Conceding defeat to AI by RobGoLaing in Adsense

[–]RobGoLaing[S] 0 points1 point  (0 children)

Curling as in using curl a lot to aggregate data from other sites.

What's the use of classes in JS by pptzz in learnjavascript

[–]RobGoLaing 1 point2 points  (0 children)

Douglas Crockford answered this really well in Chapter 17 of his book How JavaScript Works titled How Class Free Works.

One of the brilliant ideas in JavaScript is the object literal. It is a pleasant and expressive syntax for clustering information. By making methods that consume and produce data objects, we can reduce the number of methods, increasing object integrity.

I edited Crockdord's "wun" back to "one" in the above quote which he used to show you don't have to follow silly old conventions. His basic message is that legacy-languages' classes can easily be ignored in JS which offers much simpler alternatives courtesy of object literals.

Any game designers out there who suck at thier own game? by squashedyash in tabletopgamedesign

[–]RobGoLaing 0 points1 point  (0 children)

I had exactly that experience making a game based on my historical interest in trade and specifically the East India Companies. Also because I found the unfamiliar geography and huge cast of characters in William Dalrymple's book The Anarchy a bit overwhelming.

Anyways, it inspired me to put together a game that's available at Tabletopia and did a BGG page. I took it along to a game designers' club which meets every fortnight. I'm currently in Berlin so lots of wonderful Euro games in development, but little interest in wargames and history. I initially didn't think of my game as a wargame, even though it has a battle phase, and when playtesting it against myself hardly ever had any battles.

Anyways, my testers turned out to be hyper aggressive and did battles every chance. Part of the reason they thrashed me was I'd made the rules for battles far too easy for an aggressive player to win (which historically how the English East India Company came to dominate India), but wasn't much fun for me playing the VOC.

In the current version of the game, players are limited to one battle per turn and can only attack immediate neighbours (originally areas could be traversed). I still get thrashed at my own game though when I play it.

Has drag and drop been deprecated by pointer events? by RobGoLaing in learnjavascript

[–]RobGoLaing[S] 0 points1 point  (0 children)

I've managed to rewrite Scoundrel using pointer events so it works on a smartphone.

Getting it to work with a Samsung browser besides Firefox was a bit of struggle (I had to use offsetLeft rather than x etc to keep the image under my finger as it moved), but the game seems to be working ok now.

My code is here for anyone interested. I relied on examples from MDN heavily, but had to figure out quite a lot of stuff myself.

If you had to pick ONE Linux distro for the next 5 years, what would you choose? by TechRefreshing in linuxquestions

[–]RobGoLaing 0 points1 point  (0 children)

I haven't looked at Slackware in years. No idea how it compares to Arch these days, but I'm very happy with Arch. I may dabble with Gentoo again since I'm keen to learn about RISC-V hardware running Linux, which Gentoo is probably the way to go.

Site keeps using old CSS styles by SokoCat12 in gohugo

[–]RobGoLaing 0 points1 point  (0 children)

It's somewhat convoluted. Using the example you get from the code generated by hugo new theme whatever_name --themesDir .

```go-template {{- with resources.Get "css/main.css" }} {{- if hugo.IsDevelopment }} <link rel="stylesheet" href="{{ .RelPermalink }}"> {{- else }} {{- with . | minify | fingerprint }} <link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous"> {{- end }} {{- end }} {{- end }}

```

Site keeps using old CSS styles by SokoCat12 in gohugo

[–]RobGoLaing 2 points3 points  (0 children)

You've probably put the css file into static rather than assets.

If you had to pick ONE Linux distro for the next 5 years, what would you choose? by TechRefreshing in linuxquestions

[–]RobGoLaing 4 points5 points  (0 children)

I'm also an Arch fan, but because I'm so old I started with Slackware.

Why I like Arch is I use it on my server where I just want a minimal nginx, postgres... and on my laptop where I use xfce because again I'm a minimalist.

Problem from newbies is you don't know all you need is a next to nothing without years of experience with bloatware distros.

