Page 1 of 4 | Next »
[14:52:40] RedNifre: Hi there. If I want to implement a very old school BASIC compiler (line numbers, goto etc.), are there any good tokenizer/parser libraries I could use?
[14:53:07] RedNifre: (It's for compiling basic programs for my old calculator that is programmed in something that feels like machine language)
[16:55:56] RedNifre: It's french and means christmas. If it's UTF-8 and 5 long it looks like the unicode format that encodes the e with the diaresis as one character.
[16:57:18] RedNifre: Looks like everything is working, but you need to be careful, if you are on a mac and use that as a file name, MacOS will turn it into a different representation so when you read it back in it will be at least 7 bytes I think.
[16:57:49] RedNifre: length is the byte count. You might want the grapheme cluster count, but I don't know if Ruby has a function for that.
[16:58:53] RedNifre: Ruby might have a code point count which will work in that case, but not if you read it as a file name on MacOS. Hm.
[16:59:44] RedNifre: Looks like nobody knows how to do it: https://unicode-programming.readthedocs.io/en/latest/count-characters/ruby/
[17:00:26] RedNifre: I only know about Swift counting grapheme clusters correctly, I hope more languages will offer that feature in the future.
[17:01:20] RedNifre: Also, according to legend, there is a giant several hundred MB large C library from IBM somewhere, that is the only thing that can handle Unicode correctly. If you can get that to work you might be able to get the correct character count.
[17:02:54] RedNifre: Your string would fit into ISO/IEC 8859-15, so convert it to that to get a 4 byte string ;)
[17:05:03] RedNifre: Because then you couldn't mix it with Japanese or Russian text any more. It wouldn't be Unicode.
[17:05:24] RedNifre: If you want to count the grapheme characters correctly here's how: http://www.unicode.org/reports/tr29/
[17:08:15] RedNifre: Then 5 is the correct code point length, because your string is actually "noe<dots on previous char>l"
[17:13:00] RedNifre: Yeah, I got it from Wikipedia, the article name is written with the "E WITH DIARESIS" character, while your String has an "E" followed by "COMBININD DIARESIS", so your string has the dots as a separate combining character.
[17:15:53] RedNifre: MacOS respects that, you can use both strings to open a file with that name, because MacOS converts all representations to the same format before writing it to disk.
[17:19:14] RedNifre: If you are on MacOS you could try reversing "🇺🇸🇪🇪" (USA flag followed by Estland Flag).
[17:20:39] RedNifre: Estland flag should stay as it is, but the USA flag should turn into the Soviet Union flag when reversed (Though I don't think that any platform has that flag supported).
[22:15:08] RedNifre: Hi. I'm currenly working through Hartl's tutorial and everything works so far except that when I do `heroku run rails console --sandbox`, inside irb it won't find `User` even though that worked locally (I added a User model and pushed that to heroku and did a db:migrate).
[22:16:46] RedNifre: Can I do other things in rails console to get a better picture of the situation?
[16:08:57] RedNifre: hey there, I'm new to rails. When I run `rails test` in the Cloud9 IDE it first runs the tests as expected but follows it with a lot of output, something about tmux (which isn't even installed) and many .rb files. Why is that?
[16:09:42] RedNifre: so it outputs the expected statistics of how many tests worked or failed, followed by /usr/local/rvm/gems/ruby-2.4.1/gems/notiffany-0.1.1/lib/notiffany/notifier/tmux/client.rb:12:in `version': undefined method `' for nil:NilClass (NoMethodError)
[16:10:38] RedNifre: I guess it wants to notify in tmux but fails because there is no tmux? Can I tell it to run the tests without a notification when they are done?
[19:33:24] RedNifre: What's a good way to learn Rails if you have medium knowledge of web frameworks and ruby?
[19:56:06] RedNifre: E.g. a Jira automation, some raspberry Pi LED blinking stuff, some media ingest etc.
[19:58:31] RedNifre: Yeah, I noticed that even though I never learned Ruby properly it's still my go to language for getting something simple done quickly. So I wondered if I should give it a closer look regarding doing large things with it, hence Rails.
[20:09:31] RedNifre: it basically replaced bash for me completely, especially since you can write `inline bash like that`
[23:49:43] RedNifre: What happens when you launch ruby files with the interpreter? Does it parse individual files lazily when it encounters a require? I have a version of my script running and it's currently crawling something, but I'd like to continue working on it... I gues the interpreter doesn't mind if I edit the file since it only reads it once on startup, right?
[19:29:02] RedNifre: Hey there. What's the idiomatic ruby way for tail -f somefile | ruby somescript.rb?
[21:40:31] RedNifre: Well, given that I'm rewriting my big ball of mud code to clean it up I guess I should do the proper 'select' solution
[21:41:36] RedNifre: You see, historically I used ruby to write tiny ugly prototypes and when it got too messy I rewrote it in a different language, but now I'm trying to do it properly in ruby (because I couldn't find a better scripting language)
[17:37:53] RedNifre: Well... It's just that I have the script running locally on my machine, I want to quit it easily and I want it to continue where it left off when I start it again, so it should save its state when I quit it.