Sunday, December 28, 2014

qt fatal error qdialog no such file or directory #include

In the process of compiling your cpp file in linux under QT 5 or more you may receive such  a weird fatal error message. If you are wondering where and how to start solving it here is the solution for you. Just go to your projectFile.pro and add the following on the top (before headers):
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

Special credit goes to AB Bolim stackoverflow

Hope you enjoy it

Rename a file in linux

So you have forgotten or are just a newbee looking for how to rename a file in linux, these two tricks are for you:
  1.  Using mv command: yourdir$ mv oldname newname
  2. Using copy and delete: 
  • copy old file to new file with cp command: yourdir$ cp oldname newname
  • delete old file with rm command: yourdir$ rm odname

Saturday, December 20, 2014

Intrexx : transfer a parameter from one page to another using javascript

Hi, there are many ways to transfer paramters from between pages in Intrexx. This method I am going to present here is one them. I am not intending to write a complete solution with details but rather to point out some directives.

Javascript:


Page A:

- Dropdown list: value(Yes, NO)

- Button (onClick event: paramTransfer(this) )

Page B:
static text and select the option Only default language (such as for programming purposes).
[ $Request.get("rq_KNr") ]

More info regarding this topic can be found in documentations at united planet academy
Hope it helps and do not forget to drop a comment.

Tuesday, December 9, 2014

Distributed database vs Distributed DBMS

Distributed database: a collection of multiple, logically interrelated databases distributed over a computer network.
However,
Distributed DBMS: the software system that permits the management of the distributed database and makes the distribution transparent to the users.

Monday, December 8, 2014

Session in javascript across pages.


 Some days back I had to implement a small feature in one of our company application. Had to think a while on how I could achieve that. Finally I end up solving the issue by smartly using Ajax and global variables. My intention here is not to give you code (at least you request it) but rather to present some ways around on solving such a matter. Taking the following point into consideration may help you dilute the situation:

  1.  Ajax: Asynchronous JavaScript and XML. AJAX is the art of exchanging data with a server, and updating parts of a web page - without reloading the whole page.
  2. Global variables
  3. The localStorage Object: The localStorage object stores the data with no expiration date. The data will not be deleted when the browser is closed, and will be available the next day, week, or year. e.g
  4. The sessionStorage Object: The sessionStorage object is equal to the localStorage object, except that it stores the data for only one session. The data is deleted when the user closes the browser window. e.ghttp://www.w3schools.com/html/html5_webstorage.asp

Feel free to share your experience or feedback with us.

GUID vs INTEGER as data type of the Primary key in INTREXX

In this short post I would like to point out few differences between the use of Guid and Integer as a data type of  the primary key when creating a new data group.
  • Guid is treated as a string and Integer as it is.
  • Guid  has a larger range than Integer.
  • When creating a new row for example, to get the current primary key maybe in groovy you need newGuid() (for Guid) while you will need to make a query : select max(id) from dgroup (for Integer)
  That is just what I have in mind now, please feel free to drop a comment and share your thoughts on this with us.
 

Wednesday, November 19, 2014

de.uplanet.jdbc.StandardDbException: Error: -1, SQLState: 42x01: syntaxfehler: Encountered "("

If you are reading this post, certainly you are using INTREXX. I will not give you a direct answer but rather some clues that will help you to find the errors.
  1.  Take a break and drink a glass of water because there is a silly mistake in your code
  2.  Have you changed your data group ? 
  3. Recheck carefully all data types with the references, if possible rewrite your query
  4. Check your punctuations: comma, semicolons...
  5. Make sure you have the right syntax for your query operation

Feel free o drop a comment sharing with us your experience with this error. If it persists feel free to knock me.

Monday, November 17, 2014

Regular expression for the file name without extension in Groovy

Are you willing to get rid on the file extension in groovy, but don't know how to do that ? This post is for you. If you are a programmer, you will not certainly want to read many useless lines before getting what you.
This line is for you:

file.name.replaceFirst(~/\.[^\.]+$/, '')
 
