Friday, September 27, 2013

J2EE vs EJB

Here come another question : what is the difference between J2EE and EJB ?.


J2EE stands for Java 2 Platform, Enterprise Edition until the name was changed to Java Platform, Enterprise Edition or Java EE in version as for EJB it means Enterprise Java Beans. EJB and J2EE are both  specifications for a server, however EJB is a part of J2EE.  For a server to run an EJB application , that server must include an EJB container. An EJB container is a program that provide a run-time necessary for running enterprise components.

Enabling archive log mode in ORACLE

Setting your Oracle 10g Database in ARCHIVELOG Mode:

1. Start your SQL *PLUS and log in with SYSDBA priveledges.

START > RUN > sqlplusw

SQL > CONNECT  username/password AS SYSDBA

2. Issue a Shutdown command

SQL > SHUTDOWN IMMEDIATE;

3. Mount yourDatabase

SQL > STARTUP MOUNT;

4. Set your database in ARCHIVELOG mode

SQL > ALTER DATABASE ARCHIVELOG;

5. Open your database

SQL > ALTER DATABASE OPEN;


6.SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled


Thursday, September 26, 2013

Emerging 4G Technology and Its Application toward Smart Home


        4G technology standing as Fourth Generation is the upcoming next generation technology which will wipe its predecessor 3G out of the surface of the world. There really is no clear definition of what 4G will be. It is generally accepted that 4G will be a super-enhanced version of 3G – i.e., an entirely packet switched network with all digital network elements and extremely high available bandwidth. For the most part, it is believed that 4G will bring true multimedia capabilities such as high-speed data access and video conferencing to the handset.    It is also envisioned that 4G systems will be deployed with software defined   radios,   allowing the equipment to be upgraded to new protocols and services via software upgrades. 4G also holds the promise of worldwide roaming using a single handheld device.  Smart home (home automation) technology was inspired when the remote control first started being introduced in houses. Popularity has increased since the turn of the twenty-first century and continues to capture the general public's interest. A smart home is any house specifically designed to accommodate the needs of the occupant(s) by means of automation. Smart homes can have advanced features such as presence detection or simple features such as voice activation or sensors.
  The definition of these two terms: 4G technology and Smart home has given us the way to observe that the applications of the 4G technology directly respond to the requirement and exigencies of smart home. Therefore let’s show how emerging 4G Technologies and Its Application lead toward Smart Home

Smart homes

A smart home is a residence equipped with technology that enhances safety of patients at home and monitors their health conditions. Worldwide, smart home initiatives are demonstrating the potential of technology to support aging. The Aware Home developed by Georgia Tech in the United States, for example,
is a project developed in two identical independent living spaces that allow for controlled experiments with technology . In Sweden, the SmartBo project explores the use of sensors, visual and tactile signaling devices, and speech synthesizers for elders with mobility impairments and cognitive disabilities. The PROSAFE project in France uses infrared sensors to identify abnormal behavior and to collect
Representative data on Alzheimer’s patients’ nocturnal and daily activity. The “HospitalWithoutWalls” in Australia is a project that includes a wireless fall monitoring system in which patients at home wear small sensors that measure
heart rate and body movement.

Emerging 4G technology



4G Applications and Their Benefits to Public Safety


One of the most notable advanced applications for 4G systems is location based services. 4G location applications would be based on visualized, virtual navigation
schemes that would support a remote database containing graphical representations of streets, buildings, and other physical characteristics of a large metropolitan area. This database could be accessed by a subscriber in a moving vehicle equipped with the appropriate wireless device, which would provide the platform on which would appear a virtual representation of the environment ahead.
For example, one would be able to see the internal layout of a building during an
Emergency rescue. This type of application is sometimes referred to as Tele geo-processing, which is a combination of Geographical Information Systems (GIS) and Global Positioning Systems (GPS) working in concert over a high-capacity wireless mobile system. Tele geo-processing over 4G networks will make it possible for the public safety community to have wireless operational functionality and specialized applications for everyday operations, as well as for crisis management. The emergence of next generation wireless technologies will enhance the effectiveness of the existing methods used by public safety. 3G technologies and beyond could possibly bring the following new features to public safety:

Virtual navigation: As described, a remote database contains the graphical representation of streets, building, and physical characteristics of a large metropolis. Blocks of this database are transmitted in rapid sequence to a vehicle,
where a rendering program permits the occupants to visualize the environment
ahead. They may also "virtually" see the internal layout of buildings to plan an emergency rescue or to plan to engage hostile elements hidden in the building.

Tele-medicine: A paramedic assisting a victim of a traffic accident in a remote location could access medical records (e.g.-rays) and establish a video conference so that a remotely based surgeon could provide “on-scene” assistance. In such a
Circumstance, the paramedic could relay the victim's vital information (recorded locally) back to the hospital in real time, for review by the surgeon.

Crisis-management applications: These arise, for example, as a result of natural disasters where the entire communications infrastructure is in disarray. In such circumstances restoring communications quickly is essential. With wideband wireless mobile communications, both limited and complete communications capabilities, including Internet and video services, could be set up in a matter of
hours. In comparison, it may take days or even weeks to re-establish communications capabilities when a wire-line network is rendered inoperable.


Limitations of 4G

Although the concept of 4G communications shows much promise, there are still limitations that must be addressed. One major limitation is operating area.
Although 2G networks are becoming more ubiquitous, there are still many areas not served. Rural areas and many buildings in metropolitan areas are not being served well by existing wireless networks. This limitation of today’s networks will carry over into future generations of wireless systems.
The hype that is being created by 3G networks is giving the general public unrealistic expectations of always on, always available, anywhere, anytime communications. The public must realize that although high-speed data communications will be delivered, it will not be equivalent to the wired Internet – at least not at first. If measures are not taken now to correct perception issues, when 3G and later 4G services are deployed, there may be a great deal of disappointment associated with the deployment of the technology, and perceptions could become negative. If this were to happen, neither 3G nor 4G may realize its full potential. Another limitation is cost. The equipment required to implement a next generation network is still very expensive. Carriers and providers have to plan carefully to make sure that expenses are kept realistic.
One technique currently being implemented in Asian networks is a Pay-Per-Use model of services. This model will be difficult to implement in the United States, where the public is used to a service-for-free model (e.g., the Internet).

Conclusion

Emerging 4G technology networks may eventually deliver on all the promises. At times, it seems that technological advances are being made on a daily basis. These advances will make high speed data/voice-over-Internet-protocol (VoIP) networks a reality. In the meantime, it is important for industry to develop a strong 3G offering that is palatable for the general public. Equally as important, industry must ensure that expectations are realistic and that services meet and exceed those expectations. If all goes according to what the industry envisions, it may be sooner, rather than later that we will see wireless communications evolve. This evolution will give the general public as well as the public safety community amazing functionality from the convenience of a single handheld device. Even though the emerging fourth generation technology and its application still present some short coming, in general we can affirm with satisfaction that its growth is going on in accordance with the requirements of smart homes.
   This expansion of the 4G technology will fulfill in a near future the smart homes dreams so dear to the research community and technology users today.

Sunday, September 22, 2013

IT Change within an organization

Every day researchers, engineers, teachers, technicians, governments and organizations are working to change things around them. Different synonyms referring to change are used such innovation, conversion, adjustment, transformation, correction, mutation, appointment, novelty , variety ,remodeling and list goes on.
  Usually people are recruited to any organization because their employer believe they will bring necessary changes to improve the organizational goals. Even though this phenomenon is common to many fields I would like to focus more on software engineering. Most often those working as IT professional and developing in-house applications will agree with me on certain points I am raising.
  The fact is that everyone will want the IT department to develop new applications for them, automate some manual tasks or add new features to existing softwares. Ok that is fine but what they forget is that the software engineer or the developer is not a magician, and that the two parties have to work together hand in hand to achieve the desired target. But what I have noticed is that in many cases the whole thing is left in the hands of the developer alone, the user no longer show any interest in the project at all or worse when the project is completed the user is reluctant to use it. This lead us ineluctably to the following question:  

Why do people resist change ?

According to James Hunt  “Resistance isn't an indication that something is wrong with what you are trying to change. It is an indication that something is happening.” 

