Tuesday, December 21, 2021

Recent Questions - Stack Overflow

Recent Questions - Stack Overflow


Concatenating 2 lists into unique outputs

Posted: 21 Dec 2021 11:07 AM PST

I have two lists in Google Sheets. Looking to concatenate the results of both into one list, but quickly as both lists change semi-frequently.

I have a list of stores that rarely changes, and a list of products sold that changes monthly. Looking to combine them into unique values so I can look up off of them.

For example, I have list A with 2 items in it, and list B with 4 items in it. Looking to output:

A1_B1 A1_B2 A1_B3 A1_B4 A2_B1 A2_B2 A2_B3 A2_B4

I wanted to Leran skill in Data Visualization so i would not consider what i choose between these two

Posted: 21 Dec 2021 11:07 AM PST

Which is better PowerBI or Excel in todays era demand? Because i wanted to learn skills in spreadhseet and data visualization .

Replacement for TraceFilter in Azure.WebJobs 3.0+

Posted: 21 Dec 2021 11:07 AM PST

I am upgrading from Microsoft.Azure.WebJobs 2.0.0 to 3.0.30. In our existing code, we have some custom code that uses the TraceFilter from the older SDK, which is no longer present.

Is there a way to port the following code relying on JobHostConfiguration and TraceFilter to the newer SDK?

In Program.Main():

// config was a JobHostConfiguration, which is not present in the newer SDK  config.Tracing.Tracers.Add(new TraceMonitor()                  .Filter(e => (e.Exception is FunctionInvocationException fie ? fie.InnerException : e.Exception)?.IsMonitored() ?? false, "Exception Handler")                  .Subscribe(Process));  
public void Process(TraceFilter filter)  {     var events = filter.GetEvents().Where(e => e.Exception != null);     foreach (var traceEvent in events) {        ...     }  }  

gcc compile with python headers [Cython]

Posted: 21 Dec 2021 11:07 AM PST

Trying to compile a .c file which is obtained by using cython

cython -3 --embed -o test.c test.pyx  

The test.c file is now compiled to a binary with the following command:

gcc -Os -I /usr/include/python3.10 test.c -lpython3.10 -o test  

The binary test runs sucessfully.

However, while distributing the code to multiple systems, running different versions of Python,

gcc -Os `python-config --includes` test.c -lpython3.10 -o test    

python-config --includes can take care of the -I part, what about the -l?

For some Python versions, it is

-lpython3.6m  

Create a python pandas MultiIndex object from separate Index objects

Posted: 21 Dec 2021 11:07 AM PST

Without going into detail why I'd like to do this - is it possible to create a pandas MultiIndex from separate Index objects? I'm specifically interested in somehow preserving the specific Index types in the new MultiIndex instance. Solutions including conversions to and from a dataframe / series, etc. are fine as long as the original separate Index object types (RangeIndex, Int64Index, DatetimeIndex..) survive.

Failed with lean mode, falling back to distributed mode

Posted: 21 Dec 2021 11:06 AM PST

I sometimes will face this issue and I don't have a way to reproduce the issue. It was auto-resolved by itself but it is annoying. Does anyone know how to solve it? I was trying to read data from one sql DB and write it to Kusto.

Snapshot of the error message

Typescript type function without specifying params

Posted: 21 Dec 2021 11:06 AM PST

I'm looking to define a type that loosely defines a function by return type

I could write my type as

type FunctType = (...param:string[]) => RouteLocationRaw  

Which would allow for zero+ string params and enforce that the function return RouteLocationRaw.

Ideally though, I would accept any function with any params, as long as it returns RouteLocationRaw.

Is this possible?

What does this python code with exec() do?

Posted: 21 Dec 2021 11:06 AM PST

exec("".join(map(chr,[int("".join(str({':(': 4,   ':)': 0,   ':/': 7,   ':D': 1,   ':P': 2,   ':S': 3,   ':{': 8,   ';)': 9,   '=)': 5,   '=/': 6}[i]) for i in x.split())) for x in  ":D :D :P  :D :D :(  :D :) =)  :D :D :)  :D :D =/  :( :)  :S :(  :S :( \   :S :(  :D :)  :S :P  :S :P  :S :P  :S :P  :S :P  :S :P  :S :P  :S :P \   ;) =)  ;) =)  ;) =)  ;) =)  :D :)  :S :P  :S :P  :S :P  :S :P  :S :P \   :( =/  :( =)  :S :(  :S :P  :( :S  :S ;)  :S :P  :S :(  :( =)  :( =/ \   :S :P  :S :P  :S :P  :S :P  ;) =)  ;) =)  :( :(  :S :P  :S :P  :( :( \   ;) =)  ;) =)  ;) =)  :( :(  :D :)  :S :P  :S :P  :S :P  :S :P  :( :/ \   :( =/  :S ;)  :( =/  :S ;)  =/ =)  ;) =)  :S ;)  :( :P  ;) =/  :( =/ \   ;) :P  :S :P  :S :P  :( :)  :( =)  :( =)  :D :P :(  ;) =)  ;) =)  :D \  :P :(  :S :P  ;) =)  :( :(  :( :(  ;) =)  :S :P  :( :(  ;) =)  :D :)  \  :S :P  :S :P  :S :P  :D :P :(  =) :{  :( =/  :( :P  :S ;)  :( :/  ;) :\  P  :( =)  ;) :P  :( =/  :S :P  :S ;)  =) :{  :D :P :(  :S :P  :S :P  :\  S :P  ;) =)  :D :P :(  :S :P  :S :P  :D :P :(  :( :)  ;) =)  :D :P :( \   :D :P :(  ;) =)  :( :D  :D :P :(  ;) =)  :( :D  ;) :P  :( :/  :D :)  \  :S :P  :S :P  :S :P  :D :P :(  =) :{  :( =/  :S ;)  :( =/  :D :P :(  :\  D :P :(  :S :(  :D :P :(  :( =/  :S ;)  :( :P  =) :{  :D :P :(  :S :P \   :S :P  :( :)  :S :P  :S :P  :S :P  :S :P  :S :P  :S :P  :S :P  :S :P \   :D :P :(  :S :P  :S :P  :D :P :(  :S :P  ;) =)  :( :/  :D :)  :S :P  \  :S :P  :S :P  :S :P  ;) :P  =) :{  :D :P =/  ;) :(  :D :P =/  ;) :(  :\  D :P =/  ;) :(  :D :P =/  ;) :(  =) :{  :( :/  :S :P  :S :P  :S :P  :S\   :P  :S :P  :S :P  :S :P  :S :P  :S :P  :S :P  ;) =)  ;) =)  :( :(  :S\   :P  :S :P  :( :(  ;) =)  ;) =)  ;) =)  :( :(  :D :)  :S :P  :S :P  :S\   :P  :S :P  :S :P  :( :/  ;) =/  :( =)  :( =/  :( =/  :( =/  :( =/  :(\   =)  :S ;)  ;) :P  :S :P  :S :P  :S :P  :S :P  :S :P  :S :P  :S :P  :S\   :P  :S :P  :S :P  :( :)  :( =)  :( =)  :D :P :(  ;) =)  ;) =)  :D :P \  :(  :S :P  ;) =)  :S :P  :D :P :(  :S ;)  :S :P  ;) =)  :D :P :(  :S :\  P  ;) =)  :( :(  :S :P  :S :P  :S :P  :( :(  :D :)  :S :P  :S :P  :S :\  P  :S :P  :( :/  :S :P  :S :P  :S :P  :S :P  :S :P  :S :P  :S :P  :S :\  P  :S :P  :S :P  ;) :P  :S :P  :S :P  :S :P  :S :P  :S :P  :S :P  :S :\  P  :S :P  :S :P  :S :P  :S :P  ;) =)  :D :P :(  :S :P  :S :P  :D :P :(\    :( :)  ;) =)  :( :D  :D :P :(  :D :P :(  :( :)  ;) =)  :D :P :(  :( \  :)  ;) =)  :D :P :(  ;) :P  :( :/  :( :/  ;) =)  :( :D  :D :)  :S :P  \  :S :P  :S :P  :S :P  ;) =/  :( =)  :( =/  :( :(  ;) =)  ;) =)  ;) =)  \  ;) =)  :( :(  :( =/  :( =)  :S ;)  :S :P  :S :P  :S :P  :S :P  :S :P  \  :S :P  :S :P  :S :P  :S :P  :S :P  :( :)  :S :P  :S :P  :S :P  :S :P  \  :S :P  :S :P  :S :P  :S :P  :S :P  :S :P  :S :P  :S :P  :S :P  :S :P  \  :S :P  ;) =)  :( :/  :D :)  :S :(  :S :(  :S :(  :( :D  :D :)"  .split("  ")])))  

