This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
struct weather { | |
id int | |
main string | |
description string | |
icon string | |
} | |
struct document { | |
weather []weather |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct TNode { | |
pub mut: | |
id int | |
children []*TNode | |
} | |
struct Record{ | |
pub: | |
id int | |
parent int |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package tree | |
import ( | |
"fmt" | |
"sort" | |
) | |
//Record sctruct holds initial records | |
type Record struct { | |
ID int |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
reader, writer = IO.pipe # writes in parent -> reads in child | |
reader2, writer2 = IO.pipe # writes in child -> reads in parent | |
Process.run(command: "./child", input: reader, output: writer2) do | |
puts "inside master block" | |
writer.puts "message from master 2" | |
end | |
reader2.each_line { |x| puts "rcvd: #{x}"} | |
puts "done" # doesn't get to this line |