Roscoemanuelmelissa's Profile

190
Points

Questions
36

Answers
45

  • That’s not hard, just iterate over the arrays and merge them:

    var result = [], input = [["$6"], ["$12"], ["$25"], ["$25"], ["$18"]];  for (var i = 0; i < input.length; ++i) {     result = result.concat(input[i]); } 
    • 860 views
    • 30 answers
    • 0 votes
  • You get it directly from the axes’ patches:

    for p in ax.patches:     ax.annotate(str(p.get_height()), (p.get_x() * 1.005, p.get_height() * 1.005)) 

    You’ll want to tweak the string formatting and the offsets to get things centered, maybe use the width from p.get_width(), but that should get you started. It may not work with stacked bar plots unless you track the offsets somewhere.

    • 296 views
    • 2 answers
    • 0 votes
  • Asked on July 15, 2020 in php.

    @AbraCadaver found the solution, with word boundary

    preg_replace('/\bvelocity\b/', '120', $input_lines); 

    Thank you!

    • 255 views
    • 1 answers
    • 0 votes
  • Asked on July 15, 2020 in Python.

    The only possible thing in python is to scrap the whole text of a page. You can do that using that code.

    import requests from bs4 import BeautifulSoup r = requests.get('https://www.businessinsider.in/tech/news/airbnb-is-getting-ripped-apart-for-asking-renters-to-donate-money-to-landlords/articleshow/76968577.cms') soup = BeautifulSoup(r.text, 'html.parser') texet = soup.find('html').text print(texet) 
    • 293 views
    • 1 answers
    • 0 votes
  • Asked on July 15, 2020 in Java Script.

    Since you’re using PHP to change the form action, until you got to the last page there is not access to the action value, meaning it won’t take place in the form submit action while it is a different page than the last one.

    I would suggest having that last page url/action in a different php variable, so it can be used as for JS expiration/redirection anytime. Something like:

    1: Timeout – Redirection last page

    <?php     $lastPageUrl = 'https://example.com'; ?>  <script type="application/javascript"> setTimeout(function() { timeOut() }, 3000);  function timeOut() {     var lastPage = "<?= $lastPageUrl ?>";     location.replace(lastPage); } </script> 

    2: Timeout – Update form action last page

    <script type="application/javascript">  function timeOut() {     var form = document.getElementById('submitmyform');     form.action = '<?= $lastPageUrl ?>'; } </script> 
    • 251 views
    • 2 answers
    • 0 votes