## sublimetext3 – Sublime Text 3: How to select multiple lines and paste them sequentially in a specific place? – For example:

Here is what I would need to do with some build-in shortcuts or similar:
I’m using Sublime Text 3 is the current version of Sublime Text.

PAGE A 50 LINES

``````<div class="wrapper ratio" style="padding-bottom: 138,75% ;">
<div class="wrapper ratio" style="padding-bottom: 86,875% ;">
<div class="wrapper ratio" style="padding-bottom: 146,5625% ;">
<div class="wrapper ratio" style="padding-bottom: 68,125% ;">
<div class="wrapper ratio" style="padding-bottom: 45,3125% ;">
``````

PAGE B 50 LINES

``````<!--0-->
<div class="microstory-media-container" id="img80">
<div class="wrapper ratio" style="padding-bottom: xxxxx2x ;">
<img alt="Lazy load image orgy-img-microstory" sizes="100vw" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" data-srcset="https://www.lastorgy.com/img/320w-lo-edt-0-050.jpg 320w, https://www.lastorgy.com/img/640w-lo-edt-0-050.jpg 640w, https://www.lastorgy.com/img/800w-lo-edt-0-050.jpg 800w, https://www.lastorgy.com/img/1024w-lo-edt-0-050.jpg 1024w " data-src="https://placehold.it/600x400?text=fallback" class="b-lazy animate" />
</div>
</div>
<!--1-->
<div class="microstory-media-container" id="img80">
<div class="wrapper ratio" style="padding-bottom: xxxxx2x ;">
<img alt="Lazy load image orgy-img-microstory" sizes="100vw" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" data-srcset="https://www.lastorgy.com/img/320w-lo-edt-0-051.jpg 320w, https://www.lastorgy.com/img/640w-lo-edt-0-051.jpg 640w, https://www.lastorgy.com/img/800w-lo-edt-0-051.jpg 800w, https://www.lastorgy.com/img/1024w-lo-edt-0-051.jpg 1024w " data-src="https://placehold.it/600x400?text=fallback" class="b-lazy animate" />
</div>
</div>
<!--2-->
<div class="microstory-media-container" id="img80">
<div class="wrapper ratio" style="padding-bottom: xxxxx2x %;">
<img alt="Lazy load image orgy-img-microstory" sizes="100vw" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" data-srcset="https://www.lastorgy.com/img/320w-lo-edt-0-052.jpg 320w, https://www.lastorgy.com/img/640w-lo-edt-0-052.jpg 640w, https://www.lastorgy.com/img/800w-lo-edt-0-052.jpg 800w, https://www.lastorgy.com/img/1024w-lo-edt-0-052.jpg 1024w " data-src="https://placehold.it/600x400?text=fallback" class="b-lazy animate" />
</div>
</div>
<!--3-->
<div class="microstory-media-container" id="img80">
<div class="wrapper ratio" style="padding-bottom: xxxxx2x ;">
<img alt="Lazy load image orgy-img-microstory" sizes="100vw" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" data-srcset="https://www.lastorgy.com/img/320w-lo-edt-0-053.jpg 320w, https://www.lastorgy.com/img/640w-lo-edt-0-053.jpg 640w, https://www.lastorgy.com/img/800w-lo-edt-0-053.jpg 800w, https://www.lastorgy.com/img/1024w-lo-edt-0-053.jpg 1024w " data-src="https://placehold.it/600x400?text=fallback" class="b-lazy animate" />
</div>
</div>
<!--4-->
<div class="microstory-media-container" id="img80">
<div class="wrapper ratio" style="padding-bottom: xxxxx2x ;">
<img alt="Lazy load image orgy-img-microstory" sizes="100vw" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" data-srcset="https://www.lastorgy.com/img/320w-lo-edt-0-054.jpg 320w, https://www.lastorgy.com/img/640w-lo-edt-0-054.jpg 640w, https://www.lastorgy.com/img/800w-lo-edt-0-054.jpg 800w, https://www.lastorgy.com/img/1024w-lo-edt-0-054.jpg 1024w " data-src="https://placehold.it/600x400?text=fallback" class="b-lazy animate" />
</div>
</div>
<!--5-->
<div class="microstory-media-container" id="img80">
<div class="wrapper ratio" style="padding-bottom: xxxxx2x ;">
<img alt="Lazy load image orgy-img-microstory" sizes="100vw" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" data-srcset="https://www.lastorgy.com/img/320w-lo-edt-0-055.jpg 320w, https://www.lastorgy.com/img/640w-lo-edt-0-055.jpg 640w, https://www.lastorgy.com/img/800w-lo-edt-0-055.jpg 800w, https://www.lastorgy.com/img/1024w-lo-edt-0-055.jpg 1024w " data-src="https://placehold.it/600x400?text=fallback" class="b-lazy animate" />
</div>
</div>
``````

