Wednesday, 16 July 2014

Intro to C

Every full C program begins inside a function called "main". A function is simply a collection of commands that do "something". The main function is always called when the program first executes. From main, we can call other functions, whether they be written by us or by others or use built-in language features. To access the standard functions that comes with your compiler, you need to include a header with the #include directive. What this does is effectively take everything in the header and paste it into your program. Let's look at a working program:
#include <stdio.h>
int main()
{
    printf( "I am alive!  Beware.\n" );
    getchar();
    return 0;
}
Let's look at the elements of the program. The #include is a "preprocessor" directive that tells the compiler to put code from the header called stdio.h into our program before actually creating the executable. By including header files, you can gain access to many different functions--both the printf and getchar functions are included in stdio.h. 

The next important line is int main(). This line tells the compiler that there is a function named main, and that the function returns an integer, hence int. The "curly braces" ({ and }) signal the beginning and end of functions and other code blocks. If you have programmed in Pascal, you will know them as BEGIN and END. Even if you haven't programmed in Pascal, this is a good way to think about their meaning. 

The printf function is the standard C way of displaying output on the screen. The quotes tell the compiler that you want to output the literal string as-is (almost). The '\n' sequence is actually treated as a single character that stands for a newline (we'll talk about this later in more detail); for the time being, just remember that there are a few sequences that, when they appear in a string literal, are actually not displayed literally by printf and that '\n' is one of them. The actual effect of '\n' is to move the cursor on your screen to the next line. Notice the semicolon: it tells the compiler that you're at the end of a command, such as a function call. You will see that the semicolon is used to end many lines in C. 

The next command is getchar(). This is another function call: it reads in a single character and waits for the user to hit enter before reading the character. This line is included because many compiler environments will open a new console window, run the program, and then close the window before you can see the output. This command keeps that window from closing because the program is not done yet because it waits for you to hit enter. Including that line gives you time to see the program run. 

Finally, at the end of the program, we return a value from main to the operating system by using the return statement. This return value is important as it can be used to tell the operating system whether our program succeeded or not. A return value of 0 means success. 

The final brace closes off the function. You should try compiling this program and running it. You can cut and paste the code into a file, save it as a .c file, and then compile it. If you are using a command-line compiler, such as Borland C++ 5.5, you should read the compiler instructions for information on how to compile. Otherwise compiling and running should be as simple as clicking a button with your mouse (perhaps the "build" or "run" button). 

You might start playing around with the printf function and get used to writing simple C programs.

Wednesday, 4 June 2014

How Can I Optimize My META Description - WordPress

 I’m glad you asked! Finally, we’ll get to those Conditional WordPress Tags I talked about earlier. Here is the code below:

<meta name=”description” content=”<?php if (have_posts() && is_single() OR is_page()):while(have_posts()):the_post();
$out_excerpt = str_replace(array(“\r\n”, “\r”, “\n”), “”, get_the_excerpt());
echo apply_filters(‘the_excerpt_rss’, $out_excerpt);
endwhile;
elseif(is_category() OR is_tag()):
if(is_category()):
echo “Posts related to Category:
“.ucfirst(single_cat_title(“”, FALSE));
elseif(is_tag()):
echo “Posts related to Tag:
“.ucfirst(single_tag_title(“”, FALSE));
endif;
else: ?><?php bloginfo(‘description’) ?>
<?php endif; ?>” />

Install this code in between your WordPress site’s <head></head> section in the ‘header.php’ file. Basically, this code will do a couple things.

If the search engine/user views your site’s individual pages or categories, the conditional WordPress tags kick in and tell the browser/webcrawler to grab the opening excerpt of your post/page and use that as the META Description tag.
If the search engine/user lands on the homepage, it will tell the browser/webcrawler to display the default Blog Description (which you specify on the ‘Settings’ page) as your META Description.

Tuesday, 3 June 2014

Claim Google Authorship for Your WordPress Website

Hopefully you’ve already caught the importance of Google Authorship, the mechanism by which Google’s search engine rankings can be influenced byAuthor Rank.

If you haven’t, Google Authorship basically amounts to the biggest shakeup in search since the link. It’s Google’s way of identifying the author of a piece of content to factor it as a signal of content quality.
We realize that most writers and online publishers don’t have tons of time to sift through excessively geeky posts involving underlying website code (rel= “author” or rel=”me” anyone?).
Also, the process up until this point has been confusing, to say the least. Now, that tedious code and confusion is not necessary.

Easily Claim Google Authorship with the Genesis Framework for WordPress

It’s a truly exciting time for online writers because high-value content that attracts, entertains, informs, and engages enhances the author’s authority, instead of only page or site authority. This in turn will kick in the Author Rank effect, which are search signals that are directly associated with you.
If you’re using WordPress, you’re hopefully already running the newest version (3.5) on your site. Our StudioPress division just released a new version of the Genesis Framework for WordPress with a similarly streamlined feel.
Now, with the beautiful designs, SEO benefits, and added security of Genesis also comes an effortless connection to Google Authorship.
We’ve made it very easy to get Google to associate your content with your Google+ profile. Here’s how.

How to Setup Google Authorship in 3 Easy Steps 

1. Add Your Google+ Profile Link
Go to the edit user screen (and to your profile, if you have multiple authors) in your WordPress dashboard and scroll down until you see the option box for your Google+ profile link. Copy your Google+ profile link and paste it into the Google+ option box. Here’s my Google+ profile link, to give you the right idea:

2. Add a Google+ Contributor Link
Now you’ll need to add a reciprocal link back from your Google+ profile to the site(s) you just updated. You can do this by going to your Google+ profile page, and editing the “Contributor To” section.
In the dialog that appears, click “Add custom link”, and then enter your website URL. 
3. Test Your Google Authorship Connection
Finally, you’ll want to test that you accomplished the first two steps properly.
Thankfully, Google has provided a Structured Data Testing Tool to do the checking for you.


Thursday, 29 May 2014

CSS3: Viewport Units

Developing web designs that adjust to the width or – if needed – the height of a browser window is easy with percentage-based values. You will probably be doing this on a daily basis, optimizing your website for tablets and smartphones. No matter the element, text blocks, images, everything adjusts to the size given.

But using percentage-based values is not always the best way to define sizes in relation to the browser window. Think of font sizes. A font size cannot be defined to react to a changing width of the browser window, at least not percentage-based. CSS3 introduces new units that explicitly address this problem.

Viewport Units for More Flexible Size Definitions

The units „vw“ and „vh“ define a width/height relative to the window size. We use „vw“ for „view width“ and „vh“ for „view height“. These so-called viewport units allow us to define sizes in relation to the recent size of the browser window.

div {
  width: 50vw;
  height: 100vh;
}

Our example element will take up 50% of the window width and 100% of the window height. While percentage-based values always relate to their parent element, viewport units always relate to the window size. It is even possible to define heights in relation to width and vice versa.


div {
  height: 50vw;
}

Our example defines the height of the element to be 50% of the window width. Scaling down the window width alters the element’s height.

Universal Font Size Fits Due to Viewport Units

If you want to secure a decent typography, you will want to make sure, that fonts are displayed in acceptable sizes, no matter the device it’s being displayed on. Especially large headlines need to be taken care of, to avoid having them look horrible. Use viewport units to define your font in relation to the width of the browser window.


h1 {
  font-size: 10vw;
}

Our example defines the font size to be 10% of the window width. Thanks to „vw“, the font size, defines for „h1“ will now always adjust to the browser window.

Define Sizes Depending on The Aspect Ratio

To add to the units „vw“ and „vh“, we got the units „vmin“ and „vmax“.With „vmin“ we define a size either in relation to the window height or in relation to the window width, depending on which value is smaller. I s the width smaller than the height, „vmin“ will relate to the width. You can imagine what „vmax“ does. Yup, the same, only in relation to the higher value.

div {
  width: 2vmin;
}

In this example our element will receive a width of 20% of the window width while the window width is smaller than the height. Is the height smaller than the width, the element will be defined as being 20% of the window height. It’s easy, once you played around with it a bit.

Browser Support

You won’t believe it, but viewport units are supported by all major browsers. Even the Internet Explorer is able to properly work with them, from version 10 onwards, at least. Firefox added support from version 19, Chrome from version 20.

Thursday, 15 May 2014

How to Disable Right Click and Protect Your Blog Content from Copy Cats

Blogpost content copied/stolen by other blogger is one thing that must be faced by every blogger. This often makes us angry because our works is stolen without permission, however, we can still be able to minimize it. Here, I want to give you tips how to disable right click andprotect your blog content, so, your contents will be more difficult to be copied. Indeed, there will be always a way to outsmart these tricks.
protect your blog content

This is how to protect your blog content from copy cats: (I will give you 2 ways)

First:

1. Login to your blog, we will edit our blog template, go to layout -> edit HTML.
2. Find <body> and replace with this script: <body oncontextmenu=’return false;’ onkeydown=’return false;’ onmousedown=’return false;’>
3. Finish.
It’s easy right? Here is the explanation for the HTML functions.
oncontextmenu=’return false;’  –> it is to disable right click.
onkeydown=’return false;’  –> it is to disable keyboard keys (CTRL+A, CTRL+U, etc…)
onmousedown=’return false;’   –> it is to disable mouse selection.
‘return false’   –> It is to disable function you want.
From three functions above, you can use 1, 2 or all. And this first method is great but it can be outsmarted by disabling javascript in browser. So, you need to add the second method to your blog.

Second

1.  Go to layout -> edit HTML and find </head>.
2. Then add this script above </head>
1
2
3
4
5
6
<script type='text/javascript'>
if (top.location != self.location) top.location.replace(self.location);
</script>
<script type='text/javascript'>
document.ondragstart = function(){return false;};
</script>
3. After that, add this script below <body>  (if you have used the first way, then just add below/after <body oncontextmenu=’return false;’ onkeydown=’return false;’ onmousedown=’return false;’>)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<div align='center'><noscript>
   <div style='position:fixed; top:0px; left:0px; z-index:3000; height:100%; width:100%; background-color:#FFFFFF'>
   <div style='font-family: Tahoma; font-size: 14px; background-color:#FFF000; padding: 10pt;'>To see this page as it is meant to appear, we ask that you please enable your Javascript!</div></div>
</noscript></div>
<script type='text/javascript'>
function mousedwn(e) {
try { if (event.button == 2||event.button == 3) return false; }
catch (e) { if (e.which == 3) return false; }
}
    document.oncontextmenu = function() { return false; }
    document.ondragstart   = function() { return false; }
    document.onmousedown   = mousedwn;
</script>
<style type='text/css'>
* : (input, textarea) {
 
 
    -webkit-touch-callout: none;
    -webkit-user-select: none;
}
 
 
img {
        -webkit-touch-callout: none;
        -webkit-user-select: none;        
    }
</style>
 
 
&lt;script type='text/javascript'&gt;
window.addEventListener(&quot;keydown&quot;,function (e) {
    if (e.ctrlKey &amp;&amp; (e.which == 65 || e.which == 67 || e.which == 85 || e.which == 80)) {
        e.preventDefault();
    }
})
        document.keypress = function(e) {
        if (e.ctrlKey &amp;&amp; (e.which == 65 || e.which == 67 || e.which == 85 || e.which == 80)) {
    }
        return false;
                };
&lt;/script&gt;
If you only use this second method, your visitors still can be able to do right click, CTRL+A and click copy, however, it can’t be pasted. And that script also has ability to protect your blog from copypaste although the javascript is disabled. Because your visitor will be forced to enable their browser javascript. But, for me, I recommend you to use both of these methods.
protect blog from copy paste
Well, above are two easy methods you can use and try for your blog. I have tested and used above methods in this testing blog: http://valentinesdaygiftsz.blogspot.com/. It’s so easy. Hopefully now you can protect your blog from copy cats. Happy blogging!

Saturday, 3 May 2014

Logo Design Tips

Your logo is a visual representation of your company and your brand.  It is one of the most important components to your identity and it will impact all of your marketing efforts. Successful logos can become iconic images for products. Poorly crafted logos are a long-lasting nightmare for the designers and marketers that are left to work with them. Whether you are developing a new logo or refreshing the look of an existing one, here are some basic tips to follow to make sure that your logo succeeds:
1. Understand
The first step in the process is to really understand the brand that the logo is being developed for. Make sure that you understand some key marketing elements:
·         Brandpositioning: what place does the brand occupy in the competitive landscape?
·         Brand message: what is different, special or unique about the brand?
·         Target audience: who is this brand being sold to? Need to know basic demographics like age and gender. Geography and culture are also important to understand as symbols and colors can have different meanings for different regions, religions and nationalities.
2. Research
Find out what is being done in the marketplace now.  Gather information and logos from at least the top five competitors. Knowing competitor’s positioning and messaging will also be helpful. You want to create a logo that is impactful and memorable, so knowing what already exists is essential. For logo redesigns or refreshing, collect all past logo versions. Perhaps continuity is the goal or a complete departure is needed. Either way, you need to know what has been done in the past to move forward.
3. Inspiration
Whether you are a designer or a marketer, inspiration needs to come from somewhere. Look for visuals, symbols and words that communicate your brand message. Do an online search for images or keywords and see what appears. Additionally, many logo sites exist where you can see what is currently being done in a wide variety of marketplaces. This can be a great starting point. You can even use some old school tools like a dictionary or thesaurus to look for meanings and ideas. Old sketchbooks and even previous designs you’ve done or seen can all help to get the creative process started.
4. Design
Let the fun begin! Typically this is the part that everyone enjoys the most. Here are a few things to remember when designing and reviewing logos:
·         Typography: Type only logos can be powerful and memorable. Just think Coca-Cola, Disney and FedEx. Whether using an existing typeface or creating a custom type, remember to keep it simple and readable. You want something that will stand the test of time. Also make sure that the type you pick matches the brand’s personality. Finally, remember to use a maximum of two fonts, for clarity and legibility.
·         Color and Usage: Make sure you think through all uses and color scenarios. Will the color logo work in a black and white format? It probably looks great on a white background, but how about on a dark or photo backdrop? Some simple modifications are usually all it takes to make the design work in all the necessary formats.

·         White Space and Negative Space: Keep a defined area of clear space around your logo so that the focus stays where it should—on the logo and therefore the brand. This standard can be reinforced when developing a brand book or graphic standards manual. Also, don’t forget that you can utilize the negative space in your logo to reinforce messaging, but keep it natural and not overly forced. Some cleaver examples include FedEx (look for the arrow) and the Big Ten logo (when an eleventh school was added).

DYC - Search Local Schools, Colleges, Institutes, Tutions and more

Friday, 2 May 2014

Techniques to Clean Up Your Web Design

Most people assume that a clean website design is similar to a simple web design. There is a difference between these two types of designs.
When you use a simple design, you focus on eliminating non-essential aspects and place a premium on getting your message across. This makes it easy for the content to be the main focus of the site.
Simple web designs tend to be highly functional and practical. On the other hand, a clean design includes some aesthetic aspects. It allows you to refine the elements on your website.

Use Colors Strategically

A clean design calls for strategic use of color on your website. For a clean look, you need to select light, neutral colors. These colors will allow the content to be the focus of your website. You do not want to overwhelm visitors to your site with bold colors. A limited palette is also suitable because including a wide variety of colors will shift focus from the message.
Include some limited color splashes to accentuate particular components such as your headings, navigation and logos. Using bold colors on important elements helps to draw user attention. Single, solid shades work between than gradients when you want to create a clean Melbourne fl web design.

Invest in Good, Professional Photography

People are visual, and love photos. Good imagery helps establish a connection between your business and the website visitors. This is why it is important to find quality images. A large number of website visitors judge a site based on the imagery that you include. In most cases, it can break or make your website and you should invest in professional photography.
Consider stock photos with services such as iStockphoto or Thinkstockphotos. Downloading imagery from the internet may seem like an easy way out when you are designing a clean web design but they will provide the visual element that attracts visitors and lowers bounce rates. Original images will capture the website visitors and encourage them to read the content.

Fast Load Times

Waiting for a website to load is one of the most irritating things. A professional web design needs to ensure visitors enjoy fast load times. If your web pages take minutes to load, you are highly likely to lose visitors and this can translate into lower sales. Your web design should ensure that the load time is as fast as possible. looking into cloud hosting if you have to.
Most website owners tend to compromise on load times in order to include more aesthetic elements, such as JavaScript and jQuery. Site visitors are actually more interested in fast load times and not bold colors. If a website loads fast, a visitor will be able to go through all the sections with ease and they are more likely to be visit again. This makes it easy to convert visitors to customers.

Use Intuitive Navigation


A clean web design includes intuitive navigation to make it easy for visitors to locate information and pages. It’s imperative to have a navigation bar that displays all the titles on the different pages on your website. Internal links are also helpful because they connect visitors to different pages. Intuitive navigation also includes sitemaps especially if your site has several pages.