What are the signs of resistance  ?
  1. Confusion
  2.  Immediate criticism
  3. Denial 
  4. Malicious compliance
  5. Sabotage
  6. Easy agreement
  7. Deflection (change the subject)
  8. Silence
  9. In-your-face criticism
How should we respond to resistance ?

As stated in [1] here are the guidelines for responding to resistance.
 NO. 1: Maintain clear focus
           Keep both long and short view, persevere
NO. 2: Embrace resistance
NO. 3: Respect those who resist
            Respect vs. trust
            Listen with interest
            Tell the truth
NO. 4: Relax
            Stay calm to stay engaged
            Know their intentions
NO. 5: Join with the Resistance
            Begin together
           Change the game
           Find themes and possibilities

I am stopping here and hopefully will try to continue this discussion on my next post. Next time.

Referecence:
[1] Maurer, Rick, Beyond the Wall of Resistance, Austin, Texas: Bard Press, 1996, chapter 5


 

Thursday, September 19, 2013

Control line spacing in ireport

Is it possible to control the line spacing in ireport ? Yes

I have recently come through this problem during one of project as the requirement was to have something line the following
 but what I had by defaut in ireport is


The question is How to reach my target of reducing line spacing ?

This is easily achievable in ireport (version 5.00 ) . In fact ireport offer various properties for controlling line
  spacing . If you click on a textfield and go to properites you get the following options
 line spacing has many options available :
  •  single (default)
  • 1.5
  • Double
  • At least 
  • Fixed 
  • Proportional
If you set it to fixed , you can control line spacing by entering different value in line spacing size .
For the remaining option s, you can easily test them yourself.

Note:
I assume you can insert a newline in ireport , if not here is how you can do that using \n.
As in the preceding example , we want to insert four (04) fields in a single textfield and each appearing in a newline.

$F{empName}+"\n\n"+$F{comment1}+"\n"+$F{comment2}+"\n"+$F{comment3}

Hope you find it useful.


Thursday, September 12, 2013

How to Disable and Enable the network adapter from cmd in XP

Recently I have come across this problem. With very few precise tutorial available on this, I have decided to dedicate one of my post to it.
Suppose you want to enable and disable the network adapter from the command line of windows xp.
First you need the devcon utility downloadable from here:
  • unzip the devcon.zip folder
  • you will have two folder I386 and ia64 , and one file EULA
  • copy the devcon.exe from i386 if you have a 32 bit system or  from ia64 if you have a 64 bit system.
  • Paste the devcon.exe inside C://Windows/System32/
 Secondly get the device instance ID of the NIC by:
 
  • Right click Start --->Right click computer ---> manage
  •  the manage window appears as follows , then go to Device Manager:
  • Click on Device Manager to expand it, then  at the right side click on Network adapters and right the specific adapter listed below ---> Properties:
  • Under properties ---> Details 
  •  Here the ID will be *DEV_1094*
  Finally , Now that our devcon utility is installed and the device id obtained. Let go to the command prompt ( Start ---> run (cmd) ---> Enter ).

To disable :

C: >  devcon disable *DEV_1094*

To enable :

C:> devcon enable *DEV_1094*


This process can be easily applied to other hardware devices like printer, key board, mouse and more.
Hope you find it useful.

Opening a URL in java

Do you want to launch a URL from your default browser maybe after a button is pressed.
Just attached these lines of code under the button action performed.

   import java.awt.Desktop;
   import java.net.*;
URI uri = new URI("http://moumie.org") ;
Desktop desk= Desktop.getDesktop();
desk.browse(uri);
And life goes on.

Delay execution in Java

It is indeed funny talking about delaying execution in java, but trust me this line of java code is worth mentioning.

Thread.sleep(your time in millis);
That is all.
have fun !

Saturday, September 7, 2013

Big Data, what is it ?

