Tuesday, 31 December 2013

Happy New Year!


To all my readers, I wish you a happy New Year! Stay tuned, as there will be more blog posts in 2014!

The most important tips of 2013 were probably:





Stay safe folks. May you all have a great and malware-free 2014!






Sunday, 29 December 2013

Delete, change or re-format the "Showing posts with label" message.

This article explains options for deleting, or changing the content or formatting of Blogger's "Showing posts with  LABEL.  Show all posts" message and it's ugly grey box.

If your blog has a Layout or Designer template, then when a person who is reading it chooses a label value, Blogger displays a page with (a summary of) your most recent posts with that label.

If there are more posts that Blogger is willing to show on one page, then there will also be "older posts" and "newer posts" links at the bottom of the page.

And - unless you have removed it - there will also be a message at the top of the page saying "Showing posts with label yourLabel. Show all posts"





Reader actions that cause a visitor to see this message include:
  • Clicking a label value that is displayed in your post header or footer
    (unless you have turned them off in the Layout > Blog Posts edit option).
  • Clicking a link that you have manually set up to show posts with a specific label (eg if you have used a Pages gadget to make a menu bar, and one of the options in it has a value like http://www.yourBlog.com/search/label/yourLabel?max-results=999

Unfortunately Blogger does not provide any way to customize or configure this message.
.
But it is easy enough to totally delete it, or to change the formatting, or to change the text..


How to delete the "Showing posts with LABEL" message

There are two ways that you can remove the "Showing posts with Label.   Show all posts" message.

Option 1:   Remove the code totally.   

To do this,

1  Edit your template in the usual way

2  Find the following text
<b:includable id='status-message'>
<b:if cond='data:navMessage'>
<div class='status-msg-wrap'>
<div class='status-msg-body'>
<data:navMessage/>
</div>
<div class='status-msg-border'>
<div class='status-msg-bg'>
<div class='status-msg-hidden'><data:navMessage/></div>
</div>
</div>
</div>
<div style='clear: both;'/>
</b:if>
</b:includable>

3   Delete that text and replace it with
<b:includable id='status-message'>
<b:if cond='data:navMessage'>
<div>
</div>
<div style='clear: both;'/>
</b:if>
</b:includable>

(If you just delete the text and do not put the replacement in, then it is possible that Blogger will add that section back in again later.)


Option 2:  Hiding the message using CSS

To do this, add  this CSS rule to your template in the usual way:
.status-msg-wrap,
.status-msg-body {
display: none;
}
(This approach is less risky because you do not need to edit your template, and because it's easier to change later.   But some people have reported that on their template, it has not worked.)


How to change the format of the "Showing posts with LABEL" message

Some people don't mind the actual  "Showing posts with Label.   Show all posts" message.   But they want to format it in a way that suits their blog's layout and colour scheme.

This is easily done, by adding some extra CSS rules to your template in the usual way.

To change the format of the message text, use rules like this:
.status-msg-body {
text-align: left;
line-height: 1.4;   
font-weight: bold;
color: red;
padding: 0.5em 0.3em;
width: 100%;
}

To change the grey-shaded background or the box:
.status-msg-wrap {
width: 100%;
margin: 0 auto;   /*  keep the auto statement if the width is less than 100%, so the box is centered */
position: relative;
}

There are a wide range of options - check with CSS reference guides for the options.   You may need to carry out some experiments with your template and how it looks with various options to decide on the best combination for your blog.



How to change the "Showing posts with LABEL" message

There are several ways that you can change the text in the "Showing posts with Label.   Show all posts" message.

Option 1:   Just replace it with some text

To show a sentence of your own instead of Blogger's standard message, 

1  Edit your template in the usual way

2  Find the following text
<b:includable id='status-message'>
<b:if cond='data:navMessage'>
<div class='status-msg-wrap'>
<div class='status-msg-body'>
<data:navMessage/>
</div>
<div class='status-msg-border'>
<div class='status-msg-bg'>
<div class='status-msg-hidden'><data:navMessage/></div>
</div>
</div>
</div>
<div style='clear: both;'/>
</b:if>
</b:includable>

3   Replace the line in bold (ie <data:navMessage/> ) with your own words.

For example, you might say
<b:includable id='status-message'>
<b:if cond='data:navMessage'>
<div class='status-msg-wrap'>
<div class='status-msg-body'>
Posts in this category include (use the Older Posts link to see previous posts):
</div>
<div class='status-msg-border'>
<div class='status-msg-bg'>
<div class='status-msg-hidden'><data:navMessage/></div>
</div>
</div>
</div>
<div style='clear: both;'/>
</b:if>
</b:includable>

To show the searched-for label value in your message, you need to use the   <data:blog.searchLabel/>   tag. For example, you might say
<b:includable id='status-message'>
<b:if cond='data:navMessage'>
<div class='status-msg-wrap'>
<div class='status-msg-body'>
Posts about <data:blog.searchLabel/>  include (use the Older Posts link to see previous posts):
</div>
<div class='status-msg-border'>
<div class='status-msg-bg'>
<div class='status-msg-hidden'><data:navMessage/></div>
</div>
</div>
</div>
<div style='clear: both;'/>
</b:if>
</b:includable>

Note:  if you are going to use this tag, then you need to choose your label values very carefully, so that they all make sense.   For example, in one blog I have some posts labelled "For quiz organizers" and others labelled "Finance", "Organisation" etc.    There is no way that I can write a sentence including the labels that makes sense for both of these.




Related Articles:





Friday, 27 December 2013

Torque3D seems to finally get a Linux port!

Following the release of the Torque3D engine under the MIT license (latest release 3.5 here), there was a lot of back and forth regarding a port to Linux (the engine actually used to have a good Linux port, but that one was dropped a few years back). At some point there was even an official Kickstarter crowed-funding attempt, which however failed to reach the estimated funds (but nether the less more than US$10k were pledged). After that things quited down, but several people continued developing a OpenGL renderer and Linux port.

Now it seems like all these efforts seem to be near a somewhat usable Linux port or at least that's what I understand by following this forum thread.

Torque3D running on Xubuntu 12.10

In the short term the most interesting application of this Linux port is probably that the creator of RotC has announced on his currently running indigogo campaign to liberate (and update) the game, that now there will also be a Linux port.

Great news if you ask me, so don't forget to pledge some of that Christmas money you got towards reaching the funding goal (currently $388 out of $1500, with 36 days left). Let's make this happen!

Edit (nearly forgot): these two projects related to Torque3D might be interesting to follow: Project GREED and Zentense.

Wednesday, 25 December 2013

December RTS updates

Merry Christmas from FreeGamer!

As a nice present from the 0 A.D. team, the new Alpha 15 Osiris was released today:



Lots of great new features and especially multiplayer games should be now much easier to do with hosting improvements and a lobby for browsing available games.

Another open-source RTS engine (using Mono/C# though) has also released a new version: OpenRA. Currently it is still geared toward running an assortment of older Command & Conquer based games, so you need to own these for the data. But this release adds lua scripting for the creation of custom missions, so maybe someone will come up with a libre game to run on this engine.

Last but not least, a new version of Warzone2100 was released about a week ago. This one actually includes some higher resolution textures, which is hopefully the first step to officially integrate all the awesome new art assets from the art revolution project.
Speaking of WZ mods: There is also an interesting new tower-defense mod currently being developed.

Tuesday, 24 December 2013

Google Adsense Approval Trick To Monetize YouTube

 Today, I have got some relief and thus publishing an important article about getting an Approved Adsense Account in 1 hour. I was getting several request, Where user asked me to provide some easiest method for getting an Approved Adsense Account.
Google Adsense is undoubtedly one of the best Ad network for bloggers and Web Masters but getting an approved adsense account was never an easy procedure. However, those days are passed and now, You can get an Approved Adsense Account in 1 hour. Isn’t that unbelievable? But it is true. In this post, I will show you “How to get an Approved Adsense Account in 1 hours?”
You can get an Approved Adsense Account in 1 hours through the help of YouTube Monetization method. The whole procedure is shown below:
  • First of all, Create a New Gmail Acount .  If you haven’t used your Old GMail account for Monetization then you can also use your Old account as well. If your country is not supported by Adsense then choose a country like US and UK, while creating New Gmail Account
  • Login to your “YouTube” Account by visiting https://www.youtube.com/
  • Visit http://youtube.com/account_monetization
  • Enable “Monetization” for your YouTube Account. The screenshot for doing the same is given below:
211

After that, You will have to “Accept” all terms and condition. The screenshot of the same is given below:
21
Finally, Click on “Monetize” Button. The screenshot of the same is given below:
211
  • After doing that, You will receive an EMail in your Inbox.
  • Now, Upload a Unique video in your YouTube Account. While doing that, Don’t forget to add appropriate description and Tags for videos. Wait for the upload to get completed. Once done, Publish it.
  • To associate an Adsense Account, Visit https://www.youtube.com/account_monetization and expand the topic “How Will I be Paid” and click on the link “Associate an Adsense Account“. The screenshot of the same is given below:
52
Now, You will be redirected to a screen, Where you will have to set up your Adsense Account. Click on “Continue” button for filling your other details such as Address, Country, Payee Name etc
apply-for-adsense-5

After clicking on “Continue” button, You will see the below given screen. Enter all details correctly.
fill-adsense-aplication-form-form-6
  • After filling all details, Click on “Submit” button. Wait for 1-2 hours. You will get an EMail containing the details of  an Approved Adsense Account. Hurray….Hurray…enjoy.
  • Login to your Adsense Account
  • Click on “Account Settings” option on Home Page. The screenshot of the same is given below:
52 How to get an Approved Adsense Account in 1 hour?
  • Move to “Access and Authorization” section. You will find this section at the end of “Account Settings” Page.
  • Click on “Edit” link which appears next to “Only host sites are allowed to show ads for your account” option.
  • Now, Add the url of your website(where you want to show Ads) on “Show Ads on Other Website” Page. You have done most of your work.
  • Finally, Create an Ad Unit and implement the code in your website.. Enjoy.
  • If you want to display Adsense Ads on Blogger Blog, Simply Associate your Adsense Account with blogger.
The above described method for getting an Approved Adsense Account in 1 hour is the easiest one. Anyone can easily get an Approved adsense account. The method is tested and 100% working. However, Always follow the terms and condition of Adsense otherwise they will ban your accountwithout any pre-warning.
Simply Give it a try and post your comments.

Monday, 23 December 2013

AUD/USD Forex 24th December 2013

AUD/USD Primary & Monthly Cycles

December lows currently supporting the trend,
whilst the overall bias is to move down into the 2014 lows/BUY ZONE, as part of the Primary Break-n-Extend pattern.

Short-term resistance during the rest of December #A @ 89.90

Until those lows are reached, then 1st Quarter resistance around 91.40/70

Popular Posts Widget for Christmas

The Christmas countdown has begun and while homes are decorated with colorful lights and the sweet smell of pine trees, there's no reason why we wouldn't decorate our Blogspot blog with Christmas bells next to the Popular Posts widget for Blogger!

So, today I was playing around a bit with CSS and I was thinking that it would be cool to add some fresh styles to the Popular Posts widget in such a way to look just ready for the forthcoming Christmas holiday.

popular posts widget, blogger gadgets

To see a demo for the Popular Posts widget for Christmas, please visit the demo blog:


How to Add Popular Posts Widget with Christmas Bells in Blogger

Step 1. Log in to your Blogger Dashboard, then go to 'Template' and click the 'Edit HTML' button:


Step 2. Click anywhere inside the code area and press the CTRL + F keys, then search for this tag:
</head>
Step 3. Just above the </head> tag, add the following CSS code:
<style>
#PopularPosts1 .item-thumbnail:before{
display: block;
content: url('https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiL3-SRBh41U6liCZUEo-mIR86f2BtyDPat-RacJP6Nq3e2Fw-sBl1mEnVZCFUdjmIHOp1Kf31cY2hCFI58ZEFR3iPEbeV86VeUVl4lpVxg9m_vHMBMQyCzPCuDLXJ6ZRmuwxbjvc99h5Oc/s1600/bells.png');
margin-left: -15px;
margin-top: -5px;
z-index: 2;
position: absolute;
}
#PopularPosts1 .item-thumbnail img{
float:left;
margin:5px;
padding: 2px;
border: 6px solid #FED74C;
height: 72px;
width: 92px;
position: relative;
background: #F11C25;
-webkit-box-shadow: 2px 2px 5px rgba(0,0,0,0.3);
-moz-box-shadow: 2px 2px 5px rgba(0,0,0,0.3);
box-shadow: 2px 2px 5px rgba(0,0,0,0.3);
transition: opacity 1s ease;
}
#PopularPosts1 ul li:nth-child(odd){
  -ms-transform:rotate(20deg); /* IE 9 */
  -moz-transform:rotate(20deg); /* Firefox */
  -webkit-transform:rotate(20deg); /* Safari and Chrome */
  -o-transform:rotate(20deg); /* Opera */
 -webkit-transition: all 0.2s ease-in-out;
-moz-transition: all 0.2s ease-in-out;
-o-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
}
#PopularPosts1 ul li:nth-child(even){
  -ms-transform:rotate(-40deg); /* IE 9 */
  -moz-transform:rotate(-40deg); /* Firefox */
  -webkit-transform:rotate(-40deg); /* Safari and Chrome */
  -o-transform:rotate(-40deg); /* Opera */
 -webkit-transition: all 0.2s ease-in-out;
