Sunday, August 1, 2021

Posts from Recent Questions - Stack Overflow for 08/01/2021

View this email in your browser
Updates from https://stackoverflow.com/questions

Recent Questions - Stack Overflow



In the 08/01/2021 edition:

How to show a Vaadin Notification to the User from seperate Thread

By KaijuDeluxe on Aug 01, 2021 04:10 am

I have a Quartz Job which checks every 30 min if there is a software update available. This i trigger in the code below. But i get a Nullpointer at UI.getCurrent(). How can i make a Notification visible, independet on which page the user is?

@Service  @DisallowConcurrentExecution  public class SystemJobCheckForUpdates extends UI implements Job  {    @Override  public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {      UI.getCurrent().access(() -> {          Notification.show("Update available");      });    }  }  

Read in browser »
share on Twitter

How can I get the lambda method called by invokedynamic in Javassist?

By scarvish on Aug 01, 2021 04:08 am

I want to get the name and parameters of lambda methods using Javassist, is there a way to do this?


Read in browser »
share on Twitter

set progress bar value from other activity in android

By user16566034 on Aug 01, 2021 04:08 am

I have a progress bar in viewHolder class inside adapter class. I need to update that bar from another activity UpdateActivity when the method onSavedState in that activity is implemented. I have tried using the interface but it does not update the progress bar, the bar remains as before with no error as well.

public class MyAdapter extends RecyclerView.Adapter<MyAdapter.MyViewHolder> {      public static class MyViewHolder extends RecyclerView.ViewHolder implements MyCallBack{            ProgressBar progressBar;            public MyViewHolder(@NonNull View itemView) {                super(itemView);              progressBar = itemView.findViewById(R.id.progress_bar);          }          @Override          public void updateMyText(int integer) {              progressBar.setProgress(integer);          }      }  }    interface MyCallBack {      public void updateMyText(int integer);  }    public class  UpdateActivity extends AppCompatActivity {  MyCallBack myCallBack;           @Override      public void onSavedState() {              myCallBack = new MyCallBack() {                  @Override                  public void updateMyText(int integer) {                      progressBar.setProgress(100);                      Toast.makeText(PlayerActivity.this, "call back", Toast.LENGTH_SHORT).show();                  }              };            }      }  }  

Read in browser »
share on Twitter

Run Multiple Service in One Container

By Marcin_S on Aug 01, 2021 04:07 am

Below is my script :

fi    if [[ "${1}" == "worker" ]]; then    echo "Starting Celery worker..."    celery --app=superset.tasks.celery_app:app worker -Ofair -l INFO  elif [[ "${1}" == "app-gunicorn" ]]; then    echo "Starting web app..."    /app/docker/docker-entrypoint.sh  fi  

By DOCKERFILE :

ENTRYPOINT ["/usr/bin/my-script.sh"]  

I want to start two process by passing worker and app-gunicorn arguments to my scripts How to do that in docker file so I can have two process running


Read in browser »
share on Twitter

How to parse external JSON multidimensional nested array with PHP foreach operator?

By Fox Cadet on Aug 01, 2021 04:07 am

I'm not familiar with targeting arrays within arrays such as in the JSON data I'm working with. How do you make a foreach loop using PHP for the [1] [2] [3][and so on....] keys (and ultimately the value for [venue]) that are nested inside of [data] in an example like below? This is the format returned to me after I've used json_decode.

<?php  $data = file_get_contents ("https://api.example.com/data.json");  $data = json_decode ($data, true);      print_r($data);  ?>  
Array  (      [count] => 1      [data] => Array          (              [0] => Array                  (                      [location] => Array                          (                              [venue] => Someplace Building                          )                  )              [1] => Array                  (                      [location] => Array                          (                              [venue] => Some Other Building                          )                  )              [2] => Array                  (                      [location] => Array                          (                              [venue] => Some Other Building                          )                  )          )  )  

Read in browser »
share on Twitter

How to fix Uncaught TypeError: moreArrow is null -error? [duplicate]

By Bence Rigó on Aug 01, 2021 04:05 am
// search-box open close js code  let navbar = document.querySelector(".navbar");      // sidebar open close js code  let navLinks = document.querySelector(".nav-links");  let menuOpenBtn = document.querySelector(".navbar .bx-menu");  let menuCloseBtn = document.querySelector(".nav-links .bx-x");  menuOpenBtn.onclick = function() {      navLinks.style.left = "0";  }  menuCloseBtn.onclick = function() {      navLinks.style.left = "-100%";  }      // sidebar submenu open close js code  let htmlcssArrow = document.querySelector(".htmlcss-arrow");  htmlcssArrow.onclick = function() {      navLinks.classList.toggle("show1");  }  let moreArrow = document.querySelector(".more-arrow");  moreArrow.onclick = function() {      navLinks.classList.toggle("show2");  }  let jsArrow = document.querySelector(".js-arrow");  jsArrow.onclick = function() {      navLinks.classList.toggle("show3");  }  

I'm new in the javascript industry and I can't find any solution to fix this code... I'm getting the following error message: Uncaught TypeError: moreArrow is null


Read in browser »
share on Twitter

Does Microsecond Timestamp is enough to avoid duplicate date?

By Susi S on Aug 01, 2021 04:03 am

I want to know if a microsecond timestamp is enough to prevent duplicate datetime?

If that's not enough I want to know what guarantees a unique timestamp? Is there a case where a Database can insert or update less than 1 microsecond?

Why I need a unique timestamp because I am doing data synchronization where rely on DateTime to check if new data available

Thank you


Read in browser »
share on Twitter

unable to find valid certification path to requested target when parse xml url

By Dolphin on Aug 01, 2021 03:52 am

When I am using this code to parse a rss xml source(the app using embedded tomcat and running in CentOS 7.x, using Java 11 AdoptJDK):

package com.dolphin.soa.post;    import com.rometools.rome.feed.synd.SyndFeed;  import com.rometools.rome.io.SyndFeedInput;  import com.rometools.rome.io.XmlReader;  import lombok.extern.slf4j.Slf4j;    import java.net.URL;    /**   * @author dolphin   */  @Slf4j  public class MiniExample {        public static void main(String args) {          try {              URL url = new URL("https://zpblogs.cn/feed/");              SyndFeed feed = new SyndFeedInput().build(new XmlReader(url));              System.out.print(feed.getCopyright());          }catch (Exception e){              log.error("error",e);          }      }  }  

this is the package I am using:

api "com.rometools:rome:1.15.0"  

but show this error:

PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target  

why woud this happen? I have read this question, all tell that should using keytool to import the cert, but my rrs url has more than 1000000+, import the cert one by one, seems it hard to implement? what should I do to fix this problem?


Read in browser »
share on Twitter

Calculating over time hours for employees against their contract hours

By Anna on Aug 01, 2021 03:31 am

[![enter image description here][1]][1]Calculating over time hours for employees against their individual contract hours, the percentage an employee has worked overtimes as well as how many worked more than 10% overtime.

Sample data is here:

http://sqlfiddle.com/#!9/a2ba19/2/0

Sample data has: ID- Employee ID PROJECT - Project code Employee belongs to SEGMENT - are the projects an employee is working on SEG_DESC- description of the projects CONTRACT HRS- is the individual contract hrs the employee is hired to do HOURS - are the hours an employee has worked in a segment TEAM- Employee belongs to END_OF_WEEK - data is collected weekly

I need the the percentage an employee has worked overtime how many employees have worked more than 10% overtime

Once these calculations are done, I need to be able to visualise the data in Power BI.

I have actually achieved all I needed to do in Power BI - but the dashboard is extremely slow and therefore not viable. Therefore, the overtime calculations need all to already happen in sql. How can I do this?

While I would be thankful for the calculations, the main issue I perceive to have is that as soon as I sum all the hours an employee has worked in a one week, I am actually ending up aggregating the data. But I need not aggregated data to be able to visualise other elements, such as which segments cost most hours for employees to work on for example.

Please see how it should look: [1]: https://i.stack.imgur.com/xpJgf.png


Read in browser »
share on Twitter

Trying to call a class with constructor but @Autowired var is throwing Null Pointer Exception in Kotlin/Spring Boot

By Jay Berd on Aug 01, 2021 02:58 am

I'm new to Kotlin and Spring Boot. I'm trying to call SearchService class with initialized constructors through ServiceClass, everything is fine until it's time to access Autowired env variable in SearchService - it throws Null Pointer Exception. I'm assuming I will have to Autowire SearchService in ServiceClass but then how will I initialize the constructor and name/isAlive variables in the performSearch method.

