Skip to content

Instantly share code, notes, and snippets.

@911992
911992 / v14.4.0-SNAPSHOT_grouped_attributes_(20201125)_r0_spec.md
Created November 26, 2020 02:28
Spec of UMLet public/grouped attrib

Related to umlet#515

Spec

First shared attribs (either public/grouped) must be defined, to do so:

  • Simply select the working diagram(also works for pallets)(not an element, e.g. a blank space in diagram)
  • Start the shared public/grouped definition using [includes]
    • Any line after [includes] will be assumed as public attribs(all elements will grab it, at the first line of each)
    • For specifying a group, do it using leading # char, like #blues
      • any line after #blues will be assigned for group blues
  • Hint: # char could be escaped using \#
@911992
911992 / pgsql_trigger_arg.md
Created October 31, 2020 01:20
PostgreSQL trigger function argument

As normal array types in pgsql are started at index 1, but suprisingly, the TG_ARGV input arg for triggers are zero indexed!

This is becasue the TG_ARGV were defined to be indexed from zero

Considering following example!

create table x(
	_id serial,
	_val int
@911992
911992 / array_idx_pgsql.md
Created October 30, 2020 23:50
Array indexing Postgresql

suprisingly! index are started from 1 in pgpsql when it's about arrays!, I just realize it, while i was debuging a plpsql func

An more suprising stuff is about NULL when accessing out-of-bound index of an array, well I was expecting errors!

with arr as(
  select array[911,992]::int[] as arr
)
select arr[1] from arr /*returns 911*/
union all
@911992
911992 / winnie_the_pooh_add.c
Created October 11, 2020 23:14
Need more brain for add
#include <stdio.h>
//https://github.com/911992
//clone: https://ideone.com/nW8NGx
#define B 1024
#define A 1024
int main(void) {
int a=A;
int b=B;
int c;
@911992
911992 / json_mutable_reader_test.java
Created October 10, 2020 21:24
gson MutableJsonReader example
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
sample_code_java0
File: json_mutable_reader_test.java
Created on: Oct 10, 2020 12:04:38 PM
@911992
911992 / json_mutable_writer_test.java
Created October 10, 2020 21:20
gson MutableJsonReader example
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
sample_code_java0
File: json_mutable_writer_test.java
Created on: Oct 10, 2020 12:43:02 PM
@911992
911992 / Gson_Transient1.java
Created September 18, 2020 10:45
including transient field in gson
/*
* Lic: BSD 3
*/
/*
sample_code_java0
File: Gson_Transient1.java
Created on: Sep 18, 2020 2:33:06 AM
@author https://github.com/911992
@911992
911992 / Gson_Transient.java
Created September 18, 2020 10:25
including transient field in gson
/*
* Lic: BSD 3.0
*/
/*
sample_code_java0
File: Gson_Transient.java
Created on: Sep 18, 2020 1:51:02 AM
@author https://github.com/911992
@911992
911992 / windfly_add-user.md
Created August 12, 2020 18:04
Adding user to windfly

By default using ./bin/add-user.sh|cmd file should work.

But if add-user.bat result a failed resp by The system cannot find the path specified. message, you may go like following

  1. head into the wildfly root folder.

  2. use following command (template)

java -Djboss.server.config.user.dir=<<address of configuration folder, example: ./standalone/configuration>>
-Djboss.domain.config.user.dir=&lt;&gt;
@911992
911992 / AutoCloseable_Type.java
Created July 2, 2020 21:25
java try-with-resources AutoCloseable example
/*@author https://github.com/911992*/
class My_Closeable_Type implements AutoCloseable
{
public static void main (String arg_args[])
{
try(My_Closeable_Type _ins = new My_Closeable_Type()){
}/*will call close() automatically*/
}