Wednesday, 28 May 2014

Purpose of the '@' symbol in CSS 0

@ has been around since the days of @import in CSS1, although it's arguably becoming increasingly common in the recent @media (CSS2, CSS3) and @font-face (CSS3) constructs. The @ syntax itself, though, is not new. These are all known in CSS as at-rules (@). They're special instructions for the browser, not directly related to styling of (X)HTML/XML elements in Web documents using rules and properties, although they do play important roles in controlling how styles are applied. Some...

Tuesday, 27 May 2014

Difference between Math.floor() and Math.round() 0

Syntax   Math.floor(x) , Math.round(x) Definition Math.floor(x) and Math.round(x)  expects floating number as parameter. Math.floor(x)  The floor() method rounds a number DOWNWARDS to the nearest integer, and returns the result. If the passed argument is an integer, the value will not be rounded. Math.round(x)  The round() method rounds a number to the nearest integer. Main Difference  Math.floor(x)   If the parameter is 3.51,...

Monday, 26 May 2014

Jquery - check if at least one checkbox is checked 2

     In some situation we need at least one user input in check box to submit form. In that case, we should check if at least one check box is checked. So, we can simply check that condition in .click event listener of check box.      Here we are going to enable Submit Form button at least any one of check box is checked. $("input[type='checkbox']").click(function () { $("input[type='submit']").attr( "disabled", !$("input[type='checkbox']").is(":checked")); });     ...

Friday, 23 May 2014

How to check current day is the last day of the month in php 0

We can simply use PHP's data() function to do this.  date('t') will return the last day of the month.  date('j') will return the current day of the month. So, we can simply implement our if-else logic here to get the output. $maxDays = date('t'); $currentDay = date('j'); if($maxDays == $currentDay) { echo 'Last Day of month'; } else { echo 'Not last day of the month'; } Have any doubt, feel free to comment here...

Wednesday, 14 May 2014

How to show particular lines from gist ? 2

I tried to show selected lines of code from my gist to my blog. I got kashif-umair's Repository from GitHub. It's very easy to implement. This plug-in using jQuery. So, you should load jQuery library. If you are going to use this in blog or website, You can use online CDN for both jQuery and gist-embed libraries like below, .gist-file{ background-color: #f8f8f8; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border:...

Tuesday, 13 May 2014

How to use sql query's between clause in filter() - concrete5 0

I just tried to filter my base query between two dates. I don't know how to use that between clause in filter() function. .gist-file{ background-color: #f8f8f8; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 1px solid rgb(221, 221, 221); box-sizing: border-box; color: #333333; font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 13px; line-height: 19px; margin-bottom: 15px; margin-top: 15px;...

Multiple List Paginations in a one page - concrete5 0

If you want to put two or more paginated list using concrete5 pagination (item list) class, You need to set name space for each instance of a class. for example, I am taking two various instance for a single class. $pageList1 = new productList(); $pageList2 = new productList(); Here I'm separate resultant list using different filter queries like below, .line-data { font-size:14px; font-family: Consolas,"Liberation Mono",Courier,monospace; } .line-numbers { font-size:14px; background-color:...

Thursday, 8 May 2014

How to change MYSQL database data directory to another location? - WAMP 0

Database server storing the values in files data directory. So, if you want to change the storage location for the database, you can just put this data directory in any location in your system and tell that path to MYSQL to manipulate data. In this post I'm going to show some screen shots to do this. Note : I'm using WAMP in this example. First step you should Stop All services Just click...

Wednesday, 7 May 2014

How to set default time zone in php? 0

to set default timezone in our php page, we can use PHP native function. syntax: date_default_timezone_set('region/area'); for example, if you are in New York, your timezone is "America/New_York" standard timezone for India is "Asia/Kolkata" or "Asia/Calcutta". WHY we need to set timezone in our PHP page?      Consider your server in India and your client access your web page from America, In this situation you are getting date() or time() from your server using PHP,...