Resize the bunch of pictures with Ubuntu

I was trying to create the photo gallery for my web site. So I had the folder with 87 pictures and the goal was to make the pictures smaller and add watermark on them to protect because these photos was shoot by myself.
I used imagemagic for these purposes.
sudo apt-get install imagemagic
You can use straight away, just go to your folder with photos (don’t forget to make a reserved copy) and type
mogrify -resize 75% *.jpg
It will make all photos that match expression to be resized to 75% of the initial size.
Then we need to add watermark.
mogrify -font /usr/share/fonts/truetype/msttcorefonts/Arial_Black.ttf pointsize 22 -verbose -draw "gravity south fill black text 0,33 'Australian Head Hunters Association' " *.jpg

And that’s how it’s done =)

Database transfering

Last night was hard for me. I finished my project and before I went to bed I decided to transfer my project and database to the server. Deployment of the web application was easy as 1-2-3. However, found some problems with MySQL (now I think that happened due to lack of sleep). The goal was to copy the structure of the tables with the existent data. So I dumped the database like “mysqldump –user yury –password=*** eventseeker > dump.sql;” But I always got a problem during importing of the database on the server. After one hour of fight I realized that in my dump I had a line that creates the database eventseeker with the tables in it while g00dspeed gave me database with the name ‘yury’… it’s a bad feeling when you think that you kill your sleeping time :D
Some other news: I skipped the advanced database practice but in my project I use INNER JOIN so still I covered this material!
And at last, now I think that glassfish can’t surprise me with functionality and I want something bigger. Will have a look on commercial version or probably WebSphere or JBoss. Jboos seems fully featured… interesting.

I’ve finished my project… feels great. Got a lot of knowledge from it in JavaEE and I hope I will refine it soon. Question remain how do I access EJB in the JSP? Will try to use the same way that I did with Java Beans but looks like I failed because of database connectivity problems and not because of wrong methods. Any way feel much more confident in it.

Gradient with HTML5!

Hello folks,

A couple of days ago I came up with one dilemma: I asked myself how can I put a gradient on the page with HTML and CSS. The only solution that I found is to use gradient pattern (say 1px line witch present the actual gradient) and simply clone it with a CSS.
But I found today other good solution with HTML5.

The code in HTML is very simple:

Basically it is a normal rectangle.

Then you need to write the following javascript.

var d_canvas = document.getElementById(“d”);
var context = d_canvas.getContext(“2d”);
var my_gradient = context.createLinearGradient(0, 0, 300, 0);
my_gradient.addColorStop(0, “black”);
my_gradient.addColorStop(1, “white”);
context.fillStyle = my_gradient;
context.fillRect(0, 0, 300, 225);
What we’ve done is got the picture by id, assign the parameters and returned it back as a gradient.
I hope that was helpful, for more information check the website diveintohtml5.org, I’ve found it quite helpful and descriptive!

HOSTING!

Thanks to my friend from Ukraine, now I have a GlassfishV3 hosting! The website is going to be http://www.g00dspeed.org.ua:4848/. Unfortunately, I’ve found that UTS web server blocks ports so I can’t access the web site from the uni. Probably I should use my own laptop and broadband to present it. Anyway, quite happy with that!

New wireframe tool

I have a bad news for you the mocking bird finished beta testing and now you allowed to have only one project with 10 pages for free but for the rest you need to pay.

So I’ve spent a couple of hours looking such topics like “500 free tools for user design” etc. No I want to try Cacoo. As the official web site said, this tool is free and video showed that it’s quite convenient. I will post my experience some time later.

Looking for wireframe

Yesterdays lecture I saw the video demonstration for Balsamiq Mockups and was really impressed. So I tried to find any good wireframe tool for my assignment. Two criteria: Linux and FREE.

After some search was really upset because lots of web sites tries to promote Napkin feel&look but instead this program only gives the look of the mockups to the programs and windows. So for me it’s useless.

