Sunday, June 14, 2015

A Framework or a CMS? What is better to choose?

There are lot of articles who are talking about Frameworks and CMS systems. What to choose? Which is the best?


However I wanted to write an article from a totally different perspective. First of all I want to make sure that developers and customers understand the difference between the terminology “CMS” and “Framework” nowadays.


Some theory first

When we use the terminology “Framework” we are more often talking aboutWeb application framework . A web application framework is simply based on coding. If you are a programmer or a web developer that loves coding you often choose a Web application framework for your projects.
A CMS is a Content management framework and it is based on the modules rather than code. Anyone can handle a CMS as it doesn’t require any coding knowledge. Of course programmers can also choose a CMS as they can do their job faster.

There are lot of fights…

There are lot of misunderstandings about what a framework and what a CMS can do. Lot of fans that use CMS they are saying that “We can do everything with a CMS” and the fans of the frameworks are “No we can do everything with a framework” and so on… As a fan of frameworks of course I will have the same opinion but actually this is not true! The truth is that as we use the same base (PHP,RoR,python,. NET… e.t.c.), we all can do everything (well almost everything, but still). Even the myth that CMS doesn’t use a good structure isn’t truth. For example Drupal 8 is based on Symfony framework, a very good object oriented web application framework.

So what do I choose?

Nowadays the CMS is more popular than the Web application Framework as it is really easy to use it. Even if you don’t have programming knowledge you can install and create a whole website with just a CMS. So what to choose?
It is always about four basic things that you have to think before you choose a framework or a CMS in my personal experience:
1. How much time you want to spend?
2. What do you want to do and how flexible has to be this project in the future?
3. How much money (if it matters) you will take after the end of the project.
4. What the hosting environment will be
For the customer it doesn’t really matter what tools you will use. The thing that matters is to have their job done. So let’s have an example:
I will explain to you my choices about two personal projects and one normal project. This blog and www.grocerycrud.com. First of all I am a PHP web developer so I can choose either a PHP framework, either a PHP CMS.
So for this blog that you are reading right now, I used WordPress as:
1. I wanted to spend as less time as I could as it is a simple blog
2. I didn’t want to do anything extreme. Just the usual. SEO, caching, comments, nice design and less spams!
3. I will not make any profit for the creation of the project. So I don’t have as a criteria the money.
4. Free to choose.
For grocerycrud.com I choose Codeigniter framework as:
1. I wanted to spend a normal time to do it. Not too much as this is a personal project
2. I wanted to be 100% extendable as I am changing the structure all the time with new ideas. For example now I am preparing a new mini website inside the grocerycrud.com (www.grocerycrud.com/image-crud).
3. Still the money doesn’t count here as it is a personal project
4. Free to choose
For www.dailyfx.gr I chose Codeigniter framework as
1. I had only 1 month deadline for me to do it from scratch
2. It was a system that the clients wanted some extremely custom webpages (such as with an internal connection with java applet charts). I didn’t choose wordpress or drupal as it would require more time to customize all of these unique needs.
3. For money nothing more than my normal monthly salary. So the money was not something to motivate me
4. Just another shared hosting

I want to investigate more

As I said only in my personal experience are 4 simple things that I have in mind but this is only because the outsource projects that I have are often small projects so that’s why I have only these four things in mind. Of course if I want to investigate more time I think a Web Application framework is the solution and I can give you much more criteria to have in mind. As the Symfony webpage says:
You’re making progress and that’s a good thing! You already know that you are going to use a framework to develop your site or your application. But which one? Here is a checklist that you can use to avoid making a mistake:

So there are 10 criteria for choosing the correct framework. You can take a look at this article as it is really straight forward about what are the real criteria to actually choose a framework. So if you really want to investigate to a framework for your big projects, have in mind that it is a long-term commitment, so make sure that you make the right selection… for you!

What about a CMS?

On the other side it is not so bad to know programming and also be a “CMS guy”. The bad think about it is that they are many “CMS guys” that don’t have any programming knowledge and think that they can do everything with a CMS. This is also a myth! When I was talking before that with a CMS you can do everything as you have the same base it also depends if you have some basic programming skills of course. If not then you can do everything as far as the programmers/web developers let you have it. So my opinion is that if you are a “CMS guy” and you don’t have any programming knowledge it is good to start learning some basic stuff and try to create your custom plugins for the CMS from scratch.

And finally a conclusion…

