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 String keyHashes(){ | |
PackageInfo info; | |
String keyhashes = null; | |
try{ | |
info = getPackageManager().getPackageInfo("publishme.aneury.com.publishme", PackageManager.GET_SIGNATURES); | |
for(Signature signature : info.signatures){ | |
MessageDigest md; | |
md = MessageDigest.getInstance("SHA"); | |
md.update(signature.toByteArray()); | |
keyhashes = new String(Base64.encode(md.digest(), 0)); |
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
ArrayList<String> amounts = new ArrayList<String>(); | |
amounts.add("1000"); | |
amounts.add("1200"); | |
amounts.add("1300"); | |
amounts.add("1400"); | |
amounts.add("1500"); | |
amounts.add("1600"); | |
ArrayAdapter<String> adapter1 = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, amounts); | |
ListView ms = (ListView)findViewById(R.id.testlist); |
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 find(const char *str, const char *sb, int beg) | |
{ | |
int whole= strlen(str), len2=strlen(sb); | |
bool found=false; | |
int i = beg; | |
for( i=beg; i < whole; i++) | |
{ | |
if( str[i] == sb[0]) |
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
#include <fstream> | |
using namespace std; | |
static const unsigned char bmp[]= | |
{ | |
0x42,0x4D,0x46,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
0x36,0x00,0x00,0x00,0x28,0x00,0x00,0x00,0x02,0x00, | |
0x00,0x00,0x02,0x00,0x00,0x00,0x01,0x00,0x18,0x00, | |
0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x13,0x0B, | |
0x00,0x00,0x13,0x0B,0x00,0x00,0x00,0x00,0x00,0x00, |
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
//The tile | |
class Tile | |
{ | |
public: | |
//Initializes position and type | |
Tile( int x, int y, int tileType ); | |
//Shows the tile | |
void render( SDL_Rect& camera ); |
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
#include <arpa/inet.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <sys/types.h> | |
#include <sys/socket.h> | |
#include <unistd.h> | |
#include <iostream> |
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
#include <SDL2/SDL.h> | |
#include <fstream> | |
#include <string.h> | |
#include <string> | |
#include <iostream> | |
SDL_Window *window; | |
SDL_Renderer *render; | |
bool run; | |
void init() |
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
#define MAX(X,Y) (X>Y)?X:Y | |
#define MIN(X,Y) (X<Y)?X:Y | |
int mcd(int x, int y) | |
{ | |
int ret= -1; | |
int cociente =0; | |
int divisor = MAX(x,y); | |
int dividendo = MIN(x,y); | |
int resto =0; | |
do{ |
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
bool WinsockInitialized() | |
{ | |
SOCKET s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); | |
if (s == INVALID_SOCKET && WSAGetLastError() == WSANOTINITIALISED){ | |
return false; | |
} | |
closesocket(s); | |
return true; | |
} |
OlderNewer