Token Type (Parent Class) | Description |
---|---|
Token | The base class from which each token inherits |
ElementToken(Token) | Each non special char is an element token |
WildcardToken(Token) | Base class for the wildcard type tokens |
Wildcard(WildcardToken) | Class for the '.' as wildcard token |
StartToken(Token) | Base class for the start type tokens |
Start(StartToken) | Class for '^' as start token |
EndToken(Token) | See StartToken |
End(EndToken) | '$' as end token |
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
/** | |
* Checks for a set of permissions. If not granted, the user is asked to grant them. | |
* | |
* @param activity The activity that is requesting the permissions | |
* @param permissions The permissions to be checked | |
* @param requestCode The request code to be used when requesting the permissions | |
*/ | |
fun checkPermissions(activity: Activity, permissions: Array<out String>, requestCode: Int) | |
/** |
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
val permissions = arrayOf( | |
Manifest.permission.BLUETOOTH_SCAN, | |
Manifest.permission.ACCESS_COARSE_LOCATION, | |
Manifest.permission.ACCESS_FINE_LOCATION, | |
Manifest.permission.BLUETOOTH_ADMIN, | |
) |
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
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" /> | |
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" /> | |
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" /> | |
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> | |
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> |
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 .tokens import * | |
import numpy as np | |
class Lexer: | |
def __init__(self): | |
self.__digits__ = '0123456789' | |
pass | |
def __is_digit__(self, ch): |
Feature | Syntax |
---|---|
match start | ^... |
match end | ...$ |
escaping | \ |
grouping | (...) |
alternative | a|b |
wildcard | . |
quantifiers | ? * + |
curly brace quantification | {exact} {min,max} {,max} {min,} |
We can make this file beautiful and searchable if this error is corrected: It looks like row 10 should actually have 27 columns, instead of 15. in line 9.
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
race,Joan Mir,Franco Morbidelli,Alex Rins,Andrea Dovizioso,Pol Espargaro,Maverick Vinales,Jack Miller,Fabio Quartararo,Miguel Oliveira,Takaaki Nakagami,Brad Binder,Danilo Petrucci,Johann Zarco,Alex Marquez,Valentino Rossi,Francesco Bagnaia,Aleix Espargaro,Cal Crutchlow,Stefan Bradl,Iker Lecuona,Bradley Smith,Esteve Rabat,Michele Pirro,Mika Kallio,Lorenzo Savadori,Marc Marquez | |
race 1,0,11,0,16,10,20,13,25,8,6,3,7,5,4,0,9,0,0,0,0,1,2,0,0,0,0 | |
race 2,11,11,6,26,19,40,13,50,8,19,3,7,12,12,16,9,0,3,0,0,5,7,0,0,0,0 | |
race 3,11,31,19,31,19,42,20,59,18,27,28,11,28,13,27,9,6,6,0,0,5,7,0,0,0,0 | |
race 4,31,31,19,56,19,48,36,67,18,37,41,20,28,15,38,9,11,7,0,7,8,7,4,0,0,0 | |
race 5,44,32,29,67,35,48,56,70,43,46,49,25,30,15,45,9,15,7,0,13,8,7,4,0,0,0 | |
race 6,60,57,40,76,41,58,64,70,48,53,53,25,31,15,58,29,18,7,0,15,8,7,4,0,0,0 | |
race 7,80,64,44,84,57,83,64,83,59,63,53,31,36,24,58,29,18,7,0,15,11,7,4,0,0,0 | |
race 8,100,77,60,84,57,90,75,108,59,72,58,39,36,27,58,39,22,13,0,17,11,8,4,0,0,0 | |
race 9,105,77,60,97,73,96,75,115,69,81,62,64,47,4 |
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
<!DOCTYPE html> | |
<html> | |
<body> | |
<input type='button' id="btn" value='now: true'> | |
<script src="playpause.js"></script> | |
</body> | |
</html> |
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 playPause() { | |
let playing = true; | |
return () => { // () => is equivalent to function() ...in this case | |
if (playing) | |
console.log("now stopped"); | |
else | |
console.log("now playing"); | |
playing = !playing; | |
} |
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 makeCounter(initialValue) { | |
let count = initialValue; | |
function toString() { | |
return 'The count is ' + count +'.'; | |
} | |
return { | |
add: function() { return ++count }, | |
sub: function() { return --count }, | |
val: function() { return count }, | |
toString: toString |
NewerOlder