-moz-transition: all 0.2s ease-in-out;
-o-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
}
#PopularPosts1 ul li:nth-child(odd):hover{
  -ms-transform:rotate(0deg); /* IE 9 */
  -moz-transform:rotate(0deg); /* Firefox */
  -webkit-transform:rotate(0deg); /* Safari and Chrome */
  -o-transform:rotate(0deg); /* Opera */
}
#PopularPosts1 ul li:nth-child(even):hover{
  -ms-transform:rotate(0deg); /* IE 9 */
  -moz-transform:rotate(0deg); /* Firefox */
  -webkit-transform:rotate(0deg); /* Safari and Chrome */
  -o-transform:rotate(0deg); /* Opera */
}
#PopularPosts1 ul li{
display: inline-block;
float: left;}
#PopularPosts1 .item-thumbnail{
width: 70px;
}
#PopularPosts1 li{
margin-right: 15px;
}
#PopularPosts1 .item-snippet, .item-title{
display: none;
} </style>
Step 4. Click the 'Save Template' button to save the changes and you're done. Enjoy!

Also, please check out this tutorial on how to add falling snowflakes in the background of a Blogger blog.

Sunday, 22 December 2013

How to Use Character Entities in CSS, HTML and JavaScript

Sometimes, when using scripts, we must write special characters like accents by using a special set of codes called character entities. However, these don't always look good or we get a question mark or other strange symbols. Usually, this is solved if the character encoding is done right but the logic may not always work.

