TIL (about the Dark Arts of HTML)
-
-
@anonymous234 Ever since I heard that random fact, I wondered if you can change the cat's colour by e.g. wrapping one paw in thermal insulation. Write random words on the cat's back using its fur colour etc.
Depends how long it takes for the fur to react to a change in temperature, but since I've never heard that they change colour across seasons (i.e. whiter in summer than in winter), I guess it takes too long for that kind of practical joke to be practical.
-
@remi The temperature that affects this is that in the deeper layers of skin when the hair is growing. And since cats are warm-blooded, it is fairly stable.
-
@Gąska I mean if you can do something with them you can do it without them.
-
@Gąska said in TIL (about the Dark Arts of HTML):
, I dread what abominations have been created by its abuse.
I think we (as in, the people before me) were using them as poor-man's global app singleton.
I'm still slowly unfucking it.
-
@Bulb said in TIL (about the Dark Arts of HTML):
@remi The temperature that affects this is that in the deeper layers of skin when the hair is growing. And since cats are warm-blooded, it is fairly stable.
I still think it could be done, but making a marketable Siamese cat mat to do this would be a challenge.
-
TIL that apparently CGI is still a thing and there are new people trying to use it for shit. For some reason.
Naturally I blanched...
'course they come to defend...
-
@Tsaukpaetra said in TIL (about the Dark Arts of HTML):
TIL that apparently CGI is still a thing
Why wouldn't it‽ RFCs don't just go away (and even less so informal ones like 3875).
and there are new people trying to use it for shit. For some reason.
Because it's simple and general. It just stuffs the HTTP headers in environment variables, executes a process and takes its output. So you can write your shit in anything you want¹ and connect it with minimal setup. Of course spawning process is not the most efficient thing in the world, which is why all the application servers and web server plugins exist, but if your shit is going to run twice a Hungarian year, you couldn't care less.
What I am more surprised (well, not really, but I wouldn't) is why anybody still uses Apache HTTPD. Nginx can do everything Apache can, but is smaller and simpler.
Well, almost. It does not have a PHP module, but if they are running it with CGI anyway…
… which means what does surprise me is seeing the combination of PHP and CGI in one sentence—PHP is the one language that almost never was invoked via CGI.
¹ If I was to write management interface for some IoS thing that would have to squeeze in really small space, I'd seriously consider writing it as busybox shell scripts and calling them via CGI from lighttpd. Not exactly comfortable, but very small if you don't need much bling.
-
@Tsaukpaetra said in TIL (about the Dark Arts of HTML):
TIL that apparently CGI is still a thing
My personal web server (that hasn't even had a power cord plugged into it since 2010) was still running a bunch of CGI stuff the last time it was online.
and there are new people trying to use it for shit.
I wouldn't use CGI if I were going to rewrite my website, but it works (± a decade of sitting unused), and I have no plans to do that much of an overhaul on it, if I ever get it online again. It could use cosmetic updates, and very much needs security updates — starting with the decade-old version of Linux that needs to be updated before it gets anywhere near a network, followed by really insecure web user authentication — but the custom DB access (read-only) and display stuff does (almost) exactly what I want it to. If I do anything with it, I'd probably scrap it entirely and pre-generate static pages (Web 1.0 ). It was written in the days when storage was expensive and my site exceeded my ISP's disk quota, but modern web frameworks transfer that much data (mostly useless JS) for each page load. My whole site would use (probably) <1% of my ISP's allocation for personal web hosting.
-
We still have an internal app my team looks after that uses CGI and Perl. It's not ancient and it's still important and gets regular changes. Unless there's a compelling reason to replace the whole thing with something else it'll use CGI forever.
-
@mott555 said in TIL (about the Dark Arts of HTML):
@loopback0 One of our software packages we develop and sell requires me to generate license files for it, otherwise it doesn't work on customer systems. There's sort of an "about" window that has all the relevant info I need to create a license, along with a big "Copy to Clipboard" button. It involves some nasty GUID-looking things I need to enter into our license generator on my end, and if I get a single character wrong, the license won't work on the system.
Do you know how many people click the "Copy to Clipboard" button and send me an email with the required information in text format that I can copy-paste into the license generator? It's almost 0%. And do you know how many people completely ignore the "Copy to Clipboard" button and instead take a screenshot and send me a bitmap image, requiring me to read and hand-type a pile of GUID's into the license generator? It's almost 100%.
I should add "I Hate Users" to my signature. Or change it to a big, long bulleted list.
Why not add a barcode to the dialog?
-
@Tsaukpaetra said in TIL (about the Dark Arts of HTML):
@anonymous234 said in TIL (about the Dark Arts of HTML):
If you took this 3D environment here and tried to do any real work with it you'd just reinvent Windows.
I remember a program that captured Windows apps and 3d-ized them. Wonder what happened to it... It was kinda cool because it would physically raise recognized controls like buttons out of the window a bit.
Unwieldy though, since there was no VR and mouse-and-keyboard controls for manipulating 3d objects wa (and still is to large extent) rather finicky...
So, kind of like Microsoft Bob for the modern age.
-
@brie said in TIL (about the Dark Arts of HTML):
@Tsaukpaetra said in TIL (about the Dark Arts of HTML):
@anonymous234 said in TIL (about the Dark Arts of HTML):
If you took this 3D environment here and tried to do any real work with it you'd just reinvent Windows.
I remember a program that captured Windows apps and 3d-ized them. Wonder what happened to it... It was kinda cool because it would physically raise recognized controls like buttons out of the window a bit.
Unwieldy though, since there was no VR and mouse-and-keyboard controls for manipulating 3d objects wa (and still is to large extent) rather finicky...
So, kind of like Microsoft Bob for the modern age.
If by modern you mean Windows XP...
-
@Tsaukpaetra True, the modern modern age version would be some silly thing like this
-
@anonymous234 said in TIL (about the Dark Arts of HTML):
@Tsaukpaetra True, the modern modern age version would be some silly thing like this
How old is that Promo? HoloLens hasn't had a tether since ever...
-
@Tsaukpaetra said in TIL (about the Dark Arts of HTML):
HoloLens hasn't had a tether since ever...
That's not a tether. That's a hose to deliver liquid Fool-Aid directly into one's brain stem.
-
@loopback0 said in TIL (about the Dark Arts of HTML):
We still have an internal app my team looks after that uses CGI and Perl. It's not ancient and it's still important and gets regular changes. Unless there's a compelling reason to replace the whole thing with something else it'll use CGI forever.
CGI.pm wasn't bad... it was just slow because Apache had to fork a process all the time.
Is it literally just CGI.pm? Or is is the Apache running mod_perl to keep a CGI process running?
-
-
TIL the "resize" attribute can be used in other HTML elements than textareas
<div style="resize: both; overflow: auto; border:solid">Hello world</div>
Look! It resizes!
-
Hmmm, what if I do...
* { resize:both; overflow:auto; }
How's that for a flexible layout!
-
@anonymous234 said in TIL (about the Dark Arts of HTML):
Look! It resizes!No it doesn't. That's just an image. :|
-
I'm a bit fascinated by the first example in MDN's page on resize.
Resizing a centered element feels so special.
-
just casually vertically centering like it's nothing
-
-
@Captain said in TIL (about the Dark Arts of HTML):
keep a CGI process running?
That's an oxymoron. CGI is a way of executing a process to handle the request. A new process for each request.
Of course I can't exclude the possibility that the original writer didn't know that either and used it incorrectly, because PHP is usually not invoked using CGI, but using
mod_php
.
-
@Bulb Um,
mod_perl
keeps a Perl and a copy of CGI.pm in memory, ready to respond to your request...
-
@Captain said in TIL (about the Dark Arts of HTML):
@Bulb Um,
mod_perl
keeps a Perl and a copy of CGI.pm in memory, ready to respond to your request...CGI.pm
≠ CGI.CGI means web server stuffs the request parameters in the environment, executes a new process, feeds it the request body if any on standard input and responds with its standard output, filling in various bits in the headers.
mod_perl
changes this, so it is no longer CGI, though it has the same interface to the script to keep things simpler.
-
@Bulb Don't care. It's a CGI process.
-
@Captain said in TIL (about the Dark Arts of HTML):
@Bulb Don't care. It's a CGI process.
No. It just looks a lot like one, enough that the rest of your code usually can ignore the difference.
-
@dkf If they implement the same API i'm going to be quite happy to call it a damn CGI PROCESS AND NONE OF YA'LLS BITCHING IS GOING TO STOP ME. :slam:
-
@Captain said in TIL (about the Dark Arts of HTML):
If they implement the same API
Guess what, they don't. It looks very similar, but there are subtle differences in behaviour that can easily bite you if you are not aware of them (mainly with the execution of BEGIN blocks and module code). And of course the server configuration is completely different.
-
@Bulb Jesus that takes me back... yeah, I know what you're talking about. The begin blocks that only get run on "compile", so mod_perl doesn't re-run them.
That's not exactly a difference in their API, it's a PERL misfeature.
-
TIL Python has an ellipsis
operatorliteralno idea what it is. Google lead me to SO explaining:Extending this further, Ellipsis is used here to indicate a placeholder for the rest of the array dimensions not specified. Think of it as indicating the full slice
[:]
for all the dimensions in the gap it is placed, so for a 3d array,a[...,0]
is the same asa[:,:,0]
and for 4d,a[:,:,:,0]
, similarly,a[0,...,0]
isa[0,:,:,0]
(with however many colons in the middle make up the full number of dimensions in the array).
-
@topspin TIL Python has extremely permissive indexing syntax. Not that strange in retrospect, but I thought it was limited to slices and integers.
>>> class Indexed(object): def __getitem__(self, key): return key >>> Indexed()['foo',:,1,2:,:4,-3.4] ('foo', slice(None, None, None), 1, slice(2, None, None), slice(None, 4, None), -3.4) >>> Indexed()[...,0] (Ellipsis, 0)
@topspin said in TIL (about the Dark Arts of HTML):
ellipsis
operatorliteralno idea what it istype(Ellipsis)
helpfully remarks<class 'ellipsis'>
. It's just another basic type likeNone
orNotImplemented
that you could theoretically use however you want.Use it in place of
None
to indicate that the script is utterly dumbfounded about whatever the actual value is!
-
@topspin said in TIL (about the Dark Arts of HTML):
TIL Python has an ellipsis
operatorliteralno idea what it is. Google lead me to SO explaining:Extending this further, Ellipsis is used here to indicate a placeholder for the rest of the array dimensions not specified. Think of it as indicating the full slice
[:]
for all the dimensions in the gap it is placed, so for a 3d array,a[...,0]
is the same asa[:,:,0]
and for 4d,a[:,:,:,0]
, similarly,a[0,...,0]
isa[0,:,:,0]
(with however many colons in the middle make up the full number of dimensions in the array).Of course, nothing restrict the syntax to indexing:
>>> ... Ellipsis
The
:
does have special meaning in[]
s though:>>> 1:2 File "<stdin>", line 1 SyntaxError: illegal target for annotation
-
@kazitor said in TIL (about the Dark Arts of HTML):
slice(None, None, None)
Interesting. I was wondering what kind of object the
:
operator produces, but too to figure out.
-
@kazitor said in TIL (about the Dark Arts of HTML):
TIL Python has extremely permissive indexing syntax.
Yes, that's one of its great features IMHO.
-
@ixvedeusi I wish other languages would adopt some of Python's good ideas. Real life example: had to trim a string to the first 100 characters.
Python:
text[:100]
C#:text.Substring(0, Math.Min(text.Length,100));
-
@anonymous234 Its great until it isn't, and then you're left wondering wtf went wrong and where (because the problem propagated far and wide before blowing up your code...)
-
@boomzilla said in TIL (about the Dark Arts of HTML):
Ludwig Boltzmann, haunting his successors, killing them by his own hand from beyond the grave...
-
@dkf said in TIL (about the Dark Arts of HTML):
@anonymous234 Its great until it isn't, and then you're left wondering wtf went wrong and where (because the problem propagated far and wide before blowing up your code...)
care to explain?
it might be because monkey brains are bigger then fox brains, but i'm just not following how your comment is conencted to @anonymous234's... Additional context would be most welcome.
-
-
@boomzilla Guess the actual bombing run was a spectacular sight, unlike some boring controlled demolition, but I'm having the impression that military engineers using explosives to clear ice is quite common thing in places where rivers tend to do that sort of thing?
-
@Applied-Mediocrity said in TIL (about the Dark Arts of HTML):
military engineers using explosives to clear ice is quite common thing in places where rivers tend to do that sort of thing?
In Quebec, we have a special machine to do that
-
@TimeBandit Blowing stuff up is more fun
Edit: <snip>
-
@TimeBandit
That's one icy frog
-
TIL Elle DeGeneres is 61. Talk about not showing your age.
-
@anonymous234 said in TIL (about the Dark Arts of HTML):
@ixvedeusi I wish other languages would adopt some of Python's good ideas. Real life example: had to trim a string to the first 100 characters.
Python:
text[:100]
C#:text.Substring(0, Math.Min(text.Length,100));
It's interesting that the VB.NET assemblies still have a helper for that. I don't know if you can use it from a C# program but it might raise a few eyebrows if you do. No idea why they haven't copied that one to somewhere else by now.
-
@JBert said in TIL (about the Dark Arts of HTML):
It's interesting that the VB.NET assemblies still have a helper for that. I don't know if you can use it from a C# program but it might raise a few eyebrows.
TIL (about the methods; I've never even properly looked at VB.NET)
Yes, you can. Manually add reference to
Microsoft.VisualBasic
and there you go. Although there's lots of other stupid VB cruft that comes with it, I'm tempted
-
@Applied-Mediocrity In the same DLL there's also Microsoft.VisualBasic.FileIO.TextFieldParser, a good-enough CSV/TSV parser.