←2016-01-06 2016-01-07 2016-01-08→ ↑2016 ↑all
00:03:44 -!- FreeFull has joined.
00:05:49 -!- hppavilion[1] has joined.
00:05:52 <hppavilion[1]> OOh
00:06:02 <hppavilion[1]> I don't think anyone's made an OO logic language before
00:09:43 <tswett> What do you mean by OO?
00:10:23 <oerjan> the logic part is usually immutable, isn't it
00:11:01 <oerjan> hm some say Erlang is an OO language in the original sense
00:11:28 <tswett> There's an original sense?
00:11:37 <oerjan> Alan Kay's sense, iirc
00:31:12 <oerjan> @tell izabera <izabera> https://en.wikipedia.org/wiki/Befana YOU PEOPLE DON'T HAVE THIS?!? <-- NOPE HTH
00:31:12 <lambdabot> Consider it noted.
00:34:33 <hppavilion[1]> oerjan: We don't have it here in america
00:34:45 <oerjan> i wouldn't expect you to
00:34:46 <hppavilion[1]> In fact, I don't think we even celebrate Epiphany in the US
00:35:00 <hppavilion[1]> oerjan: Of course not xD.
00:35:08 <oerjan> not in norway either
00:35:31 <oerjan> hppavilion[1]: well, unless maybe you were of italian descent
00:35:41 <hppavilion[1]> oerjan: True
00:36:22 <hppavilion[1]> oerjan: Where can I find info on OO in the Alan Kay sense?
00:36:25 <hppavilion[1]> I want to learn about it :)
00:36:47 <oerjan> i don't think epiphany is celebrated, although it's traditionally the last day of christmas in parts of norway (some include one more week)
00:36:50 <hppavilion[1]> Unless it's the typical description of OO, but modern languages /don't/ OO properly
00:37:21 <hppavilion[1]> Like, they don't implement what Wikipedia talks about
00:38:25 <oerjan> hppavilion[1]: well "Actually I made up the term "object-oriented", and I can tell you I did not have C++ in mind."
00:38:44 <oerjan> although he probably had something smalltalkish
00:38:54 <hppavilion[1]> oerjan: Ah.
00:39:00 <hppavilion[1]> Are you the one who hates OO?
00:39:11 <hppavilion[1]> Someone on this channel does, one of the o's
00:39:34 <hppavilion[1]> (People whose names start with "o" are nearly indistinguishable in my memory)
00:40:27 <oerjan> hate? not really. i'm almost haskell-monoglottish these days, though. when i even program.
00:40:42 <hppavilion[1]> Ah. It must be \oren\ then.
00:40:51 <oerjan> \oren\ perhaps. he's rather opinionated on some things.
00:41:15 <hppavilion[1]> oerjan: Yes, I think it was.
00:46:44 -!- mauris has joined.
00:50:02 -!- mauris has quit (Read error: Connection reset by peer).
00:52:46 <oerjan> oh right, istr back when i was a kid january 6 was about the time we removed the christmas decorations.
00:54:57 -!- mauris has joined.
00:56:14 <\oren\> I don't like most OO, but only because of the syntax being needlessly complicated
00:57:00 <\oren\> the actual concepts of ADT's and polymorphism, etc are mostly fine
00:57:13 <vanila> ADT's and polymorphism isn't OO
00:57:23 <\oren\> sure it is
00:57:31 <vanila> thats functional programming
00:57:35 <vanila> OO is about message passing and/or classes and instances
00:57:52 <\oren\> classes and instances = ADT's?
00:58:27 <\oren\> well i mean an ADT is like an interface, and then an implemention is a class
00:59:19 <vanila> thats a completely different thing that i ever thought of
01:01:13 <\oren\> anyway basically a lot of the useful parts of OO are functional programming with a stupid syntax
01:10:07 <oerjan> ADT has two different meanings hth
01:10:48 <oerjan> dependent on whether A is Abstract or Algebraic
01:11:04 <vanila> in an OO context you would say encapsulation
01:13:50 <hppavilion[1]> vanila: OO need not be classy
01:36:50 <zgrep> oerjan: What if it's just Average?
01:45:22 -!- hppavilion[1] has quit (Ping timeout: 256 seconds).
01:49:29 -!- mauris has quit (Ping timeout: 255 seconds).
02:00:16 -!- AlexR42 has joined.
02:10:28 -!- andrew has joined.
02:32:58 -!- jaboja has joined.
02:39:43 <oerjan> > 38 * 38
02:39:45 <lambdabot> 1444
02:40:11 <oerjan> oh wait that's correct
02:40:17 <oerjan> > 38^2
02:40:19 <lambdabot> 1444
02:40:49 <vanila> amazitng that it has all the 4s
02:41:19 <Phantom_Hoover> 38^4
02:41:25 <Phantom_Hoover> > 38^4
02:41:27 <lambdabot> 2085136
02:41:35 <Phantom_Hoover> disappointing, that
02:41:58 <Elronnd> does lambdabot support nested powers or whatever they're called?
02:42:02 <Elronnd> > 2^^2
02:42:03 <lambdabot> 4.0
02:42:08 <Elronnd> :(
02:42:23 <Phantom_Hoover> :t (^^)
02:42:24 <lambdabot> (Fractional a, Integral b) => a -> b -> a
02:42:44 <Phantom_Hoover> :t (^)
02:42:45 <lambdabot> (Integral b, Num a) => a -> b -> a
02:42:48 <Phantom_Hoover> :t (**)
02:42:49 <lambdabot> Floating a => a -> a -> a
02:43:04 <oerjan> > foldr1 (^) [2,2]
02:43:05 <lambdabot> 4
02:43:19 <oerjan> > foldr1 (^) $ replicate 3 2
02:43:20 <lambdabot> 16
02:43:28 <vanila> tghere doesn't seem to be any other numbers
02:43:36 <Phantom_Hoover> oerjan, now write it pointfree
02:44:19 <oerjan> > (((foldr1 (^).).replicate) 3 2
02:44:20 <lambdabot> <hint>:1:31:
02:44:20 <lambdabot> parse error (possibly incorrect indentation or mismatched brackets)
02:44:22 <oerjan> oops
02:44:29 <oerjan> > ((foldr1 (^).).replicate) 3 2
02:44:31 <lambdabot> 16
02:47:53 <HackEgo> [wiki] [[Cardinal]] https://esolangs.org/w/index.php?diff=46094&oldid=45357 * Albedo * (+310) /* External resources */ external source added
02:52:00 <oerjan> `? gray
02:52:20 <HackEgo> gray? ¯\(°​_o)/¯
02:52:25 -!- singingboyo has joined.
02:52:45 <oerjan> `learn Gray is e common misspalling of grey.
02:52:49 <HackEgo> Learned 'gray': Gray is e common misspalling of grey.
02:54:06 <oerjan> just chennaling en eltarnetiva univarsa hara
02:55:00 <singingboyo> oerjan: well those were an odd couple of messages to join to
02:55:14 <Elronnd> `? gray
02:55:16 <HackEgo> Gray is e common misspalling of grey.
02:55:40 <oerjan> singingboyo: okey
02:56:40 <oerjan> also i was inspired by some logreading
02:57:33 <Elronnd> earjen: good work fixing thet dafinition
02:57:45 <Elronnd> *oarjen
02:57:55 <oerjan> thenks
02:59:16 -!- Elronnd has changed nick to Alronnd.
03:06:16 -!- Alronnd has changed nick to Elronnd.
03:25:53 -!- Phantom_Hoover has quit (Read error: Connection reset by peer).
04:09:06 -!- hppavilion[1] has joined.
04:09:47 -!- lleu has quit (Quit: That's what she said).
04:45:02 -!- oerjan has quit (Quit: Nite).
04:46:08 -!- MDude has changed nick to MDream.
05:17:30 <myname> i am confused by the first dot
05:24:23 -!- vanila has quit (Quit: Leaving).
05:31:39 -!- jaboja64 has joined.
05:35:09 -!- jaboja has quit (Ping timeout: 245 seconds).
05:37:18 -!- jaboja64 has quit (Ping timeout: 260 seconds).
05:42:35 -!- hppavilion[1] has quit (Ping timeout: 276 seconds).
05:52:37 -!- singingboyo has quit (Remote host closed the connection).
06:17:42 -!- onetwothree4life has quit (Ping timeout: 252 seconds).
06:47:28 -!- singingboyo has joined.
06:54:09 -!- FireFly has quit (Ping timeout: 250 seconds).
06:54:35 -!- EgoBot has quit (Ping timeout: 250 seconds).
06:55:13 -!- EgoBot has joined.
06:56:19 -!- FireFly has joined.
07:09:41 -!- jaboja has joined.
07:42:45 -!- ^^v has joined.
08:17:10 -!- ocharles__ has changed nick to ocharles.
08:18:18 -!- ^^v has quit (Quit: Leaving).
08:23:46 -!- jaboja has quit (Ping timeout: 240 seconds).
08:37:18 -!- haavardp has changed nick to haavard.
08:42:25 -!- mroman has joined.
08:42:35 <mroman> What happens if you reverse the order of returns?
08:47:23 <mroman> also... where would return values go...
08:47:59 <mroman> http://codepad.org/EZD8StCf
08:48:13 <mroman> basically ret would pop elements from the call stack in reverse order
09:03:07 <haavard> What would happen is your brain would start hurting
09:04:20 -!- singingboyo has quit (Remote host closed the connection).
09:06:14 -!- \oren\ has quit (Ping timeout: 256 seconds).
09:06:48 -!- \oren\ has joined.
09:17:39 -!- sebbu has quit (Quit: reboot).
09:22:15 -!- jaboja has joined.
09:23:53 <mroman> also if any new languages come out that have nullable types as the default I will only look at them and go "whyyyy :("
09:24:50 <b_jonas> hah
09:25:52 <mroman> because they should be non-nullable
09:26:25 <b_jonas> I don't have a problem with nullable types as defaults in C++, but that's because the nullable types are the _pointers_ (pointers to objects, to void to functions, to member objects, to member functions), which are supposed to be low level types,
09:26:41 -!- jaboja has quit (Ping timeout: 255 seconds).
09:26:48 <b_jonas> but you can build high-level types that aren't nullable, and the standard library generally has such types.
09:27:24 <mroman> The thing is that most methods for example in Java will assume that references are valid (non-null)
09:27:44 <mroman> luckily if they are null it will raise a NullPointer-Exception
09:27:51 <mroman> which you can catch somewhere
09:27:59 <b_jonas> On the other hand, there's some reasons why certain types have to be nullable in C++ even if they're semantically non-nullable, and this is because it's easier to handle types that can be moved, and even easier if they can be default-constructed, which often requires nullability.
09:28:18 <b_jonas> Which is why eg. unique_ptr is nullable and should be.
09:28:21 <mroman> but usually you catch those only in outter-outter-outter function because you never expect a NullPointer-Exception to be thrown
09:28:58 <b_jonas> (And by can be moved, I mean that they can have noexpect move constructed technically.)
09:29:12 <b_jonas> mroman: sorry, I don't do java.
09:29:17 <mroman> so ideally you'd have to annotate references that they may be null
09:29:34 <mroman> such as String (never null), String? (maybe null)
09:30:05 <mroman> and passing a T? to a T would be deemed illegale without having it checked first
09:30:50 <b_jonas> Now for a language that's almost fully dynamically allocated, like java or haskell or ruby or python, the objections I mentioned don't stand, although there are some other reasons why you want nullable by default types in some of those languages.
09:31:08 <mroman> what reasons?
09:31:59 <mroman> There are cases where you'd want null (such as for example in certain data structures) but those would be T? then
09:32:02 <fizzie> That's what @Nullable is for in Java.
09:32:25 <mroman> for example map.get would be T? because it returns null if the element does not exist
09:32:36 <fizzie> It's not an uncommon convention to say that all non-annotated references are always non-null, and require @Nullable otherwise.
09:33:00 <fizzie> It's a bit more verbose than the C# ?, but still.
09:34:12 <mroman> It's a convention, yes.
09:34:23 <mroman> but it's not reflected within the language itself
09:34:31 <fizzie> Well, there are also good tools that make it an error to pass @Nullable Foo to a function taking a Foo.
09:34:34 <mroman> because the language's convention is, that they are all nullable
09:34:43 <fizzie> Of course you need an annotations for all libraries you use, including the standard one, which can be a pain.
09:35:10 <mroman> That's why it's so important to design a language nicely from the start
09:35:26 <mroman> if you fix things later you'll have trouble that you have lots and lots of old code around
09:35:33 <mroman> that don't follow new "things"
09:36:20 <mroman> and then you need external tools that check annotations/javadoc in the hope that all code you use use them properly too
09:36:56 <mroman> I guess findbugs might have some @Nullable heuristics
09:37:33 <fizzie> It does, and the Checker Framework is popular too.
09:37:39 <b_jonas> mroman: In haskell, as far as I know, almost nothing is implicitly nullable.
09:39:00 <mroman> Haskell is quite nice :)
09:39:15 <b_jonas> mroman: in ruby and python, the problem is that, unlike in smalltalk, classes don't have their set of instance variables fixed statically in advanced, but each instance can add instance variables dynamically. due to this, you can't require that all instances variables of an object of a user-defined class are initialized when the obj is constructed,
09:39:15 <mroman> except for things like fromJust
09:39:20 <mroman> and non-total list functions
09:40:01 <fizzie> I mean, I admit it's very much less clean than it would be if it were part of the core language, but it's still quite possible to have strict nullness checks in Java.
09:40:15 <b_jonas> so there have to exist non-existant instance variables, and either those are just implicitly read as a null value, which means the instance variable is of a nullable type, or cause an error when read, which sort of means the class is of a nullable type.
09:40:18 <mroman> b_jonas: Yes, this wouldn't work in dynamic languages
09:40:25 <mroman> you'd need static type checking
09:40:49 <mroman> the whole point is to avoid run-time nullpointer errors
09:41:30 <mroman> but that's because i've worked with librarys with poor exception handling
09:42:04 <mroman> that throw nullpointer exceptions for all kinds of errors
09:42:27 <b_jonas> mroman: I see.
09:42:34 <mroman> which are annoying to debug because then I need to go through the source code of that library
09:42:47 <mroman> and trace where those values come from to see why something is null
09:43:10 <b_jonas> But is this a problem with the java language, or just some badly written libraries?
09:43:28 <mroman> and you can't do proper error reporting in your application because you can't really tell much if it the library just reports nullpointer exception
09:43:59 <mroman> that's why you display "An error happened" to the user-gui :)
09:44:05 <mroman> instead of a meaningful message
09:44:25 <fizzie> Oh? In my experience, you generally display a 200-line stack trace instead.
09:44:27 <mroman> b_jonas: It's 90% badly written library
09:44:40 <b_jonas> By the way, SQL also has types that are nullable by default, but can be declared as non-nullable, and I don't know the reason for that.
09:44:59 <fizzie> Okay, maybe you print the 200-line stack trace in the console and display "an error happened" in the GUI.
09:45:29 <mroman> fizzie: Well you obviously log the stack trace but you won't be displaying the stack trace to an end-user
09:45:38 <b_jonas> In SQL, is it a good practice to declare most table columns as NON NULL explicitly if they shall not contain nulls?
09:45:47 <fizzie> I've seen quite a lot of stack traces as an end user of Java programs.
09:46:22 <fizzie> b_jonas: I've been doing that, but I don't know if it's standard practice or not.
09:46:28 <mroman> some display the stacktrace to the user
09:46:42 <mroman> but in my case it wouldn't tell the user what he did wrong.
09:47:10 <fizzie> Sometimes it's a stack trace after Proguarding, which is extra helpful.
09:47:17 <b_jonas> fizzie: I'm not asking if it's standard practice or not. I'm asking if it's good practice or not. There's lots of bad SQL out there so the two needn't be the same.
09:47:28 <mroman> the only thing I can do is to check for the exact location of the null-pointer exception within the library
09:47:31 <mroman> and then do
09:48:01 <mroman> if(lineNo == 12) { /* this is wrong */ } else if (lineNo == 99) { /* that other thing is wrong */ } ...
09:48:17 <fizzie> Sounds very maintainable.
09:48:21 <mroman> but I'm not going to do that because we have no more funding :D
09:48:45 <mroman> fizzie: The library has internal state
09:48:59 <mroman> lots
09:49:13 -!- farooghkz has joined.
09:49:50 -!- farooghkz has left.
09:50:02 -!- variable has joined.
09:50:53 <mroman> which is also a problem if you restart tomcat
09:50:54 <mroman> because...
09:51:12 <mroman> even though the library saves certain things to files
09:51:21 <mroman> it doesn't properly reload all of them
09:52:59 -!- variable has quit (Remote host closed the connection).
09:56:04 <mroman> http://pastebin.com/T3uZLCtm <- that's the storage
09:56:57 <mroman> well that's the "database" of the library to be precis
09:57:01 <mroman> O(n) lookup
09:57:21 <mroman> and deletion is done by creating a tempfile, copying every entry in the file to it, skipping the one to delet, delete the file, rename the tempfile
09:57:50 <mroman> and yes, that code is property of IBM :D
09:58:33 <mroman> oh, I meant copy from tempfile back to original file
09:58:34 -!- mauris has joined.
09:58:48 <b_jonas> In ascii text, if I want to give a list of timestamps, each timestamp in an RFC 3339 / ISO 8601 format, then can I separate the timestamps with commas? Or are commas commonly used for something else in the context of ISO 8601 style timestamps?
09:59:14 <lifthrasiir> b_jonas: comma may optionally replace period.
09:59:46 -!- sebbu has joined.
09:59:52 <b_jonas> hmm, that could be a problem
10:00:30 <b_jonas> (although I personally dislike commas used as a decimal point OR thousands separator)
10:00:40 <b_jonas> I might need to find a different separator then
10:00:58 <mroman> property, but not written I assume.
10:01:23 <mroman> It's an open source privacy/crypto engine/library
10:01:50 <b_jonas> indeed, https://en.wikipedia.org/wiki/ISO_8601#Times says commas are used as a decimal point in such timestamps
10:02:56 <mroman> >> Represent it as "14:30,5", "1430,5", "14:30.5", or "1430.5". <<
10:03:11 <mroman> parsing date times must be tedious
10:03:13 <mroman> so many formats
10:03:14 -!- J_Arcane has quit (Ping timeout: 276 seconds).
10:03:20 <mroman> and formats allow multiple variations?
10:03:30 <fizzie> Huh, I didn't know ISO 8601 was that flexible.
10:03:43 <b_jonas> Commas in numbers are a stupid historical practice from back when people frequently used a period as either a thousands group separator or a multiplication sign, and should be gone.
10:03:56 <fizzie> We've got commas in numbers back in Finland.
10:04:10 <fizzie> And the period as the thousands separator.
10:04:25 <mroman> We use ' for that
10:04:31 <mroman> 1'000,95
10:04:43 <mroman> but I hate that we use commas for that
10:04:48 <lifthrasiir> did you know that in RFC 3339 +0000 and -0000 has different meanings?
10:04:52 <b_jonas> People should use symbols for thousands separators other than commas or periods, such as a thin space, underscore, apostrophe, double colon, space; and even if you insist on using the dot for a multiplication sign, you should use an upper dot rather than a comma for decimal separator.
10:05:19 <lifthrasiir> mroman: non-breaking space (or non-breaking thin space) FTW
10:05:19 <mroman> lifthrasiir: is that "duration"?
10:05:27 <lifthrasiir> mroman: no, the time zone
10:05:31 <mroman> hm
10:05:36 <lifthrasiir> hmm
10:05:37 <lifthrasiir> sorry
10:05:41 <lifthrasiir> it was RFC 2822
10:06:04 <b_jonas> fizzie: yes, _traditionally_ Hungary has commas only for decimal points, just like how _traditionally_ it uses roman numerals to denote months, and multiple crazy formats to denote timestamps made of hours and minutes.
10:06:04 <lifthrasiir> anyway, only +0000 refers to UTC; -0000 signals the lack of timezone information (????)
10:06:12 <mroman> "Unknown local offset convention
10:06:13 <mroman> "
10:06:19 <mroman> I'd attend that convention.
10:06:21 <b_jonas> But these are traditions that many people don't follow anymore, and I wish even fewer people would follow.
10:07:19 <b_jonas> One big problem with the decimal point is that it's specified as the comma in lots of software, including most Hungarian locales, and those are generally VERY hard to change, eg. they require recompiling libc or worse.
10:07:21 <fizzie> Sorry, I misspoke: we use space for the separator.
10:07:25 <fizzie> I mean, in theory.
10:07:34 <fizzie> I don't think people actually use it that much, but that's the standard.
10:07:38 <fizzie> `cc #include <locale.h> \n int main(void) { setlocale(LC_ALL, "fi_FI"); printf("%'.2f", 1234.56); }
10:07:39 <HackEgo> 1234,56
10:07:45 <mroman> what's even worse is that scanf looks at the locale
10:08:23 <b_jonas> However, those Hungarian locales suck in other ways, eg. the one in Gnu libc has a blatant error in it where the month abbreviation for September is wrong, and message translations to Hungarian suck in lots of software.
10:08:44 <mroman> my brother used a chemical software that parsed some data format with scanf
10:09:01 <mroman> but since he had a de_ locale set, the software couldn't parse it
10:09:27 <b_jonas> lifthrasiir: wtf
10:09:36 <b_jonas> that sounds strange
10:10:13 <mroman> `cc #include <locale.h> \n int main(void) { setlocale(LC_ALL, "fi_FI"); printf("%'.2f", 12340000.56); }
10:10:15 <HackEgo> 12340000,56
10:10:29 <mroman> `cc #include <locale.h> \n int main(void) { setlocale(LC_ALL, "de_DE"); printf("%'.2f", 12340000.56); }
10:10:31 <HackEgo> 12.340.000,56
10:10:41 <mroman> `cc #include <locale.h> \n int main(void) { setlocale(LC_ALL, "de_CH"); printf("%'.2f", 12340000.56); }
10:10:41 <fizzie> I remember seeing "Jan 1" formatted by some program that attempted localization as "1. Januaryta" -- en:January is fi:tammikuu, and for the date the month needs to be in the partitive case, so "tammikuuta", and apparently the program somehow managed to add the Finnish suffix to the English month name.
10:10:42 <HackEgo> 12'340'000.56
10:11:00 <mroman> locales are fun .
10:12:05 <mroman> `cc #include <locale.h> \n int main(void) { setlocale(LC_ALL, "de_AU"); printf("%'.2f", 12340000.56); }
10:12:07 <HackEgo> 12340000.56
10:12:12 <mroman> hm
10:12:15 <mroman> is it de_AU?
10:12:32 <mroman> or AT
10:12:33 <mroman> probably AT
10:12:41 <mroman> `cc #include <locale.h> \n int main(void) { setlocale(LC_ALL, "de_AT"); printf("%'.2f", 12340000.56); }
10:12:42 <HackEgo> 12340000,56
10:13:17 <fizzie> So you've got periods for de_DE, 's for de_CH and no separator at all for de_AT? Good.
10:13:18 <mroman> so germany has dots and comma, switzerland has apostrophes and dot and austria has nothing and comma
10:13:32 <fizzie> Oh, I didn't notice one of them had period for the decimals too.
10:13:39 <fizzie> Very nice.
10:14:06 <mroman> `cc #include <locale.h> \n int main(void) { setlocale(LC_ALL, "it_IT"); printf("%'.2f", 12340000.56); }
10:14:08 <HackEgo> 12340000,56
10:14:16 <mroman> `cc #include <locale.h> \n int main(void) { setlocale(LC_ALL, "it_CH"); printf("%'.2f", 12340000.56); }
10:14:18 <HackEgo> 12'340'000.56
10:14:26 <b_jonas> fizzie: yes, that kind of mixed language thing happens when a program has messages for a certain language but uses system locale for other languages. The most common such symptom ime is message boxes with an English message and Hungarian labels on the yes/no/cancel buttons.
10:15:05 <mroman> `cc #include <locale.h> \n int main(void) { setlocale(LC_ALL, "fr_FR"); printf("%'.2f", 12340000.56); }
10:15:07 <HackEgo> 12 340 000,56
10:15:15 <mroman> ok
10:15:23 <mroman> so the frenchs are more loke the fins
10:15:29 <b_jonas> I have seen dates in a language mixed with text in a different language, but not a case where the program tried to attach an affix to it.
10:16:00 <mroman> `cc #include <locale.h> \n int main(void) { setlocale(LC_ALL, "jp_JP"); printf("%'.2f", 12340000.56); }
10:16:02 <HackEgo> 12340000.56
10:16:09 <mroman> hm
10:16:11 <mroman> damn
10:16:15 <mroman> no kanjis?
10:16:41 <b_jonas> mroman: not from a plain printf.
10:16:48 <b_jonas> (that would be a bad idea anyway)
10:17:10 <mroman> oh
10:17:13 <mroman> it's ja_JP anyway?
10:17:27 <mroman> `cc #include <locale.h> \n int main(void) { setlocale(LC_ALL, "ja_JP.UTF-8"); printf("%'.2f", 12340000.56); }
10:17:29 <HackEgo> 12,340,000.56
10:18:29 <mroman> why
10:18:34 <mroman> it could use JIS
10:18:39 <b_jonas> ``` LANG=ja_JP locale
10:18:40 <HackEgo> locale: Cannot set LC_CTYPE to default locale: No such file or directory \ locale: Cannot set LC_MESSAGES to default locale: No such file or directory \ locale: Cannot set LC_ALL to default locale: No such file or directory \ LANG=ja_JP \ LANGUAGE= \ LC_CTYPE="ja_JP" \ LC_NUMERIC="ja_JP" \ LC_TIME="ja_JP" \ LC_COLLATE="ja_JP" \ LC_MONETARY="ja_JP"
10:18:49 <b_jonas> ``` locale -a | grep ^ja
10:18:52 <HackEgo> ja_JP.eucjp \ ja_JP.utf8
10:19:10 <fizzie> `cc #include <locale.h> \n int main(void) { setlocale(LC_ALL, "sv_SE"); printf("%'.2f | ", 12340000.56); setlocale(LC_ALL, "sv_FI"); printf("%'.2f", 12340000.56); }
10:19:12 <HackEgo> 12 340 000,56 | 12340000,56
10:19:18 <fizzie> At least there's no difference there.
10:20:04 <mroman> ``` locale -a | grep FI
10:20:04 <b_jonas> fizzie: try a norvegian locale, maybe it writes zeros with more or fewer diagonal slashes
10:20:05 <HackEgo> fi_FI \ fi_FI.utf8 \ fi_FI@euro \ sv_FI \ sv_FI.utf8 \ sv_FI@euro
10:20:27 <mroman> is that "with euro sign"?
10:20:30 <mroman> :D
10:21:30 <fizzie> I think they might well be identical now.
10:21:32 <mroman> ``` locale -a | grep ^ch
10:21:33 <HackEgo> No output.
10:21:36 <fizzie> They probably were different at some point.
10:21:39 <mroman> ``` locale -a | grep CH
10:21:40 <HackEgo> de_CH \ de_CH.utf8 \ fr_CH \ fr_CH.utf8 \ it_CH \ it_CH.utf8
10:21:48 <fizzie> Or, hmm.
10:22:10 <mroman> no ch_CH
10:22:12 <mroman> that sucks :(
10:22:34 <fizzie> ``` locale -a | wc -l
10:22:35 <HackEgo> 442
10:22:38 <mroman> there's probably no standard for selecting dialects
10:23:46 <mroman> üch geits abr no güät.
10:24:04 <fizzie> sv_SE and sv_FI have different currency rules, but I wonder if there are any programs anywhere with different messages for them.
10:24:19 <mroman> does C even have currency stuff?
10:25:03 <fizzie> Yes, in struct lconv.
10:25:34 <mroman> that's not in the libc though
10:25:37 <fizzie> It is.
10:25:41 <mroman> it is?
10:25:47 <fizzie> It is. C11 7.11p2.
10:26:01 <mroman> oh. C11
10:26:08 <mroman> Is it in C99?
10:26:20 <fizzie> C99 7.11p2 as well.
10:27:08 <mroman> I've never used that
10:27:18 <mroman> Is there a printf char for currencies?
10:27:30 <fizzie> `cc #include <locale.h> \n int main(void) { setlocale(LC_ALL, "sv_SE"); struct lconv *se = localeconv(); printf("%s ", se->currency_symbol); setlocale(LC_ALL, "sv_FI"); struct lconv *fi = localeconv(); printf("%s", fi->currency_symbol); }
10:27:31 <HackEgo> kr EUR
10:27:44 <mroman> oh the ' does that
10:28:01 <mroman> `cc #include <locale.h> \n int main(void) { setlocale(LC_ALL, "de_CH"); printf("%.2f", 12340000.56); }
10:28:03 <HackEgo> 12340000.56
10:28:11 <mroman> `cc #include <locale.h> \n int main(void) { setlocale(LC_ALL, "de_CH"); printf("%'.2f", 12340000.56); }
10:28:13 <HackEgo> 12'340'000.56
10:28:24 <mroman> I deduced that ' meant "use delimiters for thousands"
10:28:42 <fizzie> The ' *isn't* part of the standard, of course.
10:29:44 <mroman> I see.
10:30:03 <fizzie> And ' is "use grouping if locale needs it".
10:30:28 <fizzie> I don't think there's a printf thing for money, which is allowed to use different characters for grouping and decimals.
10:30:58 <mroman> `cc #include <locale.h> \n int main(void) { setlocale(LC_ALL, "de_CH"); printf("%'I.2f", 12340000.56); }
10:30:59 <HackEgo> 12'340'000.56
10:31:05 <mroman> `cc #include <locale.h> \n int main(void) { setlocale(LC_ALL, "ja_JP"); printf("%'I.2f", 12340000.56); }
10:31:07 <HackEgo> 12340000.56
10:31:20 <mroman> `cc #include <locale.h> \n int main(void) { setlocale(LC_ALL, "fa_IR"); printf("%'I.2f", 12340000.56); }
10:31:22 <HackEgo> ​۱۲٬۳۴۰٬۰۰۰٫۵۶
10:31:25 <fizzie> Fancy.
10:31:51 <mroman> `cc #include <locale.h> \n int main(void) { setlocale(LC_ALL, "ja_JP.utf8"); printf("%'I.2f", 12340000.56); }
10:31:53 <HackEgo> 12,340,000.56
10:32:02 <mroman> ``locale -a | grep ja | grep utf
10:32:03 <HackEgo> ​/home/hackbot/hackbot.hg/multibot_cmds/lib/limits: line 5: exec: `locale: not found
10:32:06 <b_jonas> fizzie: if you want such fancy formatting, use libicu rather than just the small support in libc and locales
10:32:10 <mroman> `` locale -a | grep ja | grep utf
10:32:11 <HackEgo> ja_JP.utf8
10:32:25 <mroman> still no kanji though
10:32:31 <b_jonas> mroman: ^
10:32:40 <mroman> also
10:32:47 <mroman> it should print vertically
10:32:54 <mroman> of course
10:33:03 <mroman> a vertical terminal would look weird though
10:33:43 <mroman> although that should really be a terminal issu
10:33:45 <mroman> *issue
10:33:48 <mroman> not a printf issue
10:34:47 <b_jonas> incidentally, in Japanese text with digits written as kanji digits (not a read out number with words like "ten" and "hundred" in it) printed vertically, can you write a decimal point or a negative sign or other numeric punctuations, and if so, how?
10:35:26 <mroman> also bear in mind they count in 10'000
10:35:47 <mroman> oh
10:35:48 <mroman> ah
10:35:49 <mroman> sry
10:35:51 <mroman> misread :D
10:37:22 <mroman> I don't even know if they write digits with kanjis
10:38:53 <b_jonas> mroman: they do, mostly in vertical writing, because roman digits don't work in vertical writing
10:39:50 <b_jonas> mroman: you can see it in street signs advertising prices in Japan, eg 600 yen is written as a kanji 6 followed by two of the circular punctuation followed by the kanji for yen.
10:40:05 <mroman> so they write 10000$ as 一〇〇〇〇$?
10:40:18 <mroman> oh ok
10:40:18 <mroman> Didn't know that.
10:40:21 <b_jonas> mroman: in vertical writing, yes, although I don't know how they write dollar
10:40:38 <b_jonas> mroman: in horizontal, generally they just use roman numerals
10:40:41 <b_jonas> um
10:40:49 <b_jonas> s/roman/hindu-arabic/
10:41:01 <b_jonas> halfwidth ascii numerals that is
10:41:05 <b_jonas> not fullwidth
10:43:19 <mroman> It would be funny if they indeed used roman numerals
10:43:54 -!- Frooxius has quit (Quit: *bubbles away*).
10:46:45 <mroman> how does one pronounce roman numerals?
10:46:58 <mroman> We just learned to read IV as 4
10:47:05 <mroman> but not how do spell roman numerals
10:48:45 <b_jonas> I don't know. I hate roman numerals, and belive they should not be used for anything,
10:49:17 <mroman> is 2003 spelled as M M three, or M M I I I or M M unus unus unus or M M tres?
10:49:47 <b_jonas> I wish people would stop using them, which has already partly happened since month numbers are almost never written in a roman numeral these days, and clock faces have roman numerals less often, but people still almost always use roman numerals to identify the districts in Budapest.
10:50:14 <mroman> chapters are often numbered with roman numerals
10:51:23 <b_jonas> Admittedly, there _is_ a good reason why districts of Budapest are written in a roman numeral: if you write them with digits in a street address, they are ambiguous with street names that start with a number.
10:52:34 <mroman> ideally the name of the street should contain enough information to navigate to it without a map
10:53:01 <mroman> but people back in the days when streets were named fucked that up
10:53:32 <b_jonas> mroman: we're very far from that. we have lots of sets of streets in Budapest with identical names, which are distinguished by the district number, or very rarely not even by the district number.
10:53:33 <mroman> although some countries have systems where streets are named
10:53:40 <mroman> but blocks and houses
10:53:52 <mroman> *are not not named
10:54:17 <b_jonas> The one I hate the most is "Csömöri út", of which there are two big parallel ones very close to each other.
10:54:53 <mroman> although today with google maps and smartphones this isn't much of an issue
10:54:54 <b_jonas> There are also lots of pairs of prominent streets with not identical but very similar names.
10:55:30 <mroman> but if I think back to the older days it might have made sense to name streets in a way that people with rough knowledge of the city they live in can navigate to it
10:55:38 <b_jonas> mroman: it totally is. there's no easy way to search for a street name together with district number in google maps, unless you already know the postal code
10:55:51 <b_jonas> so ambiguous street names pose a problem in google maps.
10:56:07 <mroman> oh well, street names aren't unique among cities
10:56:18 <b_jonas> (that's probably just a bug they should fix)
10:56:24 <mroman> but they should at least be unique within a city :D
10:56:59 <b_jonas> mroman: oh, among towns they're definitely not unique. most small villages, including ones with only one or few streets, have either a Kossuth utca or Kossuth Lajos utca or a Fő utca
10:57:51 <b_jonas> You can't quite expect them to be unique within a city because of the history of Budapest where it used to be multiple towns unified at different times,
10:58:15 <b_jonas> but that doesn't explain all the duplications: many dupe street names are new or are close and were in the same town originally.
10:58:27 <mroman> well then rename streets :D
11:01:11 -!- mauris has quit (Ping timeout: 255 seconds).
11:22:12 -!- andrew has quit (Remote host closed the connection).
11:25:32 -!- MDream has changed nick to MDude.
11:28:42 -!- boily has joined.
11:37:52 <boily> @metar CYUL
11:37:52 <lambdabot> CYUL 071100Z 31006KT 15SM FEW030 M06/M12 A3031 RMK SC2 SLP267
11:38:01 <boily> shovelable weather.
11:40:25 -!- TieSoul has joined.
11:45:02 -!- TieSoul has quit (Ping timeout: 260 seconds).
11:58:04 <b_jonas> mroman: We've had lots of street renamings for political reasons, and unlike in the 1980s, lately the government has been an asshole about them, renaming the wrong streets to wrong names in wrong ways.
11:58:26 <b_jonas> I don't think we've everd had streets renamed to disambiguate streets that had already had a name.
12:00:03 <b_jonas> In particular, when they renamed streets in the 1980s and 1990s, they had left the signs of the old street name up next to the new one for a few years. Now they don't.
12:06:49 -!- boily has quit (Quit: CRYSTALLINE CHICKEN).
12:29:56 -!- bender| has joined.
12:38:35 <Taneb> Information theory exam is this evening :(
12:41:44 <b_jonas> Taneb: huh? wasn't it a formal languages exam?
12:41:59 <Taneb> b_jonas: that was someone else's that I was helping him revise for
12:42:09 <Taneb> There's a lot of exams this week
12:42:24 <b_jonas> ok.
12:45:25 <Taneb> I think I probably ought to learn information theory
12:45:54 <b_jonas> Nah, why bother.
12:49:24 <int-e> a couple of hours before the exam is a good time to remind yourself of those two or three facts that you keep forgetting :P
12:49:52 <int-e> it's a bad time to figure out what the fuck the course was about
12:50:54 <mroman> Information is measured in bits.
12:51:59 <Taneb> int-e: the lecturer had a strong accent which I had difficulty understanding, but provided quite detailed notes online, so I decided to stop going to the lectures and do it in my own time
12:52:12 <Taneb> Unfortunately, only three quarters of my actions happened
12:52:18 <Taneb> (I learnt about half the course in my own time)
12:52:27 <mroman> We had entropy, some coding theory and LFSR?
12:52:39 <mroman> Yeh, LFSR.
12:52:59 <Taneb> Coding theory is I think next term
12:53:24 <mroman> not much, just enough to know that there are block codes
12:53:59 <mroman> I'm not sure we had conv... thingies
12:54:05 <mroman> convolution codes?
12:54:18 <mroman> convolutional codes
12:57:46 <int-e> hmm, you could also move towards data compression (Huffman codes, to begin with)
12:57:53 <mroman> yeah
12:57:55 <mroman> we had that too
12:58:12 <mroman> that's the time I came up with this stupid idea of compressing data by encoding the next occurences of things
12:58:45 <mroman> well.. not stupid just not as efficient for larger files than what's already being used.
13:00:02 -!- Sprocklem has quit (Ping timeout: 276 seconds).
13:00:07 <int-e> hmm, for strings or single letters? if the latter it sounds like a move to front transformation...
13:00:18 <mroman> single letters
13:00:26 <int-e> (not exactly the same, but similar in spirit)
13:01:09 <mroman> the rough idea is
13:01:18 <mroman> <number of occurences><letter><position*>
13:01:56 <mroman> http://codepad.org/7YhvTZxq
13:02:00 <mroman> ^- like that
13:02:27 <mroman> you remove already encoded letters from the buffer
13:02:29 <int-e> (the connection is that with a MTF transform, a letter gets encoded by the number of distinct letters seen since the previous occurrence of that letter)
13:03:11 <mroman> which has the effect that letters that were originally too far apart to be encoded as next occurence (if you use n bits you have 2^n lookahead) will come close to each other
13:05:13 <mroman> (http://codepad.org/i2Z71xxh is the decompression)
13:06:21 <mroman> if you use two bits for number of occurences and three bits for position
13:06:35 <int-e> "1. Estimate the information contents of the lecture (in bits)."
13:07:03 <mroman> then you can encode at best 3 occurences of the same letter within 27 letters
13:07:15 <mroman> because once you have found a next occurence you start counting from zero again
13:07:56 <mroman> thus if you encounter a letter s, you can encode three more occurences of the same letter within a range of 27 letters each needing only three instead of 8 bits
13:08:26 <mroman> i.e. with (2,3) "This is a short sentence" can be compressed by 29 bits
13:08:38 <mroman> > 192 / 29.0
13:08:40 <lambdabot> 6.620689655172414
13:08:51 <mroman> > 29.0 / 192
13:08:53 <lambdabot> 0.15104166666666666
13:08:58 <mroman> that's about 15%
13:09:46 <int-e> > (2+8+3*3)/(4*8)
13:09:48 <lambdabot> 0.59375
13:10:43 <mroman> 40.625% is max for (2,3)
13:11:08 <mroman> at best you can get 87.5%
13:11:16 <mroman> which wasn't good to me
13:11:38 <int-e> well you get RLE as a corner case
13:11:58 <int-e> (n,0)
13:12:04 <mroman> so I enhanced the compression by adding prefixes that allow to encode more occurences
13:12:18 <mroman> or prefixes that say "next token has (4,8) instead of (2,3)"
13:12:22 <mroman> stuff like that
13:13:07 <mroman> but I managed to compress larger files only by about 50%
13:13:24 <mroman> where gzip usually at leasts manages 70%
13:13:56 <mroman> It was fun to play around in the boring lectures, but I haven't found any practical usages :D
13:14:18 <int-e> still, not bad
13:14:31 <mroman> It beats RLE.
13:14:37 <mroman> simple RLE at least
13:14:38 <mroman> because
13:14:42 <mroman> with rle stuff like
13:14:52 <mroman> ABCAABBCAAABCCBABCAB compresses poorly :)
13:15:00 <mroman> with my idea this compresses fairly well
13:15:43 <mroman> because once you encoded the A's for example
13:15:51 <mroman> you end up with BCBBCBCCBBCB
13:16:01 <mroman> then encode the Bs and you're only left with CCCCC
13:16:13 <int-e> The reason for bringing up RLE was that it can beat the 1/8 limit (in very special cases, obviously.)
13:17:18 <int-e> Special cases, hmm... PCX was a quite successful image format.
13:17:21 <mroman> hm
13:17:22 <mroman> but
13:17:33 <mroman> if you use 8 bits for number of occurences, and 1 bit for position
13:17:36 <mroman> then you have uhm
13:18:00 <int-e> > (8+8+255*1)/(256*8)
13:18:02 <lambdabot> 0.13232421875
13:18:23 -!- puckipedia has quit (Ping timeout: 260 seconds).
13:18:52 <mroman> > 1 - 0.875
13:18:53 <lambdabot> 0.125
13:18:54 <FireFly> "next occurrence of things" reminds me of perfect caching
13:19:37 <mroman> but yeah, you can't beat the 1/8 limit
13:20:02 <FireFly> 1/8 limit?
13:20:06 <int-e> > (8+8+255*0)/(256*8) -- this would be RLE, getting *very* lucky (runs of length 256)
13:20:09 <lambdabot> 7.8125e-3
13:20:32 <mroman> and (8,1) would only be reasonably if you have sequences like ABABABABABABABABABABAAABABABABABABABABABAABABABABABABABABABABAAABABABABABABAAAAAABBBBBABABABABAB
13:20:55 <mroman> (i.e. worst case for RLE)
13:21:20 <mroman> worst case for RLE is where my idea would perform pretty much best case :D
13:21:44 <mroman> except that a smart RLE would switch to encode (AA,AB,BA,BB) in this case
13:22:04 <mroman> which is something you could do with my method as well
13:22:12 <mroman> but I've never looked more into that
13:22:20 -!- puckipedia has joined.
13:22:25 <mroman> you could encode combinations of letters as well, instead of just single letters
13:22:26 <int-e> and LZ variants would just see a repetition of AB anyway...
13:22:32 <FireFly> Where does the 1/8 figure come from?
13:22:48 <mroman> basically you'd look how many times c[0] occurs, and how many times c[0],c[1] occurs
13:22:51 <int-e> FireFly: from having at least 1 bit per offset
13:23:02 <mroman> if c[0]c[1] occurs more often then you switch to encode multiple letters
13:23:20 <mroman> but that would make compression pretty slow I think
13:23:49 <FireFly> But if you have say 256 repetitions of a string s, you'd get something like s(repeat 1)(repeat 2)(repeat 4)... no?
13:23:58 <int-e> FireFly: mroman's (n,m) uses m/8 bytes per byte in the best case as n gets large.
13:24:02 <FireFly> Ah
13:24:20 <mroman> You need at least one bit for every occurence
13:24:25 <FireFly> Okay
13:31:53 <mroman> I can compress the Orly.jpg by about 15%
13:33:31 <mroman> > 39 / 47
13:33:33 <lambdabot> 0.8297872340425532
13:33:42 <mroman> > 1 - (39 / 47)
13:33:43 <lambdabot> 0.17021276595744683
13:34:51 <mroman> > 39576 * 8
13:34:52 <lambdabot> 316608
13:36:05 <mroman> well in this case my optimized approach is slighty better than gzip
13:36:48 <mroman> (better than gzip -9 )
13:37:55 <mroman> let me check lena.png
13:39:07 <mroman> 15.8% compression with my algo
13:39:13 <mroman> no compression at all with gzip o_O
13:39:42 <mroman> -rw-r--r-- 1 mroman mroman 35222 Jan 7 14:46 lena.gz
13:39:43 <mroman> -rw-r--r-- 1 mroman mroman 35185 Jan 7 14:44 lena.png
13:39:47 <mroman> well
13:41:25 <mroman> http://codepad.org/NmUc324s
13:41:46 <mroman> It can beat gzip if you use variable length encodings for occurences/positions
13:43:16 <mroman> that's weird
13:44:36 <mroman> that's gotta be a bug
13:45:36 -!- Phantom_Hoover has joined.
13:49:46 <mroman> Yeah, bug.
13:49:58 <mroman> I've never unbugged the optimized version as it seems.
13:56:02 <FireFly> I reversed a compression format some time ago with opcodes for things like "copy x bytes verbatim" or "copy x bytes from history at offset -d", but also interestingly a "copy x bytes verbatim interspersed with null bytes"
13:56:12 <FireFly> First time I see that
13:57:42 <int-e> oh cute
13:58:26 <int-e> ascii to utf-16...
13:59:26 <int-e> (windows executables are full of utf-16 strings)
14:01:14 <\oren\> `cc #include <locale.h> \n int main(void) { setlocale(LC_ALL, "sv_SE"); printf("%'.2f | ", 12340000.56); setlocale(LC_ALL, "sv_FI");
14:01:17 <\oren\> printf("%'.2f", 12340000.56); }
14:01:39 <\oren\> `cc #include <locale.h> \n int main(void) { setlocale(LC_ALL, "sv_SE"); printf("%'.2f | ", 12340000.56); setlocale(LC_ALL, "sv_FI"); printf("%'.2f", 12340000.56); }
14:02:33 <\oren\> RRRGH
14:02:46 <int-e> `cc #include <locale.h> \n int main(void) { setlocale(LC_ALL, "sv_SE"); printf("%'.2f | ", 12340000.56); setlocale(LC_ALL, "sv_FI"); printf("%'.2f", 12340000.56); }
14:03:08 <HackEgo> 12 340 000,56 | 12340000,56
14:04:05 <FireFly> int-e: yeah, or just compressing sequences of low 16-/32-bit ints
14:04:19 <\oren\> ok, so why does sweden have spaces, while finnish swedish has no-break spaces?
14:04:26 <FireFly> Good question
14:04:44 <FireFly> They should probably be non-breaking in both cases
14:04:55 <FireFly> breaking a numeral to multiple lines is just weird
14:05:16 -!- Frooxius has joined.
14:12:10 -!- mauris has joined.
14:19:16 -!- J_Arcane has joined.
14:23:35 <\oren\> `cc #include <locale.h> \n int main(void) { setlocale(LC_ALL, "hi_IN"); printf("%'.2f | ", 12340000.56); setlocale(LC_ALL, "ar_JO"); printf("%'.2f", 12340000.56); }
14:23:49 <\oren\> `cc #include <locale.h> \n int main(void) { setlocale(LC_ALL, "hi_IN"); printf("%'.2f | ", 12340000.56); setlocale(LC_ALL, "ar_JO"); printf("%'.2f", 12340000.56); }
14:23:59 <HackEgo> 12,340,000.56 | 12,340,000.56
14:24:25 <\oren\> awww, no fancy arabic or devanagari numbers?
14:24:33 <FireFly> ar_JO?
14:24:42 <\oren\> arabic, jordan
14:24:54 <FireFly> ah
14:25:23 <\oren\> i wonder what differs between different arabic countries?
14:25:44 <\oren\> `cc #include <locale.h> \n int main(void) { setlocale(LC_ALL, "ar_SA"); printf("%'.2f | ", 12340000.56); setlocale(LC_ALL, "ar_EG"); printf("%'.2f", 12340000.56); }
14:25:50 <HackEgo> 12340000.56 | 12,340,000.56
14:26:19 <\oren\> huh. saudis don't use thousands commas
14:26:33 <FireFly> 12 340 000.56 is my preferred style I think...
14:27:11 <FireFly> or I guess I'd use less than a full space to group thousands
14:27:14 <\oren\> `cc #include <locale.h> \n int main(void) { setlocale(LC_ALL, "th_TH"); printf("%'.2f | ", 12340000.56); setlocale(LC_ALL, "ar_AE"); printf("%'.2f", 12340000.56); }
14:27:15 <HackEgo> 12,340,000.56 | 12,340,000.56
14:27:53 <\oren\> i bet algeria and lebanon use . for , and , for .
14:28:07 <mroman> \oren\: you need the I flag for that
14:28:29 <mroman> `cc #include <locale.h> \n int main(void) { setlocale(LC_ALL, "th_TH"); printf("%'I.2f | ", 12340000.56); setlocale(LC_ALL, "ar_AE"); printf("%'I.2f", 12340000.56); }
14:28:30 <HackEgo> 12,340,000.56 | 12,340,000.56
14:28:36 <\oren\> `cc #include <locale.h> \n int main(void) { setlocale(LC_ALL, "DZ"); printf("%'.2f | ", 12340000.56); setlocale(LC_ALL, "ar_LB"); printf("%'.2f", 12340000.56); }
14:28:38 <HackEgo> 12340000.56 | 12,340,000.56
14:29:15 <\oren\> `cc #include <locale.h> \n int main(void) { setlocale(LC_ALL, "ar_DZ"); printf("%'I.2f | ", 12340000.56); setlocale(LC_ALL, "ar_LB"); printf("%'I.2f", 12340000.56); }
14:29:17 <HackEgo> 12,340,000.56 | 12,340,000.56
14:29:50 <\oren\> huh? really. apparently france didn't rub off on them too badly
14:29:56 <mroman> `cc #include <locale.h> \n int main(void) { setlocale(LC_ALL, "th_TH"); printf("%'I.2f | ", 12340000.56); setlocale(LC_ALL, "fa_IR"); printf("%'I.2f", 12340000.56); }
14:29:58 <HackEgo> 12,340,000.56 | ۱۲٬۳۴۰٬۰۰۰٫۵۶
14:30:04 <FireFly> Fancy
14:30:05 <b_jonas> \oren\: right, not only do they break hard eggs on the wrong end, they also write numbers wrong
14:30:07 <\oren\> NICE
14:30:23 <mroman> but fa_IR is the only locale I've found so far where I does something.
14:30:34 <b_jonas> huh? what the heck does the flag I mean in there?
14:30:40 <int-e> b_jonas: are you little endian or big endian?
14:30:56 <FireFly> Is I locale-dependent format or something?
14:31:07 <b_jonas> int-e: little-endian. definitely.
14:31:10 <\oren\> `cc #include <locale.h> \n int main(void) { setlocale(LC_ALL, "th_TH"); printf("%'I.2f | ", 12340000.56); setlocale(LC_ALL, "hi_IN"); printf("%'I.2f", 12340000.56); }
14:31:10 <b_jonas> big-endian sucks.
14:31:11 <FireFly> wait 'I
14:31:12 <HackEgo> 12,340,000.56 | १२,३४०,०००.५६
14:31:32 <int-e> b_jonas: also, from which end do you peel a banana?
14:31:37 <\oren\> hindi with I gives you fancy devanagari numbers
14:31:43 <int-e> b_jonas: I'm talking about eggs, of course.
14:32:43 <\oren\> what;s the coide for Urdu?
14:32:45 <b_jonas> int-e: I don't have a definite opinion about banana opening.
14:33:09 <b_jonas> int-e: see also https://en.wikipedia.org/wiki/Toilet_paper_orientation
14:34:12 <\oren\> `cc #include <locale.h> \n int main(void) { setlocale(LC_ALL, "ur_PK"); printf("%'I.2f", 12340000.56); }
14:34:14 <HackEgo> 12,340,000.56
14:34:24 <mroman> also it seems to be poorly documented
14:34:30 <mroman> I can't find it anywhere on gnu.org
14:34:45 <mroman> http://www.gnu.org/software/libc/manual/html_node/Integer-Conversions.html#Integer-Conversions
14:34:45 -!- callforjudgement has joined.
14:34:50 <mroman> I expected it to be mentioned here somewhore
14:34:55 <mroman> or under floating points
14:34:56 <mroman> but it's not
14:35:00 -!- callforjudgement has changed nick to ais523.
14:35:07 <\oren\> I always open a banana from the non-stem end
14:35:15 <\oren\> then put it into a blander
14:35:23 <\oren\> s/lan/len
14:36:03 <\oren\> toilet paper shouldn't even come in a cylinder
14:36:16 <mroman> REF (flag_i18n), /* for 'I' */\
14:36:17 <\oren\> it should be in fanfold
14:36:20 <mroman> but it's there in the glibc
14:36:53 <mroman> _i18n_number_rewrite
14:36:57 <mroman> which invokes this
14:37:38 -!- Sprocklem has joined.
14:37:44 <int-e> b_jonas: I like that the article ends with a reference to Knuth.
14:38:39 <mroman> outdigit = _NL_CURRENT (LC_CTYPE, _NL_CTYPE_OUTDIGIT0_MB + n);
14:47:01 <mroman> __mempcpy (__mempcpy (__mempcpy (newp, file->filename, filenamelen),
14:47:06 <mroman> that looks complicated af
14:47:14 <FireFly> "Toilet paper orientation is often mentioned as a hurdle for married couples." hmm
14:47:38 <int-e> Hah.
14:49:18 <ais523> ooh, are we talking about the best Wikipedia article?
14:57:47 -!- atslash has joined.
14:58:21 * ais523 sees a process called "aptd" running during an update
14:58:25 <ais523> apt has a daemon now?
14:58:52 <ais523> apparently so, its job seems to be permissions checks on package operations
14:59:25 <int-e> "aptd allows to perform package management tasks, e.g. installing or removing software, using a D-Bus interface." ... sounds useless
15:00:06 <ais523> d-bus does have valid uses, but I'm not sure that's one of them
15:00:56 <int-e> to me it only serves to make software less predictable (read: "smarter")
15:02:46 <ais523> well, something like unity relies on d-bus to get information about the running programs
15:08:56 <izabera> OOP spelled backwards is POO
15:09:03 <izabera> </useful info>
15:09:30 <int-e> ow
15:51:54 -!- mauris_ has joined.
15:53:09 <b_jonas> ais523: wait, I found something strange.
15:53:16 <b_jonas> ais523: M:tG card Charmed Pendant.
15:53:52 <b_jonas> from Odyssey, has a mana ability that reveals hidden info in itself, same as Selvala
15:54:35 -!- mauris has quit (Ping timeout: 255 seconds).
15:54:42 <b_jonas> ais523: also Deranged Assistant from Innistrad but at least that one adds a known amount of mana
15:55:54 <b_jonas> And Millikin, from Odyssey too. Why are there so many of these?
16:00:06 -!- mauris__ has joined.
16:00:23 <b_jonas> Incidentally, although this doesn't cause rules problems, Wheel of Sun and Moon can also be used (not only Lich's Mirror) to put cards into a library at mana ability speed.
16:01:44 -!- Lord_of_Life has quit (Excess Flood).
16:02:41 -!- mauris_ has quit (Ping timeout: 255 seconds).
16:02:45 -!- augur has quit (Remote host closed the connection).
16:03:06 -!- Lord_of_Life has joined.
16:03:17 -!- augur has joined.
16:05:34 -!- augur_ has joined.
16:05:42 -!- augur has quit (Read error: Connection reset by peer).
16:05:52 -!- augur_ has quit (Remote host closed the connection).
16:06:14 -!- mauris__ has changed nick to mauris.
16:07:18 -!- Welo has joined.
16:28:31 <HackEgo> [wiki] [[Special:Log/newusers]] create * Smurfix * New user account
16:28:32 -!- mroman has quit (Quit: Lost terminal).
16:30:31 <HackEgo> [wiki] [[Brainfuck]] M https://esolangs.org/w/index.php?diff=46095&oldid=46068 * Smurfix * (-1) de-apostrophied
17:00:18 -!- spiette has joined.
17:00:59 <b_jonas> ais523: syn
17:18:45 -!- Welo has quit (Quit: Leaving).
17:20:24 <fizzie> I think DBus for desktop notifications makes some amount of sense.
17:22:50 -!- augur has joined.
17:23:04 <fizzie> I think our workstations at the university used aptd to allow us to install what we needed without having to allow overall system-administration access, or general "sudo apt-get" privileges.
17:23:24 <fizzie> Incidentally, I noticed they had recently changed apt-get to drop privileges when it shows the changelog.
17:23:46 -!- J_Arcane has quit (Ping timeout: 250 seconds).
17:23:57 <fizzie> This wasn't the case while I was at the university; you could "sudo apt-get changelog foo" and then just "!sh" out from the less it spawned.
17:24:20 <fizzie> (In a previous installation, where they were trying to use a sudoers file that allowed apt-get to do the same sort of limited software-installation privileges.)
17:24:54 * izabera didn't know that less had !sh
17:25:05 <izabera> or !
17:25:40 <fizzie> Apparently plain '!' is already a shell, but anyway, that.
17:25:47 <fizzie> I've only used the '!foo' form.
17:26:07 <fizzie> I wonder what the aptd stuff does if you tell it to install a package over DBus, and it has to ask you a question.
17:42:56 -!- AlexR42 has quit (Quit: Textual IRC Client: www.textualapp.com).
17:45:27 <ais523> b_jonas: I'm here, sorry, and saw what you said
17:45:30 <ais523> just didn't have a reply
18:02:31 -!- vanila has joined.
18:13:43 -!- augur has quit (Remote host closed the connection).
18:17:41 <izabera> is there a way to copy a file descriptor?
18:17:46 <izabera> not like dup()
18:21:13 <izabera> i want to learn this stuff but i don't even know where to start
18:23:29 <Deewiant> http://www.mikescher.com/blog/1/Project_Euler_with_Befunge
18:45:24 <fizzie> izabera: If not like dup, then like what?
18:45:55 <izabera> like if i read from fd1 i don't want the position to change in fd2
18:47:20 <fizzie> Then, no, that's not possible in general. (What if it's a socket or a pipe?)
18:47:46 <izabera> well i know that
18:48:22 <fizzie> If it's a file, you can open the same file again. Very non-portably, /proc/$pid/fd/$N could help you find it if you don't remember what it was.
18:49:03 <izabera> so i open it again, with the same flags, and then seek to the current offset
18:49:04 <izabera> gotcha
18:49:33 <izabera> i was just hoping it'd be possible to copy the internal file descriptor structure
19:19:53 -!- hppavilion[2] has joined.
19:19:56 -!- hppavilion[2] has changed nick to hppavilion[1].
19:20:03 <hppavilion[1]> I've never seen an imperative language with Prolog-like rules instead of functions
19:23:56 <vanila> are you just doing X + prolog until you find an interesting one?
19:33:20 -!- esowiki has joined.
19:33:25 -!- esowiki has joined.
19:33:25 -!- esowiki has joined.
19:34:01 -!- esowiki has joined.
19:34:05 -!- esowiki has joined.
19:34:06 -!- esowiki has joined.
19:34:41 -!- esowiki has joined.
19:34:45 -!- esowiki has joined.
19:34:46 -!- esowiki has joined.
19:35:21 -!- esowiki has joined.
19:35:25 -!- esowiki has joined.
19:35:26 -!- esowiki has joined.
19:36:24 -!- esowiki has joined.
19:36:28 -!- esowiki has joined.
19:36:29 -!- esowiki has joined.
19:37:20 -!- esowiki has joined.
19:37:24 -!- esowiki has joined.
19:37:25 -!- esowiki has joined.
19:38:10 -!- esowiki has joined.
19:38:14 -!- esowiki has joined.
19:38:15 -!- esowiki has joined.
19:39:01 -!- esowiki has joined.
19:39:05 -!- esowiki has joined.
19:39:06 -!- esowiki has joined.
19:40:04 -!- esowiki has joined.
19:40:06 -!- glogbot has joined.
19:40:06 <?unknown?> [freenode-info] channel flooding and no channel staff around to help? Please check with freenode support: http://freenode.net/faq.shtml#gettinghelp
19:40:08 -!- esowiki has joined.
19:40:09 -!- esowiki has joined.
19:43:04 -!- lambdabot has joined.
19:43:48 -!- sewilton_ has changed nick to sewilton.
20:16:36 -!- mauris_ has joined.
20:19:04 <hppavilion[1]> Are there any fixities beyond Prefix, Postfix, Infix, Circumfix, Postcircumfix, Precircumfix, and Incircumfix
20:19:04 <hppavilion[1]> ?
20:19:44 -!- mauris has quit (Ping timeout: 245 seconds).
20:19:46 <int-e> I hope not, that's starting to sound dirty already.
20:20:15 <izabera> i don't even know what the last ones are
20:21:13 <ais523> izabera: postcircumfix is a[b] or a.(b), that sort of thing
20:21:24 <ais523> precircumfix is presumably the mirror image of that
20:21:30 <ais523> and incircumfix is something that hppavilion[1] made p
20:21:31 <ais523> *made up
20:21:54 <hppavilion[1]> ais523: I didn't make it up
20:22:00 <hppavilion[1]> x?y:z is incircumfix
20:22:11 <hppavilion[1]> And so is x[y]z, which is one notation for the Hyperoperations
20:22:13 <ais523> hppavilion[1]: then what's x?y(z) ?
20:22:51 <hppavilion[1]> ais523: That is actually x OR y(z), where y(z) is function application, which may or may not be an operation
20:23:11 <hppavilion[1]> ? being random selection in this case, though it could certainly mean something else
20:23:21 <ais523> hppavilion[1]: no, I mean what's its fixity
20:23:29 <hppavilion[1]> ais523: It's not a single operator
20:23:42 <ais523> hppavilion[1]: suppose it is a single operator
20:23:48 <ais523> say it's some esolang's notation for x?y:z
20:24:01 <hppavilion[1]> ais523: Otherfix
20:24:16 <izabera> bugfix
20:24:17 <hppavilion[1]> xD
20:24:27 <hppavilion[1]> infix->circumfix?
20:25:17 <hppavilion[1]> I suppose Appfix
20:25:38 <hppavilion[1]> Not for x?y(z), but as a fixity
20:26:46 <izabera> this is starting to look like c code written by a drunk monkey
20:39:38 <b_jonas> ais523: I think that's probabl x?(y(z)) where x? is a function name
20:39:49 <b_jonas> ais523: in ruby, function names can end in ? or ! or =
20:40:03 <b_jonas> and the syntax has some crazy irregular rules for everything
20:41:01 <b_jonas> at least, that's what it looks like to me
20:41:17 <b_jonas> or else it could be x ? (y(z)) where ? is an infix operator
20:44:07 -!- bb010g has joined.
20:50:18 <fizzie> Duplifix.
20:50:47 <fizzie> It's one of the "positional categories of affixes" table entries in Wikipedia. It's not talking about operators, mind you.
20:51:06 <fizzie> Prefix, suffix/postfix, suffixoid/semi-suffix, infix, circumfix, interfix, duplifix, transfix, simulfix, suprafix, disfix.
20:52:56 <fizzie> `` words 20 | sed -re 's/( |$)/fix\1/g'
20:52:58 <HackEgo> parumfix rftfix villfix olenicfix guibilifix ordamanirvifix cbadornerefix obernofix volutfix aucerdenkofix magnafix tinfix broadfix bergafix caseymafix exterfix samunufix runcifix fidtfix tralefix
20:53:27 <fizzie> Just as believable.
20:53:38 <fizzie> Especially exterfix.
21:01:26 <mauris_> broadfix could definitely be a thing
21:10:31 <fizzie> Willfix and wontfix.
21:27:37 <hppavilion[1]> I just realized
21:27:56 <hppavilion[1]> One could treat (x) as a circumfix operator that returns its argument
21:33:27 -!- hppavilion[1] has quit (Ping timeout: 265 seconds).
21:56:36 -!- tjt263 has joined.
21:59:18 -!- tjt263 has left.
22:01:27 <FireFly> Yeah, I implemented parentheses as a circumfix identity operator in a toy language I created once
22:01:36 -!- hppavilion[1] has joined.
22:02:16 <FireFly> I could see that approach being useful in things like Agda with mixfix operators/functions too
22:08:31 <hppavilion[1]> I suppose one could also treat , as an operator, as in [x, y, z]
22:08:45 <hppavilion[1]> A minimum-precedence operator that builds arrays
22:09:07 <hppavilion[1]> And [] takes such an array and turns it into a list
22:13:25 -!- vanila has quit (Quit: Leaving).
22:16:39 <FireFly> Eh.
22:16:42 <FireFly> Maybe
22:17:10 <FireFly> In Python , is an operator, but [a,b,c] is separate from that
22:23:16 <mauris_> pretty sure , isn't an operator?
22:23:59 <mauris_> like 3,2 is an exprlist, not an expr https://docs.python.org/2/reference/grammar.html
22:24:11 <mauris_> and you can't overload it they way you have __add__, __mul__...
22:24:20 <myname> print('.'),
22:27:13 -!- Mongoose has joined.
22:30:01 -!- Mongoose has left ("Au Revoir").
22:30:31 -!- spiette has quit (Quit: :qa!).
22:35:39 <FireFly> Hm
22:36:15 <FireFly> I thought it was a tuple-forming operator (but not overloadable), guess that's not how it works
22:44:29 <fizzie> C has a proper operator called ',', but most commas in C source probably aren't instances of it, because there are also commas in argument, initializer and declarator lists (among others), which are more common.
22:48:39 <fizzie> And Forth has a , word that's (presumably) chosen because it makes lists like 123 , 456 , 789 , look somewhat natural.
22:50:18 -!- hppavilion[1] has quit (Ping timeout: 265 seconds).
22:50:55 -!- hppavilion[1] has joined.
22:52:35 <FireFly> Oh right, I think Qt overload the comma operator in C++ for its list type to append elements to a list, too
22:52:43 <FireFly> Which is pretty horrible, but still
22:53:31 <fizzie> An overloaded comma operator no longer has the sequence point properties of the real comma.
22:53:55 <hppavilion[1]> The language I'm currently working on is called Irgex :)
22:54:07 <olsner> doesn't it get some of those properties through argument evaluation when each comma operator is a function call?
22:54:11 <hppavilion[1]> It's basically Regex generalized to the level of TCness, or at least that's the pan
22:55:40 <fizzie> olsner: I guess, but the evaluation order isn't specified.
22:59:00 -!- hppavilion[1] has quit (Ping timeout: 265 seconds).
23:01:54 -!- augur has joined.
23:02:29 -!- augur has quit (Remote host closed the connection).
23:03:02 -!- augur has joined.
23:03:29 -!- augur has quit (Remote host closed the connection).
23:03:44 -!- augur has joined.
23:10:08 -!- atslash has quit (Quit: Leaving).
23:18:16 -!- oerjan has joined.
23:22:56 <tswett> I never remember what the comma operator in C does.
23:23:22 <oerjan> @metar ENVA
23:23:22 <lambdabot> ENVA 072250Z 11009KT CAVOK M15/M20 Q1007 RMK WIND 670FT 10010KT
23:23:25 <izabera> if (something) expr1 , expr2; == if (something) { expr1; expr2; }
23:23:30 <fizzie> "The left operand is evaluated as a void expression; there is a sequence point between its evaluation and that of the right operand. Then the right operand is evaluated; the result has its type and value."
23:23:57 <oerjan> i think the airport is a bit colder than here
23:24:19 <fizzie> @metar EFHK
23:24:19 <lambdabot> EFHK 072320Z VRB01KT CAVOK M28/M30 Q1015 NOSIG
23:24:24 <fizzie> That's getting ridiculous.
23:24:39 <fizzie> @metar EGLL
23:24:39 <lambdabot> EGLL 072320Z AUTO 21007KT 9999 NCD 03/00 Q1000 NOSIG
23:24:45 <oerjan> @metar ENRO
23:24:45 <lambdabot> ENRO 072250Z AUTO VRB02KT 9999NDV OVC008/// M22/M24 Q1001
23:24:59 <oerjan> darn helsinki beats røros
23:25:20 <oerjan> (røros is the default "cold as ..." place in norway.)
23:25:33 <fizzie> It's colder in Helsinki than it is in some parts of Lapland at the moment.
23:25:52 <oerjan> @metar ENSB
23:25:53 <lambdabot> ENSB 072250Z 11014KT CAVOK M11/M17 Q1021 RMK WIND 1400FT 09020KT
23:25:58 <fizzie> @metar EFRO
23:25:59 <lambdabot> EFRO 072320Z AUTO 32007KT 9999 FEW019 BKN080 BKN100 M26/M28 Q1006
23:26:02 <oerjan> svalbard is warmer :P
23:26:11 <oerjan> rovaniemi?
23:26:14 <fizzie> Yes.
23:26:54 <oerjan> @metar NZSP
23:26:55 <lambdabot> NZSP 072250Z 13005KT 9999 SCT030 M29/ A2851 RMK CLN AIR 13004KT ALL WNDS GRID SDG/HDG
23:26:59 <fizzie> It's not really a "cold as ..." place, but it's the standard "the northernmost place that has lots of people in it" place, I'd say.
23:27:10 -!- Phantom__Hoover has joined.
23:28:11 -!- Phantom_Hoover has quit (Ping timeout: 255 seconds).
23:28:40 <oerjan> the south pole seems to have no dew point
23:28:47 <oerjan> balmy summer temps
23:29:00 <fizzie> They broke the all-time electricity use record in Finland today.
23:30:49 <fizzie> And also measured -41.1 degrees in Muonio.
23:31:15 <fizzie> I don't know if there are any airports nearby, and many places have already started getting warmer, I think -- the whole country's supposed to, in the next days.
23:32:02 <fizzie> @metar EFET
23:32:03 <lambdabot> EFET 072320Z AUTO 00000KT 2200 -SN OVC027 ///// Q////
23:32:19 <fizzie> Well, there's apparently no temperature at all in Enontekiö.
23:32:50 <oerjan> is there any air pressure?
23:33:05 <oerjan> maybe they have a vacuum problem.
23:33:05 <fizzie> I think that would've been the Q//// field.
23:33:11 <fizzie> Seems that way.
23:33:29 <fizzie> No wind, either.
23:33:37 -!- boily has joined.
23:33:40 <fizzie> Still some clouds in the sky, though.
23:33:54 <oerjan> brrohily
23:36:30 <boily> *munch* *munch* rjan
23:36:47 <boily> (there's a sandwich in my mouth)
23:39:35 <shachaf> whoa whoa whoa
23:39:38 <shachaf> Undertale is TG.
23:39:54 -!- J_Arcane has joined.
23:40:42 <boily> *munchaf*
23:40:56 <boily> what's undertale, and why are they transgender?
23:41:13 <shachaf> boily: baron munchausen?
23:41:30 <shachaf> boily: it's a game at http://undertale.com/ , and it's too good.
23:43:02 <boily> baron munchausen had an operation?
23:43:14 <boily> pixels! must resist the appeal...
23:43:37 <shachaf> boily: what you must resist is spoilers
23:43:52 <shachaf> this is a very spoilable game. don't make the mistake i did. just don't read anything about it.
23:45:29 -!- hppavilion[1] has joined.
23:47:16 <boily> I'll continue what I'm doing, and having had the tab closed since a few bites ago, I'm at no reasonable risk of being spoiled.
23:47:24 <boily> hppavellon[1].
23:47:30 <boily> @metar CYUL
23:47:30 <lambdabot> CYUL 072300Z 00000KT 15SM FEW120 SCT160 BKN240 M01/M06 A3028 RMK AC2AC1CI2 SLP256
23:47:36 <boily> -1. not so bad.
23:58:19 <hppavilion[1]> Wel.
23:58:21 <hppavilion[1]> *Well.
23:58:39 <boily> Well?
23:58:47 <hppavilion[1]> The wiki article on Al-Qaeda has a section titled "Criticism"
←2016-01-06 2016-01-07 2016-01-08→ ↑2016 ↑all