1. 3

      Wow, this is really short!

      I’m not a go expert but wouldn’t storing all channels in a map prohibit them from being garbage-collected (as channels are strongly reachable) even when they have been used? (That is one can mount a DoS attack by enumerating a lot of URLs on this service).

      1. 1

        Why should they be garbage collected? If I create a queue with his service, I’d expect the queue not to be suddenly deleted.

        He could have some logic to delete unused queues after a while though, especially if his project becomes widely used (or abused).

        1. 2

          Why should they be garbage collected?

          You answered your own question in the next paragraph:

          He could have some logic to delete unused queues after a while though, especially if his project becomes widely used (or abused).

          As far as I can see the queues are never deleted so if I use a name it’s permanently bound so the memory consumption never decreases. The only way to prune unused channels is restarting the process.

          At least that’s what I think, I’m no go programmer.

          1. 3

            Yes, I noticed that too (also not a go dev). I think that can be solved by just deleting the channel at the end of the handler. That also fixes PUT and DELETE requests filling up the map with channels that will never be handled.

            1. 2

              Good points!

      2. 2

        Since this isn’t distributed at all, I wonder how many concurrent pending requests this setup can handle. Both in regards to number of open connections, and less so in regards to memory usage on the server.

        1. 1

          I guess http.ListenAndServe just fires off the passed in handler in a new goroutine for each connection. I could be wrong, haven’t written a single line of go before…

          1. 2

            you guessed correctly

          2. 1

            Benchmarking time! I imagine it’s a goroutine per thread in the handler, so RAM would be the upper limit… Throughput across a channel is almost definitely not the limiting factor, but I’d be curious to see the benchmarks, if we could generate them.

        1. 3

          Took me a while to find the source code. Here’s one to draw a sphere:

          /* MySQL raytracing engine by Nick (holtsetio@gmail.com) */
          Select if(repeat(char(
          /* Parameters */
          @w := 512,            /* width of the output in pixels */
          @h := 512,            /* height of the output in pixels */
          @cam.x := 0.0,        /* x-position of the camera */
          @cam.y := 0.0,        /* y-position of the camera */
          @cam.z := -4.5,         /* z-position of the camera */
          @cam.lookatx := 0.0,  /* x-position of a point at which the camera looks at */
          @cam.lookaty := 0.0,  /* y-position of a point at which the camera looks at */
          @cam.lookatz := 0.0,  /* z-position of a point at which the camera looks at */
          @cam.upx := 0.0,      /* x-part of the camera's up vector */
          @cam.upy := 1.0,      /* y-part of the camera's up vector */
          @cam.upz := 0.0,      /* z-part of the camera's up vector */
          
          @light.x := 0.0,      /* x-position of the lightsource */
          @light.y := 0.95,     /* y-position of the lightsource */
          @light.z := 0.0,      /* z-position of the lightsource */
          @light.r := 0.35,     /* radius of the lightsource */
          @fov := 50,           /* Field of view in degrees */
          @shadows := true,     /* shadows enabled? */
          @maxRecDepth := 10,   /* max. recursion depth for reflections */
          
          /* List of triangles in the scene, separated by semicolons.                   */
          /* Each triangle is given by xyz-coordinates of three vertices, separated by  */
          /* commas. Then follows the material which can be either "m" for matte or "r" */
          /* for reflective. Matte materials are followed by three values representing  */
          /* the color in r,g,b format.                                                 */
          
          @triangles := "-10.0,-1.0,-10.0,10.0,-1.0,-10.0,0.0,-1.0,5.0,m,0.6,0.6,0.6;
          -10.0,1.0,-10.0,10.0,1.0,-10.0,0.0,1.0,5.0,m,0.6,0.6,0.6;
          -1.0,-10.0,-10.0, -1.0,10.0,-10.0, -1.0,0,5.0, m, 0.85,0.5,0.0;
          1.0,-10.0,-10.0, 1.0,10.0,-10.0, 1.0,0,5.0, m, 0.2,0.6,0.75;
          -10.0,-10.0,1.0, 10.0,-10.0,1.0, 0.0,5.0,1.0, m, 0.6,0.6,0.6;
          -100.0,-100.0,-10.0, 100.0,-100.0,-10.0, 0.0,50.0,-10.0, m, 0.6,0.6,0.6;",
          
          /* List of spheres in the scene, separated by semicolons.                     */
          /* Each sphere is given by its xyz-coordinates and a radius, separated by     */
          /* commas. Then follows the material which can be either "m" for matte or "r" */
          /* for reflective. Matte materials are followed by three values representing  */
          /* the color in r,g,b format.                                                 */ 
          @spheres := "-0.5,-0.6,0.3,0.4,r;
          0.4,-0.6,-0.6,0.4,r,3.0;
          1.0,0.0,0.5,0.25,m,0.2,0.8,0.2;",
          
          /* end of parameters */
          @spheres:=concat(@spheres,@light.x,",",@light.y,",",@light.z,",",@light.r,",l;")
          ,@triangles:=replace(replace(replace(@triangles," ",""),"\t",""),"\n",""),
          @spheres:=replace(replace(replace(@spheres," ",""),"\t",""),"\n",""),@ntriangles
          :=(length(@triangles)-length(replace(@triangles,";",""))),@nspheres:=(length(
          @spheres)-length(replace(@spheres,";",""))),@nprimitives:=@ntriangles+@nspheres,
          @aspectRatio:=@w/@h,@fov:=@fov*(3.14159/180.0),@epsilon:=0.000001,@linelen:=4*
          floor((@w*24+31)/32),@cdx:=@cam.lookatx-@cam.x,@cdy:=@cam.lookaty-@cam.y,@cdz:=
          @cam.lookatz-@cam.z,@tlen:=sqrt(@cdx*@cdx+@cdy*@cdy+@cdz*@cdz),@rotz1:=@cdx/
          @tlen,@rotz2:=@cdy/@tlen,@rotz3:=@cdz/@tlen,@rotx1:=@cam.upy*@rotz3-@cam.upz*
          @rotz2,@rotx2:=@cam.upz*@rotz1-@cam.upx*@rotz3,@rotx3:=@cam.upx*@rotz2-@cam.upy*
          @rotz1,@tlen:=sqrt(@rotx1*@rotx1+@rotx2*@rotx2+@rotx3*@rotx3),@rotx1:=@rotx1/
          @tlen,@rotx2:=@rotx2/@tlen,@rotx3:=@rotx3/@tlen,@roty1:=@rotz2*@rotx3-@rotz3*
          @rotx2,@roty2:=@rotz3*@rotx1-@rotz1*@rotx3,@roty3:=@rotz1*@rotx2-@rotz2*@rotx1,
          @r:=concat(0x424d,reverse(lpad(char(26+@h*@linelen),4,0x00)),0x00000000,
          0x1A000000,0x0C000000,reverse(lpad(char(@w),2,0x00)),reverse(lpad(char(@h),2,
          0x00)),0x01001800),@pxy:=0,Benchmark(@h,char(@pxx:=0,@line:=repeat(0xff,0),
          Benchmark(@w,char(@degx:=(((@pxx+0.5)/@w)-0.5)*@fov*@aspectRatio,@degy:=(((@pxy+
          0.5)/@h)-0.5)*@fov,@tx:=sin(@degx),@ty:=sin(@degy),@tz:=1.0,@rdx:=@tx*@rotx1+@ty
          *@roty1+@tz*@rotz1,@rdy:=@tx*@rotx2+@ty*@roty2+@tz*@rotz2,@rdz:=@tx*@rotx3+@ty*
          @roty3+@tz*@rotz3,@rox:=@cam.x,@roy:=@cam.y,@roz:=@cam.z,@doray:=true,
          @shadowdone:=false,@cr:=0,@cg:=0,@cb:=0,@inside:=false,benchmark(@maxRecDepth+if
          (@shadows,2,1),if(@doray,char(@doray:=false,@tlen:=sqrt(@rdx*@rdx+@rdy*@rdy+@rdz
          *@rdz),@rdx:=@rdx/@tlen,@rdy:=@rdy/@tlen,@rdz:=@rdz/@tlen,@i:=0,@triangleptr:=1,
          @sphereptr:=1,@intersect:=false,@mindist:=999999,@material:="n",@nox:=0,@noy:=0,
          @noz:=0,@primitive:="",@ptr:=0,benchmark(@nprimitives,char(@primhit:=false,if(@i
          <@ntriangles,concat(@tpos:=locate(";",@triangles,@triangleptr),@primitive:=mid(
          @triangles,@triangleptr,@tpos-@triangleptr+1),@triangleptr:=@tpos+1,@tpos:=instr
          (@primitive,","),@v1x:=left(@primitive,@tpos-1),@ptr:=@tpos+1,@tpos:=locate(",",
          @primitive,@ptr),@v1y:=mid(@primitive,@ptr,@tpos-@ptr),@ptr:=@tpos+1,@tpos:=
          locate(",",@primitive,@ptr),@v1z:=mid(@primitive,@ptr,@tpos-@ptr),@ptr:=@tpos+1,
          @tpos:=locate(",",@primitive,@ptr),@v2x:=mid(@primitive,@ptr,@tpos-@ptr),@ptr:=
          @tpos+1,@tpos:=locate(",",@primitive,@ptr),@v2y:=mid(@primitive,@ptr,@tpos-@ptr)
          ,@ptr:=@tpos+1,@tpos:=locate(",",@primitive,@ptr),@v2z:=mid(@primitive,@ptr,
          @tpos-@ptr),@ptr:=@tpos+1,@tpos:=locate(",",@primitive,@ptr),@v3x:=mid(
          @primitive,@ptr,@tpos-@ptr),@ptr:=@tpos+1,@tpos:=locate(",",@primitive,@ptr),
          @v3y:=mid(@primitive,@ptr,@tpos-@ptr),@ptr:=@tpos+1,@tpos:=locate(",",@primitive
          ,@ptr),@v3z:=mid(@primitive,@ptr,@tpos-@ptr),@ptr:=@tpos+1,@e1x:=@v2x-@v1x,@e1y
          :=@v2y-@v1y,@e1z:=@v2z-@v1z,@e2x:=@v3x-@v1x,@e2y:=@v3y-@v1y,@e2z:=@v3z-@v1z,@Px
          :=@rdy*@e2z-@rdz*@e2y,@Py:=@rdz*@e2x-@rdx*@e2z,@Pz:=@rdx*@e2y-@rdy*@e2x,@det:=
          @e1x*@Px+@e1y*@Py+@e1z*@Pz,if(1.0*@det<-1.0*@epsilon||1.0*@det>1.0*@epsilon,char
          (@det:=1.0/@det,@Tx:=@rox-@v1x,@Ty:=@roy-@v1y,@Tz:=@roz-@v1z,@u:=(@Tx*@Px+@Ty*
          @Py+@Tz*@Pz)*@det,if(1.0*@u>=0.0&&1.0*@u<=1.0,char(@Qx:=@Ty*@e1z-@Tz*@e1y,@Qy:=
          @Tz*@e1x-@Tx*@e1z,@Qz:=@Tx*@e1y-@Ty*@e1x,@v:=(@rdx*@Qx+@rdy*@Qy+@rdz*@Qz)*@det,
          if(1.0*@v>=0.0&&1.0*(@u+@v)<=1.0,char(@tdist:=(@e2x*@Qx+@e2y*@Qy+@e2z*@Qz)*@det,
          if(1.0*@tdist>1.0*@epsilon&&1.0*@tdist<1.0*@mindist,/*Intersection!*/char(
          @primhit:=true,@intersect:=true,@mindist:=@tdist,@nox:=@e2y*@e1z-@e2z*@e1y,@noy
          :=@e2z*@e1x-@e2x*@e1z,@noz:=@e2x*@e1y-@e2y*@e1x,@tlen:=sqrt(@nox*@nox+@noy*@noy+
          @noz*@noz),@nox:=@nox/@tlen,@noy:=@noy/@tlen,@noz:=@noz/@tlen,@tdot:=(@nox*@rdx+
          @noy*@rdy+@noz*@rdz),if(1.0*@tdot>0.0,char(@nox:=-1.0*@nox,@noy:=-1.0*@noy,@noz
          :=-1.0*@noz),0)),0)),0)),0)),0)),char(@tpos:=locate(";",@spheres,@sphereptr),
          @primitive:=mid(@spheres,@sphereptr,@tpos-@sphereptr+1),@sphereptr:=@tpos+1,
          @tpos:=instr(@primitive,","),@spx:=left(@primitive,@tpos-1),@ptr:=@tpos+1,@tpos
          :=locate(",",@primitive,@ptr),@spy:=mid(@primitive,@ptr,@tpos-@ptr),@ptr:=@tpos+
          1,@tpos:=locate(",",@primitive,@ptr),@spz:=mid(@primitive,@ptr,@tpos-@ptr),@ptr
          :=@tpos+1,@tpos:=locate(",",@primitive,@ptr),@spr:=mid(@primitive,@ptr,@tpos-
          @ptr),@ptr:=@tpos+1,@Lx:=@spx-@rox,@Ly:=@spy-@roy,@Lz:=@spz-@roz,@tca:=@Lx*@rdx+
          @Ly*@rdy+@Lz*@rdz,@d2:=@Lx*@Lx+@Ly*@Ly+@Lz*@Lz-@tca*@tca,if(1.0*@d2<=1.0*(@spr*
          @spr),char(@thc:=sqrt(@spr*@spr-@d2),@tdist:=if(1.0*@tca-1.0*@thc>0.0,@tca-@thc,
          0),@tdist:=if(1.0*@tca+1.0*@thc>0.0,least(@tca+@thc,@tdist),@tdist),if(1.0*
          @tdist>0.0&&1.0*@tdist<1.0*@mindist,char(@primhit:=true,@intersect:=true,
          @mindist:=@tdist,@nox:=@rox+@tdist*@rdx-@spx,@noy:=@roy+@tdist*@rdy-@spy,@noz:=
          @roz+@tdist*@rdz-@spz,@tlen:=sqrt(@nox*@nox+@noy*@noy+@noz*@noz),@nox:=@nox/
          @tlen,@noy:=@noy/@tlen,@noz:=@noz/@tlen),0)),0))),if(@primhit,char(@material:=
          mid(@primitive,@ptr,1),@ptr:=@ptr+2,if(@material="m",char(@tpos:=locate(",",
          @primitive,@ptr),@hor:=mid(@primitive,@ptr,@tpos-@ptr),@ptr:=@tpos+1,@tpos:=
          locate(",",@primitive,@ptr),@hog:=mid(@primitive,@ptr,@tpos-@ptr),@ptr:=@tpos+1,
          @tpos:=locate(";",@primitive,@ptr),@hob:=mid(@primitive,@ptr,@tpos-@ptr)),0),if(
          @material="t",char(@tpos:=locate(";",@primitive,@ptr),@href:=mid(@primitive,@ptr
          ,@tpos-@ptr)),0)),0),@i:=@i+1)),if(@shadowdone,char(if(@material!="l",char(@cr:=
          0.0,@cg:=0.0,@cb:=0.0),0)),char(if(@material="l",char(@cr:=1.0,@cg:=1.0,@cb:=1.0
          ),0),if(@material="m",char(@lix:=@light.x-(@rox+@rdx*@mindist),@liy:=@light.y-(
          @roy+@rdy*@mindist),@liz:=@light.z-(@roz+@rdz*@mindist),@tlen:=sqrt(@lix*@lix+
          @liy*@liy+@liz*@liz),@lix:=@lix/@tlen,@liy:=@liy/@tlen,@liz:=@liz/@tlen,@tdot:=
          greatest(0.0,(@lix*@nox)+(@liy*@noy)+(@liz*@noz)),@cr:=@hor*@tdot,@cg:=@hog*
          @tdot,@cb:=@hob*@tdot,if(@shadows&&@shadowdone=false,char(@shadowdone:=true,@rox
          :=@rox+@rdx*@mindist+@nox*@epsilon,@roy:=@roy+@rdy*@mindist+@noy*@epsilon,@roz:=
          @roz+@rdz*@mindist+@noz*@epsilon,@rdx:=@light.x-@rox,@rdy:=@light.y-@roy,@rdz:=
          @light.z-@roz,@doray:=true),0)),0),if(@material="t",char(if(@inside,char(@nox:=-
          @nox,@noy:=-@noy,@noz:=-@noz),0),@tdot:=-(@rdx*@nox)-(@rdy*@noy)-(@rdz*@noz),
          @refb:=if(@inside,@href,1.0/@href),@refd2:=1.0-@refb*@refb*(1.0-@tdot*@tdot),if(
          1.0*@refd2>=0.0,char(@refa:=@refb*@tdot+if(1.0*@tdot>=0.0,-1.0,1.0)*sqrt(@refd2)
          ,@rox:=@rox+@rdx*@mindist-@nox*@epsilon,@roy:=@roy+@rdy*@mindist-@noy*@epsilon,
          @roz:=@roz+@rdz*@mindist-@noz*@epsilon,@rdx:=@refa*@nox+@refb*@rdx,@rdy:=@refa*
          @noy+@refb*@rdy,@rdz:=@refa*@noz+@refb*@rdz,@inside:=!@inside,@doray:=true),char
          (@material:="r"))),0),if(@material="r",char(@tdot:=(@rdx*@nox)+(@rdy*@noy)+(@rdz
          *@noz),@rox:=@rox+@rdx*@mindist+@nox*@epsilon,@roy:=@roy+@rdy*@mindist+@noy*
          @epsilon,@roz:=@roz+@rdz*@mindist+@noz*@epsilon,@rdx:=@rdx-2.0*@nox*@tdot,@rdy:=
          @rdy-2.0*@noy*@tdot,@rdz:=@rdz-2.0*@noz*@tdot,@doray:=true),0)))),0)),@line:=
          concat(@line,if(@intersect,concat(char(@cb*255),char(@cg*255),char(@cr*255)),
          0x000000)),@pxx:=@pxx+1)),@r:=concat(@r,rpad(@line,@linelen,0x00)),@pxy:=@pxy+1)
          )),0),0,@r) as bmpdata from (select 1) as tmp INTO DUMPFILE '/var/lib/mysql-files/sqlray.bmp'
          
          1. 3

            I really want to know what their video processing pipeline is like since they generate clips and varying video quality levels for what I assume is every device in existence. There were some nice nuggets here. I didn’t know about the Beacon api or the intersection observer. Seems like a mostly boring stack but considering they’ve been around for about 10 years and the site hasn’t slowed to a crawl on my intentionally crappy test laptop it means they’re doing something right.

            Did anyone pick up on whether they’re running all of their infra on AWS or just the vertica part? I thought the bandwidth costs would be killer.

            1. 4

              Why would they need to generate so many different quality levels? They probably just have 2 or 3 which is enough to cover most devices out there. Using ffmepg it’s trivial to generate these videos, though you need the infrastructure and processing power behind it.

              1. 2

                When you do it live, constantly, on terabytes of data, the infrastructure and processing power become the big problems.

                Edit: upon rereading it, they actually sound like they put a big emphasis on quality and compatibility too. So their question is, “if we can we make this content incrementally better for X market segment, is it worth it?” Start from the biggest X’s and work your way down like any other priority list!

                1. 2

                  There’s absolutely no way they’d do live transcoding; these sites usually only have two versions, it’d be much cheaper to simply store both at all times.

                  It’s actually a very simple thought experiment — you obviously cannot re-create the high-res version from the low-res one, and the low-res one would take so little space in storage compared to high-res one, that spending minutes trying re-create it from the high-res one would simply make very little sense — they’re probably transcoded once on upload, and pretty much forever cached.

                  BTW, I’d suggest you read the DDIA book, which explains a lot of these things. It has many insights into how actual popular applications are designed nowadays, including the actual Twitter implementation — which answered my own question on why it often takes so long to post a Tweet.

                  1. 2

                    They might only have two versions from your perspective (SD and HD), but having worked in video development, it’s likely they have 3-4 x those two versions for compatability. The web has converged on a few technologies in the last few years, making it less cumbersome, but if they want to cover “most” devices, then I still expect them to have at least 2-3 sets of files.

                  2. 1

                    Do you think they do live transcoding? I’m certain they have multiple copies of the media transcoded to different qualities. It’s really not that much processing power when you have things like Ryzen boxes and GPUs which can rip through this in no time.

                  3. 2

                    At this point, they almost certainly don’t. But in the not too distant past, they would have had to have a multiplicity of encodings, because of the varying abilities of the various browsers/devices/codecs.

                  4. 3

                    This is tangential, but I have really enjoyed learning about how netflix handles encoding and processing their videos.

                    Although Pornhub must process much more video than netflix does. I wonder what trade offs PH makes compared to Netflix’s approach based soley on the amount of content they have.

                    Here is a brief article from the Netflix Engineering blog about encoding. But I first started thinking about it when I watched this system design video from Gaurav Sen.

                    1. 2

                      Although Pornhub must process much more video than netflix does

                      Are you sure about this? I don’t remember where I read it, but I’m sure at some point I read that one of the adult sites (likely this one) determined that most viewing behaviour is to watch a bit at the beginning, and then skip forward to about 80% of the way through the video. The consumption of Netflix [I’m guessing] would look very different, i.e., watching a film start to finish.

                      I would have thought that this site could optimise videos for certain behavioural patterns.

                    2. 3

                      Self hosted, I’ve seen their servers in the datacenter.

                      Porn industry giants usually self-host as much as possible.

                      1. 3

                        Self-hosted using Level 3 as the network provider per Rusty.

                      2. 2

                        Although idk about processing, I do remember that Rusty said in Reddit AMA that they use Limelight for video CDN.

                      1. 1

                        What’s the purpose of ReactOS? Is it just to run old Windows XP software? But if I wanted to do that, I’d use VirtualBox with a Windows XP image as it’s likely to work better. Any idea what it’s actually used for?

                        1. 2

                          The Windows XP image is license-encumbered software.

                        1. 2

                          Beside my day job, I’m implementing a server app to support synchronisation with Joplin, my open source note-taking app.

                          1. 2

                            I’ve read through it and it’s unclear what problem this tool is solving. As I understand it replaces macros with some values. But when is this useful? What problem does this solve that’s not already solved by, say, Go or Python built-in features?

                            1. 2

                              Here’s the Strange Loop video on it, it addresses your questions. He actually presents an example of the AST manipulation it would take in Go to accomplish the same thing he does with Comby.

                            1. 8

                              I wonder what’s their incentive for using a non-free licence. It’s not like they can expect to sell it, since there are open alternatives.

                              1. 6

                                They could hide analytics gathering I guess, or maybe the developers have newer code in there they want to use on other projects that are commercial and not let those trade secrets out?

                                I like how this post isn’t pitchforks, but I would like to see a response from the author(s) on why, just out of curiosity on why they made that choice really.

                              1. 5

                                Like the Go developers have nothing better to do that making up fake proposals…

                                1. -1

                                  These are bizarre, even if they’re from 2005.

                                  His windowing example shows that he had never seen a window manager like XMonad or RatPoison. It’s trivial to make a window manager enforce uncrossable or always-on-top windows, block movement when someone tries to drag across another window. Can Windows really not do that? There’s a ton of them for the Mac.

                                  Setup and teardown scripts follow a programmed order in Unices, Mac, and Linux. I actually don’t know how to do it on anything but init-based systems: /etc/init.d, rc0.d, and rc6.d execute their contents in ASCII order, but I’m sure there’s an equivalent for launchd and systemd, I just haven’t needed to read a man page yet.

                                  Named pipes and quota let you solve the multi-user file problem. There’s no such thing as “exclusive mode” in a real OS.

                                  File association stealing can be annoying, but only the last program launched would win, so they wouldn’t “fight”.

                                  Is this what Windows is like? I’ve never really used it (had to run VisualAge and Eclipse on it at work for a while), but it sounds like DOS never died.

                                  The blog links all worked for me, but the MSDN links didn’t.

                                  1. 9

                                    I don’t think there was anything bizarre to his article. Windows tasks can be started or stopped in a given order too, but there’s still the issue of badly written services which try anyway to be the last or first to do something, and I’m sure there would be similar examples on Linux.

                                    For file associations it seems you missed the end of the article where he gave an example of the issue, which again could apply to other operating systems.

                                    1. 7

                                      This is a pretty uncharitable reading of the post (which is a pretty classic one from a pretty classic blog).

                                      His windowing example shows that he had never seen a window manager like XMonad or RatPoison.

                                      Pretty sure the Windows team, even in 2005, had people who’d seen lots of different window manager approaches. Don’t assume ignorance on their part.

                                      It’s trivial to make a window manager enforce

                                      And this is where you misunderstand what the post is about. It’s not about Windows having or lacking some feature. It’s about companies that build Windows applications wanting, and going to great lengths to try to implement, hostile, nonsensical, and literally logically impossible things.

                                      Your preferred approach seems to be to have the window manager tell the programmer they can’t do what they asked for. Which works up until the moment the programmer decides to hack around the window manager’s prohibition, which is why people are bringing up hypotheticals like an app editing the user’s window manager config in order to specially privilege itself over other windows. And the point of the post is to walk through the thought exercise of “if there were a feature that did this” – where “this” means full-screen, always on top, and no other application’s window can be visible – “what would happen if two applications each tried to use that feature simultaneously”. This is a reductio ad absurdum to show why such a feature could not exist.

                                      Also, trying to get around it by saying you’d just have your tiling WM split the screen between the two windows wouldn’t actually get around it, because then the app author would come back with “no, that’s not what I meant, I meant really full screen and no other application is allowed to be visible while mine is open”. You can say that’s hostile to the user, and it is, but the app authors (or, rather, their employers) are still going to try any way they can think of to make it happen.

                                      1. 5

                                        His windowing example shows that he had never seen a window manager like XMonad or RatPoison. It’s trivial to make a window manager enforce uncrossable or always-on-top windows, block movement when someone tries to drag across another window. Can Windows really not do that? There’s a ton of them for the Mac.

                                        I wouldn’t call this trivial at all: What if I have an always-on-top window in full-screen mode, and another full-screen always-on-top window gets opened? With tiling WMs you might be able to justify them just splitting the fullscreen among them, but for non-tiling WMs there’s no reasonable solution, unless you’re fine with the WM moving and resizing your windows, which I’m not.

                                        1. 0

                                          That’s what a WM is for, yes. If you’ve set a window to be uncrossable, the WM (which is a singleton) is responsible for moving the new one to a non-conflicting space. In a tiler, the existing windows get split or moved.

                                          1. 7

                                            If you’ve set a window to be uncrossable

                                            Okay, so I’ll have my application edit your xmonad config file to ensure that it’s always on top. In case another application goes in and edits the xmonad config file after me, I’ll have my app run a timer in the background to check and ensure it still has top priority in the WM config.

                                            1. 4

                                              You puny app will do no such thing on my immutable, password-protected xmonad.hs

                                              (app installs keylogger to sniff password and edits xmonad.hs)

                                              Oh yeah? Try to get your app to put my finger on the finger print reader to edit xmonad.hs

                                              (app does just that by hooking itself into a commonly used fingerprint-protected command)

                                              …etc.

                                              The end result looks rather like Core War(s) [1]…

                                              [1] https://corewars.org/

                                            2. 7

                                              No user knows what a WM is. No user knows what a tiling WM is. Even if they knew, no user should have to configure a third program to resolve a conflict between two programs.

                                              Raymond Chen is talking about end-user experience and you are talking about interfaces that only a small subculture (even within the userbase of Linux on the Desktop) uses.

                                              1. 3

                                                Enough users do know what window managers are to make a bunch of alternatives available on Mac, UNIX, and Linux (and aside, I find it a little offensive to be called a Linux user; I’m a UNIX user, and now Mac because it’s the last UNIX workstation).

                                                But every desktop computer ships with a WM, whether the user has configured it themselves or not. And most of those can manage some kind of always-on-top and blocking behavior, even if it’s not exposed by default; a program can ask for it. Chen’s argument is that you can’t even do this, which is false or indicates severely crippled behavior in Windows.

                                                Condescending to users as if they’re stupid is why they avoid learning anything, and why they loathe technical people.

                                                1. 1

                                                  What alternative window managers are available for macOS?

                                                2. 2

                                                  Even if they knew, no user should have to configure a third program to resolve a conflict between two programs.

                                                  You’re not configuring a ‘third program’, you’re telling the system, in an appropriate place, to act in a certain way. The WM is more these days part of the system. It might be implemented as a separate program but I don’t think anyone actually sees it that way except for some arch linux alumni.

                                                  1. 0

                                                    The distinction between system and program does not matter to me. I care about the fact that I need to configure anything at all to work around broken interaction between two parties.

                                                    1. 1

                                                      The distinction between system and program does not matter to me.

                                                      Even if they knew, no user should have to configure a third program to resolve a conflict between two programs.

                                                      It very clearly does because you explicitly called out configuring ‘a third program’.

                                                      I care about the fact that I need to configure anything at all to work around broken interaction between two parties.

                                                      Is it broken interaction? If one program signals an error, an always-on-top messagebox is displayed. If another program then signals an error, do you choose to display that second error? How should those messages interact?

                                                      The conflict is innate to the nature of having an ‘always on top’ option. The idea that something as fundamental as that should be removed just because it adds a form of conflict that already exists is ludicrous. Let’s not even mention the fact that you, as a user, would not have to configure anything anyway, because there exists a sane default. This is like saying “I should not have to configure my car seat position to match me, it should just work”, and then arguing that the car seat should be removed because it’s configurable.

                                                3. 3

                                                  So how do I make my program run under a wm that supports this behavior? Should I bundle a wm in my program and kill the currently running one at startup?

                                              2. 5

                                                File association stealing can be annoying, but only the last program launched would win, so they wouldn’t “fight”.

                                                I suspect both programs are running at the same time, with both running loops to check+change file associations.

                                                It’s trivial to make a window manager enforce uncrossable or always-on-top windows

                                                What’s possible and what are good options are not the same thing.

                                                suspect he is describing a situation where the application devs don’t like that everyone can access the ‘always on top’ feature, so they want something even higher again to make sure they are the only ones ontop. This brings up both philosophical and practical problems.

                                                1. 0

                                                  Chen describes two programs running timers, apparently pretty fast, reassigning filetypes without user permission. I don’t actually believe anyone would waste main loop time doing that, he may have seen a contrived demo or more likely made it up for the example.

                                                  The behavior defies the law of programmer laziness.

                                                  So a realistic scenario is just checking on startup or hitting a button in preferences, and that’s a trivial annoyance. Firefox used to be a prime offender there, and it just whined at me every startup.

                                                  1. 9

                                                    The behavior defies the law of programmer laziness.

                                                    This law does not exist in software developed by companies.

                                                    more likely made it up for the example.

                                                    Your perspective is the one of a Linux user, and Linux on the Desktop has both a very small marketshare and its own development culture around GUI programs. Just keep that in mind before you assert that the author is lying because his world seems alien to you.

                                                    1. 8

                                                      Raymond has seen a lot of things in real life that you wouldn’t believe, then. Read the blog entries on his Windows backward compatibility work.

                                                      1. 4

                                                        He’s seen things you people wouldn’t believe. COM files in DOS boxes running critical code. OS memory management driven by bugs in SimCity. A20 gates on fire off the shoulder… OK, not that, probably, but don’t underestimate the Windows Crazification Factor and the full scope of petty venality in writing closed-source software. BonziBuddy existed, after all.

                                                        1. 2

                                                          The behavior defies the law of programmer laziness.

                                                          Laziness can easily be overcome by offering money in exchange for goods and services.

                                                      2. 3

                                                        He’s answering developers questions. Imagine a music player developer asking for a way to set the flag on their window, without user interaction, or a virus scanner program that wants to set itself as the last program running.

                                                        All of these things are not hard if you force the user to configure them, but what happens when the user says no?

                                                      1. 18

                                                        I have long had trouble understanding how the blockchain gets the very many magical properties ascribed to it. Every time I’ve asked, I have gotten a lecture in hashes and proof of work. I know the fundamentals of blockchains, what I don’t understand is how the fundamentals lead to these amazing emergent properties.

                                                        This article sorta kinda makes me think I might not be missing anything at all – the people talking about it may have been full of shit.

                                                        1. 8

                                                          I have been wrong before but to me it seems like a mass psychological phenomenon. That many people and that much money cannot be wrong! So they add more people and money.

                                                          In the best case, some companies use the label “block chain” to market some established cryptographic techniques that are not block chain at all…

                                                          1. 7

                                                            yep. You might think “blockchain” meant something like “append-only ledger with a consensus mechanism”, but it turns out in practice to literally just mean “whatever I’m trying to sell you today”.

                                                            I was talking about this a few months ago with a well-meaning non-techie, who suggested that Uber - the money-burning minicab firm with an app - was an example of a “decentralised system.” More than that - it was a model for how blockchain could succeed.

                                                            I think they’d never thought about the concept of distributed systems of any sort ever before in their lives.

                                                            “It’s like blockchain, because anyone can sign up to be an Uber driver!”
                                                            “Uh … anyone can sign up to be a minicab driver.”

                                                            or the very concept of “open source” only being possible with “blockchain”.

                                                            1. 4

                                                              The weird thing is that I know intelligent, technical people that advocate for this. If asked for specifics, some variant of “we still have to figure out the specifics” is used.

                                                              Well, chances are that you never will…

                                                            2. 4

                                                              The hype cycle became self fulfilling. I got a look at the internal roadmap for one of the pieces of legacy software at the big enterprise I work at - crusty old barely touched 90s technology that’s critical for parts management and ordering.

                                                              2020 plans? Traceability of parts on the blockchain.

                                                              1. 1

                                                                Traceability, correct me if I’m wrong, was one of the actual things a distributed append-only ledger was good at. The way I see it, it’s a good decision with regards to what tech to use, at least until someone puts the wrong data in.

                                                            3. 4

                                                              As well as that non-tech explanation talk, I have the longer and more techy version to an infosec group. (My mission to get across to them: “please don’t get into blockchains”)

                                                              1. 4

                                                                You’re sending the wrong message. Instead, tell them to come up with something useful, pitch a blockchain version, build the useful thing first with the money, open source it, and then build the “better” version with blockchain. We’ll steadily get more useful stuff out of blockchain investments.

                                                              2. 4

                                                                I’d like to refer to this article about Bitcoin from 2011, before all the mass hysteria began: https://paulbohm.com/articles/bitcoins-value-is-decentralization/

                                                                To elaborate: Bitcoin isn’t just a currency but an elegant universal solution to the Byzantine Generals’ Problem, one of the core problems of reaching consensus in Distributed Systems. Until recently it was thought to not be practically solvable at all, much less on a global scale. Irrespective of its currency aspects, many experts believe Bitcoin is brilliant in that it technically made possible what was previously thought impossible.

                                                                /edit quote

                                                                1. 4

                                                                  Herd behavior. It’s usually irrational except for the scheming people fueling and benefiting from it.

                                                                  Blockchain looks like herd behavior. Similarly, most of it has a tiny group of people that will get rich if enough buy in. That’s similar to how companies like Goldman create, pop, and profit from bubbles in the market.

                                                                  1. 3

                                                                    irrational exuberance meets unjustifi-ed/able faith in technology.

                                                                    if you bought into a blockchain, you want to hype it up because that’s how you get paid. If you didn’t buy into it, well you got bored of trying to reason with people a long time ago.

                                                                    It’s probably the most interesting social phenomenon of recent years.

                                                                    1. 2

                                                                      It sounds basically like a pyramid scheme when you put it like that…

                                                                    2. 2

                                                                      The flip side of this is that some companies are actually trying to look for the blockchain-based “killer app”, if such an app ever exists. I did develop a few blockchain based proof of concepts, which didn’t go anywhere, but there wasn’t any attempt to trick anyone. It’s just about experimenting with a new technology and see what can be done with it.

                                                                    1. 3

                                                                      I think it’s not different enough from Markdown to be interesting. Sure it has text diagrams, but you can put text diagrams in Markdown too. You can also add some JavaScript to your Markdown files to have them render automatically in a browser (although I’m not sure I see a point to this, as opposed to just rendering the file to HTML before publishing it).

                                                                      It basically feels like a proprietary variant of Markdown, tied to a specific JS lib, so once you start using it it makes it hard to move your data. As opposed to regular Markdown (based for instance on CommonMark), which will work pretty much everywhere.

                                                                      1. 4

                                                                        While I agree with your sentiment I should point out that the link says that markdeep is an open-source hobby project, not proprietary. (I know you wrote feels like but I thought this note was still worth pointing out.)

                                                                        1. 3

                                                                          I use it in my blog, and Markdeep is amazing.

                                                                          I’m using the diagram feature, and for me it’s basically the decision of either using Markdeep, or not providing diagrams at all, because Markdeep just works.

                                                                          1. 1

                                                                            Do you do diagrams by hand? I always get annoyed tweaking the whitespace.

                                                                            1. 1

                                                                              Well there’s always things like artist-mode in emacs, or DrawIt in vim. More convoluted than dia or visio, but they do have the advantage of being inline in a readme.

                                                                          2. 1

                                                                            I think adding graphs is valuable however I think it maybe should be done as a contribution to markdown.

                                                                            1. 7

                                                                              There’s no contributing to Markdown, which is the genesis story of CommonMark.

                                                                          1. 5

                                                                            In most cases I’d agree with him. I had examples like this where I would just throw an exception in PHP if some variable didn’t have the expected value. I figured at that time: if that happens, I don’t know how to handle it so let’s crash. Eventually it did happen once but the clear stack trace in the log made it very easy to locate and fix the issue.

                                                                            Crashes basically give clear indications that 1. something needs to be done and 2. how. The opposite is subtle invalid state that spreads through the app and you often don’t notice till it’s too late, and then it’s very hard to find the root of the problem.

                                                                            1. 6

                                                                              Are you the “Marketing and Brand Manager” for headway.io (the source of this blog post) by any chance? It looks like you were invited by the person who wrote the blog you’re posting, which is interesting.

                                                                              If so, posting your company’s marketing material (company blogs are marketing, after all) just a day after joining Lobste.rs, and with zero other interactions, feels kinda spammy to me.

                                                                              Meta: We must be getting close to the point of considering a cool-down period for users posting links after joining the site? Or, a minimum karma threshold? It seems kinda rampant these days.

                                                                              1. 4

                                                                                Yeah, it’s extremely odd. Also @geekoncoffee, the person who wrote the post, hasn’t interacted at all with lobsters either.

                                                                                I flagged it as spam: while the essay itself was pretty good, the context is weird enough I want to raise it to the mods.

                                                                                1. 3

                                                                                  Thanks for flagging. I’ve written to @kineticbear to ask them to please participate in the community.

                                                                                2. 1

                                                                                  A cool-down period is not needed in my opinion. If the content is not interesting, it will be downvoted and flagged. On the other hand, if it is interesting, there’s no reason to prevent new users from posting their own stuff, even their own company stuff.

                                                                                  I feel the current tools already deal well with posts without adding new restrictions.

                                                                                  1. 1

                                                                                    My apologies. I was looking into this community on behalf of our development team. I won’t be posting here anymore, but I wanted to see what it was all about. They would be more involved than I would be.

                                                                                    Again sorry for giving you the wrong impression. We’re just trying to share helpful content and things that we’ve learned.

                                                                                  1. 6

                                                                                    In my experience, integration tests have the best ROI as they can be relatively simple to write, and test a large area of the code. They are good at spotting issues deep inside the code that might not be obvious at first, and perhaps even wouldn’t be caught by unit testing.

                                                                                    Unit testing on the other hand is perfect for testing library-like code, say your utility library to manage ut8 strings or date calculations, etc.

                                                                                    1. 3

                                                                                      I think that there are ways of architecting the system such that unit tests become better than integration tests, namely hexagonal testing. In my experience people usually write end-to-end tests because they’re easier to write then wonder why CI is always red when they have 1000 of those. They’re flaky, and nearly as bad, slow to run, which makes people not run them after every change.

                                                                                      1. 4

                                                                                        What is “hexagonal testing?” Because trying to Google that leads to athletics testing, not program testing.

                                                                                          1. 2

                                                                                            Thanks.

                                                                                      2. 1

                                                                                        Sort of countering and corroborating that, I think usage-based testing is highest ROI as advocated by Cleanroom in 1980’s. Their theory was it’s better for software to have a 100 bugs users never see than even 5 they often do. Their perception would drive the acceptance and spread of the software. So, you look at the ways they can use the project, game out any ways to turn it into tests, and run those first. Maximizes the perceived quality.

                                                                                        Then, integration. Then, unit. These will improve actual quality but might take more resources. I said corroborate since the usage-based tests will likely be a form of integration testing since they test many features at once. Acceptance testing is the common term for this, though, since it’s usually black box.

                                                                                      1. 2

                                                                                        Or maybe allow stories to be resubmitted after a certain delay, 6 months or something.

                                                                                        1. 1

                                                                                          I’d go with a longer delay; perhaps a year or two. In my experience shorter minimums lead to a lot more “legal” reposts.

                                                                                        1. 1

                                                                                          If only encoding standards had been developed in German or Chinese, or basically any language more complex than English. Then maybe we would have had sane encoding from day one, rather than having the assumption that every text is written in English, with no accent, etc.

                                                                                          1. 5

                                                                                            Docker is overkill for some projects, and it also depends on what’s your app doing. If it’s a server that needs Nginx, Python and Postgres, then sure Docker is a right solution. But if it’s just a command line tool written in Node or Go, npm i or go get is much simpler.

                                                                                            1. 1

                                                                                              Anyone knows how to pronounce “sr.ht” or what it means? (I saw this question a few times but never an answer, though I guess the answer must be there somewhere)

                                                                                              1. 4

                                                                                                Sir Hat (or any other way you want). From https://drewdevault.com/2018/11/15/sr.ht-general-availability.html

                                                                                              1. 3

                                                                                                The main issue with sub-repos is that you never know which commit of which branch of one repo is compatible with another commit of another repo. In theory things should be versioned or there should be tooling to manage all this, but often it’s not done, and I see the same problem over and over again in various projects I worked on. Manager splits things into sub-repos and considers the job is done, “things are organised now”, except they are not.

                                                                                                With monorepo it’s much simpler - the dependency management between modules is built-in - you can check any commit of any branch and it just works. And as he mentioned in the article, splitting things up into directories is perfectly reasonable and code review is there to ensure that no-one is making a mess.

                                                                                                I think it makes sense to use sub-repo for things that are generic, independent libraries, basically code you could release as open source (I guess React for instance is not part of the Facebook monorepo).

                                                                                                1. 13

                                                                                                  Also avoid “flexible holidays”. That’s just another way of saying there’s a baseline of no holidays, and for the few you’ll want, you’ll have to get approval from management. Similar story with “flexible hours”, which means you’ll be expected to leave late rather than early. Often when there’s “flexibility”, it’s flexibility for the company, not for you.

                                                                                                  Much better to go for jobs with clear business hours and a clear number of holidays per year, at least you know exactly what you’ll get and can make an informed decision.

                                                                                                  1. 13

                                                                                                    As I understand it “unlimited vacation” is a hack on human psychology to trick workers into taking less vacation. If they don’t let you book it when you try, though (barring normal reasons like a pending release you’re super important for or whatever – which apply even with “standard” vacation policies) it’s not really flexible or unlimited.

                                                                                                    My old employer gave me 4 weeks of vacation, and I usually didn’t use it all, or forced myself to use it at year end and got long Christmases. Since moving to new job with “unlimited vacation” and knowing the risks of such a policy, I make very sure to book at least 4 weeks a year. This year it’ll be 5.5 weeks.

                                                                                                    1. 5

                                                                                                      Not always. At my last job, it was exactly as you described it: a hack to get you to take less vacation. At my current job, it really is unlimited. “Standard practice” at my current company is 3-4 weeks off per year, with 5-6 not being unheard of as well. I, personally, take less but also have an understanding with my manager that I can take off on short notice as I tend to have periods where I get very sick of work.

                                                                                                      1. 3

                                                                                                        I’ll echo this; at my current company, the unlimited vacation policy exists pretty much in earnest. I calculated that over the past 3.5 years I have averaged 4.5weeks/year of vacation. I’ve never had a vacation request denied, though I obviously don’t do things like request every single Friday off, or take a month in the middle of a release rollout, etc.

                                                                                                        1. 1

                                                                                                          At my last job, it was exactly as you described it: a hack to get you to take less vacation. At my current job, it really is unlimited.

                                                                                                          These do not have to be mutually exclusive. As I said in my post, as long as you make sure to take ownership of the situation and force yourself to remember and ask for vacations, you can get them (often). Just don’t let your mind fall into the trap of not counting the vacation days, because then you’ll (likely) end up taking less.

                                                                                                        2. 3

                                                                                                          Alternatively, employers have to pay out unused vacation days when you leave a company. This can be pretty expensive, especially if you accrue a lot of vacation.

                                                                                                          1. 2

                                                                                                            Around here (Ontario, Canada) they have to have a baseline of some vacation in the contract, so that still has to get counted and paid out in theory.

                                                                                                            1. 1

                                                                                                              Yeah, probably varies by location. I’m in California and my old manager admitted it after I put two and two together.

                                                                                                          2. 2

                                                                                                            Unlimited vacation makes no sense to me. You can just take as many paid days off per year as you like? Why don’t people just take the whole year off?

                                                                                                            If you mean unpaid holidays then… who the hell cares how many unpaid days off you can take per year? What kind of employer is going to tell you that you can’t take unpaid leave. The number that matters is the number of paid days holiday above the legal minimum.

                                                                                                            1. 3

                                                                                                              You can - but your coworkers will judge you for it. Social forces are pretty powerful.

                                                                                                              The theory is that you avoid having employees show up un-motivated - the practice is nobody gets any time off.

                                                                                                              1. 2

                                                                                                                My coworkers will judge me? Who cares they judge me. I can take unlimited paid time off..

                                                                                                              2. 1

                                                                                                                Why don’t people just take the whole year off?

                                                                                                                Three reasons – because employees are more trustworthy than that – because an employee who did that would have zero productivity and likely get fired – because vacations require manager approval and no one would approve the whole year.

                                                                                                                At my company in particular, you need “extra special” approval to get more than two weeks in a row, even. But taking almost 6 weeks in drips and drabs is easy to do.

                                                                                                                1. 1

                                                                                                                  because employees are more trustworthy than that

                                                                                                                  If you trust someone to not take advantage of an incredibly poorly thought out policy that allows them to get as much free money as they like without doing five minutes of work, then you’re a naive fool.

                                                                                                                  because an employee who did that would have zero productivity and likely get fired

                                                                                                                  You can’t fire someone for taking leave. If it’s ‘unlimited leave’ then it’s unlimited leave. They aren’t expected to be productive when they’re on leave when they take a month of leave, so why would they be expected to be productive on leave when they take 6 months or 12 months of leave in a year?

                                                                                                                  because vacations require manager approval and no one would approve the whole year.

                                                                                                                  Okay, so the actual answer is ‘it’s not actually unlimited leave’?

                                                                                                                  At my company in particular, you need “extra special” approval to get more than two weeks in a row, even. But taking almost 6 weeks in drips and drabs is easy to do.

                                                                                                                  That’s not unlimited leave, that’s 6 weeks of leave, but where if you take fewer than 6 weeks of leave you don’t accrue more that you can take the next year or be paid out for when you leave. In other words, it’s really shitty leave.

                                                                                                                  1. 1

                                                                                                                    no one would approve the whole year.

                                                                                                                    So it’s not unlimited. That’s the issue I have with this - there’s obviously an upper limit to how many days one can take, and I don’t see why the company would keep that information a secret. I prefer things to be clear from day one and the same for everybody. Otherwise it’s just those who remember to take days off, or those who get along well with the manager who get more vacation days, it’s basically a policy that’s not fair to all employees.

                                                                                                              3. 2

                                                                                                                That might be true in some places, but it’s certainly not true everywhere. The last place I worked, ‘flexible holidays’ meant that while they expected you to take holidays they were pretty much fine with you taking them whenever you wanted.

                                                                                                                ‘Flexible hours’ meant you were expected to be there 10:00-15:00 on Monday-Friday and when you did the rest of your 40 hours per week was up to you. Want to work 6:30-15:00? Cool! Want to work 8:00-17:15 four days a week and 10:00-15:00 on Fridays? Do it. Most people finished around 16:00 on Fridays, for example, and many came in at 9:30 or 10:00 every day or 7:00 or even earlier every day.

                                                                                                                Maybe you should fix your labour laws so that ‘baseline of no holidays’ doesn’t exist.