Sampuran programming

Sampuran programming Belief in Clean and Quality of code

We deal in
LANGUAGE:C++,JAVA,LINUX,RUBY
WEB DESIGNING:PHOTOSHOP,FLASH,HTML
WEB DEVELOPMENT:PHP,ASP,.NET
CMS:WORDPRESS,DRUPAL,SMARTY,JOOMLA
FRAMEWORK:ROR

5 days Bootcamp. Learn professional PHP training.It cost 199/- rupees only.Location: Mohali sector 74. Only first 20 use...
06/04/2021

5 days Bootcamp.

Learn professional PHP training.

It cost 199/- rupees only.

Location: Mohali sector 74.

Only first 20 users get this benefit.

19/03/2021

PHP Bootcamp for 1 month.

Belief in Clean and Quality of code

19/10/2017

Happy Diwali guys!

20/08/2016

++

int i=8,y=-2,k=0,r,s,g;
r= i || y || k;
s= i || y && k;
g= i && y || k;

output r, s and g??

23/03/2016

Happy Holi frnds!

11/11/2015

Happy Diwali friends!

26/07/2015



Q) How do you check if an element exists or not in jQuery?
A) Using jQuery length property, we can ensure whether element exists or not.

$(document).ready(function(){
if ($(' ').length > 0){
//Element exists
}
});

26/07/2015


Q) Difference between $(this) and 'this' in jQuery?

A) this and $(this) refers to the same element. The only difference is the way they are used. 'this' is used in traditional sense, when 'this' is wrapped in $() then it becomes a jQuery object and you are able to use the power of jQuery.

$(document).ready(function(){
$(' ').mouseover(function(){
alert($(this).text());
});
});

this is an object but since it is not wrapped in $(), we can't use jQuery method and use the native JavaScript to get the value of span element.

$(document).ready(function(){
$(' ').mouseover(function(){
alert(this.innerText);
});
});

26/07/2015



Q) What is the difference between .empty(), .remove() and .detach() methods in jQuery?

A): All these methods .empty(), .remove() and .detach() are used for removing elements from DOM but they all are different.
empty(): This method removes all the child element of the matched element where remove() method removes set of matched elements from DOM.
remove(): Use .remove() when you want to remove the element itself, as well as everything inside it. In addition to the elements themselves, all bound events and jQuery data associated with the elements are removed.
detach(): This method is the same as .remove(), except that .detach() keeps all jQuery data associated with the removed elements. This method is useful when removed elements are to be reinserted into the DOM at a later time.

11/04/2015



function a(){
alert('A');
}

function a(){
alert('AA');
}

a();

What will be the output?
1) alert A.
2) alert AA.
3) Program will throw error re-declaration function a.

10/10/2014



You can't a table that has FK constraints applied on it.

:
To truncate the table. You have to remove the constraints first then truncate it and then apply constraints on table.

SET FOREIGN_KEY_CHECKS = 0;
TRUNCATE TABLE_NAME;
SET FOREIGN_KEY_CHECKS = 1;

28/08/2014


See unexcepted behaviour count function with order clause.

Suppose table t contains n record.
Id, last_call, last_call_duration
1, 2014-09-2014 14:24:41, 4 -08-14 07:24:29, 0
26, 2014-09-2014 14:24:41, 4

order by desc
Select id, last_call, last_call_duration from t order by last_call desc.

:
26, 2014-09-2014 14:24:41, 4
1, 2014-08-14 07:24:29, 0

order by desc with count function
Select count(last_call),id, last_call, last_call_duration from t order by last_call desc.

:
Count(last_call),id,....
2,1, 2014-08-14 07:24:29, 0

solve this :

Select count(last_call),id,last_call,last_call_duration from
(select last_call,last_call_duration from t)t1


Count(last_call),id,last_call,last_call_duration
2, 26, 2014-09-2014 14:24:41,4

Address

Mohali
160055

Opening Hours

Monday 9am - 5pm
Tuesday 9am - 5pm
Wednesday 9am - 5pm
Thursday 9am - 5pm
Friday 9am - 5pm
Saturday 9am - 5pm

Website

Alerts

Be the first to know and let us send you an email when Sampuran programming posts news and promotions. Your email address will not be used for any other purpose, and you can unsubscribe at any time.

Contact The Business

Send a message to Sampuran programming:

Share