Few years ago a company needed only a traditional database system such as Oracle, mysql , MS Server , Sybase etc to smoothly run its business. Nowadays for the same company to remain competitive, there is a need to take into account not only employees , transactional records and others but online data, and more. All possible sources of information related to that particular company need to be analyzed properly. However our traditional data cannot easily store or manage these highly unstructured data. NoSql related databases enter into the play...
In short the following figure shows a view of Big Data within an organisation:

  
With the current trends, willing or not any company today aspiring to survive must join the dance. In general Big Data is a term used to describe the exponential growth and availability of both structured and unstructured data. While a properly analysis of these massive data may offer enterprises tremendous benefits, there are also risks of being overwhelmed. 
  • How can you use it to suit your need ?
  • How can you analyze it all ?
  • How do you store all these data ?
  • How do you extract intelligence from it ?
  • Do you have enough to professionals to handle and analyze it ?
 As stated by Scott Zucker : Small data is gone. Data is just going to get bigger and bigger and bigger, and people just have to think differently about how they manage it.

Add an internal page to Koha

Koha is one of the most commonly used open source fully automated library management system used by libraries today. Even though koha an opac interface, many librarians and user espicially would like to have a portal where all library resources and information can easily be accessed. In an attempt to offer this feature to the koha's opac many opt for attaching external link sometime referring to the library website or a standalone web page.  Leaving koha to another different page or website is odd and not effective, as it really disturbs a smooth user navigation.
   Many librarians or IT professional setting up koha find it difficult  or have either forgotten that koha offer indeed an option create internal page. With a good skills of css and html only, the OPAC can easily be converted to a web portal. Through out this post and other that will follow, I will try to share the little I know on this issue.

 1- login as the root user:
  --$ su
  Password:
 2- create the first page to be served as templates called page.pl:
  --# cp  /usr/share/koha/opac/cgi-bin/opac/opac-main.pl  /usr/share/koha/opac/cgi-bin/opac/pages.pl

 3-  Edit the newly created page.pl from your preferred text editor like gedit (debian) or leafpad (ubuntu)
  --# gedit /usr/share/koha/opac/cgi-bin/opac/pages.pl

 4- At around line 30 just before my ( $template, $borrowernumber, $cookie ) = get_template_and_user( add the following statement:
  : my $cgi = new CGI;






 5- Make this change to the code at around line 33:

    template_name   => "opac-main.tt", change to  template_name   => "pages.tt",




 6- Approximately at 56 add this code:

 my $page = "page_" . $cgi->param("p");
          $template->param(
          koha_news => $all_koha_news,
          koha_news_count => $koha_news_count,
          local_page => "" .
          C4::Context->preference($page)
          );



 7- Save page.pl and exit.

 8- Create a second page called page.tt
 --# cp /usr/share/koha/opac/htdocs/opac-tmpl/prog/en/modules/opac-main.tt  /usr/share/koha/opac/htdocs/opac-tmpl/prog/en/modules/pages.tt

 9- At approximately  line 40 make this change:
        
        Change
      [% IF ( OpacMainUserBlock ) %]<div id="opacmainuserblock" class="container">[% OpacMainUserBlock %]</div>[% END %]

       to

      [% IF ( local_page ) %]<div id="opacmainuserblock" class="container">[% local_page %]</div>[% END %]



   10- Save page.tt and exit.

   11- In system preferences in the staff client, click the button for "New Preference" under "Local Use"
  
   12-

  Fill it out as follow:

      Explanation: demo page for an internal koha page
 
      Variable: page_demo

      Value: What is up , this is my demo page.

      Click the TextArea link (or enter "TextArea" into the input field below it)
 
      variable options (last field): 100|80

  13- In a browser go to http://youraddress/cgi-bin/koha/pages.pl?p=demo
      youraddress can be localhost or 127.0.0.1

 14- To add more pages simply create a system preference where the title begins with "page_" followed by any arbitrary letters. You can add any markup you want as the value of the field. Reference the new page by changing the value of the "p" parameter in the URL.

 15- Hope it works. For any issue drop me a comment.

Monday, September 2, 2013

Mysql Reset Auto_increment

Hi, recently I have come across this small issue and would like to share it with you.
After deleting all records from the table, and inserting new rows I noticed the  primary key continue to increment from the last (old) id. Because of the foreign key constraints I could not even drop the table without extra burden.
Luckily trying the following simple sql statement easily solves the problem:

ALTER TABLE table_name AUTO_INCREMENT = initialValue

Here the initialValue can be 1 or any integer value.
Cool isn't it ?