hyper_card 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +5 -0
  3. data/CODE_OF_CONDUCT.md +132 -0
  4. data/LICENSE.txt +21 -0
  5. data/README.org +75 -0
  6. data/Rakefile +36 -0
  7. data/docs/c_basic/2_5_2.c +17 -0
  8. data/docs/c_basic/README.html +175 -0
  9. data/docs/c_basic/README.org +67 -0
  10. data/docs/hyper_card/README.html +104 -0
  11. data/docs/hyper_card/README.org +35 -0
  12. data/docs/hyper_card/Rakefile +8 -0
  13. data/docs/hyper_card/hc_index.rb +54 -0
  14. data/docs/hyper_card/images/HyperCard_24f-01.jpg +0 -0
  15. data/docs/hyper_card/images/HyperCard_24f-02.jpg +0 -0
  16. data/docs/hyper_card/images/HyperCard_24f-03.jpg +0 -0
  17. data/docs/hyper_card/images/HyperCard_24f-04.jpg +0 -0
  18. data/docs/hyper_card/images/HyperCard_24f-05.jpg +0 -0
  19. data/docs/hyper_card/images/HyperCard_24f-06.jpg +0 -0
  20. data/docs/hyper_card/images/HyperCard_24f-07.jpg +0 -0
  21. data/docs/hyper_card/images/HyperCard_24f-08.jpg +0 -0
  22. data/docs/hyper_card/images/HyperCard_24f-09.jpg +0 -0
  23. data/docs/hyper_card/images/HyperCard_24f-10.jpg +0 -0
  24. data/docs/hyper_card/images/HyperCard_24f-11.jpg +0 -0
  25. data/docs/hyper_card/images/HyperCard_24f-12.jpg +0 -0
  26. data/docs/hyper_card/images/HyperCard_24f-13.jpg +0 -0
  27. data/docs/hyper_card/multiple_rake.html +40 -0
  28. data/docs/hyper_card/multiple_rake.org +17 -0
  29. data/docs/hyper_card/rakelib/al_twist.rake +58 -0
  30. data/docs/hyper_card/rakelib/comp_a.rake +55 -0
  31. data/docs/hyper_card/schizophrenia_vs_paranoia/Kato10_book_review_eto.html +105 -0
  32. data/docs/hyper_card/schizophrenia_vs_paranoia/Kato10_book_review_eto.org +49 -0
  33. data/docs/hyper_card/schizophrenia_vs_paranoia/TetsugakuRenshu20_296.html +131 -0
  34. data/docs/hyper_card/schizophrenia_vs_paranoia/TetsugakuRenshu20_296.org +55 -0
  35. data/docs/ruby_basic/README.html +115 -0
  36. data/docs/ruby_basic/README.org +30 -0
  37. data/docs/ruby_basic/Rakefile +56 -0
  38. data/docs/ruby_basic/Rakefile_on_site +69 -0
  39. data/docs/ruby_basic/basic_6/README.org +12 -0
  40. data/docs/ruby_basic/basic_6/readlines.rb +5 -0
  41. data/docs/ruby_basic/fsm/README.html +189 -0
  42. data/docs/ruby_basic/fsm/README.org +27 -0
  43. data/docs/ruby_basic/fsm/README_sample.org +25 -0
  44. data/docs/ruby_basic/fsm/README_sample_org.html +57 -0
  45. data/docs/ruby_basic/fsm/README_sample_org.org +13 -0
  46. data/docs/ruby_basic/fsm/complex/README.html +133 -0
  47. data/docs/ruby_basic/fsm/complex/README.org +50 -0
  48. data/docs/ruby_basic/fsm/complex/check_auto_calc_state_action.rb +35 -0
  49. data/docs/ruby_basic/fsm/complex/check_auto_calc_state_action_rb.html +67 -0
  50. data/docs/ruby_basic/fsm/complex/check_auto_calc_state_action_rb.org +13 -0
  51. data/docs/ruby_basic/fsm/complex/fsm_results.txt +16 -0
  52. data/docs/ruby_basic/fsm/complex/fsm_results_txt.html +52 -0
  53. data/docs/ruby_basic/fsm/complex/fsm_results_txt.org +14 -0
  54. data/docs/ruby_basic/fsm/complex/vasptest.o22698 +4289 -0
  55. data/docs/ruby_basic/fsm/complex/vasptest_short.o01234 +26 -0
  56. data/docs/ruby_basic/fsm/complex/vasptest_short_o01234.html +62 -0
  57. data/docs/ruby_basic/fsm/complex/vasptest_short_o01234.org +14 -0
  58. data/docs/ruby_basic/fsm/fsm_no_hash.html +108 -0
  59. data/docs/ruby_basic/fsm/fsm_no_hash.org +20 -0
  60. data/docs/ruby_basic/fsm/fsm_no_hash.rb +8 -0
  61. data/docs/ruby_basic/fsm/fsm_no_hash_results.txt +4 -0
  62. data/docs/ruby_basic/fsm/fsm_simplest.rb +12 -0
  63. data/docs/ruby_basic/fsm/fsm_state_action.html +50 -0
  64. data/docs/ruby_basic/fsm/fsm_state_action.org +16 -0
  65. data/docs/ruby_basic/fsm/fsm_state_action.rb +34 -0
  66. data/docs/ruby_basic/fsm/fsm_state_action.results +14 -0
  67. data/docs/ruby_basic/fsm/fsm_state_action_rb.html +64 -0
  68. data/docs/ruby_basic/fsm/fsm_state_action_rb.org +13 -0
  69. data/docs/ruby_basic/fsm/fsm_state_action_results.html +46 -0
  70. data/docs/ruby_basic/fsm/fsm_state_action_results.org +13 -0
  71. data/docs/ruby_basic/fsm/fsm_state_key.rb +22 -0
  72. data/docs/ruby_basic/fsm/full_fsm +1 -0
  73. data/docs/ruby_basic/images/seminar_24s-05.jpg +0 -0
  74. data/docs/ruby_basic/images/seminar_24s-06.jpg +0 -0
  75. data/docs/ruby_basic/images/seminar_24s-07.jpg +0 -0
  76. data/docs/ruby_basic/images/seminar_24s-08.jpg +0 -0
  77. data/docs/ruby_basic/images/seminar_24s-09.jpg +0 -0
  78. data/docs/ruby_basic/images/seminar_24s-10.jpg +0 -0
  79. data/docs/ruby_basic/images/seminar_24s-11.jpg +0 -0
  80. data/docs/ruby_basic/images/seminar_24s-12.jpg +0 -0
  81. data/docs/ruby_basic/images/seminar_24s-13.jpg +0 -0
  82. data/docs/ruby_basic/images/seminar_24s-14.jpg +0 -0
  83. data/docs/ruby_basic/images/seminar_24s-15.jpg +0 -0
  84. data/docs/ruby_basic/images/seminar_24s-18.jpg +0 -0
  85. data/docs/ruby_basic/images/seminar_24s-19.jpg +0 -0
  86. data/docs/ruby_basic/images/seminar_24s-2.jpg +0 -0
  87. data/docs/ruby_basic/images/seminar_24s-20.jpg +0 -0
  88. data/docs/ruby_basic/images/seminar_24s-21.jpg +0 -0
  89. data/docs/ruby_basic/images/seminar_24s-22.jpg +0 -0
  90. data/docs/ruby_basic/images/seminar_24s-24.jpg +0 -0
  91. data/docs/ruby_basic/images/seminar_24s-25.jpg +0 -0
  92. data/docs/ruby_basic/images/seminar_24s-27.jpg +0 -0
  93. data/docs/ruby_basic/images/seminar_24s-28.jpg +0 -0
  94. data/docs/ruby_basic/images/seminar_24s-31.jpg +0 -0
  95. data/docs/ruby_basic/images/seminar_24s-34.jpg +0 -0
  96. data/docs/ruby_basic/images/seminar_24s-35.jpg +0 -0
  97. data/docs/ruby_basic/images/seminar_24s-37.jpg +0 -0
  98. data/docs/ruby_basic/images/seminar_24s-38.jpg +0 -0
  99. data/docs/ruby_basic/simple_tdd/README.html +74 -0
  100. data/docs/ruby_basic/simple_tdd/README.org +19 -0
  101. data/exe/hyper_card +3 -0
  102. data/lib/hyper_card/version.rb +5 -0
  103. data/lib/hyper_card.rb +9 -0
  104. data/sig/hyper_card.rbs +4 -0
  105. metadata +150 -0
