This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.ajax({ | |
url:"someUrl.php", | |
// async:false, // dependera del caso, | |
dataType:"json", // aqui indico que ya es json | |
type:'POST', | |
success:function(res) { | |
if(res.estatus){ | |
// todo bien, proseguir | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static function redirect_post($url,$params){ | |
$html = ""; | |
$html.= '<!doctype html> | |
<html> | |
<head> | |
<script type="text/javascript" language="JavaScript" src="lib/js/jquery-1.8.3.js"></script> | |
<script> | |
$(function(){ | |
$("#redirect_form").submit(); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// lineas sin comentar | |
// funcion pr( sin comentar: | |
// para NPP N++ Notepad++ | |
^(?:(?!//).)*?\Kpr\( | |
// para Netbeans: | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// jquery .each | |
ref: http://api.jquery.com/jquery.each/ | |
jQuery.each( array, callback(index, value) ) | |
jQuery.each( object, callback(key, value) ) | |
// nota que la funcion | |
$.each() | |
// puede iterar sobre cualquier coleccion (array o objeto), y NO ES IGUAL a | |
$(selector).each() | |
// el cual se usa para iterar SOLO en objetos jQ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function secondRightmostZeroBit($n) { | |
return ~($n | ($n+1)) & (($n | ($n+1))+1); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function secondRightmostZeroBit(n) { | |
return ~(n |= -~n) & -~n; | |
} | |
function secondRightmostZeroBit(n) { | |
return ~(n | n + 1) & (n | n + 1) + 1; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int secondRightmostZeroBit(int n) { | |
return ~(n|(n+1)) & ((n|(n+1))+1) ; | |
} | |
int secondRightmostZeroBit(int n) { | |
return (~n) & ((n | ((~n) & (n+1))) +1); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int secondRightmostZeroBit(int n) | |
{ | |
return ~(n|=n+1) & -~n ; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function swapAdjacentBits(n) { | |
return ((n & 0xaaaaaaaa) >> 1) | ((n & 0x55555555) << 1); | |
} | |
function swapAdjacentBits(n) { | |
return x = 2863311530, n/2 & x/2 | 2*n & x; | |
} | |
function swapAdjacentBits(n) { | |
return (n >> 1 & 0x55555555) | (n << 1 & 0xAAAAAAAA) ; |
OlderNewer