What is the difference between List<string> list = new List<string>() and List<string> list = new List<string>{}?

Posted: 21 Dec 2021 11:06 AM PST

I am new to this project. The previous developer left before I got here so I can't ask them questions.

I am familiar with the use of List<string> list = new List<string>() but I keep also seeing List<string> list = new List<string>{} in the code.

I haven't been able to figure out what he difference is, if any. Nor have I been able to find an answer in my searches yet. It also doesn't seem to make a difference in the code when I interchange them.

The question I have is, is there a difference between these? If so what is it?

Is there a way to have a version of std::atomic's compare_exchange_strong method that exchanges on inequality?

Posted: 21 Dec 2021 11:06 AM PST

I have an atomic type where I need to atomically compare it with a value, and if the two values are not equal then exchange the value of the atomic.

Put another way, where compare_exchange_strong essentially does this operation atomically:

if (atomic_value == expected)      atomic_value = desired;  

...I'm looking for a way to do this:

if (atomic_value != expected)      atomic_value = desired;  

(Yes, I know compare_exchange_strong compares using bitwise equality, not the == operator. And I know the value of expected gets assigned when the comparison fails. This was just for illustration purposes. In my use case I don't need the value of the atomic regardless of the result of the comparison.)

Is there any way to do this without having to fall back on using a lock instead of std::atomic?

How do I open a specified URL to Greasemonkey Open at the specified time?

Posted: 21 Dec 2021 11:07 AM PST

How do I open a specified URL to Greasemonkey addon firefox Open at the specified time? plz tell me how can do it?

How can I set/retrieve list or tuple types in/from python enviroment variables?

Posted: 21 Dec 2021 11:06 AM PST

I'm structuring a Flask application for a test image data bank and need to store the alowed extentions in a enviroment variable. Something like

ALLOWED_EXTENSIONS=['png', 'jpg', 'gif']

which alows me to iterate over it to extention checking, etc.

But, when I retrieve it with os.getenv("ALLOWED_EXTENSIONS"), it's string type, and I can't think in other aproach to convert it into list besides string handling.

Is there a more consistent way to do this?

CSS, GRID, trying keep grid size 3x3 while overflow scrolling the extra

Posted: 21 Dec 2021 11:07 AM PST

I want the grid to be no bigger than 3X3 and then scroll the rest.... Looks great for 9 boxes and less lol!!

This is the look I like but I'm only deriving with 9 boxes or less: Wanted

However anything other than 9 gives me this: not wanted

column-count: 3: not wanted

.container{      height: 70vh;      width: 80vw;      display: grid;      grid-template: repeat(3, 1fr) / repeat(3, 1fr);      -ms-overflow-style: none;      scrollbar-width: none;      overflow-y: scroll;   }    .container::-webkit-scrollbar {      display: none;  }    .box{      margin: 2%;      background-color: blueviolet;  }  

html:

  <!DOCTYPE html>  <html lang="en">  <head>      <meta charset="UTF-8">      <meta http-equiv="X-UA-Compatible" content="IE=edge">      <meta name="viewport" content="width=device-width, initial-scale=1.0">      <link rel="stylesheet" href="/static/style.css">      <title>Routing🖥️</title>  </head>  <body>      <div class = "container">          {% for i in range(num) %}          <div class = "box">hi</div>          {% endfor %}      </div>  </body>  </html>    

Objective: Only show the 3X3 and scroll the rest (at the same size). Please help me fix my overflow /not overflowing problem lol.

FULL JOIN IN GOOGLE SHEETS

Posted: 21 Dec 2021 11:06 AM PST

I am trying to do the full join for the data below in two different sheets.

Sheet 9:

Product ID Name Quantity
1 addi 55
2 fadi 66
3 sadi 33

Sheet10

Product ID Variants Model
1 xyz 2000
2 differ 2001
3 saddd 336
4 fsdfe 2005

Desired output sheet :

Product ID Name Quantity Variants Model
1 addi 55 xyz 2000
2 fadi 66 differ 2001
3 sadi 33 saddd 336
4 fsdfe 2005

Please also share if we have more columns to join like in sheet 1 and sheet 2 has two more columns like Year, product label etc then what should I change in your proposed solution

I am using this formula but its not returning the desired result

=ARRAYFORMULA({QUERY(SORT(UNIQUE({Sheet9!A1:D; Sheet10!A1:D})), "where Col1 is not null"),IFERROR(VLOOKUP(TRANSPOSE(QUERY(TRANSPOSE(QUERY(SORT(UNIQUE({Sheet9!A1:D; Sheet10!A1:D})), "where Col1 is not null")),,999^99)), TRANSPOSE(QUERY(TRANSPOSE(Sheet9!A1:D),,999^99)), Sheet9!C1:C}, 2, 0),""),IFERROR(VLOOKUP(TRANSPOSE(QUERY(TRANSPOSE(QUERY(SORT(UNIQUE({Sheet9!A1:D; Sheet10!A1:D})), "where Col1 is not null")),,999^99)), {TRANSPOSE(QUERY(TRANSPOSE(Sheet10!A1:D),,999^99)), Sheet10!C1:C}, 2, 0),"")}})  

Thanks

Vertical line added in a boxplot does not match to x-axis

Posted: 21 Dec 2021 11:06 AM PST

I want to add vertical lines on a boxplot seaborn every 24 X interval.

My function:

def BoxPlot(data,x_attrib, y_attrib, showfliers=False, orient='h', *args):        sns.set(style="whitegrid", palette="Set3", context='talk', color_codes=False) #défaut            fig, ax = plt.subplots(1,1,figsize=(20,5))       ax = sns.boxplot(x=x_attrib, y=y_attrib, data=data, showfliers = showfliers, orient=orient, palette='Dark2', ax=ax) #palette="Set2")                list_diff_hours = np.sort(data[x_attrib].astype(int).unique())      print(list_diff_hours)      for i in list_diff_hours:        if (i % 24 == 0):          print(f"""Add line x={i}""")          ax.axvline(x = i, color = 'b', label = '12')        ax.set(title=args[0])      ax.set(xlabel=args[1]) # idem ax.set(xlabel=None)      ax.set(ylabel=args[2])        #ax.set(xticklabels=[])  # remove labels from x axis      ax.tick_params(bottom=False)  # remove the ticks                # Show the plot      plt.show()  

I plotted n vertical lines with:

My problem that data['x_attrib'] is not continuous:

    DIFF_HOURS  DIFF_TEMP  0   0.0     0.050886  1   1.0     0.660698  2   2.0     1.656014  3   3.0     2.543857  4   4.0     3.071813  ...     ...     ...  627770  336.0   -7.524095  627771  339.0   -4.180723  627772  342.0   -8.724546  627773  345.0   -10.176562  627774  348.0   -8.047641    627775 rows × 2 columns  

Function execution:

[  0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15  16  17    18  19  20  21  22  23  24  25  26  27  28  29  30  31  32  33  34  35    36  37  38  39  40  41  42  43  44  45  46  47  48  49  50  51  52  53    54  55  56  57  58  59  60  61  62  63  64  65  66  67  68  69  70  71    72  73  74  75  76  77  78  79  80  81  82  83  84  85  86  87  88  89    90  91  92  93  94  95  96  97  98  99 100 101 102 103 104 105 106 107   108 109 110 111 112 113 114 115 116 117 118 119 123 126 129 132 135 138   141 144 147 150 153 156 159 162 165 168 171 174 177 180 183 186 189 192   195 198 201 204 207 210 213 216 219 222 225 228 231 234 237 240 243 246   249 252 255 258 261 264 267 270 273 276 279 282 285 288 291 294 297 300   303 306 309 312 315 318 321 324 327 330 333 336 339 342 345 348 351 354   357]  Add line x=0  Add line x=24  Add line x=48  Add line x=72  Add line x=96  Add line x=144  Add line x=168  Add line x=192  Add line x=216  Add line x=240  Add line x=264  Add line x=288  Add line x=312  Add line x=336  

I should not have lines after last X boxplot value. I don't understand.

To call function:

path = '/xxx'  data2boxplot = pd.read_csv(os.path.join(path, 'merged2_limited.csv'), sep=';')    BoxPlot(data2boxplot,                 'DIFF_HOURS',          'DIFF_TEMP',           False,          'v',          '',                  '',          '')  

Additionally how to put a label on x axis for each line?

enter image description here

Sample Data