I want to paste page A into Page B changing the styles of `style="padding-bottom: xxxxx2x`
sequentially.

This is the results I would need:

``````<!--1-->
<div class="microstory-media-container" id="img80">
<div class="wrapper ratio" style="padding-bottom: 138,75% ;">
<img alt="Lazy load image orgy-img-microstory" sizes="100vw" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" data-srcset="https://www.lastorgy.com/img/320w-lo-edt-0-050.jpg 320w, https://www.lastorgy.com/img/640w-lo-edt-0-050.jpg 640w, https://www.lastorgy.com/img/800w-lo-edt-0-050.jpg 800w, https://www.lastorgy.com/img/1024w-lo-edt-0-050.jpg 1024w " data-src="https://placehold.it/600x400?text=fallback" class="b-lazy animate" />
</div>
</div>
<!--2-->
<div class="microstory-media-container" id="img80">
<div class="wrapper ratio" style="padding-bottom: 86,875% ;">
<img alt="Lazy load image orgy-img-microstory" sizes="100vw" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" data-srcset="https://www.lastorgy.com/img/320w-lo-edt-0-051.jpg 320w, https://www.lastorgy.com/img/640w-lo-edt-0-051.jpg 640w, https://www.lastorgy.com/img/800w-lo-edt-0-051.jpg 800w, https://www.lastorgy.com/img/1024w-lo-edt-0-051.jpg 1024w " data-src="https://placehold.it/600x400?text=fallback" class="b-lazy animate" />
</div>
</div>
<!--3-->
<div class="microstory-media-container" id="img80">
<div class="wrapper ratio" style="padding-bottom: 146,5625% ;">
<img alt="Lazy load image orgy-img-microstory" sizes="100vw" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" data-srcset="https://www.lastorgy.com/img/320w-lo-edt-0-052.jpg 320w, https://www.lastorgy.com/img/640w-lo-edt-0-052.jpg 640w, https://www.lastorgy.com/img/800w-lo-edt-0-052.jpg 800w, https://www.lastorgy.com/img/1024w-lo-edt-0-052.jpg 1024w " data-src="https://placehold.it/600x400?text=fallback" class="b-lazy animate" />
</div>
</div>
<!--4-->
<div class="microstory-media-container" id="img80">
<div class="wrapper ratio" style="padding-bottom: 68,125% ;">
<img alt="Lazy load image orgy-img-microstory" sizes="100vw" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" data-srcset="https://www.lastorgy.com/img/320w-lo-edt-0-053.jpg 320w, https://www.lastorgy.com/img/640w-lo-edt-0-053.jpg 640w, https://www.lastorgy.com/img/800w-lo-edt-0-053.jpg 800w, https://www.lastorgy.com/img/1024w-lo-edt-0-053.jpg 1024w " data-src="https://placehold.it/600x400?text=fallback" class="b-lazy animate" />
</div>
</div>
<!--5-->
<div class="microstory-media-container" id="img80">
<div class="wrapper ratio" style="padding-bottom: 45,3125% ;">
<img alt="Lazy load image orgy-img-microstory" sizes="100vw" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" data-srcset="https://www.lastorgy.com/img/320w-lo-edt-0-054.jpg 320w, https://www.lastorgy.com/img/640w-lo-edt-0-054.jpg 640w, https://www.lastorgy.com/img/800w-lo-edt-0-054.jpg 800w, https://www.lastorgy.com/img/1024w-lo-edt-0-054.jpg 1024w " data-src="https://placehold.it/600x400?text=fallback" class="b-lazy animate" />
</div>
</div>

