you cannot extract the window compress the Zip file using the Drupal extraction function in druapl 8

When I use 7zip software to compress the folder, it works fine when I extract this through drupal code 8. But the same thing when I do it by compressed zip of window s / w does not work for me.

How to separate GitHub extraction requests from problems using a Gmail filter?

In Gmail, I would like to apply the tag Code to all GitHub notification emails about extraction requests, and Bug to all who refer to issues.

Specifically, any message that receives the "See extraction request" button must be labeled Code, and any message that receives the "See problem" button should be labeled Bug.

There seems to be no reliable way to distinguish the two based on the text search in the subject line or body of the message.

Ideally, I'd like to filter based on the JSON-LD data that makes those buttons appear, but that doesn't seem possible either.

Dynamic: FlipView extraction and output and then update

Let's say I have a triangulation of an octagon:

edges[n_Integer]:=Join[Table[{i,i+1},{i,n-1}],{{1,n}}]

triangulation[n_Integer,d_List]:=Module[{pts,external=edges[n]},
 pts=CirclePoints[n];
  Graphics[Map[Line[{pts[[#[[1]]]],pts[[#[[2]]]]}]&,Join[d,external,{{1,n}}]]]]

triangulation[8,{{1,3},{1,4},{1,5},{1,6},{1,7}}]

enter the description of the image here

Now I have a function that rotates the diagonals counterclockwise when it is clicked.

RotateAnticlockwise[L_Line, n_Integer] := 
 Module[{line, vpair , pts = CirclePoints[n]}, 
  line = First@L /. Line -> List ; 
   vpair = Flatten[Position[pts, #] & /@ line] + {1, 1} /. n + 1 -> 1; 
    Line[{pts[[vpair[[1]]]], pts[[vpair[[2]]]]}]
]


triangulation[8, Triangulations[[1]]] /. 
 l_Line -> FlipView[{{Green, l}, {Blue, Thick, RotateAnticlockwise[l, 8]}}]

Now, how can I do it so I can keep turning diagonally as many times as I want, instead of going back? Equivalently, is there any way to save the output we get after clicking and then use that output as our new base case? Is FlipView a bad choice here?

dnd 5e: What is the correct way to apply the Thorn Whip extraction effect on a mounted lens?

The description of thorn whip cantrip is:

You create a long, spiny vine-covered whip that attacks
Your command to a creature in range. Make a melee attack
against the objective. If the attack hits, the creature takes 1d6
penetrating damage, and if the creature is large or smaller, you pull the
creature up to 10 feet closer to you.

If the cantrip is aimed at a target mounted on a mount and hits, should both the mount and the rider be pulled?

performance: extraction of date and time from the database and optimization of a For loop

I'm learning Python and I'm looking for ways to make my code look more python.

My first problem is the conversion of a DateTime returned by a database.

try:
        print("Getting most recent record from database")
        get_max_date=fixfile.conn.execute('SELECT max(date) from sharehistory').fetchall()
        get_max_date=get_max_date(0)(0)
        get_max_date=dtime. strptime(get_max_date,'%Y-%m-%d %H:%M:%S')
        day_start=get_max_date.strftime('%m%d%Y')
        day_start=dtime.strptime(day_start, '%m%d%Y')

As you can see, I get the Date, denoting it and converting it.
I guess there is a better way to do this.

Second, I have written 3 FOR loops to address very similar problems

 for div in table.find_all("tr", {'align':'right'}): 
            div.decompose()

        for div in table.find_all("td", {'align':'right'}): 
            div.decompose()

        for div in table.find_all("td", {'colspan':'8'}): 
            div.decompose()

How can this be done more efficiently?

Differential equations: data extraction from the 2D surface graph InterpolatingFunction

I would like to directly extract the data from the solution surface graph to a differential equation (using NDSolve). While there are many examples of this, I could not find an example in 2D.

Here I am solving a 1D diffusive heat equation and plotting the results (the solution behaves very badly with significant artifacts). I would like to be able to extract the heat distributions along the x-axis (that is, the temperature distribution in the bar) for each moment in time and save in something like a text file in order to have direct access to the data of Simulation and analyze it using a different program. This is done more easily with InterpolatingFunctionAnatomy but I'm not sure how to extract and package it.

If anyone has suggestions to improve the accuracy of the solution, I would also appreciate it. (I know that I can decrease MaxCellMeasure but it greatly increases the calculation time).

Needs("NDSolve`FEM`")
Needs("DifferentialEquations`InterpolatingFunctionAnatomy`");
parameters = {v -> -1, DT -> 0.000000143, rho -> 1000, c -> 4200, 
eta -> 0.001002};
HEATIMP = (-D(u(r, t), t) - 
 v D(u(r, t), r) + (DT/r^2) D(r^2. D(u(r, t), r), 
   r) + (12. eta)/(rho c) (v/r) (v/r)) /. parameters;
BCE1 = DirichletCondition(u(r, t) == 1, r == 2);
BCE2 = DirichletCondition(u(r, t) == 0, r == 1);
BCTot = {BCE1, BCE2};
ic = {u(r, 0) == 0};
heatdist = 
NDSolve({HEATIMP == 0, BCTot, ic}, u, {r, 1, 2}, {t, 0.00000, 1}, 
Method -> {"FiniteElement", 
"MeshOptions" -> {MaxCellMeasure -> 0.005}})
Plot3D(Evaluate(First(u(r, t) /. %)), {r, 1, 2}, {t, 0.00000, 1}, 
 MaxRecursion -> 6, WorkingPrecision -> 20,  
PlotRange -> Full, AxesLabel -> {RodPosition, Time, Temperature})

Very poor solution

c ++ – More ergonomic / convenient STL algorithm calls – sort order and member field extraction using std :: invoke

While we wait patiently ranges in C ++ 20, it can still be frustrating to write begin(), end() Y micro-lambdas to specify "sort order" and "field extraction".

It is the latter, the "field extraction", which I find is very necessary, but it is rarely discussed. the C++11 lambda It has made it easier, but the syntax is still very detailed for a very common task. There was even a recent slack / cpplang question about it. Inspired by a comment on Sean Parent's famous Seasoning talk, where he suggested using std::bind To summarize this syntax, I looked for modern alternatives. std::bind It has a bad name for being big and slow. More modern is std::invoke of C ++ 17.

So, my proof of concept below tries to reach a terser syntax for these common operations using std::invoke.

I am looking for comments on:

  • Coding style
  • Restrict that template – with / without c ++ 20 concepts (it is fully open at this time)
  • The new terser call syntax for something STLs that operate in some user-defined class and require field / member extraction and, potentially, classification in them.
  • std::sort It is just an example. This could work for std :: accumulate or anything really. Would you need up to 115 wrap templates? Is there a better way?

Code size may still a concern (even with std::invoke rather than std::bind) as shown by the ASM generated here. The base case of the traditional lambda generates ~ 2000 lines of assembly code (LOA). Then each of the "new syntax" lines generates an additional 2000 LOA, bringing it to ~ 8000 LOA in total for clang-9 -O3. Because the sortby The template is stamped for each type of lambda.

I have not measured the performance. Will all this code slow you down significantly with many repetitions and hints, or is it just the size of the code that suffers?

#include 
#include 
#include 
#include 
#include 
#include 

struct Employee {
  int         id;
  std::string firstname;
  std::string lastname;
  int         yob;

  ((nodiscard)) int getAge() const noexcept { return 2020 - yob; }

  friend std::ostream& operator<<(std::ostream& stream, const Employee& e) {
    return stream << e.id << ", " << e.firstname << ", " << e.lastname << ", " << e.yob << ", "
                  << e.getAge();
  }
};

namespace os::algo {

// the following 6 lines make it possible
template >
void sortby(Container& c, Member&& m, Comparison comp = Comparison()) {
  std::sort(c.begin(), c.end(), (&m, &comp)(const auto& a, const auto& b) {
    return comp(std::invoke(m, a), std::invoke(m, b));
  });
}

} // namespace os::algo

int main() {

  using os::algo::sortby;

  auto employees = std::vector{
      {1, "James", "Smith", 2008},
      {2, "John", "Jones", 1998},
      {3, "Sarah", "Evans", 1968},
      {4, "Michelle", "Harris", 1978},
  };

  // BEFORE: This is what's required with normal STL calls
  std::sort(employees.begin(), employees.end(),
            ()(const auto& a, const auto& b) { return a.firstname < b.firstname; });

  // AFTER: and now we can do this...

  // the easy part -- no begin(), end()

  // trivial, terse sorting by any member field
  sortby(employees, &Employee::firstname);

  // trivially specify sort direction
  sortby(employees, &Employee::yob, std::greater<>());

  // can use getters too
  sortby(employees, &Employee::getAge, std::greater<>());

  for (const auto& e: employees) std::cout << e << "n";

  // std::sort is but one example. The same technique applies to any STL algorithm

  return 0;
}

color management: image information extraction

I am working on a presentation on compression of JPEG images using discrete Cosine Transformations. I have read several things about color spaces such as RGB, CMYK, YCbCr and how they work approximately. From what I have read, JPEG compression converts RGB to YCbCr and performs the mathematical functions to compress it.

Now I would like to know if there is a way to convert R, G and B channels to individual channels Y, Cb and Cr and also access the matrix values ​​of the 8×8 blocks (which JPEG uses for compression) of each of the RGB channels of the uncompressed image, as well as the YCbCr channels.
Thank you.

differential equations: extraction of elements from the table

enter the description of the image here
enter the description of the image here

Code for the randomly generated interest rate table

Clear("Global`*")
nrows = 100;
ncols = 834;
dt = 0.0001;
t = 0.0833;
r = 0.005;
X = ConstantArray(0.0158, {nrows, ncols});
SeedRandom(1234)
W = Table(
X((i, j)) = 
X((i, j - 1)) + 
r*RandomVariate(NormalDistribution(0, Sqrt(dt))), {i, nrows}, {j,
2, ncols});
MatrixForm(W) (*randomly generated interest rates*)

Code for the BTCS scheme:

dS = 5;
sigma = 0.2183;
S0 = 201.05;
k = 212.50;

(Mu) = (dt/dS);
(Lambda) = (dt*sigma^2)/(2*(dS^2));
s = Range(0, 500, 5); (*list containing spot price partition*)
V = 
Clip(s - k, {0, 500});
(For(p = 1, p < nrows, p++, 
For(q = 2, q <= ncols, q++, 
btcs(p_, q_) = 
SparseArray({{m_, m_} -> 
1 + 2*(Lambda)*Indexed(s, m)^2 + 
Indexed(X, {p, q})*dt, {m_, l_} /; 
l - m == 1 -> -(Lambda)*Indexed(s, m)^2 - (Mu)*
Indexed(X, {p, q})*Indexed(s, m), {m_, l_} /; 
m - l == 1 -> -(Lambda)*Indexed(s, m)^2 + (Mu)*
Indexed(X, {p, q})*Indexed(s, m)}, {nrows + 1, 
nrows + 1});
A = btcs(p_, q_)););)

Question: How can I extract my first sequence of interest rates to calculate the ratio || Vn || / || Vn + 1 ||?

python: accelerating the code for random polygon extraction

I have a shape file with thousands of features (polygons). I need to extract a polygon every 1 km. I wrote the following code that works. However, it is very slow.

import numpy as np, pandas as pd, geopandas as gpd
from shapely.geometry import Polygon

fi = 'test.shp'
gdf = gpd.read_file(fi)(('geometry'))
print (gdf.shape)        
crs = gdf.crs     

ULX, LRY, LRX, ULY = gdf.total_bounds
ts = 0.008983157 #1km
lats, lons = np.mgrid(ULY:LRY-ts:-ts, ULX:LRX+ts:ts)

ulx_s = lons(:-1,:-1).ravel()
uly_s = lats(:-1,:-1).ravel()                   
lrx_s = lons(1:,1:).ravel()
lry_s = lats(1:,1:).ravel()
tiles = (((ulx,uly),(ulx,lry),(lrx,lry),(lrx,uly)) for ulx, uly, lrx, lry in zip(ulx_s, uly_s, lrx_s, lry_s))
print(len(tiles))

outputs = ()           

for tile in tiles:                
    poly = Polygon(tile)
    ok = gdf(gdf.geometry.intersects(poly))
    if ok.shape(0) >= 1:
        out = ok.sample(1)
        outputs.append(out)

out_df = pd.concat(outputs, axis=0)
out_gdf = gpd.GeoDataFrame(out_df, geometry='geometry')
out_gdf.crs = crs

out_gdf.to_file(fo, layer='test', driver='ESRI Shapefile')

Any idea to improve the code is appreciated.