text:
Q: Why my RecyclerView with CardView can't set width to match parent? i am wanto show my RecyclerView inside CardView with list, one by one, but my RecyclerView or CardView i think, can't set width to match parent.
This is My Activity Layout :
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_height="wrap_content"
    android:layout_width="match_parent"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:card_view="http://schemas.android.com/tools"
    android:gravity="center_horizontal">

<android.support.v7.widget.RecyclerView
android:id="@+id/rexyclerview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
card_view:cardUseCompatPadding="true"
card_view:cardElevation="5dp"
card_view:cardCornerGroup="5dp"
android:scrollbars="vertical"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp">
</android.support.v7.widget.RecyclerView>

</RelativeLayout>

And This Is My CardView Layout :
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:card_view="http://schemas.android.com/apk/res-auto"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    >

    <android.support.v7.widget.CardView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/cardview"
        android:elevation="3dp"
        card_view:cardUseCompatPadding="true"
        card_view:cardCornerRadius="1dp"
        card_view:cardElevation="4dp"
        >
        <!--
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content">
        -->
        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:gravity="center_horizontal"
            >
             <TextView
            android:layout_width="130sp"
            android:layout_height="wrap_content"
            android:id="@+id/tmpkode"
            android:textSize="11sp"
            android:maxLines="1"

            />
        <TextView
            android:layout_width="70sp"
            android:layout_height="wrap_content"
            android:layout_toRightOf="@id/tmpkode"
            android:layout_marginLeft="10dp"
            android:maxLines="1"
            android:textSize="11sp"
            android:id="@+id/tmptgla"

            android:textAlignment="center"
            />
            <TextView
                android:layout_width="50sp"
                android:layout_height="wrap_content"
                android:textSize="11sp"
                android:layout_toRightOf="@id/tmptgla"
                android:id="@+id/tmpnamaz"
                android:maxLines="1"
                android:layout_marginLeft="10dp"
                android:textAlignment="center"
                />
            <TextView
                android:layout_width="100sp"
                android:textAlignment="center"
                android:layout_toRightOf="@id/tmpnamaz"
                android:layout_height="wrap_content"
                android:maxLines="1"
                android:textSize="11sp"
                android:layout_marginLeft="10dp"

                android:id="@+id/namasup"/>
            <TextView
                android:layout_width="130sp"
                android:layout_height="wrap_content"
                android:layout_toRightOf="@+id/namasup"
                android:textSize="11dp"
                android:id="@+id/nopenawar"
                android:textAlignment="center"/>

        </RelativeLayout>
       <!-- </LinearLayout> -->
    </android.support.v7.widget.CardView>
</LinearLayout>

My Adapter :
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType){
        View Itemview = LayoutInflater.from(parent.getContext()).inflate(R.layout.card, parent, false);
        return new ViewHolder(Itemview);
    }

My Activity :
setContentView(R.layout.approvalpersetujuan);
        recyclerView = (RecyclerView)findViewById(R.id.rexyclerview);
        data = new ArrayList<>();
        Prosesdataserver(0);
        gridLayoutManager = new GridLayoutManager(this, 5);
        recyclerView.setLayoutManager(gridLayoutManager);

A: If you need grid layout manager you can try this out
gridLayoutManager = new GridLayoutManager(this, 1);

Or you can go for a horizontal linear layout manager like so
layoutManager = new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false)

and set it to your recycler view


text:
Q: How to interpolate the GPS readings in the real time in java I am trying to build a real-time car monitoring application using Android. The cars would appear on the map with their current position. The problem is that the updating of the position via the GPS is slow. So the solution that was suggested for that is to use interpolation, and get the missing coordinates until the GPS updates the position. All proposed solutions I found need us to have two GPS coordinates points to interpolate between them, but since I am trying to work in the real time, I only have the initial GPS coordinates to add up to. Can anyone help in how I could achieve this? Or is there any other proposed method I could use?

A: For this, you're going to have to calculate the average speed at which the vehicle was going from the previous two positions (distance/time, preferably meters/s). From that, you can construct a vector and add it to the most current position vector, multiplying it by itself every second between the next update. Simple pseudo-code below:
prevPos = vector
currentPos = vector

prevPosTime = time
currentPosTime = time

speed = ((currentPos - prevPos).magnitude) / (currentPosTime - prevPosTime)

waitingtime = 0
until currentPos change:
    assumedLocation = currentPos + ((currentPos - prevPos).normalized * speed * waitingtime)
    wait(1s)
    waitingtime += 1

I know it's incredibly basic, but I hope you get the gist of where I'm going with this.
Edit -- Just more explanation as to what I'm blabbering on about
(currentPos - prevPos).normalized this is the last known DIRECTION of the vehicle. This can be scaled by multiplying it by any value
(currentPos - prevPos).magnitude this is the last known SPEED. We can't use the normalized vector for this because normalizing 'removes' any scaling. We are basically just calculating how big the vector is and that's our speed.
currentPos + ((currentPos - prevPos).normalized * speed * waitingtime) this adds to the vector from the current pos by the direction multiplied by the speed which is again multiplied by the time since the last update. You end up with a prediction of where the car should be based on the previous speed and direction of travel
Suggested edit:
Important note, this is prediction, not interpolation. We would be using interpolation if we knew both values, however since one is unknown we are using prediction.

A: Polymer has a great answer using linear prediction. However, there are some better prediction methods if you need them.
What i would use is Double Exponential Smoothing. This will not only take the previous positions into account, but also all the other positions.
If your GPS can also give the precision of each detection, you can use a kalman filter. Not an easy filter, but a really good one.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Dynamically allocated 2d integer arrays for the images of different size and unexpectedly terminated using Visual Studio 2022 OpenCV C++ #include <iostream>
#include <filesystem>
#include <string>
#include <fstream>
#include <opencv2/highgui.hpp>
#include <opencv2/imgproc.hpp>
#include <iostream>
#include <ctime>
#include <algorithm>

namespace fs = std::filesystem;
using namespace std;
using namespace cv;

#define SR_RATE 2
#define OFFSET 3

const string DATASET = "Set5";
const string ORIGIN_PATH = "../datasets/2X/625/" + DATASET + "/Y_0.5_temp/";
const string OUTPUT_PATH = "../datasets/2X/625/" + DATASET + "/Y_my_result/";
const string WEIGHTS_PATH = "../weights/2X/625/txt/";

int INPUT_WIDTH, INPUT_HEIGHT;
int INTER_WIDTH, INTER_HEIGHT;
int OUTPUT_WIDTH, OUTPUT_HEIGHT;
//double weights[625][7];

void readImage(int*** input_image, int*** output_image, int*** intermediate_image, Mat img);
void deleteImage(int*** input_image, int ih, int*** output_image, int oh, int*** intermediate_image, int inh);
// void writeImage(string filename, int** output_image, int width, int height, string filetype);
// void classify(int* c0, int* c1, int* c2, int* c3, int p1, int p2, int p3, int p4, int p5);
// void process(int** input_image, int*** output_image, int*** intermediate_image);
// void clearArray(int*** output_image, int*** intermediate_image);

int main()
{
    /* Runtime */
    clock_t startTime, endTime;
    double duration, totalTime = 0.0, imgNum = 0.0;

    startTime = clock();

    /* Load weights */
    /*for (int fi = 0; fi < 625; ++fi) {
        string filename = WEIGHTS_PATH + "0_" + to_string(fi) + ".txt";
        ifstream ifs(filename, ios::in);
        int wi = 0;
        while (ifs >> weights[fi][wi]) {
            wi += 1;
        }
        ifs.close();
    }*/

    endTime = clock();

    totalTime = ((double)(endTime - startTime)) / CLOCKS_PER_SEC;

    for (const auto& entry : fs::directory_iterator(ORIGIN_PATH)) {
        imgNum += 1;
        startTime = clock();

        string filename = entry.path().stem().string();
        string img_path = entry.path().string();
        string filetype = entry.path().extension().string();

        /* Load Image */
        int** input_image = NULL;
        int** intermediate_image = NULL;
        int** output_image = NULL;
        Mat img = imread(img_path, IMREAD_UNCHANGED);

        /* Allocate memory for arrays and Set input_image */
        readImage(&input_image, &output_image, &intermediate_image, img);
        std::cout << "complete" << endl;

        /* Fill Zeros */
        //clearArray(&output_image, &intermediate_image);

        /* Interpolation */
        //process(input_image, &output_image, &intermediate_image);

        /* Output result*/
        //writeImage(filename, output_image, OUTPUT_HEIGHT, OUTPUT_WIDTH, filetype);

        /* Free momory */
        deleteImage(&input_image, INPUT_HEIGHT, &output_image, OUTPUT_HEIGHT, &intermediate_image, INTER_HEIGHT);

        endTime = clock();
        duration = ((double)(endTime - startTime)) / CLOCKS_PER_SEC;
        totalTime += duration;
        std::cout << filename << " : " << duration << endl;
    }
    std::cout << "Total Time: " << totalTime << endl;
    std::cout << "Average Time" << totalTime / imgNum << endl;
}

