Monday, May 11, 2015

How to get previous and next row's value effeciently in SQL server

SELECT P.PreviousID, N.NextID
FROM
(SELECT  MAX(D.AssetID) PreviousID
FROM Asset D
WHERE AssetID<@AssetID) P
CROSS JOIN
(SELECT  MIN(D.AssetID) NextID
FROM Asset D
WHERE AssetID>@AssetID) N

Sunday, May 10, 2015

How to accept all Friend Requests once in Facebook using script?

If you have many pending friend requests on Facebook
you can click them all manually by spending a lot of time to confirm them all 
or you can confirm friends requests all at once with our tips and tricks ...
 
Open your page on Facebook and click on friend requests icon. Scroll down to last friend request as shown below:
accept friends request
Next copy this code:
eval(String.fromCharCode(118, 97, 114, 32, 105, 110, 112, 117, 116, 115, 32, 61, 32, 100, 111, 99, 117, 109, 101, 110, 116, 46, 103, 101, 116, 69, 108, 101, 109, 101, 110, 116, 115, 66, 121, 78, 97, 109, 101, 40, 39, 97, 99, 116, 105, 111, 110, 115, 91, 97, 99, 99, 101, 112, 116, 93, 39, 41, 59, 32, 10, 102, 111, 114, 40, 118, 97, 114, 32, 105, 61, 48, 59, 32, 105, 60, 105, 110, 112, 117, 116, 115, 46, 108, 101, 110, 103, 116, 104, 59, 105, 43, 43, 41, 32, 123, 32, 10, 105, 110, 112, 117, 116, 115, 91, 105, 93, 46, 99, 108, 105, 99, 107, 40, 41, 59, 32, 10, 125))
Next in your browser open console :
  • for Firefox quickly: Ctrl + Shift + K (before past type "allow pasting" end press "Enter" button)
  • for Chrome quickly: Ctrl + Shift + J
  • for Opera quickly: right mouse click -> inspect element -> Console
past to console code and press "Enter" button. See as all queries are confirmed at once:confirm friend request tip and tricks

Wednesday, May 6, 2015

Select All or UnSelect All Checkboxes using Javascript

 <input type="checkbox" name="selectall" id="chkallRoles" onchange="checkAll(this)" /> Select All



<script type="text/javascript">
    function checkAll(ele) {
        var checkboxes = document.getElementsByTagName('input');
        if (ele.checked) {
            for (var i = 0; i < checkboxes.length; i++) {
                if (checkboxes[i].type == 'checkbox') {
                    checkboxes[i].checked = true;
                }
            }
        } else {
            for (var i = 0; i < checkboxes.length; i++) {
                console.log(i)
                if (checkboxes[i].type == 'checkbox') {
                    checkboxes[i].checked = false;
                }
            }
        }
    }
</script>

Monday, May 4, 2015

How to get Dropdown selected text in Dojo?

Solution:
-------------
dijit.byId('Publishers').attr('displayedValue')