Thursday, October 14, 2021

Recent Questions - Stack Overflow

Recent Questions - Stack Overflow


Custom tenant themes

Posted: 14 Oct 2021 08:30 AM PDT

I am trying to use different dev portal thems for each tenant. I would like to have different looking dev portal based on signed tenant but with the same wso2 instance.

I am using 4.0.0 version. Looking into https://apim.docs.wso2.com/en/latest/reference/customize-product/customizations/customizing-the-developer-portal/overriding-developer-portal-theme/ there is a solution with uploading zipped themes but it is not working for me. I can see only changes included in userTheme.js (part included in Global Theming in docs.

Do you have any experience in tenand based theming?

Thanks.

Segmentation fault (core dumped) in linux anaconda environment

Posted: 14 Oct 2021 08:30 AM PDT

A. Background:

1.Because I need to use GPU to run a python file for deep learning practice. And this python file had been running in google colab successfully.
2.And I tried to run other python file to see whether the result would be core dumped or not. That's true. I found the result is same even I running different py.file. 3.So I guess my shell scripts would be some problems. If my anaconda, tensorflow and python are matched version in linux virtual environment.

B.What I searched for solving this issue.

1.some people said I need to use the command unlimited -c to check something. it seems okay. 2.I have read some issue case and it said the core dumped may connect to the code/memory, but code can be running in jupyter notebook/colab and GPU memory is okay because this is school's GPU.others didn't meet this issue.

  1. My shell scripts. I made a shell scripts below and use the qsub to submit the shell scrip. and the virtual anaconda environment name is edward so I ACTIVATED IT. and the python file is cwgan-gp.learning.py. and it will read a txt file in this python file to predict something. Any problem??
#!/bin/sh  #$ -S /bin/sh  #$ -l h_vmem=3G  #$ -l mem_req=3G  #$ -cwd  #$ -e eerror.txt  #$ -o ooutput.txt        source ~/local/anaconda3/etc/profile.d/conda.sh  conda activate edward    python3  /home/edward/archive/cwgan-gp.learning.py  

when I submit the file it will give me a core dumped result and a core.1134 file. and other python file would be get the same feedback. How can I do???

Programming Blackmagic ATEM using SDK

Posted: 14 Oct 2021 08:30 AM PDT

I'm new on here. I'm a retired programmer. I spent many years writing C code but not much C++ or GUI based applications. I want to write some software for my Blackmagic ATEM. I've done some of this in Python using an API that is no longer supported and doesn't seem to work for methods that control the audio. Hence I am now looking at the SDK for the switcher. I have downloaded and unzipped it, but don't understand much about COM etc. Does anyone know if this SDK can be used with Python (or similar free languages)? Also, what would I have to do to the downloaded stuff so that Python (or whatever) can see it? Do I just add its directory to a LIBPATH? Thanks for any help.

How to design vertical progress bar with Tailwind using Typescript / React

Posted: 14 Oct 2021 08:30 AM PDT

I want to design vertical progress bar like below using Typescript/React and Tailwind combination. The Tailwind documentation provides basic progress bar example as this:

<div class="relative pt-1">    <div class="overflow-hidden h-2 text-xs flex rounded bg-purple-200">        <div style="width:30%"            class="shadow-none flex flex-col text-center whitespace-nowrap text-white justify-center bg-purple-500">        </div>    </div>  </div>  

But I am not sure what is the best strategy I can take for this specific example of vertical progress bar. Any help is appreciated!

enter image description here

How to get all the media source url of a post in WordPress grapghql

Posted: 14 Oct 2021 08:30 AM PDT

I am using the below graphql query to fetch post data and I want all the media source URL in a post and not only the featured media.

query PostBySlug($id: ID!, $idType: PostIdType!) { post(id: $id, idType: $idType) { title excerpt slug date featuredImage { node { sourceUrl } } content } }

Pass Filter Parameter To DBContext

Posted: 14 Oct 2021 08:30 AM PDT

Inside an ASP.Net Core Web app, what is the correct way to pass a value to the DB Context class to use it as a filter?

