Author Topic: A random thread for small computing things that don't really warrant a thread of their own  (Read 300395 times)

Pingu

  • Put away those fiery biscuits!
  • Mrs Pingu's domestique
    • the Igloo
Just did a Windoze update for the first time in a looooooooooooong time and the lapdancer is still working  :o

Pingu

  • Put away those fiery biscuits!
  • Mrs Pingu's domestique
    • the Igloo
I've just found a bit of SQL someone's written which stumped me. The code is effectively:

Code: [Select]
select decode(column_name, null, null, column_name)
from table_name

Why not just use

Code: [Select]
select column_name
from table_name

?

Mr Larrington

  • A bit ov a lyv wyr by slof standirds
  • Custard Wallah
    • Mr Larrington's Automatic Diary
Q: What does that red light on the front of the WD NAS signify?

Quote from: TFM
The following faults trigger this state:
• Disk SMART failure
• Data volume does not exist
• System volume does not exist
• System thermal shutdown (75° C)

Ulp!

Edit: Or because it's 96% full because stupid Macrium Reflect orphaned four backup sets from before I embiggened the SSD in August.  Old crap removed, light now a soothing blue again.
External Transparent Wall Inspection Operative & Mayor of Mortagne-au-Perche
Satisfying the Bloodlust of the Masses in Peacetime

TheLurker

  • Goes well with magnolia.
I've just found a bit of SQL someone's written which stumped me. The code is effectively:

Code: [Select]
select decode(column_name, null, null, column_name)
from table_name

Why not just use

Code: [Select]
select column_name
from table_name

?

Just goggled it, cos it's not any T-SQL I know.  It's coracle  and I quote "The Oracle/PLSQL DECODE function has the functionality of an IF-THEN-ELSE statement...."

I haven't looked any further than that, but it looks like something like the T-SQL coalesce function which lets you extract the first non-null value from a set of columns*.

*I expect you know that, but just in case you didn't.
Τα πιο όμορφα ταξίδια γίνονται με τις δικές μας δυνάμεις - Φίλοι του Ποδήλατου

I've just found a bit of SQL someone's written which stumped me. The code is effectively:

Code: [Select]
select decode(column_name, null, null, column_name)
from table_name

Why not just use

Code: [Select]
select column_name
from table_name

?

LOL

It's good practice to deal with nulls, otherwise unintended bad things can happen, eg if you're going to use a string function on the result the idiom is
Code: [Select]
select decode(column_name, null, 'null', column_name)
from table_name

I would put your colleague's version in the same box as the very common
Code: [Select]
if (variable == true)
{
  do_stuff();
}

It's harmless but shows the author to be a complete idiot.
Quote from: tiermat
that's not science, it's semantics.

Pingu

  • Put away those fiery biscuits!
  • Mrs Pingu's domestique
    • the Igloo
I've just found a bit of SQL someone's written which stumped me. The code is effectively:

Code: [Select]
select decode(column_name, null, null, column_name)
from table_name

Why not just use

Code: [Select]
select column_name
from table_name

?

Just goggled it, cos it's not any T-SQL I know.  It's coracle  and I quote "The Oracle/PLSQL DECODE function has the functionality of an IF-THEN-ELSE statement...."

I haven't looked any further than that, but it looks like something like the T-SQL coalesce function which lets you extract the first non-null value from a set of columns*.

*I expect you know that, but just in case you didn't.

Nested DECODE is fucking horrible to look through and get any meaning from it  :demon: I found that example deep in the guts of just such a horrible beast. You can use CASE in Oracle SQL these days, but some of my colleagues seem to be rather sadistic.

Mr Larrington

  • A bit ov a lyv wyr by slof standirds
  • Custard Wallah
    • Mr Larrington's Automatic Diary
Could be worse.  It could have GOTOs in it :demon:
External Transparent Wall Inspection Operative & Mayor of Mortagne-au-Perche
Satisfying the Bloodlust of the Masses in Peacetime

woollypigs

  • Mr Peli
    • woollypigs
I'm giving win10 a go, mainly because reasons. Been trying for an hour to reassign a key to be my mute key. In Linux that was dead easy even if it was already assigned to something else. Anyone here knows how to get the key on my keyboard that by default is calculator to become mute. No I don't want a combo I just want one key just like Linux did and like volume up and down do
Current mood: AARRRGGGGHHHHH !!! #bollockstobrexit

Unless it is supported in your keyboard (many do) not sure you can without a little hacking ... something like nircmd http://www.nirsoft.net/utils/nircmd.html may do the job. Alternatively, just use the key combo ;)

If you're new to W10, (or not new but never looked at shortcuts) it is worth having a shufti at https://support.microsoft.com/en-gb/help/12445/windows-keyboard-shortcuts although having said that, one of my faves Win-Shft-S for the snipper, doesn't seem to be listed.

ETA - this may help, too https://www.microsoft.com/accessories/en-gb/support/how-to/keyboard/reassign-keys

Vince

  • Can't climb; won't climb
I've just found a bit of SQL someone's written which stumped me. The code is effectively:

Code: [Select]
select decode(column_name, null, null, column_name)
from table_name

Why not just use

Code: [Select]
select column_name
from table_name

?
I've seen that sort of construct before. It happens when the simple solution doesn't produce the desire results, where the decode did.
I'm sure that not all nulls have the same value.
216km from Marsh Gibbon

David Martin

  • Thats Dr Oi You thankyouverymuch
