shunkuntype 1.0.12 → 1.0.13

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a9b732dc82cc5aa2ddf7736e55af3453cd3bafd2
4
- data.tar.gz: 7def80b6697fcec4ab2fce2d14c27afe6ddcb3f2
3
+ metadata.gz: 8116daf8b4491b03eae9efc00a2293e7d1779ef7
4
+ data.tar.gz: 05516f095e981543e05e2ddd08a1983de4e789d8
5
5
  SHA512:
6
- metadata.gz: 65af830217d92b322e78cc518457a77daaf884769d1d4a8b3a795f8cf0b6754d1797839cf4f232cf5c6ea019b935e599fcf9a3d3a30baa82bad019d3e1ea3501
7
- data.tar.gz: bb18ccd9b3f008e48ddfa5ee0b0339a2f44e1b1adcc01b1d256a35e0f107049a93f36d996198ec2cc6d4ca6310997eddf6cbbfea96bf93942dc8f7d577e7acc6
6
+ metadata.gz: 8deff29282144e6fcfd6144b88dff256d1cf28f93c69539edbcd2863838b8aa1b8e36442fce0922b1f5d9e7be5363d49f4ef3f8d396a751ce5d4544fb0069aa4
7
+ data.tar.gz: 0c04fcec5327b3b6068915a00ef93932e99e21390670c010f838a30334e64ffe17c282c5841f8898da845b7e91142e081cf162f5ea4d45d15bbf78eaaa139979
@@ -9,7 +9,18 @@ class FinishCheck
9
9
  ['lo. 30,31,32,33,34', 30,31,32,33,34],
10
10
  ['aqz 35,36,37,38,39', 35,36,37,38,39],
11
11
  [';p 40,41,42,43,44,45',40,41,42,43,44,45],
12
- ['consol 46,47,48,49,50', 46,47,48,49,50]
12
+ ['consol 46,47,48,49,50', 46,47,48,49,50],
13
+ ['ex01 51,52,53,54,55', 51,52,53,54,55],
14
+ ['ex02 56,57,58,59,60', 56,57,58,59,60],
15
+ ['ex03 61,62,63,64,65', 61,62,63,64,65],
16
+ ['ex04 66,67,68,69,70', 66,67,68,69,70],
17
+ ['ex05 71,72,73,74,75', 71,72,73,74,75],
18
+ ['ex06 76,77,78,79,80', 76,77,78,79,80],
19
+ ['ex07 81,82,83,84,85', 81,82,83,84,85],
20
+ ['ex08 86,87,88,89,90', 86,87,88,89,90],
21
+ ['ex09 91,92,93,94,95', 91,92,93,94,95],
22
+ ['ex10 96,97' , 96,97]
23
+
13
24
  ]]
14
25
  def initialize
15
26
  finish = [[],[]]
@@ -23,6 +23,7 @@ class MkSummary
23
23
  p name
24
24
  speed_file="#{name}_speed_data.txt"
25
25
  if files.include?(speed_file)
26
+ p speed_file
26
27
  file = File.readlines(File.join($mem_dir,speed_file))
27
28
  init= (file[0]!=nil ? file[0].split(",")[2].to_f : 0.0 )
28
29
  cur = (file[-1]!=nil ? file[-1].split(",")[2].to_f : 0.0 )
@@ -30,6 +31,7 @@ class MkSummary
30
31
  end
31
32
  training_file="#{name}_training_data.txt"
32
33
  if files.include?(training_file)
34
+ p training_file
33
35
  file = File.readlines(File.join($mem_dir,training_file))
34
36
  work_time = file.inject(0){|sum,line|
35
37
  sec=line.split(',')[3].to_i
@@ -29,12 +29,16 @@ class PlotData
29
29
  end
30
30
 
31
31
  def read_general_data(file, x_col, y_col)
32
- File.open(file,'r'){|file|
33
- while line=file.gets do
34
- tmp=line.chomp.split(',')
35
- @data << [tmp[x_col],tmp[y_col]]
36
- end
37
- }
32
+ begin
33
+ File.open(file,'r'){|file|
34
+ while line=file.gets do
35
+ tmp=line.chomp.split(',')
36
+ @data << [tmp[x_col],tmp[y_col]]
37
+ end
38
+ }
39
+ rescue => e
40
+ p e
41
+ end
38
42
  end
39
43
  # @!endgroup
40
44
 
@@ -82,16 +86,15 @@ class MkPlots
82
86
  @opts = opts
83
87
  mk_mem_names()
84
88
  work_all()
85
- # FileUtils.mv('res.png', './work.png')
86
89
  speed_all()
87
- # FileUtils.mv('res.png', './speed.png')
88
90
  end
89
91
 
90
92
  def work_all
91
- all_data= @mem_names.inject([]){|all,name| all << work_view(name) }
93
+ all_data= @mem_names.inject([]){|all,name|
94
+ all << work_view(name)
95
+ }
92
96
  text="Work minutes [min]"
93
97
  plot(all_data,text)
94
- # plot(all_data,text,opts={:png=>true})
95
98
  end
96
99
 
97
100
  def speed_all
@@ -100,11 +103,10 @@ class MkPlots
100
103
  text="Typing speed [sec/20 words]"
101
104
 
102
105
  plot(all_data,text)
103
- # plot(all_data,text,opts={:png=>true})
104
106
  end
105
107
 
106
108
  def speed_view(name)
107
- p name1 = "#{@source_dir}/#{name}_speed_data.txt"
109
+ name1 = "#{@source_dir}/#{name}_speed_data.txt"
108
110
  data0 = PlotData.new(name1, 0, 2, name)
109
111
  start=Time.parse(Time.now.to_s)
110
112
  x_func = proc{|x| ((Time.parse(x)-start)/3600/24) }
@@ -2,7 +2,7 @@ require 'fileutils'
2
2
  require 'tmpdir'
3
3
 
4
4
  module Shunkuntype
5
- VERSION = "1.0.12"
5
+ VERSION = "1.0.13"
6
6
  data_dir = File.join(ENV['HOME'], '.shunkuntype')
7
7
  # SPEED_FILE="./shunkuntype_speed_data.txt"
8
8
  SPEED_FILE=File.join(data_dir,"speed_data.txt")
data/lib/shunkuntype.rb CHANGED
@@ -103,11 +103,11 @@ module Shunkuntype
103
103
  server_info=File.readlines(Shunkuntype::SERVER_FILE)
104
104
  p server_directory=server_info[0].chomp
105
105
  Dir.mktmpdir('shunkun'){|tmp_dir|
106
+ # ['tmp_dir'].each{|tmp_dir|
106
107
  p tmp_dir
107
108
  FileUtils.mkdir_p(File.join(tmp_dir,'mem_data'))
108
109
  system "scp -r #{server_directory}/* #{tmp_dir}/mem_data"
109
- # write data to file
110
- table = MkSummary.new(tmp_dir)
110
+ table = MkSummary.new(tmp_dir) # read data from files
111
111
  MkPlots.new(tmp_dir,opts)
112
112
  File.open('./tmp.html','a'){|f|
113
113
  f.write("<html>\n")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shunkuntype
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.12
4
+ version: 1.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shigeto R. Nishitani
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-07-12 00:00:00.000000000 Z
11
+ date: 2017-07-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: systemu