Another computer question...

What's going on here? It's been popping up when I run a search from the browser bar – anyone else getting similar?

IMG_4879.jpeg
 
What's going on here? It's been popping up when I run a search from the browser bar – anyone else getting similar?

View attachment 7680
I don't usually use Google but I switched (temporarily) to it and didn't get the message. Probably didn't do enough searching to trigger it. One possibility is that you or someone using the same ISP have been bombarding Google with rapid requests. I've had similar messages from other sites when I've only accessed it once. As far as I could tell I wasn't infected with a virus/bot or whatever. So it must be another user(s) on the same ISP (?).
 
I had BBC News on in the background and caught a bit of "Tech Now". Some deformed code scrolled up the screen and I saw a construct which I've probably used but I don't think is good practice.
The code appeared to be Python and went something like
Python:
For i,j in something
    # some code
    if raw < T:
        continue
    # some more code
# end of loop
Isn't it preferable to reverse the condition in the "if" such that
Python:
For i,j in something
    # some code
    if raw >= T:
        # some more code
# end for loop
(In Python the indent replaces { and } in C, Java etc.)

I will probably still use the first construct occasionally, but I think it hampers clarity and complicates debugging. What do other programmers think?
 
I have no idea about Python, but in general it is easier to read code (it requires less nesting) if the exception is tested first. That way, the "break" (if the exception is true) is only one line and nested +1, while the non-exception code doesn't need to be nested at all.
 
I think it hampers clarity and complicates debugging. What do other programmers think?
I use whatever feels right in each particular case, but generally would do what you suggest. Sometimes if the indentation level gets too annoying I'll stick the "continue" or "break" in, but generally that means the function needs splitting up anyway.
I get annoyed with stuff that sticks religiously to 80 character limits as well. It's 2026, not 1986 and we are not using 80x25 displays any more. Of course, excessively long lines get even more annoying, so I usually limit them to about 120.
 
That way, the "break" (if the exception is true) is only one line and nested +1, while the non-exception code doesn't need to be nested at all.
All true, and excessive nesting is a right pain.
It just had me thinking of the old argument that followed early BASIC and FORTRAN IV - the goto statement. The continue is behaving like a "goto end of loop".
I have no idea about Python,
I've written one very short program and waded through other people's code. I only quoted Python as this appeared to be what was listed on "Tech Now". I would have preferred C or, at a push, C++ or Java.
 
Anybody got ideas...

Short of installing zeroconf on network-addressable devices (which I can't), I am reduced to freezing their IP addresses at my router and typing numbers from memory into the address bar. I do have a private web page with links coded, but that's an external access to act as a look-up table for internal accesses, and complex to keep updated!

What I need is a local DNS. Always-on things I could possibly run a DNS on are the Humii or my router (Netgear DGND3700v2). I can't find any such option in the Netgear admin panel.
 
1. Use the HDR. It already has dnsmasq installed, but it's ancient and you'd need to write your own config. file and get it to use it. And you'd need your DHCP server to tell its clients the address (can it?). Gets messy.
2. Use a Raspberry Pi with dnsmasq or Pi-hole setup. The DHCP thing applies here too - maybe install your own DHCP server and disable the router's.
3. Get a better router which has DNS capability built in.
 
And you'd need your DHCP server to tell its clients the address (can it?).
Well, I presume that would then mean no access to a real DNS for everything else, so no!

Use a Raspberry Pi
Yes it would have to take over DHCP, but that means something else having to run 24/7. At least it could be physically local to the router.

Get a better router which has DNS capability built in.
Do they? Sounds like a plan, but for the moment I'll handle the local DNS using neural processing!
 
I would go for option 3, as the other options rely upon another device being up (in addition to the router) for all devices on your network to use DNS.
With an Asus router running ASUSWRT-Merlin firmware, you name the devices on the network (the ones you're interested in), make sure your router's IP is advertised for DNS, set your router's local DHCP domain name to 'home' (or your own preference - but not 'local') and set "Forward local domain queries to upstream DNS" to "No".
 
Last edited:
Well, I presume that would then mean no access to a real DNS for everything else, so no!
Well obviously you presume wrongly.
Mine does. I can't speak for any of the domestic cr@p since I haven't used it for about 10 years. My former DG834s were set to bridge mode and just used as modems until they got replaced with VDSL/fibre equivalents.
 
Back
Top