@@ -0,0 +1,26 @@
1
+ loading .bash_profile
2
+ "098_098"
3
+ "/usr/local/vasp/vasp.5.4.4.pl2_CentOS6_Intel-2018.5.274/bin/vasp"
4
+ * relax calc kpoints:50, in_plane:0.98, vertical:0.98
5
+ running on 8 total cores
6
+ distrk: each k-point on 8 cores, 1 groups
7
+ ...
8
+ 5 F= -.37860710E+03 E0= -.37860716E+03 d E =-.915715E+00
9
+ ...
10
+ * fix calc kpoints:50, in_plane:0.98, vertical:0.98
11
+ running on 8 total cores
12
+ ...
13
+ DAV: 3 -0.379546039319E+03 0.14390E-04 -0.91443E-05 2730 0.134E-02
14
+ 1 F= -.37954604E+03 E0= -.37954604E+03 d E =0.000000E+00
15
+ writing wavefunctions
16
+ "098_100"
17
+ "/usr/local/vasp/vasp.5.4.4.pl2_CentOS6_Intel-2018.5.274/bin/vasp"
18
+ * relax calc kpoints:50, in_plane:0.98, vertical:1.00
19
+ ...
20
+ writing wavefunctions
21
+ * fix calc kpoints:50, in_plane:0.98, vertical:1.00
22
+ running on 8 total cores
23
+ ...
24
+ 1 F= -.38143537E+03 E0= -.38143537E+03 d E =0.000000E+00
25
+ writing wavefunctions
26
+ ...
@@ -0,0 +1,62 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4
+ <html xmlns="http://www.w3.org/1999/xhtml" lang="jp" xml:lang="jp">
5
+ <head>
6
+ <!-- 2024-07-06 Sat 15:07 -->
7
+ <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
8
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
9
+ <title>vasptest_short.o01234</title>
10
+ <meta name="author" content="Shigeto R. Nishitani" />
11
+ <meta name="generator" content="Org Mode" />
12
+ <link rel="stylesheet" type="text/css" href="https://fniessen.github.io/org-html-themes/src/readtheorg_theme/css/htmlize.css"/>
13
+ <link rel="stylesheet" type="text/css" href="https://fniessen.github.io/org-html-themes/src/readtheorg_theme/css/readtheorg.css"/>
14
+ <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
15
+ <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
16
+ <script type="text/javascript" src="https://fniessen.github.io/org-html-themes/src/lib/js/jquery.stickytableheaders.min.js"></script>
17
+ <script type="text/javascript" src="https://fniessen.github.io/org-html-themes/src/readtheorg_theme/js/readtheorg.js"></script>
18
+ </head>
19
+ <body>
20
+ <div id="content" class="content">
21
+ <h1 class="title">vasptest_short.o01234</h1>
22
+ <pre class="example">
23
+ &gt; ruby check_auto_calc_state_action.rb vasptest_short.o01234
24
+ </pre>
25
+
26
+ <div class="org-src-container">
27
+ <pre class="src src-bash"><span class="linenr"> 1: </span>loading .bash_profile
28
+ <span class="linenr"> 2: </span><span style="color: #8b7355;">"098_098"</span>
29
+ <span class="linenr"> 3: </span><span style="color: #8b7355;">"/usr/local/vasp/vasp.5.4.4.pl2_CentOS6_Intel-2018.5.274/bin/vasp"</span>
30
+ <span class="linenr"> 4: </span>* relax calc kpoints:50, in_plane:0.98, vertical:0.98
31
+ <span class="linenr"> 5: </span> running on 8 total cores
32
+ <span class="linenr"> 6: </span> distrk: each k-point on 8 cores, 1 groups
33
+ <span class="linenr"> 7: </span>...
34
+ <span class="linenr"> 8: </span> 5 <span style="color: #2e8b57;">F</span>= -.37860710E+03 <span style="color: #2e8b57;">E0</span>= -.37860716E+03 d E =-.915715E+00
35
+ <span class="linenr"> 9: </span>...
36
+ <span class="linenr">10: </span>* fix calc kpoints:50, in_plane:0.98, vertical:0.98
37
+ <span class="linenr">11: </span> running on 8 total cores
38
+ <span class="linenr">12: </span>...
39
+ <span class="linenr">13: </span>DAV: 3 -0.379546039319E+03 0.14390E-04 -0.91443E-05 2730 0.134E-02
40
+ <span class="linenr">14: </span> 1 <span style="color: #2e8b57;">F</span>= -.37954604E+03 <span style="color: #2e8b57;">E0</span>= -.37954604E+03 d E =0.000000E+00
41
+ <span class="linenr">15: </span> writing wavefunctions
42
+ <span class="linenr">16: </span><span style="color: #8b7355;">"098_100"</span>
43
+ <span class="linenr">17: </span><span style="color: #8b7355;">"/usr/local/vasp/vasp.5.4.4.pl2_CentOS6_Intel-2018.5.274/bin/vasp"</span>
44
+ <span class="linenr">18: </span>* relax calc kpoints:50, in_plane:0.98, vertical:1.00
45
+ <span class="linenr">19: </span>...
46
+ <span class="linenr">20: </span> writing wavefunctions
47
+ <span class="linenr">21: </span>* fix calc kpoints:50, in_plane:0.98, vertical:1.00
48
+ <span class="linenr">22: </span> running on 8 total cores
49
+ <span class="linenr">23: </span>...
50
+ <span class="linenr">24: </span> 1 <span style="color: #2e8b57;">F</span>= -.38143537E+03 <span style="color: #2e8b57;">E0</span>= -.38143537E+03 d E =0.000000E+00
51
+ <span class="linenr">25: </span> writing wavefunctions
52
+ <span class="linenr">26: </span>...
53
+ </pre>
54
+ </div>
55
+ </div>
56
+ <div id="postamble" class="status">
57
+ <p class="author">Author: Shigeto R. Nishitani</p>
58
+ <p class="date">Created: 2024-07-06 Sat 15:07</p>
59
+ <p class="validation"><a href="https://validator.w3.org/check?uri=referer">Validate</a></p>
60
+ </div>
61
+ </body>
62
+ </html>
@@ -0,0 +1,14 @@
1
+ #+OPTIONS: ^:{}
2
+ #+STARTUP: indent nolineimages overview num
3
+ #+TITLE: vasptest_short.o01234
4
+ #+AUTHOR: Shigeto R. Nishitani
5
+ #+EMAIL: (concat "shigeto_nishitani@mac.com")
6
+ #+LANGUAGE: jp
7
+ # +OPTIONS: H:4 toc:t num:2
8
+ #+OPTIONS: toc:nil
9
+ #+TAG: hoge, hoge2
10
+ #+TWITTER: off
11
+ #+SETUPFILE: https://fniessen.github.io/org-html-themes/org/theme-readtheorg.setup
12
+
13
+ : > ruby check_auto_calc_state_action.rb vasptest_short.o01234
14
+ #+include: "./vasptest_short.o01234" src bash -n -i
@@ -0,0 +1,108 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4
+ <html xmlns="http://www.w3.org/1999/xhtml" lang="jp" xml:lang="jp">
5
+ <head>
6
+ <!-- 2024-07-04 Thu 15:06 -->
7
+ <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
8
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
9
+ <title>fsm_no_hash</title>
10
+ <meta name="author" content="Shigeto R. Nishitani" />
11
+ <meta name="generator" content="Org Mode" />
12
+ <link rel="stylesheet" type="text/css" href="https://fniessen.github.io/org-html-themes/src/readtheorg_theme/css/htmlize.css"/>
13
+ <link rel="stylesheet" type="text/css" href="https://fniessen.github.io/org-html-themes/src/readtheorg_theme/css/readtheorg.css"/>
14
+ <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
15
+ <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
16
+ <script type="text/javascript" src="https://fniessen.github.io/org-html-themes/src/lib/js/jquery.stickytableheaders.min.js"></script>
17
+ <script type="text/javascript" src="https://fniessen.github.io/org-html-themes/src/readtheorg_theme/js/readtheorg.js"></script>
18
+ </head>
19
+ <body>
20
+ <div id="content" class="content">
21
+ <h1 class="title">fsm_no_hash</h1>
22
+ <table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
23
+
24
+
25
+ <colgroup>
26
+ <col class="org-left" />
27
+ </colgroup>
28
+ <tbody>
29
+ <tr>
30
+ <td class="org-left"><img src="../images/seminar_24s-19.jpg" alt="seminar_24s-19.jpg" /></td>
31
+ </tr>
32
+ </tbody>
33
+ </table>
34
+
35
+ <div id="outline-container-org377bde4" class="outline-2">
36
+ <h2 id="org377bde4"><span class="section-number-2">1.</span> ./README_sample.org</h2>
37
+ <div class="outline-text-2" id="text-1">
38
+ <div class="org-src-container">
39
+ <pre class="src src-text">#+OPTIONS: ^:{}
40
+ #+STARTUP: indent nolineimages overview num
41
+ #+TITLE: title
42
+ #+AUTHOR: Shigeto R. Nishitani
43
+ #+EMAIL: (concat "shigeto_nishitani@mac.com")
44
+ #+LANGUAGE: jp
45
+ #+OPTIONS: H:4 toc:t num:2
46
+ #+TAG: hoge, hoge2
47
+ #+TWITTER: off
48
+ #+SETUPFILE: https://fniessen.github.io/org-html-themes/org/theme-readtheorg.setup
49
+
50
+ * input
51
+ ** head1
52
+ - list1 : 1
53
+ - list2 : 2
54
+
55
+ ** head2
56
+ - list1 : 3
57
+ - list2 : 4
58
+
59
+ * result- table
60
+ | | head1 | head2 |
61
+ |-------+-------+-------|
62
+ | list1 | 1 | 3 |
63
+ | list2 | 2 | 4 |
64
+ </pre>
65
+ </div>
66
+ </div>
67
+ </div>
68
+
69
+ <div id="outline-container-orgf896de7" class="outline-2">
70
+ <h2 id="orgf896de7"><span class="section-number-2">2.</span> fsm_no_hash.rb</h2>
71
+ <div class="outline-text-2" id="text-2">
72
+ <div class="org-src-container">
73
+ <pre class="src src-ruby"><span class="linenr">1: </span>file = <span style="color: #8b7355;">'README_sample.org'</span>
74
+ <span class="linenr">2: </span>state = <span style="color: #6e8b3d;">:head_search</span>
75
+ <span class="linenr">3: </span><span style="color: #00688b;">File</span>.readlines(file)[12..15].each <span style="color: #1c86ee;">do</span> |line|
76
+ <span class="linenr">4: </span> <span style="color: #cd6600;">p</span> [state, line]
77
+ <span class="linenr">5: </span> state = <span style="color: #6e8b3d;">:block_search</span> <span style="color: #1c86ee;">if</span> line.match(<span style="color: #8b7355;">/\*\* /</span>)
78
+ <span class="linenr">6: </span> state = <span style="color: #6e8b3d;">:head_search</span> <span style="color: #1c86ee;">if</span> line.match(<span style="color: #8b7355;">/^-/</span>)
79
+ <span class="linenr">7: </span><span style="color: #1c86ee;">end</span>
80
+ </pre>
81
+ </div>
82
+ </div>
83
+ </div>
84
+
85
+ <div id="outline-container-org00085c8" class="outline-2">
86
+ <h2 id="org00085c8"><span class="section-number-2">3.</span> results</h2>
87
+ <div class="outline-text-2" id="text-3">
88
+ <pre class="example">
89
+ &gt; ruby fsm_no_hash.rb
90
+ </pre>
91
+
92
+ <div class="org-src-container">
93
+ <pre class="src src-text">[:head_search, "** head1\n"]
94
+ [:block_search, "- list1 : 1\n"]
95
+ [:head_search, "- list2 : 2\n"]
96
+ [:head_search, "\n"]
97
+ </pre>
98
+ </div>
99
+ </div>
100
+ </div>
101
+ </div>
102
+ <div id="postamble" class="status">
103
+ <p class="author">Author: Shigeto R. Nishitani</p>
104
+ <p class="date">Created: 2024-07-04 Thu 15:06</p>
105
+ <p class="validation"><a href="https://validator.w3.org/check?uri=referer">Validate</a></p>
106
+ </div>
107
+ </body>
108
+ </html>
@@ -0,0 +1,20 @@
1
+ #+OPTIONS: ^:{}
2
+ #+STARTUP: indent nolineimages overview num
3
+ #+TITLE: fsm_no_hash
4
+ #+AUTHOR: Shigeto R. Nishitani
5
+ #+EMAIL: (concat "shigeto_nishitani@mac.com")
6
+ #+LANGUAGE: jp
7
+ #+OPTIONS: toc:nil
8
+ #+SETUPFILE: https://fniessen.github.io/org-html-themes/org/theme-readtheorg.setup
9
+
10
+ | [[file:../images/seminar_24s-19.jpg]] |
11
+
12
+ * ./README_sample.org
13
+ #+include: "./README_sample.org" src text
14
+
15
+ * fsm_no_hash.rb
16
+ #+include: "./fsm_no_hash.rb" src ruby -n -i
17
+
18
+ * results
19
+ : > ruby fsm_no_hash.rb
20
+ #+include: "./fsm_no_hash_results.txt" src text
@@ -0,0 +1,8 @@
1
+
2
+ file = 'README_sample.org'
3
+ state = :head_search
4
+ File.readlines(file)[12..15].each do |line|
5
+ p [state, line]
6
+ state = :block_search if line.match(/\*\* /)
7
+ state = :head_search if line.match(/^-/)
8
+ end
@@ -0,0 +1,4 @@
1
+ [:head_search, "** head1\n"]
2
+ [:block_search, "- list1 : 1\n"]
3
+ [:head_search, "- list2 : 2\n"]
4
+ [:head_search, "\n"]
@@ -0,0 +1,12 @@
1
+ require 'scanf'
2
+ TRANSITIONS = {
3
+ :head_search => [:block_search, "**"],
4
+ :block_search => [:head_search, "- "]
5
+ }
6
+ state, key = TRANSITIONS[:head_search]
7
+ file = 'README.org'
8
+ File.readlines(file)[12..15].each do |line|
9
+ p [state, key, line]
10
+ p result = line[0..1] == key
11
+ state, key = TRANSITIONS[state] if result != []
12
+ end
@@ -0,0 +1,50 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4
+ <html xmlns="http://www.w3.org/1999/xhtml" lang="jp" xml:lang="jp">
5
+ <head>
6
+ <!-- 2024-07-06 Sat 12:23 -->
7
+ <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
8
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
9
+ <title>fsm_state_action</title>
10
+ <meta name="author" content="Shigeto R. Nishitani" />
11
+ <meta name="generator" content="Org Mode" />
12
+ <link rel="stylesheet" type="text/css" href="https://fniessen.github.io/org-html-themes/src/readtheorg_theme/css/htmlize.css"/>
13
+ <link rel="stylesheet" type="text/css" href="https://fniessen.github.io/org-html-themes/src/readtheorg_theme/css/readtheorg.css"/>
14
+ <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
15
+ <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
16
+ <script type="text/javascript" src="https://fniessen.github.io/org-html-themes/src/lib/js/jquery.stickytableheaders.min.js"></script>
17
+ <script type="text/javascript" src="https://fniessen.github.io/org-html-themes/src/readtheorg_theme/js/readtheorg.js"></script>
18
+ </head>
19
+ <body>
20
+ <div id="content" class="content">
21
+ <h1 class="title">fsm_state_action</h1>
22
+ <table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
23
+
24
+
25
+ <colgroup>
26
+ <col class="org-left" />
27
+
28
+ <col class="org-left" />
29
+ </colgroup>
30
+ <tbody>
31
+ <tr>
32
+ <td class="org-left">images/seminar_24s-35.jpg</td>
33
+ <td class="org-left"><img src="../images/seminar_24s-35.jpg" alt="seminar_24s-35.jpg" /></td>
34
+ </tr>
35
+ </tbody>
36
+ </table>
37
+
38
+ <ul class="org-ul">
39
+ <li><a href="./fsm_state_action_rb.html">fsm_state_action.rb</a></li>
40
+ <li><a href="README_sample_org.html">README_sample.org</a></li>
41
+ <li><a href="fsm_state_action_results.html">fsm_state_action.results</a></li>
42
+ </ul>
43
+ </div>
44
+ <div id="postamble" class="status">
45
+ <p class="author">Author: Shigeto R. Nishitani</p>
46
+ <p class="date">Created: 2024-07-06 Sat 12:23</p>
47
+ <p class="validation"><a href="https://validator.w3.org/check?uri=referer">Validate</a></p>
48
+ </div>
49
+ </body>
50
+ </html>
@@ -0,0 +1,16 @@
1
+ #+OPTIONS: ^:{}
2
+ #+STARTUP: indent nolineimages overview num
3
+ #+TITLE: fsm_state_action
4
+ #+AUTHOR: Shigeto R. Nishitani
5
+ #+EMAIL: (concat "shigeto_nishitani@mac.com")
6
+ #+LANGUAGE: jp
7
+ #+OPTIONS: toc:nil
8
+ #+SETUPFILE: https://fniessen.github.io/org-html-themes/org/theme-readtheorg.setup
9
+
10
+ | images/seminar_24s-35.jpg | [[file:../images/seminar_24s-35.jpg]] |
11
+
12
+ - [[file:./fsm_state_action_rb.org][fsm_state_action.rb]]
13
+ - [[file:README_sample_org.org][README_sample.org]]
14
+ - [[file:fsm_state_action_results.org][fsm_state_action.results]]
15
+
16
+
@@ -0,0 +1,34 @@
1
+ require 'scanf'
2
+ require 'pp'
3
+
4
+ # Current_state
5
+ # key => Trans_state, action
6
+ TRANSITIONS = {
7
+ head_search: {
8
+ '**' => [:val_search, :head],
9
+ :default => [:head_search, :idle]
10
+ },
11
+ val_search: {
12
+ '- ' => [:val_search, :get_val],
13
+ :default => [:head_search, :idle]
14
+ }
15
+ }
16
+
17
+ state = :head_search
18
+ file = 'README_sample.org'
19
+ all_data = []
20
+ File.readlines(file).each_with_index do |line,i|
21
+ state, action = TRANSITIONS[state][line[0..1]] ||
22
+ TRANSITIONS[state][:default]
23
+ case action
24
+ when :head
25
+ p head = line.scanf("** %s")[0] # "** head1\n"
26
+ all_data << [head]
27
+ when :get_val
28
+ p tmp = line.scanf("- %s: %d")
29
+ all_data[-1] << tmp
30
+ when :idle
31
+ end
32
+ end
33
+
34
+ pp all_data
@@ -0,0 +1,14 @@
1
+ "head1"
2
+ ["list1", 1]
3
+ ["list2", 2]
4
+ "head2"
5
+ ["list1", 3]
6
+ ["list2", 4]
7
+
8
+ [["head1",
9
+ ["list1", 1], ["list2", 2]
10
+ ],
11
+ ["head2",
12
+ ["list1", 3], ["list2", 4]
13
+ ]
14
+ ]
@@ -0,0 +1,64 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4
+ <html xmlns="http://www.w3.org/1999/xhtml" lang="jp" xml:lang="jp">
5
+ <head>
6
+ <!-- 2024-07-04 Thu 15:13 -->
7
+ <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
8
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
9
+ <title>fsm state action rb</title>
10
+ <meta name="author" content="Shigeto R. Nishitani" />
11
+ <meta name="generator" content="Org Mode" />
12
+ <link rel="stylesheet" type="text/css" href="https://fniessen.github.io/org-html-themes/src/readtheorg_theme/css/htmlize.css"/>
13
+ <link rel="stylesheet" type="text/css" href="https://fniessen.github.io/org-html-themes/src/readtheorg_theme/css/readtheorg.css"/>
14
+ <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
15
+ <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
16
+ <script type="text/javascript" src="https://fniessen.github.io/org-html-themes/src/lib/js/jquery.stickytableheaders.min.js"></script>
17
+ <script type="text/javascript" src="https://fniessen.github.io/org-html-themes/src/readtheorg_theme/js/readtheorg.js"></script>
18
+ </head>
19
+ <body>
20
+ <div id="content" class="content">
21
+ <h1 class="title">fsm state action rb</h1>
22
+ <div class="org-src-container">
23
+ <pre class="src src-ruby"><span style="color: #cd6600;">require</span> <span style="color: #8b7355;">'scanf'</span>
24
+ <span style="color: #7f7f7f;"># </span><span style="color: #7f7f7f;">Current_state</span>
25
+ <span style="color: #7f7f7f;"># </span><span style="color: #7f7f7f;">key =&gt; Trans_state, action</span>
26
+ <span style="color: #00688b;">TRANSITIONS</span> = {
27
+ <span style="color: #6e8b3d;">head_search:</span> {
28
+ <span style="color: #8b7355;">'**'</span> =&gt; [<span style="color: #6e8b3d;">:val_search</span>, <span style="color: #6e8b3d;">:head</span>],
29
+ <span style="color: #6e8b3d;">:default</span> =&gt; [<span style="color: #6e8b3d;">:head_search</span>, <span style="color: #6e8b3d;">:idle</span>]
30
+ },
31
+ <span style="color: #6e8b3d;">val_search:</span> {
32
+ <span style="color: #8b7355;">'- '</span> =&gt; [<span style="color: #6e8b3d;">:val_search</span>, <span style="color: #6e8b3d;">:get_val</span>],
33
+ <span style="color: #6e8b3d;">:default</span> =&gt; [<span style="color: #6e8b3d;">:head_search</span>, <span style="color: #6e8b3d;">:idle</span>]
34
+ }
35
+ }
36
+
37
+ state = <span style="color: #6e8b3d;">:head_search</span>
38
+ file = <span style="color: #8b7355;">'README.org'</span>
39
+ all_data = []
40
+ <span style="color: #00688b;">File</span>.readlines(file).each_with_index <span style="color: #1c86ee;">do</span> |line,i|
41
+ state, action = <span style="color: #00688b;">TRANSITIONS</span>[state][line[0..1]] ||
42
+ <span style="color: #00688b;">TRANSITIONS</span>[state][<span style="color: #6e8b3d;">:default</span>]
43
+ <span style="color: #1c86ee;">case</span> action
44
+ <span style="color: #1c86ee;">when</span> <span style="color: #6e8b3d;">:head</span>
45
+ <span style="color: #cd6600;">p</span> head = line.scanf(<span style="color: #8b7355;">"** %s"</span>)[0] <span style="color: #7f7f7f;"># </span><span style="color: #7f7f7f;">"** head1\n"</span>
46
+ all_data &lt;&lt; [head]
47
+ <span style="color: #1c86ee;">when</span> <span style="color: #6e8b3d;">:get_val</span>
48
+ <span style="color: #cd6600;">p</span> tmp = line.scanf(<span style="color: #8b7355;">"- %s: %d"</span>)
49
+ all_data[-1] &lt;&lt; tmp
50
+ <span style="color: #1c86ee;">when</span> <span style="color: #6e8b3d;">:idle</span>
51
+ <span style="color: #1c86ee;">end</span>
52
+ <span style="color: #1c86ee;">end</span>
53
+
54
+ pp all_data
55
+ </pre>
56
+ </div>
57
+ </div>
58
+ <div id="postamble" class="status">
59
+ <p class="author">Author: Shigeto R. Nishitani</p>
60
+ <p class="date">Created: 2024-07-04 Thu 15:13</p>
61
+ <p class="validation"><a href="https://validator.w3.org/check?uri=referer">Validate</a></p>
62
+ </div>
63
+ </body>
64
+ </html>
@@ -0,0 +1,13 @@
1
+ #+OPTIONS: ^:{}
2
+ #+STARTUP: indent nolineimages overview num
3
+ #+TITLE: fsm state action rb
4
+ #+AUTHOR: Shigeto R. Nishitani
5
+ #+EMAIL: (concat "shigeto_nishitani@mac.com")
6
+ #+LANGUAGE: jp
7
+ # +OPTIONS: H:4 toc:t num:2
8
+ #+OPTIONS: toc:nil
9
+ #+TAG: hoge, hoge2
10
+ #+TWITTER: off
11
+ #+SETUPFILE: https://fniessen.github.io/org-html-themes/org/theme-readtheorg.setup
12
+
13
+ #+include: "./fsm_state_action.rb" src ruby
@@ -0,0 +1,46 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4
+ <html xmlns="http://www.w3.org/1999/xhtml" lang="jp" xml:lang="jp">
5
+ <head>
6
+ <!-- 2024-07-04 Thu 16:38 -->
7
+ <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
8
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
9
+ <title>fsm_state_action_results.org</title>
10
+ <meta name="author" content="Shigeto R. Nishitani" />
11
+ <meta name="generator" content="Org Mode" />
12
+ <link rel="stylesheet" type="text/css" href="https://fniessen.github.io/org-html-themes/src/readtheorg_theme/css/htmlize.css"/>
13
+ <link rel="stylesheet" type="text/css" href="https://fniessen.github.io/org-html-themes/src/readtheorg_theme/css/readtheorg.css"/>
14
+ <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
15
+ <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
16
+ <script type="text/javascript" src="https://fniessen.github.io/org-html-themes/src/lib/js/jquery.stickytableheaders.min.js"></script>
17
+ <script type="text/javascript" src="https://fniessen.github.io/org-html-themes/src/readtheorg_theme/js/readtheorg.js"></script>
18
+ </head>
19
+ <body>
20
+ <div id="content" class="content">
21
+ <h1 class="title">fsm_state_action_results.org</h1>
22
+ <div class="org-src-container">
23
+ <pre class="src src-ruby"><span style="color: #8b7355;">"head1"</span>
24
+ [<span style="color: #8b7355;">"list1"</span>, 1]
25
+ [<span style="color: #8b7355;">"list2"</span>, 2]
26
+ <span style="color: #8b7355;">"head2"</span>
27
+ [<span style="color: #8b7355;">"list1"</span>, 3]
28
+ [<span style="color: #8b7355;">"list2"</span>, 4]
29
+
30
+ [[<span style="color: #8b7355;">"head1"</span>,
31
+ [<span style="color: #8b7355;">"list1"</span>, 1], [<span style="color: #8b7355;">"list2"</span>, 2]
32
+ ],
33
+ [<span style="color: #8b7355;">"head2"</span>,
34
+ [<span style="color: #8b7355;">"list1"</span>, 3], [<span style="color: #8b7355;">"list2"</span>, 4]
35
+ ]
36
+ ]
37
+ </pre>
38
+ </div>
39
+ </div>
40
+ <div id="postamble" class="status">
41
+ <p class="author">Author: Shigeto R. Nishitani</p>
42
+ <p class="date">Created: 2024-07-04 Thu 16:38</p>
43
+ <p class="validation"><a href="https://validator.w3.org/check?uri=referer">Validate</a></p>
44
+ </div>
45
+ </body>
46
+ </html>
@@ -0,0 +1,13 @@
1
+ #+OPTIONS: ^:{}
2
+ #+STARTUP: indent nolineimages overview num
3
+ #+TITLE: fsm_state_action_results.org
4
+ #+AUTHOR: Shigeto R. Nishitani
5
+ #+EMAIL: (concat "shigeto_nishitani@mac.com")
6
+ #+LANGUAGE: jp
7
+ # +OPTIONS: H:4 toc:t num:2
8
+ #+OPTIONS: toc:nil
9
+ #+TAG: hoge, hoge2
10
+ #+TWITTER: off
11
+ #+SETUPFILE: https://fniessen.github.io/org-html-themes/org/theme-readtheorg.setup
12
+
13
+ #+include: "fsm_state_action.results" src ruby
@@ -0,0 +1,22 @@
1
+ # Current_state => Trans_state, Key
2
+ TRANSITIONS = {
3
+ :head_search => [:val_search, "**"],
4
+ :val_search => [:head_search, "- "]
5
+ }
6
+ state,key = TRANSITIONS[:head_search]
7
+ file = 'README.org'
8
+ temp, contents = [], []
9
+ File.readlines(file)[10..20].each_with_index do |line,i|
10
+ p [i, 'before', state, key, line]
11
+ state, key = TRANSITIONS[state] if line[0..1] == key
12
+ p [i, 'after ', state, key, line]
13
+ case state
14
+ when :head_search
15
+ contents << temp
16
+ p temp = line.scan(/\*\* (\w+)/)[0] #"** head1\n"
17
+ when :val_search
18
+ temp << line
19
+ end
20
+ end
21
+
22
+ pp contents
@@ -0,0 +1 @@
1
+ /Users/bob/git_hub/ruby_docs/chart_style_ruby/finite_state_machine