Skip to content

Instantly share code, notes, and snippets.

// data
{
"_id" : ObjectId("5f4f03709f80fb9179d5136e"),
"data1" : 1.0,
"data2" : 2.0,
"data3" : 3.0,
"data4" : 4.0,
"data5" : 5.0,
"other" : {
"data6" : 6.0,
# spark-env.sh
export SPARK_DIST_CLASSPATH=$(hadoop classpath)
=====================================
pseudo distribution
=====================================
# hadoop-env.sh
export JAVA_HOME=/home/hadoop/app/java
# core-site.xml
<configuration>
<property>
<?php // <?php is required
// helper
if (!function_exists('separator')) {
function separator($tag = 'TAG')
{
echo '------------ ' . $tag . ' ------------' . PHP_EOL;
}
}
# directory & file
app // include Console, Events, Exceptions, Http (Controllers/Middleware), Jobs, Listeners, Models, Providers
bootstrap/app.php // instantiate lumen application
config // default: vendor/laravel/lumen-framework/config (include app.php, auth.php, logging.php ...)
public/index.php // there is a .htaccess in the same level
routes/web.php
vendor // dependencies
.env // after loaded, get by function env($key, $default = null)
artisan // #!/usr/bin/env php
composer.json // like npm package.json
#define _GNU_SOURCE
#include <sys/wait.h>
#include <sys/wait.h>
#include <sched.h>
#include <stdio.h>
#include <signal.h>
#include <unistd.h>
#define STACK_SIZE (1024 * 1024)
# rvm
rvm list // list installed interpreters
rvm list known // list available interpreters
rvm install <version> // install ruby interpreter
rvm use <version> // switch to specified ruby interpreter
rvm remove <version> // remove ruby interpreter (alias: delete)
rvm get <version> // upgrade rvm: stable, master
ls -al ~/.rvm/
# ruby
# base
cri (container runtime interface)
cni (container network interface)
csi (container storage interface)
ipvs (ip virtual server)
oci (open container initiative)
nfs (network file system)
=> ref: https://zhuanlan.zhihu.com/p/33390023
=> ref: https://www.youtube.com/watch?v=Qw-6k95IBHU
# .net standard
=> ref: https://github.com/dotnet/standard/blob/master/docs/versions.md
=> ref: https://github.com/dotnet/standard/tree/master/docs/versions
# .net framework
v4.8 is recommended
=> ref: https://dotnet.microsoft.com/download/dotnet-framework
# .net core
v3.1 is LTS
[ApiController]
[Route("api/[controller]/[action]")]
public class AsyncController : ControllerBase
{
[HttpGet]
public async void Test()
{
Console.WriteLine("thread id: {0}", Thread.CurrentThread.ManagedThreadId);
await new HttpClient().GetAsync("https://www.google.com/");