Your Ad Here

Posts Tagged ‘programming’

The making of my portfolio: http://mutedart.zendfree.com



URL:http://mutedart.zendfree.com

I won’t be going through the whole process that is I won’t explain how I did every thing since this is not a tutorial to make a website. But just a quick over view of how I made the website.

I started of with an A4 sheet right in front, on which I drew the whole interface that was the proposed interface on paper. Designed my logo on rough A4 so I knew what I was going to design and develop. This is one of the most important stages. Why? It’s because this stage actually tells the developers, designers, (i.e. the web team) what to do. And w hat is required at the final stage. Then I continued with what will I be using in the development of my website? By saying this I am referring to the technologies that I will be using. Choose wisely as the choice made now matters a lot. So I decided to use Html for almost every thing and CSS for buttons. I used notepad as my editor for CSS, there are others like Macromedia Dream weaver, etc.  Then for the designing of my logo, I used Adobe Photoshop. After this I designed the rough layout using tables, Front page, and fire fox for checking the interface.  Than I designed the buttons; the theory behind the buttons:

I knew I was going to use CSS for my buttons; I divided my buttons in two parts. One being the menu from where navigation is allowed and the other being all other links in the web page.

Now before starting to code for the web site, I decided for the color theme, that I will be using in my web page. So I decided the following were the RULES I will be using inn the buttons

a:link {}, a:visited {}, a:hover{}, a: active{}

then for the main buttons that  act as the buttons to transfer I made a list, changed it to inline, the list-style-type property to none. So the bullets don’t come up than placed a border on both left and right to give it a button look. I used the same rules as before. But there is variation in the properties that I used.  One important thing I used external style sheet as that saves a lot of code and does not create a lot of fuss. And I used one style sheet for the whole website.

This is it, I am done with the template then I moved to save page as. Since my template will be the same by referring to template I am saying the basic layout will be the same. Only the area of content will vary. Even that wont vary that much. So I started saving my template as other pages changing the title. I made changes as well as I continued to complete my website. When all my pages were done, I came back for hyper linking. I connected the pages. For images I had decided I won’t open them in he same tab/ window. So in the <a href=”xyz/jpeg”>image thumbnail here</a>I included the target=”_blank”, this opens that particular link in a new tab/window.  The code became <a href=”xyz/jpeg” target=”_blank”>image thumbnail here></a>.

I was done with the site; I was consistently checking my site in fire fox. Now was a time to run a quick run. So I TESTED the whole website clicking on links randomly going from one menu to another. After testing the site, I uploaded my site to my server.

So all the best, happy coding. :)



Posted on January 7th, 2009 by Mutedart  |  No Comments »

Quote of the day- 25th december 2008

The Six Phases of a Project:

* Enthusiasm
* Disillusionment
* Panic
* Search for the Guilty
* Punishment of the Innocent
* Praise for non-participants

Posted on December 25th, 2008 by Mutedart  |  No Comments »

Very good tips for Java by experts

I found this link on www.sun.com . It is an article written by experts of Java. They shared a few tips but these tips are really good. I won’t be posting the tips here. It is a link to the website. The tips are not specific to any domain in java but they are very generalized and very well explained. I really liked the way the information was conveyed there.

The link is

http://java.sun.com/developer/technicalArticles/Interviews/studentdevs/index.html#bloch

Happy coding. :)






Posted on December 17th, 2008 by Mutedart  |  No Comments »

JavaFX blog



JavaFX being released on the December 4th 2008. it allows users to create Internet Rich applications.  It includes all the basic information about JavaFX. plus the latest news archives about JavaFX are also there. The link to the blog is

http://blogs.sun.com/javafx/entry/javafx_1_0_is_live

This is the best initiative by launching a blog that will allow users to discuss, and they will be notified about the latest news thats around about JavaFX…

Happy coding :)

“Building technical systems involves a lot of hard work and specialized knowledge: languages and protocols, coding and debugging, testing and refactoring.”

Jesse J. Garrett




Posted on December 9th, 2008 by Mutedart  |  No Comments »

Programming tips


These tips are generalized and not to any specific language that is the reason why I included code from many different languages. The techniques are almost the same though variations exist in the syntax of things.

By referring to variations, I mean the different methodologies of coding, e.g

So let the tips come.

When beginning a method, class, loop, function, condition statements (such as if, switch, etc), open and close it before starting to code.

e.g.

if(condition)

{ //place this and the closing of the curly bracket first, then code

//this reduces a lot of problems faced when writing complicated problems

/*don’t start typing here first*/

}

By this a typical error is often removed that is just because of the { , } that is often encountered by new programmers.

Code indentation

Indentation is normally done using the tab key typically 5 or 6 spaces are left.

e.g. the following is a C/C++ code.

Indentation helps when catching errors in larger programs such as databases. In a database related program where a database such as SQL, Oracle. Etc run in the backend the code is very complicated and there are lots of things we have to do. So why not indent the code so that errors can be caught easily. Not only are database programs long. Full calendar software in C exceeds 500 lines with a lot of nested loops, and conditional statements. So if the code is poorly indented, there is very little probability that the code will run properly without any abnormalities. Where as in indentation we can figure out the loop of conditional changes and make necessary changes to it to fix the problem.

Comments inclusion

One of the very crucial points, often the point where many of the new programmers have difficulty in. when we start making larger more sophisticated programs (i.e. that involve more lines of cod, we can’t figure out every time that this variable was for this purpose and this was for this purpose). This often is helpful when code has to be updated. That is miscellaneous bugs have to be removed.

Ways of commenting.

One is the single lined comment that is started with // here is a comment

Another is the multi lined comment which has syntax as follows

/*

Here is comment line 1

Here is comment line 2

Here is comment line 3

*/

Here is a sample java code with and without codes.

Include author(s) name, created on, version, and purpose of program in the beginning of your source code. Source code is the code that we wrote. This way user knows who made the code, no on can claim that he/she wrote the code without seeing the source code.

How to write it?

The following template can be used in most of the languages such as C, C++, Java, etc.

Name Variables, pointers, functions, classes properly. Do not name the variables randomly as this can create a lot of complexities in larger programs.

e.g.

we are naming both the variables for the use of date.

int d; // d will be hard to remember

int date; // but date can be easily remembered

What about the case for first name. Many things can be done;

This is not allowed in most of the languages

char first name [100];

Correctly we can name variables such as

char first_name[100];

char f_name[100];

Use of data structures

The purpose of data structures is to help us to use fewer computer resources and do a specific purpose without the hesitation of buying a new computing machine.

E.g. we have a record of cars for a whole city. We have 10 million cars in the city. We want to store them in a database, if our program is badly written it will take up hours, days or even weeks to execute. Where as if our program is written properly with the use of data structures we can minimize this to even 20 minutes. The process we are doing on the records can be sorting, searching, or any other thing. We are using the same computer for the manipulation of records in the system.

Always make an algorithm, flowchart, what is the point of getting into more trouble? Actually this is even a little time consuming when writing small programs.

Algorithms are not meant for any programming languages; instead they can be used to create the same program in different languages.

A sample Algorithm is as follows. This algorithm shows the process of registering a user.

Registering a User

This is done because when writing complex programs is not that easy, one can not just open up the compiler and start coding. When working with larger systems, we need to design it properly so that bugs are not there as well. We often use a model called ADITE model (Analysis Design Implementation Testing & Evaluation) to create full systems. The following is a flow chart




Posted on November 25th, 2008 by Mutedart  |  4 Comments »

Prolog introduction



There are many programming languages that exist in the market. There are many paradigms in programming. Prolog is a logical and declarative language. Program is PROgramming in LOGic. French clause ‘programmation en logique’. This means programming in logic. Prolog differs from other programming languages. It was developed by a French scientist.

Prolog is particularly used by programs that use non numeric objects. Programmer has to specify how to solve a problem. The general purpose of the language is associated with AI and computational linguistics. Program logic is expressed in terms of relations and execution is triggered by running queries over these relations.

What is a relation? It consists of facts and rules. Basically how things are related;

For example: I love programming. This is describing a relationship between me and programming.

Imran loves basketball à relation

?- Imran loves basketball /*The query question mark at beginning indicates a query*/

Yes /*this is the output we get from the query we ran*/

Ejaz_lost_his_room_keys /*this means Ejaz lost his room keys*/

?-Imran_lost_his_room_keys /*we are asking the computer to check if imran lost his room keys*/

No /*we get a no to be the answer*/

What if we have two people doing the same thing like reading a book?

?-reads(people,’book’). /*people The group reads a book*/

people=Imran; /*people include Ayesha and Imran*/

people=Ayesha;

Prolog is a very case sensitive language. What do we mean by saying case sensitive? An example will be HELLO WORLD, and hello world.

HELLO WORLD is in upper case as it is all capitalized where as hello world is in lower case as it is in small characters.

Prolog can be divided into two parts

· One is the program, the program has an extension of pl (i.e. *.pl) this is the file that contains all the facts and rules.

· The other part is the query which is actually running the program. We ask about the relationships we described in the program.

So where is it used? It is used in databases, Backend of websites, Artificial Intelligence, Expert systems, Programs using non numeric objects, computational linguistics.

Where can I get the compiler from? SWI-prolog is the compiler that I know there might be others in the market. But this one works fine. Link is http://www.swi-prolog.org/




Posted on November 19th, 2008 by Mutedart  |  2 Comments »

Basic information about Java



There are many programming languages, each with different importance. Each have the power of there own. Now I will discuss one of the languages that I have studied a little which is Java. Java is a high level language. It is a very powerful language. Sun was developed by Sun Microsystems. When it was being launched it had been tested by many people who were experts in C++ and approved Java of being a programming language. The logo is a coffee cup. A little note to the c++ programmers, many of the functions of java derive from c++, but it’s more cohesive and more consistent than c++. It gives programmer full control, and reflects exactly who you program. A few of the reasons why use java

  • Simple
  • Secure
  • Portable
  • Object oriented
  • Robust
  • Multithreaded
  • Architecture neutral
  • Interpreted
  • High performance
  • Distributed
  • Dynamic
  • Very powerful

Where is java used? Lets see Web servers, Internet applications/ applets, Servlets, Relational databases, Mobile technology and personal digital assistants, Mainframe computers, Operating system that is Solaris, Orbiting telescopes, Credit card sized smart cards, Telephones, Architectural and 3d design, Etc… And these are becoming even more and more every day due to extensive research being done in Sun Microsystems. One important thing that people really don’t know is java is not at all becoming obsolete. This is rather a strange statement I heard from people but I strongly disagree with it. One more important note Java script is not a part of java, Java script has been designed and developed by some one else. The method of coding in both is different. And Java is a programming language where as Java script is not a programming language. But both can be used for internet. How? Well java allows user to make applications that can work on the internet one example of such applications is applets. Java script is like an add on for web pages.

So in a nutshell, Java is a highly professional programming language. Not made for a beginner. Gain some knowledge about programming and computers before starting java. As there exist a lot more than it looks. The home page for Java is www.java.com and www.sun.com. There are a lot of resources there to go through for beginning your step into the vast field of java.




Posted on October 10th, 2008 by Mutedart  |  3 Comments »