All credits go to Nikita 

Namaste

Friday, October 10, 2014

Qt error: invalid use of incomplete type and forward declaration

You may get this error by one means or other, in my case I found it while trying to implement the dialogbox example in the book C ++ GUI Programming with Qt 4 by Jasmin Blanchette and Mark Summerfield.
I got nearly 51 errors after I ran it in my Qt Creator 5.3 IDE. The solution is just to replace the finddialog.cpp:

#include <QtGui>  

by

#include <QtWidgets>

clean , rebuild and run it again and have fun !!!

Thursday, October 9, 2014

Qt Creator view menu : enable or disable

Crafting a UI in Qt is cool but sometimes it appears that the design tool sets just vanish. On Windows --> Views , view is disabled and here comes the trouble. You just have to go to the Mode Selector on left hand side and click on Debug or Design Mode for View to become active. When you are on Edit Mode, the view becomes inactive. Hopefully that you have got the idea...

Thursday, September 25, 2014

Interface Vs Abstract class

Either preparing an exam or an interview this is a must know. Be aware and don't be the next victim. As stated in wikipedia. Starting with Java 8 default and static methods may have implementation in the interface definition. Interfaces cannot be instantiated, but rather are implemented. A class that implements an interface must implement all of the methods described in the interface, or be an abstract class.
           However an Abstract class is a class that represents a generalization and provides functionality but is only intended to be extended and instantiated. Without going too far into unecessary theories, I would like to share with you this  comprehensive comparison that I found on DURGA SOFT
INTERFACE ABSTRACT CLASS
If we have the requirement specification and we don't know anything about the implementation In case of partial implementation, here we are talking about the implementation but not completely
Inside interface every method is always public and abstract whether we are declaring or not. Hence interface is also considered as 100% pure abstract class Every methods present in abstract class need not to be public or abstract. In addition to abstract methods we can take concrete methods also.
We cannot declare interface methods with the following modifiers: private, protected, final, static, synchronized, native, strictfp There are no restriction on abstract class method modifiers
Variables are always public, static and final whether we are declaring or not. Variables need not to be public, final and static
Variables cannot be declared with the following modifiers: private, protected, volatile, transient No restrictions on abstract class variables modifiers
Variables must be initialized at declaration otherwise compile time error Variables initialization not required at declaration time
Not possible to declare instance and static blocks otherwise compile time error Instance and static blocks allowed
No constructors allowed Constructor declaration allowed and to be executed during child objects creation

About Polymorphism

One of the key aspect of OOPs is ineluctably  the Polymorphism. What is it ? How is it implemented ?
the phenomenon where the same message sent to two different objects produces two different set of actions. Polymorphism is generally divided into two parts:
  • Static polymorphism : .An entity existing in different physical forms simultaneously. Here the response to message is decided on compile-time. E.g: Overloading (methods, operator). Method overloading  creates a new method with the same name and different signature. It uses early binding.
  • Dynamic polymorphism : An entity changing its form depending on the circumstances. Here  the response to message is decided on run-time. E.g: Overriding (methods). Method overriding  is the process of giving a new definition for an existing method in its derived class. A class that declares or inherits a virtual function is called a polymorphic class.
This post is intended to be a discussion topic, feel free to drop your comment...

Classes defined with struct and union in C++

When it comes to C++ everything is pushed beyond limits, and so it the case of a class defined with struct or union keyword. But the point I would like to share with you on this post is the key difference involved.
            The concepts of class and data structure are so similar that both keywords (struct and class) can be used in C++ to declare classes (i.e. structs can also have function members in C++, not only data members). The only difference between both is that members of classes declared with the keyword struct have public access by default, while members of classes declared with the keyword class have private access. For all other purposes both keywords are equivalent.
    In a similar fashion, the concept of unions is different from that of classes declared with struct and class, since unions only store one data member at a time, but nevertheless they are also classes and can thus also hold function members. The default access in union classes is public.
Credit : Juan Soulie