``````

Is there any shortcut or Plug-In in order to do that with a single operation?

## bittorrent – How do I tell qBittorrent v4.3 to download files within a torrent sequentially? (files, not parts of files)

Normally qBittorrent will download many files simultaneously. Is there a way to tell it to use all bandwidth/connections to download one file and then move to the other?

Setting file priorities does help, but that’s a lot of manual work, and two files with the same priority will be downloaded in parallel anyway.

Utorrent could do it easily, but new version of the program does not want to turn off ads fully as it did before, so i had to leave.

If there is absolutely no way qbittorrent can do this, please point me to a couple of other programs, small and fast, free, no ads.

## postgresql – Does Postgres read blocks sequentially, even if a disk is high-latency?

I’m using Postgres on AWS EBS, when running a query that uses a bitmap heap scan and a bitmap index scan, the execution time seems proportional to the number of “heap blocks” read, as shown by the EXPLAIN ANALYZE (I’ve not 100% verified this). Because EBS is networked attached storage, it has a high (~1ms) latency, but a high throughput/bandwidth, meaning Postgres wouldn’t be taking full advantage of the disk.

Is it the case that when reading from Disk postgres queries blocks/pages sequentially?

## dnd 5e – Are dice re-rolled together or sequentially for Chaos Bolt with the Metamagic option Empowered Spell?

The Sorcerer’s Empowered Spell metamagic option reads

When you roll damage for a spell, you can spend 1 sorcery point to reroll a number of the damage dice up to your Charisma modifier (minimum of one). You must use the new rolls.

While the spell chaos bolt reads:

You hurl an undulating, warbling mass of chaotic energy at one creature in range. Make a ranged spell attack against the target. On a hit, the target takes 2d8 + 1d6 damage. (…) If you roll the same number on both d8s, the chaotic energy leaps from the target to a different creature of your choice within 30 feet of it. Make a new attack roll against the new target, and make a new damage roll, which could cause the chaotic energy to leap again.

If Sorcerer chooses to use Empowered Spell when they cast chaos bolt (and has a Charisma modifier of at least +2), do they need to re-roll all of the dice that they wish to re-roll at once? Or can they re-roll one d8, then, if it does not match, re-roll the other?

As an example:
The sorcerer casts chaos bolt and rolls a 7 and an 8. They use Empowered Spell, and re-roll the 7, getting a 3.

If Empowered Spell dice rolls are sequential:
The sorcerer casts chaos bolt and rolls a 7 and an 8. They use Empowered spell and re-roll the 7 getting a 3. The sorcerer uses the additional re-roll allowed by empowered spell to re-roll the 8 and gets a 3 causing the spell to jump to another target

If Empowered Spell dice rolls are rolled together:
The sorcerer already chose to just re-roll the 7 and so cannot now choose to re-roll the 8. The spell does not target another creature.

A related unofficial tweet from December 2017 by Jeremy Crawford on the subject:

When casting Chaos Bolt and using the Empowered Spell metamagic on the
first damage roll, would you be able to reroll only up to the first
two d8s, or would you be able to reroll potential secondary damage
dice too assuming your charisma modifier was high enough?

You can reroll as many dice as your Charisma modifier allows.

A related question: Which yields higher average damage, an Empowered or Twinned Chaos Bolt?

## dnd 5e – Are dice re-rolled together or sequentially for Chaos Bolt with Empowered Metamagic?

The Sorcerer’s Empowered Spell metamagic option reads

Empowered Spell
When you roll damage for a spell, you can spend 1 sorcery point to reroll a number of the damage dice up to your Charisma modifier (minimum of one). You must use the new rolls.

While the spell Chaos Bolt reads:

You hurl an undulating, warbling mass of chaotic energy at one creature in range. Make a ranged spell attack against the target. On a hit, the target takes 2d8 + 1d6 damage…
If you roll the same number on both d8s, the chaotic energy leaps from the target to a different creature of your choice within 30 feet of it. Make a new attack roll against the new target, and make a new damage roll, which could cause the chaotic energy to leap again.

