Programming

Right, hence my point…

? mine too

Well your statement was a bit tautological since queries written in ANSI compliant SQL will run on every RDBMS, by definition. So I thought you were responding to my original post by proxy of your response to microbet, saying that I work with TSQL but should be able to work it out.

Jeez.

Let’s just say we agree to agree.

2 Likes

In fact, I don’t think even how I “format” my code is ANSI compliant. I use “alias = [expression]” in all my code, so I can align it better. I think the only ANSI compliant syntax is “[expression] AS alias” or the even worse “[expression] alias”

Which is really annoying, because the widths (number of characters) of the aliases are much better aligned with one another than the widths of the expressions.

As a MS BI Dev the only SQL I ever wrote was T-SQL, so :man_shrugging:

But yeah, the whole formatting thing is mostly a matter of taste eg comma before or after.

(Also, a gratuitous “lol SSAS” just to get it off my chest now I don’t have to build that shit any more)

Erm, that’s what I do. I’m a BI dev. I build data warehouses and cubes, SQL & MDX are my bread and butter. Well, MDX is a bit of a dark art, so yeah, I guess I understand the lols.

ETA: not a matter of taste at all. Commas go before or the guillotine comes out :smiley:

Yeah, MDX certainly takes a while to get your head around - the longer you’ve been a set-based SQL guy the worse it is, I think - and there’s scant help online. Best advice is to build many and small, testing each as you go.

The lol was more at SSAS just being hugely time-consuming (build and process) and very clunky (lol again at having to manually process Dims before Measures) workaround for computers being unable to aggregate in real time the data volumes companies are accumulating now.

Took me years and I’m still objectively pretty bad at it. Better than anyone else I’ve worked with, though.

1 Like

Do a lot of research before pulling the trigger on this. It’s a bit of a scandal in the industry that some well known Ivy league schools outsource their bootcamps and aren’t doing any of the actual schooling themselves. I think Western Governers University is a well regarded online program thats pretty affordable if you haven’t looked into them before. GL

2 Likes
    api.onPageChange(() =>{
        domReady(function () {
            document.querySelector('#nav-menu li.heading').addEventListener('mouseover', 
              function () {
                //show submenu
                document.querySelectorAll('#nav-menu li.heading ul').forEach(elem => elem.style.display = 'block');
              }); 

            document.querySelector('#nav-menu li.heading').addEventListener('mouseout', (
              function () {
                //hide submenu
                document.querySelectorAll('#nav-menu li.heading ul').forEach(elem => elem.style.display = 'none');
              });
        });
    });

I am very not sure about this, but give it a try. Use the domReady method from earlier.

If the nav menu has multiple <li>s - then the code will have to be tweaked to use querySelectorAll().forEach(). And the inner selectors will have to be tweaked to use element.querySelectorAll instead of document. Hopefully there’s only one list in the nav menu.

Also assuming this code is all shared, you might start making some methods like:

hideElement(el) { el.style.display = 'none'; } 

showElement(el) { el.style.display = 'block'; }
1 Like

Here’s a typical JS interview question.

What is the output of this code, assuming the selector finds an element and the mouseover fires:

document.querySelector('#nav-menu li.heading').addEventListener('mouseover', 
  function () {
     console.log(this)
   }); 
});
1 Like

The document? That gives me a headache and I’m sure it’s something dumb

It’s either the element returned by the query selector, the addEventListener function, or the anonymous function inside. I would literally just be guessing but I’d say it’s the element - w/o any good way to explain why.

My real answer would be to console.log it and see what it is, then proceed accordingly.

1 Like

Not sure if you meant to, but something seems missing on the threads view.

Didn’t there used to be something on the left?

1 Like

Uncaught SyntaxError: Unexpected token ‘}’

1 Like

It’s the element. You can put this in your console on this page

document.querySelector(’#current-user’).addEventListener(‘mouseover’,
function () {
console.log(this)
});

and mouseover your avatar at the top right

output is

<li id="current-user" class="header-droptown-toggle current-user">...</li>

eta: can I have a jerb?

    api.onPageChange(() =>{
        domReady(function () {
            document.querySelectorAll('#nav-menu li.heading').forEach(elem => elem.addEventListener('mouseover', 
              function () {
                //show submenu
                elem.querySelectorAll('ul').forEach(el => el.style.display = 'block');
              })); 

            document.querySelectorAll('#nav-menu li.heading').forEach(elem => elem.addEventListener('mouseout', (
              function () {
                //hide submenu
                elem.querySelectorAll('ul').forEach(el => el.style.display = 'none');
              }));
        });
    });

Try this.

1 Like

I can’t find any element with id of ‘nav-menu’ on the page. Where does this thing that we’re show/hiding appear?

Did you try clearing cache/cookies

Not sure if that would help or not though