[Solved] I'm trying...
 
Notifications
Clear all

[Solved] I'm trying to put a line of text in the center, but it doesn't work

0 Posts
1 Users
0 Likes
0 Views
0
Topic starter
Lohas Asks: I'm trying to put a line of text in the center, but it doesn't work

Code:
.center {
    margin: auto;
    width: 50%;
    border: 3px solid black;
    padding: 10px;
}

p6 {
    text-align: center;
}

Here is the line:

Code:
<br><p6>~~This text is centered~~</p6><br>

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.

 

 


 

Unreplied Posts

[Solved] Does Selenium work with Java 16? The jars are all there and yet the imports don’t work

Tom Sherrin Asks: Does Selenium work with Java 16? The jars are all there and yet the imports don’t work
Learning Selenium from a relatively-beginner Java background. Downloaded the JARs and imported them to Eclipse as per all the guides, but they don’t have any bearing on the functionality of the code. Searched the web high and low, but can’t find anything unless I’m going crazy. Screenshot attached to show the referenced libraries as well as the code: code and jars

Code itself is:

Code:
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class Firefox {

    public static void main(String[] args) {
        // TODO Auto-generated method stub
        
        System.setProperty("webdriver.gecko.driver","C:\geckodriver.exe");
        WebDriver driver = new FirefoxDriver();
        //comment the above 2 lines and uncomment below 2 lines to use Chrome
        //System.setProperty("webdriver.chrome.driver","G:\chromedriver.exe");
        //WebDriver driver = new ChromeDriver();
        
        String baseUrl = "http://demo.guru99.com/test/newtours/";
        String expectedTitle = "Welcome: Mercury Tours";
        String actualTitle = "";

        // launch Fire fox and direct it to the Base URL
        driver.get(baseUrl);

        // get the actual value of the title
        actualTitle = driver.getTitle();

        /*
         * compare the actual title of the page with the expected one and print
         * the result as "Passed" or "Failed"
         */
        if (actualTitle.contentEquals(expectedTitle)){
            System.out.println("Test Passed!");
        } else {
            System.out.println("Test Failed");
        }
       
        //close Fire fox
        driver.close();

    }

}

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.
 
 
 

[Solved] Substitute removed rows by duplicating existing rows in order to hit a defined value target number

Phoenix Islands Asks: Substitute removed rows by duplicating existing rows in order to hit a defined value target number
Given the following dataframe

Code:
date         city        customer_name     customer_id     purchase_amount
2021-01-01   A               X                 A1                10
2021-01-01   A               Y                 A2                20
2021-01-01   A               Z                 A3                15
2021-01-01   A               Z                 A4               100
...
2021-03-03   B               AA                A4                40

I have 2 scenarios:

Scenario A: No change to dataset

Scenario B:

I would like to remove all customer_name which start by Z for date, city combination and i want to replace these rows which have been removed by the same number of rows for that date city combination, however the rows which are chosen should have an average value (for purchase amount column) as close as possible to a defined threshold.

Below is the code I wrote:

Code:
dates = df["date"].unique()
cities = df["city"].unique()
final_df = []
for date in dates:
    for city in cities:
        dff = df.copy()
        dff = dff[dff["date"]=="date"]
        dff = dff[dff["city"]=="city"]
        if scenario_name == "B":
            removal_count = dff[dff["customer_name"].str.startswith("Z")]
            removal_count = removal_count["customer_id"].count()
            dff = dff[~dff["customer_name"].str.startswith("Z")]
            threshold = dff["purchase_amount"].mean()
            df_add = dff.sample(removal_count, random_state = 8, replace = True)
            dff = pd.concat([dff,df_add])
            final_df.append(dff)

I believe the above code a part of it but does not have the threshold logic for df_add and I would like some guidance as how we can add it.

Using the dataset at the start, let’s say we remove third and fourth row and my threshold is 15. Then I would want my dataframe to have 2 random rows duplicated (here row 1 and 2) so it is possible to reach 15 (purchase_amount).

If the duplicated row cannot reach 15 then it should reach the closest number to 15 (can be more or less). 1 and 2 are relevant here become they are in the “correct” sequential number in order to reach 15, but the rows which are being picked by the code should be any rows from the filtered dataset as long as it is possible to get close to 15 using the average of X rows.