In Blogger, special characters most of the time appear correctly, but when it is about other services, like external files, things can get complicated.

For example, this usually looks good and when you click on this link, you should see the letters in the right way:
alert(" á é í ó ú  ☺ ✛ ❤ ");
If we are trying to use other method and we want to use this type of characters, sometimes we need to write them in a special format called escape sequence which is nothing but a backslash followed by a letter and a number in hexadecimal format. In the case of common characters or accents, it would be \x followed by two hex digits:
\xe1 is the letter á
\xe9 is the letter é
\xed is the letter í
\xf3 is the letter ó
\xfa is the letter ú
Other combinations generate special characters:
\n is a line break
\t is the tab character
\' is single quote
\" is double quote
\\ is a back slash
Or we can use \u followed by the Unicode character code expressed as four hexadecimal digits:
\u00e1 is the letter á
\u00e9 is the letter é
\u00ed is the letter í
\u00f3 is the letter ó
\u00fa is the letter ú
This will allow us to see correctly what we couldn't before if we were using some other services:
alert(" \u263a \u2764 \u271b ");
On this page you can find a comprehensive list of all the characters, both symbols and different alphabets.

Although rare characters are not often used in the CSS, there is a case when they are necessary as well, like when using the content property with the :after and :before pseudo-elements.

The same criteria applies there, but we only need to add a backslash followed by the four-digit hexadecimal code. For example:
content: ":\24d1\24d4\24d5\24de\24e1\24d4";

content: ":after  \263a  \2724  \2602";
:ⓑⓔⓕⓞⓡⓔ
:after ☺ ✤ ☂

Remember that IE doesn't understand the :before pseudoclass with content, and you would have to set the list-style-type property as none, or you would get 2 bullets in CSS compliant browsers.

