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
package main | |
import ( | |
"fmt" | |
"math" | |
) | |
func Sqrt(x float64) float64 { | |
z := float64(1) | |
last_z := z |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
public static class Program | |
{ | |
public static void Main() | |
{ | |
var names = new List<string> { "Alice", "Bob", "Charley", "Derp", "Ed", "F" }; |
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
[root@apacheserver ~]# fdisk -l | |
Disk /dev/sda: 107.4 GB, 107374182400 bytes | |
255 heads, 63 sectors/track, 13054 cylinders | |
Units = cylinders of 16065 * 512 = 8225280 bytes | |
Sector size (logical/physical): 512 bytes / 512 bytes | |
I/O size (minimum/optimal): 512 bytes / 512 bytes | |
Disk identifier: 0x000d4bc7 | |
Device Boot Start End Blocks Id System |
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 | |
if (isset($_POST['submit'])) { | |
$user = '...'; | |
$pass = '...'; | |
$dbh = new PDO('mysql:host=xxx;port=xxx;dbname=xxx', $user, $pass); | |
$stm = $dbh->prepare('insert into customer ( name, email, dob, last_updated ) values ( :name, :email, :dob, current_timestamp )'); | |
$stm->bindParam(':name', $_POST['name']); | |
$stm->bindParam(':email', $_POST['email']); |
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
int main(){for(int i=1;i++<=100;){printf("%s%s",i%3==0?"Fizz":"",i%5==0?"Buzz":"");printf(!((i%5==0)||(i%3==0))?"%d":"",i);printf("\n");}} |
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> | |
int main() { | |
int i; | |
for (i = 1; i <= 100; i++) { | |
if ((i % 3) == 0 && (i % 5) == 0) { | |
printf("FizzBuzz\n"); | |
} | |
else if (i % 3 == 0) { | |
printf("Fizz\n"); |
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
public enum CidrGroup | |
{ | |
Local, | |
Australia, | |
NewZealand | |
} | |
/// <summary> | |
/// Provides an easy interface for determining whether CIDR blocks contain specified IP addresses | |
/// </summary> | |
/// <remarks> |
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 | |
function buildResult() { | |
return array('result' => 'Joy to the world'); | |
} | |
header('Content-type: application/json'); | |
echo json_encode(buildResult()); |
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
import std.algorithm; | |
import std.array; | |
import std.csv; | |
import std.stdio; | |
import std.typecons; | |
import std.stream; | |
import std.path; | |
import std.string; | |
import std.file; |
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
begin transaction; | |
create table "user" ( | |
id serial not null | |
constraint pk_user primary key, | |
password bytea null, | |
created timestamp | |
); | |
create table "user_email" ( |
OlderNewer