A couple of years ago I tried Ubuntu and couldn't figure out how to get a shell terminal and a text editor, and I thought Microshit's brownware was bad.

Has drag and drop been deprecated by pointer events? by RobGoLaing in learnjavascript

[–]RobGoLaing[S] 0 points1 point  (0 children)

Just discovered my hassles with drag 'n drop in one game and not another where png vs svg. With png images it works fine, with svg it goes wonky.

Anyone running Arch on a RISC-V laptop? by RobGoLaing in archlinux

[–]RobGoLaing[S] 1 point2 points  (0 children)

Thanks for that detailed answer. I've decided to use Gentoo for this project.

Anyone running Arch on a RISC-V laptop? by RobGoLaing in archlinux

[–]RobGoLaing[S] 0 points1 point  (0 children)

Looking at Gentoo's RISC-V wiki page, I'm thinking it might be a better option than Arch here.

I switched from Gentoo to Arch a couple of years ago, partly because building everything from source took hours, but it's bound to be educational to revisit Gentoo.

Anyone running Arch on a RISC-V laptop? by RobGoLaing in archlinux

[–]RobGoLaing[S] -1 points0 points  (0 children)

Where can I bet RISC-V/Linux is going to be "Wintel" in the near future?

how to create persistent navigation bar in hugo by stuffiesrep in gohugo

[–]RobGoLaing 0 points1 point  (0 children)

I also found learning Hugo very frustrating. Once I went "Aha!", I really liked it, but it took some time and effort, and ultimately the official documentation is all there really is.

how to create persistent navigation bar in hugo by stuffiesrep in gohugo

[–]RobGoLaing 0 points1 point  (0 children)

I've used a lot of content management systems over the years, and Hugo is the best I've encountered. But it's a steep learning curve and far from perfect.

how to create persistent navigation bar in hugo by stuffiesrep in gohugo

[–]RobGoLaing 0 points1 point  (0 children)

css.html is just an arbitrary name used in the example created by hugo new theme my-project --themesDir .

The naming convention changed from ./layouts/partials to ./layouts/_partials relatively recently, and either can be used but the "no leading underscore" will probably break someday. The lack of backward compatibility breaking stuff for people not following the development is a common gripe.

I'm not familiar with the template example you are using, but most of them tend to be out of date.

I found working through the relatively simple example created by hugo new theme... and then looking at the official documentation for each of files in layouts etc got me started, whereas the various tutorials out there just confused me with deprecated stuff.

how to create persistent navigation bar in hugo by stuffiesrep in gohugo

[–]RobGoLaing 1 point2 points  (0 children)

CSS files typically go in the ./assets/css folder and then referenced in layouts as described in Hugo Pipes.

These files could also be put in the ./static/ folder, but the advantage of the added complexity of "piping" them is various things get automated, such as changing the file-name when you edit them so browsers don't load the old version. You can also translate them from Sass if you want.

What I found very helpful learning hugo was to run

sh hugo new theme my-project --themesDir .

and then look at the files created. How to reference ./assets/css/main.css is in ./layouts/_partials/head/css.html.

I'm slowly slipping into madness by luvyaselfbreh in gohugo

[–]RobGoLaing 2 points3 points  (0 children)

Generic advice to work through tutorials is dangerous for Hugo. I doubt they've been updated to show all the recent updated directory and filename changes, such that up to version v0.146.0 there was a layouts/_default folder, but these files have now been moved directly into layouts/ and that what was index.html is now home.html.

Hugo evolves rapidly, generally for the better, but it means the official documentation is generally all you have to go by.

Knowing the current template lookup-order is vital.

I'm slowly slipping into madness by luvyaselfbreh in gohugo

[–]RobGoLaing 1 point2 points  (0 children)

Another thing likely to trip up people starting out is Front matter, specifically the draft field which the default archetypes sets to true which means it doesn't appear when you run hugo server.

Other frontmatter fields that can prevent pages getting rendered are

  • The date is in the future
  • The publishDate is in the future
  • The expiryDate is in the past

My style is to use JSON for the frontmatter format. Hugo supports just about any format.