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> | |
| #include <stdlib.h> | |
| int main() { | |
| printf("Enter any number of type \"int\" : "); | |
| int YinNum1; | |
| scanf("%d yin",&YinNum1); | |
| for(;;) { | |
| if(YinNum1 % 2 == 0){ | |
| YinNum1=YinNum1/2; |
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> | |
| #include <unistd.h> | |
| #include <signal.h> | |
| #include <stdlib.h> | |
| #include <unistd.h> | |
| void handler(int num){ | |
| write(STDOUT_FILENO, "Kill Proceess Request Failed\n", 13); | |
| } |
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 javax.swing.*; | |
| class Main{ | |
| public static void main(String args[]){ | |
| JFrame frame = new JFrame("My First GUI"); | |
| frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); | |
| frame.setSize(300,300); | |
| JButton button1 = new JButton("Button 1"); | |
| JButton button2 = new JButton("Button 2"); | |
| frame.getContentPane().add(button1); | |
| frame.getContentPane().add(button2); |
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 <string.h> | |
| #include <stdlib.h> | |
| #include <stdio.h> | |
| #include <X11/Xlib.h> | |
| // CFLAGS=-lX11 -Os | |
| /* | |
| * Alsami utils, twin | |
| **/ |
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
| char** atokl(char* InC, char* delim, long unsigned int* len){ | |
| char** tok=(char**)malloc(2*sizeof(char*)); | |
| //printf("%p\n", tok); | |
| tok[0]=strtok(strdup(InC), delim); | |
| { | |
| int i=1; | |
| while(tok[i-1]!=NULL){ | |
| tok=(char**)realloc(tok, (i+1)*sizeof(char*)); | |
| tok[i]=strtok(NULL, delim); |
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
| // returns a heap duplicate up to n bytes | |
| char* strndupx(char* in, long unsigned int n){ | |
| char* new=malloc(n+1); | |
| new[n]=0x0; | |
| memcpy(new, in, n); | |
| return new; | |
| } |
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
| long unsigned int byte_instances(char* bytes, long unsigned int len, char byte){ | |
| long unsigned int inst=0; | |
| for(long unsigned int i=0;i<len;i++){ | |
| if(bytes[i]==byte){ | |
| inst++; | |
| } | |
| } | |
| return inst; | |
| } |
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
| char* read_file(char* filenm, long unsigned int* len){ | |
| char* buf=0; | |
| FILE* f=fopen(filenm, "rb"); | |
| if(f){ | |
| fseek(f,0,SEEK_END); | |
| *len=ftell(f); | |
| fseek(f,0,SEEK_SET); | |
| buf=(char*)calloc(1, *len); | |
| if(buf) | |
| fread(buf, 1, *len, f); |
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> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #ifdef __unix__ | |
| #include <unistd.h> | |
| #endif | |
| #define s_foreach(x, y)\ for(long unsigned int y=0;x[y]!=0;y++) |
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> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #ifdef __unix__ | |
| #include <unistd.h> | |
| #else | |
| #error Only supports unix! | |
| #endif |
OlderNewer