I need to filter the data returned across all pages of my ASP.Net Core web app. The filter will be based on the logged in user. If the logged in user is from Branch 6108 then they should only see that branch's data. If I use the raw value I can filter by saying

modelBuilder.Entity<Branch>().HasQueryFilter(b => b.BranchID == 6108);  

The problem is we have 50+ branches so the number will be different for any logged in user.

So ideally I want it to say

modelBuilder.Entity<Branch>().HasQueryFilter(b => b.BranchID == branchFilter);  

Where branchFilter is a value I discover and pass after getting the logged in user by using

@User.Identity.Name  

Is it wrong/illegal/bad/whatever I call it to make over 10.000 requests to a website?

Posted: 14 Oct 2021 08:30 AM PDT

So, I wanted to scrape Pixiv, a website that artists upload their arts to show to people. I wanted to download all the illustration of a certain character in my computer, only for personal use, nothing commercial, but this character has over 10.000 illustrations. So I would need to send over 10.000 requests. My question is: can I do it without guilt? What could be the consequences?

How to access second level in json object?

Posted: 14 Oct 2021 08:30 AM PDT

This is JSON object

{   "key": "***************",  "****************": {   "comment": "hello"   }  "text": "world"  }  

I want to return comment field, how?

vscode-remote-ssh does not work with SSH using Azure AD authentication

Posted: 14 Oct 2021 08:30 AM PDT

We are trying to implement remote development model with project specific VMs in Azure and allow users to connect from VS code using Azure AD authentication with MFA. It works great with Public keys but not with Azure AD authentication.

