←2019-09-05 2019-09-06 2019-09-07→ ↑2019 ↑all
00:00:00 <b_jonas> fizzie: do they fight some other animal then?
00:02:24 <fizzie> Right. For us, the preliminary examination result is a statement that either you can defend as-is (pretty rare), requires minor revisions (most common; something you can do in a few weeks and doesn't need a full recheck) or requires major revisions (expected to take months, needs to be resubmitted for a full re-examination).
00:02:49 <fizzie> Actually, pretty similar as how journal paper reviews go.
00:03:03 <b_jonas> this one is fun: https://www.youtube.com/watch?v=uiyz1IYEFtI marathon speedrun of a Game Boy Advance game, the problem being that the game requires motion controls, but on that console, recording the video output and motion controls are hard to do at the same time
00:05:10 <ais523> fizzie: here it's anywhere from "no corrections" (never happens in practice), "minor corrections" (3 months, a very common result, it's what my PhD had), "major corrections" (6 months, situations where the corrections may require new maths), "resubmit" (1 year, it means serious problems with the original but they'll give you another chance), equivalents of all those for a lesser degree ("this isn't PhD-worthy but it is worth a Masters' degree"), and
00:05:11 <ais523> outright rejection
00:07:04 <fizzie> How commonly do PhD candidates not already have a Masters' degree?
00:07:10 <b_jonas> is there one for greater degrees too, where the thesis is so impressed they decided that the candidate is chosen to become dictator for life on the spot?
00:07:28 <b_jonas> fizzie: I'd guess ones who come from the US might not have one
00:07:36 <b_jonas> their system is weird
00:08:02 <ais523> fizzie: well there's nothing preventing you getting /two/ Masters' degrees, although that might not be a preferred outcome
00:08:37 <b_jonas> but here too a master's degree is technically not a requirement for the thesis, you only need it in practice because that's the only way you can get a scholarship that lets you do research and study to be able to write a thesis
00:08:52 <shachaf> Transportation for life, and then to be fined forty pound.
00:09:20 <b_jonas> ais523: sure, but they can't just award a master's degree, right? they can only award the thesis part, while the candidate would need to satisfy all the other requirements too
00:09:38 <ais523> "Masters by research" is a recognised qualification, that can be done off just a single thesis
00:09:50 <shachaf> Hmm, should I go to graduate school?
00:09:56 <ais523> a PhD thesis would in theory qualify for it but normally you'd want the PhD instead
00:10:09 <ais523> shachaf: where are you? the US? probably not, you're highly likely to be overcharged
00:10:26 <b_jonas> shachaf: https://www.xkcd.com/498/
00:11:04 <b_jonas> shachaf: do you have a masters?
00:11:26 <ais523> xkcd was pretty different back then
00:11:37 <shachaf> ais523: I'm in the US but presumably I could go anywhere.
00:11:44 <shachaf> b_jonas: I don't.
00:11:52 <b_jonas> shachaf: would you like to get a job for which a PhD degree is a strong advantage, which are mostly jobs at a university or at state-sponsored research institutes?
00:12:15 <shachaf> I don't know.
00:12:39 <b_jonas> ais523: yes. I recommend reading SMBC, which is still similar to what xkcd used to be like in its classic era
00:12:43 <shachaf> Another fact is that I don't have a bachelor's degree.
00:12:56 <b_jonas> only more colorful
00:13:32 <b_jonas> shachaf: that part is easier to fix
00:13:38 -!- oerjan has quit (Quit: Nite).
00:13:47 <shachaf> Is it?
00:13:57 <b_jonas> yes, it's easier to get a bachelors degree than a masters degree
00:14:19 <ais523> b_jonas: I don't really like old xkcd; I don't normally like new xkcd either but sometimes it's very good
00:14:36 <b_jonas> ais523: which of the new ones do you like?
00:15:30 <ais523> the one before the current one was fairly good
00:15:38 <ais523> there's one that's slightly older that was better but I can't remember which one
00:15:59 <b_jonas> Game Show? dunno, I don't much like that one
00:16:16 <ais523> oh right, https://xkcd.com/2189/ is very good
00:16:30 <ais523> xkcd is mostly observational humour, so I mostly enjoy it when the observation is interesting / thought-provoking
00:16:48 <b_jonas> that's not my style either, but ok
00:17:00 <b_jonas> 2189 that is
00:17:08 <b_jonas> observational humor may be fine
00:17:15 <ais523> in that case, the set of xkcds we like is possibly disjoint
00:17:20 <ais523> not that that's necessarily a problem
00:17:40 <b_jonas> I don't claim that all the new ones are bad, I just prefer the classic ones in average
00:17:55 <b_jonas> I still do look at every new xkcd, I haven't stopped looking
00:18:07 <b_jonas> but prefer other comics now
00:18:18 <b_jonas> yeah, part of that is other comics having become better
00:19:02 <shachaf> Is Dennis Skinner everyone's favorite MP?
00:19:24 <ais523> I think there's quite some variety in favourite MPs
00:19:36 <ais523> many people's favourite MP is the one representing their own constituency, of course
00:19:48 <ais523> but there are quite a lot of interesting personalities in the House of Commons
00:19:55 <b_jonas> eww no way
00:20:05 <b_jonas> I still vote for the part of the city that has ruined the city park
00:20:23 <b_jonas> that's where I spent all my childhood, and now it pains me any time I go there
00:20:50 <b_jonas> so I can't feel patriotic to my election district
00:21:06 <shachaf> Presumably Lord Buckethead is everyone's favowrite Lord.
00:22:05 <b_jonas> alternately, it wasn't them who ruined it, because local governments don't have any power anymore, everything is done centrally, in which case there's no point being patriotic to any district government
00:23:07 <ais523> Lord Buckethead isn't actually a Lord (if he were, he wouldn't be able to run for the Commons)
00:23:17 <ais523> also, he isn't the same Lord Buckethead that became famous, there was an IP dispute
00:23:26 <ais523> (it's hard to tell that the person beneath the bucket has changed, though)
00:23:54 <b_jonas> but that's why only very few independents get into the parliament, people vote to support a party in the parliament rather than to support a person supposedly representing their district
00:24:22 <ais523> we normally get maybe 1 or 2 independents elected per election cycle in the UK
00:24:46 <ais523> it's difficult to win as an independent because you don't have a party's advertising / canvassing might behind you
00:25:02 <ais523> and because FPTP discourages voting for people who have little chance of winning
00:25:25 <ais523> but if an independent is considered a serious candidate in a constituency, they may well end up winning if people dislike their main competitors
00:27:15 <shachaf> Until recently I thought most Lords in the House of Lords were hereditary.
00:27:17 <b_jonas> wait what? there's a member of the parliament with a bucket on their head? but isn't that impossible because of https://stickman.qntm.org/comics.php?n=622 ?
00:27:40 <shachaf> But apparently that's only a small fraction of them.
00:27:53 <shachaf> The rest are appointed, but it's not clear to me exactly how the appointment works.
00:27:57 <b_jonas> exactly, just one or two independets at any time
00:27:57 <ais523> b_jonas: no, Lord Buckethead is a persistent /candidate/ to be an MP but has never won
00:28:03 <ais523> nor come remotely close to winning
00:28:14 <b_jonas> I think there's only one right now
00:28:19 <shachaf> Sometimes it's by the Prime Minister, but sometimes by a committee?
00:28:34 <shachaf> And appointments are for life. Should I think of it like US Supreme Court appointments?
00:28:55 <b_jonas> ais523: so they'd remove the bucket if they became an MP?
00:29:04 <ais523> think of it like life appointments to a really big advisory body that parliament calls on, that's what the Lords basically are at this point
00:29:13 <ais523> b_jonas: either that, or immediately resign
00:29:32 <b_jonas> ah yes, that can work too
00:29:50 <ais523> the normal life-cycle of a law has the Commons design it and the Lords work out the details (and/or say "are you sure?"); the Lords can't block a bill but can delay it
00:30:27 <b_jonas> I think the non-serious party here was once asked what they'd do if they gained majority in the parliament (they never had anything near the chance for that), and whoever they asked said that they'd resign and call for a new election
00:30:40 <shachaf> I guess the House of Lords is much weaker than e.g. the US Senate nowadays.
00:30:43 <ais523> so the Lords are a combination of hereditary peers which are families that have been Lording for generations (advantage: people can be educated specifically for the position; disadvantage: somewhat undemocratic), former MPs, and business/scientific leaders
00:30:47 <shachaf> Despite being called an "upper house".
00:30:54 <shachaf> I suppose that wasn't the case in the past.
00:31:23 <ais523> the Lords used to be equal to the Commons, but there was a constitutional crisis in the early 20th century which lead to the commons being given an override
00:32:55 <shachaf> Apparently bishops have priority over other humans in the House of Lords? What a scam.
00:33:09 <ais523> (for budgets, the override triggers automatically after 1 month if agreement hasn't been reached; for anything else, the Commons need to attempt to pass the same law twice a year apart and then intentionally trigger it)
00:33:41 <ais523> being able to delay bills by a year is fairly powerful and gives the Commons lots of tiime to reconsider, but means that the Lords have no final say on almost anything
00:33:57 <b_jonas> shachaf: I don't think "upper" means it should be stronger. it means the same as "Lords", that is, representing the upper classes of society
00:33:57 <shachaf> Hmm, MP terms are normally 5 years?
00:34:13 <ais523> (the exception: any attempt to increase the length of time between elections to more than 5 years needs to be approved by both the Commons and Lords, no override available)
00:34:15 <ais523> shachaf: right
00:35:10 <shachaf> b_jonas: I don't think "upper" means that it's stronger in any case.
00:35:25 <b_jonas> it does in cards
00:35:44 <b_jonas> because it's representing a single person, not a whole house
00:35:58 <b_jonas> well, as much as cards represent people
00:36:06 <b_jonas> they're abstract stuff decorated with people
00:36:09 <ais523> the funny thing is, one of the only times the override was actually used was to change the time limit on using the override from two years to one year
00:36:28 <b_jonas> lol
00:36:37 <ais523> or, not a time limit, it's the opposite of a limit
00:37:10 <b_jonas> reasonable, that's the sort of topic that they're definitely familiar with so qualified to make rules about
00:48:03 -!- xkapastel has quit (Quit: Connection closed for inactivity).
01:26:23 -!- ais523 has quit (Quit: quit).
03:03:02 <Lykaina> b_jonas: hi
03:05:43 <Lykaina> b_jonas: yeah, the spec was originally designed for my personal reference
03:06:21 <Lykaina> i'll have to clarify a lot of stuff before it is ready for the wiki
03:09:01 <Lykaina> ready for the wiki as in directly explaining it on the wiki page
03:10:42 <Lykaina> current thing is modifying the subroutine code to make it easier to reuse them
03:11:20 <Lykaina> that's { N , & , -- }
03:11:41 <Lykaina> those commands are affected
03:28:25 <esowiki> [[Super Stack]] N https://esolangs.org/w/index.php?oldid=65990 * Dtuser1337 * (+26) Redirected page to [[Super Stack!]]
04:12:02 -!- rodgort has quit (Quit: Leaving).
04:16:17 -!- rodgort has joined.
05:02:53 <esowiki> [[Echidna]] https://esolangs.org/w/index.php?diff=65991&oldid=65989 * Lykaina * (-3) updating with newest interpreter link.
05:10:23 <esowiki> [[Echidna]] https://esolangs.org/w/index.php?diff=65992&oldid=65991 * Lykaina * (+22) doing a little formatting.
06:27:44 <kmc> http://kickjava.com/src/com/sun/java/swing/plaf/nimbus/InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneMaximizeButtonWindowNotFocusedState.java.htm
06:28:19 <shachaf> Is this autogenerated code?
06:40:11 <kmc> who knows, man
06:44:56 <shachaf> kmc: My friend is very irritated at everything about this post: https://softwareengineering.stackexchange.com/questions/394399/managing-and-organizing-the-massively-increased-number-of-classes-after-switchin
06:46:20 -!- Frater_EST has joined.
07:16:54 <esowiki> [[Special:Log/newusers]] create * Peti345 * New user account
07:21:01 <b_jonas> ah great, another company that buys into design patterns and best practices instead of just writing reasonable code
07:21:31 <b_jonas> though on the plus side, they are writing tests
07:22:20 -!- nfd9001 has joined.
07:37:48 -!- Frater_EST has left.
07:39:46 -!- b_jonas has quit (Quit: leaving).
08:15:33 -!- cpressey has joined.
08:18:52 -!- nfd has joined.
08:22:11 -!- nfd9001 has quit (Ping timeout: 268 seconds).
08:36:47 -!- wob_jonas has joined.
08:41:15 <cpressey> > (foldl (flip (.)) id [\x -> x+1, \x -> x*2, \x -> x*x]) 4
08:41:17 <lambdabot> 100
08:41:25 <cpressey> (appEndo $ getDual $ mconcat $ map (Dual . Endo) [\x -> x+1, \x -> x*2, \x -> x*x]) 4
08:41:35 <cpressey> > (appEndo $ getDual $ mconcat $ map (Dual . Endo) [\x -> x+1, \x -> x*2, \x -> x*x]) 4
08:41:37 <lambdabot> 100
08:42:32 * cpressey mumbles something about a monoid at an informal gathering of endofunctions
08:43:49 <shachaf> @quote appendo
08:43:50 <lambdabot> quicksilver says: 'appEndo' sounds like a harry potter spell
08:43:51 <shachaf> @quote appendo
08:43:52 <lambdabot> hpc says: appEndo sounds like a harry potter spell
08:43:59 <shachaf> hmm
08:44:03 <shachaf> suspicious
08:44:39 <shachaf> > foldr ($) 4 [\x -> x+1, \x -> x*2, \x -> x*x]
08:44:42 <lambdabot> 33
08:44:57 -!- Lord_of_Life_ has joined.
08:44:59 <cpressey> appendo sounds like it would be an introductory minikanren example
08:45:01 <shachaf> > foldl (&) 4 [\x -> x+1, \x -> x*2, \x -> x*x]
08:45:04 <lambdabot> 100
08:47:58 -!- Lord_of_Life has quit (Ping timeout: 245 seconds).
08:48:03 -!- Lord_of_Life_ has changed nick to Lord_of_Life.
08:48:10 <wob_jonas> only because of the video game that has a "flippendo" spell, it doesn't sound like a book-canon spell name
08:49:31 <shachaf> That wasn't the quote I was looking for anyway.
09:13:03 <cpressey> @hoogle &
09:13:03 <lambdabot> Data.Function (&) :: a -> (a -> b) -> b
09:13:03 <lambdabot> Control.Lens.Lens (&) :: () => a -> (a -> b) -> b
09:13:03 <lambdabot> Control.Lens.Operators (&) :: () => a -> (a -> b) -> b
09:27:23 <wob_jonas> apparently python regexes *almost* the same syntax as perl regexen. there's one important difference, but that one is among the most frequent things I write in a regex:
09:27:35 <wob_jonas> perl's /\z/ corresponds to python's r"\Z"
09:27:50 <shachaf> oh no
09:27:54 <wob_jonas> luckily if I mess it up, r"\z" gives an unconditional error
09:28:06 <wob_jonas> and I don't think I ever want to write perl's \Z specifically
09:28:14 <wob_jonas> or at least never without thinking a lot
09:30:17 <wob_jonas> the other incompatibility is making named capture groups
09:30:45 <wob_jonas> it's possible that some of these differences come from ancient historical reasons of course, because python has old roots and evolved parallel to perl
09:40:06 -!- nfd9001 has joined.
09:42:23 -!- Bowserinator has quit (Quit: Blame iczero something happened).
09:42:42 -!- Bowserinator has joined.
09:42:52 -!- nfd has quit (Ping timeout: 276 seconds).
09:54:34 <wob_jonas> oh yeah, I almost forgot this one! in windows, you need to add an extra double quote at the start of the command for the libc system function to work
10:10:20 -!- nfd has joined.
10:10:27 <cpressey> Are there any examples of using one language's package system to distribute packages for some other language?
10:11:01 <shachaf> Ugh, the idea of "a language's package system" is so bad in the first place.
10:11:11 <cpressey> I know right?
10:11:44 <shachaf> Time to give up on all software.
10:12:32 -!- nfd9001 has quit (Ping timeout: 245 seconds).
10:28:22 -!- arseniiv has joined.
10:36:56 -!- nfd9001 has joined.
10:38:18 <wob_jonas> shachaf: good. so when do we start the rebelion to destroy all thinking machines?
10:38:47 -!- nfd has quit (Ping timeout: 245 seconds).
10:41:28 -!- nfd has joined.
10:43:23 -!- nfd9001 has quit (Ping timeout: 245 seconds).
10:46:44 -!- nfd9001 has joined.
10:49:38 -!- nfd has quit (Ping timeout: 245 seconds).
10:50:53 -!- nfd has joined.
10:53:22 -!- nfd9001 has quit (Ping timeout: 245 seconds).
11:00:53 -!- nfd has quit (Ping timeout: 245 seconds).
11:00:57 -!- nfd9001 has joined.
11:05:27 -!- nfd has joined.
11:08:04 -!- nfd9001 has quit (Ping timeout: 268 seconds).
11:20:22 -!- nfd9001 has joined.
11:20:28 -!- nfd has quit (Ping timeout: 245 seconds).
11:26:37 -!- wob_jonas has quit (Remote host closed the connection).
11:28:28 -!- xkapastel has joined.
11:37:32 -!- nfd has joined.
11:40:03 -!- nfd9001 has quit (Ping timeout: 245 seconds).
11:51:14 -!- nfd has quit (Ping timeout: 268 seconds).
12:44:33 -!- Frater_EST has joined.
12:59:55 -!- Lykaina has quit (Quit: leaving).
13:18:13 -!- Melvar has quit (Ping timeout: 246 seconds).
13:27:45 -!- jglewd2641 has joined.
13:28:16 -!- jglewd2641 has quit (Remote host closed the connection).
13:31:58 -!- Melvar has joined.
14:41:14 -!- Frater_EST has left.
15:41:22 <esowiki> [[Echidna]] https://esolangs.org/w/index.php?diff=65993&oldid=65992 * Lykaina * (+0) updating with newest interpreter link.
15:47:27 <esowiki> [[Talk:Binary to unary conversion]] https://esolangs.org/w/index.php?diff=65994&oldid=65982 * CarlosLuna * (+399) Adding an Unary to binary (arbitrary precision) conversion algorithm
15:50:46 <esowiki> [[Drawkcab]] https://esolangs.org/w/index.php?diff=65995&oldid=53052 * Gamer * (+82)
15:51:19 <esowiki> [[Drawkcab]] M https://esolangs.org/w/index.php?diff=65996&oldid=65995 * Gamer * (+0)
15:57:45 <esowiki> [[Drawkcab]] https://esolangs.org/w/index.php?diff=65997&oldid=65996 * Gamer * (+59)
15:59:07 <esowiki> [[Drawkcab]] https://esolangs.org/w/index.php?diff=65998&oldid=65997 * Gamer * (+20)
16:13:18 <cpressey> int-e: http://hackage.haskell.org/package/MonadPrompt-1.0.0.5/docs/Control-Monad-Prompt.html is making my brain hurt. Do you still have the solitaire game example? http://int-e.home.tlink.de/haskell/solitaire.tar.gz is broken.
16:14:06 <cpressey> http://paste.lisp.org/display/53766 is also broken
16:14:53 <esowiki> [[Drawkcab]] https://esolangs.org/w/index.php?diff=65999&oldid=65998 * Gamer * (+284) /* Examples */
16:15:08 <esowiki> [[Drawkcab]] https://esolangs.org/w/index.php?diff=66000&oldid=65999 * Gamer * (+6) /* drawkcaB 3 nohtyP */
16:15:27 <esowiki> [[Drawkcab]] https://esolangs.org/w/index.php?diff=66001&oldid=66000 * Gamer * (+8) /* drawkcaB ++C */
16:15:34 <int-e> cpressey: good question
16:16:10 <esowiki> [[Drawkcab]] M https://esolangs.org/w/index.php?diff=66002&oldid=66001 * Gamer * (+0) /* Concept */
16:17:20 <cpressey> No hurry, it will probably take me several weeks to wrap my head around this
16:18:40 <int-e> cpressey: https://int-e.eu/~bf3/haskell/solitaire.tar.gz in full bit-rotted glory... (February 2008)
16:19:08 <cpressey> int-e: awesome, thank you very much
16:20:57 -!- Camto[m] has quit (Remote host closed the connection).
16:21:11 -!- ivzem[m] has quit (Remote host closed the connection).
16:21:11 -!- xylochoron[m] has quit (Read error: Connection reset by peer).
16:21:21 -!- wmww has quit (Read error: Connection reset by peer).
16:21:22 -!- tswett[m] has quit (Read error: Connection reset by peer).
16:26:43 -!- cpressey has quit (Quit: A la prochaine.).
16:32:45 -!- Camto[m] has joined.
16:34:17 <int-e> @tell cpressey that was actually pretty painless to fix: https://int-e.eu/~bf3/haskell/solitaire-0.0.0.tar.gz
16:34:17 <lambdabot> Consider it noted.
16:54:05 -!- tswett[m] has joined.
16:54:05 -!- xylochoron[m] has joined.
16:54:05 -!- wmww has joined.
16:54:13 -!- ivzem[m] has joined.
16:57:47 -!- FreeFull has joined.
17:04:51 -!- b_jonas has joined.
17:26:44 <b_jonas> my hon. and learned friend fungot, what color of raisins do you prefer?
17:26:44 <fungot> b_jonas: pick me, pick me!
17:26:58 <b_jonas> fungot: I pick you
17:26:59 <fungot> b_jonas: i'm a teenage male interested in programming who recently found out about it is hurting?
17:27:07 <b_jonas> um
17:28:13 -!- xkapastel has quit (Quit: Connection closed for inactivity).
17:32:57 <int-e> ^style
17:32:57 <fungot> Available: agora alice c64 ct darwin discworld enron europarl ff7 fisher fungot homestuck ic irc* iwcs jargon lovecraft nethack oots pa qwantz sms speeches ss wp ukparl youtube
17:33:27 <int-e> thought so, but where did fungot pick up such language...
17:33:27 <fungot> int-e: i don't remember henna facepaint in wizard of earthsea.) define a macro in a standard latex command. well, the problem i'm having is at fnord
17:34:13 <int-e> b_jonas: tbf you started with a trick question
17:35:09 <shachaf> b_jonas: Oh, when you address fungot as "my hon. and learned friend", that means you and fungot are both MPs, and fungot is also a lawyer, but not a member of the Privy Council. Is that right?
17:35:10 <fungot> shachaf: catfive. better tack on the nationality and ethnicity in there as it is
17:55:44 -!- Sgeo has joined.
17:58:42 -!- Sgeo__ has quit (Ping timeout: 244 seconds).
18:32:31 -!- tromp_ has quit (Remote host closed the connection).
18:43:50 <b_jonas> `? mothology
18:43:51 <HackEso> Mothology is the study of moths, myths, mouths, and mirths.
18:44:15 <b_jonas> `? mythology
18:44:17 <HackEso> Mythology is the study of myths, moths and mirths.
18:44:18 <b_jonas> `? myth
18:44:20 <HackEso> A myth is a female moth.
18:44:39 <b_jonas> `? mother
18:44:40 <b_jonas> `? moth
18:44:40 <HackEso> A mother is a person who practices mothology.
18:44:41 <HackEso> Moths are the main ingredient of mothballs.
18:44:47 <b_jonas> `? method
18:44:49 <HackEso> A method is a tweaked out mothod.
18:45:14 <b_jonas> `? month
18:45:16 <HackEso> Month is a misspelled Moth.
18:45:22 <b_jonas> I didn't realize there were so many of these
18:46:38 <shachaf> `? mouth
18:46:39 <HackEso> mouth? ¯\(°​_o)/¯
18:46:48 <shachaf> A British moth?
18:47:00 <shachaf> `? mirth
18:47:01 <HackEso> Mirths are juvenile moths. They giggle a lot.
18:50:05 <fizzie> int-e: https://esolangs.org/logs/2007-07-03.html#lcl + #scheme <Riastradh> What about it is hurting?
18:51:09 <fizzie> Plus I think most likely some other sentence containing at least the fragment "-- out about it --"
19:13:51 -!- tromp has joined.
19:36:20 <arseniiv> `? math
19:36:21 <HackEso> math? ¯\(°​_o)/¯
19:37:10 <arseniiv> that’s reassuring
19:37:45 <arseniiv> `? mint
19:37:47 <HackEso> mint? ¯\(°​_o)/¯
19:38:21 -!- ais523 has joined.
19:39:34 <arseniiv> fungot, do you like lossy compression of music?
19:39:34 <fungot> arseniiv: unless you need faster code. and given ironically ( or mockingly... i'm unsure) but thanks :)
19:40:05 <arseniiv> fungot: and what about lossless one?
19:40:06 <fungot> arseniiv: forces statement to be fnord
19:40:10 <b_jonas> I do like lossy compression of music
19:41:57 <arseniiv> b_jonas: how much losses you can stand?
19:42:14 <b_jonas> arseniiv: five
19:44:50 <arseniiv> I’m suspicious some people who were or are encoding music in mp3 don’t know how to do it good or do have a bad codec (is it a thing at all?), as then resulting file has a reasonable bitrate over 128 kbps or even over ~200 kbps but I hear artifacts
19:45:04 <b_jonas> arseniiv: I do know how to do it
19:45:10 <b_jonas> I even have my notes about which switches to give
19:45:37 <b_jonas> it's a bit complicated because the software changed over the years, plus these days I can finally encode music to ogg instead of mp3
19:45:57 <b_jonas> but the five is real, it's an argument to a certain switch that tends to give the right amount of compression
19:45:58 <arseniiv> I think someone even takes a file about 64 kbps and then “upscales” it. Poor universe
19:46:48 <arseniiv> b_jonas: wait, what does five mean?
19:47:07 <b_jonas> the trick is to test how much you can compress until you notice problems if you specifically look for them, then encode to significantly better quality than that
19:48:29 <arseniiv> b_jonas: seems a good strategy, yes
19:48:33 <b_jonas> arseniiv: ffmpeg -i "$infile" "${metadata[@]}" -vn -c:a libvorbis -q 5.0
19:48:42 <b_jonas> the 5.0 is a quality parameter to that particular codec
19:49:01 <b_jonas> I need different parameters depending on the software and the compression method and the quality switch obviously
19:49:01 <arseniiv> ah, quality index, or how’s it called, I see
19:49:39 <arseniiv> LAME also has an indexed set of variable rate qualities
19:50:17 <b_jonas> arseniiv: yes, but I don't use LAME anymore
19:50:28 <b_jonas> I just encode video and audio with ffmpeg
19:55:40 <arseniiv> several times I encoded some music these days I took the quality associated with ~200 kbps, I think. Its index should be 1 or 2 perhaps. I read that even mp3 is sufficiently good on almost all sounds when at bitrates > 128 kbps, and formats like ogg you mentioned or some other new ones, fare even better, but my anecdotal evidence suggests that it’s not that simple (for mp3)
19:59:00 <b_jonas> yes, 128 kbps is usually enough
20:02:04 <arseniiv> also how do you think could sample rate mismatch between a file and the sound card, matter? I don’t see how it would but…
20:02:27 <arseniiv> s/how/
20:06:18 <kmc> resampling audio between two arbitrary sample rates is an interesting problem
20:06:51 <kmc> there is a tradeoff between the amount of computation needed and the quality of the result
20:07:25 <b_jonas> and probably between different types of distortions too
20:07:30 <kmc> the difficulty is related to the least common multiple of the rates
20:07:52 <kmc> obviously, the easiest case is when one rate is a multiple of the other
20:08:07 <kmc> in general you want to interpolate to the LCM and then decimate to the output rate
20:08:23 <kmc> and there are ways to do this with FIR filters that provably introduce minimum distortion
20:08:39 <b_jonas> um
20:08:50 <b_jonas> but what if the least common multiple is infinite, because the ratio is irrational?
20:08:52 <kmc> however there are cases where the LCM rate would be prohibitively high
20:09:05 <b_jonas> yeah, that
20:09:30 <kmc> if your sample rate is not a rational number then you are doing something freaky
20:09:36 <kmc> the LCM will always be finite, but it might be huge
20:09:37 <b_jonas> um
20:09:40 <b_jonas> why?
20:09:48 <b_jonas> the sample rates are not dimensionless
20:09:56 <kmc> i mean, why would you design a system where it's not
20:10:00 <kmc> the dimension doesn't really matter
20:10:10 <kmc> because there is a rational conversion factor between any two practical time units
20:10:15 <b_jonas> they're in hertzes or gertzes depending on whether you're writing it in english or russian letters
20:10:26 <kmc> if you measure time in pi-seconds or something then you deserve what's coming to you
20:10:43 <b_jonas> you don't design such a system, people design two separate systems, each of them is reasonable, it's just conversion between them that isn't
20:11:01 <kmc> can you give me an example please
20:11:01 <b_jonas> they come around from spinning vinyl disks or whatever
20:11:03 <kmc> where this has happened
20:11:13 <b_jonas> I don't know, I don't do audio stuff, it's not my thing
20:11:26 <kmc> are there any two time units in common use which do not have a rational conversion factor
20:11:28 <b_jonas> but eventually it doesn't matter of course
20:11:44 <b_jonas> because rational with prohibitively high LCM is basically the same problem
20:11:50 <kmc> yeah
20:12:06 <b_jonas> and you get between the two with some approximation in the rate
20:12:09 <kmc> non-integer rates in Hz are common, for example NTSC framerate is 29.97 Hz for Historical Reasons™
20:12:13 <kmc> and PAL is 25
20:12:20 <arseniiv> (b_jonas: there’s no cyrillic letter g :P also in an old transliteration h was converted to г, like Helmholtz and Huygens are (still and hopefully forever) Гельмгольц and Гюйгенс)
20:12:28 <kmc> but of course 29.97/25 is still rational
20:12:46 <kmc> anyway
20:13:00 <kmc> if the LCM is too big then you can do other things at the expense of introducing distortion
20:13:17 <kmc> I forget exactly how
20:13:58 <kmc> but you can interpolate to a smaller compromise value and then during decimation, interpolate that 'on the fly' using a small filter such as cubic interpolation, that only looks at a few sample points
20:14:19 <kmc> to do it properly might require storing many millions of data points in your DSP filter state
20:14:20 <b_jonas> apart from encoding music files to mp3 or ogg and chopping them timewise, all I did with audio is remove them from audio+video files when I re-encode the video
20:15:01 <kmc> I wrote a fun script once to batch-convert my master music library (a mix of mostly flac and high quality mp3) to ogg vorbis for my portable music player
20:15:09 <kmc> it would distribute the work across multiple machines
20:15:34 <kmc> then I rewrote it in C# because I wanted to get a taste of what C# is like
20:15:35 <kmc> it remains the only C# program I've written
20:16:25 <arseniiv> (and it makes some sense for southern dialects where г is frequently a fricative [ɣ], not a plosive [ɡ] like in the normed dialect, and we could also for example take Ukrainian where г means [ɦ] outright and there’s a separate letter for plosive, ґ, AFAIR it’s used in rare contexts, but the transliteration of Hertz would be probably the same and it would be read more like the original name)
20:17:21 <b_jonas> arseniiv: sure, it just becomes funny when you transliterate the russian names back to hungarian, and you get g instead of h and f instead of th
20:20:19 <arseniiv> kmc: did you come to any conclusions about C#?
20:23:35 <kmc> arseniiv: it seems like a fine language, like Java but less crippled, it's not terribly exciting but I wouldn't hate using it either
20:25:08 <arseniiv> yesterday I remembered that I don’t like C# left switch statement syntax almost as it was in C and C++ (and Java?..) I have seen a syntax like switch (e) case (…) b case (…) b … else b (where b are blocks), this looks more comfortable in a language where low-level control flow inside switch doesn’t exist
20:25:51 <arseniiv> b_jonas: ah, I agree
20:26:29 <arseniiv> I saw something like that somewhere and it looks strange
20:30:03 <b_jonas> anyway, I'm not actually an engineer, so I don't meet those unit of measure abbreviations
20:31:18 <b_jonas> though I guess Hz does appear on end-user electronics like mobile phone chargers
20:32:23 <b_jonas> but these days all those end-user electronics have magical solid state transformers that work with any of the voltage and frequency standards for mains electronics
20:32:49 <kmc> correct
20:32:56 <kmc> switch-mode power supplies
20:33:02 <kmc> some of them will even run on DC input
20:33:11 <kmc> though not to arbitrarily low voltage
20:33:18 <kmc> SMPS are very interesting
20:34:06 <kmc> simple and clever, but tricky to design well in practice
20:34:27 <b_jonas> "~ 110–240 V 50/60 Hz" they all say, so you can use them with passive converters if you travel to anywhere
20:34:34 <kmc> they basically do AC->DC->AC->DC
20:34:53 <kmc> which sounds inefficient but if you do it right it's very efficient
20:35:06 <b_jonas> isn't that because they transform to AC with much higher frequency?
20:35:30 <b_jonas> it's still magic, I don't know how it can work
20:35:34 <kmc> the middle AC frequency is on the order of 100-1000 kHz so they can use cheaper / lighter / smaller transformers
20:36:35 <kmc> b_jonas: the very simple overview is that they alternately charge up an energy storage device (usually an inductor) and then discharge it into another storage device (usually a capacitor), which feeds the load
20:36:46 <b_jonas> that makes sense, but then they have to create such a higher frequency AC too, and without too much energy loss
20:36:49 <kmc> that alternation is controlled by semiconductor switches
20:37:11 <kmc> (though actually, very old devices called "vibrators" worked on a similar principle, but mechanically!)
20:37:25 <kmc> (used to transform 12V DC in a car into hundreds of V for vacuum tube radios)
20:37:33 <kmc> and there's a feedback loop which controls the frequency and/or duty cycle of the switching
20:37:48 <kmc> to maintain a certain output voltage regardless of the load
20:38:18 <kmc> they can boost as well as reduce voltages
20:38:41 <kmc> in fact you can build ones that can take any input voltage in a wide range, lower or higher or the same as the output
20:38:46 <kmc> though it's more complicated
20:39:10 <b_jonas> and then they do multiple possible output voltages, and negotiate them through USB
20:39:12 <kmc> what I find really interesting are the similarities between a SMPS, a class-D amplifier, a delta-sigma DAC, and an active power factor correction circuit
20:39:15 <kmc> yep
20:39:56 <kmc> you can sort of think of a class-D (switching) amplifier as a SMPS whose output voltage varies over time, determined by the input signal
20:40:00 <b_jonas> yes, the car charger ones take 12 V DC
20:40:21 <kmc> USB-C-PD is neat. I have a single brick, not much bigger than a typical phone charging brick, that can charge both my phone and my laptop
20:40:24 <kmc> that's handy for travel
20:41:12 <kmc> I still use the larger dedicated laptop brick at home
20:41:26 <kmc> there are some strange esoteric things you can do with USB-C
20:41:34 <kmc> like plug two chargers into each other, or plug your laptop into itself
20:41:40 <b_jonas> I don't charge laptop, but I can charge any of my low power devices (camera, mobile phone, spare mobile phone, music player, bluetooth headphone adapter) with the same charger
20:41:50 <kmc> cool
20:42:14 <b_jonas> but they're all low power, unlike the laptop
20:42:25 <b_jonas> laptop chargers actually heat up, that's harder
20:42:42 <b_jonas> two chargers into each other? what does that do?
20:42:45 <kmc> this brick is capable of 60W (3A @ 20V)
20:42:49 <kmc> which is enough for the laptop to charge
20:42:50 <b_jonas> do you mean with only one charger plugged into mains?
20:43:05 <kmc> I think it requires 20V which is why most of my bricks won't charge it
20:43:11 <kmc> the factory default charger is only 65W anyway
20:43:19 <kmc> b_jonas: it produces mains out of the other one, obviously /s
20:43:31 <b_jonas> no, that would be touch unsafe
20:43:34 <kmc> I have a USB-C inline power meter too
20:43:35 <kmc> which is neat
20:44:16 <kmc> it tells the voltage, current, and direction of power
20:46:11 -!- Lord_of_Life has quit (Excess Flood).
20:46:30 -!- Lord_of_Life has joined.
20:47:26 -!- unlimiter has joined.
21:14:31 -!- Lord_of_Life has quit (Ping timeout: 244 seconds).
21:21:32 -!- Lykaina has joined.
21:21:40 <b_jonas> hello Lykaina
21:21:57 <Lykaina> updated the documentation pdf (again)
21:22:07 -!- Lord_of_Life has joined.
21:22:15 <Lykaina> hi b_jonas
21:22:45 <arseniiv> kmc: interesting stuff. Now I know I don’t kow anything about contemporary electronics :D
21:22:57 <arseniiv> s/kow/know
21:23:12 <kmc> :)
21:23:16 <kmc> it's complicated shit
21:23:41 <b_jonas> yeah
21:23:43 <arseniiv> I had that impression already, but not I’m aware I’m hopeless
21:23:58 <kmc> arseniiv: I knew very little until 2-3 years ago
21:23:59 <b_jonas> which explains why our company keeps hiring so many people who understand electronics enough to design and assemble it
21:24:40 <b_jonas> and train engineer student interns in it too
21:24:55 <kmc> one problem with SMPSes is that they (especially the cheap ones) tend to produce tons of radio frequency interference at frequencies which interfere with ham radio
21:25:09 <Lykaina> based on this new, easier to read pdf, what is your opinion of Echidna? http://sif.lesidhetree.com/sara/echidna/spec_notes.pdf
21:25:11 <kmc> making it harder and harder to operate HF from populated areas
21:25:56 <kmc> they also produce RF on the output itself so some hams still swear by the old, huge, expensive, inefficient linear power supplies
21:26:00 <b_jonas> kmc: but can't the power supplies shield that with some wires unless they're disassembled?
21:26:32 <arseniiv> kmc: oh, unfortunate
21:27:16 <kmc> a linear supply is much simpler. a transformer to drop ac voltage down to a bit above the target, a diode rectifier, and a linear regular which acts as a variable resistor in series with the load
21:27:22 <kmc> and some smoothing caps
21:27:34 <kmc> it's still a feedback system, but an analog continuous-time one
21:27:37 <kmc> no switching
21:28:00 <kmc> most ham gear comes with a 13.8V DC power input and you provide your own power supply
21:28:30 <b_jonas> and some of the cheaper ones are made so badly that they draw measurable current from the mains even when they're not loaded
21:28:35 <kmc> b_jonas: yes but that would cost an extra $0.0002
21:28:45 <kmc> there shielding
21:29:05 <kmc> I mean you need it for FCC certification but how many Chinese companies will actually care
21:29:14 <kmc> plus the shielding isn't necessarily good enough for hams
21:29:22 <kmc> who wants to pick up weak signals
21:29:41 <kmc> much more stringent requirements than "don't interfere with my other consumer electronics"
21:29:55 <b_jonas> yeah
21:30:25 <arseniiv> I mean you need it for FCC certification but how many Chinese companies will actually care> would they hopefully decades later?
21:30:46 <arseniiv> oops I forgot to copy all
21:30:55 <b_jonas> it's like astronomers, who have to move their big telescopes to small research towns that have more stringent regulation for darkening curtains on houses than people had during world war II
21:31:20 <b_jonas> I don't understand how they don't just trip and fall on the street at new moon there
21:31:29 -!- xkapastel has joined.
21:31:30 <kmc> yep
21:31:50 <kmc> I mean the human eye can do well in very low light if properly adjusti
21:31:55 <arseniiv> b_jonas: flashlights and wax candles
21:31:57 <kmc> adjusted
21:32:22 <b_jonas> kmc: yes, that's why it's fine at full moon
21:32:30 <b_jonas> even at half moon
21:32:46 <b_jonas> but sometimes there's new moon, and then it's new moon everywhere on Earth
21:33:09 <b_jonas> including in those places
21:33:14 <arseniiv> neat
21:33:42 <Lykaina> i guess i asked my question at the wrong time...
21:33:49 <b_jonas> Lykaina: no
21:33:55 <b_jonas> don't worry
21:34:02 <b_jonas> I will look at that pdf eventually
21:34:02 <arseniiv> (don’t mind me, I’m stalling in going to sleep)
21:34:32 <b_jonas> I already decided that it's not so weird to have 4 addressing modes for most instructions, because you have so few instructions that the total is still well under 256 different opcodes
21:35:50 <Lykaina> huh?
21:36:30 <b_jonas> Lykaina: I complained a few days ago that it seemed strange that almost every operand to your instructions can be immediate, or so it seems from the pdf
21:36:50 <b_jonas> and you have like a dozen two-operand instructions where that applies to both operands
21:37:14 <b_jonas> Lykaina: my previous question about indirect loads still stands though
21:37:28 <b_jonas> oh wait
21:37:36 <b_jonas> Lykaina: maybe you don't logread? is that the problem?
21:37:53 <Lykaina> what is logread?
21:38:33 <b_jonas> read channel logs for what people said while you're not joined to the channel
21:38:45 <b_jonas> has nothing to do with logarithms
21:40:02 <arseniiv> b_jonas: maybe @tell, then?
21:42:17 <arseniiv> btw I rely upon lambdabot usually, so if I should logread something, please remind me in that case too
21:43:15 <Lykaina> b_jonas: what is indirect load?
21:44:00 <b_jonas> Lykaina: load when the memory address of where you're loading from is not constant
21:44:23 <b_jonas> although now with this later version of the pdf, it's getting unclear
21:44:31 <b_jonas> does this thing allow self-modifying code?
21:44:44 <Lykaina> i don't think so
21:45:33 <b_jonas> then why does it say that subroutines are at "Range 0100-EFFF" of the "Memory"? is that in a code memory separate from the data memory that the arithmetic instructions operate on?
21:45:59 <b_jonas> maybe I should look at the interpreter. does it have readable code?
21:46:15 <Lykaina> typo. subroutines uses that memory space
21:46:47 <b_jonas> so that's your data stack?
21:47:02 <b_jonas> no wait
21:47:12 <b_jonas> you can't have a stack, you don't have the right sort of instructions for them
21:47:23 <b_jonas> it'd be hard to manipulate a stack without an indirect load
21:47:29 <b_jonas> so that's why it's such a large area?
21:47:30 <b_jonas> oh well
21:47:45 <Lykaina> read the interpreter
21:47:48 <b_jonas> or you can globally compile everything, find all the calls, and assign the local addresses that way
21:53:51 <Lykaina> if i understand what you mean by indirect load correctly, i may be able to implement it by adding a third argument input type (as in other than @xxxx and =xxxx types)
21:54:29 <b_jonas> oh, so.. the control instructions, as in N & -- O P Q _ - are all structured ones, there are no arbitrary gotos
21:54:32 <b_jonas> interesting
21:55:08 <b_jonas> Lykaina: as I read the spec right now, the L and M instructions are the only ones that can do an indirect load
21:55:21 <b_jonas> well, except I don't understand what the S instruction does at all
21:55:47 <Lykaina> reads the program
21:55:58 <Lykaina> *from the
21:57:46 <Lykaina> like if there's text in the program file
21:58:00 <Lykaina> it reads it to memory
21:58:33 <b_jonas> ok, that makes sense
22:00:57 <Lykaina> if i make, say, a $xxxx in addition to =xxxx and @xxxx, where, as @xxxx is mem[value], $xxxx would be mem[mem[value]], would that help?
22:03:02 <b_jonas> but which instructions would take which combinations of address modes? you'd have to tell that somewhere
22:03:37 <b_jonas> if you want to have indirect addresing modes sort of everywhere, then I don't understand why you have a specific instruction for an indirect store
22:04:13 <Lykaina> which is indirect store?
22:04:18 <b_jonas> H
22:04:23 <b_jonas> it also does ordinary store
22:06:33 -!- tromp has quit (Remote host closed the connection).
22:06:42 <Lykaina> then it's not dedicated
22:07:03 <b_jonas> it's dedicated because the other instructions, the arithmetic ones, can only store to a fixed address
22:07:08 <b_jonas> but H can store indirectly
22:07:17 <Lykaina> really?
22:07:18 <b_jonas> and the logic instructions can load indirect if I understand correctly
22:07:31 <b_jonas> but maybe I just misunderstand the spec
22:09:21 <b_jonas> hmm wait
22:09:38 -!- arseniiv has quit (Ping timeout: 245 seconds).
22:09:46 <Lykaina> i have an idea for rewriting memory addressing notation, would mean the samples would have to be rewritten too...
22:10:09 <b_jonas> from the implementation it doesn't look like the L and M instructions can read from indirect addresses
22:10:13 <b_jonas> what did I see in the spec then?
22:10:43 <b_jonas> ah
22:11:04 <b_jonas> I just didn't understand the descriptions of the L and M ops from the pdf because they're a bit unclear on what is their input and output
22:11:16 <b_jonas> the interpreter makes it clear that they don't do indirect loads
22:11:39 <b_jonas> but also that all the arithmetic instructions can do indirect stores
22:11:43 <b_jonas> so I was wrong about that too
22:11:49 <Lykaina> =xxxx is currently used to represent mem[xxxx] instead of xxxx in certain places
22:12:06 <Lykaina> i'm seeing possible confusion
22:12:47 <b_jonas> I dunno then
22:12:59 <b_jonas> the current combo with no indirect load but lots of indirect stores is ... strange
22:13:13 <b_jonas> I don't recall having seen such an instruction set
22:13:16 <Lykaina> like H =xxxx =yyyy stores yyyy to mem[xxxx]
22:13:34 <Lykaina> is that confusing?
22:13:53 <b_jonas> Lykaina: no, it's not confusing about the H and the arithmetic instructions
22:14:02 <b_jonas> but for your description of the logic instructions, it is confusing
22:14:11 <b_jonas> the pdf doesn't tell what they read and write
22:14:17 <b_jonas> unlike in the arithmetic instructions
22:14:50 <Lykaina> look at page 1 for examples of L and M
22:18:02 <Lykaina> does that help?
22:18:05 <b_jonas> no
22:18:27 <b_jonas> the implementation code does though
22:19:02 <Lykaina> how would you recommend i change it?
22:19:52 <Lykaina> the pdf, i mean
22:20:04 -!- ais523 has quit (Quit: quit).
22:20:19 <b_jonas> in the pdf, where you describe the T operation, you see how there's an equals sign in it? mem[val0] is on the lhs of that, val1 and val2 are on the rhs. from that you can tell that the first operand is output only, the second and third are input only
22:20:43 <b_jonas> it tells what that instruction does, what it stores to mem[val0]
22:21:10 <b_jonas> try something like that for the L and M instructions
22:22:23 <b_jonas> like "L bitwise_1bit: mem[val0] = (~val1 & val2 | val1 & val3)"
22:22:42 <b_jonas> only of course swap around the stuff in it until it actually describes what the operation does
22:24:34 <b_jonas> similarly like "M bitwise_2bit: mem[val0] = (val1 & val2 & -(0 != val & 8)) | val1 & ~val2 & -(0 != val & 4) | ~val1 & val2 & -(0 != val & 2) | ~val1 & ~val2 & -(0 != val &1)) but again swap around stuff until it matches your implementation
22:25:32 <Lykaina> if it will help, i'm gonna change the {=,@} stuff to {=,@,$} where =xxxx is always literal value, @xxxx is always direct address, and $xxxx is always indirect address
22:26:04 <b_jonas> if you don't want long formulas there, you can also write something like "M bitwise_2bit: mem[val0] = bitwise_2bit(val1, val2, val3)" and you explain elsewhere what the pure arithmetic part "bitwise_2bit" does, to at least maek it clear what is read from memory and what is written
22:26:47 <b_jonas> Lykaina: might help, since that matches more how popular assembly syntax for cpus work
22:27:10 <Lykaina> i like that approach. it's what i attempted to do originally
22:27:19 <b_jonas> but you should also have somewhere in the pdf that makes it clear which instructions work with what combinatinos of addressing modes
22:30:01 <Lykaina> thank you
22:30:03 <b_jonas> it needn't be in the same table as the one that summarizes the ops
22:30:08 <b_jonas> it could be a separate table
22:39:00 <b_jonas> Lykaina: oh, and I also asked
22:39:13 -!- tromp has joined.
22:40:02 <b_jonas> Lykaina: for the arithmetic instructions that do less-than compare, division, right shift, can you make it clear whether these are unsigned integer comparison, unsigned divsion, unsigned right shift? and is there a separate signed less-than comparison instruction?
22:43:35 -!- tromp has quit (Ping timeout: 250 seconds).
22:46:51 <b_jonas> wait... the interpreter stores each of the 65536 words of the memory, logically 2 bytes sized each, in 4 bytes each?
22:46:54 <b_jonas> why are you doing that?
22:47:08 <b_jonas> or is this something I misunderstood in the pdf too, and they're actually 4 byte long?
22:47:28 <b_jonas> it looks from the interpreter as if they were 4 bytes long
22:47:34 <b_jonas> no wait
22:47:49 <b_jonas> but wait
22:47:49 <b_jonas> ...
22:47:58 <b_jonas> hmm
22:48:25 <b_jonas> this is confusing
22:48:39 <b_jonas> I'd have to read the whole code to tell if you can store more than two bytes in a cell, thus breaking the abstraction
22:48:42 <b_jonas> and I'm not willing to do that now
22:54:04 <Lykaina> b_jonas: it's supposed to be 65536 cells, each 2 bytes in size.
22:54:17 <b_jonas> then why don't you represent them that way too?
22:54:24 <Lykaina> i don't?
22:54:33 <b_jonas> it doesn't look like from the source code
22:55:11 <Lykaina> they are "unsigned int". in C, is that not 2 bytes?
22:55:18 <b_jonas> no
22:56:29 <Lykaina> i always thought an int was 2 bytes, a long was 4 bytes...
22:56:56 <j4cbo> no
22:57:11 <j4cbo> if you want 2 bytes use uint16_t
22:57:48 <b_jonas> j4cbo: it's not that simple, you have to be careful with the arithmetic because it will promote to int and do a signed shift
22:57:51 <b_jonas> C is ugly
22:58:07 <b_jonas> you may need explicit casts or such things
22:58:09 <j4cbo> yeah arithmetic is tricky
22:58:18 <b_jonas> arithmetic in *C* is tricky
22:58:31 <b_jonas> this is a complication by C rules
22:58:38 <j4cbo> Lykaina: the C standard doesn’t place many constraints on how big exactly int, long, etc are
22:59:54 <j4cbo> often on modern computers short is 2, int is 4, long is 8 but that is NOT guaranteed
23:00:08 <b_jonas> j4cbo: if I subtract an unsigned int from a signed long, what type is the result?
23:00:41 <Lykaina> i'll change it to a short
23:00:51 <Lykaina> instead of an int
23:00:52 <j4cbo> Lykaina: no
23:01:13 <j4cbo> if you want 2 bytes, write int16_t or uint16_t
23:01:22 <Lykaina> b_jonas: what's your take?
23:01:42 <b_jonas> Lykaina: again, it's not that simple, if you do that, you'll also have to change some of the code for the arithmetic instrs too
23:01:49 <j4cbo> b_jonas: I know the right answer is “read the spec” :P
23:02:15 <b_jonas> I think the current version gets more of them right than if you just change all the types to a short
23:03:17 <b_jonas> j4cbo: I'm still a bit shocked about how (a) 0<1 has a different type in C++ than in C, yet the difference in type is _almost_ never detectable in code that you can write in both C and C++
23:04:15 <b_jonas> and it's a pity, because apart from that stupid change, the C++ rules are usually IMO better than the C rules
23:05:07 <b_jonas> and it's possible that that change is for the better too, I'm just not quite convinced that it's worth
23:06:47 <b_jonas> Lykaina: anyway, I think first you should decide how you want the less-than, division and right-shift operations behave, then be careful that the code for those and for the subtraction implements them correctly
23:07:46 <Lykaina> unsigned, integer division
23:08:02 <Lykaina> no floats
23:10:39 <\oren\> x-=-1
23:11:09 <b_jonas> \oren\: ah yes, secret operators
23:13:04 <Lykaina> does that even compile?
23:13:11 <Lykaina> x-=-1 ?
23:13:57 <Lykaina> i know it has to be "x -= -1"
23:14:20 <Lykaina> and what does that do?
23:14:30 <j4cbo> don’t forget the “goes to” operator: while (x --> 0) { ... }
23:15:01 <Lykaina> x=x - -1
23:16:09 <Lykaina> whoever invented lambda operations is a sadist
23:16:09 <\oren\> the -=- operator is the same as the += operator
23:17:12 <Lykaina> clearly
23:17:18 <\oren\> the +=- operator is the same as the -= operator
23:17:41 <Lykaina> why make them?
23:21:59 <b_jonas> \oren\: not quite, sadly
23:22:09 <b_jonas> not in C that is
23:22:12 <b_jonas> overflow rules
23:23:35 <b_jonas> += is better than -=-
23:29:24 <\oren\> oh, when the right operand is MAX_INT?
23:32:15 -!- tromp has joined.
23:34:07 <Lykaina> https://www.zentut.com/c-tutorial/c-integer/
23:36:50 -!- tromp has quit (Ping timeout: 252 seconds).
23:41:03 -!- unlimiter has quit (Quit: WeeChat 2.5).
23:48:17 -!- Saggytarius has joined.
23:54:11 -!- Saggytarius has quit (Ping timeout: 260 seconds).
←2019-09-05 2019-09-06 2019-09-07→ ↑2019 ↑all