Apologize if it is not clear…

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.

 

 


 

[Solved] Create intranet search [closed]

Ravi Cheruvu Asks: Create intranet search [closed]
I have created a local intranet using HTML, CSS, JavaScript. No PHP used at all.

How do I go about creating a search function for this website that searches entire content of the website using only HTML, CSS, and JavaScript?

Thanks.

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.

 

 


 

[Solved] Closing a file in x86_64 nasm assembly on mac

Daniel Yoffdan Asks: Closing a file in x86_64 nasm assembly on mac
I am having difficulties closing a file in nasm assembly on mac 64 bit. My goal is to make a file and write to it. For now I think that I opened the file the correct way. Now I need to close the file so that the file actually gets made. Here is my code so far.

Code:
global start
; default rel
section .text
    start:
        ;open
        mov rax, 0x2000005
        mov rdi, file     
        mov rsi, 1   
        syscall

        ;close
        mov rax, 0x2000006
        mov rdi, file ;I need to replace this line. With what though?
        syscall

        mov rax, 0x2000001       ;Exiting
        xor rdi, rdi         
        syscall          

section .data
    
    str: db "Hello world", 0
    strlen: equ $ - str
    file: db "test.txt"
    lenfile: equ $ - file

I did a bit of research before I posted this question. I need to get something called a file handler, I think thats what its called. Help would be greatly appreciated.

Answer

Code:
;close
mov rdi, rax ;rax contains the file handler from the previous syscall. Moving it here before it gets cleared
mov rax, 0x2000006
syscall

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.

 

 


 

[Solved] AWS RDS can’t connect security group

John Sorensen Asks: AWS RDS can’t connect security group
This is question is related to an earlier one I asked, but more specific and hopefully easier to answer.

Essentially, I can’t connect to my RDS instance. I tried in my SQL editor (datagrips) and also by pinging the server on the console. Comments on my previous question led me to believe that my problem has to do with the security group. Upon investigation, however, everything seems to be in order–my security group has an inbound rule that should allow all inbound access.

Security Group:
enter image description here

Console Ping:
enter image description here

What is going on here?

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.

 

 


 

[Solved] Seaborn multiple boxplot based by different conditions

DMatheu Asks: Seaborn multiple boxplot based by different conditions
I have a dataframe with two columns. The power column represents the power consumption of the system. And the component_status column divide the data in two, based when the component is OFF or ON. When the values are 153 is when the component is ON and when the values are 150 the component is OFF.

The result that I am looking for is to have a boxplot with three boxplots, using sns.boxplot. One is the power consumption with all the data, called “TOTAL”. The other two, the power consumption based if the component was OFF or ON, called “COMPONENT = ON” “COMPONENT = OFF”.

The data frame example is as follows:

Code:
power|component_status |
 0.5 |       150       | 
 1.5 |       150       | 
 2.5 |       150       |
 0.3 |       153       |
 0.5 |       153       | 
 1.5 |       153       | 
 2.5 |       150       |
 0.3 |       153       |

thanks for the help.

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.

 

 


 

[Solved] Trying to filter on a union of 3 queries

James C Asks: Trying to filter on a union of 3 queries
I have a union of 3 queries that summarizes like this…

Code:
Select param1 As 'example1' And .... Where... 

Union All

Select param1 As 'example2' And .... Where...

Union All

Select param1 As 'example3' And .... Where...

Is there any way to wrap this in a Select and create an optional parameter that filters on example1/example2/example3?

Any help would be greatly appreciated. Thanks!

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.

 

 


 

[Solved] Problem on spliting string variable to list in Jinja2

Abeil Coelho Asks: Problem on spliting string variable to list in Jinja2
I am having a problem with a piece of python code. I am using Flask to catch inputs from users. But I am having a problem with a split function on Jinja2.

I have a CSV file with lots of neighbourhoods names from different States witch I need the user to insert the correct City name. It is a really messed up base of neighbourhoods I can’t retrieve from map services like google maps or OpenStreetMap. So I created an app to retrieve x neighbourhoods from the file and based on the neighbourhood’s State the service show a dropbox with only the cities of this state. So the user can select a valid city name to input on the form. Every time a user enters the page, it provides 10 different places.