Wednesday, September 24, 2014

Difference between an array and dymanic memory pointer in C++

It is known to all that the least thing any programmer would like to deal with is dealing with Pointers. May Java be blessed !
Suppose I have two declarations:

1)  int array[10] //an array of 10 integer elements

2) int  *pArray ;
    pArray = new int [10];

The major difference is that for the normal array (1) , the size of the array is constant and has to be decided before the execution. However the dynamic memory allocation (2) give you more flexibity by allowing you to assign memory during the execution of the program (runtime) using any variable or constant value as its size.

 How to access elements from our declaration:
  array[2] // accessing the third element
  pArray[2] or  *(pArray+2)  // accessing the third element ....

Tuesday, April 8, 2014

How to turn on or off IIS on windows 7 or windows 8 ?

note: IIS stands for Internet Information Services...
Sometimes troubleshooting some issues with ports or others may require that you make sure your IIS is down or up as it is using by default the port 80. Even though there are many ways to do this I found this one particularly easier and decided to share it with you.

1. Simultaneously press Win + R keys and the Run dialog window pop up
           or
 type run in the lower bottom left textfield (prompting Search programs and files) under All Programs


2.  type: appwiz.cpl and Click OK

  
3. On the top left: click on Turn Windows features on or off
  
4.  Then finally you are there . Most obviously the second branch below Games will be Internet Information Services. You can turn it on or off by just filling or clearing the box...

You are now free to proceed accordingly depending of what you want to do. Stay blessed!


#1045 - Access denied for user 'root'@'localhost' (using password: NO) Solved

Here come another crazy issue intended to waste our time uselessly.
After changing the root password from the phpMyAdmin under Privileges I started getting this disgusting error page. Definitely you may suspect your mysql config or apache config file. Unfortunately the problem reside elsewhere as you are going to see.

solution:

Goto--->xampp--->phpMyAdmin folder:
Here open the file: config.inc.php
and edit as follows from around line 18 to 22 :





Change it to:
Refresh it and You are done !

Apache (xampp) not starting on windows 7

Hi, I just pass another dirty 30 minutes trying to sort out this issue. Without this nonsense of Microsoft stopping the support of XP,  I would have never been there even .
 I installed a new version of windows 7 and also installed a latest version of xampp successfully. When I start apache later it couldn't start. Usually this problem is often caused by the port 80 being busy because of Skype, IIS, etc. However I don't have skype installed on my PC yet, even IIS is not running , I even when further in the CMD listing port with > netstat -aon  still no mention of port 80.
 I started realizing that I am dumped this time again my dear Microsoft black box OS (smile).

Solution:

I finally get it started by right clicking the Xampp Control Panel icon on the desktop and  
Run as administrator and boooooommmmmmmm it just fires like a charm. This may not be a standard solution but help you work around. We never make it till some times we fake it. That said stay tuned and don't forget to drop a comment....

Friday, March 28, 2014

hide a component in jsf

Sometimes it happens that you want to hide some of your components so that they become invisible to users.
And you may suddenly wonder how to achieve that or which option to use. Fine, JSF makes it pretty easy for you to do that by using the rendered  option which is a boolean with either true or false.
e.g:

this component will become invisible. 

Monday, March 24, 2014

Change Orientation of an android emulator.

 Changing the orientation of your device to test your app is very essential for guaranteeing the user friendliness of your app. With a real device in your hand you just have to turn it up and down from portrait to landscape and  etc... without any issue.   But can you do the same thing when using an emulator ? 

    Just press CTRL + F11 or CTRL + F12 and discover it yourself.

           Contrary to what you may have thought before, it appears now to be pretty easy. I have tested this on windows and hopefully it will work on other OS as well, but If you do face any trouble or have a better way to handle this please as usual don't hesitate to drop a line of comment. 

 That said, stay tuned and have a nice coding day !

Setting SD Card File on your android emulator