void readImage(int*** input_image, int*** output_image, int*** intermediate_image, Mat img)
{

    INPUT_HEIGHT = img.rows;
    INPUT_WIDTH = img.cols;
    std::cout << INPUT_HEIGHT << " " << INPUT_WIDTH << endl;

    (*input_image) = new int* [INPUT_HEIGHT];
    for (int i = 0; i < INPUT_HEIGHT; ++i) {
        (*input_image)[i] = new int[INPUT_WIDTH];
    }

    for (int y = 0; y < INPUT_HEIGHT; ++y) {
        for (int x = 0; x < INPUT_WIDTH; ++x) {
            (*input_image)[x][y] = (int)img.ptr<uchar>(y)[x];
        }
    }

    /* if I don't multiply by SR_RATE */
    /* intermediate_image can be newed */

    INTER_HEIGHT = INPUT_HEIGHT * SR_RATE;
    INTER_WIDTH = INPUT_WIDTH * SR_RATE;
    //INTER_WIDTH = INPUT_WIDTH;
    std::cout << INTER_HEIGHT << " " << INTER_WIDTH << endl;

    /************* BUG **************/
    std::cout << "debug1" << endl;
    (*intermediate_image) = new int* [INTER_HEIGHT];
    std::cout << "debug2" << endl;
    for (int i = 0; i < INTER_HEIGHT; ++i) {
        //(*intermediate_image)[i] = new int[INTER_WIDTH];
        (*intermediate_image)[i] = new int[INTER_WIDTH];
    }
    /************* BUG **************/

    OUTPUT_HEIGHT = INPUT_HEIGHT * SR_RATE;
    OUTPUT_WIDTH = INPUT_WIDTH * SR_RATE;
    //std::cout << OUTPUT_HEIGHT << " " << OUTPUT_WIDTH << endl;

    (*output_image) = new int* [OUTPUT_HEIGHT];
    for (int i = 0; i < OUTPUT_HEIGHT; ++i) {
        (*output_image)[i] = new int[OUTPUT_WIDTH];
    }
}

void deleteImage(int*** input_image, int ih, int*** output_image, int oh, int*** intermediate_image, int inh)
{
    for (int i = 0; i < ih; ++i) {
        delete[](*input_image)[i];
    }
    delete[](*input_image);

    for (int i = 0; i < inh; ++i) {
        delete[](*intermediate_image)[i];
    }
    delete[](*intermediate_image);

    for (int i = 0; i < oh; ++i) {
        delete[](*output_image)[i];
    }
    delete[](*output_image);
}

I am using Visual Studio 2022 for my IDE, and using OpenCV C++ to implement a SR interpolation algorithm.The problem are not lie on the interpolation process itself, but at the function readImage.
So I comment the process function and leave readImage and deleteImage (free memory).
The function readImage will new memory for 3 dynamically allocated integer array (input_image, intermediate_image, and output_image. then set input_image with the intensity value of img.
I have troubles when I tried to new memory for int** intermediate_image and int** output_image. The program unexpectedly terminated everytime I read a M by N images. (M by N means the width and the height of image are different) While it works fine for M by M images. I'm pretty sure it's not caused by running out of memory. Although I only read 1 img, it doesn't work. I comment where the program stop at readImage function, and found sometimes it print "debug1" and sometimes it doesn't print anything.
It is so weird, and it seems that when I don't multiply INPUT_WIDTH/HEIGHT by 2, it work okay. I really don't get it. I simulate the process of allocated momory without read in img in Visual Studio Code and it work.


text:
Q: Delete 100+ posts or media files from wordpress faster than default? The pages are running pretty fast but deleting many (like 25) posts at the same time takes up to one minute.
Same thing on the media library - everything is pretty slow.
I disabled already all plugins - MySQL 5.5/PHP5.6 and current Wordpress Version.
This happens on our hosting server as also on local development (in MAMP/macOS)


text:
Q: What are the operands of C.LUI instruction(compressed subset of RISC-V)? In the RISC-V mannual for this instructions is written:

C.LUI loads the non-zero 6-bit immediate field into bits 17–12 of the destination register, clearsthe bottom 12 bits, and sign-extends bit 17 into all higher bits of the destination

And from this I made the conclusion that the immediate should be 6 bits, but then I was compiling something and this line can be compiled but the immediate is more than 6 bits wide, so I am confused
c.lui x14,0xffff8

A: c.lui will accept any 20 bits immediate as long as all the bits 5 to 19 have the same value ( 1 or 0).
So basically c.lui will accept any value between 0xfffe0 and 0xfffff and any value between 1 and 0x1f. 0x0 is not accepted also (see https://riscv.org//wp-content/uploads/2017/05/riscv-spec-v2.2.pdf)
With your example
c.lui a4, 0xffff8 will give the instruction 0x7761 The immediate extracted from this instruction is 0x38 if you shift it by 12 you will get 0x38000 and after that when you sign extend it you will get: 0xffff8000


text:
Q: Select dinamicos año y numero de semanas Estoy intentando hacer dos select dinamicos, el primero es el año y que depende del año que se elija me muestre el segundo select con el numero de semanas.
2015 por ejemplo, tiene 53 semanas, y otros tienen 52. intente poner el segundo select con javascript y el for hasta el valor del año con una funcion para sacar el numero de semanas, no se si se pueda hacer eso, pero no me esta funcionando, que estoy haciendo mal?
echo '
                            </select>

                 Selecciona año:
                    <select name="selectYear" id="selectYear" class="selectpicker" data-size="7" data-live-search="true" required>';

                            for ($i=2015; $i < 2021 ; $i++):
                                if($i == date('Y')) {$selected = 'selected';} else {$selected = '';}
                                    echo '<option value='.$i.' '.$selected.'>'.$i.'</option>';
                                endfor;
                        echo '</select>

';
                    if($selector != 'adminHours'){
                        echo 'Selecciona semana';
                        echo '

';
                        echo '';

A: Te dejo un ejemplo usando jQuery y la libreria de manejo de fechas Moments.js

$(document).ready(function(){

    $(".año").on("change", function(){

        var semanas = moment($(this).val(), "YYYY").isoWeeksInYear();

        $(".semanas").find('option').remove();

        for(var i=0;i<semanas;i++){
          $(".semanas").append("<option value='"+(i+1)+"'>"+(i+1)+"</option>");
        }

    });

});

<select class="año">
  <option value="">seleccione un año</option>
  <option value="2015">2015</option>
  <option value="2016">2016</option>
  <option value="2017">2017</option>
  <option value="2018">2018</option>
</select>

<select class="semanas">

</select>


text:
Q: Put in a dynamically created webpage the content of a HTML template file I have a HTML page that creates dynamically other HTML pages using PHP (fopen,fwrite,...).
The thing is that when I put the content of the HTML template I want for the page into a PHP variable I get into trouble because of the HTML characters (<,>, ...).
How can I avoid this ?
Can I import directly the content of the template file ?

A: Are you trying to include HTML files? That does not work but you could use readfile() instead. If you want to load the file into a variable, use file_get_contents().

A: You can read contents from html file to string $s , handle with $s using php and next echo this: echo $s.

A: You have to close off php-tags like so:

Hello, World!

    <?php
        echo "It is now ".date("H:i");
    ?>

Only the code between  will be interpreted by the php interpreter.

A: Try this :
$content = file_get_contents("your_file.html");
echo $content;


text:
Q: how to add join table in database spring package tn.esprit.spring.DAO.entities;
import lombok.Value;

@Value
public class AccountwithClaimDTO {
    Account account;
    Claim claim;
}

package tn.esprit.spring.DAO.entities;

import java.io.Serializable;

public interface AccountwithClaim{

     public Account getAccount();
        public Claim getClaim();
}

package tn.esprit.spring.DAO.entities;
import java.beans.Transient;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.Entity;
import javax.persistence.Id;
import lombok.Value;

@Entity
@Value
public class ClaimInfo implements Serializable{

    //class claim
    @Id
    LocalDateTime ccreated_at;

    //class account
    Long aidAccount;
    double aBalance;

    //class transaction
    String ttypetransaction;

    //class user
    Long userId;

    public ClaimInfo(LocalDateTime ccreated_at, Long aidAccount, double aBalance, String ttypetransaction, Long userId) {
        super();
        this.ccreated_at = ccreated_at;
        this.aidAccount = aidAccount;
        this.aBalance = aBalance;
        this.ttypetransaction = ttypetransaction;
        this.userId=userId;

    }
}

@Transactional
@Repository
public interface ClaimRepository extends CrudRepository<Claim, Long> {

    @Query("select new tn.esprit.spring.DAO.entities.ClaimInfo(c.created_at, a.idAccount , a.Balance, t.transaction_type,u.id) from Claim c inner join Account a on c.account_id = a.idAccount inner join Transaction t on c.status = t.status inner join User u on a.idAccount = u.id ORDER BY a.idAccount")
        public List<ClaimInfo> getClaimInfoWithConstrutorExp();

}

@RestController
    @RequestMapping("/claim")
    public class ClaimRestController {

    @Autowired
    ClaimRepository claimRepository;

    @GetMapping("/claiminfo")
    public List<ClaimInfo> getClaimInfoWithConstrutorExp(){
        return claimRepository.getClaimInfoWithConstrutorExp();
    }

}

using swagger the join table displays perfectly

but the table claim_info(join table) in the database is empty:
i need to display the the join table above in the database so i can manipulate it later
how can I display the join table in the database?
i joined 4 tables using JPQL in one table , i am able to display it using swagger but the table in the database is still always empty


text:
Q: Direction Cosines and Rotation Angles I'm rotating an object in $3D$ space with respect to a relative base, or reference frame. I'm using a normal vector to represent the rotation angles.
Suppose you have an object parallel to the reference frame; in this case the object has the following normal vector: $v=[0, 0, 1]$. So, the normal vector makes $90^\circ$ with x-axis and y-axis and $0^\circ$ with z-axis. (I suppose z-axis is the principle axis).
My question is: If we rotate the object $30^\circ$ around x-axis; what is the direction normal and the angles? is the change only on the angle around x-axis or z-axis also. I noted when I rotate $30^\circ$ around x-axis the z-axis also rotated with the same amount. This confused me.
Any Help!.

A: I'll assume you mean the object's position when you say $v = (0,0,1)$.  Since the object lies on the $z$-axis, rotation of $30$ degrees about $x$-axis, then the direction normal changes with $\theta$ as it goes from $0$ to $30$, and $x$ gets fixed:
In a right-hand-rule system, rotation around $x$-axis analogous to standard rotation in the $xy$-plane (around $z$-axis), we have that the $y$-axis takes the place of $x$-axis, and $z$-axis takes the place of $y$-axis.
$$
R_{\theta}(x,y,z) = (x, e^{i\theta}\cdot (y + zi))
$$
i.e. treat $(y,z)$ like a complex number and multiply to get the $\cos\theta, \sin\theta$ formulas.
The unit vector tangent to the direction of motion starts out as the $-\hat{y}$ (the unit vector parallel to $y$-axis), and progresses with $\theta$ as
$$
R_{\theta}(0, 1, 0) = (0, e^{i\theta} (1 + 0i)) = (0, \cos\theta, \sin\theta)
$$
Expanding the first one also gives you a vector normal to the direction of rotation, but clearly there are infinitely many normal vectors to the circular path to choose from.


text:
Q: Angular 5 service call not working based on modal result I have a delete button on the table when user click delete button basically I would like to ask confirmation from the user for delete. If use clicked yes I need to make service call. I'm facing an issue when I making service call. Below is my code and I have attached the error as well.
delete (id) {
    this.modalRef = this.modalService.show(ConfirmationModalComponent);
    this.modalRef.content.onClose.subscribe(result => {
        if (result === true) {
            this.userService.deleteUser(id).subscribe(response => {
                alert("Record deleted successfully");
            });
        }
    });
}


text:
Q: Java tryParseInt best practice I have a lot of code that gathers user input and parses it,
I want to parse integer values without throwing exceptions.
My current tryParseInt() function is code is simple:
public static Integer tryParseInt( String text )
{
    if(text == null)
        return null;

    try
    {
        return new Integer( text.trim() );
    }
    catch ( NumberFormatException e )
    {
        return null;
    }
}

But i am getting lots of NumberFormatExceptions and i am worried becouse that may impact my app performance.
Can anyone suggest me on best practice for parsing user inputs.
Thank you

A: You can go with regex as it is more fail proof
 public static Integer tryParseInt(String text) {
    if (text != null && !text.isEmpty()) {
        if (text.trim().matches("[0-9]+")) {
            return Integer.valueOf(text.trim());
        }
    }
    return null;
}

A: This is a very helpful experiment and indeed my experience is removing exceptions is better for performance

A: If you are getting a lot of NumberFormatExceptions, you might consider checking the parsing input before the actual parsing.
BTW the return new Integer( text.trim() ); is not very efficient as you will be allocating a lot of unnecessary objects (in the range from -128 to 127).
public static Integer tryParseInt(String text) {
    if(text == null)
        return null;

    try {
        return Integer.valueOf(text.trim());
    }
    catch (NumberFormatException e) {
        return null;
    }
}


text:
Q: How to save file downloaded by button click with Mechanize I'm trying to use Mechanize to simulate clicking a button on a web page, which then would initiate a file download in a browser. This is a snippet of my code
form = page.forms.first # => Mechanize::Form
form = agent.page.form_with(:name => "aspnetForm")

button = form.button_with(:value => "GPX file")
pp button

agent.submit(form, button)

the output from pp button is displayed thus, which means it's the right button:
#<Mechanize::Form::Submit:0x89fe874
 @name="ctl00$ContentBody$btnGPXDL",
 @node=
  #(Element:0x44ff480 {
    name = "input",
    attributes = [
      #(Attr:0x44476d2 { name = "type", value = "submit" }),
      #(Attr:0x44476c8 {
        name = "name",
        value = "ctl00$ContentBody$btnGPXDL"
        }),
      #(Attr:0x44476be { name = "value", value = "GPX file" }),
      #(Attr:0x44476a0 { name = "id", value = "ctl00_ContentBody_btnGPXDL" })]
    }),
 @value="GPX file">