On the index route, it selects 10 places from the neighbourhood file, merges it to a state-city file to catch the city names. Then it drops these 10 places from the neighbourhood file, so the next user doesn’t receive the same places. After this, the data frame “trechos” is passed to the template. It looks like this:

Neighhood State Cities
MUNDO NOVO SUL – BA BA ABAIRA#ABARE#ACAJUTIBA#ADUSTINA#AGUA FRIA#AIQU…
MUNDO NOVO SERTAO – BA BA ABAIRA#ABARE#ACAJUTIBA#ADUSTINA#AGUA FRIA#AIQU…
OLIVENCA – BA BA ABAIRA#ABARE#ACAJUTIBA#ADUSTINA#AGUA FRIA#AIQU…
POSTO SANTO ANTONIO – BA BA ABAIRA#ABARE#ACAJUTIBA#ADUSTINA#AGUA FRIA#AIQU…
SAO CAETANO SUL – SP SP ADAMANTINA#ADOLFO#AGUAI#AGUAS DA PRATA#AGUAS D…

On the Cities column I have all the cities of the State, on the jinja2 template I use a split function to separete values by the “#” using this code:

Code:
<tbody>
  {% for key, value in trechos.iterrows() %}
  <tr>
    <td>{{ value["Neighhood"] }}</td>
    <td>{{ value["State"] }}</td>
    {% set cities_list = value["Cities"].split("#") %}
    <td>
      <select name="cities" class="form-control" required>
        <option disabled selected value>Select and option</option>
        <option value="DONO">I DONT KNOW</option>
        {% for city in cities_list %}
        <option>{{ city }}</option>
        {% endfor %}
      </select>
    </td>
  </tr>
  {% endfor %}
</tbody>

I have a route called “status” where we can see the progress of how many cities were classified and how many are left. When I load the service on index everything works fine, but when I change to the status route and go back to index I get this error:

Code:
192.168.0.2 - - [06/Oct/2021 21:07:37] "←[37mGET / HTTP/1.1←[0m" 200 -
192.168.0.2 - - [06/Oct/2021 21:07:39] "←[37mGET / HTTP/1.1←[0m" 200 -
192.168.0.2 - - [06/Oct/2021 21:07:41] "←[37mGET /status HTTP/1.1←[0m" 200 -
192.168.0.2 - - [06/Oct/2021 21:07:42] "←[35m←[1mGET / HTTP/1.1←[0m" 500 -
Traceback (most recent call last):
  File "C:FerramentasAnacondaLibsite-packagesflaskapp.py", line 2464, in __call__
    return self.wsgi_app(environ, start_response)
  File "C:FerramentasAnacondaLibsite-packagesflaskapp.py", line 2450, in wsgi_app
    response = self.handle_exception(e)
  File "C:FerramentasAnacondaLibsite-packagesflaskapp.py", line 1867, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "C:FerramentasAnacondaLibsite-packagesflask_compat.py", line 39, in reraise
    raise value
  File "C:FerramentasAnacondaLibsite-packagesflaskapp.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "C:FerramentasAnacondaLibsite-packagesflaskapp.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "C:FerramentasAnacondaLibsite-packagesflaskapp.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "C:FerramentasAnacondaLibsite-packagesflask_compat.py", line 39, in reraise
    raise value
  File "C:FerramentasAnacondaLibsite-packagesflaskapp.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "C:FerramentasAnacondaLibsite-packagesflaskapp.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "C:1_PROJETOScrowsource_municipios_totalbusapp.py", line 34, in index
    return render_template("index.html", trechos=classificacao)
  File "C:FerramentasAnacondaLibsite-packagesflasktemplating.py", line 137, in render_template
    return _render(
  File "C:FerramentasAnacondaLibsite-packagesflasktemplating.py", line 120, in _render
    rv = template.render(context)
  File "C:FerramentasAnacondaLibsite-packagesjinja2environment.py", line 1090, in render
    self.environment.handle_exception()
  File "C:FerramentasAnacondaLibsite-packagesjinja2environment.py", line 832, in handle_exception
    reraise(*rewrite_traceback_stack(source=source))
  File "C:FerramentasAnacondaLibsite-packagesjinja2_compat.py", line 28, in reraise
    raise value.with_traceback(tb)
  File "C:1_PROJETOScrowsource_municipios_totalbustemplatesindex.html", line 49, in top-level template code
    {% set cities_list = value["Cities"].split("#") %}
jinja2.exceptions.UndefinedError: 'float object' has no attribute 'split'
192.168.0.2 - - [06/Oct/2021 21:07:42] "←[37mGET /?__debugger__=yes&cmd=resource&f=jquery.js HTTP/1.1←[0m" 200 -
192.168.0.2 - - [06/Oct/2021 21:07:42] "←[37mGET /?__debugger__=yes&cmd=resource&f=debugger.js HTTP/1.1←[0m" 200 -
192.168.0.2 - - [06/Oct/2021 21:07:42] "←[37mGET /?__debugger__=yes&cmd=resource&f=style.css HTTP/1.1←[0m" 200 -
192.168.0.2 - - [06/Oct/2021 21:07:42] "←[37mGET /?__debugger__=yes&cmd=resource&f=console.png HTTP/1.1←[0m" 200 -
192.168.0.2 - - [06/Oct/2021 21:07:42] "←[37mGET /?__debugger__=yes&cmd=resource&f=ubuntu.ttf HTTP/1.1←[0m" 200 -
192.168.0.2 - - [06/Oct/2021 21:07:42] "←[37mGET /?__debugger__=yes&cmd=resource&f=console.png HTTP/1.1←[0m" 200 -```

When a press F5 the service reloads and works fine, showing all the options on the cities list. When I send the form I get the results and all files work fine changing the classified to the right list and refreshing the pending ones, but I get the error when it redirects the user to the index route, on the other hand, if I reload the page everything is right and working.

The “status” route has an anchor to index:

Code:
href="{{url_for('index')}}"

The third route is called “save”, which receives the input by a post request, after processing the inputs, redirect the user to index by:

Code:
return redirect(url_for("index"))

I can’t see what is wrong, a few hours ago everything was working beautifully, with this error happening rarely, but now it’s happening every time.

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.

 

 


 

[Solved] Is there a way to set TableCell Borders in google apps script in SlidesApp [duplicate]

Marc-Andre Richer Asks: Is there a way to set TableCell Borders in google apps script in SlidesApp [duplicate]
As stated, this is a simple thing to do in the context of Google Sheets or even Google Docs, but the TableCell Class in Slides doesn’t seem to have methods or childs related to Borders in the documentation Class TableCell | Apps Script | Google Developers

I DO however see that Shape Class does have a getBorder() method that leads to Border methods such as setDashStyle(style), setWeight(points), getLineFill().setSolidFill(color), I am trying to find the equivalent in the Table Class

I am trying simply to create a table with varying borders and headers per cell/row/column

Code:
function addTableInPresentation() {
  //get the presentation
  var presentation = SlidesApp.getActivePresentation(); 
  
  //get the current Page
  var curPage = presentation.getSelection().getCurrentPage();
  
  //Add a table in Page
  var table = curPage.insertTable(5,4);
  
  //Cycle through 5 rows and 4 columns to customize style
  for(var i=0; i<5; i++){
    var tr = table.getRow(i)
    
    //add 4 cells in each row
    for(var j=0; j<4; j++){
      var tc= tr.getCell(j);
      
      //if it is header cell, apply the header style else cellStyle
      if(i == 0){
        tc.getText().insertText(0,'Cell'+i+j);
        tc.getFill().setSolidFill(0,0,255);
        tc.getText().getTextStyle().setForegroundColor(255,0,0);
        //tc.getBorder().setWeight(4) where you set the header border weight to 4 but this doesn't exist
      }
      else {
        tc.getText().insertText(0,'Cell'+i+j);
        tc.getFill().setSolidFill(0,255,0);
        //tc.getBorder().setWeight(2) where you set the row border weight to 2 but this doesn't exist
      }

    }
  }

}

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.

 

 


 

Share: