ruby on rails – How can I capture an index with JavaScript in a list view in RoR?

I have the following view index.slim with the JS code.

- ind = 0
- enlace = ()
h1 Posts
table
    thead
        tr
            th Content
    tbody
        - @posts.each_with_index do |post,i|
            - ind = i
            - enlace(i) = "https://midominio.com/#{i}"
            tr
                td= post.content
                td
                    a.mx-1.btn.btn-sm.btn-outline-warning href="https://es.stackoverflow.com/javascript:copiaURL();" Copiar URL
                td= i

javascript:
    function copiaURL() {
        var aux = document.createElement("input");
        aux.setAttribute("value","#{enlace(ind)}");
        document.body.appendChild(aux);
        aux.select();
        document.execCommand("copy");
        document.body.removeChild(aux);
        alert("URL copiadan#{enlace(ind)}");
    }

I have a client domain with certain parameters, for the purposes of the question I summarize the parameters with the help index each_with_index, the problem that I have is that it m & # 39; # 39; brings the last value of the array and it does not bring me the selection that I made, I attach an image which represents the problem that I have.

enter description of image here

I select index 4 (it can be any of the list) and it always brings me the last one.

How can I get the index I want to select?

php – Why Avis: an undefined index is generated when you try to validate several radio buttons on a form?

I have a form with several radio buttons which I have to validate with php, I have two files one called inscriptions.php where I process the data of the form and another inscriptions.view.php which contains the view, because an error message should be displayed below each field if it comes to exist, I send the data to the same page, my problem is that when I ; try to validate a group of radio button I get the following error Note: undefined index: note in C: xampp htdocs ColegioJRF inslaciones.php at line 9 I have already checked in both files that the name = "degree" is well defined, but the error continues to appear.

My registration.view.php code is:

Pre-registro

Completa el siguiente formulario:

  Datos del alumno

And the registration code.php is