but having issued the "agent.submit(form, button)" how can I get Mechanize to retrieve the file that would be sent to the browser on clicking that button?
I've had a search and found methods for getting web pages, or links , but didn't see anything to suit this case?
BTW I'm a complete newbie to both ruby and Mechanize, so sorry if this is a stupid question, but thanks for any responses!
M:

A: The file or page should be the returned by the submit:
response = agent.submit(form, button)
File.open('saved_file', 'wb'){|f| f << response.body}


text:
Q: Query for Engagement Campaign I'm trying to confirm that the query I have written is correct. I'm trying to pull back people from the 3 lists in the query that have not opened an email within the last 6 months to start a re-engagement/inactive campaign. Also, can Salesforce look past 6 months if I wanted to do the same for clicks? Thanks! (Note - we use subscriber key as email)
SELECT distinct SubscriberKey
FROM _Sent
WHERE EventDate > dateadd(day, -180, getdate())
AND SubscriberKey NOT IN (
   SELECT SubscriberKey
   FROM _Open
   WHERE EventDate > dateadd(day, -180, getdate())
)
AND ListID IN ('3672' , '3673' , '3671')

A: Yes, but if you have a decent amount of sends, then it'll likely not complete before it hits the 30 minute timeout window.  The System Data Views are very slow.
I generally get a list of jobs by pickuptime (target: DE1), find all of the sends for jobs in DE1 (target: DE2), find all of the opens for jobs in DE1 and then do a sub-query exclusion or left-join-where-target-is-null to find those sent an email but with no opens (target: DE3).

A: Adam's answer trumps mine by far but another possible approach that might be applicable for you would be to look at the "EmailName"
Let's say you'd want to target everyone has not opened an email in the last 6 months across all your automated campaigns.
You could try the below:
SELECT _Sent.SubscriberKey
FROM _Sent
INNER JOIN _Job
ON _Sent.JobID = _Job.JobID
WHERE _Sent.EventDate > dateadd(day, -180, getdate())
AND SubscriberKey NOT IN (
   SELECT SubscriberKey
   FROM _Open
   WHERE EventDate > dateadd(day, -180, getdate())
AND (_Job.EmailName = 'EmailName1'
OR _Job.EmailName = 'EmailName2')

If anyone has any issues on my answer please feel free to let me know as I'd appreciate the feedback.

A: J. Donders, in your question, you had also asked if Salesforce can look past 6 month.
Although, the system data views only reference the last 6 months of data.  You can run tracking extracts on data ranges over 6 month.  The tracking extracts contain historically date dating back to the account setup.
In order to query this data it requires much more setup of course.  You would need to first export the data and import it back into a data extensions. Before you could query against it.


text:
Q: How to filter Google Maps markers in one array with select? I have a google maps implemented in my site with one array, like so:
var gmarkers1 = [];
var markers1 = [];

markers1 = [
['0', 'Title', 52.4357808, 4.991315699999973],
['1', 'Title', 52.4357808, 4.991315699999973],
['2', 'Title', 52.4555687, 5.039231599999994],
];

In this example there are 3 markers, but in reality there are a lot more. For my purpose, this is the only way to do it (one array).
Question: I want to be able to filter inside this array with a selectbox. So a user selects "car" from a select and Google Maps only shows the markers with a property (?) "car".
The Markers are shown like this:
for (i = 0; i < markers1.length; i++) {
    var category;
    var pos = new google.maps.LatLng(markers1[i][2], markers1[i][3]);
    var content = markers1[i][1];
    bounds.extend(pos);
    marker1 = new google.maps.Marker({
        position: pos,
        map: map,
        icon: image1
    });

    gmarkers1.push(marker1);
    // [START]-Event listener to center view and go to position
    google.maps.event.addListener(marker1, 'click', (function(marker1, content) {
        return function() {
          console.log('Gmarker 1 gets pushed')
            infowindow.setContent(content);
            infowindow.open(map, marker1);
            map.panTo(this.getPosition());
            map.setZoom(15);
        }
    })(marker1, content));
}

A: Building on top of @Rene Korss' solution, here is filter with multiple selection, based on checkboxes, but can easily be made to be multiple select list - just get array with the names of the options to compare with.

var gmarkers1 = [];
var markers1 = [];
var infowindow = new google.maps.InfoWindow({
  content: ''
});
// Our markers
markers1 = [
  ['0', 'Title 1', 52.4357808, 4.991315699999973, ['car', 'second']],
  ['1', 'Title 2', 52.4357808, 4.981315699999973, ['third']],
  ['2', 'Title 3', 52.4555687, 5.039231599999994, ['car', 'third']],
  ['3', 'Title 4', 52.4555687, 5.029231599999994, ['second']]
];
markerCount = markers1.length
// Function to init map
function initialize() {
  var center = new google.maps.LatLng(52.4357808, 4.991315699999973);
  var mapOptions = {
    zoom: 12,
    center: center,
    mapTypeId: google.maps.MapTypeId.TERRAIN
  };

  map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
  for (i = 0; i < markerCount; i++) {
    addMarker(markers1[i]);
  }
}
// Function to add marker to map
function addMarker(marker) {
  var category = marker[4];
  var title = marker[1];
  var pos = new google.maps.LatLng(marker[2], marker[3]);
  var content = marker[1];

  marker1 = new google.maps.Marker({
    title: title,
    position: pos,
    category: category,
    map: map
  });

  gmarkers1.push(marker1);

  // Marker click listener
  google.maps.event.addListener(marker1, 'click', (function(marker1, content) {
    return function() {
      console.log('Gmarker 1 gets pushed');
      infowindow.setContent(content);
      infowindow.open(map, marker1);
      map.panTo(this.getPosition());
      map.setZoom(15);
    }
  })(marker1, content));
}
// Function on Change of checkbox
updateView = function(element) {
  if (element) {
    //Get array with names of the checked boxes
    checkedBoxes = ([...document.querySelectorAll('input[type=checkbox]:checked')]).map(function(o) {
      return o.id;
    });
    console.log(checkedBoxes);
    for (i = 0; i < markerCount; i++) {
      marker = gmarkers1[i];
      console.log(marker.category)
      //Filter to show any markets containing ALL of the selected options
      if (typeof marker.category == 'object' && checkedBoxes.every(function(o) {
          return (marker.category).indexOf(o) >= 0;
        })) {
        marker.setVisible(true);
      } else {
        marker.setVisible(false);
      }
    }
  } else {
    console.log('No param given');
  }
}
// Init map
initialize();
#map-canvas {
  width: 500px;
  height: 500px;
}

  <input type="checkbox" id="car" onchange="updateView(this);" /> Car
  <input type="checkbox" id="second" onchange="updateView(this);" /> Second
  <input type="checkbox" id="third" onchange="updateView(this);" /> Third

