=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
BrainFuck Programming Tutorial by: Katie
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
def partition3(A, l, r): | |
""" | |
partition3: A partition for quicksort algorithm. We'll use the 3-way to handle few equal elements in array (happens | |
a lot in practical use.) | |
This function is called from the main function quick_sort. | |
""" | |
lt = l # We initiate lt to be the part that is less than the pivot | |
i = l # We scan the array from left to right | |
gt = r # The part that is greater than the pivot | |
pivot = A[l] # The pivot, chosen to be the first element of the array, that why we'll randomize the first elements position |
import sys | |
import jiphy # pip install | |
from os import path | |
from types import ModuleType | |
class JsFinder(object): | |
def find_module(self, name, m_path): | |
name += '.js' | |
if m_path is not None: |
/* | |
* The default style sheet used to render HTML. | |
* | |
* Copyright (C) 2000 Lars Knoll ([email protected]) | |
* Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. | |
* | |
* This library is free software; you can redistribute it and/or | |
* modify it under the terms of the GNU Library General Public | |
* License as published by the Free Software Foundation; either | |
* version 2 of the License, or (at your option) any later version. |
# Assuming an Ubuntu Docker image | |
$ docker run -it <image> /bin/bash |
/** | |
* Generates number of random geolocation points given a center and a radius. | |
* @param {Object} center A JS object with lat and lng attributes. | |
* @param {number} radius Radius in meters. | |
* @param {number} count Number of points to generate. | |
* @return {array} Array of Objects with lat and lng attributes. | |
*/ | |
function generateRandomPoints(center, radius, count) { | |
var points = []; | |
for (var i=0; i<count; i++) { |
<?php | |
// Pull in the NuSOAP code | |
require_once('nusoap.php'); | |
// Create the client instance | |
$client = new soapclient('http://localhost/phphack/hellowsdl2.php?wsdl', true); | |
// Check for an error | |
$err = $client->getError(); | |
if ($err) { | |
// Display the error | |
echo '<h2>Constructor error</h2><pre>' . $err . '</pre>'; |