If Sorcerer chooses to Empower Chaos Bolt and has a Charisma modifier of at least +2 do they need to re-roll all of the dice that they wish to re-roll at once or can they re-roll one d8 then, if it does not match, re-roll the other?

As an example:
The sorcerer casts Chaos Bolt and rolls a 7 and an 8. They use Empowered spell and re-roll the 7 getting a 3.

If Empowered dice rolls are sequential
The sorcerer casts Chaos Bolt and rolls a 7 and an 8. They use Empowered spell and re-roll the 7 getting a 3. The sorcerer uses the additional re-roll allowed by empowered spell to re-roll the 8 and gets a 3 causing the spell to jump to another target

If Empowered dice rolls are rolled together
The sorcerer already chose to just re-roll the 7 and so cannot now choose to re-roll the 8. The spell does not target another creature.

A related RAI tweet

## geometry – How to add Spheres[] sequentially from the surface of preexisting spheres?

I’d like to connect many spheres, by adding a new sphere at some point that’s sitting on the surface of a previous sphere. How could we do this?

Suppose I have a unit sphere and a point on it:

``````myShpere1=Sphere();
myPoint1=SpherePoints(1);
Graphics3D({myShpere1, Point(myPoint1)})
``````

How can we add a second sphere who’s surface is touching the previous one at the random point, then a third sphere on a random point of the second sphere, and so on? (for any number of spheres, always choosing a new random point). On a related issue, do spheres have an orientation in MMA, as ellipsoids do? If so, how do we get the “vector/axis” of orientation?

Thanks!

## Assign sequentially a php variable

Good evening, I am breaking my head to solve a problem that appeared in my project, I intend to receive a value via the _GET method so that the same page fills a list of products, each time the User chooses a product from the list, the form send the result by filling the following field on the same page, I try with the following code:

``````\$id_produto = \$_GET("id_produto");

if(!empty(\$_SESSION("produto1"))){

if(!empty(\$_SESSION("produto2") = \$row_produtov("descricao"))){
\$_SESSION("produto3") = \$row_produtov("descricao");
}else{
\$_SESSION("produto2") = \$row_produtov("descricao");
}
}else{
\$_SESSION("produto1") = \$row_produtov("descricao");
}
``````

the buttons where they receive the values:

``````
Produto 1

Produto 2

Produto 3

``````

PS, my knowledge of JavaScript is very brief, this year I will focus on learning it.

## terminal – Cannot rename images sequentially via Applescript because other images already have this name

I am trying to automate batch renaming of images sequentially using a simple Applescript. But I'm having trouble telling the script that there are pictures in the same folder that already have the same name.

For example, I have three pictures of a cat that are named Hello World 1, Hello World 2 and Hello World 3.

In the same folder, I also have three others of the same image but with the name Test Image 1, Test Image 2 and Test Image 3.

I want to rename all "test images" to Hello World 4, Hello World 5 and Hello World 6 but i get the following error:

error "The Finder has an error: the operation cannot be completed because
there is already an element with this name. "number -48

How do I tell the script that there are other images in this folder that have the same name and that it should start from "Hello World 4" and continue renaming the rest images?

Please note that I will use it as a built-in script in an application called Hazel (noodlesoft.com) and that it does not accept handlers. So I will need a solution that does not use a manager.

Here is the script I am using which gives me the error when I try to rename the "Test Images":

``````tell application "Finder"
set all_files to every item of (choose file with prompt "Choose the Files you'd like to rename:" with multiple selections allowed) as list
set new_name to "Hello World"
repeat with index from 1 to the count of all_files
set this_file to item index of all_files
set {itemName, itemExtension} to {name, name extension} of this_file
set index_prefix to " "
if itemExtension is "" then
set file_extension to ""
else
set file_extension to "." & itemExtension
end if
set the name of this_file to new_name & index_prefix & index & file_extension as string
end repeat
end tell
``````

## postgresql – sequentially inserting calculated results into a table seems very expensive

I always fight: I have a table more or less big `trips` with two columns

``````trips
---------------

+---------+---------------+
| trip_id |     date      |
+---------+---------------+
|     350 |    2019-02-01 |
|     351 |    2019-02-01 |
|     360 |    2019-02-01 |
|       . |    .          |
|       . |    .          |
|       . |    .          |
+---------+---------------+
``````