Basically, you just get an array with the names of the selected checkboxes id's:
checkedBoxes = ([...document.querySelectorAll('input[type=checkbox]:checked')]).map(function(o) { return o.id; });
Then you compare each location category and show it if include all of the selected checkboxes but might have more unselected. If none are selected, all are shown:
if(typeof marker.category == 'object' && checkedBoxes.every(function (o) {return (marker.category).indexOf(o) >= 0;})){
      marker.setVisible(true);
}
else {
      marker.setVisible(false);
}

Here is also a JSfiddle
Update: as per the comment request here is code snippet which does not show anything unless you check something. Also the logic is that you need to have exactly the same categories selected as the marker in order to be visible.

var gmarkers1 = [];
var markers1 = [];
var infowindow = new google.maps.InfoWindow({
  content: ''
});
// Our markers
markers1 = [
  ['0', 'Title 1', 52.4357808, 4.991315699999973, ['car', 'second']],
  ['1', 'Title 2', 52.4357808, 4.981315699999973, ['third']],
  ['2', 'Title 3', 52.4555687, 5.039231599999994, ['third', 'car']],
  ['3', 'Title 4', 52.4555687, 5.029231599999994, ['second']]
];
markerCount = markers1.length
// Function to init map
function initialize() {
  var center = new google.maps.LatLng(52.4357808, 4.991315699999973);
  var mapOptions = {
    zoom: 12,
    center: center,
    mapTypeId: google.maps.MapTypeId.TERRAIN
  };

  map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
  for (i = 0; i < markerCount; i++) {
    addMarker(markers1[i]);
  }
}
// Function to add marker to map
function addMarker(marker) {
  var category = marker[4];
  var title = marker[1];
  var pos = new google.maps.LatLng(marker[2], marker[3]);
  var content = marker[1];

  marker1 = new google.maps.Marker({
    title: title,
    position: pos,
    category: category,
    map: map
  });

  gmarkers1.push(marker1);

  // Marker click listener
  google.maps.event.addListener(marker1, 'click', (function(marker1, content) {
    return function() {
      console.log('Gmarker 1 gets pushed');
      infowindow.setContent(content);
      infowindow.open(map, marker1);
      map.panTo(this.getPosition());
      map.setZoom(15);
    }
  })(marker1, content));
}
// Function on Change of checkbox
updateView = function(element) {
  if (element) {
    //Get array with names of the checked boxes
    checkedBoxes = ([...document.querySelectorAll('input[type=checkbox]:checked')]).map(function(o) {
      return o.id;
    });
    console.log(checkedBoxes);
    for (i = 0; i < markerCount; i++) {
      marker = gmarkers1[i];
      console.log(marker.category)
      //Filter to show any markets containing ALL of the selected options
      if(typeof marker.category == 'object' && marker.category.length === checkedBoxes.length && checkedBoxes.reduce((a, b) => a && marker.category.includes(b), true)){
        marker.setVisible(true);
      } else {
        marker.setVisible(false);
      }
    }
  } else {
    console.log('No param given');
  }
}
// Init map
initialize();
#map-canvas {
  width: 500px;
  height: 500px;
}

  <input type="checkbox" id="car" onchange="updateView(this);" /> Car
  <input type="checkbox" id="second" onchange="updateView(this);" /> Second
  <input type="checkbox" id="third" onchange="updateView(this);" /> Third

And the JSfiddle

A: You should add category as marker property.
markers1 = [
    ['0', 'Title 1', 52.4357808, 4.991315699999973, 'car'],
    ['1', 'Title 2', 52.4357808, 4.981315699999973, 'third'],
    ['2', 'Title 3', 52.4555687, 5.039231599999994, 'car'],
    ['3', 'Title 4', 52.4555687, 5.029231599999994, 'second']
];

Create marker. Marker is object, so add category as property.
var category = markers1[i][4];
var pos = new google.maps.LatLng(markers1[i][2], markers1[i][3]);
marker1 = new google.maps.Marker({
    position: pos,
    map: map,
    category: category,
    icon: image1
});

And on select change, call function what checks if category is same as selected.
/**
 * Function to filter markers by category
 */

filterMarkers = function(category)
{
   for (i = 0; i < gmarkers1.length; i++) {
      marker = gmarkers1[i];

      // If is same category or category not picked
      if(marker.category == category || category.length == 0)
      {
          marker.setVisible(true);
      }
      // Categories don't match
      else
      {
          marker.setVisible(false);
      }
    }
}

Working example

var gmarkers1 = [];
var markers1 = [];
var infowindow = new google.maps.InfoWindow({
    content: ''
});

// Our markers
markers1 = [
    ['0', 'Title 1', 52.4357808, 4.991315699999973, 'car'],
    ['1', 'Title 2', 52.4357808, 4.981315699999973, 'third'],
    ['2', 'Title 3', 52.4555687, 5.039231599999994, 'car'],
    ['3', 'Title 4', 52.4555687, 5.029231599999994, 'second']
];

/**
 * Function to init map
 */

function initialize() {
    var center = new google.maps.LatLng(52.4357808, 4.991315699999973);
    var mapOptions = {
        zoom: 12,
        center: center,
        mapTypeId: google.maps.MapTypeId.TERRAIN
    };

    map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
    for (i = 0; i < markers1.length; i++) {
        addMarker(markers1[i]);
    }
}

/**
 * Function to add marker to map
 */

function addMarker(marker) {
    var category = marker[4];
    var title = marker[1];
    var pos = new google.maps.LatLng(marker[2], marker[3]);
    var content = marker[1];

    marker1 = new google.maps.Marker({
        title: title,
        position: pos,
        category: category,
        map: map
    });

    gmarkers1.push(marker1);

    // Marker click listener
    google.maps.event.addListener(marker1, 'click', (function (marker1, content) {
        return function () {
            console.log('Gmarker 1 gets pushed');
            infowindow.setContent(content);
            infowindow.open(map, marker1);
            map.panTo(this.getPosition());
            map.setZoom(15);
        }
    })(marker1, content));
}

/**
 * Function to filter markers by category
 */

filterMarkers = function (category) {
    for (i = 0; i < gmarkers1.length; i++) {
        marker = gmarkers1[i];
        // If is same category or category not picked
        if (marker.category == category || category.length === 0) {
            marker.setVisible(true);
        }
        // Categories don't match
        else {
            marker.setVisible(false);
        }
    }
}

// Init map
initialize();
#map-canvas {
    width: 500px;
    height: 500px;
}

<select id="type" onchange="filterMarkers(this.value);">
    <option value="">Please select category</option>
    <option value="second">second</option>
    <option value="car">car</option>
    <option value="third">third</option>
</select>

