- 使用 cURL + cookie 完成登入 iTunesConnect
- 切換至 App 頁面資訊,查看有多少 Test User
- 添加 Test User
- 刪除 Test User
如此而已 :P 於是乎,用 https://github.com/changyy/codeigniter-library-ios-test-user 紀錄一下。
CREATE TABLE `play_action` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`timestamp` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`play_result` INT (10) NOT NULL
)
SELECT DATE_FORMAT(timestamp, "%Y-%m-%d %a") AS d, play_result, count(*) FROM play_action GROUP BY d, play_result
CREATE TEMPORARY TABLE `play` (
`play_count` INT (10) NOT NULL,
`play_date` VARCHAR(32) NOT NULL,
`play_result` INT (10) NOT NULL,
UNIQUE KEY `play_date` (`play_date`, `play_result`)
);
INSERT INTO `play` (play_result, play_date, play_count) SELECT play_result, DATE_FORMAT(timestamp, "%Y-%m-%d %a") AS d, count(*) as c FROM play_action WHERE timestamp >= '2016-04-01 00:00:00' GROUP BY play_result, d ORDER BY d ON DUPLICATE KEY UPDATE play_count=VALUES(play_count);
CREATE TEMPORARY TABLE `play_sum` (
`play_count` INT (10) NOT NULL,
`play_date` VARCHAR(32) NOT NULL,
UNIQUE KEY `play_date` (`play_date`)
);
INSERT INTO `play_sum` (play_date, play_count) SELECT play_date, SUM(play_count) AS play_total FROM play GROUP BY play_date;
SELECT play.play_date, play.play_result, play.play_count / play_sum.play_count * 100, play_sum.play_count AS play_total FROM play, play_sum WHERE play.play_date = play_sum.play_date;
+----------------+-------------+---------------------------------------------+------------+
| play_date | play_result | play.play_count / play_sum.play_count * 100 | play_total |
+----------------+-------------+---------------------------------------------+------------+
| 2016-04-01 Fri | 0 | 54.9398 | 687 |
| 2016-04-02 Sat | 0 | 68.9445 | 972 |
| 2016-04-03 Sun | 0 | 75.6607 | 1748 |
| 2016-04-04 Mon | 0 | 71.3967 | 1112 |
| 2016-04-05 Tue | 0 | 70.2852 | 886 |
| 2016-04-06 Wed | 0 | 49.8085 | 880 |
| 2016-04-07 Thu | 0 | 53.2239 | 596 |
+----------------+-------------+---------------------------------------------+------------+
$ cd /path/project
$ git submodule add https://github.com/google/googletest/tree/master/googletest 3rdParty/googletest
$ vim CMakeLists.txt
...
add_subdirectory(3rdParty/googletest)
add_executable(your_unit_test
your_unit_test.cpp
)
add_dependencies(your_unit_test gtest)
include_directories(${gtest_SOURCE_DIR}/include)
target_link_libraries(your_unit_test
gtest
)