https://ankiweb.net/shared/info/2055492159
https://aquafina-water-bottle.github.io/jp-mining-note/setup/ (used python3 on my Mac)
C.1 Setup Anki
| <!-- You can drop this into the Nihongo 2000 Core and it works! Just remember to add the Pitch Pattern field --> | |
| <a | |
| class="{{Pitch Pattern}}" | |
| href="https://www.gavo.t.u-tokyo.ac.jp/ojad/search/index/sortprefix:accent/narabi1:kata_asc/narabi2:accent_asc/narabi3:mola_asc/yure:visible/curve:invisible/details:invisible/limit:20/word:{{Vocabulary-Kanji}}"> | |
| pitch | |
| </a> |
https://ankiweb.net/shared/info/2055492159
https://aquafina-water-bottle.github.io/jp-mining-note/setup/ (used python3 on my Mac)
C.1 Setup Anki
| # SolidusImporter::Row now has a `entity_id` field. | |
| # It helps aggregate rows that belong to the same "entity" (Order for now) so we can process them together. | |
| # With this, there's no need to maintain a huge context inside the `ProcessRow` job any longer. | |
| # So how might we? | |
| # lib/solidus_importer/process_row.rb | |
| # 1. Associate the Row with an `Identifier` we an use to group related rows together | |
| def prepare_rows(data) | |
| messages = check_data(data) |
| # GET file from Importer url on dashboard | |
| url = '' | |
| file_data = Net::HTTP.get URI(url) | |
| csv = CSV.parse( | |
| file_data, | |
| headers: true, | |
| encoding: 'UTF-8', | |
| header_converters: ->(h) { h.strip } |
| # GET file from Importer url on dashboard | |
| url = '' | |
| file_data = Net::HTTP.get URI(url) | |
| csv = CSV.parse( | |
| file_data, | |
| headers: true, | |
| encoding: 'UTF-8', | |
| header_converters: ->(h) { h.strip } |
| Dir.glob('*').each do |file| | |
| content = File.read(file) | |
| parsed_content = content.split("\n")[2].sub('BODY;CHARSET=UTF-8;ENCODING=QUOTED-PRINTABLE:', '') | |
| .unpack('M').first.encode('utf-8', 'iso-8859-1') | |
| IO.binwrite(file.gsub('vnt', 'txt'), parsed_content) | |
| end |
| string = '1,2,3,4,5,6' | |
| number = true | |
| string.chars.each do |char| | |
| if number && char.number? # pseudo-code | |
| number = false | |
| continue | |
| else | |
| if char.comma? |
| $ irb -r ./select_server | |
| >> client.puts "hi" | |
| => nil | |
| >> client.puts "bye" | |
| => nil | |
| >> client.close | |
| => nil | |
| >> exit |
| results = ActiveRecord::Base.connection.execute(sql) | |
| CSV.open('csv.csv', 'w+') do |f| | |
| f << results[0].keys | |
| results.each do |r| | |
| f << r.values | |
| end | |
| end |
| # note: this assumes the order never gets recalculated | |
| csv = CSV.read('maker-orders.csv', headers: true) | |
| orders = [] | |
| csv.each do |context| | |
| order = Spree::Order.find_by_number(context['Name']) | |
| next if order.nil? | |