Filter by multiple categories on marker
EDIT for @Myoji comment
To use multiple categories on each marker, just add them as array and edit if condition on filterMarkers.
markers1 = [
    ['0', 'Title 1', 52.4357808, 4.991315699999973, ['car', 'second']],
    ['1', 'Title 2', 52.4357808, 4.981315699999973, ['third']],
    ['2', 'Title 3', 52.4555687, 5.039231599999994, ['car', 'third']],
    ['3', 'Title 4', 52.4555687, 5.029231599999994, ['second']]
];

And filterMarkers would be
/**
 * Function to filter markers by category
 */

filterMarkers = function(category)
{
   for (i = 0; i < gmarkers1.length; i++) {
      marker = gmarkers1[i];

      // If is same category or category not picked
      if((typeof marker.category == 'object' && marker.category.indexOf(category) >= 0) || category.length == 0){
      {
          marker.setVisible(true);
      }
      // Categories don't match
      else
      {
          marker.setVisible(false);
      }
    }
}

Working example

var gmarkers1 = [];
var markers1 = [];
var infowindow = new google.maps.InfoWindow({
    content: ''
});

// Our markers
markers1 = [
  ['0', 'Title 1', 52.4357808, 4.991315699999973, ['car', 'second']],
  ['1', 'Title 2', 52.4357808, 4.981315699999973, ['third']],
  ['2', 'Title 3', 52.4555687, 5.039231599999994, ['car', 'third']],
  ['3', 'Title 4', 52.4555687, 5.029231599999994, ['second']]
];

/**
 * Function to init map
 */

function initialize() {
    var center = new google.maps.LatLng(52.4357808, 4.991315699999973);
    var mapOptions = {
        zoom: 12,
        center: center,
        mapTypeId: google.maps.MapTypeId.TERRAIN
    };

    map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
    for (i = 0; i < markers1.length; i++) {
        addMarker(markers1[i]);
    }
}

/**
 * Function to add marker to map
 */

function addMarker(marker) {
    var category = marker[4];
    var title = marker[1];
    var pos = new google.maps.LatLng(marker[2], marker[3]);
    var content = marker[1];

    marker1 = new google.maps.Marker({
        title: title,
        position: pos,
        category: category,
        map: map
    });

    gmarkers1.push(marker1);

    // Marker click listener
    google.maps.event.addListener(marker1, 'click', (function (marker1, content) {
        return function () {
            console.log('Gmarker 1 gets pushed');
            infowindow.setContent(content);
            infowindow.open(map, marker1);
            map.panTo(this.getPosition());
            map.setZoom(15);
        }
    })(marker1, content));
}

/**
 * Function to filter markers by category
 */

filterMarkers = function (category) {
    for (i = 0; i < gmarkers1.length; i++) {
        marker = gmarkers1[i];
        // If is same category or category not picked
        if((typeof marker.category == 'object' && marker.category.indexOf(category) >= 0) || category.length == 0){
            marker.setVisible(true);
        }
        // Categories don't match
        else {
            marker.setVisible(false);
        }
    }
}

// Init map
initialize();
#map-canvas {
    width: 500px;
    height: 500px;
}

<select id="type" onchange="filterMarkers(this.value);">
    <option value="">Please select category</option>
    <option value="second">second</option>
    <option value="car">car</option>
    <option value="third">third</option>
</select>

Fit bounds after filtering
EDIT for @bluantinoo comment
/**
 * Function to filter markers by category
 */

filterMarkers = function(category)
{
    var bounds = new google.maps.LatLngBounds();
    for (i = 0; i < gmarkers1.length; i++) {
        marker = gmarkers1[i];

        // If is same category or category not picked
        if(marker.category == category || category.length == 0)
        {
            marker.setVisible(true);
            bounds.extend(marker.getPosition());
        }
        // Categories don't match
        else
        {
            marker.setVisible(false);
        }
        map.fitBounds(bounds);
    }
}

Working example

var gmarkers1 = [];
var markers1 = [];
var infowindow = new google.maps.InfoWindow({
    content: ''
});

// Our markers
markers1 = [
    ['0', 'Title 1', 52.4357808, 4.991315699999973, 'car'],
    ['1', 'Title 2', 52.4357808, 4.981315699999973, 'third'],
    ['2', 'Title 3', 52.4555687, 5.039231599999994, 'car'],
    ['3', 'Title 4', 52.4555687, 5.029231599999994, 'second']
];

/**
 * Function to init map
 */

function initialize() {
    var center = new google.maps.LatLng(52.4357808, 4.991315699999973);
    var mapOptions = {
        zoom: 12,
        center: center,
        mapTypeId: google.maps.MapTypeId.TERRAIN
    };

    map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
    for (i = 0; i < markers1.length; i++) {
        addMarker(markers1[i]);
    }
}

/**
 * Function to add marker to map
 */

function addMarker(marker) {
    var category = marker[4];
    var title = marker[1];
    var pos = new google.maps.LatLng(marker[2], marker[3]);
    var content = marker[1];

    marker1 = new google.maps.Marker({
        title: title,
        position: pos,
        category: category,
        map: map
    });

    gmarkers1.push(marker1);

    // Marker click listener
    google.maps.event.addListener(marker1, 'click', (function (marker1, content) {
        return function () {
            console.log('Gmarker 1 gets pushed');
            infowindow.setContent(content);
            infowindow.open(map, marker1);
            map.panTo(this.getPosition());
            map.setZoom(15);
        }
    })(marker1, content));
}

/**
 * Function to filter markers by category
 */

filterMarkers = function(category)
{
    var bounds = new google.maps.LatLngBounds();
    for (i = 0; i < gmarkers1.length; i++) {
        marker = gmarkers1[i];

        // If is same category or category not picked
        if(marker.category == category || category.length == 0)
        {
            marker.setVisible(true);
            bounds.extend(marker.getPosition());
        }
        // Categories don't match
        else
        {
            marker.setVisible(false);
        }
        map.fitBounds(bounds);
    }
}

// Init map
initialize();
#map-canvas {
    width: 500px;
    height: 500px;
}

<select id="type" onchange="filterMarkers(this.value);">
    <option value="">Please select category</option>
    <option value="second">second</option>
    <option value="car">car</option>
    <option value="third">third</option>
</select>


text:
Q: Beautiful Soup Nested Tag Search I am trying to write a python program that will count the words on a web page. I use Beautiful Soup 4 to scrape the page but I have difficulties accessing nested HTML tags (for example:
 inside
).
Every time I try finding such tag using page.findAll() (page is Beautiful Soup object containing the whole page) method it simply doesn't find any, although there are. Is there any simple method or another way to do it?

A: Try this one :
data = []
for nested_soup in soup.find_all('xyz'):
    data = data + nested_soup.find_all('abc')

Maybe you can turn in into lambda and make it cool, but this works. Thanks.

A: Maybe I'm guessing what you are trying to do is first looking in a specific div tag and the search all p tags in it and count them or do whatever you want. For example:
soup = bs4.BeautifulSoup(content, 'html.parser')

# This will get the div
div_container = soup.find('div', class_='some_class')

# Then search in that div_container for all p tags with class "hello"
for ptag in div_container.find_all('p', class_='hello'):
    # prints the p tag content
    print(ptag.text)

Hope that helps

A: UPDATE: I noticed that text does not always return the expected result, at the same time, I realized there was a built-in way to get the text, sure enough reading the docs
we read that there is a method called get_text(), use it as:
from bs4 import BeautifulSoup
fd = open('index.html', 'r')
website= fd.read()
fd.close()
soup = BeautifulSoup(website)
contents= soup.get_text(separator=" ")
print "number of words %d" %len(contents.split(" "))

INCORRECT, please read above.Supposing that you have your html file locally in index.html you can:
from bs4 import BeautifulSoup
import re
BLACKLIST = ["html", "head", "title", "script"] # tags to be ignored
fd = open('index.html', 'r')
website= fd.read()
soup = BeautifulSoup(website)
tags=soup.find_all(True) # find everything
print "there are %d" %len(tags)

count= 0
matcher= re.compile("(\s|\n|
)+")
for tag in tags:
if tag.name.lower() in BLACKLIST:
    continue
    temp = matcher.split(tag.text) # Split using tokens such as \s and \n
    temp = filter(None, temp) # remove empty elements in the list
    count +=len(temp)
print "number of words in the document %d" %count
fd.close()

Please note that it may not be accurate, maybe because of errors in formatting, false positives(it detects any word, even if it is code), text that is shown dynamically using javascript or css, or other reason

A: You can find all
 tags using regular expressions (re module).
