- Plain Strings (207):
foo
- Anchors (208):
k$
- Ranges (202):
^[a-f]*$
- Backrefs (201):
(...).*\1
- Abba (169):
^(.(?!(ll|ss|mm|rr|tt|ff|cc|bb)))*$|^n|ef
- A man, a plan (177):
^(.)[^p].*\1$
- Prime (286):
^(?!(..+)\1+$)
- Four (199):
(.)(.\1){3}
- Order (198):
^[^o].....?$
- Triples (507):
(^39|^44)|(^([0369]|([147][0369]*[258])|(([258]|[147][0369]*[147])([0369]*|[258][0369]*[147])([147]|[258][0369]*[258])))*$)
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 pyspark.sql import SQLContext | |
sqlContext = SQLContext.getOrCreate(t1.rdd.context) |
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
#!/bin/bash | |
yarn application -list | awk '{print $1}' | while read line;do | |
echo $line | |
yarn application -kill $line | |
done |
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
git branch --merged | egrep -v "(^\*|master|dev)" | xargs git branch -d |
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
#include<string> | |
#include<vector> | |
#include<sstream> | |
#include<iostream> | |
std::vector<std::string> split(const std::string& s, char delimiter) { | |
std::string item; | |
std::istringstream is(s); | |
std::vector<std::string> ret; | |
while(std::getline(is, item, delimiter)) { |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
int main (void) | |
{ | |
char *string = "T01:91+:123"; | |
char tmp[16]; | |
char* s; |
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
'hello world'[::-1] | |
#'dlrow olleh' | |
#http://stackoverflow.com/questions/931092/reverse-a-string-in-python |
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
public class TestConSum { | |
public static void main(String... args) { | |
int[] arr = new int[]{-2,11,-4,13,-5,-2}; | |
int negsum = 0; | |
int maxsum = 0; | |
for (int i = 0; i < arr.length; i++) { | |
if (arr[i] < 0) { |