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
/** | |
* jQuery.support.checkboxIndeterminate | |
* https://github.com/RupW | |
* Tests for HTML 5 checkbox 'indeterminate' property | |
* http://www.w3.org/TR/html5/the-input-element.html#dom-input-indeterminate | |
* http://www.w3.org/TR/html5/number-state.html#checkbox-state | |
* | |
* Released under the same license as jQuery | |
* http://docs.jquery.com/License | |
* |
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 | |
/** | |
* "We strongly recommend a permalink structure" admin site notice | |
* | |
* from http://wordpress.stackexchange.com/a/157071/3276 | |
*/ | |
if ( is_admin() && ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) ) { | |
/* Admin-site only code */ |
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
/** | |
* A Newton-Raphson implementation of https://stackoverflow.com/q/46289473 | |
*/ | |
public class SO46289473 | |
{ | |
public static double nrSolveW(double c, double epsilon) { | |
double guessValue; | |
if (c < 0 && c != Double.NEGATIVE_INFINITY) { | |
// Then 1st intersection is between π/2 and π (towards -infinite C) | |
guessValue = Math.PI * 0.75; |
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
// https://stackoverflow.com/q/59054704/243245 | |
import java.io.File; | |
import java.io.IOException; | |
import java.util.ArrayList; | |
import java.util.Collections; | |
import java.util.Scanner; | |
public class BinarySearchExample { | |
public static void main( String[] args ) | |
throws IOException |
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
<!DOCTYPE html> | |
<html lang="en-US"> | |
<head><title>Safari textpath multiple tspans text-anchor:middle</title> | |
<style> | |
body { | |
height: 100%; | |
margin: 0; | |
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; | |
font-size: 14px; | |
line-height: 1.42857143; |
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 * as crypto from 'node:crypto'; | |
// Format is "Salted__", 8-byte salt, cipher text | |
const saltedPrefixBuffer = Buffer.from('Salted__'); | |
function md5(...inputs: Buffer[]): Buffer { | |
const hash = crypto.createHash('md5'); | |
inputs.forEach(input => hash.update(input)); | |
return hash.digest(); | |
} |