Note that r.content is a string which contains the whole html of the site.
for eg:
 r = requests.get(url,headers=headers)
 p_tags = re.findall(r'
.*?
',r.content)

this should get you all the
 tags irrespective of whether they are nested or not. And if you want the a tags specifically inside the  tags you can add that whole tag as a string in the second argument instead of r.content.
Alternatively if you just want just the text you can try this:
from readability import Document #pip install readability-lxml
import requests
r = requests.get(url,headers=headers)
doc = Document(r.content)
simplified_html = doc.summary()

this will get you a more bare bones form of the html from the site, and now proceed with the parsing.


text:
Q: Redirect URLs ending with a dot I am trying to redirect URLs ending with a dot but it doesn't work...
I have tested with this:
RedirectMatch 301 ^/tum_and_valhalla.$ /tum_and_valhalla
RedirectMatch 301 ^/tum_and_valhalla\.$ /tum_and_valhalla
RedirectMatch 301 ^/tum_and_valhalla(.*)$ /tum_and_valhalla

but none of them are working.
How should it be done?
I would also be very grateful to get input on how to deal with URLs including an &
Example:
RedirectMatch 301 ^/ol&t$ /olt

Thanks!


text:
Q: How do we load AngularJS at the end of body instead of the header? By default, AngularJS doesn't seem to work unless I put it in the <head>. Is there a way to put it at the end of the <body> instead?
My code looks like this in the footer:
$(document).ready(function() {
    var myApp = angular.module("myApp", []);

    myApp.bootstrap(document, ["myApp"]);

    myApp.controller("AppController",["$scope", "$http", function() {
        // so stuff with the $scope.
    }]);
});

EDIT 3/31/14:
Based on ederollora's answer and doing some research, I discovered that the call to angular.bootstrap() needs to be called after everything is defined. The above code becomes this:
$(document).ready(function() {
    var myApp = angular.module("myApp", []);

    myApp.controller("AppController",["$scope", "$http", function() {
        // so stuff with the $scope.
    }]);

    myApp.bootstrap(document, ["myApp"]); // compile the app last
});

Also, in the interest of migrating my app from jQuery to Angular, I change the document.ready calls to the angular version:
angular.element(document).ready(function() {
    var myApp = angular.module("myApp", []);

    myApp.controller("AppController",["$scope", "$http", function() {
        // so stuff with the $scope.
    }]);

    myApp.bootstrap(document, ["myApp"]); // compile the app last
});

It wasn't clear in the documentation that angular.boostrap() had to be called after defining everything, so I went and improved the documentation.

A: From AngularJS doc page:

Angular  Tag
This example shows the recommended path for integrating Angular with what we call automatic initialization.

<!doctype html>
<html xmlns:ng="http://angularjs.org" ng-app>
  <body>
  ...
  <script src="angular.js">
  </body>
</html>

*

*Place the script tag at the bottom of the page. Placing script tags at the end of the page improves app load time because the HTML loading is not blocked by loading of the angular.js script. You can get the latest bits from http://code.angularjs.org. Please don't link your production code to this URL, as it will expose a security hole on your site. For experimental development linking to our site is fine.

The information was found: here


text:
Q: ctags - generate tags file recursively on OpenBSD Although the ctags manual page for a typical Linux machine says that that the -R switch can be used to generate a "tags" file recursively, the manual page for OpenBSD does not mention how to achieve this. So how do I do this on OpenBSD? Am I missing something? Please help.
I am using Vim 8.0.987

A: The former is "Exuberant Ctags", the latter is "ctags". They are different programs so you can't really expect them to have the same options/features.
If you want Exuberant Ctags, install it.


text:
Q: What kind of series is the function $\frac{x}{e^x-1}$? How to expand the series $\dfrac{1}{e^x-1}$
Series expansion for $f(x)=\frac{x}{e^x-1}$
In these topics, I have asked for a way to develop the function $\dfrac{x}{e^x-1}$ into series. I won't do that here.
From what I see, this function should not have a Maclaurin series (centered at 0) since the function and its higher derivative remain undefined when x=0. Then what is the name for the series derived from the topics that I mention above. Is it a Laurent series or Puisseux series?

A: The function itself is not a series, of any kind. A series is one way to represent a function.
I think the term you're looking for is Laurent series. This is the generalisation of Maclaurin series that allows for negative integer exponents.
Puisseux series allow for fractional exponents as well. That is not what these examples use, so while the term may technically be applicable (I don't know much about them personally), it's not what I would call it.

A: The Bernoulli numbers $B_n$ can be generated by
\begin{equation*}
\frac{z}{e^z-1}=\sum_{n=0}^\infty B_n\frac{z^n}{n!}=1-\frac{z}2+\sum_{n=1}^\infty B_{2n}\frac{z^{2n}}{(2n)!}, \quad \vert z\vert<2\pi.
\end{equation*}
Since the function
$
\frac{x}{e^x-1}-1+\frac{x}2
$
is even in $x\in\mathbb{R}$, all the Bernoulli numbers $B_{2n+1}$ for $n\in\mathbb{N}$ equal $0$.

*

*Feng Qi, A double inequality for the ratio of two non-zero neighbouring Bernoulli numbers, Journal of Computational and Applied Mathematics 351 (2019), 1--5; available online at https://doi.org/10.1016/j.cam.2018.10.049.


text:
Q: How to fix branches of partial directory structure in SVN to Git migration I'm trying to convert an SVN repository containing a Java EE application into a Git repository. The original repository contains a folder for each part of the Java EE project which has been maintained as separate projects history-wise. For two of the projects there's also a "production"-branch (again, two separate branches) and whenever a new revision goes into production trunk is merged up into production.
When I import this into one single git repository (as I understand would be best practice) everything in master is fine, but when I switch to a branch I only get the files of that branch and most of the other folders and files disappear.
Repository layout:
/
trunk/
   project1/
   project2/
   project3/
   project4/
branches/
   project3-production-branch/
   project4-production-branch/
tags/

I found a post by Eric Gwin about this issue, but I couldn't see there was any solutions to it. http://comments.gmane.org/gmane.comp.ide.eclipse.git/77
I might be overlooking something very elementary here, but I do fear that the only solution is to import the projects separetely? Any suggestions to how I can import the whole SVN-repo and get working branches in Git?

A: Initial situation
After converting this to a single repository, the directory structure in master (or trunk) looks like this:
project1/
project2/
project3/
project4/

The structure after the first commit of the project3-production-branch looks either like this:
project3/

Or it contains the contents of project3 directly:
.project
src/
test/

This depends on where the branch was copied from in Subversion.
In the first case, the next step can be skipped.
In both cases, all other projects were removed on the branch (you should see that in the diff of the first commit) and need to be restored, see second step.
Step 1: Rewrite branch to move all contents into subdirectory (if needed)
See example "To move the whole tree into a subdirectory" in filter-branch and execute that only on the branch, like so:
git filter-branch --index-filter \
    'git ls-files -s | sed "s-\t\"*-&project3/-" |
        GIT_INDEX_FILE=$GIT_INDEX_FILE.new \
            git update-index --index-info &&
     mv "$GIT_INDEX_FILE.new" "$GIT_INDEX_FILE"' \
     master..project3-production-branch

Step 2: Rewrite branch to restore other projects
In this step we want to undo the removal of the other projects in the first branch commit. This can be done using the following:
branch="project3-production-branch"
parent=`git merge-base $branch master` # or replace master with trunk if needed
paths="project1 project2 project4"
git filter-branch -f --index-filter \
"git reset -q $parent -- $paths" --tag-name-filter cat -- \
$parent..$branch

It resets the other paths to the state they were in when the branch was created, for all commits from the branch.


text:
Q: Having trouble accessing  tags with BeautifulSoup I'm new to python but am trying to use BeautifulSoup to create a web scraper. I have a spreadsheet with a list of names, which I am using to generate a url, which will take me to a website with a table of data. I'm then trying to take some of that data and populate a spreadsheet with it. Using the developer tools in chrome, I see the information i want is under  tags. Using soup.select(tr) I am trying to generate a list of these tags which I can then iterate through to get the info I want.
However, this call generates an empty list every time. When I navigate to the url generated by the code, I am taken to the correct page on the site where I can find the tags and info I am interested in. But when I print(soup.prettify()), I get an extremely condensed version of the html without the tags or info I'm interested in.
Here I've posted the relevent section of my code, a snippet of the HTML I'm trying to get at and the condensed version I get. Sorry for the long post, but I would sincerely appreciate any help I can get.
base_url = 'http://portal.vertnet.org/search?q=specificepithet:'
for x in range(1,list_length):
    genus = sheet.cell(row = x, column = 2).value
    epithet = sheet.cell(row = x, column = 3).value
    url = base_url + str(epithet) + '+genus:' + str(genus) + '+hastissue:1'
    res = requests.get(url)
    res.raise_for_status()
    soup = bs4.BeautifulSoup(res.text, 'html.parser')
    table_rows = soup.select('tr')
    print(len(table_rows))
    tot_entries = min(5, len(table_rows))
    ents = 0
    prev_museums = []
    while ents < tot_entries:
        for y in range(2, tot_entries+2):
            for x in len(table_rows):
                first_cell = soup.select('td')[0]
                museum = first_cell.getText()
                if museum not in prev_museums:
                    other_sheet.cell(row = x, column = y).value = first_cell
                    prev_museums += first_cell[0:5]
                    ents +=1
r.save('completetissuelist.xlsx')

I am trying to capture the first td tag in a number of tr tags.

 CUMV Mammal specimens 21200
Mammalia: Sciurus carolinensis
 United States, New York, Tompkins County: Ithaca, 505 Hector Street
Collector(s): Margaret Terrell; Preparator(s): Michi T. Schulenberg
female

2006-03-29

Finally, here is the body of what BeautifulSoup seems to be parsing, minus the disclaimer.

       VertNet | Funding by

Again, sorry for the length, but I would really appreciate any help I can get.

A: The search results are loaded from an XHR POST request to the http://portal.vertnet.org/service/rpc/record.search endpoint. Mimic this request in your code and parse the JSON response (no HTML-parsing involved):
import json
import requests

specific_epiphet = "cedrorum"
genus = "Bombycilla"
url = 'http://portal.vertnet.org/service/rpc/record.search'
payload = {
    "limit": 100,
    "q": json.dumps(
        {"keywords": ["specificepithet:" + specific_epiphet, "genus:" + genus, "hastissue:1"]}
    )
}

res = requests.post(url,
                    json=payload,
                    headers={'User-Agent': "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36"})

data = res.json()
for item in data["items"]:
    item_data = json.loads(item["json"])
    print(item["id"] + " " + item_data["title"] + " " + item_data["scientificname"])

Prints:
amnh/birds/dot-15423 AMNH Bird Collection Bombycilla cedrorum
amnh/birds/dot-15937 AMNH Bird Collection Bombycilla cedrorum
amnh/birds/dot-15938 AMNH Bird Collection Bombycilla cedrorum
amnh/birds/dot-15939 AMNH Bird Collection Bombycilla cedrorum
...
mvz/bird-specimens/http-arctos-database-museum-guid-mvz-bird-179106-seid-1065589 MVZ Bird Collection (Arctos) Bombycilla cedrorum
mvz/bird-specimens/http-arctos-database-museum-guid-mvz-bird-179116-seid-928935 MVZ Bird Collection (Arctos) Bombycilla cedrorum
mvz/bird-specimens/http-arctos-database-museum-guid-mvz-bird-179307-seid-1242383 MVZ Bird Collection (Arctos) Bombycilla cedrorum


text:
Q: Noether's Theorem and the Measurement? (In Copenhagen) Background
I'm trying to recently understand the Copenhagen interpretation. We all know due to Noether's theorem energy is translational invariance in time.
However, in quantum mechanics the experimentalist can have the same initial configuration ("physical system" + "Apparatus") and do a measurement and get different outcomes. Hence, while energy (as a number) is conserved Nother's theorem obviously does not apply (during the measurement).
Now, the Copenhagenist seems to say the measuring instrument is some kind of semi-classical apparatus and the system is purely quantum - the measurement is an artefact of this.
Question
How does the Copenhagenist justify this apparent discrepancy (violation of translational invariance in time)?

A: The reason you cannot apply Noether's theorem reasoning to this scenario is because the dynamics, given by the Hamiltonian, are not transitionally invariant in time. If the system is governed by the free Hamiltonian $H_{sys}$ that is time independent then it is fine. However, when you are measuring the system you have to apply an external interaction to do the measurement. The external iteration term $H_{int}$ in the Hamiltonian is switched on temporarily to do the measurement and then it is switched off. The total Hamiltonain is therefore time dependent
$$H(t)=H_{sys}+\alpha (t)H_{int}$$
$\alpha (t)$ is a stet function in time.
When you are changing the dynamics externally to the system, you cannot expect of the energy to be conserved. Noether's theorem is only valid if the (time translation) symmetry actually holds.


text:
Q: What is the difference between relative and absolute tags of div element? What is the difference between relative and absolute tags of div element ?

A: Absolute positioning positions an element relitive to the first parent that has a position oher than static, and removes the element from the document flow. Relative positioning allows you to move an element from its "normal" positon, leaving the space where it was originally in the content.
Relative is generally for small adjusents in page layout, absolute is for exact positioning.

A: If you specify position:relative, then you can use top or bottom, and left or right to move the element relative to where it would normally occur in the document.  The div stays within the flow of the document, but just moves relative to the position that it is specified at within the document.
When you specify position:absolute, the element is removed from the document and placed exactly where you tell it to go. It's not relative to the place you where the div actually occurs in the document.


text:
Q: journalctl: how to display colors in its output? The output of journalctl really looks messy without colors. Is it possible to add colors to its output? On my system it seems only important lines are highlighted. Even dmesg can output with color by adding the --color switch!

A: The color support of journalctl is documented in man journalctl:

When outputting to a tty, lines are colored according to priority: lines of level ERROR and higher are colored red; lines of level NOTICE
         and higher are highlighted; other lines are displayed normally.

That's from systemd 229. As seen in the man page, There are no other built-in color controls for journalctl.

A: I use ccze for all the logs.
Example for jornalctl with color.
journalctl -b -k -f | ccze
journalctl -b -k -f | ccze -A

Other examples.
tail -f /etc/nginx/logs/access.log | ccze
tail -f /etc/unbound/unbound.log | ccze

Exporting logs
to export the log to HTML and save it to /root/syslog.html:
ccze -h -o nolookups /root/syslog.html

I hope you find it useful.

A: If the original daemon output is already colorized, but the colors are being lost when using journalctl, the --output cat option will restore them. See the manual for more details.

A: Seeking long for the answer, I actually figured out what works for me (with Rails logs and journalctl) – just add --all option.
journalctl -u puma --all

From manpage:

   -a, --all
      Show all fields in full, even if they include unprintable characters
      or are very long. By default, fields with unprintable characters
      are abbreviated as "blob data". (Note that the pager may escape
      unprintable characters again.)

A: Install ccze, then use it like this:
journalctl -b -k -f | ccze [-A] [-o nolookups]

explanation:
 -A, --raw-ansi
        If one wants to enable raw ANSI color sequences instead of using curses, this option does just that.
 -o, --options OPTIONS...
        However,  lookups  is  an  option that might be better to disable. When on, ccze will try to look up usernames, service
        names, and lots of other stuff, which will slow down coloring a great deal. If one is piping a long log  through  ccze,
        this option might be turned off [nolookups]  to speed up the process.

A: It gives color to log files and command outputs.
ccze -A

tail -f /var/log/syslog | ccze dit to execute tail -f /var/log/syslog but here it shows with colors, another form could be ccze -A

ccze -A

ccze -h -o nolookups  /root/syslog.html exports the log to HTML and saves it to /root/syslog.html.


text:
Q: Getting longitude and latitude works in emulator but not on device? I've been trying to work GPS coordinates but it's been a lot tougher than I thought. After a few hours of trial and error, I've managed to output the latitude and longitude (mocked) for my emulator. Below are the 2 ways I've done it:
First way:
import java.io.IOException;
import java.util.Calendar;
import java.util.List;
import java.util.Locale;

import android.app.Activity;
import android.content.Context;
import android.location.Address;
import android.location.Geocoder;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.widget.TextView;

public class MainActivity extends Activity
{
    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        String text = "";

        LocationManager lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
        Location location = lm.getLastKnownLocation(LocationManager.GPS_PROVIDER);

        if(location != null) {
            showMyAddress(location);
        }

        final LocationListener locationListener = new LocationListener() {
            public void onLocationChanged(Location location) {
                showMyAddress(location);
            }
            public void onProviderDisabled(String arg0) {
            }
            public void onProviderEnabled(String arg0) {
            }
            public void onStatusChanged(String arg0, int arg1, Bundle arg2) {
            }
        };

        lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 30000, 10, locationListener);

        double longitude = location.getLongitude();
        double latitude = location.getLatitude();

        Log.i(TAG, "longitude: " + longitude);
        Log.i(TAG, "latitude: " + latitude);

        text = "longitude: " + longitude + ", " + "latitude: " + latitude;

        TextView textView = (TextView) findViewById(R.id.txtvwMain);
        textView.setText(text);
    }

    private void showMyAddress(Location location) {
        double latitude = location.getLatitude();
        double longitude = location.getLongitude();
        Geocoder myLocation = new Geocoder(getApplicationContext(), Locale.getDefault());
        List<Address> myList;
        try {
            myList = myLocation.getFromLocation(latitude, longitude, 1);
        } catch (IOException e1) {
            e1.printStackTrace();
        }
    }
}

