30 December 2013

Solution of Font size problem on different browser

  • Most of the web developers are facing problem with font size on different browser especially on old version of internet explorer.
    different browser
  •  If you are facing font size problem on different browser then this blog post might help you. 
  • Step1: Edit your css code & add the following code:
     Font size problem
  body {font-size:100%;}

  • Step2: Use Em instead of pixel (px) on your css file to specify the font-size value. 1em=16px, To calculate the em value of any pixel, divide the pixel value by 16 . 
  • Example:
p {font-size:1em;}
h1 {font-size:3.125 em;} /* 50px/16=3.125em */
#content {font-size:1.25em;} /* 20px/16=1.25em */
  • Step3. Done. Now your website text will display same on all browsers.
CSS: The Missing Manual

03 October 2013

What are the advantages of using Visual Studio to the .NET DEVELOPER?


  • Visual Studio offers much advantage to the .NET developers, some most highlighted features is given bellow:
Visual Studio to the .NET developers
Visual Studio to the .NET developers
  • Access to software design and code windows is easier than other IDE available on software development.
  • Have WYSIWYG (What You See Is What You Get) visual design support which facilitate Windows and Web Forms development.
  • Visual studio have auto Code completion support, which allows you to enter code with fewer errors and less typing.
  • Immediate flagging of syntax errors, which allows you to fix problems as they are entered.
  • The same code editor can be used for all .NET languages.
  • It has an integrated debugger, which allows you to debug the code for better software development.
  • Visual Studio helps to develop software rapidly and more easily
  • Third-party tools can be integrated into Visual Studio.
  • It has a Server Explorer features which allows you to log on to servers that you have network access to, access the data and services on those servers.
  • It has integrated build and compiles support which makes the programming life easier.
  • It has drag-and-drop controls support onto your web page.
Visual Studio Professional 2017 - PC Download

What types of applications you can build in C#.NET ?

C#.NET language can be used to develop four types of applications, these are:
  1. Console applications
  2. Windows applications
  3. ASP.NET Web applications
  4. Web services
  1. Console applications: A console application runs in a console window (ie.MS DOS) which provides simple text-based output.
  2. Windows applications: A Windows application runs on a computer desktop. Windows applications such as MS-Word and Excel, Calculator, Paint etc are example of windows application.
  3. ASP.NET applications: ASP.NET applications are developed to run on a web server which is accessible through browsers. ASP.NET technology facilitates the budding of web applications quickly and easily. Dynamic websites like http://www.microsoft.com are good example of ASP.NET applications.
    Web services
  4. Web services:Web services are complex applications that can provide services such as current weather update, product stock status, converts the temperature from Fahrenheit to Celsius and many more.
C in Depth

What is a namespace in programming language?


  • A namespace is a framework for their identifiers (class, methods). 
  • Namespace provide a way of grouping the names that are assigned to elements (class, methods) in a software application so that they don’t conflict with other class, methods names. 
  • Namespaces are heavily used in C# & other OOP language & all .NET Framework classes are organized in namespaces, to be used more clearly and to avoid confusion.

C 7.0 in a Nutshell: The Definitive Reference

What is the .NET Framework ?

  • The (dot net) .NET Framework is a software framework developed by Microsoft. It has a huge number of class libraries which provides:
    .NET Framework
  • User interface, which is used to design for software interface,
  • Database connectivity, used to connect with database
  • Cryptography, used to ensure software security,
  • Web application development, 
  • Network communications and many more facilities on software development.
  • C#, VB, J# etc are the programming language used by software developer with the combination of .NET framework to developed software application.

  • The software applications developed with the dot net framework mainly runs on Microsoft Windows OS. 

  • The most important components of the .NET framework are:
  • CLR (Common Language Runtime), which allows us to compile and execute program.
  • FCL (Framework Class Library), which has a large number of predefined types or classes to use in software development.

C 6.0 and the .NET 4.6 Framework

02 October 2013

