Pages

20 December 2012

you can use the model items like ${modelitem} but you had to put the modelitm in the model prior to that, something like model.put(modelitem, "this is modelitem")

Rule of thumb when you need to manipulate data in your MVC application:
Try looking into the referenceData method in your controller, this is the main method grabbing data from resources and adding them into the model object. Look for something like:

13 December 2012

The one thing that I was really missing in Mac was the tree command line. If you are a terminal addict and a developer, you are among those with high probability of using this in linux. However, in Mac you don't have the option (it is not built-in). But there is always hope, you can follow the instructions on this post and have your tree command working.

7 December 2012

One of the hot topics of Technology world today was about Google Apps. Google is shutting down its free Apps offering for small businesses. I am using Google Apps but I didn't know if it was small business account or something else that I was using. Looking into the Google Apps website, you won't no longer see any free option from today either. So I was looking on any piece of page I can find on internet to find out what will happen to my Google Apps service. I finally found this post on google enterprise blog saying the Free Apps won't be affected. However, the link was not working at the time of posting. Later that day I got an email from Google saying:

Starting today, we're no longer accepting new sign-ups for the free version of Google Apps (the version you're currently using). Because you're already a customer, this change has no impact on your service, and you can continue to use Google Apps for free.

Reading this comforted me. I never expected Google to make a free service to become fee based and force its users to pay. It is really nice of them to let those free Apps users keep their account. Otherwise I was looking for at least 50$ a year, or most probably getting my own hosting (for double that price of course) but with many additional options.

This reminds me of the time Google bought Feedburner and somehow messed up some feedburner feeds' names. Apologizing its customers, it sent them a nice package of mouse and pen. The package was not that important but the move; showing how much they appreciate their customers.

3 December 2012

Have you ever wondered which one to choose if you want constraint(s) to be forced on data? You can achieve your goal by using Triggers or Constraints (or even both). But the questions is which one to choose, and which one is better to use? Shall one go with Constraint all the time or pick Triggers every now and then? The relief is that there is a simple answer to that. Try to use constraints if you can. Constraints are "closer" to databases. Constraint are relational restriction you are setting for your data, and if you are using a relational database it is always best to use them. As all we know databases nowadays do more than just storing data and retrieving them, they perform optimization on queries as well. Defining constraint in your database, which is a relational principle, will give another chance for your database to deal with performance issues.

26 November 2012

I do like having all the applications that can be installed in one place. It is a really nice feature to have. Whenever you want, you can go there, find your app, have your apps backed up, read others reviews and so on.
These are all good only and only if the application you are installing won't be different from what you can get out of the AppStore. Interesting right? Apple has put some guideline in place for those applications in App Store of its Mac. For example, if you install TextWrangler from AppStore you won't get the ability to use its command line tools, such as edit .bash_profile. However, if you download from their website, you will get the full application with all the perks. See what they are saying themselves.

In order to comply with Apple’s submission guidelines, the Mac App Store version of BBEdit does not support automatic installation and updating of the bbedit, bbfind, and bbdiff command-line tools (and their associated man pages). However, it is possible to install the tools without using BBEdit’s built-in installation, and once installed, they will work correctly.

BBEdit is another product of Bare Bones Software, similar to TextWrangler. To me, it is not a really nice direction Apple is heading. Asking developers to reduce their software capabilities to be accepted in AppStore is not something I am looking for. After learning that, I didn't even once clicked on the AppStore icon in the Mac, old school searching, finding the application website, and downloading directly from there was and will be what I am going to do.

16 November 2012

This is something bothering me for a long time. I was working in a project dealing with several dependencies. After some reboots I got an exclamation mark next to the java project, like this one. There are no notes or suggestions on what is going wrong. Cleaning the projects won't work either. After some research, I have figured out that this kind of problem is related to the working code, which means it is something going wrong on the build directory. Whenever you got exclamation mark error, you first better try to clean your project, if no success, try deleting the build directory and any other build related material in your project code.