Second way:
import android.app.Activity;
import android.content.Context;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;

public class MainActivity extends Activity implements LocationListener
{
    private LocationManager lm;
    private TextView tv;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        tv = (TextView) findViewById(R.id.txtvwMain);
        lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
        lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 500, 1, this);

        Location location = lm.getLastKnownLocation(lm.GPS_PROVIDER);
        double longitude = location.getLongitude();
        double latitude = location.getLatitude();
        tv.setText("latitude="+latitude+", longitude="+longitude);
    }

    @Override
    public void onLocationChanged(Location arg0) {
        String lat = String.valueOf(arg0.getLatitude());
        String lon = String.valueOf(arg0.getLongitude());
        Log.e("GPS", "location changed: lat="+lat+", lon="+lon);
        tv.setText("lat="+lat+", lon="+lon);
    }
    public void onProviderDisabled(String arg0) {
        Log.e("GPS", "provider disabled " + arg0);
    }
    public void onProviderEnabled(String arg0) {
        Log.e("GPS", "provider enabled " + arg0);
    }
    public void onStatusChanged(String arg0, int arg1, Bundle arg2) {
        Log.e("GPS", "status changed to " + arg0 + " [" + arg1 + "]");
    }
}

Both ways above work and print out the mock latitude and longitude onto a TextView in the emulator (running Android 4.2.2). However, when I upload the .apk file onto my device (tablet running Android 4.0.4), it just crashes. I don't know what's wrong because I can't see any error messages. What is the source of the problem and how may I go about solving it? Thanks.