Saturday, 21 December 2013

Let's Play Permissions for Open Source Games With Free Art

Let's Play (LP) is an uprising form of previewing and experiencing video games.

While a review summarizes the experience, a LP allows to look a player over their shoulder and indirectly experience the game from one perspective in its entirety - if both Let's Player and viewer have the endurance.

LPs have many styles: non-commented, informational, humorous... And their production quality varies too, be it video, audio or presentation.

Example of a Let's Play video in its natural environment

Some creators of LPs ("LPers") earn money using YouTube's monetization features. When they do, YouTube's semi-automatic moderation process starts paying more attention to the videos' compliance with copyright.

Sometimes, LPers will contact game developers to receive permission to create LPs. To many creators of games, LPs are a welcome form of promotion and they will always say yes.

Clint Bellanger of FLARE released a Let's Play policy, which elegantly covers both the situation in which a game's art assets are CC-BY-SA 3.0 licensed and where all copyright belongs to one person.

FLARE is a collaborative effort of many artists who agreed to release their art under CC-BY-SA 3.0 and I think that FLARE's LP policy reflects the intention of the license very well.

A complicated case might be a game which contains art that is under the GPL, which could be interpreted in a way, that requires the resulting video, as well as video project files to be made available under GPL as well.

In theory, any LP could be considered "fair use". However, for-profit use and use of large portions of a work are often considered as not being "fair use" - for example by YouTube.

For game designers, I consider LPs to be a valuable resource, allowing to look up features or part-experience gameplay, where acquiring, installing and playing the game would be impossible, due to time restrictions.

I recommend looking up games that you have fond memories of or which you always wanted to try but the installation effort was too high on lparchive.org or just YouTube's search function with "let's play" in the query.

If YouTube's HTML5 doesn't work for you, youtube-dl will allow you to circumvent flash player issues (monetized YouTube videos appear to require flash).

How to Create a Sitemap or Table of Contents in Blogger

One of the limitations of a blog is that it doesn't have an index or sitemap of the site to make it easier for readers to find the content that they are searching for. While the blog archive and labels have all the information about the published post, these do not appear on a single page completely, so searching for more posts is not always easy.

Luckily, this gadget will help you to add a table of contents or sitemap on Blogger showing the index of all posts separated by categories that have been published. It will also show the latest posts with a text saying New!

table of contents, sitemap, blogger

Demo: You can see it in action by clicking here.

How To Add a Sitemap with a List of Posts to Blogger

To implement it on your blog, follow the steps below:

Step 1. Login to your Blogger Dashboard and select your blog

Step 2. Go to "Pages" > click the "New Page" button.

Step 3. Click on the HTML tab and paste the following code inside the empty box:
<style>
p.labels a{color: #242424; text-transform: uppercase;font-size: 15px;}
a.post-titles {color: #0000FF;}
ol li{list-style-type:decimal;line-height:25px;}
</style>
<script>
//<![CDATA[
var postTitle=new Array();var postUrl=new Array();var postPublished=new Array();var postDate=new Array();var postLabels=new Array();var postRecent=new Array();var sortBy="titleasc";var tocLoaded=false;var numChars=250;var postFilter="";var numberfeed=0;function bloggersitemap(a){function b(){if("entry" in a.feed){var d=a.feed.entry.length;numberfeed=d;ii=0;for(var h=0;h<d;h++){var n=a.feed.entry[h];var e=n.title.$t;var m=n.published.$t.substring(0,10);var j;for(var g=0;g<n.link.length;g++){if(n.link[g].rel=="alternate"){j=n.link[g].href;break}}var o="";for(var g=0;g<n.link.length;g++){if(n.link[g].rel=="enclosure"){o=n.link[g].href;break}}var c="";if("category" in n){for(var g=0;g<n.category.length;g++){c=n.category[g].term;var f=c.lastIndexOf(";");if(f!=-1){c=c.substring(0,f)}postLabels[ii]=c;postTitle[ii]=e;postDate[ii]=m;postUrl[ii]=j;postPublished[ii]=o;if(h<10){postRecent[ii]=true}else{postRecent[ii]=false}ii=ii+1}}}}}b();sortBy="titleasc";sortPosts(sortBy);sortlabel();tocLoaded=true;displayToc2();document.write('</br><div class="sitemap-link"><a href="http://helplogger.blogspot.com/2013/12/add-sitemap-table-of-contents-to-blogger.html" style="font-size: 10px; text-decoration:none; color: #5146CD;">Get This Widget</a></div>')}function filterPosts(a){scroll(0,0);postFilter=a;displayToc(postFilter)}function allPosts(){sortlabel();postFilter="";displayToc(postFilter)}function sortPosts(d){function c(e,g){var f=postTitle[e];postTitle[e]=postTitle[g];postTitle[g]=f;var f=postDate[e];postDate[e]=postDate[g];postDate[g]=f;var f=postUrl[e];postUrl[e]=postUrl[g];postUrl[g]=f;var f=postLabels[e];postLabels[e]=postLabels[g];postLabels[g]=f;var f=postPublished[e];postPublished[e]=postPublished[g];postPublished[g]=f;var f=postRecent[e];postRecent[e]=postRecent[g];postRecent[g]=f}for(var b=0;b<postTitle.length-1;b++){for(var a=b+1;a<postTitle.length;a++){if(d=="titleasc"){if(postTitle[b]>postTitle[a]){c(b,a)}}if(d=="titledesc"){if(postTitle[b]<postTitle[a]){c(b,a)}}if(d=="dateoldest"){if(postDate[b]>postDate[a]){c(b,a)}}if(d=="datenewest"){if(postDate[b]<postDate[a]){c(b,a)}}if(d=="orderlabel"){if(postLabels[b]>postLabels[a]){c(b,a)}}}}}function sortlabel(){sortBy="orderlabel";sortPosts(sortBy);var a=0;var b=0;while(b<postTitle.length){temp1=postLabels[b];firsti=a;do{a=a+1}while(postLabels[a]==temp1);b=a;sortPosts2(firsti,a);if(b>postTitle.length){break}}}function sortPosts2(d,c){function e(f,h){var g=postTitle[f];postTitle[f]=postTitle[h];postTitle[h]=g;var g=postDate[f];postDate[f]=postDate[h];postDate[h]=g;var g=postUrl[f];postUrl[f]=postUrl[h];postUrl[h]=g;var g=postLabels[f];postLabels[f]=postLabels[h];postLabels[h]=g;var g=postPublished[f];postPublished[f]=postPublished[h];postPublished[h]=g;var g=postRecent[f];postRecent[f]=postRecent[h];postRecent[h]=g}for(var b=d;b<c-1;b++){for(var a=b+1;a<c;a++){if(postTitle[b]>postTitle[a]){e(b,a)}}}}function displayToc(a){var l=0;var h="";var e="Post Title";var m="Click to sort by title";var d="Date";var k="Click to sort by date";var c="Category";var j="";if(sortBy=="titleasc"){m+=" (descending)";k+=" (newest first)"}if(sortBy=="titledesc"){m+=" (ascending)";k+=" (newest first)"}if(sortBy=="dateoldest"){m+=" (ascending)";k+=" (newest first)"}if(sortBy=="datenewest"){m+=" (ascending)";k+=" (oldest first)"}if(postFilter!=""){j="Click to view all"}h+="<table>";h+="<tr>";h+='<td class="header1">';h+='<a href="javascript:toggleTitleSort();" title="'+m+'">'+e+"</a>";h+="</td>";h+='<td class="header2">';h+='<a href="javascript:toggleDateSort();" title="'+k+'">'+d+"</a>";h+="</td>";h+='<td class="header3">';h+='<a href="javascript:allPosts();" title="'+j+'">'+c+"</a>";h+="</td>";h+='<td class="header4">';h+="Read all";h+="</td>";h+="</tr>";for(var g=0;g<postTitle.length;g++){if(a==""){h+='<tr><td class="entry1"><a href="'+postUrl[g]+'">'+postTitle[g]+'</a></td><td class="entry2">'+postDate[g]+'</td><td class="entry3">'+postLabels[g]+'</td><td class="entry4"><a href="'+postPublished[g]+'">Read</a></td></tr>';l++}else{z=postLabels[g].lastIndexOf(a);if(z!=-1){h+='<tr><td class="entry1"><a href="'+postUrl[g]+'">'+postTitle[g]+'</a></td><td class="entry2">'+postDate[g]+'</td><td class="entry3">'+postLabels[g]+'</td><td class="entry4"><a href="'+postPublished[g]+'">Read</a></td></tr>';l++}}}h+="</table>";if(l==postTitle.length){var f='<span class="toc-note">Show All '+postTitle.length+" Posts<br/></span>"}else{var f='<span class="toc-note">Show '+l+" posts by category '";f+=postFilter+"' the "+postTitle.length+" Total Posts<br/></span>"}var b=document.getElementById("toc");b.innerHTML=f+h}function displayToc2(){var a=0;var b=0;while(b<postTitle.length){temp1=postLabels[b];document.write("<p/>");document.write('<p class="labels"><a href="/search/label/'+temp1+'">'+temp1+"</a></p><ol>");firsti=a;do{document.write("<li>");document.write('<a class="post-titles" href="'+postUrl[a]+'">'+postTitle[a]+"</a>");if(postRecent[a]==true){document.write(' - <strong><span style="color: rgb(255, 0, 0);">New!</span></strong>')}document.write("</li>");a=a+1}while(postLabels[a]==temp1);b=a;document.write("</ol>");sortPosts2(firsti,a);if(b>postTitle.length){break}}}function toggleTitleSort(){if(sortBy=="titleasc"){sortBy="titledesc"}else{sortBy="titleasc"}sortPosts(sortBy);displayToc(postFilter)}function toggleDateSort(){if(sortBy=="datenewest"){sortBy="dateoldest"}else{sortBy="datenewest"}sortPosts(sortBy);displayToc(postFilter)}function showToc(){if(tocLoaded){displayToc(postFilter);var a=document.getElementById("toclink")}else{alert("Just wait... TOC is loading")}}function hideToc(){var a=document.getElementById("toc");a.innerHTML="";var b=document.getElementById("toclink");b.innerHTML='<a href="#" onclick="scroll(0,0); showToc(); Effect.toggle(\'toc-result\',\'blind\');">?? Display Table of Contents</a> <img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEit5b9DVugDIpBexNhk43nR9zgf7tgjS_uHNnsTd1JC36tBA7tfyuuBYS0PpJSVaWPtq5GlTlcFbY4HuwW3E4NCJlJy6MoU7xxcGGNVykCpzdetA1egttiMPZb2Eq1yOm9dILNFjWcW8nSs/s1600/new_icon.gif"/>'}function looptemp2(){for(var a=0;a<numberfeed;a++){document.write("<br>");document.write('Post Link : <a href="'+postUrl[a]+'">'+postTitle[a]+"</a><br>");document.write('Read all : <a href="'+postPublished[a]+'">'+postTitle[a]+"</a><br>");document.write("<br>")}};
//]]>
</script>
<script src="http://helplogger.blogspot.com/feeds/posts/default?max-results=9999&amp;alt=json-in-script&amp;callback=bloggersitemap"></script>
After adding the above code, replace http://helplogger.blogspot.com with the address of your blog.

How to Customize the Sitemap for Blogger

  • to change the color and font size of categories title, replace the values in red
  • to change the color of the links, replace the value in green
Step 4. Click "Options" on the right side of the post editor and select "Don't allow, hide existing" for the Reader comments.

Step 5. Finally, click the "Publish" button and see the page. That's it!

The index of the posts is sorted alphabetically and is updated automatically each time a new post is published.

Thursday, 19 December 2013

Using JQuery + EasyDrag to Move Elements or Images by Clicking on Them

This is a simple and easy-to-use jQuery plugin which enables drag and drop functionality to make your site more interactive so that readers can "play" with certain elements on the page by dragging them from one side to another. For example, they can drag the images with a script to move them on any part of the blog just with a mouse click.


Drag and Drop Elements or Images on click with jQuery & EasyDrag

To see how this works, please visit the demo blog and click on any item, then move it anywhere on the screen:


Adding EasyDrag & jQuery to Move Elements or Images in Blogger

1. Login to your Blogger account, go to 'Template' and click the 'Edit HTML' button:


2. Click anywhere inside the template's code and press the CTRL + F keys to search for this tag:
</head>
3. Just before </head> paste the following scripts:
<script src='http://code.jquery.com/jquery-latest.js' type='text/javascript'/>
<script type='text/javascript'>
//<![CDATA[
(function($){var isMouseDown=false;var currentElement=null;var dropCallbacks={};var dragCallbacks={};var lastMouseX;var lastMouseY;var lastElemTop;var lastElemLeft;var dragStatus={};$.getMousePosition=function(e){var posx=0;var posy=0;if(!e)var e=window.event;if(e.pageX||e.pageY){posx=e.pageX;posy=e.pageY;}
else if(e.clientX||e.clientY){posx=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;posy=e.clientY+document.body.scrollTop+document.documentElement.scrollTop;}
return{'x':posx,'y':posy};};$.updatePosition=function(e){var pos=$.getMousePosition(e);var spanX=(pos.x-lastMouseX);var spanY=(pos.y-lastMouseY);$(currentElement).css("top",(lastElemTop+spanY));$(currentElement).css("left",(lastElemLeft+spanX));};$(document).mousemove(function(e){if(isMouseDown&&dragStatus[currentElement.id]=='on'){$.updatePosition(e);if(dragCallbacks[currentElement.id]!=undefined){dragCallbacks[currentElement.id](e,currentElement);}
return false;}});$(document).mouseup(function(e){if(isMouseDown&&dragStatus[currentElement.id]=='on'){isMouseDown=false;if(dropCallbacks[currentElement.id]!=undefined){dropCallbacks[currentElement.id](e,currentElement);}
return false;}});$.fn.ondrag=function(callback){return this.each(function(){dragCallbacks[this.id]=callback;});};$.fn.ondrop=function(callback){return this.each(function(){dropCallbacks[this.id]=callback;});};$.fn.dragOff=function(){return this.each(function(){dragStatus[this.id]='off';});};$.fn.dragOn=function(){return this.each(function(){dragStatus[this.id]='on';});};$.fn.easydrag=function(allowBubbling){return this.each(function(){if(undefined==this.id||!this.id.length)this.id="easydrag"+(new Date().getTime());dragStatus[this.id]="on";$(this).css("cursor","move");$(this).mousedown(function(e){$(this).css("position","absolute");$(this).css("z-index","10000");isMouseDown=true;currentElement=this;var pos=$.getMousePosition(e);lastMouseX=pos.x;lastMouseY=pos.y;lastElemTop=this.offsetTop;lastElemLeft=this.offsetLeft;$.updatePosition(e);return allowBubbling?true:false;});});};})(jQuery);
//]]>
</script>
Note: If you already have jQuery, please remove the code in red.

4. Save the changes by clicking the 'Save template' button.

How to Move Elements or Images on Click Using EasyDrag & jQuery

Now, when you want to use EasyDrag to drag and drop an image, use the code below inside the HTML of your post or page (create a New post, then switch to the HTML tab):
<img id="easydrag1" src="image-URL" style="border: 0px none; cursor: move;" />
<script type="text/javascript">
$(function(){ $("#easydrag1").easydrag();});
</script>
Note: change the text in blue with the URL of your image and please note that each image has an unique id. Here, for example, the id is called easeydrag1 which has been added both in the HTML of the image and JavaScript function.

If you need to use EasyDrag to move a second element, then add your image with a different id, for example easydrag2, otherwise it won't work:
<img id="easydrag1" src="image-URL" style="border: 0px none; cursor: move;" />
<script type="text/javascript">
<img id="easydrag2" src="image-URL" style="border: 0px none; cursor: move;" />
<script type="text/javascript">
$(function(){ $("#easydrag1").easydrag();});
$(function(){ $("#easydrag2").easydrag();});
</script>

How to add a link to a draggable image?

We will add a JavaScript event, so that when we will double click on the image, to open the page we want.

The code to use should look something this:
<img id="easydrag1" style="cursor:move; border:0px;" ondblClick="javascript:window.open('link-URL')" src="image-URL" /><script type="text/javascript">
$(function(){ $("#easydrag1").easydrag();});
</script>
Using the script above, the image can be dragged around easily and be activated by double clicking on it.

Wednesday, 18 December 2013

Reminder: 1 week left to vote

Voting for the Linux Game Awards January 2014 will come to an end in about one week (24th of December).



So if you haven't voted yet, don't waste any time!
You can read more about the award in this older blog entry.

Tuesday, 17 December 2013

android intent example

In this post we are going to make an example that demonstrate the use of intent, intent filter and startActivity in android.
Create a new android application project in eclipse and name it as IntentDemo. I change the activity name as First_Activity and corresponding layout name as first_layout.
Ads by Google


Place a button on the first_layout.xml file as shown bellow.
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"  
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".First_Activity" >
<Button
android:id="@+id/bn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="51dp"
android:text="Go TO SECOND ACTIVITY" />
</RelativeLayout>

Now create a new Activity with class name  Second_Activity.java and layout name second_layout.xml.
Open the AndroidManifest.xml file and add the following code within the application tag.

 <activity  
android:name=".Second_Activity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="second_filter" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>

Create an object of the intent in First_Activity.java file and start the second activity using startActivity method.

                     Intent i = new Intent("second_filter");  
startActivity(i);

Finalized code for First_Activity.java is given bellow.

 package com.intentdemo;  
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
public class First_Activity extends Activity {
Button button;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.first_layout);
button = (Button)findViewById(R.id.bn);
button.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Intent i = new Intent("second_filter");
startActivity(i);
}
});
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.first_, menu);
return true;
}
}

