Skip to content

Instantly share code, notes, and snippets.

View amastov's full-sized avatar

Adam Mastov amastov

  • Slalom
  • Phoenix, AZ
View GitHub Profile
//-----------------------------------------------------------------------------
// Project 3 Userspace code.
//-----------------------------------------------------------------------------
#include <stdio.h>
#include <stdlib.h>
#define __NR_sys_get_addr 360
int main(int argc, char* argv[])
#include <stdio.h>
#define __NR_sys_get_addr 360
struct data
{
int aval;
long address;
};
int main(int argc, char* argv[])
{
#include <linux/syscalls.h>
#include <linux/kernel.h> /* Needed for KERN_INFO */
#include <linux/list.h>
#include <linux/printk.h> /* Needed to print to the kernal log file */
#include <linux/mm.h>
/* Side effect, Macro versus Function */
#include <stdio.h>
#pragma warning(disable : 4996)
#define mac(a,b) a*a + b*b - 2*a*b
int func(int a, int b) {
return (a*a + b*b - 2 * a*b);
}
@amastov
amastov / gist:74611aadf7daacb20c39
Last active August 29, 2015 14:06
check letters
Scanner in = new Scanner(System.in);
String input = "";
int nonLetters;
boolean hasNonLetters = false;
while(!hasNonLetters) {
nonLetters = 0;
System.out.println("Please enter a valid input");
input = in.next();
for (int i = 0; i < input.length(); i++) {