Eclipse (Juno) is not initializing suddenly!


My Eclipse (Juno) was working fine till yesterday, it’s not initializing today. It doesn’t even showing any error message! Splash screen coming and GONE!

Solution:

Step 1: Delete YOUR_WORKSPACE\.metadata\.plugins\org.eclipse.core.resources\.snap

If your problem is not solved yet

STEP 2: DELETE
YOUR_WORKSPACE\.metadata\.plugins\org.eclipse.e4.workbench\workbench.xmi

You are DONE!

Size conversion filter using AngularJS


Following code should give you a clean and simple example of custom filter using AngularJS.

HTML code:
———————

<!doctype html>
<html >
<head>
<script src=”src=”http://code.angularjs.org/angular-1.0.0rc6.min.js”></script >
<script src=”filter.js“></script>
</head>
<body>
<div ng-app=”testFilterApp“>
<label>Size in Byte:</label>
<input type=”text” ng-model=”sizeInB” placeholder=”Enter a name here”>
<hr>
<h2>Human Readable Size (precision:3) {{sizeInB | sizeConverter:3}}!</h2>
<h2>Human Readable Size (precision: not defined) {{sizeInB | sizeConverter}}!</h2>
</div>
</body>
</html>

Continue reading

Funny JSP parser!


OK have a look:

JSP code:

<%  if(thisCodeIsOK){ %>

I am a genius !

<% }%>

<% else { %>

JSP parser is genius !

<% } %>

 

Tell me are you a genius?

Internet-Troll

I don’t think so. To be genius you have to write this code as following

<%  if(thisCodeIsOK){ %>

I am a genius !

<% }else { %>

JSP parser is genius !

<% } %>

Eclipse Debugging


JAVA Debugging in Eclips

JAVA Debugging in Eclips

This article describes how to debug a Java application in Eclipse.

This article is based on Eclipse 4.2 (Eclipse Juno).


1.1. What is debugging?

Debugging allows you to run the program interactively and to watch the source code and the variables during this execution. Continue reading

Hints for writing secure code


Secure Coding

Secure Coding

Security and data protection are becoming now more and more popular topics. We are coming into the world where too much information is transfered/used/processed by computer systems and any leak of that information can cause a big trouble. Thus, it is very important for application to protect customer information as much as it can and do not allow it to spread out.There are many aspects of application security and these cover processes, architecture, infrastructure, code, etc. The whole topic is extremely big and versatile and there are some books written to cover all its possible verges. I will touch just a small piece which is related to something which is in area of developer’s responsibility – code and application architecture. Also, I assume that that reader mostly works on web applications implemented on Java or similar platform.

I disagree that creation of secure code is hard work; I would say it’s just a question of some knowledge and discipline. Here are several guidelines which developer has to follow to cover the most of application security vulnerabilities. Of course list is not complete and mostly covers just protection of customer’s data. Continue reading

Hack your open cart pagination library to enable AJAX calls


Open cart pagination

Okay, I just faced and solved an very interesting problem and can’t wait to share with you all.

PROBLEM: I was trying to do pagination calls by ajax as my whole project  architecture is like that. But open cart’s pagination do not by default support ajax call.

I’ll go step by step through the solution.

Pagination class returns a string what we just echo in our page. Now what is the architecture actually of that generated code?

open cart  pagination class generated code

How this code is generated?

Untitled2

You need to change the followings:

Untitled2So, can you see what is the change? I am sending a new flag “isCustomized” and changed the url.

Now you have to change in pagination.php library.Untitled3

Now write your code in classAjax()(Actually it’d callAjax) method.

Change base url of your magento application (And a bonus problem!)


Starting work with magetno (eCommerce platform). I installed the framework defining the base url as “localhost“. Everything was OK  but yet i was unable to login to admin panel. I even tried changing password in database (Changing the original password to md5 hash).

I just figured out that magento requires “.” in the host name (it should be 127.0.0.1 instead of localhost). So, i had to change the host name      every time browsing each new page from admin panel. This solved my bonus problem ;P.

Continue reading