Is that a situation where null entries would not be returned unless specifically requested through the decode? Does Oracle return nulls when selecting rows and is it SQL or PLSQL code?
"By creating we think. By living we learn" - Patrick Geddes

woollypigs

  • Mr Peli
    • woollypigs
Unless it is supported in your keyboard (many do) not sure you can without a little hacking ... something like nircmd http://www.nirsoft.net/utils/nircmd.html may do the job. Alternatively, just use the key combo ;)

If you're new to W10, (or not new but never looked at shortcuts) it is worth having a shufti at https://support.microsoft.com/en-gb/help/12445/windows-keyboard-shortcuts although having said that, one of my faves Win-Shft-S for the snipper, doesn't seem to be listed.

ETA - this may help, too https://www.microsoft.com/accessories/en-gb/support/how-to/keyboard/reassign-keys
Ha! It is Micky$oft keyboard but is not supported by the Mouse and Keyboard Center. The key opens up calculator, as it did in Linux yet I was able to tell it to mute.  I tried nirsoft but got no joy. need more hacking.
Current mood: AARRRGGGGHHHHH !!! #bollockstobrexit

Afasoas

Is that a situation where null entries would not be returned unless specifically requested through the decode? Does Oracle return nulls when selecting rows and is it SQL or PLSQL code?

For that to be the case, wouldn't the statement be decode(column_name, null, "null", column_name) ?


I've been having a play with pxelinux. Thus far I've managed to add pxe options for debian net install (i386, amd64) and DRBL live (i386, amd64).

I need to have a look into rolling my own distro that will launch desktop -> browser -> hit a certain URL. When I can master that, we can start running the Gigabyte Brixen used to display monitoring information at work sans disks.

I need to dig into chaining in Windows Deployment Services too.

PXE Boot Menu:


PXE Booted DRBL:

Unless it is supported in your keyboard (many do) not sure you can without a little hacking ... something like nircmd http://www.nirsoft.net/utils/nircmd.html may do the job. Alternatively, just use the key combo ;)

If you're new to W10, (or not new but never looked at shortcuts) it is worth having a shufti at https://support.microsoft.com/en-gb/help/12445/windows-keyboard-shortcuts although having said that, one of my faves Win-Shft-S for the snipper, doesn't seem to be listed.

ETA - this may help, too https://www.microsoft.com/accessories/en-gb/support/how-to/keyboard/reassign-keys


Ha! It is Micky$oft keyboard but is not supported by the Mouse and Keyboard Center. The key opens up calculator, as it did in Linux yet I was able to tell it to mute.  I tried nirsoft but got no joy. need more hacking.

Try here....https://www.microsoft.com/accessories/en-gb/downloads

I came across this URL https://www.macave.leclerc/ and thought "That's an unusual TLD ... really?"

And yes, http://data.iana.org/TLD/tlds-alpha-by-domain.txt it is, I must have missed that change. Scrolling through the list produces on or two "oh rly?" It appears for c $200K, .narwhal could be yours

David Martin

  • Thats Dr Oi You thankyouverymuch
Well, after 7 years they have finally agreed to upgrade my desktop at work (Dell 730, 16Gb RAM. I must have been a good boy because they approved the spec I gave them - i7, 512Gb SSD, 32Gb RAM, GeForce 730 graphics card. Now, where am I going to find another 2 monitors to get the most out of this..
"By creating we think. By living we learn" - Patrick Geddes

ian

Error 503 Backend is unhealthy

That's candid. We've all had one of those mornings when we've had to scurry off to the cubicle, sweat on brow and praying there's no one else in there to overhear our tectonic bowel motions.

Kim

  • Timelord
    • Fediverse
I've just learned that:

a) There's a printer on the International Space Station
b) It's an Epson Stylus Color 800
c) They're about to replace it with a customised (to remove the scanning/fax components) HP all-in-one.

I'll be in the corner, despairing for the human race.

T42

  • Apprentice geezer
Reminds me of the daisy-wheel printer on a US sub in The Hunt for Red October. Just about the daftest thing they could have used.
I've dusted off all those old bottles and set them up straight

hellymedic

  • Just do it!
Installed High Sierra last night.

Why oh why has the font I use for Notes changed?

T42

  • Apprentice geezer
You were obviously using the wrong one, and they fixed it.

A bit like effing Firefox, who brought out tab groups back when I was developing my routing site. I set one up specially for useful Internet & routing stuff I had found. I went looking for it this morning: FF has discontinued the feature.  Obviously I shouldn't have wanted to use it.
I've dusted off all those old bottles and set them up straight

Apple appear to be having their security claims challenged https://www.wired.com/story/hackers-say-broke-face-id-security/


I wonder if you could :

a) 3-d print fingerprints
b) 3-d print fingerprint gloves.......

ian

So they fooled facial recognition by making a realistic copy of the face? Blimey, who knew.

So they fooled facial recognition by making a realistic copy of the face? Blimey, who knew.

Ah, but they had made lots of claims that their facial recognition could not be fooled by masks.

They even had Tim Cook showing off the masks they used in their testing:-

"Yes please" said Squirrel "biscuits are our favourite things."

ian

Well that's, erm, a bit stupid. Mind you, you note that people become dumber through proximity to computers. I figure they put out some kind of ray. The knock sense clean out of your head. After a while you can't even spell 'hubris.' I see Tim's problem there. Those faces are huge. Making normal size faces was always going to be better.

Mind you, rather than go through the trouble of making an exact likeness, just go Jack Bauer with a screwdriver and ask nicely. TV, unlike computers, makes us smarter.