This file contains hidden or 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 convertBases($number, $from_digits, $to_digits) | |
{ | |
$from_digits = str_split($from_digits, 1); | |
$to_digits = str_split($to_digits, 1); | |
$number = str_split($number, 1); | |
$number_dec = "0"; | |
$ord = 0; |
This file contains hidden or 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 | |
$mysqli = new mysqli("db", "user", "pass", "db"); | |
/* check connection */ | |
if ($mysqli->connect_errno) { | |
printf("Connect failed: %s\n", $mysqli->connect_error); | |
exit(); | |
} |
This file contains hidden or 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 | |
while (true) | |
{ | |
$query_start = microtime(true); | |
$curl = curl_init(); | |
curl_setopt($curl, CURLOPT_URL, "http://127.0.0.1/nginx_status"); | |
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); | |
curl_setopt($curl, CURLOPT_HTTPHEADER, array( |
This file contains hidden or 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 Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage; | |
/** | |
* Session sotrage that avoids using _sf2_attributes subkey | |
* in the $_SESSION superglobal but instead it uses | |
* the root variable. | |
*/ | |
class LegacySessionStorage extends NativeSessionStorage |
This file contains hidden or 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 random | |
import sys | |
enter = "Please Press Enter To Continue..." | |
print "Hello! Welcome to a Guessing game!" | |
print "Please Guess A number between 1 - 100!" | |
computernum = random.randint(1, 100) | |
computernum = str(computernum) | |
guesses = 3 |
This file contains hidden or 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
<link rel="import" href="../core-scaffold/core-scaffold.html"> | |
<link rel="import" href="../core-header-panel/core-header-panel.html"> | |
<link rel="import" href="../core-menu/core-menu.html"> | |
<link rel="import" href="../core-item/core-item.html"> | |
<link rel="import" href="../core-icon-button/core-icon-button.html"> | |
<link rel="import" href="../core-toolbar/core-toolbar.html"> | |
<link rel="import" href="../core-menu/core-submenu.html"> | |
<link rel="import" href="../google-map/google-map.html"> | |
<polymer-element name="my-element"> |
This file contains hidden or 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 com.example.gpulayerbug; | |
import android.app.Activity; | |
import android.os.Bundle; | |
import android.transition.Fade; | |
import android.transition.Transition; | |
import android.transition.TransitionManager; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import android.widget.Button; |
This file contains hidden or 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 | |
class DrinkingGame | |
{ | |
const TAIL = 'tail'; | |
const DRUNKEST = 'zoltan'; | |
public function __construct(array $names, Coin $coin = null) { | |
$this->names = array_fill_keys($names, 0); | |
$this->coin = $coin; |
OlderNewer