and for that I have to calculate some results, for which I use a self-written function `SEARCHROUTE` which calls another function based on certain PostGIS functions (to get the route for that path and this day) and is supposed to insert the results as a table in a table `shape_prep`.

The problem is that the above call consumes a lot of memory over time.

Here is what I have done so far:

This is the main call (based on the short version of a `LATERAL JOIN`):

``````SELECT DISTINCT trip_id, day FROM trips, SEARCHROUTE(trip_id,day)
``````

which uses the following function to get the array of integers from `getroutepertrip` and insert the values ​​into the existing array but before the empty one `shape_prep`:

``````CREATE OR REPLACE FUNCTION SEARCHROUTE(x INTEGER, d DATE)
RETURNS VOID AS
\$\$ DECLARE
a INTEGER;
b DATE;
c INTEGER();
BEGIN

SELECT t, v,agg INTO a, b,c FROM
(
SELECT route.trip t,route.day, array_agg(ogc_fid)::INT() agg
FROM (SELECT * FROM getroutepertrip(\$1,\$2)) as route
GROUP BY route.trip,route.d
ORDER by route.trip,route.d
) AS subroute;

INSERT INTO shape_prep(trip, day, ogc_fid) VALUES(a, b, c);

END;
\$\$
LANGUAGE plpgsql;
``````

Here are what the results should look like:

``````shape_prep
---------------
+---------+------------+---------------------+
| trip_id |    date    |       ogc_fid       |
+---------+------------+---------------------+
|     350 | 2019-02-01 | (5521,5523,6800,-1) |
|     351 | 2019-02-01 | (9641,5866,6565,-1) |
|     360 | 2019-02-01 | (6847,6845,4545,-1) |
|       . |    .       |    .                |
|       . |    .       |    .                |
|       . |    .       |    .                |
+---------+------------+---------------------+
``````

To be honest, I am not used to programming in sql and pl / pgSQL, so maybe anybody can help me with that! Is it possible that the cache of `getRoutespertrip`Does it still exist and accumulates?

Edit EXPLAIN ANALYSIS for an example of a trip and a day:

``````"Unique  (cost=0.25..4128.47 rows=1 width=8) (actual time=1194.987..1210.942 rows=1 loops=1)"
"  Buffers: shared hit=39342 dirtied=1"
"  ->  Nested Loop  (cost=0.25..4128.47 rows=1 width=8) (actual time=1194.986..1210.939 rows=1 loops=1)"
"        Buffers: shared hit=39342 dirtied=1"
"        ->  Seq Scan on trips (cost=0.00..4128.20 rows=1 width=8) (actual time=0.016..15.967 rows=1 loops=1)"
"              Filter: ((trip_id = 350) AND (day = '2019-02-02'::date))"
"              Rows Removed by Filter: 202279"
"              Buffers: shared hit=1094"
"        ->  Function Scan on searchroute route  (cost=0.25..0.26 rows=1 width=0) (actual time=1194.964..1194.964 rows=1 loops=1)"
"              Buffers: shared hit=38248 dirtied=1"
"Planning time: 0.096 ms"
"Execution time: 1210.982 ms"
``````

BTW: My system runs on Windows 7, so no PG11 and no stored procedures available.

## sequences and series – the proof for the sequentially continuous function with a first countable domain is continuous

Assuming the axiom of the accounting choice, any function f of a first sequentially continuous first X to Y accounting space is necessarily continuous. The bottom line of the proof that I thought was that, given any x in X and any neighborhood of f (x), I can then find an open set S contained in this neighborhood. Then, I consider the pre-image of this set. Assuming by contradiction that the pre-image is not a neighborhood, then for all Ni of the accounting neighborhood of x in X, there must be at least one element that is not contained f-1 (S) ( This is where I assume the axiom accounting choice is used). I form an induction sequence where, for the nth element of the countable base, I choose an element xn in the finite intersection of N1, N2, … Nn$$–$$f-1 (S) which is not empty since the finite neighborhood intersection is a neighborhood. This sequence must converge to x but not converge to f (x), which proves by contradiction that there must be a neighborhood of x contained in the pre-image of S. Is this correct? Is there a better approach?