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
function highlightWord(root, word, className) { | |
// base on https://stackoverflow.com/a/10730063 | |
// word is lower-case | |
var walker, textNodes = []; | |
walker = document.createTreeWalker(root, NodeFilter.SHOW_TEXT, { | |
acceptNode: function (node) { | |
if (node.nodeType === Node.TEXT_NODE && node.textContent.toLowerCase().indexOf(word) >= 0) { | |
return NodeFilter.FILTER_ACCEPT; | |
} else { |
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 android.graphics.Bitmap; | |
import android.graphics.Canvas; | |
import android.graphics.Color; | |
import android.graphics.Rect; | |
/** | |
* Created by thom on 2018/9/23. | |
*/ | |
public class BitmapUtils { |
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 me.piebridge; | |
import java.io.IOException; | |
import java.io.RandomAccessFile; | |
import java.math.BigInteger; | |
import java.nio.ByteBuffer; | |
import java.nio.ByteOrder; | |
import java.util.Arrays; | |
import java.util.regex.Matcher; | |
import java.util.regex.Pattern; |
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
############################################################################# | |
# Original code ported from the Java reference code by Bram Cohen, April 2001, | |
# with the following statement: | |
# | |
# this code is public domain, unless someone makes | |
# an intellectual property claim against the reference | |
# code, in which case it can be made public domain by | |
# deleting all the comments and renaming all the variables | |
# | |
class Rijndael(object): |
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
<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 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 java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.HashMap; | |
import java.util.List; | |
public class MinDepth { | |
private static void mindepth(int[] array, int index, int depth, HashMap<Integer, int[]> maps) { | |
List<Integer> added = new ArrayList<Integer>(); | |
for (int i = 0; i < index; ++i) { |
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
--- configure.ac~ 2009-01-16 22:58:48.000000000 +0800 | |
+++ configure.ac 2013-08-27 20:33:41.000000000 +0800 | |
@@ -115,6 +115,22 @@ if test "x$ac_cv_prog_gcc" = xyes; then | |
if test "x$no_stack_protector_flag" = xyes; then | |
STAGE2_CFLAGS="$STAGE2_CFLAGS -fno-stack-protector" | |
fi | |
+ # GCC >= 3.3 supports -fno-reorder-functions; this defends us against | |
+ # unlikely-to-be-executed functions being linked before _start with GCC | |
+ # >= 4.6. | |
+ AC_CACHE_CHECK([whether gcc has -fno-reorder-functions], |