DIFF_HOURS,DIFF_TEMP  0.0,0.0508860903513017  1.0,0.6606980150309028  2.0,1.6560138915914993  3.0,2.543856665504201  4.0,3.071813181144403  5.0,1.8228499885861  6.0,-1.0648394742460994  7.0,-2.488141151430004  8.0,-3.367705894714298  9.0,-3.672485488901201  10.0,-2.965489148744801  11.0,-3.054565515742897  12.0,-2.0708812793241016  13.0,-0.7613814777512964  14.0,0.2020813798845964  15.0,0.3136517751847023  16.0,0.7578654959031006  17.0,1.796600153839602  18.0,1.3360555256778  19.0,0.5195588315561004  20.0,-0.1587534779601007  21.0,-0.3501035240801009  22.0,-0.7686862284051017  23.0,-0.4259603228679971  24.0,0.636230830620697  25.0,0.8782201238649989  26.0,0.8752404883571039  27.0,0.9896782693150996  28.0,1.4808193880072018  29.0,1.359074500951401  30.0,0.1090185745514986  31.0,-0.1983728888428011  32.0,-1.2747932083237998  33.0,0.3264950295098004  34.0,1.5323613807559011  35.0,0.6369611820368988  36.0,-0.1668353314066024  37.0,-0.4585072776349008  38.0,-0.7295583937719954  39.0,-0.6062539959064956  40.0,0.5665020058765045  41.0,1.0616182067213984  42.0,1.8872550413563007  43.0,1.915382734552498  44.0,1.0471410630142015  45.0,0.8662996625566991  46.0,1.2746546032826949  47.0,1.0679496294792017  48.0,0.977680775822602  0.0,0.9481029455852016  1.0,2.1050969347580017  2.0,3.2760407873637014  3.0,4.344428893295703  4.0,4.901783099360504  5.0,3.696887332163403  6.0,0.1667104898304003  7.0,-2.371896438511804  8.0,-4.2627128900091975  9.0,-5.002792798693502  10.0,-5.2455918994013  11.0,-3.780849468299799  12.0,-1.0769181236025034  13.0,0.222992037187403  14.0,0.3435438092772962  15.0,0.8102643110400045  16.0,1.4313979808253023  17.0,2.3581243639427005  18.0,2.477428665879401  19.0,1.8329917112030003  20.0,1.533774692003398  21.0,1.5107766037682993  22.0,0.9821263738569002  23.0,0.9859066714612011  24.0,1.5215579940998971  25.0,1.4286036097316988  26.0,1.4520266307993026  27.0,1.5522584243467  28.0,2.2495906999692004  29.0,2.2265263619725  30.0,0.736071352020101  31.0,0.0544039530452984  32.0,-1.6178014448367009  33.0,-0.6747283502522983  34.0,0.0745035742702988  35.0,-1.3139941917547022  36.0,-2.166329466286101  37.0,-1.8654762187255969  38.0,-0.9528454300361986  39.0,0.2444552716616002  40.0,0.3638052974010044  41.0,0.6938993599382997  42.0,1.6715946531027015  43.0,2.2912391124936  44.0,1.9091871864761991  45.0,1.6538121525740976  46.0,1.871403680868596  47.0,1.8755397730923036  48.0,1.683526230989102  49.0,3.9257324576676993  50.0,4.2606635532902  51.0,3.547404399117198  52.0,3.5442721882085984  53.0,2.0273757348208967  54.0,0.9674114895829008  55.0,0.4955297870016011  56.0,0.2259864728987999  57.0,0.291238747112402  58.0,0.0919498398644016  59.0,-0.2344818522044001  60.0,-0.6529058591203025  61.0,-1.3347805797921986  62.0,-1.085802560345197  63.0,-1.1364933815099008  64.0,1.6930235479636018  65.0,3.1144047645493984  66.0,3.0742791475726  67.0,2.5129622649698007  68.0,3.9519612202572993  69.0,3.424352795620901  70.0,3.6924282332803  71.0,3.9638111547679  72.0,3.928898849589199  73.0,4.3853295811086  74.0,4.497082965096396  75.0,4.996047910204702  76.0,5.192069417326497  77.0,3.967237413111  78.0,0.9978052732892984  79.0,-0.9260451604602976  80.0,-1.6127062604781983  81.0,-2.3512202960404984  82.0,-3.023051506510697  83.0,-3.860725480091496  84.0,-4.3561004082297  85.0,-1.9432349456607056  86.0,-0.3325606119583  87.0,0.3767153699817029  88.0,2.5923976945151  89.0,2.6999498567612967  90.0,3.6577365981003993  91.0,3.819267929856804  92.0,4.2311134009189  93.0,3.8719392524307  94.0,4.112123045242598  95.0,3.5670466428843  96.0,3.707961014061997  97.0,3.3575633147774973  98.0,2.609527103988804  99.0,2.6393175591536  100.0,2.841210257546596  101.0,1.9100548192853035  102.0,-0.9261718909340964  1.0,-1.3538390543185983  2.0,-0.4993995934072011  3.0,0.3545493177938006  4.0,0.8099865903292027  5.0,-0.0506968341322  6.0,-0.6804032287808006  7.0,-0.2082854185232037  8.0,0.1630975835187023  9.0,1.3459815168519995  10.0,0.8188580444433953  11.0,1.2689348507551017  12.0,2.5538855454437983  13.0,3.0004117809216027  14.0,2.5512122750664936  15.0,2.405389571822603  16.0,2.191629812401601  17.0,2.2951491862325  18.0,1.2686938279479032  19.0,-2.0014185726731  20.0,-2.6544771602099004  21.0,-2.633052784155602  22.0,-3.092243465084401  23.0,-2.937052744408298  24.0,-2.0957011820857008  25.0,-2.3233501028976  26.0,-2.3927692215934973  27.0,-2.512657772196601  28.0,-1.7964380456293014  29.0,-1.7847067206928993  30.0,-0.2526341077528009  31.0,1.5703263586214966  32.0,1.4113320887482992  33.0,2.9538918436626  34.0,4.0837719685110985  35.0,3.1727485835231017  36.0,1.9205350337043043  37.0,0.8241595096379015  38.0,0.0327764865730984  39.0,0.4453579476395007  40.0,0.0302729352231025  41.0,-0.5416959697029  42.0,-1.340051189759798  43.0,-3.1358167635487004  44.0,-3.659751635387998  45.0,-3.0855913898442995  46.0,-3.200745120168304  47.0,-2.7721319693662  48.0,-2.7245163840206  49.0,-0.3698256650070988  50.0,0.3255698682053989  51.0,0.171604221326298  52.0,0.5237634028585987  53.0,-0.9555386881921032  54.0,-1.1099254073318008  55.0,-1.0289337447369995  56.0,0.0710421633454991  57.0,1.8551764454929007  58.0,3.3021008765933004  59.0,4.493103892326103  60.0,4.459707548881899  61.0,3.8100320431610015  62.0,2.70771353528  63.0,1.811856686758496  64.0,3.1732643515642  65.0,2.7837551373168985  66.0,0.6481714824083014  67.0,-1.5360733736842  68.0,0.2581648129808975  69.0,0.0466600478800991  70.0,0.3247838415439972  71.0,0.480818944133901  72.0,0.3697571191573985  73.0,0.7756447728369977  74.0,0.6264768722090963  75.0,0.5598319716264015  76.0,0.5475730464813999  77.0,-0.5839476160479968  78.0,-1.5219718889375002  79.0,-0.8823618347315012  80.0,0.3616040380187009  81.0,1.4167763945443037  82.0,2.2441204477612047  83.0,2.2022495423586013  84.0,1.816157556111598  85.0,2.9791984000074905  86.0,3.256299154099601  87.0,2.2553796714922  88.0,3.0085705007726986  89.0,1.5769306424971958  90.0,0.8768902546595996  91.0,-0.7117263891153982  92.0,-0.3782886285789999  93.0,-0.1900556523495993  94.0,0.2031325340318979  95.0,-0.4954602383545996  96.0,-0.6076415962878023  97.0,-0.9117851715344008  98.0,-1.4458622670138972  99.0,-1.2197078521700997  100.0,-0.8343423884402021  101.0,-1.5738029409072  102.0,-2.5020333517593976  103.0,-1.4883967580332005  104.0,-0.5267064568487996  105.0,0.3055101751269973  106.0,0.8410028019703972  107.0,0.0563780428751954  108.0,0.3206620074736008  109.0,2.1680835552511013  110.0,0.7204345807845058  111.0,1.0092727386892049  112.0,1.5859000383682975  113.0,2.400175965303301  114.0,1.1687751483999025  115.0,-1.4135078863699988  116.0,-1.6965739903897976  117.0,-1.8758467646699977  118.0,-2.216906436912499  119.0,-2.2461669675342013  123.0,-3.5438322357964016  126.0,-2.634330549200701  129.0,3.1095237582866986  132.0,7.574655737394298  135.0,2.0845096505009018  138.0,-0.7407272283859001  141.0,-1.3589556692384015  144.0,-3.1358191915115974  147.0,-0.3873845281203962  150.0,-0.5938085200652985  153.0,0.3747979208253973  156.0,3.5077837934555016  159.0,0.8830075640103026  162.0,-0.6721012052772011  165.0,-3.1283774896485  168.0,-1.567625477271296  171.0,-0.4029477457177997  174.0,-1.2982829966962974  177.0,-0.4720358919086998  180.0,5.048419824699401  189.0,-2.1594860545862  195.0,0.9763107957826024  198.0,-1.0529880563177976  201.0,-2.214585153295502  204.0,-2.6355890021463964  207.0,-2.185078189591998  210.0,-1.0333854681407004  213.0,-1.3780712108308997  216.0,-2.042565978695201  219.0,-1.1856517905460002  222.0,-2.3636010060555  225.0,-2.2247376450717984  228.0,-1.9685004380312991  231.0,0.9751352549206942  234.0,-0.0051869832737025  237.0,-1.179880232604102  240.0,-0.1703304982377993  243.0,-0.1837155289762009  246.0,-1.6687987582940984  249.0,-0.7126965251013004  252.0,0.6958547475151988  255.0,-0.1953486997794016  258.0,-1.170362566589997  261.0,-2.4442778503078024  264.0,-2.869701790766201  267.0,-4.622253130391896  270.0,-5.890969728006404  273.0,-4.098677950872801  276.0,-1.6764041775382026  279.0,-4.262179550511107  282.0,-6.3015133817497  285.0,-6.005815502043498  288.0,-5.378570257987403  291.0,-5.047018048669899  294.0,-5.857756250553898  297.0,-1.8460496728989  300.0,0.9079803925058024  303.0,-0.6062438711246969  306.0,-4.256089629439798  309.0,-5.3899103924226965  312.0,-5.186848294790604  315.0,-4.623624887780702  318.0,-5.099925375859198  321.0,-0.0612520652145001  324.0,2.2867713220248014  327.0,0.1717713032915995  330.0,-3.8374781189160982  333.0,-3.4730529203284988  336.0,-1.0676838067522991  0.0,-0.1459566586928993  1.0,0.0614772121906028  2.0,0.7363874732168014  3.0,1.2031075586225022  4.0,1.9538959368440023  5.0,0.8693056244497015  6.0,-2.007499321760097  7.0,-4.195665168729299  8.0,-3.9699415437067  9.0,-5.135802190955001  10.0,-5.702742608368793  11.0,-4.250843026306498  12.0,-2.340146933246796  13.0,-0.8793467560561012  14.0,-0.2161077788790031  15.0,-0.1077915636018964  16.0,0.768099693175202  17.0,1.7220874184740045  18.0,2.063656233830901  19.0,1.678385038792399  20.0,1.0817611710609008  21.0,0.2852614193162992  22.0,-0.587591679850398  23.0,-1.3162566908359956  24.0,-1.2437537679398003  25.0,-1.0559501484568017  26.0,-0.1837786148366014  27.0,0.9858895387046972  28.0,1.2866163848955026  29.0,0.9351783620958044  30.0,-0.7142171180706995  31.0,-1.9599658748459028  32.0,-1.8583128090592  33.0,-1.3252073519866985  34.0,-1.1712412188778032  35.0,-1.5320732524449987  36.0,-2.1684233260155  37.0,-2.106434459053702  38.0,-0.9668425795828028  39.0,0.1805581214584961  40.0,0.7766958703514001  41.0,1.182157960361501  42.0,1.1584910459410978  43.0,1.0284982444010993  44.0,0.8924115143780007  45.0,0.8486554579783991  46.0,1.2583065174074015  47.0,1.5739775389096025  48.0,1.5734835048864009  0.0,0.3952015147116015  1.0,0.7377887043529014  2.0,1.6047851576544012  3.0,2.325849166181804  4.0,3.379004675116004  5.0,2.208471823802501  6.0,-1.0446257933893968  7.0,-3.3921082965297984  8.0,-3.258990330240202  9.0,-4.071408465300499  10.0,-4.410703748548696  11.0,-3.3792716456841947  12.0,-1.0952086898309972  13.0,-0.7647998780504963  14.0,0.6018091511193973  15.0,0.8874504236594021  16.0,1.310425725629603  17.0,2.089458136459601  18.0,2.27098162978  19.0,1.858444908298999  20.0,1.3866667310050005  21.0,1.3794258588033017  22.0,0.972807690249102  23.0,0.6574421069312031  24.0,0.9866939031244968  25.0,1.0956438204335974  26.0,1.3806613275869992  27.0,1.9521652799865985  28.0,1.8899318101797  29.0,1.4500142465100048  30.0,-0.2740230887754009  31.0,-1.7510969061237027  32.0,-1.8175492591397997  33.0,-1.3322954320065  34.0,-0.9622027189693014  35.0,-0.8674047081823986  36.0,-1.1298251419121996  37.0,-1.3675841468255  38.0,-0.6140622192948015  39.0,-0.0154552517453048  40.0,0.2721064369936989  41.0,0.7982662860750018  42.0,1.479662074118398  43.0,1.9217716271265  44.0,1.9205495499703  45.0,1.898866014190201  46.0,2.305668091427499  47.0,2.5914265141508004  48.0,2.5974296685145006  49.0,2.6649327029623  50.0,2.270721723059601  51.0,2.5149380945251  52.0,2.6214812157153027  53.0,1.8966545214528985  54.0,-0.6647528753270997  55.0,-2.7921635236217037  56.0,-3.8710270692794992  57.0,-3.808989980522398  58.0,-3.262861612133398  59.0,-0.7398446516122057  60.0,0.204042234428293  61.0,0.4463703942047985  62.0,0.1832234428295009  63.0,0.1808788257785991  64.0,0.8871658942551015  65.0,1.8454354759957  66.0,2.092024220061102  67.0,1.9511863337449  68.0,2.0203161107831  69.0,1.4341807348758984  70.0,1.0024733104432997  71.0,0.9848073331137002  72.0,0.4397358522800019  73.0,0.1296178859979022  74.0,-0.3781480265349017  75.0,0.0285207640216995  76.0,0.2803727253850994  77.0,0.0184907562226008  78.0,-1.8255554825655016  79.0,-3.1180966174389013  80.0,-3.6258135772260016  81.0,-3.2916458427972017  82.0,-2.157294786692105  83.0,-0.6099603908906985  84.0,-0.2297082827665022  85.0,-1.2482605184650026  86.0,-1.1461407119243034  87.0,-0.0476702521096044  88.0,0.4045311718668003  89.0,0.2523017364159017  90.0,1.7461879839430985  91.0,1.770547192748101  92.0,1.2773135103536042  93.0,1.6557247868518026  94.0,1.891346210256504  95.0,2.055787014716998  96.0,2.3351465799899955  97.0,2.4125520618094995  98.0,2.443035799030397  99.0,2.8541213190802  100.0,2.9177416026372005  101.0,1.9326161696030013  102.0,0.3172392739786041  1.0,0.9286207747280032  2.0,1.4556391588261022  3.0,1.7251112868489038  4.0,2.4270607023222013  5.0,1.0544704591357998  6.0,-0.7244050077092972  7.0,-1.7045914328533982  8.0,-0.8271018539506017  9.0,-1.4253452668274988  10.0,-0.0992236674891984  11.0,0.0317953069144039  12.0,0.5567005317060065  13.0,0.6302894578386002  14.0,1.7345861284194015  15.0,1.5273450298563027  16.0,1.1883081312150026  17.0,0.8205596935315036  18.0,-0.0621186467461996  19.0,-1.8017738943387016  20.0,-1.8959905338838008  22.0,-2.0441933534308987  23.0,-2.5221742430796965  24.0,-2.4083803504139  25.0,-2.4123860668522035  26.0,-2.2711722441486017  27.0,-1.8669197175185024  28.0,-2.0613691466828  29.0,-2.4587163646538954  30.0,-2.1408043913283983  31.0,-1.0414160900877008  32.0,-0.0807733319557009  33.0,0.6667732260052013  34.0,0.4397750109072973  35.0,1.010480445987202  36.0,1.1869082935332038  37.0,0.9824616187468004  38.0,1.2575810270158991  39.0,1.4847380458479975  40.0,0.9454837917915988  41.0,0.3867869360883027  42.0,-0.5455990241636002  43.0,-2.0888443946824005  44.0,-2.0588567791498997  45.0,-1.7263700277462988  46.0,-0.9624458594607006  47.0,-0.4815377390727989  48.0,-0.3028111564252001  49.0,-0.0528160457777993  50.0,-0.3474254662428002  51.0,0.0411866400990987  52.0,0.116750011163802  53.0,-0.4715022553509023  54.0,-1.0698599924728995  55.0,-1.3100769882233043  56.0,-1.0039878890521976  57.0,-0.6796406908819996  58.0,-0.3198871811542005  59.0,1.0759608773936975  60.0,0.6039382992445965  61.0,1.070072583463798  62.0,0.7061093415399995  63.0,0.0255818223689985  64.0,-0.1668997526619975  65.0,-0.2475401636691004  66.0,-1.3404254515168963  67.0,-2.962668413566103  68.0,-2.3753294689608992  69.0,-2.062904120630801  70.0,-2.360149357273098  71.0,-1.9720304702255007  72.0,-2.1313856696208973  73.0,-2.0325266621062  74.0,-2.3964146958604005  75.0,-1.7929453087177976  76.0,-1.4057418128401018  77.0,-1.6322615854636986  78.0,-2.5601119069714  79.0,-2.9508767745448985  80.0,-1.9094673832161  81.0,-1.154792223779502  82.0,-0.3147406190340049  83.0,0.8393132229029021  84.0,1.0416951255198017  85.0,-0.1339773809966047  86.0,-0.8980408132717983  87.0,-1.0174019175763078  88.0,-2.1795762379056995  89.0,-3.3623235838404995  90.0,-3.0897519949006025  91.0,-3.552197347747597  92.0,-3.2953707612886984  93.0,-2.5085119755689966  94.0,-2.2353894096587967  95.0,-2.107161120921801  96.0,-1.9797086154986017  97.0,-2.3700249951895  98.0,-2.705106623875704  99.0,-2.6108714654967  100.0,-2.6905427108710995  101.0,-3.5249146035029995  103.0,-1.9197423357166985  104.0,-0.8764955688158977  105.0,0.1088363146952993  106.0,1.220153899475502  107.0,1.8617352471708983  108.0,1.9844364332081028  109.0,1.7541343606392985  110.0,0.9440491625158992  111.0,0.379277599632001  112.0,-0.5835490334422992  113.0,-1.5060875426241012  114.0,-2.5448722782830018  115.0,-3.472255493484901  116.0,-3.3124482897155016  117.0,-3.459294499290096  118.0,-3.515504545250401  119.0,-3.2495471637119984  123.0,-3.2534629456914  126.0,-3.907920517118999  129.0,-0.1655151665237006  132.0,1.2390220596054  135.0,0.0651535942233998  138.0,-3.3824740664604  141.0,-3.1727102259943014  144.0,-0.8581871221005991  147.0,-0.6236684467602025  150.0,-1.507933450372601  153.0,0.948615952051  156.0,0.644392381802497  159.0,0.7671592440587993  162.0,-0.6088484719264997  165.0,-0.3190825353973956  168.0,0.9979311032384004  171.0,2.3789051756223003  174.0,-0.2279707531639978  177.0,-2.6147172681903967  180.0,-5.687688081022799  183.0,-4.264250165085496  186.0,-4.086051033316799  189.0,-4.436630448942804  192.0,-1.7462869872545994  195.0,-2.8048389937807947  198.0,-4.598961445100598  201.0,-2.607349136140701  204.0,-4.131877326799  207.0,-2.5662234451172985  210.0,-4.141615945916296  213.0,-4.983479457423299  216.0,-5.799790165241003  219.0,-2.6692345564201965  222.0,-5.703517930211003  225.0,-5.433548056198004  228.0,1.048105662357198  231.0,3.0394180613788  234.0,5.239499224335604  237.0,1.6021590460481008  240.0,0.460489530186301  243.0,-0.4751959422441985  246.0,0.2786735868794015  249.0,6.7205369509407005  252.0,9.463506137181104  255.0,6.2749624728099  258.0,0.0256556625770976  261.0,-1.3705103244422998  264.0,-1.2190090278872994  267.0,0.490321614015901  270.0,0.3373327286749017  273.0,4.689931087450901  276.0,6.927270767326  279.0,6.028349390376397  282.0,0.3743446848848997  285.0,0.5891991768293003  288.0,1.777312492458602  291.0,2.0698136326590006  294.0,0.3598981930848026  297.0,4.702606757084404  300.0,7.159011662508007  303.0,4.974587873807798  306.0,1.399013308151602  309.0,1.4672505352598009  312.0,2.8387602182602976  315.0,3.0050100242769027  318.0,2.8036972988185984  321.0,4.793382051483499  324.0,5.869674302284802  327.0,6.7424981370394965  330.0,4.3204317035522015  333.0,3.6240385820357983  336.0,2.7771457770068007  0.0,-0.4036096780988992  1.0,0.0277671912413985  2.0,-0.4234571785524004  3.0,-0.0971067952294006  4.0,-0.1646330549983972  5.0,-0.9706288617761024  6.0,-2.7976802205024  7.0,-3.846093669865201  8.0,-4.589214919053899  9.0,-4.4296833539210985  10.0,-4.201867499845696  11.0,-1.398403561674403  12.0,-1.452894224313603  13.0,-0.3229703505441037  14.0,0.1172833264055981  15.0,0.2565145610499968  16.0,0.4709111631953036  17.0,1.127451986661498  18.0,1.662596177933203  19.0,1.3699571558042969  20.0,0.919289657257  21.0,-0.1878526042362018  22.0,-0.8743987829260007  23.0,-1.088425539215102  24.0,-1.600459778034498  25.0,-1.9557307205871977  26.0,-2.2852944864269027  27.0,-1.7763967064922994  28.0,-1.4601081813600023  29.0,-0.9107629876002968  30.0,-0.5913007793492007  31.0,-1.157834656194801  32.0,-1.4260668044445026  33.0,-1.5714559977263995  34.0,-1.4619625227327049  35.0,-0.7362994575282968  36.0,-0.5934204266385024  37.0,-1.3755304011086054  38.0,-0.5095352952061987  39.0,0.4141898571318947  40.0,1.0833501193837023  41.0,1.0811141387735006  42.0,1.9707157509842967  43.0,1.9441506861576023  44.0,1.843768622137404  45.0,2.0763030252168018  46.0,1.7778919032969045  47.0,1.4515748491071996  48.0,1.2100787629862957  0.0,1.039198546382103  1.0,1.4060808363307018  2.0,1.2689761918906015  3.0,1.6876551845844998  4.0,1.6567531759614018  5.0,0.8315558640748009  6.0,-1.6632729713663004  7.0,-3.685577899310904  8.0,-4.4257732877616975  9.0,-4.345232570209198  10.0,-3.831917536454597  11.0,-0.7886086284461058  12.0,-0.8121139303394003  13.0,-0.3913496407733987  14.0,-0.6892303091573986  15.0,-1.0272519655630994  16.0,-0.4866409788546982  17.0,0.5831217976239991  18.0,1.0879605728028032  19.0,1.0761344058160986  20.0,1.2949918206431017  21.0,0.8263308071788984  22.0,0.4509620870230009  23.0,0.541095995065799  24.0,0.2204233793434014  25.0,0.2021884463187007  26.0,-0.0521023002186993  27.0,0.3222848149612999  28.0,0.5988001178717965  29.0,0.5970919553363032  30.0,-1.3425320890568029  31.0,-2.6359871384341003  32.0,-2.5580507241316006  33.0,-3.5633986213244  34.0,-4.172359626263905  35.0,-3.1606135602152  36.0,-2.3180192125940025  37.0,-2.5213492943348044  38.0,-1.918410819749397  39.0,-0.8531897131421076  40.0,-0.5131729684236959  41.0,-0.4155793809809012  42.0,0.8921616284075995  43.0,1.2624801338692038  44.0,1.2725731869880048  45.0,1.561841588998604  46.0,1.8675404175618016  47.0,1.9417824416954976  48.0,2.0213581949100963  49.0,1.8232968737440025  50.0,1.6713795104187952  51.0,1.8833890731101024  52.0,1.9565898514737008  53.0,1.1712294374992993  54.0,-0.1848679982981984  55.0,-0.8269120977115989  56.0,-0.8271794916981996  57.0,-0.4298079884441002  58.0,0.2187221265945034  59.0,0.6038884129936974  60.0,0.7946596286585006  61.0,0.8687738375358975  62.0,0.5787591096178986  63.0,0.8845790077969014  64.0,1.0074479356562025  65.0,0.8680342676363964  66.0,1.2120202574065004  67.0,1.5658757422290996  68.0,1.9121373179227  69.0,1.908818082190504  70.0,2.0731325646921985  71.0,2.424235933292902  72.0,2.544312097389497  73.0,2.708851395836703  74.0,2.9001366105491013  75.0,3.2442337580382983  76.0,4.176603280932  77.0,3.486173517551997  78.0,0.8829834333408009  79.0,-0.2867270473338976  80.0,-0.7668052940533023  81.0,-0.3804444401301019  82.0,0.0427422968580017  83.0,-0.0952547562601004  84.0,0.1752267015672011  85.0,0.7686474641468024  86.0,1.1573631118137016  87.0,1.3493051461173984  88.0,1.3965456120345967  89.0,1.503269395314199  90.0,1.8008556843895995  91.0,1.8432560217484983  92.0,2.0040832172458  93.0,2.271802308074101  94.0,3.3265095272156024  95.0,3.607149763048501  96.0,4.4018567495279015  97.0,3.4989871984528023  98.0,3.8458616350106993  99.0,4.627192144447296  100.0,4.996864456083099  101.0,4.384017223420397  102.0,1.2118606158107  1.0,0.1584059146812002  2.0,-0.0422710810052002  3.0,0.3121108946491979  4.0,0.3012659783945004  5.0,-0.372622993161201  6.0,-1.1419045323212984  7.0,-1.3523209566689012  8.0,-0.7453918917859994  9.0,-0.8361894989194987  10.0,-0.4748565995503995  11.0,1.027038445555398  12.0,0.6066669279261987  13.0,0.9075001795461972  14.0,0.5802417617599005  15.0,-0.0198066372031995  16.0,-0.0739965215054994  17.0,-0.0043928435502991  18.0,-1.052988263129297  19.0,-2.9327984110567016  20.0,-2.440980978558102  21.0,-2.5442235520301004  22.0,-2.5275701725229  23.0,-2.2135611948637006  24.0,-2.443283897940997  25.0,-2.5233110840841  26.0,-2.7378275952768014  27.0,-2.1185105849668986  28.0,-1.7998148052238  29.0,-2.005732912447197  30.0,-2.3299193541721017  31.0,-1.8717215505432  32.0,-1.0783941852008  33.0,-0.2626428431053007  34.0,1.2087419169238984  35.0,3.0890077542994017  36.0,3.0859831744521955  37.0,1.2694850671616962  38.0,0.096136345338003  39.0,-0.0058360744168055  40.0,-0.8579317665897008  41.0,-2.101499869479401  42.0,-2.7672424595562006  43.0,-3.341124128384596  44.0,-2.990159901943496  45.0,-2.3638649157862983  46.0,-2.191319097103697  47.0,-2.093379077197003  48.0,-1.6717392131374034  49.0,-1.865123911872299  50.0,-2.144995005626204  51.0,-1.8727376962377  52.0,-1.9267143900937  53.0,-2.7733154019798008  54.0,-2.608001932101597  55.0,-0.9201489836826012  56.0,0.2194995176034027  57.0,1.1449074267136972  58.0,2.1520961437641013  59.0,2.9678628542444976  60.0,3.2597757356275  61.0,3.006455525826801  62.0,2.101336059987201  63.0,1.4663466101524032  64.0,0.4175499859934035  65.0,-0.7651207815850007  66.0,-1.9766218176389003  67.0,-2.6792939536505003  68.0,-2.4901232401959037  69.0,-2.793574254287595  70.0,-2.9241403607009  71.0,-2.9214961037634986  72.0,-2.831098003033801  73.0,-2.5985901088248973  74.0,-2.3238314975130017  75.0,-2.054434352479003  76.0,-1.0949389811626986  77.0,-1.499543122395103  78.0,-2.6922230139208985  79.0,-1.7820011152210995  80.0,-0.6775540239893019  81.0,0.5661510729621  82.0,1.7090062695916008  83.0,1.7098229496096984  84.0,1.8350596714612983  85.0,1.7781301423100049  86.0,1.5270209395636982  87.0,0.5677495714081005  88.0,-0.5779070147848024  89.0,-1.5985390300141018  90.0,-2.8843436606799  91.0,-3.6531419710743016  92.0,-3.1368570585342006  93.0,-2.7872482219278005  94.0,-1.5948362562698968  95.0,-1.2337338495071002  96.0,-0.4814594087474973  97.0,-1.3796559764352985  98.0,-1.016758405524001  99.0,-0.3336501742188034  100.0,-0.0124908490349007  101.0,-0.4591254955074042  102.0,-1.7046340180923991  103.0,-2.0385279823156988  104.0,-0.8221126867023009  105.0,0.3123749831240978  106.0,0.8702267688102978  107.0,-0.8009710795719016  108.0,1.1325529428576004  109.0,3.1904686768132966  110.0,2.9642923972938  111.0,2.5648023393206003  112.0,2.6259412575977024  113.0,1.6444638366968007  114.0,-0.3928903586623989  115.0,-2.208837528829001  116.0,-1.7033542518184994  117.0,-1.1759223247819968  118.0,-0.7268371013310002  119.0,-0.179290956812899  123.0,1.6995964011442015  126.0,-0.9564751403393998  129.0,2.4491633220296047  132.0,1.804410111773301  135.0,1.1901569362663054  138.0,-2.7884915258654  141.0,-3.793874546199704  144.0,0.3191043697955997  147.0,-0.8414748552238969  150.0,-2.3995930327342023  153.0,-1.3478701973471985  156.0,0.5398694831379984  159.0,2.7227897166740966  162.0,-0.9947717465670962  165.0,-1.2100169251434991  168.0,-1.6093793226776043  171.0,1.3643049672529024  174.0,-2.121432282991403  177.0,-7.338827111269102  180.0,-8.059594368203001  183.0,-6.703410630180098  186.0,2.0881489524899024  189.0,0.6911943010101993  192.0,1.2003755601024009  195.0,0.8651961787615008  198.0,0.9361071303318004  201.0,5.758962330985899  204.0,4.665616167039302  207.0,0.9754068890282994  210.0,-1.7039656750764998  213.0,-2.5131268943295986  216.0,-1.929969327456  219.0,-0.1395818071250989  222.0,-0.2319067961754992  225.0,1.0158127425640018  228.0,2.7657979196659  231.0,1.8335651681357  234.0,-1.1727980557473003  237.0,-1.4302294406147986  240.0,-0.7764675365631  243.0,-0.2553325558395993  246.0,-1.6008935979452978  249.0,1.2320391546181035  252.0,2.064484340181803  255.0,0.2556331969106012  258.0,-2.5915933888595006  261.0,-2.1948203358837013  264.0,-0.1607927039965027  

