Skip to content

Instantly share code, notes, and snippets.

View guanlisheng's full-sized avatar
🏠
Working from home

Lisheng Guan guanlisheng

🏠
Working from home
View GitHub Profile
@guanlisheng
guanlisheng / alluxio-emr.sh
Last active February 20, 2022 09:03
setup alluxio with tiered storage (MEM, SSD) in EMR, with Presto included to verify it.
#!/usr/bin/env bash
#
# The Alluxio Open Foundation licenses this work under the Apache License, version 2.0
# (the "License"). You may not use this work except in compliance with the License, which is
# available at www.apache.org/licenses/LICENSE-2.0
#
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
# either express or implied, as more fully set forth in the License.
#
# See the NOTICE file distributed with this work for information regarding copyright ownership.
<?php
require_once "../Webservice/db_functions.php";
require_once "../Webservice/send_mail.php";
require_once "../Webservice/utility.php";
function getIpAddress()
{
if (!empty($_SERVER['HTTP_CLIENT_IP']))
return $_SERVER['HTTP_CLIENT_IP'];
else if (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
set PATH=C:\Program Files (x86)\MSBuild\14.0\Bin;%PATH%
msbuild "build/msw-vc-2015/mmex.sln" /verbosity:normal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
"c:\Program Files (x86)\MSBuild\12.0\Bin\MSBuild.exe" "c:\projects\wxwidgets\build\msw\wx_vc12.sln" /verbosity:normal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
@guanlisheng
guanlisheng / FW_foosball_rank
Last active August 29, 2015 14:06
FW forward & guard ranking list
前锋Loser们翻滚吧 zhongyuan》Ben》lisheng》xiaotuo》peixiang》xudong
后卫Loser们吃药了 lisheng》zhongyuan》xiaotuo》ben》peixiang》xudong
select ifnull(split.CATEGID, tran.CATEGID) as CATEGID, c.CATEGNAME as Category
, ifnull(split.SUBCATEGID, tran.SUBCATEGID) as SUBCATEGID, s.SUBCATEGNAME as Subcategory
, sum(ifnull(split.SPLITTRANSAMOUNT, tran.TRANSAMOUNT)) as [Total Spend]
, count(distinct strftime('%Y%m', tran.TRANSDATE)) as [Months Active]
, sum(ifnull(split.SPLITTRANSAMOUNT, tran.TRANSAMOUNT)) / count(distinct strftime('%m', tran.TRANSDATE)) as [Average Spending]
from CHECKINGACCOUNT_V1 as tran
left join SPLITTRANSACTIONS_V1 as split on tran.TRANSID = split.TRANSID
join CATEGORY_V1 as c on (c.CATEGID = ifnull(split.CATEGID, tran.CATEGID))
join SUBCATEGORY_V1 as s on (s.CATEGID = c.CATEGID and s.SUBCATEGID = ifnull(split.SUBCATEGID, tran.SUBCATEGID))
where tran.transcode = 'Withdrawal'
{
"USD": {
"symbol": "$",
"name": "US Dollar",
"symbol_native": "$",
"decimal_digits": 2,
"rounding": 0,
"code": "USD",
"name_plural": "US dollars"
},
@guanlisheng
guanlisheng / mysql_exclude_join
Last active October 13, 2015 17:37
Handles MySQL exclude JOIN operation.
select
a.*
from a
left join b on (a.id = b.id)
where b.id is null