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
/* | |
* regex.c | |
* Qiu Chaofan, 2016/1/12 | |
* | |
* Regular expression engine. | |
* | |
* Features: | |
* Support matching for | * ? + . () | |
* No error handling is considered yet. | |
*/ |
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
// Canvas with multiple layers | |
// copyright 2015 by Fred Moolekamp | |
// MIT License | |
initMultiCanvas=function(div,options){ | |
var $div; | |
if(div instanceof jQuery){ | |
$div=div; | |
}else{ | |
$div=$(div); | |
}; |
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 os | |
import tensorflow as tf | |
trained_checkpoint_prefix = 'checkpoints/dev' | |
export_dir = os.path.join('models', '0') # IMPORTANT: each model folder must be named '0', '1', ... Otherwise it will fail! | |
loaded_graph = tf.Graph() | |
with tf.Session(graph=loaded_graph) as sess: | |
# Restore from checkpoint | |
loader = tf.train.import_meta_graph(trained_checkpoint_prefix + '.meta') |
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
# When an RSpec test like this fails, | |
# | |
# @my_array.should == [@some_model, @some_model2] | |
# | |
# RSpec will call inspect on each of the objects to "help" you figure out | |
# what went wrong. Well, inspect will usually dump a TON OF SHIT and make trying | |
# to figure out why `@my_array` is not made up of `@some_model` and `@some_model2`. | |
# | |
# This little module and technique helps get around that. It will redefine `inspect` | |
# if you include it in your model 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
/// | |
/// [Author] Alex (https://github.com/AlexV525) | |
/// [Date] 07/30/21 5:29 PM | |
/// | |
import 'dart:typed_data'; | |
import 'dart:ui' as ui; | |
import 'package:flutter/rendering.dart'; | |
import 'package:flutter/widgets.dart'; |
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(){ | |
var _fillText, | |
__slice = [].slice; | |
_fillText = CanvasRenderingContext2D.prototype.fillText; | |
CanvasRenderingContext2D.prototype.fillText = function() { | |
var args, offset, previousLetter, str, x, y, | |
_this = this; |
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
# Video: http://rubyhoedown2008.confreaks.com/08-chris-wanstrath-keynote.html | |
Hi everyone, I'm Chris Wanstrath. | |
When Jeremy asked me to come talk, I said yes. Hell yes. Immediately. But | |
then I took a few moments and thought, Wait, why? Why me? What am I supposed | |
to say that's interesting? Something about Ruby, perhaps. Maybe the | |
future of it. The future of something, at least. That sounds | |
keynote-y. | |
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
from bs4 import BeautifulSoup | |
# remove all attributes | |
def _remove_all_attrs(soup): | |
for tag in soup.find_all(True): | |
tag.attrs = {} | |
return soup | |
# remove all attributes except some tags | |
def _remove_all_attrs_except(soup): |
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 auth | |
import ( | |
"context" | |
"net/http" | |
"strings" | |
"google.golang.org/grpc/metadata" | |
"github.com/andela/micro-api-gateway/pb/authorization" |
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
"""You help triaging user requests. Given a raw text input, output either DOCS or DEFAULT, according to those definitions: | |
DOCS: if user is asking a seemingly technical question, programming questions or company-specific questions | |
DEFAULT: if user is just chit-chatting or basic knowledge questions | |
==================== | |
Input: hello there | |
Output: DEFAULT |
OlderNewer