Developing apps involving taking some photos from the camera requires the use of  SD card, but how do you set it up. Do you need to rush to the nearby hardware store to get an SD card ? Of course not, the solution just lies on few mouse clicks.
 How to set up a virtual SD card in your eclipse IDE ?  If you are using the ADT bundle you are lucky this post will likely help you out.

1. Go to SDK/tools directory :
    make sure that you have the mksdcard utility available else download SDK manager.

2. Go to the cmd and locate the mksdcard directory and your own sd card called mysdcard:
   
C:\adt-bundle-windows-x86-20130917\sdk\tools>  mksdcard.exe 62M mysdcard
   Press Enter and it is done.
 62M represents the size of your sd card file.

3. Go to the Android Virtual Device manager:

Windows --> Android Virtual Device manager

4.  Select the device and Edit:

5. Make sure you change the back camera option  to Emulated or Webcam()

6. Under SD Card:
    select the File option and browse to the location of mysdcard and select it.
  Click Ok.

7. Rebuild your project , run it and have fun

Due to the lack of time I could not provide you with screenshots but trust me I will insert them next time. If you face any problem, please don't hesitate to drop a comment.
 Aurevoir !!!

Thursday, March 20, 2014

This text field does not specify an inputType or a hint

You a scenario like the following where the text field is showing  the above warning

You omitted to declare the type of your text field.
e.g: if you are  going to enter text ,
then

And it becomes:
Done !

hardcoded string should use @string resource

Even though you can proceed without any major problem the principle of clean code recall us to get rid of all warnings at every steps. Now , suppose you have the following snippet:

Due to the following line :

[I18Nhardcoded string "Country" should use @string resource

Solution:

You have to go to your res folder and there will be a strings.xml file under values, then add the line below:


Then now under your main.xml  replace the existing textView with

Done !

Saturday, March 15, 2014

What is NoSql ?

No matter who you are I am sure that is has already happened one day you ask yourself this question: What is nosql ?  Asking many people out there  what they know about nosql, many of them will mention mostly one of the following terms: cassandra, mongoDb, couchDb, Hbase , something related to big data , to name only these few.
   In fact nosql does not mean that SQL is forbidden or that we should never use it rather nosql raises our attention to the fact that for certain problems other storage solutions are well suited. Therefore finish the era of one fit all, where for any problem at hand we had to automatically use a given version of sql database (mysql, oracle, sql server, etc...). In order to simplify our understanding some key points are going to  guide us and they are:

--Basic definitions:
 NOSQL is NOT ONLY SQL 
 NOSQL is not NO SQL
 NOSQL = next generation of databases
 NOSQL = modern web-scales databases
A NoSQL database provides a mechanism for storage and retrieval of data that is modeled in means other than the tabular relations used in relational databases

-- Why NOSQL is used today ?
 -Size: unprecedented data growth
-Connectedness
-Semi-structure
-Architecture

-- Four (04) emerging NOSQL categories:
-Key-value
-Graph DB
-BigTable
-Document

a) Key-value:
   e.g: -Dynamo
          -Voldemort
          -Riak
         
b) Big Table:
  e.g: -HBase
         -Hyper Table
         -Cassandra
c) Document database:
   e.g: -CouchDB
          -MongoDB
          -IBM lotus

d) Graph database:
   e.g: -Neo4j
          -AllegroGraph
          -Sones graphDB
          -InfoGrid

--NoSQL is not  traditional database, how do I query it ?
  
1. RESTful interfaces using HTTP as an access API
2. Query languages other than SQL:
   - GQL: Google table
   -SPARQL: Semantic web
   -Gremlin: graph traversal language
3.Query APIs
  -Google BigTable datastore API
  -The Noo4j traversal API

--Who is successfully using NoSql ?
  -Facebook
  -Google
  -Yahoo
  -Twitter
  -GitHub
  -Linkedin
  - Maybe you who is reading this post right now (LOL !)