However, I found Mockingbird. It’s a web based tool for your mockups. Easy to use, free, with the ability to share with others simply by providing the link, saves as a PDF or PNG. I like the sticky edges, makes easier to create design. Must have tool!

Couple of issues for me are: not configurable interface and I found not that comfortable so scroll through all widgets (thanks for search and categories, without them it will be useless), inability to upload a picture and use it say for background.

The rest is fine! Check it!

Some findings for DMT

I’d like to share some recent facts about my self-improvement and DMT project. The best way is to split all news into different paragraphs: what I’ve learned and issues in NetBeans.

What I’ve learned

I ‘ve learned how to implement EJB3 in my project. Let’s start from the beginning: the are 3 types of the EJB: Session Bean (Stateful, Stateless) which is used for business logic and state maintenance, Entity Bean which is used as a representation of the database object and Message-Driven Bean mainly used in asynchronous messaging environment.

In my assignment I will not use Message-Driven and Entity Beans (I don’t need first and second I’m going to replace with JPA), however, Session Beans are widely used. I came up with a question: how I’m going to implement my MVC model? The answer is obvious – for navigation is better to use Stateless beans because container allows to serve 100′s of clients with only one EJB what can give performance enhancement.

But I found other question: what if container itself requires resources such as memory and processing time? Maybe it would be better to implement the MVC without EBJ but normal Java Beans instead without the container? Probably this solution will give the better performance in case of 1000′s of users. Not sure about that so I will try to do a research or ask programmers from the industry.

After all, I have MVC skeleton ready! Work on design now, also I think about implementing the search by tag system… if I will have a time.

Issues

One big issue. I’ve created from the beginning the Enterprise Application in the NetBeans. Basically, it is the same Web Application + EJB Module but the addition is the Ant script which puts everything into one Enterprise Archive (EAR). Unfortunately, it’s sort of bug of the GlassFish server, after I execute the program, NetBeans can’t deploy my application on server. So I’ve spent half a day trying to find the solution, but almost without good results. One suggestion that I’ve found is the problem of interpretation of the localhost on my laptop. People say that if the address looks like 127.0.0.1/Application it works but not when localhost/Application. They say that in Vista this issue occurs because the host file contains :::1 localhost and the solution is to put standard loopback address.

I’ve checked my etc/hosts but everything was just fine. I believe the problem is in the GlassFish configuration. Anyway, I don’t want to spend my time on it anymore, so I just deleted the enterprise script and going to read how to assemble it manually later.

That’s all for today, stay with us.

PHP and CSS2

Here we go again!

Sorry for long delay in posting, I was too busy with my Project Management assignment.

So, last week we had extremely good tutorial about CSS2! Also I’m so impressed by HTML5 and going to spend more time on learning it. I’m not new in PHP and MySQL so today’s tutorial shouldn’t be a problem.

I want to share one good link with people who think that configuring Apache, php and MySQL/Postgre is a pain, here is nice WAMP package made by one crazy russian developer, called DENWER (short from Russian: web developers dgentlemen’s kit). This package is very easy to install and it provides you server+database from the scratch. Moreover, you can install it even on your USB stick!

Enjoy:

DENWER

Video Tutorial

I’ve found the good video tutorial on how to use NetBeans + GlassGish + Simple JavaEE. It covers only how to create the jsp, servlet and EJB. It doesn’t explain the details of EJB but it could be easily found in the book that I suggested in my Learning Proposal.

The link is Tutorial, it’s only the first video from the 5.

The only issue that I’ve found is the auto-generated code that the lecturer uses: he type session and press auto-fill combination of buttons. His exact code is:

int count;

if (request.getSession().getAttribute(“count”) == null){ count = 0; }

else { count = (Integer) request.getSession().getAttrib­ute(“count”); }

request.getSession().setAttrib­ute(“count”, ++count);

out.println(“Accessed: ” + request.getSession().getAttrib­ute(“count”));

Learning Proposal Final version

Finally, I’ve uploaded my LP final!

http://australianheadhunters.com/DMT/LearningProposal.html

Follow

Get every new post delivered to your Inbox.