What do you mean by CLR of Microsoft .NET framework?

  • CLR stands for Common Language Runtime. 
  • CLR is the component of the .NET Framework developed by Microsoft that allows you to compile and execute applications written in any language (i.e C#, VB) with .NET. 
  • CLR provide the following service to the .NET programming environment:
    Microsoft .NET framework

  • Exception Handling
  • Garbage Collection
  • Thread Management
  • Memory Management
  • Type Safety

30 September 2013

What are the difference between echo() and print() in PHP ?

  • To better understand the difference, you have to know the syntax with example of echo() and print(). Syntax of echo() :
void echo ( string $arg1 [, string $... ] )

  • Example of echo():
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
<?php

    echo ("The quick brown fox.");

    echo "The quick brown fox.";

    $dept_name="HR";

    echo "My department name is :$dept_name";

    echo"<p>

    Another message 1 Another message 2

    Another message 3

    </p>";

    ?>

  • Syntax of print()
int print ( string $arg )

  • Example of print():
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
    <?php

    print("The quick brown fox.");

    print "The quick brown fox.";

    $dept_name="HR";

    print "My department name is :$dept_name";

    print"<p>

    Another message 1 Another message 2

    Another message 3

    </p>";

    ?>

  • echo() is used to output one or more strings print() is used to output a string. 
  • Both echo() and print() are not actually a real function, it is a language construct. 
  • So you are not required to use parentheses with its argument list. 
  • echo() can take more than one parameter when used without parentheses. 
  • print() only takes one parameter. 
  • echo() is not a real function ,so it does not return any value. Though print() is also not a real function, but it will always returns 1. 
  • echo() has a shortcut syntax, this short syntax only works if the short_open_tag configuration setting on php.ini is enabled. 
  • Example of short_open_tag:
1
2
3
4
5
6
7
<?php

    $blog_address="http://shafiq2410.wordpress.com/";

    ?>

    <p>My Blog address is: <a href="<?=$blog_address?>" target="_blank"><?=$blog_address?></a></p>

PHP & MySQL: Novice to Ninja: Get Up to Speed With PHP the Easy Way

How to Comment your code in PHP?

  • PHP supports 'C', 'C++' and Unix shell-style (Perl style) comments. 
  • You may use any style based on your requirements. 
  • Single-Line code comments use C++ Syntax 
  • Multiple-Line code comments use C Syntax 
  • Unix Shell Syntax (Perl Style) is also used for single line comments 
  • Example: Single-Line C++ Syntax
1
2
3
4
5
6
7
 <?php

        // Title: My first PHP code

          echo "This is a PHP program.";

    ?>
  • Example: Unix Shell Syntax
1
2
3
4
5
6
7
 <?php

       # Title: My first PHP code

          echo "This is a PHP program.";

    ?>
  • Example: Multiple-Line C Syntax
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
<?php

    /*

    Title: Test Code

    Author: shafiq

    Author URL: http://shafiq2410.wordpress.com

    Email: shafiq2410@gmail.com

    */

    echo "This is a PHP program.";

    ?>
PHP Cookbook: Solutions & Examples for PHP Programmers

29 September 2013

How does code is separated in PHP?

  • PHP requires instructions to be terminated with a semicolon at the end of each statement. 
  • The closing tag (?>) of a block of PHP code automatically implies a semicolon(;) 
  • (Ref-Example 2), so you do not need to have a semicolon terminating the last line of a PHP block.
  • Example 1:
1
2
3
4
5
6
7
<?php

        echo 'This is a test';

        echo 'This is another test';

    ?>
  • Example 2:
1
<?php echo 'This is a test' ?>
  • Example 3:
1
<?php echo 'We omitted the last closing tag'; 
  • Note: The closing tag of a PHP block at the end of a file is optional and in some cases omitting it is helpful when using include() or require(), 
  • So unwanted white space will not occur at the end of files, and you will still be able to add headers to the response later.
Learning PHP, MySQL & JavaScript: With jQuery, CSS & HTML5 (Learning PHP, MYSQL, Javascript, CSS & HTML5)

What are the Syntax of PHP programming language

  • When PHP parses a file, it looks for opening PHP tag "<?php or <?" and ending php tag " ?>" which tell PHP to start and stop interpreting the code between them. 
  • Everything outside of a pair of opening and closing tags is ignored by the PHP parser. Example:
1
2
3
4
5
 <p>This is going to be ignored by PHP Parser.</p>

        <?php echo 'While this is going to be parsed.'; ?>

    <p>This will also be ignored by PHP parser.</p>
  • PHP code must have a semicolon ";" at the end of each statement.
  • The closing PHP tag "?>" automatically insert a semicolon.
  • Example:
  • 1
    2
    3
    4
    5
    6
    7
    <?php
        echo 'PHP is Fun to learn !!';
    ?>
    <br>
    <?php  echo 'PHP automatically insert a semicolon at the last closing tag' ?>
    <br>
    <?php echo 'If a PHP file have only PHP code than the last closing tag can be omitted';
    
  • Example Advanced escaping
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
<?php

        if ($expression) {

        ?>

        <strong>This is true.</strong>

        <?php

        } else {

        ?>

        <strong>This is false.</strong>

        <?php

        }

        ?> 
  • Before PHP version 7 There were four different pairs of opening and closing tags which could be used in PHP. Standard tag is always available Example: Script tag is also always available Example:
1
2
3
<script language="php">echo 'some editors (like FrontPage) don\'t like processing instructions';

            </script>
  • Short tags can be turned on and off from the php.ini configuration file. Example:
1
<?= expression ?>
  • This is a shortcut for
1
<? echo expression ?>
  • ASP style tags can be turned on and off from the php.ini configuration file Example:
1
<% echo 'You may optionally use ASP-style tags'; %><%= $variable; # This is a shortcut for "<% echo . . ." %>

PHP for the Web: Visual QuickStart Guide (5th Edition)

10 September 2013

Solution of Joomla 3.5 authentication error: Warning JAuthentication: :__construct: Could not load authentication libraries.


joomla login
joomla login


  • The solution steps are given bellow:
  •   Step1: connect your Joomla database with any database tools like phpMyadmin or Navicat for MySQL, I personally like to use Navicat.
 
  • Step2:  Find the tabprefix _extensions table in my case it’s” ybgvu_extensions” & brows for data on that table.
 
  • Step3: Find for the name ”plg_authentication_joomla” & change the enable column value from 0 to 1 & save the change.


JOOMLA tabprefix _extensions
tabprefix _extensions


  • Step 4: It’s done. Now you can login to your Joomla website using your existing username & password.
Joomla Administration panel
Joomla Administration panel

Joomla! Bible

02 September 2013

How to Change Password in Oracle using Oracle SQL developer ?

If want to change the old password of your oracle database user, then you can easily do it by the following SQL command: SQL Command Syntax:

1
ALTER user user_name identified by new_password replace old_password;

Example: Let, existing oracle user name = shafiq & password=abc123, then you to change the password of shafiq user, the correct SQL command is:

1
2
3
4
5
ALTER user shafiq

IDENTIFIED by "new_password123"

REPLACE "abc123";

Type the command on you SQL developer command SQL Worksheet or any other Database Tools you currently use.

Change Password in Oracle using Oracle SQL developer
Change password in oracle

Oracle SQL Developer Handbook (Oracle Press)

01 September 2013

Difference between the break and continue in programming language


BREAK
Break
 The break statement will terminate iteration of the loop and continue executing if there is any code that follows after the loop. Example of Break statement in JavaScript:


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
<script>

x=0;

for(x=0;x<10;x++)
{
if(x==3)
{
break;    
}
document.writeln("x=" + x + "<br />");

}


</script>
Output: x=0 x=1 x=2

Continue
Continue

The continue statement will terminate the current execution of loop and resume the loop with the next value if any. Example of Continue statement in JavaScript:
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
<script>

xx=0;

for(xx=0;xx<5;xx++)
{
if(xx==3) 
{
continue;
}
document.writeln("xx=" + xx + "<br />");
}

</script>
Output: xx=0 xx=1 xx=2 xx=4
Beginning Programming All-In-One Desk Reference For Dummies

Featured Post

How to Write PHP code and HTML code within a same file

A PHP file can have both PHP code and HTML code together. Any HTML code written outside of PHP <?php //php code here… ?> Code is ig...

Popular Posts