Coming to the end of this post, let me reaffirm again that I am not an expert on nosql but throughout this post I personally wanted to share with you my humble understanding of this promising technology that within a very short period has shown us what it is up to. In a case you have something too to share with us, please don't hesitate to drop a comment. If you are planning to get started with using Nosql I am sure that after reading this post nothing will be like before anymore and that you will confidently move on with your investigations on NoSql.

references:
1. http://www.slideshare.net/thobe/nosql-for-dummies
2. http://en.wikipedia.org/wiki/NoSQL


Thursday, March 6, 2014

Production tips#7 : Password Change in Glassfish SOLVED

Changing password in Glassfish Server can be strange sometime especially everything you do seems not to work. In this example I will focus on the case of Glassfish Server 3.0 or 3+ . I haven't yet tested on other versions. Before throwing some commands against the asadmin shell there are some important things that you need to know or at least be aware of.

  • change-admin-password : to change the admin password for the console login, in many documents out there the defaults of this user are:
 username: admin
 password: adminadmin

 However I have noticed that for Glassfish 3.0 when the installation has been done accepting all the defaults,

 the default credentials of this user are instead:

username: anonymous
password: empty 

  • change-master-password: to change the master password for controlling the DAS and IKS for more info on this read this article.
Now coming back to our aim of changing the admin password for a specific domain :

 asadmin> start-domain mydomain
asadmin> change-admin-password --port 4848 --user anonymous
  here port = your admin console page port.
 You are then prompt for a password:
  Enter admin password> just press[Enter] for accepting an empty password.
  Enter new admin password> your password
  Enter new admin password again> your password
 asadmin> stop-domain mydomain
 asadmin> start-domain mydomain

 Just access your admin console url like http:localhost:4848
  username: anonymous
 password: your password.

Congratulation you just did it ! If you still face any problems drop a comment I will come to your rescue. Don't forget to give us your feedback....




Wednesday, March 5, 2014

Production tips#6 : What do you know about Glassfish Configuration files ?

This time I would like to hear about what you really know about all these glassfish server configuration files.
To help you I'm listing them:
  1. asenv.conf
  2. asadminenv.conf
  3. domain.xml
  4. jbi.xml
  5. resources.xml
  6. server.policy
  7. sun.acc.xml
  8. webservices.xml
  9. wss-client-config.xml
 You usually make changes to these file either through the comnand-line utility or the admin console depending of your preferences, and at the end you have to restart the server for the change to take effects.

 

Thursday, February 27, 2014

PDF not working in Greenstone

If some of your PDF files cannot be built on greenstone, then they are some ways that you may use to solve your problem

1. Install the pdb-box plugin, for Greenstone 2.85 please have a look here
2. Convert your PDF to a lower version 1.5 or 1.4. Have a look here on how to proceed.

If you still have a problem or has found a better solution please drop a comment.

pdf-box plugin for greestone 2.85

I have noticed that they are many version of pdf-box plugin available out there. If by mistake you install a wrong one your Librarian Interface may fail to start. If you have greenstone 2.85 installed , you can try the plugin available in the following link. At least at the time of writing of this post, it was working properly.
I you have any further problem, knock me and will happy to help.

Note: You should put the extracted pdf-box in the ...\Greenstone\ext and restart the server.

Now that you've installed the PDFBox extension, this will be available as an option in the plugin's configuration dialog. To turn on the PDFBox extension for any collection you open in GLI, you would go to the Design panel, select Document Plugins from the left and on the right, double click the PDFPlugin (alternatively, select this plugin and click the <Configure Plugin...> below) to open the dialog to configure this plugin. In the Configure Plugin... dialog, scroll down to the section AutoLoadConverters and select the checkbox next to the pdfbox_conversion option. Click OK to close the dialog, switch to the Create panel and rebuild your collection. This time, PDF files will be processed by PDFBox which will extract their text.
Try this feature out on a collection of recent PDF files, by configuring its PDFPlugin with the pdfbox_conversion option turned on.

Wednesday, February 26, 2014

Change PDF version : Converting a PDF from one version to another