15 November 2012

There is a difference between bashrc and bash_profile in different distributions of Linux. You might need to specifically find out about the distribution you are working with. Generally difference between them are as follow:

According to the bash man page, .bash_profile is executed for login shells, while .bashrc is executed for interactive non-login shells. (more)

There are several things you can do with your bash_profile and bashrc. Let us examine some of them. Let's say you want to change how the command prompt looks, you can each time set it to what you want, or better you can set it in your bash_profile and let it be. You can set something like this:

8 November 2012

Have you ever wanted to reload your bash_profile in your Linux / Unix system? You obviously don't want to restart your whole system or re-login to your system to enable your new settings like newbies. What you can do is to reload your bash_profile file using a simple syntax. You just need to use source to do that as so:

Kick off authentication process by creating a subject (if no subject passed to it will create a new one)

Subject

e.g. user, resource, system, ...

Principal

Face of subject

subject 1..* principal

-------

Passes

Create instance of LoginContext e.g. LoginContext(string, callBackHandler) [string the name, callBackHandler used for passing information back to LoginModule]

CallBackHandler (->Handle Method ->Transfers required information to LoginModule)empty subject created before authentication beginpassed to all LoginModuelsif authentication successful, populated with principals and credentialsthen subject can be get from getSubject in LoginContext

5 November 2012

Have you noticed whenever you are connecting your Microsoft Windows PC or laptop to a second monitor, there is only one task-bar and it will stay with the main display? Is it a good option or not, you can have your say. However, I believe for most developers like me, it is not a great advantage. You do not know which windows are open in which monitor. So, if you are eager to have extended task-bar for your extra monitor, I would recommend using Actual Multiple Monitors. This is not an open source program nor it is a free one, but is has many free features that you can utilize. If you find yourself so in love with the application to use all its features you can try buying it. I have tried several applications and this is one of the best I came across. My criteria was simplicity and the ability to show the window position related to the monitor its being used.

25 September 2012

One great feature in Linux is its unified place for all of your keyboard shortcuts. You can use it to set them they way you wish. I have used ctrl + down key for lowering the volume and the up key for raising it in my Linux box. However, after switching to windows, you can easily miss that option since there isn't any option like that in windows. If you want to achieve something like that, you need to install an application called 3RVX (http://matthew.malensek.net/software/). This simple (& smart) software will overtake volume control and provide you with an on-screen display as well. After that, you are able to use win-key + mouse scroll to lower and raise the volume, you can even change those key combinations.

24 September 2012

Have you ever tried to change your mouse orientation from right to left handed ? If you haven't done it, do it right now, it is challenging not only for your brain, but also for your hand :-).