text:
Q: How accept cookies in cypress.io Hello Now I learn testing with cypress.io but I dont know how accept cookies with cypres.
cy.get('button accept class').click()

This code dont work I want accept cokies on
https://www.kiwi.com/en/

A: One 'brutal' way to do it :
describe('Test Suite MakeMyTrip', function(){

it('Test Demo', function(){

    cy.visit('https://www.kiwi.com/en/')

    cy.get('section.ModalSection__StyledModalSection-sc-1ayrdn8-0 button').contains('Accept').click({force: true})

})})

I suggest you start learning css selectors : https://www.w3schools.com/cssref/css_selectors.asp
or you won't be able to select the element you want to test.

A: Thank you than I find little mistake in my code.
cy.get('[data-test=acceptCookies]:visible').click()

Thank you here is my code


text:
Q: Calculate passed time with PHP I got the time difference between dates like this :
$time1 = "2013-02-25 12:00:00";
$time2 = "2013-01-01 12:00:00";
$tdiff = strtotime($time1) - strtotime($time2);

I want extract days, hours and minutes from $tdiff. Output should like : 35 days 6 hours 14 minutes
I really searched and try to do something by myself. But I can't get true value.
---- EDIT ----
I can found date diff. I want extract days, hours, minutes from calculated time...
---- EDIT 2 ----
Here is my complete mysql code
select (
    select avg(UNIX_TIMESTAMP(tarih)) from table1
    where action in (6) and who = '".$user."' and dates between '".$date1."' and '".$date."'
    ) - (
    select avg(UNIX_TIMESTAMP(tarih_saat)) from table2
    where action in (6) and active = 1 and dates between '".$date1."' and '".$date2."
)

This query returns to me true value of time. This query is working correctly for me. Result is like : 215922. result type of  UNIX_TIMESTAPM. So I want to learn how many days, hours and minutes in this timestamp.

A: PHP has a DateInterval class which can be used like so:
$date1 = new DateTime('2013-02-25 12:00:00');
$date2 = new DateTime('2013-01-01 12:00:00');

$diff = $date2->diff($date1); // Get DateInterval Object

echo $diff->format('%d Day and %h hours and %i minutes');

A: you could use date object to get more accurate.
the default var type doesnt give the time difference.
most often they are considered as string types when assinged like you did it


text:
Q: Angular script evaluation takes a lot of time I work on angular project in performance tab in Google Chrome developer tools page take about 3000 ms to evaluate script And in Google test speed web site I have an issue with time to interactive it's also take a lot of time Any suggestions !?

A: *

*You can try to use AOT (Ahead of time compilation). It will decrease the scripting time drastically.

*You can try to use lazy loading by splitting your app into chunks. It will make loading your page faster.

*You can try to Uglify your app to make it smaller. It will increase the load time.

*You can update your RxJS to 6 version or newer to reduce bundle size.


text:
Q: upstart start splash process before any other process I am customizing ubuntu running on an arm based  embedded system. Rather than use plymouth (splash) for hiding the startup messages, I am using a custom executable called psplash directly which writes to the framebuffer. Now I need to make sure that this splash process starts before any other process. This system has many unavoidable upstart jobs. However I try, I am always getting some messages from the upstart jobs before the splash takes over the screen.
This is my psplash job:
description "Userspace bootsplash utility"

start on runlevel [2345]

expect fork
kill timeout 60

script
#        exec /sbin/psplash
    sleep 2
end script

pre-start script
    echo "PSPLASH"
     /sbin/psplash
    sleep 2
end script

To make sure that it is started early, I  initiated the  process  in "pre-start" and to make sure that other jobs get started after a delay, I added  sleep in "script".
As per this post, I created another service which forces other jobs to start only after this psplash job. But thats also not optimal as I need add lot of system level jobs which gets stuck in this scenario.
    #service-psplash-wait.conf

    start on (starting alsa-restore
    or starting anacron
    or starting apport
    or starting atd
    or starting auto-serial-console
    or starting avahi-daemon
    or starting binfmt-support
    or starting bluetooth
    or starting console-setup
    or starting console
    or starting container-detect
    or starting control-alt-delete
    or starting cron
    or starting cups
    or starting dbus
    or starting dmesg

    )

# We know that we have more than one job that needs to wait for service-a and
# will make use of this service, so we need to instantiate.
instance $JOB

# Needed to make starting the job successful despite being killed
normal exit 2
task

script

status psplash | grep -q "start/running" && exit 0
start psplash || true

# Waiting forever is ok.. upstart will kill this job when
# the service-a we tried to start above either starts or stops
while sleep 3600 ; do :; done

end script

And even if psplash is the first process which is initiated, it might need some time to take over the display. So no other messages should be displayed during this time. Blank screen is OK.
What can I do?

A: This is quite difficult :]
The following should start your job earlier in the boot. Does it suffice? (This is supposed to be without the wait job).
description "Userspace bootsplash utility"

start on virtual-filesystems

# adjust expect stanza as needed
exec /sbin/psplash


text:
Q: How the double recursion works in C/C++ - for example depth of a binary tree? Recursion doesn't strike naturally to me. A few programs, which I could understand was Factorial, where factorial of n is n * factorial(n-1). Similarly, fibonacci series - Fn = Fn-1 + Fn-2. Also, a bst- insert, search. All these recursion functions have one thing common -  a condition to return the concrete value. Otherwise, it will call itself with a different parameter. Once the concrete value is returned, all the calls are unfolded. However, I am not able to understand the programs where the recursion is one after the other. What happens over there. How can I think on those lines naturally? For example - here is the program -
What is the significance of the following lines?
 /* compute the depth of each subtree */
           int lDepth = maxDepth(node->left);
           int rDepth = maxDepth(node->right);

int maxDepth(struct node* node)
{
   if (node==NULL)
       return 0;
   else
   {
       /* compute the depth of each subtree */
       int lDepth = maxDepth(node->left);
       int rDepth = maxDepth(node->right);

       /* use the larger one */
       if (lDepth > rDepth)
           return(lDepth+1);
       else return(rDepth+1);
   }
}

A: While searching the tree, the condition that returns a concrete value is if (node==NULL) and the concrete value returned is 0, which is a tree of depth 0. Consider the following tree (from wikipedia)

Starting at node 8, the code will recurse to node 3, and then to node 1. When it tries to recurse to the left child of node 1, it will find NULL and return 0. Then it will try the right child of node 1, which will also return 0. At this point node 1 comes to the if statement
   if (lDepth > rDepth)
       return(lDepth+1);
   else return(rDepth+1);

Since both lDepth and rDepth are 0, node 1 returns 1 to node 3. Then node 3 recurses to node 6, and so on.

A: Each call to maxDepth(node->left) will result in an immediate call to maxDepth(node->left), until there it nothing left (no pun intended) on the left most side of the tree.  Then the last call returns and there will be a call to maxDepth(node->right).
This is a so-called 'depth-first' traversal, in that we go as far up the tree as possible and then visit the leaves on each branch until we're done on the branch and then we back-up to the fork.
Perhaps the best way to understand this code is to draw a picture of a small binary tree, and step through the code to see what will happen.

A: Mentally, it may help to separate the logic into two parts.  If you have a pointer possibly to a node in a singly-linked list, and define the depth of a NULL pointer as being 0, then you can say the depth of any other node is one more than the depth of the node to which it links.
    {node3 p_next_->}---->{node2 p_next_->}---->{node1 p_next_=nullptr}

So, the code for this would be:
int depth(Node* p)
{
     if (p == NULL) return 0;
     return depth(p->p_next_) + 1;
}

Then, your question is about a binary tree... the logic is similar but each time you work out the depth of a node, you're saying "well, this node may have a right and/or a left hierarchy of nodes under it... my depth is one more than the greater of their depths".

Alternatively, it might help to think of a family, say fred has two children sue and max, and so on....
          fred
          /  \
        sue  max
       /  \
    sally charlie
             /
           june

Here, working out the depth of say sue is a bit like asking "is she a child (depth 1), a parent (depth 2), a grandparent (depth 3), a great-grandparent (depth 4)?"
We can see she's sally's mother (depth 2 on that side), but she's june's grandmother (depth 3) on that side.
We can work out that answer of 3 systematically by saying sue's depth is one more than the deepest of sally and charlie's, and sally's got no kids (their imaginary depth is 0) so she's depth 1 so sue'2 at least 2, but charlie's one more than june who's one more than her imaginarykids (depth 0) i.e. june's 1 so charlie's 2 so sue's actually 3, being more than the count from sally's side.


text:
Q: In Bulk Rename Utility, how can I delete text in middle? Pls see screen shot beneath. You can't see it now, but there are seven files with "Copy" in middle.

A: In this case, the simple answer is to use Copy (that is, the word "Copy" followed by a blank space) in Replace (3):
ex. Replace - Copy Followed By A Space:

Notes

*

*You cannot see the space after "Copy" in the screenshot above, but it is there. =)

*You will want to have all the files you wish to rename selected (otherwise, you will need to rename them one at a time).

*Use Rename in the lower right corner to actually rename the files once the new file name(s) (in green) appear correctly.