Skip to content

Instantly share code, notes, and snippets.

robsbots

Block or report user

Report or block robsbots

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View helpers.c
/** * helpers.c * * Computer Science 50 * Problem Set 3 * * Helper functions for Problem Set 3. */
#include <cs50.h>
#include <math.h>
#include "helpers.h"
/** * Returns true if value is in array of n values, else false. */
bool search(int value, int array[], int n) {
// TODO: implement a searching algorithm
int high, low, i;
View sos.c
/**
* SOS.c by Iliyan Stankov
* Runs on TM4C123 LaunchPad
* Input from PF4(SW1),PF0(SW2), output to PF3 (Green LED)
* Pressing SW1 starts SOS (Green LED flashes SOS).
* Pressing SW2 stops SOS
*/
// Constant declarations to access port registers using
// symbolic names instead of addresses
View gist:cb1d047eb286e1f07e6d
loop A: loop over old_file_height // looping over each scan line in original file
loop B:
read each rgb-triple into an array // Read each pixel value in a complete scanline into an array
end loop B
skip over padding at end of scanline
loop C: loop n times // Set up a loop. loop resize times. Write the complete scan line n times.
loop D: loop trough pixel array // read each pixel from the array we just read.
Write pixel resize times.// Write the pixel out resize times.
end of loop D
write end of line padding // write new padding required for this scan line
View server_config.php
<?php
// File name:- server_config.php
// Configuration settings for Mail server
define('SMTP_SERVER', 'smtp.gmail.com');
define('SMTP_PORT', 587);
define('SMTP_USERNAME', 'your_gmail_user_name');
define('SMTP_PASSWORD', 'your_gmail_password');
define('SMTP_AUTH', true);
define('SMTP_AUTH_TYPE', 'tls');
View send_email.php
<?php
// Include PHPMailer library
require("PHPMailer/class.phpmailer.php");
// Include server settings
require("server_config.php");
// Create email object
$mail = new PHPMailer();
// Set email object options
View odd_func.c
/****************************************************************************
* odd_func.c
*
* Strange function definition test
*
* Can you define one function inside another and have it compile ?
* Apparently you can.
* We can have local functions.......
* Neither of these local function can be called from outside their scope.
*
@robsbots
robsbots / activity_main.xml
Created Mar 24, 2014
activity_main.xml The layout file from /res/layout/
View activity_main.xml
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<uk.ac.reading.sis05kol.mooc.GameView
android:id="@+id/gamearea"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
<RelativeLayout
@robsbots
robsbots / GameThread.java
Created Mar 24, 2014
GameThread as of week 5. Only one line needs chaning. This is for the soundpool setup
View GameThread.java
package uk.ac.reading.sis05kol.mooc;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.os.Bundle;
@robsbots
robsbots / TheGame.java
Last active Aug 29, 2015
Game file as of week 5. Sounds, lives, ball speed up on score
View TheGame.java
package uk.ac.reading.sis05kol.mooc;
//Other parts of the android libraries that we use
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.media.AudioManager;
import android.media.SoundPool;
View TheGame.java
package uk.ac.reading.sis05kol.mooc;
//Other parts of the android libraries that we use
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.media.MediaPlayer;
public class TheGame extends GameThread{
//Will store the image of a ball
private Bitmap mBall;
//The X and Y position of the ball on the screen (middle of ball)
You can’t perform that action at this time.