So as a conclusion I have to say that it always depends of what you want to do and how much time you have to deal with it. I believe that every tool is build for a reason so as many tools you know (frameworks or CMS), so flexible you are as a professional developer. So it doesn’t worth it to be a CMS or a Framework fan. Just choose the best tool for you situation and that’s it.

Source : http://www.web-and-development.com/a-framework-or-a-cms-what-is-better-to-choose/

Saturday, April 12, 2014

12 Habits of Really Successful People

1. Trust your creative side.

Series protagonist Draper's title is "creative director," which has to be one of the most apt job descriptions ever, given his penchant for reinvention. However, he does seem to understand how his creative mind works. Among his practices, he'll spend a lot of time thinking about a creative challenge, then forget it, allowing his subconscious mind to do the heavy lifting

2. Fake it until you make it.

Draper is secretly living another man's life, and with the development of another character, Bob Benson, it looks as though he's not the only one. When the firm was small, it would go out of its way to try to look bigger and more accomplished. You don't want to be dishonest or disingenuous, but you do want to visualize what success would look like and behave as if you already fit the part.

3. Get ahead of your customers.

Here's the key to advertising. Dealing with people effectively is about finding a way to help them get what they want. The challenge is that so few people are truly self-aware. Thus, your mission is to figure it out for them and find a solution to a problem they didn't even know about.

4. Think bigger.

Olson rose from secretary to creative director. Joan Holloway is now a partner bringing in new accounts. Both characters have reached higher levels than they originally dreamed of, only to find that the prize for climbing a mountain is often another bigger mountain. Plans change, goals shift, but it's the people who are willing to dream bigger who actually accomplish things.

5. Plan ahead.

Mad Men opened years ago with its characters facing a professional challenge. The U.S. government was about to start cracking down on cigarette advertisers, and the firm needed to find both a new way to pitch its tobacco clients and a new direction to find more clients. This required long-term thinking that didn't exactly come naturally to all of the characters

6. Don't be afraid to quit.

The show is about beginnings and endings, over and over and over--fired clients; fired employees; marriages, business deals, and client engagements that the characters walk away from because they're not working out. From the destruction each time comes a new opportunity.

7.  Have fun.

The show is known for its unflinching look at a kind of 1960s debauchery, with all kinds of drinking, sleeping around, and drug experimentation. It's a really unhealthy way to live your life, but it also seems to be the way that the characters blow off steam--and they've got a lot of steam. Don't become an alcoholic philanderer, but be sure to have fun (in healthier ways, I hope)

8. Get a life.

This is where so many of the characters on the show fall down, because they have success only at work, and rush from one failed relationship to another. They seek to solve others' problems only when there is something tangible in it for them: a new client, more money, something they want. Don't follow their example. Remember the old adage that on their deathbeds, people rarely say they wish they had spent more time at the office.

9. Leverage technology.

In the early years of Mad Men, the new technology was television, which was quickly becoming the most effective medium of its time to communicate marketing messages. Part of the protagonists' success involved their ability to pivot and take advantage of it. The technology has changed--boy, has it ever--but the lesson is the same. You can either be an early adapter or an also-ran.

10. Enjoy the roller coaster.

If you're going to be successful--whether in building a business or elsewhere--you're going to have a lot of ups and downs. It makes for great drama on television and for some stomach-churning in real life. If you can't enjoy that kind of volatility, then find a safer, more secure path. You'll be happier and so will those around you. Every day, remind yourself that whether today was an up day or a down one, there will be many others to balance it out.

11. Care for and feed your network.

Half of the characters' jobs on Mad Men are simply to manage relationships with the firm's clients and to network and schmooze with potential new clients. Heck, Draper first got hired after meeting Roger Sterling, getting him drunk, and showing up the next day claiming he had been offered a job. Sterling had been too drunk to remember doing it. These are some morally questionable choices, but that doesn't mean you can't learn from them. Every day, reach out to at least one new person, and to someone you've been out of touch with for a while.

12. Go where the action is.

In real life, Jimmy Fallon recently moved The Tonight Show back to New York City, but in the world of Mad Men, Johnny Carson is about to head to Los Angeles. One of the themes for the new season is the idea of new beginnings, especially out West. Today's new frontiers are more global but no less real.


(Courtesy : Inc magazine)

Thursday, April 3, 2014

9 security tips to protect your website from hackers

  1.  Keep software up to date

    It may seem obvious, but ensuring you keep all software up to date is vital in keeping your site secure. This applies to both the server operating system and any software you may be running on your website such as a CMS or forum. When website security holes are found in software, hackers are quick to attempt to abuse them.

