Skip to content

Instantly share code, notes, and snippets.

@Sephiroth-XIII
Sephiroth-XIII / UIColor+MyApp.m
Last active August 29, 2015 14:13
Simple way to minimize the effort while defining color palette for an app.
#import "UIColor+MyApp.h"
@implementation UIColor(MyApp)
+(UIColor *)RGB:(long)hex A:(float)a {
return [UIColor colorWithRed:((float)((hex & 0xFF0000) >> 16)) / 255.0 green:((float)((hex & 0xFF00) >> 8))/255.0 blue:((float)(hex & 0xFF))/255.0 alpha:a];
}
+(UIColor *)MABlue {
return [self RGB:(0x12AFE8) A:1.0];
/*
The series, 1^1 + 2^2 + 3^3 + ... + 10^10 = 10405071317.
Find the last ten digits of the series, 1^1 + 2^2 + 3^3 + ... + 1000^1000.
*/
#include <iostream>
#include <cmath>
using namespace std;
unsigned long power(int n)
{
@Sephiroth-XIII
Sephiroth-XIII / LatLngPlotter.html
Created August 9, 2014 19:02
Plot Latitude and Longitude from CSV File
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<title>Simple markers</title>
<style>
html, body, #map-canvas
{
height: 100%;

Introduction

An introduction to curl using GitHub's API

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
@Sephiroth-XIII
Sephiroth-XIII / The Bidding Game Arena
Created December 16, 2012 09:39
This is a Simulator for The Bidding Game of Hackerrank. This will help u to compare any 2 bidding bots
import random
#ALL IMPORT STATEMENTS HERE
def calculate_bid_player1(player,pos,first_moves,second_moves):
#PLAYER 1 BOT HERE
def calculate_bid_player2(player,pos,first_moves,second_moves):
#PLAYER 2 BOT HERE
#THE SIMULATOR CODE
@Sephiroth-XIII
Sephiroth-XIII / K-Means.cpp
Created November 11, 2012 13:35
This is an Implementation of K-Means Clustering Algorithm.
/* This is the K-Mean Clustering Algorim's Implementation.
This code will work for 40 objects that can successfully be clusterd in 40 iteations.
Iterations and number of objects allowed can be increased by increasing the array size.*/
#include<iostream>
#include<math.h>
#include<conio.h>
using namespace std;
int main()