Help Bites


  • Discourse touched me in a no-no place

    @Arantor SVG can certainly do stuff with fancy gradients, but I'd go with dividing the space in two (along the obvious diagonal line) and apply the right gradient to each. Then set the result as a background image with CSS.



  • @dkf I think you’re still going to end up getting wrecked on the blending doing it that way if not careful.


  • Discourse touched me in a no-no place

    @Arantor said in Help Bites:

    if not careful

    :this_is_fine:



  • @topspin said in Help Bites:

    Not really help, more idle curiosity.

    gradient.jpg

    My thought is



  • Now that you mention it, it indeed looks like an off-center conic gradient. Well spotted!



  • I think you're still going to get bitten on that alpha blend on the edge of the colour change.


  • Discourse touched me in a no-no place

    @Arantor Why? The rendering engine has perfect information to sort it out. It literally knows exactly what it is supposed to do.



  • @dkf not so much the rendering as the declaring of it. But :kneeling_warthog: to actually try to recreate it.


  • BINNED

    @Watson said in Help Bites:

    @topspin said in Help Bites:

    Not really help, more idle curiosity.

    gradient.jpg

    My thought is

    Kind of looks like it, but also doesn't. Or, at least, I don't see how to do it.
    The conical gradient has a hard edge at the seem and soft at the opposite side. More importantly, as far as I understand it, it's the same color along a fixed angle.
    For the reference picture, the seam fades from a hard edge to a soft edge. I don't see how to do such a transition with a conical gradient.

    Bildschirmfoto 2024-04-17 um 10.55.22.png


  • đźš˝ Regular

    To my eyes there seems to be some horizontal banding. So maybe there's a horizontal gradient atop the conical gradient?

    This was the best I could do:

    04e43494-a40c-4bb9-8649-9415610249cc-image.png

    https://jsfiddle.net/832dxpns/


  • BINNED

    @Zecc said in Help Bites:

    Sie haben die maximal zulässige Anzahl an Blinkernutzungen überschritten

    clap.gif

    So maybe there's a horizontal gradient atop the conical gradient?

    I don't think that's it as I think the seam transitions smoothly from soft to hard. But anyway, your attempt looks pretty damn close. đź‘Ť

    EDIT: wait, maybe yours does that too. Doesn't quite look like it to me, but I'm not sure.



  • I'm having a weird bug/situation with SQL Server. We have a document/report/whatever, and we save a JSON representation of it in the database to "freeze".

    My job is to make stored procedures to feed the data into SSRS.

    My main stored procedure does an algorithm like:

    -- Get and save the static json representation
    declare @StaticJSON as json;
    exec GetTheJson @ReportId, @StaticJSON output;
    
    -- Parse out the fields I need.  
    -- Because of the structure of the JSON, this is a little complicated.
    -- I'll hide that complexity in a fake cte (it's actually like 5 cte's):
    
    with QuestionsAndAnswers as (
      do the processing
    )
    
    -- Insert the many rows of questions and answers into a temp table. 
    select *
      into #QuestionsAndAnswersTranspose
      from QuestionsAndAnswers;
    
    
    -- At this point in the script, #QuestionsAndAnswersTranspose contains many rows, 
    -- each one representing a question and a potential answer.
    -- I want to flatten this list of single items into one row with many many columns:
    
    select ( select IsSelected -- the checkbox or radio button is selected
               from #QuestionsAndAnswersTranspose
              where QuestionKeyName = 'blah blah'
                and ChoiceKeyName = 'foo bar'
           ) as FirstSSRSField
         , ( select IsSelected
               from #QuestionsAndAnswersTranspose
              where QuestionKeyName = 'blah blah'         
                and ChoiceKeyName = 'foo bar'
           ) as SecondSSRSField
      -- and many many more fields
      into #QuestionsAndAnswers
    

    This seems to be mostly working. Definitely, the CTEs are working. But this is where I run into weirdness, because some of the fields are unexpectedly yielding null in the big long query.

    I spent some time trying to figure this out and didn't notice any typos. So I went for the big guns and made a very simplified version of the script where I get the frozen JSON, use the CTEs to parse; insert into the temp table; and then ONLY SELECT FIVE COLUMNS, which I copypastad from the main source.

    The five columns are coming in as 0 and 1 instead of null.

    WTF.

    There are "only" like 500 columns, and no error is getting thrown. I mean I know that's a lot of columns, but the documentation for SQL server says a table can store 1024 columns, and a select statement can return like 4096 columns, so I shouldn't be hitting those limits.

    WTF?

    Also, there's no real "logic" to why the nulls are in these 5 columns, right in the middle of the query, and then there are at least a few dozen fields with 1's and 0's following it and working.

    TLDR: query with many columns is returning null; query on the same data (but few columns) is returning expected data.

    Anybody seen something like this? Ideas?


  • Considered Harmful

    @Captain said in Help Bites:

    I want to flatten this list of single items into one row with many many columns

    Maybe look at the pivot operator.


  • Discourse touched me in a no-no place

    This post is deleted!


  • @error said in Help Bites:

    @Captain said in Help Bites:

    I want to flatten this list of single items into one row with many many columns

    Maybe look at the pivot operator.

    I'm not very well versed with the pivot syntax, but from what I remember, it's not quite suitable for this task because 1) I have to pull out two different types of fields (the IsSelected, which is a SQL bit, and AnswerText, which is a long text -- this forces some logic that I'm unclear how I'd implement for pivot), 2) it forces an unnecessary aggregation function.

    I tend to use cross and left apply for my pivoting. But if I take the cross apply approach, it would increase the complexity of the task.

    For example, I could do a select like:

    select QuestionFooBarIsSelected -- I'd probably use a * instead of enumerating them, but this is the idea
         , QuestionFooBazIsSelected
         , QuestionFooBinIsSelected
         , ...
      from dbo.ONE_ROW -- special table we have with one row, for when we need to force a select to return a row
                cross apply ( select IsSelected
                                from #QuestionsAndAnswersTranspose
                               where QuestionKeyName = 'foo'
                                 and ChoiceKeyName = 'bar'
                                   ) UnwantedTableLikeObjectName (QuestionFooBarIsSelected)
    
                 ...
    

    In other words, I still end up with the 500 subqueries.

    I guess I could make one cross apply per question and then name the UnwantedTableLikeObjectName after the question to help manage the conceptual complexity, and then have multiple subselects in an anonymous table constructor (values).

    That could be nice but it doesn't seem worth the effort unless I know it will work.



  • I'd really love an answer to the underlying issue, but I fixed the bug by getting rid of some unnecessary columns getting pulled in by lookups into a couple of reference tables.


Log in to reply