Sunday, November 18, 2012

Tips to get your job application considered by Companies

Well, you must be applying to 100’s of jobs every month and hardly get a call from one or two or most of the times, none. This article would help you understand the current situation and why most of you are not getting calls
-         If a Tier 1 company posts a job (1 requirement), at-least 500 people apply for the post. The number would be 10 times more if it is a fresher job. You cannot expect the company to call all or the 5000 people for the interview to fill the 1 position
-         With the increase in number of engineering colleges, unemployment of engineering graduates has grown exponentially which in turn led to the increase in number of job applicants. Recruiters blindly reject most of the applications without even looking at the title or the skills
What you need to do to improve your chances of getting an interview call
-         Be one of the first to apply for the positions. Usually, the recruiters finalize few candidates from the first few 100’s who apply for the role
-         Read the Job Description completely and see that all the skills required are covered in your resume.  For example, if the job role is PHP developer and your resume has C/C++, your chances to be considered for the role are less
-         If you are a fresher and have done a project in a company or even consultancy, put the work as intern experience
-         When you see a job listing you are interested in and have a friend or relative working for that company, ask them to refer you. Referrals are given preference to those who apply directly. However, if there is no open position and if you are referred, it does not matter again.
-         Last but not the least, do not lose hope!  We know that many deserving candidates are not getting a chance to be interviewed either because they applied late or the recruiter randomly selected certain profiles. Increase your probability of consideration by applying to every job that you come across with! This would increase your probability of being considered by at least one employer. If you lose hope and start applying for jobs, you gain nothing but only lose your chances of getting a job!
Huge job portals let you apply for 50 jobs a day. This does not mean that all the 50 companies are going to call you. This is just for increasing your chances of being called by atleast one or two of them. We are writing this article to make freshers understand the current situation. An experienced engineer working for Microsoft is not getting a call from Google with ease and a fresher is expecting calls from every company he applies to! Understand the Job Market and the situation before you complain.
 Never lose hope! If you really deserve, you will definitely get the job of your dreams! 

Tuesday, June 26, 2012

JAVA INTERVIEW QUESTIONS (Volume :- 1)


Q: What is the difference between an Interface and an Abstract class?
A: An abstract class can have instance methods that implement a default behavior. An Interface can only declare constants and instance methods, but cannot implement default behavior and all methods are implicitly abstract. An interface has all public members and no implementation. An abstract class is a class which may have the usual flavors of class members (private, protected, etc.), but has some abstract methods.
.


Q: What is the purpose of garbage collection in Java, and when is it used?
A: The purpose of garbage collection is to identify and discard objects that are no longer needed by a program so that their resources can be reclaimed and reused. A Java object is subject to garbage collection when it becomes unreachable to the program in which it is used.


Q: Describe synchronization in respect to multithreading.
A: With respect to multithreading, synchronization is the capability to control the access of multiple threads to shared resources. Without synchonization, it is possible for one thread to modify a shared variable while another thread is in the process of using or updating same shared variable. This usually leads to significant errors. 


Q: Explain different way of using thread?
A: The thread could be implemented by using runnable interface or by inheriting from the Thread class. The former is more advantageous, 'cause when you are going for multiple inheritance..the only interface can help.


Q: What are pass by reference and passby value?
A: Pass By Reference means the passing the address itself rather than passing the value. Passby Value means passing a copy of the value to be passed. 


Q: What is HashMap and Map?
A: Map is Interface and Hashmap is class that implements that.


Q: Difference between HashMap and HashTable?
A: The HashMap class is roughly equivalent to Hashtable, except that it is unsynchronized and permits nulls. (HashMap allows null values as key and value whereas Hashtable doesnt allow). HashMap does not guarantee that the order of the map will remain constant over time. HashMap is unsynchronized and Hashtable is synchronized.


Q: Difference between Vector and ArrayList?
A: Vector is synchronized whereas arraylist is not.


Q: Difference between Swing and Awt?
A: AWT are heavy-weight componenets. Swings are light-weight components. Hence swing works faster than AWT.


Q: What is the difference between a constructor and a method?
A: A constructor is a member function of a class that is used to create objects of that class. It has the same name as the class itself, has no return type, and is invoked using the new operator.
A method is an ordinary member function of a class. It has its own name, a return type (which may be void), and is invoked using the dot operator.


