This is inspired by A half-hour to learn Rust and Zig in 30 minutes.
Your first Go program as a classical "Hello World" is pretty simple:
First we create a workspace for our project:
# Alternative to_sql() *method* for mssql+pyodbc or mssql+pymssql | |
# | |
# adapted from https://pandas.pydata.org/docs/user_guide/io.html#io-sql-method | |
import json | |
import pandas as pd | |
import sqlalchemy as sa | |
def mssql_insert_json(table, conn, keys, data_iter): |
# version 1.2 - 2022-11-01 | |
import pandas as pd | |
import sqlalchemy as sa | |
def df_upsert(data_frame, table_name, engine, schema=None, match_columns=None): | |
""" | |
Perform an "upsert" on a SQL Server table from a DataFrame. | |
Constructs a T-SQL MERGE statement, uploads the DataFrame to a |
Create a file: | |
$ vim /Users/Shared/logoutHook.sh | |
File content: | |
#!/bin/bash | |
say 'Hasta la vista baby!' | |
Set execution permission: | |
$ sudo chmod +x /Users/Shared/logoutHook.sh |
# brew install unixodbc | |
export CPPFLAGS="-I/opt/homebrew/Cellar/unixodbc/2.3.9_1/include" | |
export LDFLAGS="-L/opt/homebrew/Cellar/unixodbc/2.3.9_1/lib -liodbc -liodbcinst" | |
export PKG_CONFIG_PATH="/opt/homebrew/Cellar/unixodbc/2.3.9_1/lib/pkgconfig $PKG_CONFIG_PATH" | |
pip install --no-binary pyodbc pyodbc |
# ========= PROMPT ========= | |
# Version control information | |
autoload -Uz vcs_info | |
precmd() { vcs_info } | |
# Format the vcs_info_msg_0_ variable | |
zstyle ':vcs_info:git:*' formats ' %b ' | |
# Render the prompt | |
setopt PROMPT_SUBST |
" Maintainer: Lars Nielsen (dengmao@gmail.com) | |
" Last Change: January 22 2007 | |
" https://dengmao.wordpress.com/2007/01/22/vim-color-scheme-wombat/ | |
set background=dark | |
hi clear | |
if exists("syntax_on") | |
syntax reset |
/* | |
ClickHouse client version 1.1.53996. | |
Connecting to localhost:9000. | |
Connected to ClickHouse server version 1.1.53996. | |
*/ | |
:) CREATE TABLE IF NOT EXISTS `employee` ( | |
:-] `empid` Int32, | |
:-] `deptid` Int32, | |
:-] `salary` Int64 |
This is inspired by A half-hour to learn Rust and Zig in 30 minutes.
Your first Go program as a classical "Hello World" is pretty simple:
First we create a workspace for our project:
import pandas as pd | |
import visidata as vd | |
df=pd.read_csv('file.csv') | |
vd.view_pandas(df) |
create or replace function create_jsonb_flat_view | |
(table_name text, regular_columns text, json_column text) | |
returns text language plpgsql as $$ | |
declare | |
cols text; | |
begin | |
execute format ($ex$ | |
select string_agg(format('%2$s->>%%1$L "%%1$s"', key), ', ') | |
from ( | |
select distinct key |