Code for Second_Activity.java
 package com.intentdemo;  
import android.app.Activity;
import android.os.Bundle;
public class Second_Activity extends Activity{
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.second_layout);
}
}


Schema.org + Notepad++ = 💘

notepad-best-code-editor
I love Notepad++. Since i use Windows this is my code editor of choice (there are 4 years, befor i was a Mac-fanboy using TextWrangler). It is free, stable, customisable (visually with themas, and with user defined languages), extendable with rich plugin repository, has active development team, so it gets offen updates. One day i thought, there could be something better beside of Notepad++ and searched. What i found, was an article about 15 most popular code editors and a poll - look at the poll results, you know, what was my decision;)

Since 2011 i love Schema.org too. I extensively use microdata on each site i get in my hands - my own record is 125 microdata classes and properties in a single web document (detail page of a books online shop), and no single one is spam, all of them are existing and useful product informations.

Getting married

It was just obvious i decided to optimize my handwork and make Notepad++ and Schema.org vocabulary working together (and, last but not least, to create a free additional value for all, who have similar needs).
Read full article »

android button example

In this post we are going to see how to create a simple android application that contains two buttons and how to create the response for the button clicks.
Create a new android project named ButtonDemo in eclipse.
In  the activity_main.xml add two buttons as shown bellow.
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"  
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity" >
<Button
android:id="@+id/button2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:onClick="clickMeMethod"
android:text="@string/first_button" />
<Button
android:id="@+id/bn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/button2"
android:layout_centerHorizontal="true"
android:layout_marginTop="39dp"
android:text="Click me too" />
</RelativeLayout>

