ufos 1.0.88 → 1.0.94

Sign up to get free protection for your applications and to get access to all the features.
Files changed (138) hide show
  1. checksums.yaml +4 -4
  2. data/README +2 -0
  3. data/README.md +99 -65
  4. data/VERSION_NUMBER +1 -1
  5. data/bin/autocorrect +312 -0
  6. data/bin/black +0 -0
  7. data/bin/black_bold +0 -0
  8. data/bin/black_bold_underline +0 -0
  9. data/bin/black_underline +0 -0
  10. data/bin/blue +0 -0
  11. data/bin/blue_bold +0 -0
  12. data/bin/blue_bold_underline +0 -0
  13. data/bin/blue_underline +0 -0
  14. data/bin/bold +0 -0
  15. data/bin/ctit +44 -0
  16. data/bin/cyan +0 -0
  17. data/bin/cyan_bold +0 -0
  18. data/bin/cyan_bold_underline +0 -0
  19. data/bin/cyan_underline +0 -0
  20. data/bin/green +0 -0
  21. data/bin/green_bold +0 -0
  22. data/bin/green_bold_underline +0 -0
  23. data/bin/green_underline +0 -0
  24. data/bin/magenta +0 -0
  25. data/bin/magenta_bold +0 -0
  26. data/bin/magenta_bold_underline +0 -0
  27. data/bin/magenta_underline +0 -0
  28. data/bin/red +0 -0
  29. data/bin/red_bold +0 -0
  30. data/bin/red_bold_underline +0 -0
  31. data/bin/red_underline +0 -0
  32. data/bin/underline +0 -0
  33. data/bin/white +0 -0
  34. data/bin/white_bold +0 -0
  35. data/bin/white_bold_underline +0 -0
  36. data/bin/white_underline +0 -0
  37. data/bin/yellow +0 -0
  38. data/bin/yellow_bold +0 -0
  39. data/bin/yellow_bold_underline +0 -0
  40. data/bin/yellow_underline +0 -0
  41. data/documentation/autocorrect +3 -0
  42. data/documentation/ctit +18 -0
  43. data/documentation/email +2 -2
  44. data/documentation/left_right.exe +4 -3
  45. data/documentation/page +8 -1
  46. data/gem_data/README +2 -0
  47. data/gem_data/VERSION_NUMBER +1 -1
  48. data/gem_data/push_snap +30 -0
  49. data/images/STORE.png +0 -0
  50. data/images/STORE2.png +0 -0
  51. data/images/Store.png +0 -0
  52. data/index.html +108 -94
  53. data/non_compiled_programs/autocorrect +312 -0
  54. data/non_compiled_programs/ctit +44 -0
  55. data/other/beautify_html_in_heredocs +8 -0
  56. data/{cleanup → other/cleanup} +1 -0
  57. data/other/communicate +88 -0
  58. data/other/experimental_code/ABOUT_S +1 -10
  59. data/other/experimental_code/a/six +0 -0
  60. data/other/experimental_code/odi +4 -10
  61. data/other/experimental_code/orig +11 -20
  62. data/other/experimental_code/pr.rb +1 -1
  63. data/push_snap +30 -0
  64. data/src/color_tools/black +0 -0
  65. data/src/color_tools/black.c +9 -12
  66. data/src/color_tools/black_bold +0 -0
  67. data/src/color_tools/black_bold.c +9 -12
  68. data/src/color_tools/black_bold_underline +0 -0
  69. data/src/color_tools/black_bold_underline.c +9 -12
  70. data/src/color_tools/black_underline +0 -0
  71. data/src/color_tools/black_underline.c +9 -12
  72. data/src/color_tools/blue +0 -0
  73. data/src/color_tools/blue.c +9 -12
  74. data/src/color_tools/blue_bold +0 -0
  75. data/src/color_tools/blue_bold.c +9 -12
  76. data/src/color_tools/blue_bold_underline +0 -0
  77. data/src/color_tools/blue_bold_underline.c +9 -12
  78. data/src/color_tools/blue_underline +0 -0
  79. data/src/color_tools/blue_underline.c +9 -12
  80. data/src/color_tools/bold +0 -0
  81. data/src/color_tools/bold.c +9 -12
  82. data/src/color_tools/colors.rb +9 -12
  83. data/src/color_tools/cyan +0 -0
  84. data/src/color_tools/cyan.c +9 -12
  85. data/src/color_tools/cyan_bold +0 -0
  86. data/src/color_tools/cyan_bold.c +9 -12
  87. data/src/color_tools/cyan_bold_underline +0 -0
  88. data/src/color_tools/cyan_bold_underline.c +9 -12
  89. data/src/color_tools/cyan_underline +0 -0
  90. data/src/color_tools/cyan_underline.c +9 -12
  91. data/src/color_tools/green +0 -0
  92. data/src/color_tools/green.c +9 -12
  93. data/src/color_tools/green_bold +0 -0
  94. data/src/color_tools/green_bold.c +9 -12
  95. data/src/color_tools/green_bold_underline +0 -0
  96. data/src/color_tools/green_bold_underline.c +9 -12
  97. data/src/color_tools/green_underline +0 -0
  98. data/src/color_tools/green_underline.c +9 -12
  99. data/src/color_tools/magenta +0 -0
  100. data/src/color_tools/magenta.c +9 -12
  101. data/src/color_tools/magenta_bold +0 -0
  102. data/src/color_tools/magenta_bold.c +9 -12
  103. data/src/color_tools/magenta_bold_underline +0 -0
  104. data/src/color_tools/magenta_bold_underline.c +9 -12
  105. data/src/color_tools/magenta_underline +0 -0
  106. data/src/color_tools/magenta_underline.c +9 -12
  107. data/src/color_tools/red +0 -0
  108. data/src/color_tools/red.c +9 -12
  109. data/src/color_tools/red_bold +0 -0
  110. data/src/color_tools/red_bold.c +9 -12
  111. data/src/color_tools/red_bold_underline +0 -0
  112. data/src/color_tools/red_bold_underline.c +9 -12
  113. data/src/color_tools/red_underline +0 -0
  114. data/src/color_tools/red_underline.c +9 -12
  115. data/src/color_tools/underline +0 -0
  116. data/src/color_tools/underline.c +9 -12
  117. data/src/color_tools/white +0 -0
  118. data/src/color_tools/white.c +9 -12
  119. data/src/color_tools/white_bold +0 -0
  120. data/src/color_tools/white_bold.c +9 -12
  121. data/src/color_tools/white_bold_underline +0 -0
  122. data/src/color_tools/white_bold_underline.c +9 -12
  123. data/src/color_tools/white_underline +0 -0
  124. data/src/color_tools/white_underline.c +9 -12
  125. data/src/color_tools/yellow +0 -0
  126. data/src/color_tools/yellow.c +9 -12
  127. data/src/color_tools/yellow_bold +0 -0
  128. data/src/color_tools/yellow_bold.c +9 -12
  129. data/src/color_tools/yellow_bold_underline +0 -0
  130. data/src/color_tools/yellow_bold_underline.c +9 -12
  131. data/src/color_tools/yellow_underline +0 -0
  132. data/src/color_tools/yellow_underline.c +9 -12
  133. metadata +19 -8
  134. data/other/experimental_code/a/a.out +0 -0
  135. data/other/experimental_code/a/hello_world +0 -0
  136. data/other/experimental_code/c_program_faster +0 -0
  137. /data/other/experimental_code/{Resume.pdf → description_of_what_ive_done_old.pdf} +0 -0
  138. /data/other/experimental_code/{merge → merge.rb} +0 -0