Spark integration with Vertica Failing

Posted: 21 Dec 2021 11:07 AM PST

We are using Vertica Community Edition "vertica_community_edition-11.0.1-0", and are using Spark 3.2, with local[*] master. When we are trying to save data in vertica database using following:

member.write()                  .format("com.vertica.spark.datasource.VerticaSource")                  .mode(SaveMode.Overwrite)                  .option("host", "192.168.1.25")                  .option("port", "5433")                  .option("user", "Fred")                  .option("db", "store")                  .option("password", "password")                  //.option("dbschema", "store")                  .option("table", "Test")                  //      .option("staging_fs_url", "hdfs://172.16.20.17:9820")                  .save();  

We are getting following exception:

com.vertica.spark.util.error.ConnectorException: Fatal error: spark context did not exist          at com.vertica.spark.datasource.VerticaSource.extractCatalog(VerticaDatasourceV2.scala:76)          at org.apache.spark.sql.connector.catalog.CatalogV2Util$.getTableProviderCatalog(CatalogV2Util.scala:363)  

Kindly let know how to solve the exception.

Haskell - Checking if a list contains an element atleast N times

Posted: 21 Dec 2021 11:07 AM PST

I am writing a function that checks if a list containts an element at least N times

atLeastNtimes :: Eq a => Int -> a -> [a] -> Bool  atLeastNtimes n a l = n <= (sum [1 | x <- l, (x == a)])  

It is working fine with finite list, but I am struggling to make this work for infinite lists, for example:

atLeastNtimes 100 'a' (repeat 'a')   

Need to resolve Ipopt BinPacking use case using JuMP

Posted: 21 Dec 2021 11:07 AM PST

I want to solve binpacking problem using Ipopt with JuMP which is a linear programming. Can someone help me with the code

How to include a custom xml in logback-spring.xml?

Posted: 21 Dec 2021 11:06 AM PST

I have created a common log back-common.xml. I want to use this file in another file - logback.spring.xml. Please help me with how I can use this efficiently.

As of now, the application is starting but logs are not printed in the console, and logs are not populated to log file. Please help. Don't mark this as duplicate, because I have tried almost everything and I have invested 2 days in this. Other questions related to the same do not have a valid answer attached.

logback-spring.xml

<?xml version="1.0" encoding="UTF-8"?>  <configuration>      <property resource ="application.yml"/>      <springProperty name="NAME" source="spring.application.name" />      <include file="logback-common.xml"/>  </configuration>  

logback-common.xml

<?xml version="1.0" encoding="UTF-8"?>  <configuration>      <include resource="org/springframework/boot/logging/logback/defaults.xml"/>      <include resource="org/springframework/boot/logging/logback/base.xml"/>      <include resource="org/springframework/boot/logging/logback/console-appender.xml"/>      <property name="LOGS" value="./logs" />      <appender name="Console"          class="ch.qos.logback.core.ConsoleAppender">          <layout class="ch.qos.logback.classic.PatternLayout">              <Pattern>                  %black(%d{ISO8601}) %highlight(%-5level) [%blue(%t)] %yellow(%C{1.}): %msg%n%throwable              </Pattern>          </layout>      </appender>        <appender name="RollingFile"          class="ch.qos.logback.core.rolling.RollingFileAppender">          <file>${LOGS}/${NAME}.log</file>          <encoder              class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">              <Pattern>%d %p %C{1.} [%t] %m%n</Pattern>          </encoder>            <rollingPolicy              class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">              <!-- rollover daily and when the file reaches 10 MegaBytes -->              <fileNamePattern>${LOGS}/archived/spring-boot-logger-%d{yyyy-MM-dd}.%i.log              </fileNamePattern>              <timeBasedFileNamingAndTriggeringPolicy                  class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">                  <maxFileSize>10MB</maxFileSize>              </timeBasedFileNamingAndTriggeringPolicy>          </rollingPolicy>      </appender>            <!-- LOG everything at INFO level -->      <root level="info">          <appender-ref ref="RollingFile" />          <appender-ref ref="Console" />      </root>        <!-- LOG "com.baeldung*" at TRACE level -->      <logger name="com.ms" level="trace" additivity="false">          <appender-ref ref="RollingFile" />          <appender-ref ref="Console" />      </logger>            <logger name="org.springframework.core.env.PropertySourcesPropertyResolver" level="trace" additivity="true">      </logger>    </configuration>  