@Service  class ServiceClass {      @Autowired      lateinit var env: Environment        fun performSearch(req: String): String {          var searchService = SearchService("John", false)          result = searchService.searchAsync()              ...          return result      }  }    @Repository  class SearchService(name: String = "", isAlive: Boolean = true) {      private var name: String = name      private var isAlive: Boolean = isAlive        @Autowired      lateinit var env: Environment        fun searchAsync(): String {          var endpoint = env.getProperty("endpoint").toString() + name //Error here          // makes call to get endpoint with Name and isAlive as params              ...          return result      }  }  

Read in browser »
share on Twitter

Find other column data when give min or max data base other column in SQL

By Blue sky on Aug 01, 2021 02:51 am

I have a table that specifies exactly what date and time each employee was in a particular office.

EmployeeTable looks like this:

id EmployeeID DateP TimeP
1 11111 1397/01/02 01:30
2 11111 1398/05/09 05:30
3 11111 1398/06/07 05:10
4 22222 1398/08/09 06:12
5 22222 1399/02/01 07:15
6 11111 1399/07/02 08:51
7 11111 1399/08/06 12:20
8 33333 1399/09/04 20:01
9 33333 1399/12/08 22:05
10 33333 1400/01/01 23:11
11 33333 1400/02/05 14:10
12 22222 1400/04/05 16:25

I want exactly select Min and Max date and time for each Employee when present in a office:

id EmployeeID MinDateP TimeMinDateP MaxDateP TimeMaxDateP
1 11111 1397/01/02 01:30 1398/06/07 05:10
2 22222 1398/08/09 06:12 1399/02/01 07:15
3 11111 1399/07/02 08:51 1399/08/06 12:20
4 33333 1399/09/04 20:01 1400/02/05 14:10
5 22222 1400/04/05 16:25 1400/04/05 16:25

My SQL code is:

with tab1 as  (      select *      from EmployeeTable  ), tab2 as  (      select          t1.*,          case when lag(t1.EmployeeID) over(order by t1.id) is null then 1              when lag(t1.EmployeeID) over(order by t1.id) = t1.EmployeeID then 0              else 1         end lg    from tab1 t1  )  , tab3 as (  select t1.*,         sum(t1.lg) over(order by t1.id) grp    from tab2 t1  )  select t1.EmployeeID,         min(t1.DateP) as min,         TimeP,         max(t1.DateP)as max,         TimeP    from tab3 t1   group by t1.EmployeeID, t1.grp  

But above codes has error. Can every body help me?


Read in browser »
share on Twitter

Getting `panic: os: invalid use of WriteAt on file opened with O_APPEND`

By Nitin Chauhan on Aug 01, 2021 02:47 am

I am a newbie to Go. Was starting to write my first code in which I have to download a bunch of CSV's from AWS. I don't understand why it is giving me the below error with O_APPEND mode. If I remove os.O_APPEND, I only get the last file data which is not the objective.

The objective is to download all CSV files into one file locally. I'd like to understand what I'm doing incorrectly.

package main    import (      "fmt"      "os"      "path/filepath"        "github.com/aws/aws-sdk-go/aws"      "github.com/aws/aws-sdk-go/aws/credentials"      "github.com/aws/aws-sdk-go/aws/session"      "github.com/aws/aws-sdk-go/service/s3"      "github.com/aws/aws-sdk-go/service/s3/s3manager"  )    const (      AccessKeyId     = "xxxxxxxxx"      SecretAccessKey = "xxxxxxxxxxxxxxxxxxxx"      Region          = "eu-central-1"      Bucket          = "dexter-reports"      bucketKey       = "Jenkins/pluginVersions/"  )    func main() {      // Load the Shared AWS Configuration      os.Setenv("AWS_ACCESS_KEY_ID", AccessKeyId)      os.Setenv("AWS_SECRET_ACCESS_KEY", SecretAccessKey)      filename := "JenkinsPluginDetais.txt"        cred := credentials.NewStaticCredentials(AccessKeyId, SecretAccessKey, "")      config := aws.Config{Credentials: cred, Region: aws.String(Region), Endpoint: aws.String("s3.amazonaws.com")}        file, err := os.OpenFile(filename, os.O_APPEND|os.O_WRONLY|os.O_CREATE, 0666)        if err != nil {          panic(err)      }        defer file.Close()        sess, err := session.NewSession(&config)        if err != nil {          fmt.Println(err)      }        //list Buckets      ObjectList := listBucketObjects(sess)        //loop over the obectlist. First initialize the s3 downloader via s3manager      downloader := s3manager.NewDownloader(sess)        for _, item := range ObjectList.Contents {          csvFile := filepath.Base(*item.Key)            if csvFile != "pluginVersions" {                downloadBucketObjects(downloader, file, csvFile)            }        }    }    func listBucketObjects(sess *session.Session) *s3.ListObjectsV2Output {        //create a new s3 client      svc := s3.New(sess)      resp, err := svc.ListObjectsV2(&s3.ListObjectsV2Input{          Bucket: aws.String(Bucket),          Prefix: aws.String(bucketKey),      })        if err != nil {          panic(err)      }        return resp    }    func downloadBucketObjects(downloader *s3manager.Downloader, file *os.File, keyobj string) {        fileToDownload := bucketKey + keyobj        numBytes, err := downloader.Download(file,          &s3.GetObjectInput{              Bucket: aws.String(Bucket),              Key:    aws.String(fileToDownload),          })        if err != nil {          panic(err)      }        fmt.Println("Downloaded", file.Name(), numBytes, "bytes")    }  

Read in browser »
share on Twitter

addblogging.js:5 Uncaught TypeError: Cannot read property 'value' of null for text area

By SM2019 on Aug 01, 2021 02:14 am

I want to read textarea value using JavaScript.

Here is my code:

I use JavaScript in async way. Hopefully we can use textarea inside the form. This is not a fault.

function validate() {      let title = document.getElementById("title").value;      document.write(title);        let textarea = document.querySelector("#textarea1").value;      document.write(textarea);         let image = document.getElementById("myimage").value;       document.write(image)      }
<!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">      <title>AddBlogging</title>      <!-- Custom styles for this template -->      <link href="AddBloggsstylesheet.css" rel="stylesheet">      <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous" />        <script src="js/addblogging.js"></script>      </head>    <body>        <hr />      <div class="container">          <form class="form-group" action="AddBloggs.html" onsubmit="return validate()">              <h2>Blogger Page</h2>              <label>Title</label>              <input type="text" name="Title" id="title" lass="form-control" /><br />              <label>TextArea</label>              <textarea name="comment" id="textarea1" placeholder="Text" class=" form-control "></textarea>              <br />              <label>Image</label>              <input type="file" name="myImage" id="myimage" accept="image/png, image/gif, image/jpeg " class="form-control " />              <br />                <br />              <br />                <!-- <input type="submit " value="submit " class="btn btn-success " /> -->              <input type="submit" value="submit" class="btn btn-success " />              <input type="reset " value="reset " class="btn btn-info " />          </form>      </div>      <hr />        <div class="container ">          <div class="row row-cols-auto ">                <div class="col ">                  <div class="rightcolumn ">                      <h2>TITLE HEADING</h2>                      <h5>Title description, Sep 2, 2017</h5>                      <div class="fakeimg " style="height:200px; ">Image</div>                      <p>Sunt in culpa qui officia deserunt mollit anim id est laborum consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco.</p>                  </div>                </div>            </div>      </div>          </body>    </html>

but I got an error:

Uncaught TypeError: Cannot read property 'value' of null

Error details

any help regrading this error.For Javascript I use async ways...So script loading I hope it is not a problem.


Read in browser »
share on Twitter

flutter: getx RxList not run obx builder

By Cyrus the Great on Aug 01, 2021 01:59 am

I am using getx on my project . I have RxList and buy Obx I shows my data on widget:

  RxList<VocabularyModel> vocabs = RxList();  

and widget:

   return Scaffold(        body: SafeArea(          child: Obx(            () => ListView.builder(              // ignore: invalid_use_of_protected_member              itemCount: controller.vocabs.value.length,              itemBuilder: (context, index) {                return Padding(                  padding: EdgeInsets.symmetric(vertical: 8.h, horizontal: 8),  

In controller I have method to remove on object in vocabs:

  void changeToRememberState(int index) {      final upateItem = vocabs.value[index].copyWith(remember: true);      vocabs.value.removeAt(index);      // repository.changeToRememberState(index, upateItem);    }  

But when I remove object from vocabs, Obx builder not triggered? Why? I remove one element from RxList, Why RxList not fire?


Read in browser »
share on Twitter

How can I remove a cell's background color? (how can I customize it)

By MACHINE666 on Jul 31, 2021 11:43 pm

Let's say I want to make the cell have a color or make the borders of the cells more rounded or remove the line between the first cell and the second, how would I do that in SwiftUI?

enter image description here

struct TestView: View {      init() {              UITableView.appearance().backgroundColor = .clear              UITableViewCell.appearance().backgroundColor = .green          UITableViewCell.appearance()}          var body: some View {              LinearGradient(gradient: Gradient(colors: [Color.red, Color.purple]), startPoint: .top, endPoint: .bottom)                  .edgesIgnoringSafeArea(.vertical)                  .overlay(                      List {                          Group {                              Text("Hallo")                              Text("World")                          }                      }                      .padding(50)                )          }  

Read in browser »
share on Twitter

How to iterate through a array in C++ like in Python

By KidWithComputer on Jul 31, 2021 10:05 pm

Hi I had this code written for me in C++, it splits a given sentence into 4 letter segments and converts those letters into numbers. screenshot

    #include<iostream>  #include<string>  #include <stdlib.h>    using namespace std;      void splitString(string input)  {    char* result = new char[1000];    result[0] = '[';    int resultindex = 1;    int spaces = 0;    for (int i = 0; input != '\0'; i++)    {      if (input[i] == ' ')        spaces++;    }    spaces++;    int k = 0;    bool flag = true;    for (int i = 0; i < spaces; i++)    {      char* temp = new char[100];      int j = 0;        while (input[k] != ' ')      {        if (input[k] == '\0')        {          flag = false;          break;        }        temp[j] = input[k];        k++;        j++;      }        k++;      temp[j] = '\0';      int length = 0;      for (int i = 0; temp[i] != '\0'; i++)      {        length++;      }      bool firstTime = true;      if (length <= 4)      {        for (int i = 0; temp[i] != '\0'; i++)        {          if (firstTime)          {            if (int(temp[i]) >= 65 && int(temp[i]) <= 90)            {              result[resultindex] = temp[i];              resultindex++;              firstTime = false;            }            else            {              result[resultindex] = temp[i] - 32;              resultindex++;              firstTime = false;            }            }          else          {            result[resultindex] = temp[i];            resultindex++;          }            }        if (i != spaces - 1)        {            result[resultindex] = ',';          resultindex++;          }        }      else      {        int j = 0;        while (length > 4)        {          int quotient = length / 2;          for (int i = 0; i < quotient; i++)          {            if (firstTime)            {              if (int(temp[j]) >= 65 && int(temp[j]) <= 90)              {                result[resultindex] = temp[j];                resultindex++;                j++;                firstTime = false;              }              else              {                result[resultindex] = temp[j] - 32;                resultindex++;                firstTime = false;                j++;              }              }            else            {              result[resultindex] = temp[j];              resultindex++;              j++;            }            }          length = length - quotient;          result[resultindex] = ',';          firstTime = true;          resultindex++;          }          for (int i = 0; i < length; i++)        {          if (firstTime)          {            if (int(temp[j]) >= 65 && int(temp[j]) <= 90)            {              result[resultindex] = temp[j];              resultindex++;              j++;              firstTime = false;            }            else            {              result[resultindex] = temp[j] - 32;              resultindex++;              firstTime = false;              j++;            }            }          else          {            result[resultindex] = temp[j];            resultindex++;            j++;          }            }          if (i != spaces - 1)        {          result[resultindex] = ',';          resultindex++;          }        }      if (!flag)        break;      }    result[resultindex] = ']';    resultindex++;    std::cout << endl;    std::cout << "String after spliting " << endl<<endl;    for (int i = 0; i < resultindex; i++)      std::cout << result[i];    std::cout << endl<<endl;    std::cout << "Letter Converted in number" << endl << endl;    std::cout << "[";    for (int i = 0; i < resultindex; i++)    {      if (result == ',')      {        std::cout << "]";        std::cout<<",";        std::cout << "[";        continue;      }      float ascii = float(result);      if (ascii >= 97 && ascii <= 122)      {        ascii -= 96;        ascii *= 51.2;        std::cout << ascii;          if (result[i + 1] != ',' && result[i + 1] != ']')        {          std::cout << ",";        }        }      else if (ascii >= 65 && ascii <= 90)      {        ascii -= 64;        ascii *= 51.2;        std::cout << ascii;        if (result[i + 1] != ',' && result[i + 1] != ']')          std::cout << ",";      }      else        std::cout << result[i];    }    std::cout << "]";    std::cout << endl<<endl;    }    int main()  {    std::cout << "Enter sentence:";    string input;    getline(cin, input);    splitString(input);    system("pause");  }  

The only thing is that I now need to iterate through these arrays and have no clue on where to even start. Where is the actual output for the program? How can I iterate through each number in a useable way? I want behavior exactly like this(written in python):

 for x in output:    for number in x:       MoveAMotor(number)  

But cannot fathom how something like this would be done in C++. I'm not very familiar with the language and it seems much harder than in python. Can someone get me an idea of where the output of the program is, and how I could get started iterating through the nested arrays of the output.

I greatly appreciate it


Read in browser »
share on Twitter

changing the legends in ggplot2 to have groups of similar labels

By user3236841 on Jul 31, 2021 09:55 pm

this question builds off of this solution provided at enter link description here

as follows.

library(ggplot2)  library(gtable)  library(grid)    diamonds$cut = factor(diamonds$cut, levels=c("Fair","Good"," ","Very Good",                                               "Premium","Ideal"))    p = ggplot(diamonds, aes(color, fill = cut)) +         geom_bar() +         scale_fill_manual(values =                c(hcl(seq(15, 325, length.out = 5), 100, 65)[1:2],                "white",                hcl(seq(15, 325, length.out = 5), 100, 65)[3:5]),                drop = FALSE) +    guides(fill = guide_legend(ncol = 2, title.position = "top")) +    theme(legend.position = "bottom",          legend.key = element_rect(fill = "white"))    # Get the ggplot grob  g = ggplotGrob(p)    # Get the legend  leg = g$grobs[[which(g$layout$name == "guide-box")]]$grobs[]    # Set up the two sub-titles as text grobs  st = lapply(c("First group", "Second group"), function(x) {     textGrob(x, x = 0, just = "left", gp = gpar(cex = 0.8)) } )    # Add a row to the legend gtable to take the legend sub-titles  leg = gtable_add_rows(leg, unit(1, "grobheight", st[]) + unit(0.2, "cm"), pos =  3)    # Add the sub-titles to the new row  leg = gtable_add_grob(leg, st,              t = 4, l = c(2, 6), r = c(4, 8), clip = "off")    # Add a little more space between the two columns  leg$widths[] = unit(.6, "cm")    # Move the legend to the right   leg$vp = viewport(x = unit(.95, "npc"), width = sum(leg$widths), just = "right")    # Put the legend back into the plot  g$grobs[[which(g$layout$name == "guide-box")]] = leg    # Draw the plot  grid.newpage()  grid.draw(g)  

This provides the figure (from there).

enter image description here

However, I want to do two things.

  1. First group: I want to relabel "Fair" and "Good" to "Very Good" and "Premium" respectively. So they are Very Good and Premium of each group (first and second).

  2. The second thing I would like to do is to put them in one line (in two columns of First group and second group side by side, everything in one line, to save vertical space.

How do I do this? Please let me know if my questions are not clear. I feel like I am quite close here, but this solution does not quite answer my question. Many thanks!


Read in browser »
share on Twitter

Change color of selected row on Material UI table

By Carlos D. Zapata on Jul 31, 2021 07:47 pm

How to change/customize the default color of selected rows in a Material-UI table (of type Sorting & Selecting)? By default it is secondary (red) color (Codesandbox here: https://codesandbox.io/s/3sjxh). How to change it to a custom color, or at least to primary (blue), as it appears in the new beta version (https://next.material-ui.com/components/tables/#main-content) (v5).

Table with selected row in default red color


Read in browser »
share on Twitter

Sed is not matching a backslash literal or am I doing something wrong?

By Arzaan Ul on Jul 31, 2021 03:15 pm

I have a file which has 3 lines:

%fddfdffd  \%dffdfd  hello %12345678  

I need to remove anything after "%" character (inlcuding the "%" character) but not if the "%" begins with a "\".

I tried this but it didn't work:

sed -i "s/[^\\]%.*//g"    

The task is actually working on a latex file to remove the comments using sed

The file after using sed should be:

\%dffdfd  hello  

Read in browser »
share on Twitter




Recent Articles:

How to go back in android app and take new input
How to remove data from the bellow List when the data has same category so gridview has no repeated category name
selectionSort Javascript animation
My hidden test cases are not working, though my sample test case has been cleared. Can you review it? [closed]
Next js - AMP hybrid pages return 404
Twitter
Facebook
Website
Copyright © 2021 reader, All rights reserved.
You are receiving this email because you opted in via our website.

Our mailing address is:
reader
88 CELICA STREET
Davao 8000
Philippines

Add us to your address book


Want to change how you receive these emails?
You can update your preferences or unsubscribe from this list.

Email Marketing Powered by Mailchimp

No comments:

Post a Comment