Now made the following changes in the MainActivity.java file which is on the package coming under the Src folder.
 package com.buttondemo;  
import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.Toast;
public class MainActivity extends Activity {
Button button;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
button = (Button)findViewById(R.id.bn);
button.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Toast.makeText(getBaseContext(), "You click the CLICK ME TOO button", Toast.LENGTH_LONG).show();
}
});
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
public void clickMeMethod(View v)
{
Toast.makeText(getBaseContext(), "You just click CLICK ME button", Toast.LENGTH_LONG).show();
}
}

Save the project and run.
android create buttonandroid button tutorial




Ads by Google




Monday, 16 December 2013

create your first android app

In this post i explain how to create your first android application. I use the eclipse ide for the development purpose.
See this article for the installation and configuration of eclipse for android.

Create a new android application project with name HelloWorld. (Click the image to enlarge.)
hello-world-android-app

Now on the activity_main.xml file add a new TextView as shown bellow.
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"  
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity" >
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/greeting_message"
/>
</RelativeLayout>

There is no need to make any other changes on the project. Right click the project and select run as android application to run the application.
create-android-app



Ads by Google



How To Add Snow In The Background of Your Blog Using CSS

Today we’re going to go over a super simple CSS technique that you can use to make it snow on your Blogger blog. It seems particularly attractive since it doesn't require scripts, only CSS and three small images.

An advantage of this method is that by not using scripts doesn't overload the blog, the disadvantage being that users with not so modern browsers, will not be able to see it (in Internet Explorer works for version 10 and up).

The snow will fall in the background of the blog, which, in addition, prevent interfering with links or content (because the flakes are images), also prevent blocking the visibility of the content of the blog.

falling snow, snow, winter background, blogger



How To Add Falling Snow To Blogger Blogspot

Step 1. Go to "Template" and click on the "Edit HTML" button:


Step 2. Click the small arrow on the left of <b:skin>...</b:skin> to expand the style (screenshot 1) and click anywhere inside the code area to search by using the CTRL + F keys for the ]]></b:skin> tag (screenshot 2)

Step 3. Add the following code just above it:
/* Snow falling for Blogger
----------------------------------------------- */
@keyframes snow {
0% {background-position: 0px 0px, 0px 0px, 0px 0px;}
100% {background-position: 500px 1000px, 400px 400px, 300px 300px;}
}

@-moz-keyframes snow {
0% {background-position: 0px 0px, 0px 0px, 0px 0px;}
100% {background-position: 500px 1000px, 400px 400px, 300px 300px;}
}

@-webkit-keyframes snow {
0% {background-position: 0px 0px, 0px 0px, 0px 0px;}
100% {background-position: 500px 1000px, 400px 400px, 300px 300px;}
}

@-ms-keyframes snow {
0% {background-position: 0px 0px, 0px 0px, 0px 0px;}
100% {background-position: 500px 1000px, 400px 400px, 300px 300px;}
}

#falling-snow {
background-image: url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjA-RrzlnTpZag23K48OXBICMLZtrvFRNuE1pRt3mJUuurWURyw9fQV4eP2PZXMQAUBWnC60ISiR-fH2TqiaiAaR2lJereBOrN2G06VX-cY9BbUkKbJV7_qt2-bw4jpOztuuSiYnB9l7OLV/s1600/snow.png), url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUKYAcOpJ6T970_twppXSmrdUS6BkKWf5vvD7p2wg-PThr7N5Monrf3BzzbJYDqQwRRIk3YnGKZhhhthiEiq4vBC5W7oUtqQGaMiKPCE64lgFL_9LMZHqcNxY-qa619ScGTXA4Abbxz3G4/s1600/snow3.png), url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCc6yXIqH8pbKDX7yuSVR63IbzS9fy6ZxeDJ37DaId9ChaZu25y8r94O7MMDEAo_Gg7IrtZYLNI8XPH5tac7Dq06NzoJ4BLEGrbXQ55L7zSgcL1fVsYP7k10PwIipl0WSWedx33nZHxmDb/s1600/snow2.png);
-webkit-animation: snow 20s linear infinite;
-moz-animation: snow 20s linear infinite;
-ms-animation: snow 20s linear infinite;
animation: snow 20s linear infinite;
}
Screenshot 1:


Screenshot 2:


Step 3. Now, search (CTRL + F) the <body> tag or if you can't find it, search this line below:
<body expr:class='&quot;loading&quot; + data:blog.mobileClass'>
Step 4. Just below the tag, add this:
<div id='falling-snow'>
Step 5. Finally, find the closing </body> tag and add this tag just above it:
</div>
Step 6. Save the changes and that's it. Enjoy! :)

As you can see this tricks is very simple and easy to install, does not block the visibility of blog's content and most important, it has no scripts, only CSS and nothing else.

Saturday, 14 December 2013

Tales of Maj'Eyal (ToME) version 1.1.0 and Steam edition

The great roguelike RPG Tales of Maj'Eyal (ToME) is available as a new version (1.1.0) nicknamed "Full Steam Ahead". Here is a slightly older trailer for version 1.0.5.:



Release highlights:

  • New necromancer tree: Animus
  • All achievements now feature beautiful 128x128 images
  • Improved Alchemist interaction with its golem
  • Tons of fixes and balance adjustements
  • Many improvements for addon creators, including a way to enable debug mode and a tool (inthe debug menu) to register and upload addons to te4.org directly from the game.
  • Includes a Fez. Fezzes are cool!
Interestingly it has also been "greenlit" on the popular game distribution channel Steam, so if you want to donate to the developers you can also do it by buying ToME through this channel. The currently discounted version includes a DLC with an updated UI (and the hint for a Steampunk themed extension) which seems to me like a planned way of funding the development of the game in the future.

Friday, 13 December 2013

How to show AdSense ads that are non-standard sizes

This QuickTip is about AdSense's new custom-size-advertisement option, which lets you choose the height and width of each advertisement that you show on your site.


quick-tips logo
Today, AdSense announced that we can now make ad-units in any size that we want - within certain restrictions.  

They don't use the phase in the text of their announcement, but the post-URL for their says that this feature is  "the-next-evolution-of-responsive-ads" - so I guess it can be seen as part of the efforts to cater to mobile-readers and mobile site-publishers, even though these ads themselves don't adapt to according to the size of your visitor's screen.


What will custom-size text ads look like:

For text ads, AdSesne, will work out the best number of text ads to show in each ad-block, and the individual ads will be shown the same way they that the look inside the standard ad-sizes.

Note that they say
"For unique ad unit sizes, our system will need some time before it can optimize the number of ads shown."

My guess is that this means that initially they will just fit a standard text-unit ad within your custom size, but may manage to figure how how to fit in more content over time, as they observe what display options make most money for you (and thus for them).


What will custom-size display ads look like:

For display ads (ie ones that show pictures which the advertiser has created), AdSense will work out the best size ad to show in the custom space that you select; the only guarantee is that "the selected ad will not be larger than the space requested".

There are some accompanying  rules about maximum and minimum AdSense ad-unit sizes, and any custom ad size that doesn't satisfy these restrictions simply won't appear on a page.  These rules may change (so do go and check the official version) - but to start with they say that:
  • Only one dimension can be greater than 300 pixels
  • The minimum width is 120 pixels
  • The minimum height is 50 pixels
  • Neither height nor width can exceed 1200 pixels.

One more point:   a while after the 300x600 ad-unit was introduced, they also added a rule saying there could be no more than one of these units per page.   With custom ads, they simply say:
As always, please use your best judgement when using custom-sized ad units; ad units similar in size to the 300x600 ad format will be subject to similar placement restrictions.


How to create a custom-sized AdSense advert for Blogger

  1. Log into www.adsense.google.com using your AdSense account.
  2. Start to create an ad unit in the usual way,
  3. Select "Custom ad size" from the Ad size drop-down and enter the width and height that you want for for your ad unit.
  4. Copy and paste the ad code into the HTML source code provided by AdSense, and add it to your blog in the usual way.


Note: you will only be able to do this if you have gone through the full AdSense sign-up process. If you do not have a custom-domain and signed up for AdSense after the fast-track process for hosted-content was introduced, then your only option is to choose standard ad-sizes from the regular Add-a-gadget > Adsense process.