'; 
        }

        if(empty($ap_pat_alu)){
            $error_apellido1 = 'Ingresa un apellido.
'; } if(empty($ap_pat_alu)){ $error_apellido2 = 'Ingresa un apellido.
'; } require 'views/inscripciones.view.php';

How can I fix this so that the error is no longer displayed? It is only in this type of field where it appears since in the last name I had no problem.

php – Note: undefined index: page in C: xampp

Good night!
I have notifications and am unable to resolve and correct these messages.
Someone with good knowledge who can help me. Here is the code snippet:

require_once("funcoes.php");

    $path = $_GET('pagina'); ----ERRO nesta LINHA
    echo $path;     
            if($path('basename') == "importa.php" or $path('basename') .......

I have had this program for a long time and I think that the version update will be given.

beginner – ROT (ation) by Index

I wrote some C ++ functions which should:

  • take a chain
  • transform it according to the index
  • transform it according to the number of alphabetic characters seen
  • return the transformed chain

I am inexperienced in C ++ and OOP and in programming and in English.

Example first, detail after:

$ rotn_a("Hello, World!")
> Igopt, Exbwp!

$ rotn_a("aaaaaaaaaaaaaaaaaaaaaaaaaaa")
> bcdefghijklmnopqrstuvwxyzab

$rotn_a("aa!aaaaaaaaaaaaaaaaaaaaaaaa")
> bc!efghijklmnopqrstuvwxyzab
     ^


$rotn_b("Hello, World!")
> Igopt, Cvzun!

$rotn_b("aaaaaaaaaaaaaaaaaaaaaaaaaaa")
> bcdefghijklmnopqrstuvwxyzab

$rotn_b("aa!aaaaaaaaaaaaaaaaaaaaaaaa")
> bc!defghijklmnopqrstuvwxyza
     ^


$unrotn_a(rotn_a("Hello, World!"))
> Hello, World!

$unrotn_a(rotn_a("aaaaaaaaaaaaaaaaaaaaaaaaaaa"))
> aaaaaaaaaaaaaaaaaaaaaaaaaaa

$unrotn_a(rotn_a("aa!aaaaaaaaaaaaaaaaaaaaaaaa"))
> aa!aaaaaaaaaaaaaaaaaaaaaaaa


$unrotn_b(rotn_b("Hello, World!"))
> Hello, World!

$unrotn_b(rotn_b("aaaaaaaaaaaaaaaaaaaaaaaaaaa"))
> aaaaaaaaaaaaaaaaaaaaaaaaaaa

$unrotn_b(rotn_b("aa!aaaaaaaaaaaaaaaaaaaaaaaa"))
> aa!aaaaaaaaaaaaaaaaaaaaaaaa

rotn_a: chain and rotate each character index time
rotn_a example:

in:  aaaaa

middle step
-----------

     bbbbb
     bcccc
     bcddd
     bcdee
     bcdef

out: bcdef

unrotn_a: to cancel rotn_a

unrotn_a example:

in:  bcdef

middle step
-----------

     abcde
     aabcd
     aaabc
     aaaab

out: aaaaa

rotn_b: chain and rotate each character index-alpha_encountered times and alpha_encountered is the number of a-z seen in the chain so far
rotn_b example:

in:  aa'aa

middle step
-----------

     bb'bb
     bc'cc
     bc'cc
     bc'dd

out: bc'de

unrotn_b: to cancel rotn_b

#include 
#include 

std::string rotn_a(std::string text);
std::string rotn_b(std::string text);

std::string unrotn_a(std::string text);
std::string unrotn_b(std::string text);

int main() {
    // Encode example
    std::cout
        << rotn_a("Hello, World!") << "n"
        << rotn_a("aaaaaaaaaaaaaaaaaaaaaaaaaaa") << "n"
        << rotn_a("aa!aaaaaaaaaaaaaaaaaaaaaaaa") << "nn";
    std::cout
        << rotn_b("Hello, World!") << "n"
        << rotn_b("aaaaaaaaaaaaaaaaaaaaaaaaaaa") << "n"
        << rotn_b("aa!aaaaaaaaaaaaaaaaaaaaaaaa") << "nn";

    // Decode example
    std::cout
        << unrotn_a(rotn_a("Hello, World!")) << "n"
        << unrotn_a(rotn_a("aaaaaaaaaaaaaaaaaaaaaaaaaaa")) << "n"
        << unrotn_a(rotn_a("aa!aaaaaaaaaaaaaaaaaaaaaaaa")) << "nn";
    std::cout
        << unrotn_b(rotn_b("Hello, World!")) << "n"
        << unrotn_b(rotn_b("aaaaaaaaaaaaaaaaaaaaaaaaaaa")) << "n"
        << unrotn_b(rotn_b("aa!aaaaaaaaaaaaaaaaaaaaaaaa")) << "nn";
}

std::string rotn_a(std::string text) {
    for (auto i = begin(text); i != end(text); ++i) {
        // Modified from https://codereview.stackexchange.com/a/14610/177972
        std::transform(
            i, end(text), i,
            () (char c) -> char {
                if (not std::isalpha(c)) {
                    return c;
                }

                char const pivot = std::isupper(c) ? 'A' : 'a';
                return (c - pivot + 1) % 26 + pivot;
            }
        );
    }

    return text;
}

std::string rotn_b(std::string text) {
    auto rot = 0;

    for (auto i = begin(text); i != end(text); ++i) {

        auto c = *i;

        if (not std::isalpha(c)) {
            continue;
        }

        rot++;
        char const pivot = std::isupper(c) ? 'A' : 'a';
        *i = (c - pivot + rot) % 26 + pivot;
    }

    return text;
}

std::string unrotn_a(std::string text) {
    for (auto i = begin(text); i != end(text); ++i) {
        std::transform(
            i, end(text), i,
            () (char c) -> char {
                if (not std::isalpha(c)) {
                    return c;
                }

                char const pivot = std::isupper(c) ? 'A' : 'a';
                return (c - pivot + 25) % 26 + pivot;
            }
        );
    }

    return text;
}

std::string unrotn_b(std::string text) {
    auto rot = 0;

    for (auto i = begin(text); i != end(text); ++i) {

        auto c = *i;

        if (not std::isalpha(c)) {
            continue;
        }

        rot++;
        char const pivot = std::isupper(c) ? 'A' : 'a';
        *i = (c - pivot + (26-rot)) % 26 + pivot;
    }

    return text;
}
```

magento2 – How to fix / core / index / notFound

I have been working on a Magento 2 development project for a few months now, and until recently there were no problems. When I started it today, my main css file came back as follows: and none of the main css css sites are working. The CSS for the other extensions still works, only the styles.css file on the main site does not work.

I cleared the cache, executed setup: upgrade, s: s: d, setup: di: compile, composer update and nothing worked to get rid of this error. No errors are also logged. I searched everywhere, but I couldn't find anything regarding this particular error, especially since it worked fine yesterday.

postgresql – the index is not used, the filter is too slow

I am analyzing the query which takes several minutes to execute and I want it to be a little faster:

 psql -h localhost -p 3336 -U user -d dbName '-c EXPLAIN (ANALYZE, BUFFERS) SELECT * FROM filings AS filing
    WHERE (
    filing.sources_id != 10 OR filing.action_date < NOW()::date)
    AND (filing_type_id IN (4538,5080))
    ORDER BY filing.action_date desc LIMIT 10 '

Reply:

                                                                                  QUERY PLAN                                                                                  
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 Limit  (cost=0.56..4124.25 rows=10 width=704) (actual time=128412.522..158528.958 rows=10 loops=1)
   Buffers: shared hit=177017 read=162030 dirtied=81 written=34435
   ->  Index Scan Backward using filings_action_date_idx on filings filing  (cost=0.56..6437894.65 rows=15612 width=704) (actual time=128412.429..158528.832 rows=10 loops=1)
         Filter: ((filing_type_id = ANY ('{4538,5080}'::integer())) AND ((sources_id <> 10) OR (action_date < (now())::date)))
         Rows Removed by Filter: 351983
         Buffers: shared hit=177017 read=162030 dirtied=81 written=34435
 Planning time: 5.454 ms
 Execution time: 158529.062 ms
(8 rows)

I don't understand why my index is useless and the filtering of 300K lines is used instead

Filter: ((filing_type_id = ANY ('{4538,5080}'::integer())) AND ((sources_id <> 10) OR (action_date < (now())::date)))

although the index is in place:

"filings_filing_type_id_sources_id_action_date_idx" btree (filing_type_id, sources_id, action_date)

Instead, this index is in action:

"filings_action_date_idx" btree (action_date)

according to the query plan

Formatting math formulas in Google Docs – nesting multiple exponent and index levels

Does anyone know if Google Docs supports exponents and nested indices like the following?

AX3

VSX2

When I try it using the options from the Format-> Text menu, everything is formatted relative to the main line. If the same formatting is applied to text that already has this attribute, it is disabled instead of allowing embedding inside.

Forum Index Redirects Auction # 15 | Forum promotion


Forum index redirect bids
The auction ends every week, at the end of each week, Sunday at 11:59 p.m. (EST)
Competition status:
OPEN
The


In this auction, you are offering FP $ to have the opportunity to have your website link published on the Forum Promotion forum index in the "Forum Redirect Auction" ad space for one week after the end of each weekly raffle, for the duration of the following week. The member who offers the most FP $ before the end of the auction will win.

Please review the following rules before bidding.

Auction rules:

  • Must have at least 10 positions on FP – Only members who have 10 or more positions are authorized to bid.
  • Must have the equivalent of FP $ to match your bid – Failure to have the equivalent amount of FP $ to match your offer will result in the cancellation of your offer and a note added to your account.
  • Offers must be increments of 10 FP $ or more – Any offer less than 10 FP $ from the previous offer will be ignored.
  • End of the auction – Only offers before the end of the closing time of the current week will count. Those bidding after the auction closing time will be canceled.

How to bid:

Just answer this thread below with your offer!

It's late, but let's go.

Google Search Console – Your sitemap or sitemap index file does not correctly declare the namespace!

Here is my site map, it starts like this:








    
        https://autocostos.info/AR
        weekly
        

            
            
            
            
            
            
            
            
            

But the Google search console insists that

Your sitemap or sitemap index file does not correctly declare the namespace

They just give an example on line 16:
Line 16
Parent tag: url
Tag: link

Line 16 corresponds to

What am i doing wrong?

postgresql – Postgres complex similarity query index

I have a materialized view which has a few columns on which I need to execute a complex OR query with a similarity match and the structure is like this

mymatview:

column a,
column b,
column c,
column d,
column e

and on column D (which is a TEXT field), I run a query like this

SELECT * FROM mymatview   
WHERE ((LOWER(d) = <> ) OR (LENGTH(d) > 4 AND d % <>))  
    OR ((LOWER(d) = <> ) OR (LENGTH(d) > 4 AND d % <>))

Currently, the matview contains 1 mil + rows and it performs a sequence scan on this table using the filter above with the OR conditions. Does anyone know what a good index on the d column would help improve the performance of executing a query like this?