This file contains hidden or 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
void gotoxy(int x,int y){ | |
HANDLE hcon; | |
hcon = GetStdHandle(STD_OUTPUT_HANDLE); | |
COORD dwPos; dwPos.X = x; dwPos.Y= y; | |
SetConsoleCursorPosition(hcon,dwPos); | |
} |
This file contains hidden or 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
#include<stdio.h> | |
//gotoxy() function definition | |
void gotoxy(int x,int y) | |
{ | |
printf("%c[%d;%df",0x1B,y,x); | |
} | |
int main () | |
{ |
This file contains hidden or 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
Below you can find colors reference of text to command when running node.js application: | |
console.log('\x1b[36m%s\x1b[0m', 'I am cyan'); //cyan | |
console.log('\x1b[33m%s\x1b[0m', stringToMakeYellow); //yellow | |
Colors reference | |
Reset = "\x1b[0m" | |
Bright = "\x1b[1m" | |
Dim = "\x1b[2m" |
This file contains hidden or 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 boolean isEmail(String correo) { | |
Pattern pat = null; | |
Matcher mat = null; | |
pat = Pattern.compile("^([0-9a-zA-Z]([_.w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-w]*[0-9a-zA-Z].)+([a-zA-Z]{2,9}.)+[a-zA-Z]{2,3})$"); | |
mat = pat.matcher(correo); | |
if (mat.find()) { | |
System.out.println("[" + mat.group() + "]"); | |
return true; | |
}else{ | |
return false; |
This file contains hidden or 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
void SetColor(int ForgC){ | |
WORD wColor; | |
HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE); | |
CONSOLE_SCREEN_BUFFER_INFO csbi; | |
if(GetConsoleScreenBufferInfo(hStdOut, &csbi)) | |
{ | |
wColor = (csbi.wAttributes & 0xF0) + (ForgC & 0x0F); | |
SetConsoleTextAttribute(hStdOut, wColor); | |
} |