Q: What is an Iterator?
A: Some of the collection classes provide traversal of their contents via a java.util.Iterator interface. This interface allows you to walk through a collection of objects, operating on each object in turn. Remember when using Iterators that they contain a snapshot of the collection at the time the Iterator was obtained; generally it is not advisable to modify the collection itself while traversing an Iterator.



Q: State the significance of public, private, protected, default modifiers both singly and in combination and state the effect of package relationships on declared items qualified by these modifiers.
A: public : Public class is visible in other packages, field is visible everywhere (class must be public too)
private : Private variables or methods may be used only by an instance of the same class that declares the variable or method, A private feature may only be accessed by the class that owns the feature.
protected : Is available to all classes in the same package and also available to all subclasses of the class that owns the protected feature.This access is provided even to subclasses that reside in a different package from the class that owns the protected feature.
default :What you get by default ie, without any access modifier (ie, public private or protected).It means that it is visible to all within a particular package
.



Q: What is an abstract class?
A: Abstract class must be extended/subclassed (to be useful). It serves as a template. A class that is abstract may not be instantiated (ie, you may not call its constructor), abstract class may contain static data. Any class with an abstract method is automatically abstract itself, and must be declared as such.
A class may be declared abstract even if it has no abstract methods. This prevents it from being instantiated.


Q: What is static in java?
A: Static means one per class, not one for each object no matter how many instance of a class might exist. This means that you can use them without creating an instance of a class.Static methods are implicitly final, because overriding is done based on the type of the object, and static methods are attached to a class, not an object. A static method in a superclass can be shadowed by another static method in a subclass, as long as the original method was not declared final. However, you can't override a static method with a nonstatic method. In other words, you can't change a static method into an instance method in a subclass.


Q: What is final?
A: A final class can't be extended ie., final class may not be subclassed. A final method can't be overridden when its class is inherited. You can't change value of a final variable (is a constant).




Q: What if the main method is declared as private?
A: The program compiles properly but at runtime it will give "Main method not public." message.




Q: What if the static modifier is removed from the signature of the main method?
A: Program compiles. But at runtime throws an error "NoSuchMethodError".


Q: What if I write static public void instead of public static void?
A: Program compiles and runs properly.



Q: What if I do not provide the String array as the argument to the method?
A: Program compiles but throws a runtime error "NoSuchMethodError".



Q: What is the first argument of the String array in main method?
A: The String array is empty. It does not have any element. This is unlike C/C++ where the first element by default is the program name.



Q: If I do not provide any arguments on the command line, then the String array of Main method will be empty or null?
A: It is empty. But not null.



Q: How can one prove that the array is not null but empty using one line of code?
A: Print args.length. It will print 0. That means it is empty. But if it would have been null then it would have thrown a NullPointerException on attempting to print args.length.


Q: What environment variables do I need to set on my machine in order to be able to run Java programs?
A:  PATH is the only variable.



Q: Can an application have multiple classes having main method?
A: Yes it is possible. While starting the application we mention the class name to be run. The JVM will look for the Main method only in the class whose name you have mentioned. Hence there is not conflict amongst the multiple classes having main method.



Q: Can I have multiple main methods in the same class?
A: No the program fails to compile. The compiler says that the main method is already defined in the class.


Q: Do I need to import java.lang package any time? Why ?
A: No. It is by default loaded internally by the JVM.



Q: Can I import same package/class twice? Will the JVM load the package twice at runtime?
A: One can import the same package or same class multiple times. Neither compiler nor JVM complains abt it. And the JVM will internally load the class only once no matter how many times you import the same class.



Q: What are Checked and UnChecked Exception?
A: A checked exception is some subclass of Exception (or Exception itself), excluding class RuntimeException and its subclasses.
Making an exception checked forces client programmers to deal with the possibility that the exception will be thrown. eg, IOException thrown by java.io.FileInputStream's read() method·
Unchecked exceptions are RuntimeException and any of its subclasses. Class Error and its subclasses also are unchecked. With an unchecked exception, however, the compiler doesn't force client programmers either to catch the
exception or declare it in a throws clause. In fact, client programmers may not even know that the exception could be thrown. eg, StringIndexOutOfBoundsException thrown by String's charAt() method· Checked exceptions must be caught at compile time. Runtime exceptions do not need to be. Errors often cannot be.


Q: What is Overriding?
A: When a class defines a method using the same name, return type, and arguments as a method in its superclass, the method in the class overrides the method in the superclass.
When the method is invoked for an object of the class, it is the new definition of the method that is called, and not the method definition from superclass. Methods may be overridden to be more public, not more private.


Q: What are different types of inner classes?
A: Nested top-level classes, Member classes, Local classes, Anonymous classes
Nested top-level classes- If you declare a class within a class and specify the static modifier, the compiler treats the class just like any other top-level class.
Any class outside the declaring class accesses the nested class with the declaring class name acting similarly to a package. eg, outer.inner. Top-level inner classes implicitly have access only to static variables.There can also be inner interfaces. All of these are of the nested top-level variety.

Member classes - Member inner classes are just like other member methods and member variables and access to the member class is restricted, just like methods and variables. This means a public member class acts similarly to a nested top-level class. The primary difference between member classes and nested top-level classes is that member classes have access to the specific instance of the enclosing class.

Local classes - Local classes are like local variables, specific to a block of code. Their visibility is only within the block of their declaration. In order for the class to be useful beyond the declaration block, it would need to implement a
more publicly available interface.Because local classes are not members, the modifiers public, protected, private, and static are not usable.

Anonymous classes - Anonymous inner classes extend local inner classes one level further. As anonymous classes have no name, you cannot provide a constructor.




Q: Are the imports checked for validity at compile time? e.g. will the code containing an import such as java.lang.ABCD compile?
A: Yes the imports are checked for the semantic validity at compile time. The code containing above line of import will not compile. It will throw an error saying,can not resolve symbol
symbol : class ABCD
location: package io
import java.io.ABCD;


Q: Does importing a package imports the subpackages as well? e.g. Does importing com.MyTest.* also import com.MyTest.UnitTests.*?
A: No you will have to import the subpackages explicitly. Importing com.MyTest.* will import classes in the package MyTest only. It will not import any class in any of it's subpackage.


Q: What is the difference between declaring a variable and defining a variable?
A: In declaration we just mention the type of the variable and it's name. We do not initialize it. But defining means declaration + initialization.
e.g String s; is just a declaration while String s = new String ("abcd"); Or String s = "abcd"; are both definitions.


Q: What is the default value of an object reference declared as an instance variable?
A: null unless we define it explicitly.



Q: Can a top level class be private or protected?
A: No. A top level class can not be private or protected. It can have either "public" or no modifier. If it does not have a modifier it is supposed to have a default access.If a top level class is declared as private the compiler will complain that the "modifier private is not allowed here". This means that a top level class can not be private. Same is the case with protected.



Q: What type of parameter passing does Java support?
A: In Java the arguments are always passed by value .



Q: Primitive data types are passed by reference or pass by value?
A: Primitive data types are passed by value.



Q: Objects are passed by value or by reference?
A: Java only supports pass by value. With objects, the object reference itself is passed by value and so both the original reference and parameter copy both refer to the same object .



Q: What is serialization?
A: Serialization is a mechanism by which you can save the state of an object by converting it to a byte stream.



Q: How do I serialize an object to a file?
A: The class whose instances are to be serialized should implement an interface Serializable. Then you pass the instance to the ObjectOutputStream which is connected to a fileoutputstream. This will save the object to a file.



Q: Which methods of Serializable interface should I implement?
A: The serializable interface is an empty interface, it does not contain any methods. So we do not implement any methods.



Q: How can I customize the seralization process? i.e. how can one have a control over the serialization process?
A: Yes it is possible to have control over serialization process. The class should implement Externalizable interface. This interface contains two methods namely readExternal and writeExternal. You should implement these methods and write the logic for customizing the serialization process.



Q: What is the common usage of serialization?
A: Whenever an object is to be sent over the network, objects need to be serialized. Moreover if the state of an object is to be saved, objects need to be serilazed.



Q: What is Externalizable interface?
A: Externalizable is an interface which contains two methods readExternal and writeExternal. These methods give you a control over the serialization mechanism. Thus if your class implements this interface, you can customize the serialization process by implementing these methods.



Q: When you serialize an object, what happens to the object references included in the object?
A: The serialization mechanism generates an object graph for serialization. Thus it determines whether the included object references are serializable or not. This is a recursive process. Thus when an object is serialized, all the included objects are also serialized along with the original object.




Q: What one should take care of while serializing the object?
A: One should make sure that all the included objects are also serializable. If any of the objects is not serializable then it throws a NotSerializableException.




Q: What happens to the static fields of a class during serialization?
A: There are three exceptions in which serialization doesnot necessarily read and write to the stream. These are
1. Serialization
ignores static fields, because they are not part of ay particular state state.
2. Base class fields are only hendled if the base class itself is serializable.
3. Transient fields.