Are you having hard time trying to convert your PDF file from one version to another ? It is a common scenario with some software not accepting the latest version of PDF. I faced a similar probelm working a Greenstone library software which could only process at most the version 1.4.
No matter what you are going through this post is going help you move on with your task.

1. Download PDFCreator, don't panic as far as I know it is free.
    Jsut install it and it is straight forward.

2. Check the version of your PDF version
    Open the file with a pdf reader like acrobat ---> File --->Properties.
 
As you can see the version of this file is 1.6, so we have to convert it to lower one. 

3.  Launch PDFCreator:
   You will have the following small interface.
Click on Add and brwose to the file location. and you will get a pop window
4. Wait for 1 to 2 minutes you will get another windows
5. Click on Options :
 The button at the bottom center. And follow.

6. Click on Format:
 At the left side you see format, under click PDF.
Then at the right side set the Default settings (Ebook for my case),
Under compatibility choose your desired version (In my case i chose Adobe Acrobat 5 (PDF 1.4)).
Click on save and wait for a while. Your converted pdf will pop up.
Just save it and enjoy.
 Sorry for being long, I will try to come up with another short and better way on the matter in another post, till then stay tuned.
Aurevoir !!!!!!!

Tuesday, February 25, 2014

Production tips#5 : Glassfish Master Password

What is the master master password often referred to in Glassfish ? In this post I sharing with you some of the basic points regard the master password that can help you to administer your server confidently.

The master password is a password that is used to encrypt the DAS or Domain Administration Server and the instances keystores (IKS). The DAS and IKS used it to open instances at startup.
Another point worth mentioning is that the master password is not transmitted over the network nor is it used for authentication.
It is saved for the DAS and all the  instances in the domain. Contrary to what you may have in mind, the default master password is 'changeit' and not 'adminadmin'
For each domain like domain1 is it located inside  C:\glassfishv3\glassfish\domains\domain1
cmd: asadmin> create-domain  --savemasterpassword domain1

Start a domain:
asadmin> start-domain domain1

stop a domain:
asadmin> stop-domain domain1

You will have noticed that you are not prompted to enter the master password when it is starting the DAS just because it has been saved.

Change master password for a domain:
asadmin> change-master-password --savemasterpassword domain1

Delete a domain:
asadmin> delete-domain domain1


Monday, February 24, 2014

Production tips#4 : Create a secured domain in Glassfish console and assign it to the GUI in netbeans

What is really the issue here ?
Suppose you want to have your Netbeans IDE and an embedded Glassfish server GF attached to it. By default the web administration console page is not password protected. If you go directely to the web admin console page and change the admin password and hope it to work chances are that you will disappoint yourself. 
If that is the case then what to do ?
1. Go to the command prompt and navigate into the C:\glassfishv3\glassfish\bin.
   Clik on asadmin.bak
    or cd C:\glassfishv3\glassfish\bin
C:\glassfishv3\glassfish\bin> asadmin [ENTER]
asadmin > create-domain --adminport 5555--savemasterpassword domain3
 Follow the shell instruction it is interactive but enter your admin username, admin password and master password (at least 6 characters )
2. Assign the domain we just created to GUI so that we don't need to use the command line or asadmin shell  every time for the server administration.
 Go to Netbeans --> Services -->Servers :
        Right click Servers and Add a Glassfish server
 
Click Next  -->Next  and you are here
 Specify the same domain name you created previously : domain3
 
Finish and Restart you IDE, you can now visit the admin web console page by just right clicking the server name and click View Domain Admin Console  like here below
 Congratulation you just did it, feel to comment ...

Production tips#3 : Could not connect to admin listener for Glassfish Server ...Verify that NetBeans can make outbound connections to localhost:4848

How did I even get into this ?
Initially as part of security policy that consist of regularly changing the port of the application, I change the port information under the domain.xml situated in C:\glassfishv3\glassfish\domains\domain1\config. When I launch my application I received the following error message:

Before going to the solution there some points that are worth to be mentioned.