data/bin/autocorrect ADDED
@@ -0,0 +1,312 @@
1
+ #!/usr/bin/ruby
2
+
3
+ # frozen_string_literal: false
4
+ SPECIAL = {"cmd" => "command", "unix" => "UNIX"}
5
+
6
+ print "\rAUTOCORRECT\r\n"
7
+ require 'set'
8
+ $ln = Set.new File.read("/usr/share/dict/words").split
9
+ exc = %w[coo verb cad Mar Mao ma Mai Mae wag wan T's Th wad cab mad strep pi goo fob foe yo yon fog fop war i ] # '
10
+
11
+ exc.each do |i|
12
+ raise "No #{i}" unless $ln.include?(i)
13
+ end
14
+
15
+ $ln -= exc
16
+
17
+ LINES = "\n" << $ln.sort.reverse.join("\n") << "\n"
18
+
19
+ AMOUNT = 1
20
+ PUNCT = (("!".."@")).map do |i|
21
+ i.chr
22
+ end.reject do |i|
23
+ ("0".."9").include? i
24
+ end
25
+
26
+ #puts PUNCT.to_a.to_s
27
+
28
+ def get_word_(word)
29
+ return word if $ln.include? word
30
+ return word if $ln.include? word.downcase
31
+ return word.capitalize if $ln.include? word.capitalize
32
+
33
+ special = SPECIAL[word]
34
+ if special; return special; end
35
+
36
+ c = word.chars
37
+
38
+ i = c.size
39
+
40
+ def get(c, i)
41
+ return "" if c.size.zero?
42
+ while i != 0
43
+ c.permutation(i).each do |q|
44
+ # if q == first_len
45
+ # i-=1
46
+ # next
47
+ # end
48
+ q = q.join
49
+ len = LINES.scan(reg = /\n#{q}[^\n]*/i).map do |i|
50
+ i[1..-1]
51
+ end.sort do |a, b|
52
+ if a[0].downcase? == b[0].downcase?
53
+ a <=> b
54
+ else
55
+ b <=> a
56
+ end
57
+ end
58
+ # puts (len.reject do |i| i.size != 3; end.to_a.to_s)
59
+
60
+ # warn "\n#{q}[^\n]".inspect[1..-2].prepend('/').concat('/')
61
+ # warn format('permutation of %s chars of %s len of %s', i, q, len.inspect)
62
+ # return len
63
+ next if len.empty?
64
+
65
+ char_size = c.size
66
+ # puts char_size, len[0].size, len.to_s
67
+ # sleep
68
+ # puts len.inspect
69
+
70
+ len.each do |i|
71
+ cur_siz = i.size
72
+ # puts [i, c].to_s
73
+ next if cur_siz < char_size
74
+ next if cur_siz > char_size + AMOUNT
75
+
76
+ funcs = []
77
+ q.chars.each do |i|
78
+ funcs << if ("A".."Z").cover? i
79
+ :upcase
80
+ else
81
+ :downcase
82
+ end
83
+ end
84
+
85
+ funcs.size.times do |q|
86
+ i[q] = i[q].send funcs[q]
87
+ end
88
+ return i
89
+ end
90
+ end
91
+
92
+ i -= 1
93
+ end
94
+
95
+ "ERROR text is #{c.join.inspect}"
96
+ end
97
+
98
+ if i > 4
99
+ max = 0
100
+ l = $ln
101
+ maxes = {}
102
+
103
+ j = c.join
104
+
105
+ # puts 55
106
+
107
+ (c.size - c.size).times do |n|
108
+ n += 1
109
+ cont = 0
110
+ while cont < c.size
111
+ first = j[0..cont - 1]
112
+ second = j[cont..cont + n - 1].upcase.clear
113
+ third = j[n + cont..-1]
114
+ unless third
115
+ cont += 1
116
+ next
117
+ end
118
+ first = "" if cont.zero?
119
+
120
+ puts first + second + third
121
+ cont += 1
122
+ end
123
+
124
+ puts "DONE"
125
+ end
126
+ # puts 'DO'
127
+
128
+ l.each_with_index do |a, _index|
129
+ count = 0
130
+ orig_a = a.dup
131
+ a = a.dup
132
+
133
+ c.each do |char|
134
+ if a.include? char
135
+ count += 1
136
+ a.sub! char, ""
137
+ end
138
+ end
139
+
140
+ next unless count >= max && count != 0
141
+
142
+ # puts [count, max].to_s
143
+ maxes[orig_a] = count
144
+ max = count
145
+ end
146
+
147
+ maxes.select! do |_k, v|
148
+ v == max
149
+ end
150
+
151
+ l.each do |i_|
152
+ next if i_.size < c.size
153
+
154
+ maxes[i_] = max if i_[0..3] == c.join[0..3]
155
+ end
156
+ #puts l.size
157
+ def foo(a, b, c)
158
+ p = 0
159
+ while p < c.size && p < a.size
160
+ break if c[p] != a[p]
161
+
162
+ p += 1
163
+ end
164
+ p2 = 0
165
+ while p2 < c.size && p2 < b.size
166
+ break if c[p2] != b[p2]
167
+
168
+ p2 += 1
169
+ end
170
+
171
+ [p, p2]
172
+ end
173
+
174
+ val = maxes.keys.sort do |a, b|
175
+ p, p2 = foo(a, b, c)
176
+
177
+ if p2 - p >= 1
178
+ 1
179
+ elsif p2 == p2
180
+ 0
181
+ elsif p2 - p <= 1
182
+ -1
183
+ end
184
+ end[0..20].sort_by(&:size)[0..10].sort do |a, b|
185
+ p, p2 = foo(a, b, c)
186
+
187
+ if p2 - p >= 1
188
+ 1
189
+ elsif p2 == p2
190
+ 0
191
+ elsif p2 - p <= 1
192
+ -1
193
+ end
194
+ end[0]
195
+
196
+ raise unless val.class == String
197
+
198
+ return val
199
+ else
200
+ get(c, i)
201
+ end
202
+ end
203
+
204
+ require "io/console"
205
+
206
+ class String
207
+ def end?
208
+ self == "\r" || self == "\n" || self == "\t"
209
+ end
210
+
211
+ def downcase?
212
+ !!match(/[a-z]/)
213
+ end
214
+ end
215
+
216
+ class DoneException < Exception
217
+ end
218
+
219
+ def _get
220
+ a = nil
221
+ $c = ""
222
+ while a != " "
223
+ a = $stdin.getc
224
+ #print a.inspect
225
+ raise DoneException.new if a == "\x03"
226
+ if a == "\u007F"
227
+ $all_text = $all_text[0..-2]
228
+ $c = $c[0..-2]
229
+ print "\e[1D \e[1D"
230
+ next
231
+ end
232
+ $c << a
233
+ $all_text << a
234
+ putc(a) unless a.end?
235
+ return nil if a.end?
236
+ end
237
+
238
+ $c.chomp! " "
239
+ # $c.gsub!(/\e\[[A-Z]/, "")
240
+
241
+ # print c.inspect
242
+
243
+ File.open("words", "a") do |f|
244
+ f.puts c.inspect
245
+ end if false
246
+ c = $c
247
+
248
+ $c = ""
249
+ c
250
+ end
251
+
252
+ str = ""
253
+ $all_text = ""
254
+
255
+ $stdin.tty? && $stdin.raw do
256
+ last_char = "."
257
+ loop do
258
+ qi = _get
259
+ i=qi&.gsub(/\e\[[A-Z]/, "")
260
+
261
+
262
+ if i.nil?
263
+ print "\r\n"
264
+ next
265
+ end
266
+ if i.empty?
267
+ # print ' '
268
+ next
269
+ end
270
+
271
+ # raise if / |\e/.match?(i)
272
+
273
+ new_word = get_word_(i.sub(/[[:punct:]]+/, "")) + i.match(/[[:punct:]]+$/ ).to_s; if PUNCT.include?(last_char); new_word[0]=new_word[0].upcase; end
274
+ puts new_word.inspect if false
275
+
276
+ amount = i.size + 1
277
+ f = File.open("words", "a") if false
278
+
279
+ # if amount == 0
280
+ #
281
+ # text = ""/
282
+ #else
283
+ if new_word == i
284
+ else
285
+ print "\e[#{amount}D" << new_word << " "
286
+ end
287
+
288
+ $all_text = $all_text[0..-(1 + i.size + " ".size)]
289
+ $all_text << new_word << " "
290
+ last_char = new_word[-1]
291
+ # end
292
+
293
+ # puts new_word.inspect
294
+
295
+ #print "\u001b[0K"
296
+
297
+ #{new_word} "
298
+ end
299
+ rescue DoneException
300
+ end #rescue DoneException
301
+
302
+
303
+ #$all_text << $c
304
+ #system 'tput reset'
305
+ at=nil
306
+
307
+ #puts "\n\nYour story\n\n"
308
+ IO.popen("xclip -selection c", 'w') do |i|
309
+ i.print at=$all_text.strip
310
+ end
311
+ puts "YOUR STORY COPIED"
312
+ print at
data/bin/black CHANGED
Binary file
data/bin/black_bold CHANGED
Binary file
Binary file
data/bin/black_underline CHANGED
Binary file
data/bin/blue CHANGED
Binary file
data/bin/blue_bold CHANGED
Binary file
Binary file
data/bin/blue_underline CHANGED
Binary file
data/bin/bold CHANGED
Binary file
data/bin/ctit ADDED
@@ -0,0 +1,44 @@
1
+ #!/usr/bin/ruby
2
+ # This is a work in progress.
3
+
4
+ ROMAN = /^([limcdvx]|[[:punct:]])+$/i
5
+
6
+ def capitalize(a)
7
+ a = a.gsub(/\s*(-|–|—|:)(-|–|—|:)*\s*/, "\\1 ")
8
+ w = a.split
9
+ not_major = /^(?:to|a|an|the|on|in|of|at|and|or|but|nor|for|yet|so)$/i
10
+ w = w.map do |i|
11
+ case i
12
+ when ROMAN
13
+ i.upcase
14
+ when /^(?:not|no|be|is|are|was|were|have|has|had|do|does|did|that|it|my|me|we|our|you|he|his|she|her|they|them|who)$/i
15
+ i.capitalize
16
+ when /(-|–|—|:)/
17
+ i.capitalize
18
+ when not_major
19
+ i.downcase
20
+ else
21
+ i.capitalize
22
+ end
23
+ end
24
+ w = w.to_a
25
+ if w.size == 0
26
+ w = [" "]
27
+ end
28
+ if w[0].match(ROMAN)
29
+ w[0] = w[0].upcase
30
+ else
31
+ w[0] = w[0].capitalize
32
+ end
33
+ if (w[-1].match(ROMAN))
34
+ w[-1] = w[-1].upcase
35
+ else
36
+ w[-1] = w[-1].capitalize
37
+ end
38
+ w = w.join(" ")
39
+ w = w.gsub "- ", "-"
40
+ w
41
+ end
42
+
43
+
44
+ print (capitalize ARGV.join(" "))
data/bin/cyan CHANGED
Binary file
data/bin/cyan_bold CHANGED
Binary file
Binary file
data/bin/cyan_underline CHANGED
Binary file
data/bin/green CHANGED
Binary file
data/bin/green_bold CHANGED
Binary file
Binary file
data/bin/green_underline CHANGED
Binary file
data/bin/magenta CHANGED
Binary file
data/bin/magenta_bold CHANGED
Binary file
Binary file
Binary file
data/bin/red CHANGED
Binary file
data/bin/red_bold CHANGED
Binary file
Binary file
data/bin/red_underline CHANGED
Binary file
data/bin/underline CHANGED
Binary file
data/bin/white CHANGED
Binary file
data/bin/white_bold CHANGED
Binary file
Binary file
data/bin/white_underline CHANGED
Binary file
data/bin/yellow CHANGED
Binary file
data/bin/yellow_bold CHANGED
Binary file
Binary file
data/bin/yellow_underline CHANGED
Binary file
@@ -0,0 +1,3 @@
1
+ Command line offline non-AI free software BSD licensed autocorrect using words file.
2
+
3
+ Work in progress.
@@ -0,0 +1,18 @@
1
+
2
+
3
+ Capitalize Title
4
+
5
+ A work in progress.
6
+
7
+ Capitalizes arguments and treats them like a title.
8
+
9
+ ctit this is my heading
10
+ ==> This Is My Heading for a Document
11
+
12
+ You can also do
13
+
14
+
15
+ ctit .... | copy
16
+
17
+ To copy the title to your clipboard
18
+
data/documentation/email CHANGED
@@ -10,11 +10,11 @@ Modes
10
10
 
11
11
  email [no arguments]
12
12
 
13
- Email [yourself]
13
+ email [yourself]
14
14
 
15
15
  email [addr]
16
16
 
17
- Email one email address
17
+ email one email address
18
18
 
19
19
  email [Subject] [addr] [option more addrs]
20
20
 
@@ -2,8 +2,9 @@ This is a tool to bring sanity to politics.
2
2
 
3
3
  ![UCA](./images/8.png)
4
4
 
5
- It gets viewpoints from the person that see the good in each political side, left, right, left, right, etc.
5
+ It asks for viewpints from a person that see the good things in each political side--left, right, left, right, etc.
6
6
 
7
- It then presents all of that.
7
+ It then makes a webpage of that and presents all of that.
8
+
9
+ Hopefully this can make people more sane, and less hyper-partisan.
8
10
 
9
- Hopefully this can make people more sane and less hyper-partisan.
data/documentation/page CHANGED
@@ -276,6 +276,12 @@ def main
276
276
  <h2>All of these programs are mostly self-contained. This is a really good thing. You can use them anywhere without dependencies.</h2>
277
277
  <p>My email is <a href=mailto:#{EMAIL}>#{EMAIL}</a> and I really would like to make free and open source software. Everything I have is BSD licensed (free for commerical and non-commerical use).</p>
278
278
  <p>HOW TO DOWNLOAD/INSTALL</p>
279
+ <p><iframe src="https://snapcraft.io/democracy/embedded?button=black" frameborder="0" width="100%" height="300px" style="border: 1px solid #CCC; border-radius: 2px;"></iframe></p>
280
+
281
+ <p>With snap (<a href=https://snapcraft.io/democracy>https://snapcraft.io/democracy</a>)</p>
282
+ <p>sudo snap install democracy or snap install democracy</p>
283
+ <p>Binaries then would be in /snap/democracy/current/bin, source code is in /snap/democracy</p>
284
+ <p>With gem command (RubyGems) (preinstalled on Mac)</p>
279
285
  <p>gem unpack democracy</p>
280
286
  <p>gem install democracy</p>
281
287
  <p>work to download or install (gem)</p>
@@ -293,7 +299,8 @@ def main
293
299
  <p>On rubygems, there are even fewer results. MY CODE WILL BE FOUND.</p>
294
300
  <p>I shared my gem online.</p>
295
301
  #{"https://www.rubygems.org/gem/democracy
296
- https://www.linkedin.com/in/gregory-cohen-274333261/"}
302
+ https://twitter.com/democracygem
303
+ https://www.linkedin.com/in/gregory-cohen-274333261/".strip.list}
297
304
  <p>Gems that link to this gem on RubyGems</p>
298
305
  #{"
299
306
  https://www.rubygems.org/gems/democracy
data/gem_data/README CHANGED
@@ -1,5 +1,7 @@
1
1
  Trying to help with democracy.
2
2
 
3
+ https://snapcraft.io/democracy
4
+
3
5
  This is a collection of software that could truly change the world.
4
6
 
5
7
  All of these programs are mostly self-contained. This is a really good thing.
@@ -1 +1 @@
1
- 87.0
1
+ 93.0
@@ -0,0 +1,30 @@
1
+ #!/bin/bash
2
+
3
+ set -x
4
+ set -e
5
+
6
+ if [[ $2 = "" ]]; then
7
+ red_bold_underline OLD
8
+ nth 3 < *yaml | red_bold
9
+ red_bold VERSION AND REVISION ARE ARGS
10
+ exit 1
11
+ fi
12
+
13
+ rm -rf *snap democracy* 2>/dev/null
14
+
15
+
16
+
17
+ gsubip "1\.0\.\d+" 1.0.$1 snapcraft.yaml
18
+
19
+
20
+ cp /home/a/democracy -r . &>/dev/null
21
+ cd democracy
22
+ rm -fr .git
23
+ cd ..
24
+ tar cfz democracy.tar.gz democracy
25
+
26
+ snapcraft
27
+
28
+ snapcraft push democracy*snap
29
+
30
+ snapcraft release democracy $2 stable
data/images/STORE.png ADDED
Binary file
data/images/STORE2.png ADDED
Binary file
data/images/Store.png ADDED
Binary file