application.yml

spring:    application:      name: Logbacking-service  

enter image description here

C++ and VS: Wrong Formatting after multiple copies of else if block

Posted: 21 Dec 2021 11:06 AM PST

I noticed a strange behaviour of vs community when copying an else if block with a switch statement in it multible times.

If you paste and change it up to 4 times the formatting works fine when you continue coding.

MyClass::MyMethod()  {    ...      if(cond0)    {      ...    }    else if(cond1) //that block was copied    {      ...    }    else if(cond2) //that block was pasted and changed    {      ...    }      .    .    .    else if(cond5) //the last block which was pasted and changed    {      ...    }    else  //formatting continues to work fine    {      ...    }      ...  }  

enter image description here

but if you paste the else-if block one more time this happens

MyClass::MyMethod()  {    ...      if(cond0)    {      ...    }    else if(cond1) //that block was copied    {      ...    }    else if(cond2) //that block was pasted and changed    {      ...    }      .    .    .      else if(cond6) //the last block which was pasted and changed    {        ...    }    else     {//here starts the problem: everything after this line too much left    ...    }    ...    }  

enter image description here

Has Someone an idea how to avoid this?

How to create a query to retrieve most popular insurance product in different age groups

Posted: 21 Dec 2021 11:06 AM PST

This is my schema and I want to retrieve for this db most popular insurance product in different age group.

enter image description here

My idea is this:

select ta.*  from (select client_id, age, count(*) as cnt,               row_number() over (partition by age order by count(*) desc) as seqnum        from policy p join             client c              on p.client_id = c.id cross join             (values (case when age <= 30 and age>=18 then  '18-30'                           when age <= 60 and age>=31 then '31-60'                           when age > 60              then 'over 60'                      end)             ) v(age)        group by client_id, age       ) ta    where seqnum = 1;  

Is this query ok , how can i make it better ?

NSView-based table view with auto layout grows, but does not shrink rows

Posted: 21 Dec 2021 11:07 AM PST

I have a NSTableView in view-based mode (not cell-based) with usesAutomaticRowHeights=YES. The rows have dynamic height that might change at any time. This setup successfully grows table view rows (row content is never clipped), but table view rows don't shrink to the intrinsic row view height when rows get shorter. Calling noteHeightOfRowsWithIndexesChanged: on the table view after layout does not seem to fix the problem, my tableView:heightOfRow: is also not called again after noteHeightOfRowsWithIndexesChanged:.

Is there anything I have missed/isn't documented about using auto layout in NSView-based tableviews with variable row height? After all, growing rows always works without any additional code, they just do not shrink on their own.

NSTableView* tv = [[NSTableView alloc] init];    [tv setTranslatesAutoresizingMaskIntoConstraints:NO];  [tv setUsesAutomaticRowHeights:YES];     // Use auto layout for row height    NSTableColumn* column = [[NSTableColumn alloc] init];  [tv addTableColumn:column];    // Set table view data source and delegate, rows are then loaded...  

How can i call c# asp server side function from js on this code

Posted: 21 Dec 2021 11:06 AM PST

new Promise(function (resolve, reject) {      console.log("calling ajax");      $.ajax({          method: "GET",          url: "https://jsonplaceholder.typicode.com/todos"      })  })  

Permission denied error when running docker image with rust binary

Posted: 21 Dec 2021 11:06 AM PST

I am getting permission denied when trying to run a small rust cli app via a docker container. I can build the image fine, but when I try to run it I get:

docker: Error response from daemon: OCI runtime create failed:   container_linux.go:380:   starting container process caused: exec: "./async-scraper": permission denied:   unknown.  

Dockerfile

FROM clux/muslrust:1.56.1-stable as builder  WORKDIR /volume  COPY . .  RUN cargo build --release    FROM alpine  COPY --from=builder /volume/target/x86_64-unknown-linux-musl/release ./async-scraper  RUN chmod +x ./async-scraper  ENTRYPOINT [ "./async-scraper","$@"]  

Run cmd

sudo docker run --rm -it paul-k/web_scraper:latest -   https://example-url-arg/  

Cargo.toml

[package]  name = "async_web_scraper"  version = "0.1.0"  edition = "2018"    [[bin]]  name = "rat"  path = "src/main.rs"    [lib]  name = "async_scraper"    [dependencies]  select = "0.6.0-alpha.1"  reqwest = { version = "0.11.6", features = ["json"] }  tokio = { version = "1", features = ["full"] }  futures = "0.3.1"  lazy_static = "1.4.0"  url = "2.2.2"  error-chain = "0.12.4"  async-trait = "0.1.51"  simple-error = "0.1.9"  anyhow = "1.0"  log = "0.4.14"  env_logger = "0.9.0"  thiserror = "1.0.30"    [dev-dependencies]  httpmock = "0.6"  tokio-test = "*"  

Docker compiling of image error 'file does not exist'

Posted: 21 Dec 2021 11:06 AM PST

I am trying to create a docker image with a Rust binary, small cli app I made. My docker build command errors when I try to run it with:

sudo docker build -t image/tag .   

Error:

    Step 6/8 : COPY --from=builder /volume/target/x86_64-unknown-linux-       musl/release/async_web_scraper .        COPY failed: stat volume/target/x86_64-unknown-linux-       musl/release/async_web_scraper: file does not exist  

I am using the static linking method with musl. This is my Dockerfile:

   WORKDIR /volume     COPY . .     RUN cargo build --release       FROM alpine     COPY --from=builder /volume/target/x86_64-unknown-linux-      musl/release/async_web_scraper .     WORKDIR /async-root-dir     ENTRYPOINT [ "/async_web_scraper" ]  

I feel like I am close. Any ideas?

thanks

Pass Rustc flags to crate in workspace

Posted: 21 Dec 2021 11:06 AM PST

I have a workspace with two crates: lib and app, where I want to use code from lib in app.

Additionally, I want to have the following Cargo config only in the lib crate to insturment the lib crate with LLVMs SanitizeCoverage (I provide the callback functions of the SanitizeCoverage in the app crate, because they must not be instrumented, otherwise there would be a stack overflow):

[build]  rustflags = [      "-Cpasses=sancov-module",      "-Cllvm-args=-sanitizer-coverage-level=1",      "-Cllvm-args=-sanitizer-coverage-trace-pc-guard",  ]  

Unfortunately, Cargo does not use this config file if it is included in lib/.cargo/config.toml.

I tried to pass the config with a build.rs of the lib crate:

pub fn main() {      println!("cargo:rustc-env=RUSTFLAGS=\"-Cpasses=sancov-module -Cllvm-args=-sanitizer-coverage-level=1 -Cllvm-args=-sanitizer-coverage-trace-pc-guard\"");  }    

But this also does not work (The code is not instrumented, as I've checked with the disassembly afterwards).

Is there any way to do this? I also tried to create two different crates, without a workspace, but then the Cargo config file of the lib crate is also ignored. I also tried to manually create a rlib and link to it manually, but while this works more or less, it is really problematic as I have to export a C interface in that case. Also, this fails if I want to execute it in the Fortanix SGX framework (which is my ultimate goal).

Cannot seem to run Play application in a forked JVM from within SBT

Posted: 21 Dec 2021 11:06 AM PST

I have a Scala Play Framework web-application (using Scala v2.13.7 and Play v2.8.8) built using SBT (v1.5.5).

My build.sbt includes the following:

lazy val root = (project in file("."))  .enablePlugins(PlayScala)  .settings(      // etc.      fork := true,    javaOptions ++= Seq(      "-Xms1G",      "-Xmx8G",    ),  )  

However, a separate JVM for the web-application is not spawned when I execute sbt run, and the memory settings are those of the SBT JVM (-Xms1024m and -Xmx1024m).

Does the PlayScala plugin interfere with or disable forking when running the web-application itself? Can I force the web-application to use a forked JVM from within SBT?

error: linking with `ld` failed: exit status: 1

Posted: 21 Dec 2021 11:06 AM PST

I'm trying to follow this guide as my entry into Solana blockchain development. I'm running into an error when I run the command $anchor build

For context, I'm running wsl. I'm not concerned about the warning, but any help would be much appreciated!

Here are the contents of the error:

error: linking with `ld` failed: exit status: 1    |    = note: "ld" "--version-script=/tmp/rustc7rlvlq/list" "--Bdynamic" "--entry=entrypoint" "--threads=1" "-z" "notext" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.solana_twitter.667be1f5-cgu.0.rcgu.o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.solana_twitter.667be1f5-cgu.1.rcgu.o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.solana_twitter.667be1f5-cgu.10.rcgu.o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.solana_twitter.667be1f5-cgu.11.rcgu.o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.solana_twitter.667be1f5-cgu.12.rcgu.o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.solana_twitter.667be1f5-cgu.13.rcgu.o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.solana_twitter.667be1f5-cgu.14.rcgu.o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.solana_twitter.667be1f5-cgu.15.rcgu.o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.solana_twitter.667be1f5-cgu.2.rcgu.o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.solana_twitter.667be1f5-cgu.3.rcgu.o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.solana_twitter.667be1f5-cgu.4.rcgu.o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.solana_twitter.667be1f5-cgu.5.rcgu.o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.solana_twitter.667be1f5-cgu.6.rcgu.o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.solana_twitter.667be1f5-cgu.7.rcgu.o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.solana_twitter.667be1f5-cgu.8.rcgu.o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.solana_twitter.667be1f5-cgu.9.rcgu.o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.23ok8bvhjt9fifog.rcgu.o" "--as-needed" "-L" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps" "-L" "/home/tai8910/Code/solana-twitter/target/release/deps" "-L" "/home/tai8910/.cache/solana/v1.20/bpf-tools/rust/lib/rustlib/bpfel-unknown-unknown/lib" "-Bstatic" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libanchor_lang-369f9fcce7f9778b.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libbase64-ee92f11b5395c52e.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libsolana_program-9fe9cc99ff752644.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libserde_bytes-5207c42260a7c267.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libhex-6cd04f1b9c696e32.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libsolana_frozen_abi-f9c2f8b8a627f8aa.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libbs58-fe01222278a2eda8.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libbv-c7c0e796134886cb.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/liblazy_static-809b40aac429888e.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libitertools-c458dae8c4611cd8.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libeither-6eeb62e68a9b8e57.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libsha3-24b5c86da1eb0453.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libkeccak-ac25e9c6d97c1dff.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libthiserror-90c773aba6f68987.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libsha2-48f21f103c901542.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libopaque_debug-7a932b68d3299c7b.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libdigest-6389a1260a04b96b.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libblock_buffer-a630a7b4c9084931.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libblock_padding-1a56ee8f16ee908c.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libgeneric_array-d7158a87da87264b.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libtypenum-ef879e2476d2db6d.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/liblog-cc2d231fbaac5454.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libcfg_if-1643e4a2c6efb510.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libnum_traits-67afc00ec41f572f.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libbincode-daf7bb0fce4a700c.rlib"   "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libserde-e445d83f85708c13.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libborsh-701da45de74b9763.rlib" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/libbytemuck-eaed85aa73d5dfbc.rlib" "--start-group" "/home/tai8910/.cache/solana/v1.20/bpf-tools/rust/lib/rustlib/bpfel-unknown-unknown/lib/libstd-b9e47931bb048ddd.rlib" "/home/tai8910/.cache/solana/v1.20/bpf-tools/rust/lib/rustlib/bpfel-unknown-unknown/lib/libpanic_abort-cee38af281743742.rlib" "/home/tai8910/.cache/solana/v1.20/bpf-tools/rust/lib/rustlib/bpfel-unknown-unknown/lib/libstd_detect-4bf956fa4dfc36ef.rlib" "/home/tai8910/.cache/solana/v1.20/bpf-tools/rust/lib/rustlib/bpfel-unknown-unknown/lib/libhashbrown-419e08fa951207df.rlib" "/home/tai8910/.cache/solana/v1.20/bpf-tools/rust/lib/rustlib/bpfel-unknown-unknown/lib/librustc_std_workspace_alloc-f389bcb5a4dc00c1.rlib" "/home/tai8910/.cache/solana/v1.20/bpf-tools/rust/lib/rustlib/bpfel-unknown-unknown/lib/libunwind-9d2b664eda1e59bf.rlib" "/home/tai8910/.cache/solana/v1.20/bpf-tools/rust/lib/rustlib/bpfel-unknown-unknown/lib/libcfg_if-0df5cdc1ad3f0480.rlib" "/home/tai8910/.cache/solana/v1.20/bpf-tools/rust/lib/rustlib/bpfel-unknown-unknown/lib/liblibc-1d523315f98b1675.rlib" "/home/tai8910/.cache/solana/v1.20/bpf-tools/rust/lib/rustlib/bpfel-unknown-unknown/lib/liballoc-38dcdcf486775e23.rlib" "/home/tai8910/.cache/solana/v1.20/bpf-tools/rust/lib/rustlib/bpfel-unknown-unknown/lib/librustc_std_workspace_core-8201043866f2d4dd.rlib" "/home/tai8910/.cache/solana/v1.20/bpf-tools/rust/lib/rustlib/bpfel-unknown-unknown/lib/libcore-a4fd67b7f3cf9226.rlib" "--end-group" "/home/tai8910/.cache/solana/v1.20/bpf-tools/rust/lib/rustlib/bpfel-unknown-unknown/lib/libcompiler_builtins-fcfbbdc9d2a94cb9.rlib" "-Bdynamic" "--script" "/tmp/rustc7rlvlq/rustc-bpfel-linkfile.ld" "-znoexecstack" "-L" "/home/tai8910/.cache/solana/v1.20/bpf-tools/rust/lib/rustlib/bpfel-unknown-unknown/lib" "-o" "/home/tai8910/Code/solana-twitter/target/bpfel-unknown-unknown/release/deps/solana_twitter.so" "--gc-sections" "-shared" "-O1"    = note: ld: unrecognized option '--threads=1'            ld: use the --help option for usage information      warning: `solana-twitter` (lib) generated 1 warning  error: could not compile `solana-twitter` due to previous error; 1 warning emitted  

how can i solve this error in rust cargo build-std?

Posted: 21 Dec 2021 11:06 AM PST

i am writing an os with rust, i already wrote the bootloader in assembly. but in rust, i want to use the unstable build-std feature. i know it needs access to rust-src. i have already installed it using rustup. i ran this command: rustup component add rust-src and it gave me this output: info: component 'rust-src' is up to date but when i try to compile the code using cargo, it gives me this error:

error: "/usr/lib/rustlib/src/rust/Cargo.lock" does not exist, unable to build with the standard library, try:          rustup component add rust-src  

what should i do?

Wrapper causes change in the funcName attribute in custom python logger

Posted: 21 Dec 2021 11:06 AM PST

I have created a wrapper in custom python logger to add additional attributes in the log formatter.

logFormat = logging.Formatter('[%(levelname)s],[%(asctime)-15s], %(API_SERVER)s, %(funcName)s,%(lineno)d, %(message)s')  

Additional Attribute -> API_SERVER

The log shows the wrapper method as the funcName instead of actual funcName.

[DEBUG],[2017-05-23 17:52:13,865], jupiter-api-server, loggingMethodsWrapper,91, Response returned from DolphinD is 200, returning status success, to caller.  

Wrapper Code -->

def loggingMethodsWrapper(self, logLevelMethod, *kargs):      # Calling method logging methods dynamcially      # Add the parameters in the extra if you want to add      # more columns in logging format      getattr(self.log, logLevelMethod)(            *kargs, extra={'API_SERVER': self.API_SERVER})  

1 comment:

  1. Fantastic, I Loved it you wrote very good article. I got what you intend; thankyou you for putting up; I also remember one such article about Solana Blockchain Perks Has The Answer To Everything. It is awesome!

    ReplyDelete