There were some recommendations of disabling localserver option and enable console, so users can click on the device login link and enter code. However, that model is deprecated by Microsoft. So option currently usable is using az ssh module (or something I couldn't find)

https://docs.microsoft.com/en-us/azure/active-directory/devices/howto-vm-sign-in-azure-ad-linux

Appreciate any guidance on how to configure authentication for this model

How do I write a csv to a specific sharepoint folder?

Posted: 14 Oct 2021 08:30 AM PDT

I am trying to write to my company's sharepoint. However, I am having problems doing this. I have tried to use sharepoints capabilities of linking my computer to the sharepoint, and then accessing it using the path provided. Howeverthis method does not work since the script it can only update if my computer is on. I am able to get the website address to the sharepoint's specific folder path I need. However I don't know how to write to it using a website address. Here is my code:

import pandas   from datetime import date   from datetime import datetime  import pytz    east_time = pytz.timezone('America/New_York')  date_time_east = datetime.now(east_time)  date_time_east = date_time_east.strftime("%H")  update_time = "11"    if date_time_east == update_time:      today = date.today()         data = pandas.DataFrame(dataset)       path = "sharepoint path"      date = today.strftime("%m.%d.%y")      csv = ".csv"      final_path = path + date + csv      data.to_csv(final_path)  

Migrate all keys one database to another database by Redis Cli

Posted: 14 Oct 2021 08:30 AM PDT

Want to migrate all keys one one database to another database by redis cli getting error "NOKEY"

Redis Cli >> migrate host port "" 0 5000 auth pass copy keys "NOKEY"

JSON update error - Dictionary update sequence element #0 has length 1; 2 is required

Posted: 14 Oct 2021 08:30 AM PDT

i a trying to update this dictionary but i get an error "dictionary update sequence element #0 has length 1; 2 is required"

{      "ert": [          {              "pos": 0,              "value": 0.0416666679084301,              "interp": 5          },          {              "pos": 1,              "value": 1.0,              "interp": 5          }      ]  }  

i want to append data and this is how it should look

{      "preset1": [          {              "pos": 0,              "value": 0.0416666679084301,              "interp": 5          },          {              "pos": 1,              "value": 1.0,              "interp": 5          }      ],      "preset2": [          {              "pos": 0,              "value": 0.0416666679084301,              "interp": 5          },          {              "pos": 1,              "value": 1.0,              "interp": 5          }      ]  }  

this is my python code and it works for writing a json file or overwriting it but when i try to update the dictionary and append another key like the example above i get the error i mentioned. i tried loading the json updating and writing back in separate open functions but that didnt work either.

keylist = []  for i,key in enumerate(ramp.keys()):      data = { 'pos': i,               'value': ramp.values()[i],               'interp': interplookup.index(ramp.basis()[i])}          keylist.append(data)    dict = { presetname: keylist } #we use the preset name from the pop up window  ##########################################################    #convert dict to json  filepath = path + 'test.json'  json_data = json.dumps(dict, indent=4)  print('Done')    #write - overwrite or append json to disk  ##########################################################  if os.path.isfile(filepath) and os.path.getsize(filepath)>0: #if file exists and is not zero bytes            user = hou.ui.displayMessage('a file already exists', buttons=('Append','Overwrite',))       if user==0:#append mode          with open(filepath,'r+') as f:              dic = json.load(f)              dic.update(json_data)              json.dump(dic, f)      if user==1:#write mode          os.remove(filepath)          with open(filepath,'w') as f:              f.write(json_data)  else:      with open(filepath,'w') as f:          f.write(json_data)  

OIDC - Identifying the Resource Server

Posted: 14 Oct 2021 08:29 AM PDT

If i'm implementing OIDC server which can be used by multiple clients and there are multiple resource servers involved.

In the authorize endpoint, we get only clientId. As per the RFC, we do not get any information about the Resource Server in the authorize end-point. How do I know for which resource server I'm returning the ID token and access token?

Should I have a unique ClientId and is always mapped to a unique resource server?

So if client App A wants to use OIDC with Resource Server X => then client Id will be ID1

if client App A wants to use OIDC with Resource Server Y => then client Id will be ID2

So based on the Client-ID we will know what the resource server is.

How to read the static typing info from typescript at build time?

Posted: 14 Oct 2021 08:29 AM PDT

I want to create a script to generate a file with node containing the return type of certain functions automatically. How can I read that kind of information from a file within the context of a project (including potentially types imported from other modules)?

I'd think this is certainly possible, since that's basically the kind of info that vscode reads for intellisense, but don't have any idea where to start reading that info.

Clickhouse create table query throwing syntax error

Posted: 14 Oct 2021 08:29 AM PDT

I am executing the below-given query but it throwing an error. I am new to clickhouse can you please assist me with how to fix it?

CREATE TABLE rapidTax.mutualFund (      `id` varchar(255),      `mutualFundId` varchar(255) DEFAULT NULL,      `date` date DEFAULT NULL,      `nav` float DEFAULT NULL,        INDEX mutualFundIdIndex mutualFundId,      INDEX dateIndex date  ) ENGINE = MergeTree(),  PRIMARY KEY id  

Throwing Error:

Code: 62. DB::Exception: Syntax error: failed at position 247 ('dateIndex') (line 8, col 11): dateIndex date ) ENGINE = MergeTree(), PRIMARY KEY id. Expected one of: Comma, Arrow, token. (SYNTAX_ERROR) (version 21.9.4.35 (official build))

I was creating a collage method that had the use of static, I was wondering how I could invoke this method without calling out Picture p1/p2/p3?

Posted: 14 Oct 2021 08:29 AM PDT

//I want to know how to invoke createCollage without calling p1, p2, and p3, due to static. //This is my current use in my AdvanceCollage class:
Picture combine = new Picture(3*pictObj.getWidth(), pictObj.getHeight()); combine.createCollage(p1,p2,p3); //goal is to use the method without p1,p2,p3
combine.explore();


