code logs -> 2018 -> Tue, 29 May 2018< code.20180528.log - code.20180530.log >
--- Log opened Tue May 29 00:00:38 2018
00:03 Kindamoody is now known as Kindamoody[zZz]
00:11 * McMartin gets simavr and avr-gdb working well enough to validate his function, woot
00:27 Jessikat [Jessikat@Nightstar-pd8uo5.dab.02.net] has quit [[NS] Quit: Bye]
00:34 * McMartin also determines that avr-gcc is Just Fine At This
00:35
<&McMartin>
"Optimize for size" only lost 8 bytes from my hand-coded routine, and those 8 bytes were all because of one trick I used to exploit data layout.
00:36
<&McMartin>
(Which meant I got to write all my state out through one pointer instead of naming four extra addresses)
00:36
<&McMartin>
"Optimize for speed" does a hilarious strength reduction on some code which I think will be the punchline of my next Bumbershoot post.
00:45 Vorntastic [uid293981@Nightstar-6br85t.irccloud.com] has joined #code
00:50 celticminstrel [celticminst@Nightstar-jocbi5.dsl.bell.ca] has joined #code
00:51 mode/#code [+o celticminstrel] by ChanServ
01:20 Mango1 [Frankie_Boy@Nightstar-hqmi86.abhsia.telus.net] has joined #code
01:20 * Mango1 waves to the room.
01:22
< Mango1>
Using Javascript, I need to convert a string like "2,4,6-8,10-12" to an array like [2,4,6,7,8,10,11,12]. I don't suppose there's a prebuilt function that does this?
01:26
< Mango1>
Ah. I do believe I found it.
01:26
< Mango1>
https://codereview.stackexchange.com/questions/26125/getting-all-number-from-a-string-like-this-1-2-5-9
01:40 Jessikat [Jessikat@Nightstar-pd8uo5.dab.02.net] has joined #code
01:45 Vornicus [Vorn@Nightstar-oe1443.res.rr.com] has joined #code
01:45 mode/#code [+qo Vornicus Vornicus] by ChanServ
02:51 Jessikat [Jessikat@Nightstar-pd8uo5.dab.02.net] has quit [Ping timeout: 121 seconds]
02:53
< Degi>
https://i.redd.it/p0v3ufhftl011.jpg
02:57
<&McMartin>
Confirmed
02:57
<&McMartin>
;_;
03:00
<&McMartin>
(See also: using ᐸTᐳ - and those are Canadian Aboriginal Syllabics, mind you, not angle brackets - to pretend Go has generics)
03:07 Vornicus [Vorn@Nightstar-oe1443.res.rr.com] has quit [Ping timeout: 121 seconds]
03:09
<@celticminstrel>
XOR swap, huh. Does that actually work in scripting languages?
03:09
<@celticminstrel>
Like JS, Python, etc.
03:09
<@celticminstrel>
Because IIRC they treat the bitwise operators a little weirdly.
03:13 McMartin [mcmartin@Nightstar-rpcdbf.sntcca.sbcglobal.net] has quit [Ping timeout: 121 seconds]
03:15 McMartin [mcmartin@Nightstar-rpcdbf.sntcca.sbcglobal.net] has joined #code
03:15 mode/#code [+ao McMartin McMartin] by ChanServ
03:17
<&McMartin>
As long as the integer you use fits within a double, you're fine
03:17
<&McMartin>
All integers are exactly representable until you run out of mantissa bits, so you can convert floating point to integer, do your operation, then convert back to floating point
03:17
<&McMartin>
IIRC asm.js uses "|0" to mean "this number is actually an integer"
03:19
<@celticminstrel>
I'm assuming this refers specifically to JS and not scripting langs in general.
03:20
<&McMartin>
Yes but this behavior is extremely common in scripting langs
03:20
<@celticminstrel>
Does it work in Python too then?
03:20
<@celticminstrel>
The XOR swap.
03:20
<&McMartin>
As long as XOR doesn't produce wrong answers it should.
03:21
<&McMartin>
XOR as a reversible mask is kind of how XOR rolls.
03:23
<@celticminstrel>
ISTR bitwise operators in Python producint unintuitive results though.
03:23
<@celticminstrel>
Like, behaving as if there exist no bits beyond the most significant 1 bit in the integer?
03:23
<&McMartin>
I'm going to need a citation for that one.
03:23
<&McMartin>
Oh
03:23
<&McMartin>
That doesn't affect XOR.
03:23
<@celticminstrel>
I should probably go try it again before explaining properly...
03:23
<@celticminstrel>
Oh?
03:24
<&McMartin>
or wouldn't
03:24
<&McMartin>
A XOR B; take one of the values as the "base". the bits in the other specify which bits are to be flipped in the other.
03:24
<&McMartin>
So X XOR 0 is X for all X
03:24
<&[R]>
<McMartin> IIRC asm.js uses "|0" to mean "this number is actually an integer" <-- new trick!
03:25
<&[R]>
Though ~~ works too
03:25
<&McMartin>
[R]: Note that *outside* of asm.js this just performs the conversion and then converts it right back.
03:25
<&[R]>
Aye, but there are a few times where I've wanted some kind of guarantee a number is an int and not a float
03:25
<&[R]>
IE: there's no decimal point
03:26
<&McMartin>
As in, has been floored/ceilinged?
03:26
<&[R]>
Yeah
03:26
<&McMartin>
Because the whole thing with JS is that *all* numbers are IEEE 754 double-precision floats, IIRC.
03:26
<&[R]>
I'm well aware
03:26
<&[R]>
Also PHP has all the bitwise operators too
03:28 Degi [Degi@Nightstar-fadrog.dyn.telefonica.de] has quit [Connection closed]
03:28
<&McMartin>
Perl is also similar, IIRC
03:28
<&McMartin>
But Python has unlimited-precision integers
03:30
<@celticminstrel>
But not unlimited-precision floats. :(
03:30
<&McMartin>
That's what unlimited-precision rationals are for.
03:31 Vornicus [Vorn@Nightstar-oe1443.res.rr.com] has joined #code
03:31 mode/#code [+qo Vornicus Vornicus] by ChanServ
03:32
<@celticminstrel>
But then how are you supposed to represent the area of a circle?
03:54 Vorntastic [uid293981@Nightstar-6br85t.irccloud.com] has quit [[NS] Quit: Connection closed for inactivity]
05:11 celticminstrel [celticminst@Nightstar-jocbi5.dsl.bell.ca] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!]
05:12 Derakon is now known as Derakon[AFK]
06:00
<@Pi>
Python does have good unlimited precision binary float libraries.
06:01
<@Pi>
And decimals in the standard library, of course.
06:01
<@Pi>
Neither can do irrational numbers, though. :)
06:41
< simon_>
Pi, I'm experiencing a little annoyance in Haskell: I've got a Gen called DaggerGen for my AST that I'm currently using to QuickCheck my parser. since my Arbitrary instances are inside my DaggerGen module, and since I'm generating a specific subset of ASTs (ones that should also type-check), I've made some newtypes like ValidContract instead of Contract.
06:41
< simon_>
Pi, so the sub-types like Time and Expr in my AST also have custom Arbitrary instances like AnyTime and ValidExpr (not mixing bools and ints, e.g.)
06:42
< simon_>
Pi, and so my 'shrink' definitions have to do a lot of packing and unpacking of these newtype constructors.
06:42
< simon_>
e.g.:
06:42
< simon_>
shrink (ValidContract contract) = case contract of
06:42
< simon_>
Scale maxFactor scaleFactorExpr c -> map ValidContract $
06:42
< simon_>
[c] ++ map (\(IntExpr expr) -> Scale maxFactor expr c) (shrink (IntExpr scaleFactorExpr))
06:42
< simon_>
++ map (\(ValidContract c') -> Scale maxFactor scaleFactorExpr c') (shrink (ValidContract c))
06:44
< simon_>
do you think there's a neater way than packing and unpacking these all the time? I could make a shrinkIntExpr, etc. that does packing and unpacking.
06:54
<@Pi>
simon_: Hmm, I think that's a design thing in QuickCheck.
07:04 Reiv [NSkiwiirc@Nightstar-ih0uis.global-gateway.net.nz] has quit [[NS] Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
07:04 Kindamoody[zZz] [Kindamoody@Nightstar-eubaqc.tbcn.telia.com] has quit [Ping timeout: 121 seconds]
07:10 Kindamoody|autojoin [Kindamoody@Nightstar-eubaqc.tbcn.telia.com] has joined #code
07:10 mode/#code [+o Kindamoody|autojoin] by ChanServ
07:14 Vornicus [Vorn@Nightstar-oe1443.res.rr.com] has quit [Ping timeout: 121 seconds]
07:18 Vornicus [Vorn@Nightstar-oe1443.res.rr.com] has joined #code
07:18 mode/#code [+qo Vornicus Vornicus] by ChanServ
07:22
< simon_>
Pi, yeah okay. well, I guess I *do* want to explicitly say that I want a shrinked integer expression.
07:23 Vornicus [Vorn@Nightstar-oe1443.res.rr.com] has quit [Ping timeout: 121 seconds]
07:37 Vorntastic [uid293981@Nightstar-6br85t.irccloud.com] has joined #code
08:35 McMartin [mcmartin@Nightstar-rpcdbf.sntcca.sbcglobal.net] has quit [[NS] Quit: Reboot]
08:37 McMartin [mcmartin@Nightstar-rpcdbf.sntcca.sbcglobal.net] has joined #code
08:37 mode/#code [+ao McMartin McMartin] by ChanServ
09:42
< simon_>
Pi, you'd also avoid orphan type class instances, right?
10:12
<@abudhabi_>
So... how does one make HTTPS work on a newly installed apache2 server?
10:37
<@abudhabi_>
Is that synonymous with setting up SSL?
11:06
<@Pi>
simon_: Probably, yes.
11:14 Degi [Degi@Nightstar-fadrog.dyn.telefonica.de] has joined #code
12:06 Kindamoody|autojoin is now known as Kindamoody
12:09 Degi_ [Degi@Nightstar-fadrog.dyn.telefonica.de] has joined #code
12:12 Degi [Degi@Nightstar-fadrog.dyn.telefonica.de] has quit [Ping timeout: 121 seconds]
13:09 Emmy [Emmy@Nightstar-9p7hb1.direct-adsl.nl] has joined #code
13:39 Vornicus [Vorn@Nightstar-oe1443.res.rr.com] has joined #code
13:40 mode/#code [+qo Vornicus Vornicus] by ChanServ
14:04 Degi_ is now known as Degi
14:11
<@TheWatcher>
abudhabi_: yep
14:13
<@TheWatcher>
I can give you a simple example if you want
14:23
<@abudhabi_>
TheWatcher: Thanks, please do! (I'm a little busy ATM, so my response may be asynchronous, though!)
14:24 Vornicus [Vorn@Nightstar-oe1443.res.rr.com] has quit [Ping timeout: 121 seconds]
14:25 Kindamoody is now known as Kindamoody|afk
14:43
<@Pi>
Obligatory pointer to https://certbot.eff.org/
14:46 Vornicus [Vorn@Nightstar-oe1443.res.rr.com] has joined #code
14:46 mode/#code [+qo Vornicus Vornicus] by ChanServ
14:57 Kindamoody|afk [Kindamoody@Nightstar-eubaqc.tbcn.telia.com] has quit [Ping timeout: 121 seconds]
16:21 Vornicus [Vorn@Nightstar-oe1443.res.rr.com] has quit [Ping timeout: 121 seconds]
16:47 Vorntastic [uid293981@Nightstar-6br85t.irccloud.com] has quit [[NS] Quit: Connection closed for inactivity]
17:12
<@abudhabi_>
I have been told that self-signed certificates are a no-no. Is this true?
17:14
<@abudhabi_>
Also, what about free SSL certificates? Like https://letsencrypt.org/ ?
17:20
<@TheWatcher>
Yesh, self-signed are going to make you No Friends Whatsoever
17:20
<@TheWatcher>
letsencrypt is made of rainbows and unicorns, though
17:21
<@abudhabi_>
Cool.
17:21
<@abudhabi_>
Curious why self-signed is bad and wrong, though.
17:22
<@TheWatcher>
As for a setup that I find works, I stick http://pastebin.starforge.co.uk/15 in /etc/apache2/includes/ssl.inc and http://pastebin.starforge.co.uk/16 in /etc/apache2/vhosts/00_starforge.conf - the wordpress.inc and cachecontrol.inc lines are http://pastebin.starforge.co.uk/17 if you want them
17:22
<@TheWatcher>
(I use includes like that because I have 30-odd subdomains)
17:23
<@TheWatcher>
self-signed gives you no trust chain
17:24
<@abudhabi_>
Thanks! I'll try this out a little later.
18:47 Emmy is now known as Emmy-Noms
18:49 Emmy-Noms is now known as Emmy
18:54
<&[R]>
abudhabi_: there are two components to the TLS infrastructure. 1) encrypted packet streams. 2) web of trust. Self signed will get you #1, but will make browsers scream very loudly that #2 is being violated and the connection is insecure.
18:54
<@abudhabi_>
Right.
18:55
<&[R]>
The assumption browsers make with self-signed certs is that they're being used for a MitM and thus they warn the user appropriately.
18:57
< Emmy>
remember, to assume makes an ass out of u and me!
19:53 Degi [Degi@Nightstar-fadrog.dyn.telefonica.de] has quit [Ping timeout: 121 seconds]
20:43 Kindamoody|autojoin [Kindamoody@Nightstar-eubaqc.tbcn.telia.com] has joined #code
20:43 mode/#code [+o Kindamoody|autojoin] by ChanServ
20:43 Kindamoody|autojoin is now known as Kindamoody
21:18 * abudhabi_ installs f.lux.
21:54 Degi [Degi@Nightstar-1qt.mhi.212.185.IP] has joined #code
22:18 Reiv [NSkiwiirc@Nightstar-ih0uis.global-gateway.net.nz] has joined #code
22:18 mode/#code [+o Reiv] by ChanServ
22:19 Reiv [NSkiwiirc@Nightstar-ih0uis.global-gateway.net.nz] has quit [[NS] Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
22:39 himi [sjjf@Nightstar-v37cpe.internode.on.net] has quit [Ping timeout: 121 seconds]
23:47 Degi [Degi@Nightstar-1qt.mhi.212.185.IP] has quit [Connection closed]
23:47 Degi [Degi@Nightstar-1qt.mhi.212.185.IP] has joined #code
23:50 Reiv [NSkiwiirc@Nightstar-ih0uis.global-gateway.net.nz] has joined #code
23:50 mode/#code [+o Reiv] by ChanServ
--- Log closed Wed May 30 00:00:39 2018
code logs -> 2018 -> Tue, 29 May 2018< code.20180528.log - code.20180530.log >

[ Latest log file ]