If you are using a left-handed mouse with Synergy cross platforming your linux and windows box, and if the windows box is the server, you just need to reset the linux mouse setting to right handed and change the windows mouse setting only to left handed. if you have both them left-handed, your linux will become a right handed mouse. I am not sure, if it is windows that is not sending mouse orientation information, synergy or linux, but it seems like, making a left-handed mouse in linux, will exchange the right and left mouse buttons with each other. If it is sent to be a left-handed mouse (let's say from a windows box), then it will reverse the buttons in Linux resulting in a right handed mouse for you on your Linux box. However, if you are using Linux as your Synergy Server, it won't have any problems such. This is the solution I do suggest, to use Linux as your main box, why I am not having my own prescription? The only reason I used windows as a Synergy Server is because I have Linux installed on my laptop and don't want every time to attach and detach my mouse and keyboard to it.

23 August 2012

If you are trying to compare two strings in a stored procedure or trigger or ... you need to note that you have to specify the length of the strings before comparison, if you don't do that, you won't get the expected result out of your query. Also remember, it is one equal sign not two like Java.

I am not suggesting to do that, I am looking at DBs as storage for data and to me, all manipulations on data should be exercised on the logic layer of your application.

17 August 2012

Have you ever wondered how you can move to the next / previous tab when coding in Eclipse? You might find it very helpful to know that you can do that by using Ctrl + PgUp / PgDn (in windows) for moving to the next or previous tab or by clicking Ctrl + E or Ctrl + F6 for a list of tabs to pop up, then you select which one to show using arrow keys.

3 August 2012

After a while when you do coding, you become familiar with the concept of Locale. Instinctively it means something local to the user, it's definition is as described below

"These settings usually include the following display (output) format settings:

Number format setting

Character classification, case conversion settings

Date/Time format setting

String collation setting

Currency format setting

Paper size setting

Etc ...

The locale settings are about formatting output given a locale. So, the timezone information and daylight saving time are not usually part of the locale settings. Less usual, but worth mentioning, is the input format setting. This is mostly defined on a per application basis."

An operation that requires a Locale to perform its task is called locale-sensitive and uses the Locale to tailor information for the user.

24 July 2012

If you are trying to migrate from blackberry to the Android world, this article might help you. If you were heavily using notes in blackberry you find this article super useful.

Notes can be exported from blackberry to a computer using blackberry native program. After exporting them, you will see that they are stored as a msg format (the format outlook uses to store emails). Thus you need to convert it to a txt file, you can do that using msgText. However, if you are having lots of notes, task of converting each one to a text will be tiresome. What you can do is to copy the following text, save it as convert.bat file. Put the run.bat file where the msgText is, copy all notes in the same folder and run convert.bat.

convert.bat:
%%f in (*.msg) do (

call msgText "%%f"
)

You could expect txt files for each note and a folder containing a word format for each of your note. Then it's easy, you need a google drive account, upload all text files to your google drive and then install google drive application on your android.

6 July 2012

There are two different interfaces available when you are writing an EJB. One is remote and one is Local. Remote, as it name suggests is for remote client that want to remotely call (or fire) functions and get some results. On the other hand Local is designed to be used in a local environment, for example in a case if another EJB or even a POJO in your system is using that. The usage would be the same as when you want to use an EJB using its Remote interface. However, it has less headache for the server to handle that. That's the only reason you might want to use a Local interface instead of Remote interface. Local interface is not local to JVM but local like an other POJO class.

Local client view cannot be accessed:

When an EJB or web component is packaged in a different application's EAR packages.

When a web component is deployed in a web container, and EJBs are deployed in an EJB container, and these containers are separated (even if they are running on the same machine)

These are main factors in considering a Local or Remote interface:

Client: if your client is not a web component or another bean do not use Local

Beans & Beans: Are the beans loosely coupled? then it is a good idea to use Local

Scalability: Remote is always better for scalability

Local interfaces are recommended for entity beans, which helps with performance issue.

27 June 2012

Last year, I was part of Google IO. This year however, 3 days was not feasible for me. It was a fun event, with many talented people from all over the world attending it. Last year, Google handed out Samsung Tab 10.1 and Chromebooks for free. This year I believe there is going to be a 7 inch Nexus tablet from Google and Asus for sure. Not sure, if there is going to be any more handouts or not. Although, I have attended IO last year, I have found myself watching videos of other events on my own time on YouTube. This time I have decided to do that for all sessions, starting with keynote.

4 June 2012

Venus is going to pass in front of the sun tomorrow. If you are in North America, you are among the most lucky ones to observe this happening. The next happening is in the next century, so you better look out to the sun (not directly) and see a black dot passing in front of it, that's Venus. It began roughly around 5pm EST and 2pm PST. For more detail information please visit the following:

31 May 2012

This is pretty awesome. If you have not upgraded to timeline and share the fear of being upgraded without your permission, watch this video. You share the same symptoms with this people, suggestion: instead of timeline get reallife. Enjoy!

It took me some time to figure this out, you have to have sequenceName in your SequenceGenrator annotation. It might work without it, and might as well give you sequence does not exit problem. The later case in which it is hard to trace what happened.

To make sure you have enough privileges on your sequence in oracle, you can test getting next generated value by using the following command in oracle: