Saturday, June 5, 2010

Install reliance broadband+ in ubuntu


In Ubuntu 10.04 , broadband+ device is detected as usb storage.To make it detected as modem we will use usb-modeswitch package. It is a Switching tool for controlling "flip flop" USB devices.

Need to Install follwoing tools.

A. usb-modswitch
B. usb-modswitch-data

Commands to install:-

1. sudo apt-get install -yq usb-modeswitch usb-modeswitch-data

2. wget -c  http://mirrors.kernel.org/ubuntu/pool/universe/u/usb-modeswitch-data/usb-modeswitch-data_20100127-1_all.deb

3. dpkg -i  usb-modeswitch-data_20100127-1_all.deb

For 64 bit :

4. wget  -c  http://mirrors.kernel.org/ubuntu/pool/universe/u/usb-modeswitch/usb-modeswitch_1.1.0-2_amd64.deb

5. dpkg -i usb-modeswitch_1.1.0-2_amd64.deb

For 32 bit

4. wget -c http://mirrors.kernel.org/ubuntu/pool/universe/u/usb-modeswitch/usb-modeswitch_1.1.0-2_i386.deb

5. dpkg -i usb-modeswitch_1.1.0-2_i386.deb

Once you install both packages,  you should have the modem detected and then use networkmanager to configure it.

Wednesday, March 17, 2010

Check how much your PHP code meets the standards ?

Generely we easily check for parse errors in a file using the PHP command line interface and the -l (lowercase L) option.
$ php -l /path/to/code/myfile.inc
No syntax errors detected in /path/to/code/myfile.inc

So code is fine and why do I need check code standered ?

Coding standards  make our code easier to read and maintain, especially when multiple people are working on the same application. we want to ensure to follow some set of coding standards,in my previous company , every SVN commits to email all team members so we fulfill the code review process but sometimes still issues are left. we need some more deep level to review code.

PHP_CodeSniffer is a solution. It's quick and easy way to do that. PHP_CodeSniffer is a replacement for the more manual task of checking coding standards in code reviews. With PHP_CodeSniffer, we can reserve code reviews for the checking of code correctness. if we use it in a regular time interval , we ensures some couple of positive things like
1. Team learn the coding standards and make less mistakes in the future.
2. Team can decide if a coding standard doesn't fit a particular piece of code.

Install and How to use:-  it's pear package so easy to install and we can use it as command line.

phpcs -n --report=summary /var/www/html/shiksha/

Another good tool is PHPMD. it scans PHP source code and looks for potential problems such as possible bugs, suboptimal code or overcomplicated expressions. we can get HTML output of Report as well.


Install and How to use:-  it's pear package so easy to install and we can use it as command line.
phpmd ~/shiksha_head/marketing/  html codesize

Third one is PHPCPD. it is a Copy/Paste Detector (CPD) for PHP code. it's funny tool.

fourth and final one is PHP_Depend. it performs static code analysis on a given source base. Static code analysis means that PHP_Depend first takes the source code and parses it into an easily processable internal data structure. This data structure is normally called an AST (Abstract Syntax Tree), that represents the different statements and elements used in the analyzed source base. Then it takes the generated AST and measures several values, the so called software metrics. what are the software metrics ? They are just the sum of some statements or code fragments found in the analyzed source.
it's also provide some graphical charts that tells about percentage of metrics that current code is followed.

Install and How to use:-  it's pear package so easy to install and we can use it as command line.
pdepend --summary-xml=/tmp/summary.xml   --jdepend-chart=/tmp/jdepend.svg    --overview-pyramid=/tmp/pyramid.svg    /home/raviraj/shiksha_head/marketing/

we have seen some good tools that are really helpful for automated quality testing of code. i have run all these tests in my current  project

Happy coding !!!

Thursday, March 11, 2010

Monday, August 24, 2009

What is Thin Server Architecture ?

IT's simple but much more Smarter than other frameworks ...

Putting the View on the Client (Yes, you have one. It's the browser, silly!)
1) Do not use server-side templating to create the web page
2) Use a classical and simple client-server model, where the client runs in the browser.
3) Separate concerns using protocol between client and server and get a much more efficient and less costly development model.

 
 

Thursday, May 28, 2009

UI Bugs & QA Responsibilities

Anybody who has written code for public use will probably have received at least one bad bug report. Reports that say nothing ("It doesn't work!"), reports that make no sense, reports that don't give enough information,reports that give wrong information. well ... as a coder i felt it's a horrible job to work on UI bugs and one reason is bad bug reports. However, not all bug reports are unpleasant and sometimes we received a wonderfully clear, helpful, informative bug reports.

Quality of Bugs:- depends on following points.
1. The development process (how much time between releases)
2. The product planning (how much change per release)
3. The QA Cycle approach
4. % of bugs would have been found within unit test cases or web services testing?
5. % of bugs platform(dependencies like software, os, browsers etc ) specific? how many are UI bugs ?
6. % of bugs as known issues.

Points that should keep in mind:-
1. Be specific. If you can do the same thing two different ways, state which one you used. "I refreshed page" might mean "I clicked refresh button" or "I pressed F5". Say which you did. Sometimes it matters.
2. Be verbose. Give more information rather than less. If you say too much, the programmer can ignore some of it. If you say too little, they have to come back and ask more questions. Be careful of pronouns. Don't use words like "it", or references like "the window", when it's unclear what they mean.
3.Read what you wrote. Read the report back to yourself, and see if you think it's clear. If you have listed a sequence of actions which should produce the failure, try following them yourself, to see if you missed a step.
4. You report a bug because you want the bug fixed. it may be their fault and your problem, and you might be right to be angry with them, but the bug will get fixed faster if you help us by supplying all the information needed.
5. "It doesn't work."case Give the programmer some credit for basic intelligence, :D if the program really didn't work at all, they would probably have noticed. Since they haven't noticed, it must be working for them. Therefore, either you are doing something differently from them, or your environment is different from theirs. They need information, providing this information is the purpose of a bug report. More information is almost always better than less.
6. "Works for me. So what goes wrong?" case Possibly the fault doesn't show up on every computer, your system and theirs may differ in some way. Possibly you have misunderstood what the program is supposed to do, and you are both looking at exactly the same display but you think it's wrong and they know it's right. So also describe what happened. Tell us exactly what you saw. Tell us why you think what you saw is wrong.
7. What happens if bug gets rejected? Rejected bugs fall into two categories:-
7.1. It was rejected because it was not a bug.
7.2. It was rejected because development team do not feel like working on it. :D

Thursday, March 19, 2009

Eval is Evil ...

The Eval method is JS takes a string containing JavaScript code, compiles it and runs it.It is probably the most powerful and most misused method in JavaScript.
In the majority of cases, eval is used like a sledgehammer swatting a fly -- it gets the job done, but with too much power. It's slow, it's unwieldy, and tends to magnify the damage when you make a mistake. Please spread the word far and wide: if you are considering using eval then there is probably a better way. Think hard before you use eval. eval starts a compiler. Before you use it, ask yourself whether there is a better way to solve this problem than starting up a compiler!

Here few points that force to not use Eval.

Debugability: what is easier to debug, a program that dynamically generates new code at runtime, or a program with a static body of code?

Maintainability: What's easier to maintain, a table or a program that dynamically spits new code?

Speed: which do you think is faster, a program that dereferences an array, or a program that starts a compiler?

think about string more than 10,000 persons name and we want to eval that string ... JavaScript encountered with problem on manipulating and eval()ing very large strings.


Memory: which uses more memory, a program that dereferences an array, or a program that starts a compiler and compiles a new chunk of code every time you need to access an array?


Learn More ....

http://blogs.msdn.com/ericlippert/archive/2003/11/04/53335.aspx

http://blogs.msdn.com/ericlippert/archive/2003/11/01/53329.aspx


Saturday, March 14, 2009

Holi ... celebration of colors ..

Holi is celebrated after the full moon day in the month of phalgun (February – March). It is traditionally a harvest festival. Like all Hindu festivals, the reason for the celebration of Holi can be traced to Hindu scriptures and it commemorates the victory of good over evil. The significance of Holi is that victory of good over evil is achieved by a young devotee through his unshakable devotion for the Lord.

The date of Holi celebration depends on the moon and lunar calendar.

Holi Myth based on Prahlada and Demon Holika

Young Prahlada was an ardent devotee of Lord Vishnu but this was detested by his arrogant father, Hirnakashyipu, who was the king of the land. The father constantly sought for ways to eliminate his son and each time he failed miserably. But this only hardened his stance.

Now, the king had a sister named Holika who was immune to fire. So, she took young Prahlada and entered into fire. Legend has it that Prahlada came out of the fire without any burns but Holika was consumed by the fire. Huge bonfires that are burnt on the day prior to Holi symbolize this event from mythology.

Holi Legend based on Krishna and Radha

Holi is also associated with the evergreen love of Krishna and Radha. KrishnaKrishna was waiting for an idea for a prank and did exactly as his mother suggested. was jealous of Radha’s fair color and asked mother Yashoda for the reason for Radha’s fair color. Yashoda jokingly said if you are so jealous change her complexion by smearing color. Naughty young

For Krishna devotees, the festival is spread over two weeks. The most important events are held at Vrindavan, Mathura, Barsnar and Nandgaon.

Holi Myth based on Kamdev and Lord Shiva

Another important Holi legend is associated with Kamdev, the god of love. After the death of Sati, Lord Shiva took to severe meditation. Sati took rebirth as Parvati and tried to impress Lord Shiva. When her feminine charms failed, she took the help of Kamdev. Not knowing the seriousness of Lord Shiva’s meditation, Kamdev used his arrow of love on Shiva. The infuriated Shiva opened his third eye and turned Kamdev into ashes. This happened on the Holi day.

Monday, March 2, 2009

Here i am sitting in my office at night…

Here i am sitting in my office at night…
Thinking hard about life How it changed from a maverick college life to strict professional life…...

How tiny pocket money changed to huge monthly paychecks
but then why it gives lesss happiness….

How a few local denim jeans changed to new branded wardrobe but then why there are less people to use them

How a single plate of samosa changed to a full Pizza or burger But then why there is less hunger…..

Here i am sitting in my office at night…
Thinking hard about life How it changed…..

How a bike always in reserve changed to bike always on
but then why there are less places to go on……

How a small coffee shop changed to cafe coffee day
but then why its feels like shop is far away…..

How a limited prepaid card changed to postpaid package
but then why there are less calls & more messages……

Here i am sitting in my office at night…
Thinking hard about life How it changed…...

How a general class journey changed to Flight journey
But then why there are less vacations for enjoyment….

How an old assembled desktop changed to new branded laptop but then why there is less time to put it on……….

How a small bunch of friends changed to office mate
But then why we always feel lonely n miss those college frnz.….

Here i am sitting in my office at night…
Thinking hard about life How it changed….. How it changed……..