This file contains 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
<?php | |
/* * ** | |
* | |
* This script converts an existing MySQL database to migrations in Laravel 4. | |
* | |
* 1. Place this file inside app/controllers/ | |
* | |
* 2. In this file, edit the index() method to customize this script to your needs. | |
* - inside $migrate->ignore(), you pass in an array of table |
This file contains 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
<?php | |
use Illuminate\Database\Migrations\Migration; | |
use Illuminate\Database\Schema\Blueprint; | |
class AddPermissions extends Migration | |
{ | |
/** | |
* Run the migrations. |
This file contains 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
#define _USE_MATH_DEFINES | |
#include <iostream> | |
#include <cmath> | |
#include <windows.h> | |
using namespace std; | |
int main() | |
{ | |
for (int i = 0; i < 100000; i++) { |
This file contains 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
// simple matrix calculator | |
#include <iostream> | |
#include <cstdlib> | |
#include <limits> | |
// A 3x3 matrix | |
const int M_SIZE = 3; | |
typedef double matrix[M_SIZE][M_SIZE]; | |
// function prototypes |
This file contains 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
.SUFFIXES: .cpp | |
#for sgi -- comment out the lines below to use on HP | |
#CC=CC -g0 -o32 | |
#CC=gcc | |
# Compiler options | |
#OPTS=-g | |
#OPTS=-O0 | |
#OPTS=-O3 |
This file contains 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
#pragma once | |
#include <sstream> | |
#include <iostream> | |
class Point | |
{ | |
public: | |
typedef std::shared_ptr<Point> SPtr; | |
typedef std::unique_ptr<Point> UPtr; |
This file contains 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 <iostream> | |
#include <memory> | |
#include <string> | |
#include <cassert> | |
#include "Point.hpp" | |
class PointMan | |
{ | |
public: | |
static const size_t SIZE = 3; |
This file contains 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 <iostream> | |
#include <cmath> | |
using namespace std; | |
// rounds a double variable to nPlaces decimal places | |
double Round(double dbVal, int nPlaces /* = 0 */) | |
{ | |
const double dbShift = pow(10.0, nPlaces); | |
return floor(dbVal * dbShift + 0.5) / dbShift; |
OlderNewer