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 main() { | |
// instantiation | |
final noLoop = NoLoop(max: 100); | |
// method call:- prints 1 - 100 | |
noLoop.withoutLoop(); | |
} | |
class NoLoop { | |
static int i = 0; |
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
import 'dart:io'; | |
import 'dart:math'; | |
enum Options { r, p, s } | |
void main() { | |
// call func | |
rockPaperScissors(); | |
} |
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 "Ui.h" | |
#include "Common.h" | |
#include "Communication.h" | |
#include "net_if.h" | |
#include "jsmn.h" | |
// string replace function | |
char *replace( | |
char const *const original, | |
char const *const pattern, |
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 "Ui.h" | |
#include "Common.h" | |
#include "Communication.h" | |
#include "net_if.h" | |
#include "jsmn.h" | |
// string replace function | |
char *replace( | |
char const *const original, | |
char const *const pattern, |
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 "Ui.h" | |
#include "Common.h" | |
#include "Communication.h" | |
#include "jsmn.h" | |
// cust replace func | |
// char *replace(char const *const original, char const *const pattern, char const *const replacement) | |
// { | |
// size_t const replen = strlen(replacement); | |
// size_t const patlen = strlen(pattern); |
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 "Ui.h" | |
#include "Common.h" | |
#include "Communication.h" | |
#include "jsmn.h" | |
const char* GetWallet(unsigned char *pcOut) | |
{ | |
short sRC; | |
char url[] = "https://devapi.ucard.store/identity/Agent/login/wallet/initate"; |
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 "Ui.h" | |
#include "Common.h" | |
#include "Communication.h" | |
#include "jsmn.h" | |
short makeApiCall(char *url, unsigned char *requestData, unsigned short requestDataLength) | |
{ | |
short sRC; | |
// sRC = UIWireHttpSend(url, requestData, requestDataLength, NULL); | |
sRC = UIWireHttpSend(url, requestData, requestDataLength, "Content-Type: application/json\r\n"); |
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
short makeApiCall(char *url, unsigned char *requestData, unsigned short requestDataLength) | |
{ | |
short sRC; | |
sRC = UIWireHttpSend(url, requestData, requestDataLength, NULL); | |
// sRC = UIWireHttpSend(url, requestData, requestDataLength, "Content-type: application/json; charset=UTF-8"); | |
return sRC; | |
// if (sRC != TY_OK) | |
// { | |
// return sRC; // failed, I think | |
// } |
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 "Ui.h" | |
#include "Common.h" | |
#include "Communication.h" | |
#include "jsmn.h" | |
#include "LibApi.h" | |
#include "Print.h" | |
#include "MessageBox.h" | |
#include "net_if.h" | |
// for print |
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
short TestGet(int iTimeout) | |
{ | |
int sRC = -1; | |
unsigned char ucRecvBuff[3500] = {0}; | |
unsigned short usRecvBUffLen = sizeof(ucRecvBuff); | |
// char *myHeader = "{\"Host\": \"dev.ucard.store\r\n\", \"Authorization\": \"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9lbWFpbGFkZHJlc3MiOiJqYXp6eWJ1cmdlckBxYS50ZWFtIiwiaHR0cDovL3NjaGVtYXMueG1sc29hcC5vcmcvd3MvMjAwNS8wNS9pZGVudGl0eS9jbGFpbXMvZ2l2ZW5uYW1lIjoiamF6enkgYnVyZ2VyIiwiaHR0cDovL3NjaGVtYXMubWljcm9zb2Z0LmNvbS93cy8yMDA4LzA2L2lkZW50aXR5L2NsYWltcy9ncm91cHNpZCI6IkFnZW50IiwiaHR0cDovL3NjaGVtYXMubWljcm9zb2Z0LmNvbS93cy8yMDA4LzA2L2lkZW50aXR5L2NsYWltcy9yb2xlIjoiQWdlbnQiLCJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1laWRlbnRpZmllciI6Imphenp5YnVyZ2VyQHFhLnRlYW0iLCJodHRwOi8vc2NoZW1hcy5taWNyb3NvZnQuY29tL3dzLzIwMDgvMDYvaWRlbnRpdHkvY2xhaW1zL3VzZXJkYXRhIjoie1wiVXNlcklkXCI6MzYzLFwiRnVsbE5hbWVcIjpcImphenp5IGJ1cmdlclwiLFwiRGVmYXVsdFdhbGxldElkXCI6XCI1MTQ5XCIsXCJXYWxsZXRDd |