public static void createCollage(Picture p1, Picture p2, Picture p3) { Pixel sPixel = null, tPixel = null, sPixel2 = null, tPixel2 = null, sPixel3 = null, tPixel3 = null; int targetX = 0, targetX2 = 0, targetX3 = 0, targetY = 0, targetY2 = 0, targetY3 = 0;

    // Add the first picture      for (int sourceX = 0; sourceX < p1.getWidth(); sourceX++)      {          for (int sourceY = 0; sourceY < p1.getHeight(); sourceY++)          {              // code to copy the pixels go here              sPixel = p1.getPixel(sourceX,sourceY);              tPixel = p1.getPixel(targetX,targetY);              tPixel.setColor(sPixel.getColor());              // target pixel is (sourceX, sourceY)          }      }      // Add the second picture      for (int sourceX2 = 0; sourceX2 < p2.getWidth(); sourceX2++)      {          for (int sourceY2 = 0; sourceY2 < p2.getHeight(); sourceY2++)          {              // code to copy the pixels go here              sPixel2 = p2.getPixel(sourceX2,sourceY2);              tPixel2 = p2.getPixel(targetX2,targetY2);              tPixel2.setColor(sPixel2.getColor());              // target pixel is (sourceX + pic1.getWidth(), sourceY)          }      }      // Add the third picture      for (int sourceX3 = 0; sourceX3 < p1.getWidth(); sourceX3++)      {          for (int sourceY3 = 0; sourceY3 < p1.getHeight(); sourceY3++)          {              // code to copy the pixels go here              sPixel3 = p3.getPixel(sourceX3,sourceY3);              tPixel3 = p3.getPixel(targetX3,targetY3);              tPixel3.setColor(sPixel3.getColor());              // target pixel is (sourceX + pic1.getWidth() + pic2.getWidth(), sourceY)          }      }  }  

LeanTween.MoveY unexpected results on different devices

Posted: 14 Oct 2021 08:29 AM PDT

I'm using LeanTween for animating my UI. Everything works fine except for an unexpected behavior using the MoveY() method.

Basically what happens is that the movement on the Y axis results different if I change device.

public void ShowAnimation(float position)  {      LeanTween.cancel(this.gameObject);      LeanTween.moveY(this.gameObject, position, 0.7f);  }  

Let's suppose I call the method using ShowAnimation(100.0f), this is what it happens:

iPhone X/XS (2436x1125) -> Moves the gameObject to 110.37f  iPhone XS Max (2688x1242) -> Moves the gameObject to 100.00f  iPhone (1334x750) -> Moves the gameObject to 182.66f  

But... if I change the method adopting the value() method everything works fine.

public void ShowAnimation(float position)  {      LeanTween.cancel(this.gameObject);      LeanTween.value(this.gameObject, MoveObject, 0.0f, position, 0.7f);  }    void MoveObject(float position)  {      this.GetComponent<RectTransform>().anchoredPosition = new Vector2(0.0f, position);  }  

Any help? I don't know why this happens.

Edit: as long as I read, it seems a problem with the Canvas Scaler. Any workaround?

The parameter 'snapshot' can't have a value of 'null' because of its type, but the implicit default value is 'null'

Posted: 14 Oct 2021 08:30 AM PDT

i am getting this error. i have tried putting required word but it shows new errors. can someone please help. I'm stuck at this point.if I put required this.snapshot than it shows error for PostDetails

enter image description here

enter image description here

my code:

  import 'package:cloud_firestore/cloud_firestore.dart';  import 'package:flutter/material.dart';  //ignore: must_be_immutable  class PostDetails extends StatefulWidget {    DocumentSnapshot snapshot;    PostDetails(List<DocumentSnapshot<Object?>> snapshot, {required this.snapshot});      @override    _PostDetailsState createState() => _PostDetailsState();  }    class _PostDetailsState extends State<PostDetails> {    get title => null;      @override    Widget build(BuildContext context) {      return new Scaffold(        appBar: new AppBar(          title: new Text("Post Details"),          backgroundColor: Colors.green,        ),        body: new Card(          elevation: 10.0,          margin: EdgeInsets.all(10.0),          child: new ListView(            children: <Widget>[              new Container(                  padding: EdgeInsets.all(10.0),                  child: Row(                    children: <Widget>[                      new CircleAvatar(                        child: Text(widget.snapshot["title"][0]),                        backgroundColor: Colors.green,                        foregroundColor: Colors.white,                      ),                      new SizedBox(                        width: 10.0,                      ),                      new Text(                        widget.snapshot[title],                        style: TextStyle(fontSize: 22.0, color: Colors.green),                      ),                    ],                  )),              new SizedBox(                height: 7.0,              ),              new Container(                margin: EdgeInsets.all(1.0),                child: new Text(                  widget.snapshot["content"],                  style: TextStyle(fontSize: 18.0),                ),              )            ],          ),        ),      );    }  }  

Your PHP installation appears to be missing the MySQL extension which is required by WordPress on Ubuntu

Posted: 14 Oct 2021 08:30 AM PDT

I am attempting to create a staging WordPress site where the PHP and WordPress versions are very outdated. When I visit localhost, I get the following error:

Your PHP installation appears to be missing the MySQL extension which is required by WordPress.

Ubuntu version: 20.04.2 LTS

PHP version CLI: PHP 7.2.34-24+ubuntu20.04.1+deb.sury.org+1

MySQL version: 8.0.26-0ubuntu0.20.04.3 for Linux on x86_64 ((Ubuntu))

WordPress version: 5.3.9

I need the PHP version to be 7.2.34 and the WordPress version to be 5.3.9.

In my info.php file, the Loaded Configuration path and extension_dir path are as follows:

Loaded Configuration File /etc/php/7.2/apache2/php.ini

extension_dir /usr/lib/php/20170718

Do these need to be the same?

Here is the Client API Library version. I'm a bit confused as to why this error is being thrown, doesn't this mean the extension is installed? I'm aware that in newer MySQL versions it was removed, but I am at a loss as to how to proceed.

Client API library version mysqlnd 5.0.12-dev - 20150407 - $Id: 3591daad22de08524295e1bd073aceeff11e6579 $

I have searched through the similar questions that have been posted, but none of the answers were helpful to this situation. Please let me know if I need to provide more information. Thank you.

Angular (Cannot read properties of null (reading 'addControl') - Change form value in child component

Posted: 14 Oct 2021 08:30 AM PDT

I want to update the form value from the child component. Here is the parent component:

app.component.ts

ngOnInit() {    this.form = this.fb.group({       priority: [this.editPriority, Validators.nullValidator],       .        .       .    });   }  

app.component.html

  <div *ngIf="editType === 'priority'">      <app-child[form]="form"></app-child>    </div>  

child.component.ts:

export class ChildComponent implements OnInit {    @Input() form: FormGroup;    constructor() { }      ngOnInit(): void {    }    }  

child.component.html:

  <div class="col-sm-2">      <label for="priority"> Priority</label>    </div>    <div class="input-group col-sm-10">      <input type="text" class="form-control" id="priority" name="priority" formControlName="priority"             placeholder="priority">    </div>  

I tried like this stackBlitz but I got the below error:

TypeError: Cannot read properties of null (reading 'addControl')

I tried adding:

this.formGroup.addControl('priority', new FormControl());  

inside ngOnInitbut still I got the error.

Any suggestions for updating data through the child component?

fill missing date column in python dataframe

Posted: 14 Oct 2021 08:30 AM PDT

Need help in filling gaps for missing beginning date of a month in df_1 (for example: 03, 04, 05, and 07 to 12), I need to have a continuous months (i.e. 12) .

In: df_1 = pd.DataFrame([['2021-01-01', 'Supp_1', 'Product_1', '1'],                           ['2021-02-01', 'Supp_1', 'Product_1', 1],                           ['2021-06-01','Supp_1', 'Product_1', 1],                           ['2021-12-01', 'Supp_1', 'Product_1', 1.25]],                          columns=['Date','Supplier','Product','Cost'])  Out: df_1      Date    Supplier    Product     Cost  0   2021-01-01  Supp_1  Product_1   1  1   2021-02-01  Supp_1  Product_1   1  2   2021-06-01  Supp_1  Product_1   1  3   2021-12-01  Supp_1  Product_1   1.25  

Expected result is,

      Date     Supplier Product     Cost  0   2021-01-01  Supp_1  Product_1   1  1   2021-02-01  Supp_1  Product_1   1  2   2021-03-01  Supp_1  Product_1     3   2021-04-01  Supp_1  Product_1     4   2021-05-01  Supp_1  Product_1     5   2021-06-01  Supp_1  Product_1   1  6   2021-07-01  Supp_1  Product_1     7   2021-08-01  Supp_1  Product_1     8   2021-09-01  Supp_1  Product_1     9   2021-10-01  Supp_1  Product_1     10  2021-11-01  Supp_1  Product_1     11  2021-12-01  Supp_1  Product_1   1.25  

Once we have the df_2, then I can use ffill() and bfill() to fill the gaps for 'Cost'

Why reduce with async function returns only the last object

Posted: 14 Oct 2021 08:30 AM PDT

I'm trying to set random number to all fruits in array and return an object containing all the fruits with async function in reducer, but only the last element of array is returned

(async () =>    console.log(      await [("apple", "banana", "orange")].reduce(async (o, fruit) => {        const random_number = await new Promise((resolve) => setTimeout(() => resolve(Math.random()), 200));        return { ...o, [fruit]: random_number };      }, {})    ))();

Apache Flume with netcat source requires sending authentication

Posted: 14 Oct 2021 08:30 AM PDT

I have a TCP data source from a third party that requires the following authentication:

nc <host> <port>  A|T|<AUTHENTICATION_TOKEN>  

Is there a way to tell Flume (or any Flume alternative) to send this text on connecting BEFORE receiving the data?

dash exceptions InvalidCallbackReturnValue

Posted: 14 Oct 2021 08:30 AM PDT

I know this question might be asked, but I couldn't find a solution that fits my problem. I'm trying to build a multi layout dash app.

I would like to to change the layout (which contains dcc.Graphs and dbc.Card) everytime I click on a different Tab ( I have 3 of those). The problem is that I have this exception when I run my code: "dash.exceptions.InvalidCallbackReturnValue: The callback for <Output content.children> returned a value having type Dash which is not JSON serializable. "

Below is my code:

import dash_bootstrap_components as dbc  import base64  import dash  from dash.dependencies import Input, Output  import dash_core_components as dcc  import dash_html_components as html  from DashFriends import friends_layout  from DashUser import user_layout  from FriendsUserApp import userfriends_layout      app = dash.Dash(__name__, suppress_callback_exceptions=True, external_stylesheets=[dbc.themes.MINTY],                  meta_tags=[{'name': 'viewport',                              'content': 'width=device-width, initial-scale=1.0'}]                  )  colors = {      'background': '#ffffff',      'text': '#4d94ff',      'plot': '#D1D0CE',      'textfig': '#000000'  }    app_tabs = html.Div(      [          dbc.Tabs(              [                  dbc.Tab(label="My friends", tab_id="tab-friends", labelClassName="text-success font-weight-bold",                          activeLabelClassName="text-danger"),                  dbc.Tab(label="Just me", tab_id="tab-user", labelClassName="text-success font-weight-bold",                          activeLabelClassName="text-danger"),                  dbc.Tab(label="My Friends and I", tab_id="tab-userfriends",                          labelClassName="text-success font-weight-bold",                          activeLabelClassName="text-danger")              ],              id="tabs",              active_tab="tab-user",          ),      ], className="mt-3"  )    app.layout = html.Div(style={'backgroundColor': colors['background']}, children=[      html.H1(          children='Twitter User Analysis',          style={              'textAlign': 'center',              'font-family': 'Garamond',              'font-weight': 'bold',              'color': colors['text']          }      ),      html.Div(children='Get an analysis of a user', style={          'textAlign': 'center',          'font-family': 'Garamond',          'font-weight': 'bold',          'color': colors['text']      }),      html.Br(),      html.Hr(),      dbc.Row(dbc.Col(app_tabs, width=12), className="mb-3"),      html.Br(),      html.Div(id='content', children=[])  ])        @app.callback(      Output(component_id="content", component_property="children"),      [Input(component_id="tabs", component_property="active_tab")]  )    def switch_tab(tab_chosen):      if tab_chosen == "tab-friends":          return friends_layout      elif tab_chosen == "tab-user":          return user_layout      elif tab_chosen == "tab-userfriends":          return userfriends_layout      return html.P("This shouldn't be displayed for now...")      if __name__ == '__main__':      app.run_server(debug=True)  

lc3 Assembly Language Nested Loops

Posted: 14 Oct 2021 08:30 AM PDT

I am trying to print a block of x's for example a 3x4 rectangle using a nested loop in lc3 assembly language and I am having trouble with converting the logic from simple python nested loops into lc3 Assembly language. I am new to this language.

for example this python code here I want to create the same output in lc3 assembly using strictly nested loops. I looked over the web and gave it a shot my self but the only program I could find somewhat similar was a 'hello world' single loop.

heres the python code

x = 'x'  width = 3  length = 4  for i in range(length):      for j in range(width):          print(x, end='')      print()    #output is   # xxx  # xxx  # xxx  # xxx  

Thanks very much!

SageMaker get feature store values with HTTP request

Posted: 14 Oct 2021 08:30 AM PDT

I created a feature group and ingested data to it using the Python SDK of Amazon SageMaker. Now, to get the values of the features I could use the "get_record" API of Python, as shown below:

customer_id = 'xyz  sample_record = sagemaker_session.boto_session.client('sagemaker-featurestore-runtime', region_name=region).get_record(      FeatureGroupName=client_behaviour_feature_group_name, RecordIdentifierValueAsString=str(customer_id))  

It turns out that I wouldn't like to use Python SDK in my production environment, once it's not prepared for that. That's why, I want to know if it's possible to get the records of my feature group in SageMaker using an HTTP request, like if I had an API to consume the production features of my feature store!

I know that a possible option is to use a Lambda function to deploy the Python SDK and consume the features using that Lambda, but using a simple get request from an endpoint seems to be easier.

How to have the same position of the background image in the css background

Posted: 14 Oct 2021 08:29 AM PDT

As you can see from the code, I would like to have the same position of my image in the same place as my gradient. Why? The background image is noise in webp. For the sake of page weight, the noise image is small and repeated in css to simply import a really light image. But suddenly it's a nightmare for the noise to align perfectly with my gradient (superimposed)

div {    width: 500px;    height: 500px;    background-size: initial;    background-repeat: repeat;    background-image: linear-gradient(260deg,#ffab00 10%,rgba(0,0,0,0) 46%), url(https://i.stack.imgur.com/ILZHP.png) !important;  }
<div></div>

Could not find a version that satisfies the requirement selenium; No matching distribution found for selenium while installing Selenium on Python3.6.5

Posted: 14 Oct 2021 08:29 AM PDT

pip install selenium  

throws error as:

Could not find a version that satisfies the requirement selenium;  No matching distribution found for selenium  

Please guide as to how to proceed

Do lambda expressions have any use other than saving lines of code?

Posted: 14 Oct 2021 08:29 AM PDT

Do lambda expressions have any use other than saving lines of code?

Are there any special features provided by lambdas which solved problems which weren't easy to solve? The typical usage I've seen is that instead of writing this:

Comparator<Developer> byName = new Comparator<Developer>() {    @Override    public int compare(Developer o1, Developer o2) {      return o1.getName().compareTo(o2.getName());    }  };  

We can use a lambda expression to shorten the code:

Comparator<Developer> byName =  (Developer o1, Developer o2) -> o1.getName().compareTo(o2.getName());  

Mongoexport -q ISODate query

Posted: 14 Oct 2021 08:29 AM PDT

I'm trying to run this:

mongoexport.exe -h *MYHOST* -p *MYPORT* -q "{'time':{'$gte': ISODate('2014-12-21 12:57:00.506Z'),'$lt': ISODate('2014-12-21 12:59:00.506Z')}}"  

Or this(the gte & lt without - ' ):

mongoexport.exe -h *MYHOST* -p *MYPORT* -q {'time':{$gte: ISODate('2014-12-21 12:57:00.506Z'),$lt: ISODate('2014-12-21 12:59:00.506Z')}}  

The query works fine on Robomongo, But with mongoexport it throws: "too many positional arguments"

I know I can run the following instead, But I don't want to use the date converter everytime I need to execute a query.

mongoexport.exe -h *MYHOST* -p *MYPORT* -q "{'time':{$gte: new Date(14191  66620506),$lt: new Date(1419166740506)}}"  

No comments:

Post a Comment