Inside the C:\glassfishv3\glassfish\domains\domain1\config, there is a replicate of domain.xml that I believe to the compiled file resulted from  the domain.xml each time you start the server. That file is domain.xml.bak .  Any change you make in domain.xml should be reflected in that bak file for it to be effective.
 However other solution have been suggested so far but none of them work in my situation.

Solution:

 If you have your glassfish embedded with netbeans, then just stop the glassfish server and restart netbeans .
 After restarting you should be able move on without any problem. Congratulation if you have succeeded otherwise throw some comment and I will assist you.

Saturday, February 22, 2014

Children Psychology in Education

Hi, as part of the requirement engineering analysis for a project on designing an android app to improve learning capabilities of kids, I have done the following observations. In fact to build an application for children it is very important for a system analyst or a developer to know how children think, how children behave, how children learn or in fact what is going on in their small brain : the kid psychology.
  You will definitely be overwhelmed reading this post, you will be surprised. This small people that you usually think you know are different, they have their own world apart. Of course the following points are not exhaustive.

  •   They like games.
  •   They like cartoons.
  •   Kids are curious. They often want to make sense out of things, and find out how things work.
  •   Kids like to be given a lot of freedom to learn in their own way.
  •   Visuals are crucial for young children and their learning process.
  •   Children learn to concentrate by doing things that interest them.  If an activity is too challenging for them, children either may choose not to participate or may stay with the activity only for a short time.
  •   They are great imitators, kids like trying what they see other people doing around them.
  •   A kid doesn’t not merely observe the world around him, but tastes it, touches it, hefts it, bends it, breaks it
  •   They are not afraid of making mistakes, nor do they shut themselves off from the strange, confused, complicated world around them. Kids play with snakes.
  •   They can also keep going for great lengths of time when they are involved in something important. If you take them away, they start screaming or say P-L-E-A-S-E.
The same goes for teachers or guardians who are expected to have certain special conducts while teaching children. Here are some important instructions for them to observe:

  •   Always encourage the children, and never point out a "mistake" in their drawing.
  •  Always have a sense of fun. A smile means a lot for children.
  •   As teachers it is recommend to support children in developing concentration for activities of their choosing (by providing ample time for them to choose each day). At the same time, we should encourage kids to experiment and stay with activities that challenge skills they are not comfortable with.
  •  Children’s moods also have an effect on their ability to focus. If a child comes to school upset, tired, or overly excited, he may be too distracted to concentrate on an activity, particularly a new or challenging one.
  •   Children need frequent breaks from academic work to keep their attention focused.
  •   When teaching them, we must relate new information to previous knowledge.
Tell us what you think, your experience with children !

Thursday, February 20, 2014

Production tips#2 : Glassfish Server cannot start. Port is occupied

Ports management is another key point to be taken serious especially when you deploying many application scattered over different domains, this in addition to your utilities software running in your PC. To come back to our concern :
 Then after getting this warning window popping up repeatedly what to do ?
 You need to know the port creating problem.
 In the case you are using glassfish with netbeans, right clicking the server will show you some useful information regarding the port.
Else you may go to your domain.xml file    under    C:\glassfishv3\glassfish\domains\domain1\config  to see the         <network-listeners> (around line 190) ports :

After your port is known , go to the command line or DOS. (CMD) and check the process id.

cmd> netastat -aon


     
kill the process. Here for port 8080 the pid=1988

cmd> taskkill /f /pid 1988

Finally it is done. Run your server now and enjoy !!

Production tips#1 : Glassfish admin page not loading

Running a random web application on test in one thing but when on production a new consistent mind set is needed. In  line with this principle I starting today a series of production tips that I hope will be useful to someone out there. That said, today I am going to talk about the importance of making your Glassfish server independent . What do I mean by independent ?
Yes, you don't have to depend on any online repository on internet in order to start your server.
Yes, you don't need any automatic update as it may cause more damage that good.
Yes, you need to have a total control of your server, by deciding what to update.
Yes , ...etc

