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 | |
$app->get('/exception', function ($req, $res, $args) { | |
// errorHandler will trap this Exception | |
throw new Exception("An error happened here"); | |
}); | |
$app->get('/php7', function ($req, $res, $args) { | |
$x = function (int $x) { | |
return $x; | |
}; |
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 | |
/*============================================================================== | |
* Register the error handler | |
*/ | |
$whoops = new \Whoops\Run; | |
if ($environment !== 'production') { | |
// show errors for cool kids | |
$whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler); | |
// log exception |
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 | |
// Before: composer require monolog/monolog | |
// composer autoloader | |
require_once 'vendor/autoload.php'; | |
// Shortcuts for simpler usage | |
use \Monolog\Logger; | |
use \Monolog\Formatter\LineFormatter; | |
use \Monolog\Handler\StreamHandler; |
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
# Your init script | |
# | |
# Atom will evaluate this file each time a new window is opened. It is run | |
# after packages are loaded/activated and after the previous editor state | |
# has been restored. | |
# | |
# An example hack to log to the console when each text editor is saved. | |
# | |
# atom.workspace.observeTextEditors (editor) -> | |
# editor.onDidSave -> |
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<stdio.h> | |
#include<math.h> | |
float f(float x){ | |
return (4*x-3*x*x); | |
/* | |
return (1/(1+x*x)); | |
*/ | |
} |
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<stdio.h> | |
#include<math.h> | |
float f(float x){ | |
return exp(x); | |
/* | |
return sqrt(1 - 0.162 * sin(x) * sin(x)); | |
*/ | |
} |
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<stdio.h> | |
#include<graphics.h> | |
int main() | |
{ | |
int maxx,s_angle,i,r,e_angle,x,y,maxy,gd,gm,maxr; | |
detectgraph(&gd,&gm); | |
initgraph(&gd,&gm,"C:\\TURBOC3\\BGI"); | |
maxx=getmaxx(); |
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<stdio.h> | |
#include<graphics.h> | |
#include<math.h> | |
int main() | |
{ | |
int gd,gm; | |
int r,i,a,b,x,y; | |
float PI=3.14; | |
detectgraph(&gd,&gm); |
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<stdio.h> | |
#include<graphics.h> | |
int main() | |
{ | |
int gd,gm,x,y,r,i,j=0,maxx,maxy,high; | |
detectgraph(&gd,&gm); | |
initgraph(&gd,&gm,"C:\\TurboC3\\BGI"); | |
//road | |
setcolor(WHITE); |
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<stdio.h> | |
#include<graphics.h> | |
void flood_fill(int x,int y,int old_color,int fill_color); | |
int main() | |
{ | |
int gd,gm,x,y,x1,x2,y1,y2; | |
detectgraph(&gd,&gm); | |
initgraph(&gd,&gm,"C://TurboC3//BGI"); | |
printf("Enter top-left point of rectangle: "); |