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
SELECT total_params_tier | |
,AVG(logging_statements / total_repo_logging_statements) percent_out_of_total_repo_statements | |
,SUM(total_params) total_params | |
,SUM(logging_statements) logging_statements | |
,SUM(has_parameters) has_parameters | |
,SUM(has_concatenation) has_concatenation | |
,SUM(has_none) has_none | |
,SUM(has_both) has_both | |
,SUM(parameters_count) parameters_count | |
,SUM(concatenation_count) concatenation_count |
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
SELECT sample_repo_name | |
,log_level | |
,CASE WHEN parametersCount + concatenationCount = 0 THEN "0" | |
WHEN parametersCount + concatenationCount = 1 THEN "1" | |
WHEN parametersCount + concatenationCount = 2 THEN "2" | |
WHEN parametersCount + concatenationCount = 3 THEN "3" | |
WHEN parametersCount + concatenationCount = 4 THEN "4" | |
WHEN parametersCount + concatenationCount >= 5 THEN "5+" | |
END total_params_tier | |
,SUM(parametersCount + concatenationCount) total_params |
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
SELECT * | |
FROM [java-log-levels-usage:java_log_level_usage.top_repos_java_contents_lines_no_android_no_arduino] | |
WHERE REGEXP_MATCH(line, r'.*((LOGGER|Logger|logger|LOG|Log|log)[.](trace|info|debug|warn|warning|error|fatal|severe|config|fine|finer|finest)).*') | |
OR REGEXP_MATCH(line, r'.*((Level|Priority)[.](TRACE|TRACE_INT|X_TRACE_INT|INFO|INFO_INT|DEBUG|DEBUG_INT|WARN|WARN_INT|WARNING|WARNING_INT|ERROR|ERROR_INT)).*') | |
OR REGEXP_MATCH(line, r'.*((Level|Priority)[.](FATAL|FATAL_INT|SEVERE|SEVERE_INT|CONFIG|CONFIG_INT|FINE|FINE_INT|FINER|FINER_INT|FINEST|FINEST_INT|ALL|OFF)).*') |
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
CountCatsInput input = new CountCatsInput(); | |
input.setBucketName("pictures-of-cats"); | |
input.setKey("three-cute-cats"); | |
int cats = catService.countCats(input).getCount(); |
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
// equivalent to: turn(left).then(right) | |
turn left then right | |
// equivalent to: take(2.pills).of(chloroquinine).after(6.hours) | |
take 2.pills of chloroquinine after 6.hours | |
// equivalent to: select(all).unique().from(names) | |
select all unique() from names | |
show = { println it } |
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
if { | |
// [#1145] Bind variables only for true prepared statements | |
// [#2414] Even if parameters are inlined here, child | |
// QueryParts may override this behaviour! | |
executePreparedStatements(c.settings()) && | |
// [#1520] Renderers may enforce static statements, too | |
!Boolean.TRUE.equals(ctx.data(DATA_FORCE_STATIC_STATEMENT))) { | |
... |
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
function killtomcat() | |
{ | |
running_tomcats=ps -ef | grep org.apache.catalina.startup.Bootstrap | grep -v grep | awk '{ print $2 }' | tail -1 | |
kill -9 $running_tomcats | |
} |
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
function temp() | |
{ | |
local root_dir=~/temp/temp | |
local date_seconds=date +%s | |
local temp_dir="$root_dir/$date_seconds" | |
mkdir -p "$temp_dir" | |
cd "$temp_dir" | |
} |
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
function unzipAll() | |
{ | |
for file in `ls | /bin/grep zip`; do | |
local base_name="${file%.*}" | |
rm -rf $base_name | |
mkdir $base_name | |
unzip $file -d $base_name | |
rm $file | |
done | |
} |
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
function d2h() | |
{ | |
printf "%x\n" $1 | |
} |