When your server is dependent you will need to be connected to the internet in order to log in in your admin panel. Even when you are connected and your internet slow, you still need to waste sometimes before getting access. The reason is that the admin web application loads the available module updates from java.net during the log-in. Worse if the java.net server is down you are almost dead !

What to do:

  1. Disable Automatic Update Checks
    Rename $GLASSFISH_INST/glassfish/modules/console-updatecenter-plugin.jar to console-updatecenter-plugin.jar.disabled
  2. Disable News and other Internet-Dependent Admin GUI Features
    Set the following System Property (you can do that in the Admin GUI -provided that you can open it- in Configuration > JVM Settings > JVM Options > Add JVM Option : to get an empty textfield entry.
    -Dcom.sun.enterprise.tools.admingui.NO_NETWORK=true

Now restart your server (but if GF is embedded with an IDE like netbeans restart netbeans instead)and enjoy it. Special thank goes to Mike for his inspiring Idea. If you have anything to share regarding this article please feel free to drop a comment.

Wednesday, February 19, 2014

Cannot find login page in drupal

A time comes when you are completely log out of your drupal site, in fact you are sent out of your own home. But how can you get the login page ? How can you get back the control of your site ?
If you are new to drupal, please just cool down Drupal has a made it easy for you.
For all Drupal sites you can have acces to the login page by just suffixing your url with a /user.
www.yourURL.com/?q=user

So final I hope you are back into your home, so is Drupal really rocking ?

Insert data from Excel to Oracle in Java

It is tutorial I would show you how you can easily load your data from an excel file to Oracle in Java.

Database: Oracle 10g
Excel: 97-2003 (.xls)
Oracle Driver: ojdbc14 from here or here
Poi jar: from here or here  (for this tutorial I use version 3.8)
IDE: netbeans 7.1.1

I suppose that you know how to create a java project and add libraries to a project .

1. Create a java Project and add ojdbc14 and poi jars to it.
  After adding jars under project properties you will have something like this under project lib folder.

2. Create a table called STUDENTS.


 

CREATE TABLE students
   ( id varchar2(5) PRIMARY KEY,
     stname varchar2(50),
     country varchar2(30),
     types varchar2 (2)
   )

  
3. Prepare your excel file  and make sure you have saved it as a 1997-2003 (.XLS) file
  
4. Here is your code



public static void main( String [] args ) throws ClassNotFoundException, InstantiationException, SQLException, IllegalAccessException {

    String fileName="C:\\book\\list.xls";
    Vector dataHolder=xlsReader(fileName);
    printCellDataToConsole(dataHolder);
   }
   public static Vector xlsReader(String fileName)
   {
   
     Vector cellVectorHolder = new Vector(); //Vector definition

    try{
   
    FileInputStream myInput = new FileInputStream(fileName); //stream creation
    POIFSFileSystem file = new POIFSFileSystem(myInput); //POIFSFileSystem Object
    HSSFWorkbook workBook = new HSSFWorkbook(file);
    HSSFSheet mySheet = workBook.getSheetAt(0);  //getting the first sheet from the WorkBook
    Iterator rowIter = mySheet.rowIterator(); //cells iterator

      while(rowIter.hasNext()){
          HSSFRow row = (HSSFRow) rowIter.next();
          Iterator cellIter = row.cellIterator();
          Vector cellStoreVector=new Vector();
          while(cellIter.hasNext()){
              HSSFCell cell = (HSSFCell) cellIter.next();
              cellStoreVector.addElement(cell);
          }
          cellVectorHolder.addElement(cellStoreVector);
      }
      
    }catch (Exception e){e.printStackTrace(); }
    return cellVectorHolder;
  }

  private static void printCellDataToConsole(Vector dataHolder) throws ClassNotFoundException, InstantiationException, SQLException, IllegalAccessException 
  {
     
    String id="";
    String name="";
    String country="";
    String type="";
    
    for (int i=0;i
 
5.Finally run your project, Yep ! You  made it, Congratulations !!!
 If you face any problem along then don't hesitate to drop a comment.