Id
int64 1.68k
75.6M
| PostTypeId
int64 1
2
| AcceptedAnswerId
int64 1.7k
75.6M
⌀ | ParentId
int64 1.68k
75.6M
⌀ | Score
int64 -60
3.16k
| ViewCount
int64 8
2.68M
⌀ | Body
stringlengths 1
41.1k
| Title
stringlengths 14
150
⌀ | ContentLicense
stringclasses 3
values | FavoriteCount
int64 0
1
⌀ | CreationDate
stringlengths 23
23
| LastActivityDate
stringlengths 23
23
| LastEditDate
stringlengths 23
23
⌀ | LastEditorUserId
int64 -1
21.3M
⌀ | OwnerUserId
int64 1
21.3M
⌀ | Tags
sequence |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
74,518,993 | 2 | null | 29,225,660 | 0 | null | Add following code on drag end event:
```
onDragEnd(event: any) {
var tinymceId = 'tinymceId_' + event.source.data.index; //get selected element id
tinymce.get(tinymceId ).remove(); //remove existing instance
$('#' + tinymceId ).closest('.mce-tinymce.mce-container').show();
tinymce.init({id: tinymceId , selector: '#' + tinymceId , height: 200}; //you can add other properties into init()
}
```
| null | CC BY-SA 4.0 | null | 2022-11-21T12:32:58.293 | 2022-11-23T16:17:22.713 | 2022-11-23T16:17:22.713 | 14,267,427 | 6,573,357 | null |
74,519,316 | 2 | null | 15,777,131 | 0 | null | For future references:
You can implement this by using something like this:
```
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
val parentView = view.findViewById<ConstraintLayout>(R.id.container)
getContainer().viewTreeObserver.addOnGlobalFocusChangeListener { oldFocus, newFocus ->
if (!getContainer().contains(newFocus) && oldFocus != null)
oldFocus.requestFocus()
}
}
```
| null | CC BY-SA 4.0 | null | 2022-11-21T12:56:56.570 | 2022-11-21T12:56:56.570 | null | null | 3,016,293 | null |
74,519,634 | 2 | null | 74,519,224 | 1 | null |
# Try this:
[StackedInline](https://docs.djangoproject.com/en/4.1/ref/contrib/admin/#django.contrib.admin.StackedInline)
```
from django.contrib import admin
from .models import AnalysisType, PatientGroupAnalysis
# Register your models here.
class PatientGroupAnalysisInline(admin.StackedInline):
model = PatientGroupAnalysis
@admin.register(AnalysisType)
class AnalysisTypeAdmin(admin.ModelAdmin):
list_display = ["id", "a_name", "a_measur", "a_ref_min", "a_ref_max"]
search_fields = ("id", "a_name")
inlines = [PatientGroupAnalysisInline]
```
| null | CC BY-SA 4.0 | null | 2022-11-21T13:23:43.137 | 2022-11-21T13:23:43.137 | null | null | 20,562,994 | null |
74,519,994 | 2 | null | 74,519,667 | 1 | null | You can use conditional logic along with a `HAVING` clause such as
```
SELECT id,
MAX(revision_id) AS revision_id,
MAX(moderation_state) AS moderation_state
FROM content_moderation_state_field_revision
GROUP BY id
HAVING MAX(CASE WHEN moderation_state = 'published' THEN revision_id END) =
MAX(revision_id);
```
| null | CC BY-SA 4.0 | null | 2022-11-21T13:54:01.583 | 2022-11-21T14:08:31.207 | 2022-11-21T14:08:31.207 | 5,841,306 | 5,841,306 | null |
74,520,122 | 2 | null | 25,023,723 | 0 | null | I had the same issue, and I just found that adding a label on an arbitrary edge solves this problem.
[Graphviz: edges between cells in the same HTML table are too long](https://stackoverflow.com/a/74519813/2596280)
| null | CC BY-SA 4.0 | null | 2022-11-21T14:03:01.847 | 2022-11-27T23:22:04.777 | 2022-11-27T23:22:04.777 | 2,452,869 | 2,596,280 | null |
74,520,145 | 2 | null | 74,518,836 | 1 | null | Your query into your DbSet should look something like this to get the specific value:
```
using var dbContext = _factory.CreateDbContext();
dbContext.ChangeTracker.QueryTrackingBehavior = QueryTrackingBehavior.NoTracking;
var value = await dbContext.Set<TRecord>()
.SingleOrDefault(item => item.start <= this.salary && item.end >= this.salary)?.p2 ?? 0;
```
Here's a demo page.
```
@page "/"
<PageTitle>Index</PageTitle>
<input class="form-control" @bind-value=this.salary />
<div class="text-end m-2">
<button class="btn btn-primary" @onclick=Calc>Calculate</button>
<button class="btn btn-secondary" @onclick=Calc2>Calculate 2</button>
</div>
<div class="bg-dark text-white m-2 p-2">
P2 = @P2
</div>
@code {
private int salary;
private int P2;
private void Calc()
{
var record = deductions.SingleOrDefault(item => item.start <= this.salary && item.end >= this.salary);
P2 = record?.p2 ?? 0;
}
private void Calc2()
{
P2 = deductions.SingleOrDefault(item => item.start <= this.salary && item.end >= this.salary)?.p2 ?? 0;
}
private List<Deduction> deductions = new List<Deduction>
{
new Deduction(1,0,199,10,20,30),
new Deduction(2,200,299,20,30,40),
new Deduction(3,300,399,30,40,50),
new Deduction(4,400,499,40,50,60),
};
public record Deduction(int Id, int start, int end, int p1, int p2, int p3 );
}
```
Note: there's a problem in your dataset your ranges overlap!
| null | CC BY-SA 4.0 | null | 2022-11-21T14:04:50.683 | 2022-11-21T18:28:48.717 | 2022-11-21T18:28:48.717 | 13,065,781 | 13,065,781 | null |
74,520,171 | 2 | null | 74,519,872 | 0 | null | Try this it looks problems due to the position relative on the span tag and it's not taking the height and width 100% due to a inline element.
```
<section class="mobile-only" style="margin-top: 0px; margin-bottom: 20px;">
<span class="" style="position: relative;width: 100%;height: 100%;display: block;">
{% render 'full_width_image' , mobile_image: hero_mobile %} <!-- liquid code: just places a img -->
<div class="gradiant-overlay-hero"></div>
<a href="{{ section.settings.link_1 }}" class="primary-button button mobile_button_hero" style="position: absolute; bottom: 0;">{{ section.settings.button_text_1 | escape }}</a>
<a href="{{ section.settings.link_seconary }}" class="primary-secondary
button mobile_button_hero mobile-only" style="position: absolute; bottom: 4em; background-color: {{ section.settings.color_seconary }}; box-shadow: none; color: white; border: 1px solid {{ section.settings.color_seconary }}; border-radius: 6px; box-shadow: #efefef 0px 8px 24px;">{{ section.settings.button_text_secondary | escape }}</a>
</span>
</section>
<style>
.gradiant-overlay-hero{
position: absolute;
bottom:0;
left:0;
right:0;
width: 100vw;
height: 100px;
background: rgb({{ settings.background | color_extract: 'red' }} ,{{ settings.background | color_extract: 'green' }} ,{{ settings.background | color_extract: 'blue' }} );
background: -moz-linear-gradient(0deg, rgba({{ settings.background | color_extract: 'red' }} ,{{ settings.background | color_extract: 'green' }} ,{{ settings.background | color_extract: 'blue' }} ,1) 0%, rgba({{ settings.background | color_extract: 'red' }} ,{{ settings.background | color_extract: 'green' }} ,{{ settings.background | color_extract: 'blue' }} ,0) 100%);
background: -webkit-linear-gradient(0deg, rgba({{ settings.background | color_extract: 'red' }} ,{{ settings.background | color_extract: 'green' }} ,{{ settings.background | color_extract: 'blue' }} ,1) 0%, rgba({{ settings.background | color_extract: 'red' }} ,{{ settings.background | color_extract: 'green' }} ,{{ settings.background | color_extract: 'blue' }} ,0) 100%);
background: linear-gradient(0deg, rgba({{ settings.background | color_extract: 'red' }} ,{{ settings.background | color_extract: 'green' }} ,{{ settings.background | color_extract: 'blue' }} ,1) 0%, rgba({{ settings.background | color_extract: 'red' }} ,{{ settings.background | color_extract: 'green' }} ,{{ settings.background | color_extract: 'blue' }} ,0) 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#020024",endColorstr="#020024",GradientType=1);
}
.mobile_button_hero {
position: absolute;
bottom: 10px;
left: 50vw;
transform: translate(-50%,50%);
width:70vw;
}
</style>
<!-- other classes are mainly for styling colors- padding etc. -->
```
| null | CC BY-SA 4.0 | null | 2022-11-21T14:06:31.017 | 2022-11-21T14:06:31.017 | null | null | 3,065,049 | null |
74,520,369 | 2 | null | 71,215,916 | -1 | null | I think the key point is "position: sticky"
| null | CC BY-SA 4.0 | null | 2022-11-21T14:20:19.927 | 2022-11-21T14:20:19.927 | null | null | 3,126,550 | null |
74,520,970 | 2 | null | 30,057,110 | 0 | null | R markdown has builtin support for "mathdisplay" you may use that for inserting new line it .
#### code
```
---
title: "testdoc"
author: ""
date: ""
output: pdf_document
---
# Title
this is a test text $\\$ this is a text after newline
too many newlines $\\ \\ \\ \\ \\$ foo $\\$ bar
\begin{paragraph}{with newline}
$\\$
How much wood could a woodchuck chuck if a
woodchuck could chuck wood? A woodchuck $\\$
would chuck all the wood that a woodchuck
could chuck, if a woodchuck could chuck wood.
\end{paragraph}
\begin{paragraph}{without newline}
How much wood could a woodchuck chuck if a
woodchuck could chuck wood? A woodchuck
would chuck all the wood that a woodchuck
could chuck, if a woodchuck could chuck wood.
\end{paragraph}
```
#### output
[](https://i.stack.imgur.com/ZtXck.jpg)
| null | CC BY-SA 4.0 | null | 2022-11-21T15:07:32.570 | 2022-11-21T15:38:27.280 | 2022-11-21T15:38:27.280 | 18,416,336 | 18,416,336 | null |
74,521,132 | 2 | null | 74,521,041 | 2 | null | If you change the Attributes name from "CanonicalNameOfObject" to just "CanonicalName" you will receive the CN in string format.
```
Get-ADComputer -Filter * -Property * | Select-Object CanonicalName
```
| null | CC BY-SA 4.0 | null | 2022-11-21T15:20:32.067 | 2022-11-21T15:20:32.067 | null | null | 20,561,885 | null |
74,521,287 | 2 | null | 74,287,675 | 1 | null | Iris is strict about metadata and will fail loudly when they don't match in operations you try to do.
The error you get tells you what's going on: `ValueError: Coordinate 'latitude' has different points for the LHS cube 'air_temperature' and RHS cube 'Elevation'.`
So you can investigate and compare your left and right hand sides with
`cube.coord('latitude').points`
Xarray on the other hand is not strict about metadata and assumes you know what you are doing, i.e. will also do operations that will give wrong results.
Both have their merits. I'm siding with xarray for reading and analysing files. And iris when writing files.
| null | CC BY-SA 4.0 | null | 2022-11-21T15:32:21.113 | 2022-11-21T15:32:21.113 | null | null | 7,047,144 | null |
74,521,982 | 2 | null | 74,513,401 | 0 | null | you can use json_normalize:
```
df = pd.DataFrame(your_json['registrants']).explode('custom_questions').reset_index(drop=True)
df=df.join(pd.json_normalize(df.pop('custom_questions')))
#convert rows to columns. Set index first 17 columns. We will not use theese.
df=df.set_index(df.columns[0:17].to_list())
dfx=df.pivot_table(values='value',columns='title',aggfunc=list).apply(pd.Series.explode).reset_index(drop=True)
#we have duplicate rows. Drop them
df=df.reset_index().drop(['value','title'],axis=1).drop_duplicates().reset_index(drop=True)
df=df.join(dfx)
'''
| | id | first_name | last_name | email | address | city | country | zip | state | phone | industry | org | job_title | purchasing_time_frame | role_in_purchase_process | no_of_employees | comments | Departamento/ Región | Edad | Género | Nivel de estudio | ¿Eres cliente de una entidad financiera? | ¿Tiene una empresa? |
|---:|:----------------------|:-------------|:--------------|:-------------------|:----------|:-------|:----------|:------|:--------|:--------|:-----------|:------|:------------|:------------------------|:---------------------------|:------------------|:-----------|:-----------------------|:----------------|:----------|:-------------------|:-------------------------------------------|:----------------------|
| 0 | 23lnTNqyQ3qkthfghjgkk | HUGO | MACHA ILLEN | [email protected] | | | | | | | | | | | | | | | De 35 a 55 años | Masculino | Técnico / Superior | Si | Si |
'''
```
| null | CC BY-SA 4.0 | null | 2022-11-21T16:27:17.040 | 2022-11-21T19:41:56.920 | 2022-11-21T19:41:56.920 | 15,415,267 | 15,415,267 | null |
74,522,928 | 2 | null | 74,518,836 | 3 | null | You have to locate the row. Then use a switch statement to get the appropriate value.
```
double GetDeduction(double salary, string discount)
{
var row = someData.SingleOrDefault(a => salary >= a.start && salary < a.end);
if(row == null) throw new SomeRowNotFoundException();
return discount switch
{
"p1" => row.p1,
"p2" => row.p2,
"p3" => row.p3,
_ => throw new SomeDiscountNotValidException();
}
}
```
You have to include one of the boundaries and exclude the other to avoid overlap. I arbitrarily chose to include start the alternative would be
`someData.SingleOrDefault(a => salary > a.start && salary <= a.end)`
| null | CC BY-SA 4.0 | null | 2022-11-21T17:44:35.027 | 2022-11-21T18:15:09.350 | 2022-11-21T18:15:09.350 | 1,492,496 | 1,492,496 | null |
74,523,250 | 2 | null | 74,522,982 | 1 | null | you need to aply a filter query with `where` over that collection, use this:
```
void Result() async{
var query = FirebaseFirestore.instance.collection("Result").where("result", isEqualTo: "COVID");
var snapshot = await query.get();
var count = snapshot.size;
print(' Records are $count');
}
```
now it should get and print the count of the documents with a "COVID" value in the `result` field.
| null | CC BY-SA 4.0 | null | 2022-11-21T18:16:19.277 | 2022-11-21T18:16:19.277 | null | null | 18,670,641 | null |
74,523,291 | 2 | null | 74,499,605 | 0 | null | As someone suggested in the comments, this case use requires looping over indexes and elements on their own, as using `for index in enumerate(ndarray)` will result in `index` being a tuple rather than being an integer. Furthermore, using `for index, item in enumerate(ndarray)` is suggested, as shown below:
```
# Filter function
def filter(x):
h = np.array([-0.0147, 0.173, 0.342, 0.342, 0.173, -0.0147])
y = np.zeros_like(x)
buf_array = np.zeros_like(h)
buf = 0.0
for n, n_i in enumerate(x):
for k, k_i in enumerate(h):
i = n-k
buf = h[k]*x[i]
buf_array[k] = buf
y[n] = np.sum(buf_array)
return y
```
| null | CC BY-SA 4.0 | null | 2022-11-21T18:20:26.967 | 2022-11-21T18:20:26.967 | null | null | 15,072,560 | null |
74,523,568 | 2 | null | 74,217,650 | 0 | null | finally i found the solution for this every time ask permission in cordova ios webview
Add this Function on CDVWebViewUIDelegate.m
```
- (void)webView:(WKWebView *)webView requestMediaCapturePermissionForOrigin:(WKSecurityOrigin *)origin initiatedByFrame:(WKFrameInfo *)frame type:(WKMediaCaptureType)type decisionHandler:(void (^)(WKPermissionDecision))decisionHandler API_AVAILABLE(ios(15.0)) API_AVAILABLE(ios(15.0)){ decisionHandler(WKPermissionDecisionGrant);
}
```
And using this plugin for native permissions `cordova-plugin-diagonstics`
| null | CC BY-SA 4.0 | null | 2022-11-21T18:47:16.023 | 2022-11-21T18:47:16.023 | null | null | 20,117,097 | null |
74,524,302 | 2 | null | 74,524,047 | 0 | null | This is what your query returns (to me, result seems to be OK - as far as I understood the question):
```
SQL> select min_sal, deptno, round(avg_sal)
2 from (select avg(sal) as avg_sal, min(sal) as min_sal, deptno
3 from emp
4 group by deptno
5 )
6 where avg_sal = (select max(avg(sal)) from emp group by deptno);
MIN_SAL DEPTNO ROUND(AVG_SAL)
---------- ---------- --------------
1300 10 2917
```
However, consider a slightly different approach - the one that selects from the `emp` table only once so - if it were a really large table (with many, many rows), such an approach should perform better.
Basically, sort rows by average salaries in descending order and return the one that ranks as the highest:
```
SQL> with temp as
2 (select deptno,
3 min(sal) min_sal,
4 round(avg(sal)) avg_sal,
5 dense_rank() over (order by avg(sal) desc) rnk_avg_sal
6 from emp
7 group by deptno
8 )
9 select a.min_sal, a.deptno, a.avg_sal
10 from temp a
11 where a.rnk_avg_sal = 1;
MIN_SAL DEPTNO AVG_SAL
---------- ---------- ----------
1300 10 2917
SQL>
```
| null | CC BY-SA 4.0 | null | 2022-11-21T20:01:55.543 | 2022-11-21T20:01:55.543 | null | null | 9,097,906 | null |
74,524,409 | 2 | null | 6,529,421 | 0 | null | I was facing the same problem, so the answer that [tize](https://stackoverflow.com/users/12429497/tize) gave helped me alot, I created a div right under my header and used some css(z-index, overflow and background), so the main element is scrollable and hid behind the transparent header:
```
<header>
<h1>Hello World</h1>
</header>
<div class="inv-header"></div>
<main>Content Here...</main>
```
```
header{
position:fixed;
background:rgba(255,255,255,80%);
top:0;
width:100%;
z-index:10;
}
.inv-header{
position:fixed;
top:0;
height:12.8%;
width:100%;
background:inherit;
}
main{
margin-top:5.9%;
padding-top:1%;
overflow:auto;
}
```
| null | CC BY-SA 4.0 | null | 2022-11-21T20:14:02.010 | 2022-11-21T20:14:02.010 | null | null | 20,566,246 | null |
74,524,499 | 2 | null | 74,524,232 | 0 | null | It's easy to solve this problem with a recursive generator. This is similar to how you solve change-making problems, just here we have only two "coins", either two characters together, or one character at a time. The total change we're trying to make is the length of the input string. The fact that the characters are digits in a numeric string is irrelevant.
```
def singles_and_pairs(string):
if len(string) <= 1: # base case
yield list(string) # yield either [] or [string] and then quit
return
for result in singles_and_pairs(string[:-1]): # first recursion
result.append(string[-1:])
yield result
for result in singles_and_pairs(string[:-2]): # second recursion
result.append(string[-2:])
yield result
```
If you plan on running this on large input strings, you might want to add memoization, since the recursive calls recalculate the same results quite often.
| null | CC BY-SA 4.0 | null | 2022-11-21T20:24:32.410 | 2022-11-21T20:24:32.410 | null | null | 1,405,065 | null |
74,524,509 | 2 | null | 74,523,496 | 4 | null | The "roundness" measure is sensitive to a precise estimate of the perimeter. What `cv2.arcLength()` does is add the lengths of each of the polygon edges, [which severely overestimates the length of outlines](https://www.crisluengo.net/archives/310/). I think this is the main reason that this measure hasn't worked for you. With a better perimeter estimator you would get useful results.
An alternative measure that might be more useful is "circularity", defined as the coefficient of variation of the radius. In short, you compute the distance of each polygon vertex (i.e. outline point) to the centroid, then determine the coefficient of variation of these distances (== std / mean).
I wrote a quick Python script to compute this starting from an OpenCV contour:
```
import cv2
import numpy as np
# read in OP's example image, making sure we ignore the red arrow
img = cv2.imread('jGssp.png')[:, :, 1]
_, img = cv2.threshold(img, 127, 255, 0)
# get the contour of the shape
contours, hierarchy = cv2.findContours(img, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_NONE)
contour = contours[0][:, 0, :]
# add the first point as the last, to close it
contour = np.concatenate((contour, contour[0, None, :]))
# compute centroid
def cross_product(v1, v2):
"""2D cross product."""
return v1[0] * v2[1] - v1[1] * v2[0]
sum = 0.0
xsum = 0.0
ysum = 0.0
for ii in range(1, contour.shape[0]):
v = cross_product(contour[ii - 1, :], contour[ii, :])
sum += v
xsum += (contour[ii - 1, 0] + contour[ii, 0]) * v
ysum += (contour[ii - 1, 1] + contour[ii, 1]) * v
centroid = np.array([ xsum, ysum ]) / (3 * sum)
# Compute coefficient of variation of distances to centroid (==circularity)
d = np.sqrt(np.sum((contour - centroid) ** 2, axis=1))
circularity = np.std(d) / np.mean(d)
```
| null | CC BY-SA 4.0 | null | 2022-11-21T20:25:19.623 | 2022-11-26T14:34:12.213 | 2022-11-26T14:34:12.213 | 7,328,782 | 7,328,782 | null |
74,524,563 | 2 | null | 74,353,591 | 0 | null | I was able to find an attempt at an answer. I added another property to my Point collection implementation (that included the index of that point in an array), and used this to iterate over edges in the triangulation to build the Graph, before running the EMST algorithm on it.
However, the real answer is don't do this -- it still is not working correctly (incorrect number of edges, including infinite vertices in the edge list, and other problems).
```
// Form triangulation to later convert into Graph representation
using VertexInfoBase = CGAL::Triangulation_vertex_base_with_info_3<
PointData,
Kernel
>;
using TriTraits = CGAL::Triangulation_data_structure_3<
VertexInfoBase,
CGAL::Delaunay_triangulation_cell_base_3<Kernel>,
CGAL::Parallel_tag
>;
using Triangulation_3 = CGAL::Delaunay_triangulation_3<Kernel, TriTraits>;
Triangulation_3 tr;
// Iterate through point indices assigned to each detected shape.
std::vector<std::size_t>::const_iterator
index_it = (*it)->indices_of_assigned_points().begin();
while (index_it != (*it)->indices_of_assigned_points().end()) {
PointData& p = *(points.begin() + (*index_it));
// assign shape diagnostic color info
boost::get<3>(p) = rgb;
// insert Point_3 data for triangulation and attach PointData info
TriTraits::Vertex_handle vertex = tr.insert(boost::get<0>(p));
vertex->info() = p;
index_it++; // next assigned point
}
std::cout << "Found triangulation with: \n\t" <<
tr.number_of_vertices() << "\tvertices\n\t" <<
tr.number_of_edges() << "\tedges\n\t" <<
tr.number_of_facets() << "\tfacets" << std::endl;
// build a Graph out of the triangulation that we can do a Minimum-Spanning-Tree on
// examples taken from https://www.boost.org/doc/libs/1_80_0/libs/graph/example/kruskal-example.cpp
using Graph = boost::adjacency_list<
boost::vecS, // OutEdgeList
boost::vecS, // VertexList
boost::undirectedS, // Directed
boost::no_property, // VertexProperties
boost::property< boost::edge_weight_t, double > // EdgeProperties
>;
using Edge = boost::graph_traits<Graph>::edge_descriptor;
using E = std::pair< size_t, size_t >; // <: TODO - should be iterator index of vertex in Triangulation_3 instead of size_t?
Graph g(tr.number_of_vertices());
boost::property_map< Graph, boost::edge_weight_t >::type weightmap = boost::get(boost::edge_weight, g);
// iterate over finite edges in the triangle, and add these
for (
Triangulation_3::Finite_edges_iterator eit = tr.finite_edges_begin();
eit != tr.finite_edges_end();
eit++
)
{
Triangulation_3::Segment s = tr.segment(*eit);
Point_3 vtx = s.point(0);
Point_3 n_vtx = s.point(1);
// locate the (*eit), get vertex handles?
// from https://www.appsloveworld.com/cplus/100/204/how-to-get-the-source-and-target-points-from-edge-iterator-in-cgal
Triangulation_3::Vertex_handle vh1 = eit->first->vertex((eit->second + 1) % 3);
Triangulation_3::Vertex_handle vh2 = eit->first->vertex((eit->second + 2) % 3);
double weight = std::sqrt(CGAL::squared_distance(vtx, n_vtx));
Edge e;
bool inserted;
boost::tie(e, inserted)
= boost::add_edge(
boost::get<6>(vh1->info()),
boost::get<6>(vh2->info()),
g
);
weightmap[e] = weight;
}
// build Euclidean-Minimum-Spanning-Tree (EMST) as list of simplex edges between vertices
//boost::property_map<Graph, boost::edge_weight_t>::type weight = boost::get(boost::edge_weight, g);
std::vector<Edge> spanning_tree;
boost::kruskal_minimum_spanning_tree(g, std::back_inserter(spanning_tree));
// we can use something like a hash table to go from source -> target
// for each of the edges, making traversal easier.
// from there, we can keep track or eventually find a source "key" which
// does not correspond to any target "key" within the table
std::unordered_map< size_t, std::vector<size_t> > map = {};
// iterate minimum spanning tree to build unordered_map (hashtable)
std::cout << "Found minimum spanning tree of " << spanning_tree.size() << " edges for #vertices " << tr.number_of_vertices() << std::endl;
for (std::vector< Edge >::iterator ei = spanning_tree.begin();
ei != spanning_tree.end(); ++ei)
{
size_t source = boost::source(*ei, g);
size_t target = boost::target(*ei, g);
// << " with weight of " << weightmap[*ei] << std::endl;
if ( map.find(source) == map.end() ) {
map.insert(
{
source,
std::vector({target})
}
);
} else {
std::vector<size_t> target_vec = map[source];
target_vec.push_back(target);
map[source] = target_vec;
}
}
// iterate over map to find an "origin" node
size_t origin = 0;
for (const auto& it : map) {
bool exit_flag = false;
std::vector<size_t> check_targets = it.second;
for (size_t target : check_targets) {
if (map.find(target) == map.end()) {
origin = target;
exit_flag = true;
break;
}
}
if (exit_flag) {
break;
}
}
std::cout << "Found origin of tree with value: " << origin << std::endl;
```
| null | CC BY-SA 4.0 | null | 2022-11-21T20:31:31.330 | 2022-11-21T20:31:31.330 | null | null | 11,929,780 | null |
74,524,614 | 2 | null | 74,516,589 | 0 | null | Use this measure instead:
```
sum_of_max =
CALCULATE(
SUM(T1[value]),
T1[value] = MAX(T1[value])
)
```
| null | CC BY-SA 4.0 | null | 2022-11-21T20:36:50.290 | 2022-11-21T20:36:50.290 | null | null | 7,108,589 | null |
74,524,776 | 2 | null | 51,421,511 | 0 | null | I don't know why this is happens, but this code worked for me:
```
.cdk-global-scrollblock {
position: initial !important;
overflow: hidden !important;
}
```
| null | CC BY-SA 4.0 | null | 2022-11-21T20:53:41.620 | 2022-11-23T16:18:41.930 | 2022-11-23T16:18:41.930 | 14,267,427 | 12,795,118 | null |
74,524,808 | 2 | null | 74,514,832 | 0 | null | Using [.layoutPriority(1)](https://developer.apple.com/documentation/swiftui/view/layoutpriority(_:)) on the Picker() and [.fixedSize()](https://developer.apple.com/documentation/swiftui/view/fixedsize()) on the Text() helped.
| null | CC BY-SA 4.0 | null | 2022-11-21T20:57:56.050 | 2022-11-21T20:57:56.050 | null | null | 14,862,649 | null |
74,524,931 | 2 | null | 74,524,640 | 1 | null | Your reset logic is synchronous, because the outmost condition is `rising_edge(clk)`. Therefore the internal signals are undefined until the first raising edge of the clock.
Change to an asynchronous reset like this (excerpt):
```
if reset = '0' then
-- reset statements
elsif rising_edge(clk) then
-- work statements
end if;
```
Please be aware that even with an asynchronous reset the signals will be undefined until reset is activated or the clock raises. This reflects the actual behavior of a real device.
| null | CC BY-SA 4.0 | null | 2022-11-21T21:11:37.587 | 2022-11-21T21:26:26.373 | 2022-11-21T21:26:26.373 | 11,294,831 | 11,294,831 | null |
74,525,209 | 2 | null | 74,525,106 | 1 | null | The new query building in the Firestore console is just a visual way to build a query that then determines what data the console shows. I find it most helpful to limit the amount of data the console shows, and to see if a query is going to be possible before I translate it in to code.
Aside from that, the query build shows the resulting documents in a tabular view (rather than the panel view that already existed), which makes it possible to compare documents at a glance and fits more data in less space.
| null | CC BY-SA 4.0 | null | 2022-11-21T21:42:56.737 | 2022-11-21T21:42:56.737 | null | null | 209,103 | null |
74,525,213 | 2 | null | 74,511,828 | 0 | null | You just needed to add this extra If clause:
`ElseIf Tabgroup(1, i + 1) < Counter Then OBJ.Fill.ForeColor.RGB = RGB(216, 32, 39)`
commented below. I also slightly changed how the color behaves. In case you do not want it this way, just replace as per above.
```
Sub BarreDeProgression()
'Génère une barre de progression
'Valeurs à adapter selon besoin
Const Longueur As Single = 0.1 'Longueur totale de la barre (% de la longueur de la diapo (0.25 =25%))
Const Hauteur As Single = 0.03 'Hauteur totale de la barre (% de la hauteur de la diapo)
Const PositionX As Single = 0 'Position en X de la barre (% de la longueur de la diapo en partant de la gauche)
Const PositionY As Single = 0.985 'Position en Y de la barre (% de la hauteur de la diapo en partant de la gauche)
'Récupération des infos
Set Pres = ActivePresentation
H = Pres.PageSetup.SlideHeight
W = Pres.PageSetup.SlideWidth * Longueur
nb = Pres.Slides.Count
Counter = 1
Counter2 = 1
nbgroupe = 5 'CInt(InputBox("nombre de groupe ?", "nombre de groupe", 1))
Dim Tabgroup() As Integer
Dim a As Integer
Dim X As Integer
a = 0
Dim test As Integer
test = 0
'nombre de page pour chaque groupe
For L = 1 To nbgroupe
ReDim Preserve Tabgroup(2, 1 To L)
nbslide = 3 'CInt(InputBox("nombre de slide dans le groupe" & L & " ?", "nombre de slide du groupe", 1))
Tabgroup(0, L) = nbslide
Tabgroup(1, L) = nbslide + a
Tabgroup(2, L) = Tabgroup(1, L) - nbslide
a = Tabgroup(1, L)
Next
'Pour chaque Slide
For X = 1 To Pres.Slides.Count
If X > 1 And X < (Pres.Slides.Count) Then
'Supprime l'ancienne barre de progression
nbShape = Pres.Slides(X).Shapes.Count
del = 0
For a = 1 To nbShape
If Left(Pres.Slides(X).Shapes.Item(a - del).Name, 2) = "PB" Then
Pres.Slides(X).Shapes.Item(a - del).Delete
del = del + 1
End If
Next
'pose la nouvelle barre de progression
For i = 0 To nbgroupe - 1
Set OBJ = Pres.Slides(X).Shapes.AddShape(msoShapeChevron, (W * i / nbgroupe) + W / nbgroupe * (PositionX / 2), H * (1 - PositionY), (W / nbgroupe) * (1 - PositionX), H * Hauteur)
OBJ.Name = "PB" & i
OBJ.Line.Visible = msoFalse
If Tabgroup(1, i + 1) >= Counter And Counter > test Then
OBJ.Fill.ForeColor.RGB = RGB(156, 156, 156)
OBJ.Fill.TwoColorGradient Style:=msoGradientVertical, Variant:=1
OBJ.Fill.GradientStops.Insert RGB(216, 32, 39), 0
OBJ.Fill.GradientStops.Insert RGB(216, 32, 39), (Counter - Tabgroup(2, i + 1)) * (1 / Tabgroup(0, i + 1)) - (1 / Tabgroup(0, i + 1))
OBJ.Fill.GradientStops.Insert RGB(216, 32, 39), (Counter - Tabgroup(2, i + 1)) * (1 / Tabgroup(0, i + 1)) - (1 / Tabgroup(0, i + 1)) + 0.02
OBJ.Fill.GradientStops.Insert RGB(216, 32, 39), (Counter - Tabgroup(2, i + 1)) * (1 / Tabgroup(0, i + 1)) - 0.02
OBJ.Fill.GradientStops.Insert RGB(156, 156, 156), (Counter - Tabgroup(2, i + 1)) * (1 / Tabgroup(0, i + 1))
OBJ.Fill.GradientStops.Insert RGB(156, 156, 156), 1
ElseIf Tabgroup(1, i + 1) < Counter Then 'here
OBJ.Fill.ForeColor.RGB = RGB(216, 32, 39)
Else
OBJ.Fill.ForeColor.RGB = RGB(156, 156, 156)
End If
test = Tabgroup(1, i + 1)
Next
test = 0
Counter = Counter + 1
End If
Next X
End Sub
```
| null | CC BY-SA 4.0 | null | 2022-11-21T21:43:04.820 | 2022-11-21T22:44:33.393 | 2022-11-21T22:44:33.393 | 18,247,317 | 18,247,317 | null |
74,525,285 | 2 | null | 74,524,232 | 0 | null | Pheew, this one took me some time to get right, but it seems to finally work (edited for prettier ordering):
```
def max_2_partitions(my_string):
if not my_string:
return [[]]
if len(my_string) == 1:
return [[my_string]]
ret = []
for i in range(len(my_string)):
for l in max_2_partitions(my_string[:i] + my_string[i + 1:]):
li = sorted([my_string[i]]+l, key = lambda x: (len(x),x))
if li not in ret:
ret.append(li)
for j in range(i+1,len(my_string)):
for l in max_2_partitions(my_string[:i]+my_string[i+1:j]+my_string[j+1:]):
li = sorted([my_string[i] + my_string[j]] + l, key = lambda x: (len(x),x))
if li not in ret:
ret.append(li)
return sorted(ret, key=lambda x: (-len(x),x))
```
Example:
```
print(max_2_partitions("1234"))
# [['1', '2', '3', '4'], ['1', '2', '34'], ['1', '3', '24'], ['1', '4', '23'], ['2', '3', '14'], ['2', '4', '13'], ['3', '4', '12'], ['12', '34'], ['13', '24'], ['14', '23']]
```
| null | CC BY-SA 4.0 | null | 2022-11-21T21:51:23.447 | 2022-11-21T22:02:25.700 | 2022-11-21T22:02:25.700 | 20,267,366 | 20,267,366 | null |
74,525,314 | 2 | null | 74,076,140 | 0 | null | The IDE itself proposed to make recently created venv as interpreter, I agreed and after that this mistake occured. The decision: I came to the run->edit configurations and I saw that interpreter path wasn't setted. Than I've added the path by myself and everything worked
| null | CC BY-SA 4.0 | null | 2022-11-21T21:56:38.130 | 2022-11-21T21:56:38.130 | null | null | 19,675,333 | null |
74,525,336 | 2 | null | 74,525,297 | 1 | null | Depends how you wanted to position it.
If you're looking for absolute positioning you could so something like the following:
```
border-left: 1px solid black;
left: 35%;
top: 0;
bottom: 0;
position: absolute;
```
Make sure it's in a `position: relative;` container.
Example: [https://jsfiddle.net/6mw9Lnay/](https://jsfiddle.net/6mw9Lnay/)
If you wanted a relative element:
You could define the height (and width) and apply the same principal with the border-left or border-right applied.
This way you can have elements side-by-side.
| null | CC BY-SA 4.0 | null | 2022-11-21T21:58:56.923 | 2022-11-21T21:58:56.923 | null | null | 1,224,963 | null |
74,525,410 | 2 | null | 60,696,798 | 1 | null | This happened to me following the same tutorial.
My issue was the variables coming from my instrument were strings. Therefore, there is no order. I changed my variables to float and that fixed the problem
```
xs.append(float(FROM_INSTRUMENT))
```
| null | CC BY-SA 4.0 | null | 2022-11-21T22:09:17.477 | 2022-11-24T05:28:34.880 | 2022-11-24T05:28:34.880 | 958,529 | 19,707,832 | null |
74,525,570 | 2 | null | 74,524,232 | 0 | null |
You can first create permutations of the string, and then add spacing:
```
from itertools import permutations
def solution(A):
result = []
def dfs(A,B):
if not B:
result.append(A)
else:
for i in range(1,min(2,len(B))+1):
dfs(A+[B[:i]],B[i:])
for x in permutations(A):
dfs([],''.join(x))
return result
print(f"{solution('123') = }")
# solution('123') = [['1', '2', '3'], ['1', '23'], ['12', '3'], ['1', '3', '2'], ['1', '32'], ['13', '2'], ['2', '1', '3'], ['2', '13'], ['21', '3'], ['2', '3', '1'], ['2', '31'], ['23', '1'], ['3', '1', '2'], ['3', '12'], ['31', '2'], ['3', '2', '1'], ['3', '21'], ['32', '1']]
```
| null | CC BY-SA 4.0 | null | 2022-11-21T22:29:39.210 | 2022-11-21T22:37:12.177 | 2022-11-21T22:37:12.177 | 4,667,669 | 4,667,669 | null |
74,525,677 | 2 | null | 74,525,356 | 0 | null | Join the two tables on `suspect_id` (not `crime_id`) and get the difference between the start and end of the sentence and then sort the table in descending order of sentence length and fetch the first row with ties to find the maximums:
```
SELECT s.name,
FLOOR(MONTHS_BETWEEN(c.end_date, c.start_date) / 12) AS years,
FLOOR(MOD(MONTHS_BETWEEN(c.end_date, c.start_date), 12)) AS months,
31 * MOD(MONTHS_BETWEEN(c.end_date, c.start_date), 1) AS days
FROM crime c
INNER JOIN suspects s
ON c.suspect_id = s.suspect_id
ORDER BY
MONTHS_BETWEEN(c.end_date, c.start_date) DESC
FETCH FIRST ROW WITH TIES;
```
If you are using Oracle 11 or earlier, then you can use the `RANK` analytic function:
```
SELECT *
FROM (
SELECT s.name,
FLOOR(MONTHS_BETWEEN(c.end_date, c.start_date) / 12) AS years,
FLOOR(MOD(MONTHS_BETWEEN(c.end_date, c.start_date), 12)) AS months,
31 * MOD(MONTHS_BETWEEN(c.end_date, c.start_date), 1) AS days,
RANK() OVER (ORDER BY MONTHS_BETWEEN(c.end_date, c.start_date) DESC) AS rnk
FROM crime c
INNER JOIN suspects s
ON c.suspect_id = s.suspect_id
)
WHERE rnk = 1;
```
| null | CC BY-SA 4.0 | null | 2022-11-21T22:45:51.117 | 2022-11-21T22:59:37.727 | 2022-11-21T22:59:37.727 | 1,509,264 | 1,509,264 | null |
74,525,810 | 2 | null | 74,525,675 | 5 | null | One solution is to check all of the named colors that have "green" in the name to see if one will suffice:
```
colors()[grep("green", colors())] # Forty green colors
```
A better solution would be to shift to hue/saturation/value color specification. This looks close to what you want, but could probably use some tweaking:
```
show_col(hsv(121/360, .4, 1))
```
See the manual page `?hsv` for details.
| null | CC BY-SA 4.0 | null | 2022-11-21T23:07:53.860 | 2022-11-26T22:55:06.217 | 2022-11-26T22:55:06.217 | 1,580,645 | 1,580,645 | null |
74,525,976 | 2 | null | 74,525,869 | 1 | null | It sounds like you are looking to use non-default labeling, where you want the labels to be aligned to the midpoint of the bins instead of their boundaries, which is what the `breaks` define. We could do that by using a continuous scale and hiding the main breaks, but keeping the minor breaks, like below.
`scale_x_binned` does not have minor breaks. It only has breaks at the boundaries of the bins, so it's not obvious to me how you could place the break labels at the midpoints of the bins.
```
ggplot(df, aes(x = hour)) +
geom_histogram(bins = 24, fill = "grey60", color = "red") +
scale_x_continuous(name = "Hour of Day", breaks = 0:23) +
theme(axis.ticks = element_blank(),
panel.grid.major.x = element_blank())
```
[](https://i.stack.imgur.com/5Dh3s.png)
| null | CC BY-SA 4.0 | null | 2022-11-21T23:39:02.847 | 2022-11-22T00:32:44.563 | 2022-11-22T00:32:44.563 | 6,851,825 | 6,851,825 | null |
74,526,042 | 2 | null | 74,522,240 | 2 | null | I made some changes in your code to utilize `Animatable` so we always `snap` to the beginning before animating to our `target` value. We also eliminated the computation here since we just want to fill the entire progress every time the score updates, in our case to (`limitAngle`) and used the `newScore` state as a `key` in the `LaunchedEffect` to trigger the animation every time it increments. Don't mind the `+30` increments, its just an arbitrary value that you can change without affecting the animation.
```
@Composable
fun ArcProgressbar(
modifier: Modifier = Modifier,
newScore: Float,
level: String,
startAngle : Float = 120f,
limitAngle: Float = 300f,
thickness: Dp = 8.dp
) {
val animateValue = remember { Animatable(0f) }
LaunchedEffect(newScore) {
if (newScore > 0f) {
animateValue.snapTo(0f)
delay(10)
animateValue.animateTo(
targetValue = limitAngle,
animationSpec = tween(
durationMillis = 1000
)
)
}
}
Box(modifier = modifier.fillMaxWidth()) {
Canvas(
modifier = Modifier
.fillMaxWidth(0.45f)
.padding(10.dp)
.aspectRatio(1f)
.align(Alignment.Center),
onDraw = {
// Background Arc
drawArc(
color = Color.Gray,
startAngle = startAngle,
sweepAngle = limitAngle,
useCenter = false,
style = Stroke(thickness.toPx(), cap = StrokeCap.Square),
size = Size(size.width, size.height)
)
// Foreground Arc
drawArc(
color = Color.Green,
startAngle = startAngle,
sweepAngle = animateValue.value,
useCenter = false,
style = Stroke(thickness.toPx(), cap = StrokeCap.Square),
size = Size(size.width, size.height)
)
}
)
Column {
Text(
text = level,
modifier = Modifier
.fillMaxWidth(0.125f)
.offset(y = (-10).dp),
color = Color.Gray,
fontSize = 82.sp
)
Text(
text = "LEVEL",
modifier = Modifier
.padding(bottom = 8.dp),
color = Color.Gray,
fontSize = 20.sp
)
Text(
text = "Score ( $newScore ) ",
modifier = Modifier
.padding(bottom = 8.dp),
color = Color.Gray,
fontSize = 20.sp
)
}
}
}
```
Sample usage:
```
@Composable
fun ScoreGenerator() {
var newScore by remember {
mutableStateOf(0f)
}
Column {
Button(onClick = {
newScore += 30f
}) {
Text("Add Score + 30")
}
ArcProgressbar(
newScore = newScore,
level = ""
)
}
}
```
[](https://i.stack.imgur.com/UuzDi.gif)
| null | CC BY-SA 4.0 | null | 2022-11-21T23:50:54.907 | 2022-11-22T05:56:37.900 | 2022-11-22T05:56:37.900 | 19,023,745 | 19,023,745 | null |
74,526,509 | 2 | null | 74,526,297 | 0 | null | You can read/write GeoJSON objects and do spatial set operations like this with geopandas:
```
In [8]: df = gpd.read_file("data_01.json", engine="GeoJSON")
In [9]: df
Out[9]:
z la geometry
0 1412.5 ba POLYGON ((2.00000 2.00000, 2.00000 22.00000, 2...
1 1412.5 ba POLYGON ((12.00000 16.00000, 7.00000 10.00000,...
2 1412.5 ba POLYGON ((27.00000 15.00000, 24.00000 12.00000...
In [10]: df.loc[0, "geometry"] = (df.loc[0, "geometry"] - df.loc[1, "geometry"])
In [11]: df = df.drop(1)
In [12]:
Out[12]:
z la geometry
0 1412.5 ba POLYGON ((2.00000 22.00000, 22.00000 22.00000,...
2 1412.5 ba POLYGON ((27.00000 15.00000, 24.00000 12.00000...
```
You can then export back to json with `to_json`:
```
In [13]: print(df.to_json())
Out[13]:
{
"type": "FeatureCollection",
"features": [
{
"id": "0",
"type": "Feature",
"properties": {"la": "ba", "z": 1412.5},
"geometry": {
"type": "Polygon",
"coordinates": [
[[2.0, 22.0], [22.0, 22.0], [22.0, 2.0], [2.0, 2.0], [2.0, 22.0]],
[[7.0, 10.0], [17.0, 10.0], [12.0, 16.0], [7.0, 10.0]]
]
}
},
{
"id": "2",
"type": "Feature",
"properties": {"la": "ba", "z": 1412.5},
"geometry": {
"type": "Polygon",
"coordinates": [
[[27.0, 15.0], [24.0, 12.0], [29.0, 12.0], [27.0, 15.0]]
]
}
}
]
}
```
| null | CC BY-SA 4.0 | null | 2022-11-22T01:18:44.203 | 2022-11-22T04:26:48.430 | 2022-11-22T04:26:48.430 | 3,888,719 | 3,888,719 | null |
74,526,603 | 2 | null | 74,521,806 | 0 | null | as @Gabe pointed out
[https://tailwindcss.com/docs/customizing-colors#using-css-variables](https://tailwindcss.com/docs/customizing-colors#using-css-variables)
Need to first convert hex to RGB [https://www.rapidtables.com/convert/color/hex-to-rgb.html](https://www.rapidtables.com/convert/color/hex-to-rgb.html) and set that up in the `app.css`
```
--color-element-primary: 87 84 255;
```
Than in the `tailwind.config.js`
```
'primary': 'rgb(var(--color-element-primary) / .10)',
```
| null | CC BY-SA 4.0 | null | 2022-11-22T01:35:43.417 | 2022-11-22T01:35:43.417 | null | null | 14,192,860 | null |
74,526,637 | 2 | null | 74,525,869 | 1 | null | I though the same as you, namely `scale_x_discrete`, but the data given to geom_histogram is assumed to be continuous, so ...
```
ggplot(df, aes(x = hour)) +
geom_histogram(bins = 24, fill = "grey60", color = "red") +
scale_x_continuous(breaks = 0:23)
```
(Doesn't require any machinations with theme.)
[](https://i.stack.imgur.com/uIg2h.png)
I wish I could tell you that I found out geom_histogram is centering the labels, but ggproto objects exist in a cavern with too many tunnels and passages for my mind to follow.
So I took a shot at examining the plot object that I created when I produced the png graphic above:
```
ggplot_build(plt)
# ------------
$data
$data[[1]]
y count x xmin xmax density ncount ndensity flipped_aes PANEL group ymin ymax colour fill size linetype
1 6 6 0 -0.5 0.5 0.04000000 0.6 0.6 FALSE 1 -1 0 6 red grey60 0.5 1
2 7 7 1 0.5 1.5 0.04666667 0.7 0.7 FALSE 1 -1 0 7 red grey60 0.5 1
3 4 4 2 1.5 2.5 0.02666667 0.4 0.4 FALSE 1 -1 0 4 red grey60 0.5 1
4 5 5 3 2.5 3.5 0.03333333 0.5 0.5 FALSE 1 -1 0 5 red grey60 0.5 1
5 7 7 4 3.5 4.5 0.04666667 0.7 0.7 FALSE 1 -1 0 7 red grey60 0.5 1
#snipped remainder
```
So the reason the break tick-marks are centered is that the bin construction is set up so they all are centered on the breaks.
Further exploration f whats in ggplot_build results:
```
ls(envir=ggplot_build(plt)$layout)
#[1] "coord" "coord_params" "facet" "facet_params" "layout" "panel_params"
#[7] "panel_scales_x" "panel_scales_y" "super"
ggplot_build(plt)$layout$panel_params
#-------results
[[1]]
[[1]]$x
<ggproto object: Class ViewScale, gg>
aesthetics: x xmin xmax xend xintercept xmin_final xmax_final xlower ...
break_positions: function
break_positions_minor: function
breaks: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 ...
continuous_range: -1.7 24.7
dimension: function
get_breaks: function
get_breaks_minor: function
#---- snipped remaining outpu
```
| null | CC BY-SA 4.0 | null | 2022-11-22T01:43:10.733 | 2022-11-22T03:15:05.640 | 2022-11-22T03:15:05.640 | 1,855,677 | 1,855,677 | null |
74,527,272 | 2 | null | 74,526,851 | 1 | null | I think your problem is that value of bool is string
try `this.carSeat == 'true'`
| null | CC BY-SA 4.0 | null | 2022-11-22T03:38:21.213 | 2022-11-22T03:38:21.213 | null | null | 1,100,248 | null |
74,527,471 | 2 | null | 74,521,041 | 0 | null | A "property value collection" is just that, a collection. You get that a lot in AD, every time an attribute takes more than one value (that is to say "most of the time").
Indexing is required even for singular items, eg. `$AdUser.proxyAddresses[0]`; if you can't be certain there is just the one value then you'll need to iterate.
Note that you can check .PropertyNames for presence of the attribute you want - which is not necessarily a given - and that you can also use `$UserObject[$propertyName]` syntax to access it.
| null | CC BY-SA 4.0 | null | 2022-11-22T04:19:54.167 | 2022-11-22T04:19:54.167 | null | null | 20,551,048 | null |
74,527,606 | 2 | null | 74,527,344 | 0 | null | Try This
```
Update @tb Set Outcome = 60 + Score Where sesion = 1
Declare @Session decimal(18,0)
Declare F Cursor For Select sesion From @tb Where sesion <> 1 Order By sesion
Open F
Fetch Next From F Into @MaID
While @@FETCH_STATUS = 0
Begin
Update @tb
Set Outcome = Case When Score + (Select Outcome From @tb Where sesion = @Session - 1) > 100 Then 100
When Score + (Select Outcome From @tb Where sesion = @Session - 1) < 0 Then 0
Else Score + (Select Outcome From @tb Where sesion = @Session - 1) End
Where sesion = @Session
Fetch Next From F Into @Session
End
Close F
DeAllocate F
```
| null | CC BY-SA 4.0 | null | 2022-11-22T04:44:15.347 | 2022-11-22T04:44:15.347 | null | null | 12,365,827 | null |
74,527,679 | 2 | null | 74,527,076 | 0 | null | it can be done using an after element on shape
```
#shape{
width: 100px;
height: 100px;
border-left: 0px solid transparent;
border-top: 0px solid transparent;
border-right: 1px solid blue;
border-bottom:1px solid blue;
border-bottom-right-radius: 25px;
position: relative;
overflow: hidden;
}
#shape::after{
content:"";
position: absolute;
background-color: blue;
width: 1px;
height: 150%;
bottom: 0;
transform-origin: bottom;
transform: rotateZ(45deg);
}
```
```
<div id="shape"></div>
```
| null | CC BY-SA 4.0 | null | 2022-11-22T04:56:26.627 | 2022-11-22T06:30:44.390 | 2022-11-22T06:30:44.390 | 17,033,432 | 17,033,432 | null |
74,527,728 | 2 | null | 13,485,030 | 0 | null | In my case:
migrated a
```
CharField(max_length=1) to CharField(max_length=2)
```
then save some data.
Then I wanna migrate back
DB already have data like `"sg"` inside.
just temporarily make them shorter will fix this error
Note if you have `django-simple-history` installed. got there and change/delete data as well
`varying(1)`
| null | CC BY-SA 4.0 | null | 2022-11-22T05:03:58.863 | 2022-11-22T05:03:58.863 | null | null | 7,728,887 | null |
74,527,732 | 2 | null | 74,527,344 | 0 | null | This will work correctly for the same id:
```
SELECT
y.id,
y.nosession,
y.score,
@running_total :=
CASE WHEN @running_total + y.score > 100 THEN 100
WHEN @running_total + y.score < 0 THEN 0
ELSE @running_total + y.score END
AS cumulative_sum
FROM yourtable y
JOIN (SELECT @running_total := 60) r
ORDER BY y.id, y.nosession
```
This will do for different id's:
```
SELECT sub.id, sub.nosession, sub.score, sub.cumulative_sum
FROM
(SELECT
y.id,
y.nosession,
y.score,
@running_total :=
CASE WHEN id <> @id THEN 60 + y.score
WHEN @running_total + y.score > 100 THEN 100
WHEN @running_total + y.score < 0 THEN 0
ELSE @running_total + y.score END
AS cumulative_sum,
@id := y.id
FROM yourtable y
JOIN (SELECT @running_total := 60, @id:='0') r
ORDER BY y.id, y.nosession) sub;
```
Try out here: [db<>fiddle](https://dbfiddle.uk/JkFSzRyx)
| null | CC BY-SA 4.0 | null | 2022-11-22T05:05:02.933 | 2022-11-22T05:45:09.693 | 2022-11-22T05:45:09.693 | 18,794,826 | 18,794,826 | null |
74,527,767 | 2 | null | 74,527,076 | 1 | null | you can add `border-bottom-right-radius` in your `#shape` css. you just need to set the `border-left` to white or depending on your background color of your div to match the color
```
#shape {
width: 0;
border-left: 72px solid white;
border-right: 0px solid transparent;
border-bottom: 72px solid red;
border-bottom-right-radius: 20px;
}
```
```
<div id="shape"></div>
```
| null | CC BY-SA 4.0 | null | 2022-11-22T05:12:01.517 | 2022-11-22T06:31:25.423 | 2022-11-22T06:31:25.423 | 14,820,590 | 14,820,590 | null |
74,527,841 | 2 | null | 74,527,344 | 0 | null | Here's a solution with recursive CTE:
```
with recursive cte (id, session_no, score, outcome) as (
select id, session_no, score, 60+score as outcome
from session_score
where session_no = 1
union all
select ss.id, ss.session_no, ss.score,
case
when c.outcome + ss.score > 100 then 100
when c.outcome + ss.score < 0 then 0
else c.outcome + ss.score
end as outcome
from session_score ss
join cte c
on ss.id = c.id
and ss.session_no = c.session_no+1)
select id, session_no, score, outcome
from cte
order by 1,2;
```
Tested with 2 IDs:
```
id |session_no|score|outcome|
------+----------+-----+-------+
ST0127| 1| 2| 62|
ST0127| 2| 2| 64|
ST0127| 3| 2| 66|
ST0127| 4| 2| 68|
ST0127| 5| 2| 70|
ST0127| 6| 2| 72|
ST0127| 7| 2| 74|
ST0127| 8| 2| 76|
ST0127| 9| 2| 78|
ST0127| 10| 2| 80|
ST0127| 11| 2| 82|
ST0127| 12| 2| 84|
ST0127| 13| 2| 86|
ST0127| 14| 2| 88|
ST0127| 15| 2| 90|
ST0127| 16| 2| 92|
ST0127| 17| 2| 94|
ST0127| 18| 2| 96|
ST0127| 19| 2| 98|
ST0127| 20| 2| 100|
ST0127| 21| 2| 100|
ST0127| 22| 2| 100|
ST0127| 23| -5| 95|
ST0127| 24| 2| 97|
ST0127| 25| 0| 97|
ST0127| 26| -5| 92|
ST0127| 27| 2| 94|
ST0127| 28| 2| 96|
ST0127| 29| 2| 98|
ST0128| 1| 2| 62|
ST0128| 2| 2| 64|
ST0128| 3| 2| 66|
ST0128| 4| 2| 68|
ST0128| 5| 2| 70|
ST0128| 6| 2| 72|
```
| null | CC BY-SA 4.0 | null | 2022-11-22T05:23:37.043 | 2022-11-22T05:23:37.043 | null | null | 20,127,235 | null |
74,528,487 | 2 | null | 74,513,873 | 1 | null | Try the following code:
```
import 'package:flutter/material.dart';
import 'package:get/get_core/src/get_main.dart';
import 'package:get/get_navigation/get_navigation.dart';
import 'Reminder/ui/home_reminder.dart';
import 'Reminder/ui/widgets/button.dart';
void main() {
// debugPaintSizeEnabled = true;
runApp(const HomePage());
}
class HomePage extends StatelessWidget {
const HomePage({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
appBar: AppBar(
title: const Text('Medicine Reminder App'),
),
body: Column(
children: [
Stack(
children: [
Image.asset(
'images/MenuImg.jpg',
width: 600,
height: 200,
fit: BoxFit.cover,
),
],
),
const SizedBox(height: 10.0),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
ElevatedButton(
child: const Text('Button 1'),
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const Scaffold(
body: body,
),
),
);
},
),
ElevatedButton(
child: const Text('Button 2'),
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const Scaffold(
body: body,
),
),
);
},
),
ElevatedButton(
child: const Text('Button 3'),
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const Scaffold(
body: body,
),
),
);
},
),
],
),
],
),
),
);
}
}
```
| null | CC BY-SA 4.0 | null | 2022-11-22T06:48:59.313 | 2022-11-24T11:54:22.073 | 2022-11-24T11:54:22.073 | 16,124,033 | 16,124,033 | null |
74,528,840 | 2 | null | 70,432,774 | 0 | null | Change dio.get to dio.request:
```
dio.request<dynamic>(
'https://address',
queryParameters: <String,dynamic>{
'cn': 'iPhone_11', 'qt': '20', 'ct': 'Delhi'},
options: Options(method: "GET"));
}
```
| null | CC BY-SA 4.0 | null | 2022-11-22T07:27:07.957 | 2022-11-22T07:27:07.957 | null | null | 5,052,603 | null |
74,528,834 | 2 | null | 74,527,037 | 2 | null |
I ran the same command as you and got same response with `rbac` in like below:
```
az ad sp create-for-rbac -n my_app --years 99
```

To get these results from , you can use below command:
```
az ad app credential list --id <ApplicationID>
```

To create a with a specific , you can make use of below command:
```
az ad app credential reset --id <ApplicationID> --display-name <Enter description here> --append
```
I ran the above command and created `new secret` with description.
When I tried to list the secrets of that application, I got both successfully like below:
```
az ad app credential list --id <ApplicationID>
```

When I checked the same in Azure Portal, I can see the new client secret with like below:

| null | CC BY-SA 4.0 | null | 2022-11-22T07:26:38.677 | 2022-11-22T07:26:38.677 | null | null | 18,043,665 | null |
74,528,881 | 2 | null | 74,441,883 | 0 | null | To update a work item with a custom ID for particular work item type, you can refer to the followings.
Step1: Use action "When a work item is created"
[](https://i.stack.imgur.com/y8W0P.png)
Step2: Use action "Get work item details"
[](https://i.stack.imgur.com/HvOhg.png)
Work Item Id is get from Step1.
Step3: Use action "HTTP"
[](https://i.stack.imgur.com/tzL3w.png)
This action uses REST API [Work Items - Update](https://learn.microsoft.com/en-us/rest/api/azure/devops/wit/work-items/update?view=azure-devops-rest-7.0&tabs=HTTP) to update work item field.
URL: `https://dev.azure.com/{organization}/{project}/_apis/wit/workitems/{id}?api-version=7.0`
Headers: Key: `Content-Type` Value: `application/json-patch+json`
Body:
```
[
{
"op": "add",
"path": "/fields/Custom.customID",
"value": "Activity - 1"
}
]
```
Authentication: `Basic`
Username: Your user name in Azure DevOps. You can check from User settings.
Password: [Personal Access Token](https://learn.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=azure-devops&tabs=Windows) created in Azure DevOps.
Then when I create a new Activity, the custom ID will be "Activity - 1".
[](https://i.stack.imgur.com/vjhEz.png)
| null | CC BY-SA 4.0 | null | 2022-11-22T07:31:29.580 | 2022-11-22T07:31:29.580 | null | null | 16,183,552 | null |
74,529,140 | 2 | null | 74,528,442 | 1 | null | Trickier than it looked
You do not have an array but an object. I renamed it and we can use the Object.entries(stepLabelObject) to loop or reduce.
Filter and map does not work well here.
Reduce
```
const stepLabelObject = { 0: "0", 1: "1", 2: "2", 3: "3", 4: "4", 5: "5", 6: "6", 7: "7", 8: "8", 9: "", 10:"9", 11: "10", 13: "11", 14: "12", 15: "13", 16: "", 17: "14", 18: "15", 19: "", 20: "16", 21: "17", 22: "", 23: "", 24: "18", 27: "", 28: "", 29: "", 30: "", 31: "", 32: "19", 33: "", 34: "", 35: "", 36: "", 37: "", 38: "", 39: "", 40: "20" };
const stepsDropDown = e => { console.log(e.target.value) };
let cnt = 0;
const options = Object.entries(stepLabelObject).reduce((acc,[key,val]) => {
if (val !== "") acc.push(`<option value="${key}">step : ${++cnt}</option>`);
return acc;
});
const sel = document.getElementById('stepDropDown');
sel.innerHTML = options.join('');
sel.addEventListener('change',stepsDropDown);
```
```
<select id="stepDropDown"></select>
```
| null | CC BY-SA 4.0 | null | 2022-11-22T07:54:57.227 | 2022-11-22T08:27:18.230 | 2022-11-22T08:27:18.230 | 295,783 | 295,783 | null |
74,529,332 | 2 | null | 74,457,669 | 0 | null | You may consider using external tools which can render JS website OR debug if the website makes some AJAX call, and get raw JSON instead of trying to fight with HTML.
It looks like the website uses this xhr request to get the actual data in JSON:
[https://www.benzinpreis.de/bpmap-callback.php?lat_min=50.86707808969461&lat_max=51.01850632466553&lng_min=6.700286865234375&lng_max=7.215270996093751&action=getTankstellen](https://www.benzinpreis.de/bpmap-callback.php?lat_min=50.86707808969461&lat_max=51.01850632466553&lng_min=6.700286865234375&lng_max=7.215270996093751&action=getTankstellen)
( see Chrome Dev Tools Network tab for detailed information )
then you might use `ImportJSON` to import data into your Google Sheet.
[https://workspace.google.com/marketplace/app/importjson_import_json_data_into_google/782573720506](https://workspace.google.com/marketplace/app/importjson_import_json_data_into_google/782573720506)
Discovering hidden APIs using Chrome Dev Tools:
[https://www.youtube.com/watch?v=kPe3wtA9aPM](https://www.youtube.com/watch?v=kPe3wtA9aPM)
| null | CC BY-SA 4.0 | null | 2022-11-22T08:10:26.543 | 2022-11-22T08:10:26.543 | null | null | 19,917,207 | null |
74,530,399 | 2 | null | 74,530,300 | 0 | null | Please be sure that the extension does have the release variation build.
I faced this problem because I was running an "archive," the "Release" build variation is used, but the extension does not have this build variation. How can you add the release build variation to the extension? I continue creating when I add a new extension without using this build variation and the problem solved.
| null | CC BY-SA 4.0 | null | 2022-11-22T09:37:34.600 | 2022-11-22T09:37:34.600 | null | null | 20,570,798 | null |
74,530,439 | 2 | null | 71,420,378 | 0 | null | Have you checked whether the package ipykernal is installed as well? I have once uninstalled the ipykernal package and encountered the same issue.
Besides, I also encounter quite a lot of problem when using interactive window with visual studio 2022 using global python 3.9 environment. But when I use the conda environment from the anaconda 2022 distribution, everything work perfectly. I suspect it is a problem with the version of dependent packages.
| null | CC BY-SA 4.0 | null | 2022-11-22T09:40:26.483 | 2022-11-22T09:40:26.483 | null | null | 20,271,131 | null |
74,530,474 | 2 | null | 63,204,212 | 0 | null | I had a similar problem I had a command that normally takes 1 minute, but sometimes stalls and hits the 2 hour max build timeout (and corrupts my cypress installation)...
I wrapped my command with the `timeout` command and then ORd the result with `true`
eg. I changed this:
```
- yarn
```
to this:
```
- timeout 5m yarn || yarn cypress install --force || true # Sometimes this stalls, so kill it if it takes more than 5m and reinstall cypress
- timeout 5m yarn # Try again (in case it failed on previous line). Should be quick
```
| null | CC BY-SA 4.0 | null | 2022-11-22T09:44:23.970 | 2022-11-22T09:44:23.970 | null | null | 276,093 | null |
74,530,528 | 2 | null | 23,668,827 | 0 | null |
1. Right Click on your Web Page
2. Click on "Inspect"
3. on your Top Right Corner you will see three vertical dots.
4. Choose your best "Dock Side"(Your required will be,'undock into separate window') [See the arrow in the Given Screenshot] Click to view Screenshot
| null | CC BY-SA 4.0 | null | 2022-11-22T09:47:34.877 | 2022-11-29T10:43:38.673 | 2022-11-29T10:43:38.673 | 6,110,804 | 17,569,890 | null |
74,530,620 | 2 | null | 23,668,827 | 2 | null | [](https://i.stack.imgur.com/LTSXd.png)
F12 Call up the toolbar and follow the steps. so easy!
| null | CC BY-SA 4.0 | null | 2022-11-22T09:53:28.167 | 2022-11-22T09:53:28.167 | null | null | 17,325,694 | null |
74,530,900 | 2 | null | 74,530,837 | 0 | null | It looks like your function isn't called an misses the "function" prefix.
The following code works:
```
var full_star = '../assets/full_star.svg';
setStars();
function setStars(){
document.getElementById('star_1').src = full_star;
document.getElementById('star_2').src = full_star;
document.getElementById('star_3').src = full_star;
document.getElementById('star_4').src = full_star;
document.getElementById('star_5').src = full_star;
}
```
```
<div>
<span> <img id="star_1" class="star" src="../assets/empty_star.png"> </span>
<span> <img id="star_2" class="star" src="../assets/empty_star.png"> </span>
<span> <img id="star_3" class="star" src="../assets/empty_star.png"> </span>
<span> <img id="star_4" class="star" src="../assets/empty_star.png"> </span>
<span> <img id="star_5" class="star" src="../assets/empty_star.png"> </span>
</div>
```
| null | CC BY-SA 4.0 | null | 2022-11-22T10:12:11.363 | 2022-11-22T10:29:55.790 | 2022-11-22T10:29:55.790 | 6,093,936 | 6,093,936 | null |
74,530,956 | 2 | null | 73,425,036 | 0 | null | I encountered a similar, if not exactly the same issue.
I changed the encoding to UTF-8 under . After restarting the console it works!
| null | CC BY-SA 4.0 | null | 2022-11-22T10:16:41.647 | 2022-12-03T14:01:21.700 | 2022-12-03T14:01:21.700 | 5,214,691 | 5,214,691 | null |
74,531,001 | 2 | null | 74,530,837 | 0 | null | You should use IIFE Then
```
;(function () {
const full_star = '../assets/full_star.svg';
const stars = document.querySelectorAll('.star')
stars.forEach((star) => {
star.src = full_star
})
}());
```
| null | CC BY-SA 4.0 | null | 2022-11-22T10:20:36.470 | 2022-11-22T10:20:36.470 | null | null | 19,120,939 | null |
74,531,186 | 2 | null | 74,530,837 | 0 | null | ```
document.querySelectorAll('.star')
.forEach(el => el.src = '/assets/full_star.svg'');
```
| null | CC BY-SA 4.0 | null | 2022-11-22T10:33:19.960 | 2022-11-22T10:33:19.960 | null | null | 33,522 | null |
74,531,545 | 2 | null | 74,528,442 | 0 | null | First of all, Input data is an `object` not an `array` and you can iterate over the object keys with the help of [Object.keys()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys) method and then loop over it to create the options dynamically.
Live Demo
```
let stepLabelObject = {0: "0", 1: "1", 2: "2", 3: "3", 4: "4", 5: "5"};
Object.keys(stepLabelObject).forEach(key => {
var option = document.createElement("option");
option.value = key;
option.text = `Step : ${key}`;
document.getElementById('stepdropdown').appendChild(option);
});
```
```
<select id="stepdropdown" onChange="stepsDropdown()"></select>
```
| null | CC BY-SA 4.0 | null | 2022-11-22T11:01:27.200 | 2022-11-22T11:01:27.200 | null | null | 4,116,300 | null |
74,531,699 | 2 | null | 74,502,255 | 0 | null | Hmmm, a quick mockup shows expected space, knitting to HTML. Otherwise, you could use CSS to customise `div.figure > img` or `p.caption`:
```
---
title: "test.Rmd"
output: html_document
runtime: shiny
---
Text before.
{width=90%}
Text after.
```
| null | CC BY-SA 4.0 | null | 2022-11-22T11:11:41.310 | 2022-11-22T11:11:41.310 | null | null | 116,288 | null |
74,531,832 | 2 | null | 74,530,832 | 0 | null |
# Use the Power of Objects
`HashMap` is not the proper way of storing the data in this case.
Collections are containers of independent units of data, when you're trying to use a Collection in order to combine a set of properties together that's an indicator that you're misusing a collection and these correlated properties should constitute an Object.
Creating custom objects gives several advantages:
- Object provides a clear and transparant structure to the data;- Ability to use proper data types for each property;- Ability to introduce a custom behavior;- Less error-prone (with map, you can mess around with the keys).
That's how your data can be represented as a `class`:
```
public class Travel {
private String fromCountry;
private String fromCity;
private String toCountry;
private String toCity;
// constructors, getters
}
```
If you're concerned about representing the data as a string formatted in a certain way. Then you easily customize string representation of your objects, as well serialization into formats JSON.
| null | CC BY-SA 4.0 | null | 2022-11-22T11:22:09.170 | 2022-11-22T11:30:23.520 | 2022-11-22T11:30:23.520 | 17,949,945 | 17,949,945 | null |
74,531,909 | 2 | null | 74,531,297 | 0 | null | The white space came from margin parameter, margin sets a spare on outer border and padding inside.
Comment
> margin: const EdgeInsets.all(20)
Just search on google about difference between margin and padding.
Or here is another question on the same thing.
[what the difference between margin and padding in Container widget using Flutter framework?](https://stackoverflow.com/questions/67351333/what-the-difference-between-margin-and-padding-in-container-widget-using-flutter)
| null | CC BY-SA 4.0 | null | 2022-11-22T11:28:01.880 | 2022-11-22T11:30:13.243 | 2022-11-22T11:30:13.243 | 17,441,656 | 17,441,656 | null |
74,532,034 | 2 | null | 74,531,297 | 0 | null | It is coming from the margin in the second container. If you want to remove the top margin of the container, use -
> margin: const EdgeInsets.only(left: 20, right: 20, bottom: 20)
This will get you the desired output. Hope it's helpful.
| null | CC BY-SA 4.0 | null | 2022-11-22T11:38:31.293 | 2022-11-22T11:38:31.293 | null | null | 20,562,775 | null |
74,532,151 | 2 | null | 74,529,154 | 0 | null | checkout this:
```
class Test2 extends StatelessWidget {
const Test2({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: SizedBox(
height: 80,
child: Column(
children: [
SizedBox(
height: 15,
child: Row(
children: [
Expanded(
flex: 40 - withOffset(19),
child: const SizedBox(),
),
const Icon(
Icons.arrow_drop_down_rounded,
size: 30,
color: Colors.red,
),
Expanded(
flex: withOffset(19) - 11,
child: const SizedBox(),
)
],
),
),
const SizedBox(
height: 5,
),
SizedBox(
height: 40,
child: Row(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: const [
_TestContainer(
flex: 15,
color: Colors.red,
),
SizedBox(
width: 2,
),
_TestContainer(
flex: 10,
color: Colors.yellow,
),
SizedBox(
width: 2,
),
_TestContainer(
flex: 13,
color: Colors.green,
),
SizedBox(
width: 2,
),
_TestContainer(
flex: 10,
color: Colors.blue,
),
],
),
),
],
),
),
),
);
}
}
```
_TestContainer:
```
class _TestContainer extends StatelessWidget {
const _TestContainer({
Key? key,
required this.flex,
required this.color,
}) : super(key: key);
final int flex;
final Color color;
@override
Widget build(BuildContext context) {
return Expanded(
flex: flex,
child: Column(
children: [
Container(
height: 5,
decoration: BoxDecoration(
color: color,
borderRadius: BorderRadius.circular(10),
),
),
],
),
);
}
}
```
withOffset:
```
int withOffset(double bmi) {
final off = bmi;
return off.toInt();
}
```
| null | CC BY-SA 4.0 | null | 2022-11-22T11:48:47.687 | 2022-11-22T11:54:02.687 | 2022-11-22T11:54:02.687 | 14,378,940 | 14,378,940 | null |
74,532,343 | 2 | null | 74,500,055 | 1 | null | You should use `StatefulWidget` instead of `StatelessWidget` for your `HomeScreen`. Having `HomeScreen` you forced it to be redrawn on each outside event as it does not keep state.
| null | CC BY-SA 4.0 | null | 2022-11-22T12:03:30.523 | 2022-11-22T12:03:30.523 | null | null | 1,798,328 | null |
74,532,917 | 2 | null | 74,518,190 | 0 | null | I hope I understand your example well:
You could use for-loop and iterate through the items with index like the following.
```
@*Loop through all the KeyValuePairs in the Dictionary<int,string> *@
@for (int i = 1; i < orderedYearsToValue.Count(); i++)
{
<td colspan="1">
@*Select element and its value at the current index*@
<input type="text" class="radius form-control" style="background-color:transparent; border:0.1px" readonly="readonly" [email protected](i).Value>
</td>
@*If the current index is not at the last item, add an empty line *@
@if (i != orderedYearsToValue.Count()-1)
{
<td colspan="1" class="border-left border-right"></td>
}
}
@code {
private Dictionary<int, string> orderedYearsToValue;
... your code
private void OrderValues() {
orderedYearsToValue = detail.Years2Value.OrderBy(x => x.Key);
}
}
```
The empty TD is done after every region. Therefore the for-loop should be done on the top level and TD only added after region is finished, instead of the nested loop.
Simplified code (use the logic from above):
```
for (int i = 0; i < myOrderedCountries.Count(); i++)
{
if(detail != null)
{
if(isSpecialist)
{
foreach(KeyValuePair<int, string> in myOrderedYearsToValue)
{
<td colspan="1"><input type="text" ...></td>
}
}
else
{
foreach(KeyValuePair<int, string> in myOrderedYearsToValue)
{
<td colspan="1"><input type="different text" ...></td>
}
}
if(i < myOrderedCountries.Count() - 1) {
<td colspan="1" class="border-left border-right"></td>
}
}
}
```
and even nicer would be to move the if part into the nested for-loop like this:
```
for (int i = 0; i < myOrderedCountries.Count(); i++)
{
if(detail != null)
{
foreach(KeyValuePair<int, string> in myOrderedYearsToValue)
{
if(isSpecialist)
{
<td colspan="1"><input type="text" ...></td>
}
else
{
<td colspan="1"><input type="different text" ...></td>
}
if(i < myOrderedCountries.Count() - 1) {
<td colspan="1" class="border-left border-right"></td>
}
}
}
```
| null | CC BY-SA 4.0 | null | 2022-11-22T12:50:58.007 | 2022-11-23T20:57:22.657 | 2022-11-23T20:57:22.657 | 3,215,635 | 3,215,635 | null |
74,533,081 | 2 | null | 74,532,708 | 0 | null | One option to achieve your desired result would be to add an indicator variable to your data to indicate which points you want to highlight. This variable could then be mapped on the `color` attribute. The colors could then be set via the `colors` attribute.
Using a minimal reproducible example base on `mtcars`:
```
library(plotly)
data_1 <- mtcars
data_1$highlight <- row.names(data_1) %in% c("Honda Civic", "Porsche 914-2")
plot_ly() %>%
add_trace(
data = data_1, x = ~hp, y = ~mpg, color = ~highlight,
mode = "markers", type = "scatter",
marker = list(size = 8), colors = c("#d62728", "blue")
)
```
[](https://i.stack.imgur.com/o3x4k.png)
| null | CC BY-SA 4.0 | null | 2022-11-22T13:04:16.057 | 2022-11-22T13:04:16.057 | null | null | 12,993,861 | null |
74,533,254 | 2 | null | 70,210,208 | 0 | null | [https://github.com/DogusTeknoloji/compose-progress](https://github.com/DogusTeknoloji/compose-progress)
You can check this library as support animated and also step progress. The library base on canvas
| null | CC BY-SA 4.0 | null | 2022-11-22T13:16:23.093 | 2022-11-22T13:16:23.093 | null | null | 244,611 | null |
74,533,274 | 2 | null | 74,532,708 | 0 | null | One of the easiest ways is to create a variable to identify that specific point. I created sample data here and assigned a colour variable equal to 1 for the point I want in another color.
```
df = tibble(bp = round(rnorm(10,5,2),2),
log = round(rnorm(10,6,1.5),2))
df$colour <- as.factor(ifelse(df$bp == 4.41,1 ,0))
fig <- plot_ly(data = df, x = ~bp, y = ~log, group_by = ~colour,marker = list(color = factor(df$colour,labels=c("red","purple")))) %>%
add_trace(data = df, x = ~bp, y = ~log, mode = 'markers', type = 'scatter')
fig
```
[Link to plot produced by this code](https://i.stack.imgur.com/7guSP.jpg)
| null | CC BY-SA 4.0 | null | 2022-11-22T13:17:51.243 | 2022-11-22T13:19:18.997 | 2022-11-22T13:19:18.997 | 20,420,175 | 20,420,175 | null |
74,533,314 | 2 | null | 56,600,588 | -2 | null | It is because of value reference, of x to be manipulated in future makes json.parse work incorectly. Try creating reference variable.
| null | CC BY-SA 4.0 | null | 2022-11-22T13:20:55.613 | 2022-11-22T13:20:55.613 | null | null | 16,375,636 | null |
74,533,978 | 2 | null | 51,898,783 | 0 | null | If you want to write (Hindi) in then go through this GitHub [link](https://github.com/GussailRaat/Devanagari-Hindi-Language-in-pdfLatex).
मै तुमसे बहुत प्यार करता हूँ।
{\dn m\4 \7{t}ms? b\7{h}t =yAr krtA \8{h}\1. }
| null | CC BY-SA 4.0 | null | 2022-11-22T14:09:37.417 | 2022-11-22T14:09:37.417 | null | null | 6,614,626 | null |
74,534,037 | 2 | null | 74,518,190 | 1 | null | Here is the sample code
```
int i = 1;
@foreach (KeyValuePair<int, string> pair in detail.Years2Value.OrderBy(x => x.Key))
{
<td colspan="1"><input type="text" class="radius form-control" style="background-color:transparent; border:0.1px" readonly="readonly" [email protected]></td>
if(i < detail.Years2Value.Count)
{
<td colspan="1" class="border-left border-right"></td>
}
i++;
}
```
| null | CC BY-SA 4.0 | null | 2022-11-22T14:13:12.803 | 2022-11-22T14:13:12.803 | null | null | 20,552,709 | null |
74,534,169 | 2 | null | 22,154,683 | 0 | null | As per [https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-powershell-1.0/ff730952(v=technet.10)?redirectedfrom=MSDN](https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-powershell-1.0/ff730952(v=technet.10)?redirectedfrom=MSDN)
The icon must be 16 pixels high by 16 pixels wide.
```
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
$objNotifyIcon = New-Object System.Windows.Forms.NotifyIcon
$objNotifyIcon.Icon = "C:\Scripts\Forms\Folder.ico"
$objNotifyIcon.BalloonTipIcon = "Error" #optional
$objNotifyIcon.BalloonTipText = "A file needed to complete the operation could not be found." #optional
$objNotifyIcon.BalloonTipTitle = "File Not Found" #optional
$objNotifyIcon.Visible = $True
$objNotifyIcon.ShowBalloonTip(10000) #optional
```
| null | CC BY-SA 4.0 | null | 2022-11-22T14:22:18.017 | 2022-11-22T14:22:18.017 | null | null | 3,996,028 | null |
74,534,735 | 2 | null | 74,534,341 | 0 | null | First define new variable out of build method like this:
```
int selectedTap = 0;
```
then change your `_tab` to this:
```
Widget _tab(String text, int index) {
return Container(
height: 16,
padding: const EdgeInsets.all(0),
width: double.infinity,
decoration: BoxDecoration(
border: index == selectedTap
? null
: Border(
right: BorderSide(
color: Color(0xFF454545),
width: 1,
style: BorderStyle.solid),
)),
child: Tab(
text: text,
),
);
}
```
and use it like this:
```
TabBar(
indicatorPadding: EdgeInsets.symmetric(vertical: 10),
indicator: ShapeDecoration(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(5)),
side: BorderSide(color: Colors.white)),
color: Color(0xFF1C1B20),
),
labelColor: AppColors.whiteE3EAF6,
labelStyle: TextStyle(color: Colors.white),
labelPadding: const EdgeInsets.all(0),
tabs: [
_tab("1M", 0),
_tab("5M", 1),
_tab("15M", 2),
_tab("30M", 3),
Tab(text: "1H",),
],
onTap: (index) {
setState(() {
selectedTap = index;
});
},
)
```
[](https://i.stack.imgur.com/4Cydx.png)
| null | CC BY-SA 4.0 | null | 2022-11-22T15:02:57.597 | 2022-11-22T15:11:48.920 | 2022-11-22T15:11:48.920 | 10,306,997 | 10,306,997 | null |
74,534,743 | 2 | null | 69,845,686 | 1 | null | This is a false positive of PyCharms warning heuristics. As per the Python specification, the code behaves as you describe and `result` can only be reached when set.
---
According to 8.4 in the [Python documentation](https://docs.python.org/3.10/reference/compound_stmts.html):
> If the finally clause executes a return, break or continue statement, the saved exception is discarded:
```
>>> def f():
... try:
... 1/0
... finally:
... return 42
...
>>> f()
42
```
The Python interpreter will ignore the exception that was caused by `calculate()` if the `finally` block contains a `return`, `break`, or `continue` statement.
This means that with the implementation you provided, where the `finally` block has neither of the words specified above, the exception caused by `calculate` won't be discarded, so the `result` variable won't be referenced, meaning that this warning is useless.
| null | CC BY-SA 4.0 | null | 2022-11-22T15:03:25.103 | 2022-11-24T06:25:14.600 | 2022-11-24T06:25:14.600 | 5,349,916 | 18,877,953 | null |
74,534,990 | 2 | null | 62,152,057 | 0 | null | So the issue for me, was that my text was a component of canvas.
When I put it as an object in the scene, it rendered.
| null | CC BY-SA 4.0 | null | 2022-11-22T15:19:55.577 | 2022-11-22T15:19:55.577 | null | null | 3,623,413 | null |
74,535,659 | 2 | null | 20,018,609 | 0 | null | The shortest solution is following ...
```
Sub Add()
While dr.Read()
txtname.Text = dr(0) & ""
txtfathername.Text = dr(1) & ""
txtaddress.Text = dr(2) & ""
txtemail.Text = dr(3) & ""
End While
End Sub
```
This solution works also with column name !
```
Sub Add()
While dr.Read()
txtname.Text = dr("name") & ""
txtfathername.Text = dr("father_name") & ""
txtaddress.Text = dr("address") & ""
txtemail.Text = dr("email") & ""
End While
End Sub
```
When `dr("colum_name")` is DBNULL, `.Text` value is an empty string.
When column type is an integer, you can also initialize `.Text` property with "0" String.
```
txtNrChildren.Text = CStr(dr("nr_children") + "0")
```
| null | CC BY-SA 4.0 | null | 2022-11-22T16:05:25.797 | 2022-11-22T16:05:25.797 | null | null | 948,359 | null |
74,535,781 | 2 | null | 74,535,272 | 0 | null |
1. Don't use the ga debug extension. It's outdated. Use Adswerve datalayer inspector. Pay attention to the last update date when installing extensions.
2. Double check the number of your events in the network tab to make sure they're really duplicating.
3. Show the screenshot of your dataLayer, check it for duplicates.
4. Don't implement analytics through gtag.js. Use GTM. Reasons? Maintainability, scalability, manageability, abstraction of completely unneeded complexity and awkward architecture of the gtag's api.
| null | CC BY-SA 4.0 | null | 2022-11-22T16:13:53.230 | 2022-11-22T16:13:53.230 | null | null | 3,700,993 | null |
74,535,914 | 2 | null | 74,535,600 | 0 | null | Return a List instead of an array. That lets you simplify the code in several places:
```
public async Task<List<string>> GetText(string link)
{
string htmlSource = await httpClient.GetStringAsync(link);
var result = new List<string>();
page = new HtmlDocument();
page.LoadHtml(htmlSource);
var results = page.DocumentNode.Descendants().
Where(n =>
n.NodeType == HtmlNodeType.Text &&
n.ParentNode.Name != "script" &&
n.ParentNode.Name != "style"
).Select(n => n.InnerText.ToLower());
return results.ToList();
}
```
Before the advent of async/await, I would instead advocate using IEnumerable, but the async story here isn't as nice yet (ie: the below code won't work as expected) and IAsyncEnumerable has some rough edges:
```
public async Task<IEnumerable<string>> GetText(string link)
{
string htmlSource = await httpClient.GetStringAsync(link);
page = new HtmlDocument();
page.LoadHtml(htmlSource);
return page.DocumentNode.Descendants().
Where(n =>
n.NodeType == HtmlNodeType.Text &&
n.ParentNode.Name != "script" &&
n.ParentNode.Name != "style"
).Select(n => n.InnerText.ToLower());
}
```
But I still think it's worth keeping an eye on this. There's another big level of performance to be gained when the async world also learns how to avoid needing to load the whole set in memory.
| null | CC BY-SA 4.0 | null | 2022-11-22T16:23:08.573 | 2022-11-22T18:11:20.870 | 2022-11-22T18:11:20.870 | 3,043 | 3,043 | null |
74,536,368 | 2 | null | 74,536,205 | 1 | null | File objects cannot be stringified to JSON. You need to append them directly to your `FormData` object.
You probably should forget about involving JSON entirely and then do something along the lines of:
```
const datos = new FormData();
warranties.forEach((warranty, index) => {
Object.entries(warranty).forEach(([key, value]) => {
datos.append(`data[${index}][${key}]`, value);
});
});
```
Then the files will appear in `$_FILES` and the rest of the data in `$_POST`.
| null | CC BY-SA 4.0 | null | 2022-11-22T16:56:24.630 | 2022-11-22T17:04:46.807 | 2022-11-22T17:04:46.807 | 19,068 | 19,068 | null |
74,536,567 | 2 | null | 74,535,744 | 0 | null | Are you sure you're listening to the correct path in the database? Your code attaches a listener to:
```
DatabaseReference infoRef = AppDataHelper.GetDatabase().GetReference("packageinfo");
```
But your screenshot shows a node named `eventpackage` under the root.
| null | CC BY-SA 4.0 | null | 2022-11-22T17:11:00.093 | 2022-11-22T17:11:00.093 | null | null | 209,103 | null |
74,536,935 | 2 | null | 15,827,763 | 0 | null | If you are following the Agile Web Development With Rails book then there is no problem with the html.erb code. The only issue lies in the scss file. Please check if you have set the td.image display to none! Change display to block and you will see the images.
| null | CC BY-SA 4.0 | null | 2022-11-22T17:40:40.700 | 2022-11-22T17:43:23.730 | 2022-11-22T17:43:23.730 | 9,167,436 | 9,167,436 | null |
74,537,304 | 2 | null | 74,504,933 | 0 | null | I solved this problem changing som dependencies:
```
yarn add [email protected]
npx react-native start --reset-cache
npm install [email protected]
npm audit fix --force
yarn add react-native-dialog
```
downgrade expo to 45.0.6
And others dependencies
Now my package.json is:
```
{
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject"
},
"dependencies": {
"@babel/plugin-transform-runtime": "^7.14.5",
"@callstack/react-theme-provider": "^3.0.8",
"@expo/vector-icons": "^13.0.0",
"@expo/webpack-config": "^0.17.3",
"@react-native-aria/utils": "^0.2.7",
"@react-native-community/datetimepicker": "6.1.2",
"@react-native-community/masked-view": "^0.1.10",
"@react-native-toolkit/triangle": "^0.0.1",
"@react-navigation/bottom-tabs": "^6.2.0",
"@react-navigation/drawer": "~5.10.0",
"@react-navigation/native": "6.0.13",
"@react-navigation/native-stack": "^6.9.0",
"@react-navigation/stack": "^5.10.0",
"@react-query-firebase/auth": "^1.0.0-dev.2",
"@stream-io/flat-list-mvcp": "^0.10.1",
"base-64": "^1.0.0",
"eas-cli": "^2.7.1",
"expo": "45.0.6",
"expo-ads-admob": "~13.0.0",
"expo-asset": "~8.5.0",
"expo-auth-session": "~3.6.1",
"expo-av": "~11.2.3",
"expo-camera": "~12.2.0",
"expo-constants": "~13.1.1",
"expo-dev-client": "~1.0.1",
"expo-facebook": "~12.2.0",
"expo-image-picker": "~13.1.1",
"expo-location": "~14.2.2",
"expo-media-library": "~14.1.0",
"expo-permissions": "~13.2.0",
"expo-random": "~12.2.0",
"firebase": "^9.6.11",
"firesql": "~2.0.2",
"idb": "^7.0.2",
"lodash": "^4.17.21",
"material-ui": "^0.20.2",
"mathjs": "^11.4.0",
"native-base": "^3.4.22",
"node": "^16.18.1",
"pkg": "^5.8.0",
"prop-types": "^15.8.1",
"proptypes": "^1.1.0",
"random-uuid-v4": "^0.0.9",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-error-boundary": "^3.1.3",
"react-native": "0.68.2",
"react-native-action-button": "^2.8.5",
"react-native-audio": "^4.3.0",
"react-native-aws3": "^0.0.9",
"react-native-bidirectional-infinite-scroll": "^0.3.3",
"react-native-camera": "^4.2.1",
"react-native-dialog": "^9.3.0",
"react-native-easy-toast": "^2.0.0",
"react-native-elements": "~1.2.7",
"react-native-fbsdk-next": "^11.1.0",
"react-native-gesture-handler": "~2.2.1",
"react-native-gifted-chat": "^1.0.4",
"react-native-google-mobile-ads": "^8.1.0",
"react-native-image-crop-picker": "^0.38.1",
"react-native-image-picker": "^4.0.6",
"react-native-keyboard-aware-scroll-view": "^0.9.4",
"react-native-mapbox-gl": "^5.2.1-deprecated",
"react-native-maps": "0.30.2",
"react-native-menu-list": "^1.0.1",
"react-native-navbar": "^2.1.0",
"react-native-open-maps": "~0.4.0",
"react-native-paper": "^4.12.5",
"react-native-reanimated": "~2.8.0",
"react-native-router-flux": "^4.3.1",
"react-native-safe-area-context": "4.2.4",
"react-native-screens": "~3.11.1",
"react-native-snap-carousel": "~3.9.0",
"react-native-sound": "^0.11.0",
"react-native-swiper": "^1.6.0",
"react-native-switch-selector": "^2.1.4",
"react-native-video": "^5.2.1",
"react-native-web": "0.17.7",
"react-navigation": "^4.4.4",
"react-player": "^2.11.0",
"react-scripts": "^5.0.1",
"smartsocket": "^1.1.22",
"styled-components": "^5.3.0",
"use-debounce": "^3.4.2"
},
"devDependencies": {
"@babel/core": "^7.12.9",
"@types/node": "^18.11.9",
"babel-preset-expo": "~9.2.2",
"check-dependencies": "^1.1.0"
},
"private": true
}
```
| null | CC BY-SA 4.0 | null | 2022-11-22T18:12:23.443 | 2022-11-22T18:12:23.443 | null | null | 16,421,641 | null |
74,537,441 | 2 | null | 74,512,738 | 0 | null | I tried just_audio package but it didn't work. I tried audioplayers package again but in another application. Then the application launched but I found another issue that the file doesn't work. here is the codes and errors:
[](https://i.stack.imgur.com/AO9pL.png)
[](https://i.stack.imgur.com/7wKYI.png)
[](https://i.stack.imgur.com/6JYfa.png)
[](https://i.stack.imgur.com/Lo6tT.png)
[](https://i.stack.imgur.com/JEb2f.png)
| null | CC BY-SA 4.0 | null | 2022-11-22T18:26:56.010 | 2022-11-22T18:26:56.010 | null | null | 20,558,088 | null |
74,537,608 | 2 | null | 74,527,967 | -1 | null | I just downloaded latest version of Mongo Compass, and I had the exact same error. My solution was to download de MSI installer instead of the .exe

| null | CC BY-SA 4.0 | null | 2022-11-22T18:41:52.280 | 2022-11-26T12:33:57.570 | 2022-11-26T12:33:57.570 | 466,862 | 5,116,891 | null |
74,537,777 | 2 | null | 24,863,164 | 1 | null | Try GO plugin for Tracy. Tracy is "A real time, nanosecond resolution, remote telemetry" (...).
GoTracy (name of the plugin) is the agent with connect with the Tracy and send necessary information to better understand your app process. After importing plugin You can put telemetry code like in description below:
```
func exampleFunction() {
gotracy.TracyInit()
gotracy.TracySetThreadName("exampleFunction")
for i := 0.0; i < math.Pi; i += 0.1 {
zoneid := gotracy.TracyZoneBegin("Calculating Sin(x) Zone", 0xF0F0F0)
gotracy.TracyFrameMarkStart("Calculating sin(x)")
sin := math.Sin(i)
gotracy.TracyFrameMarkEnd("Calculating sin(x)")
gotracy.TracyMessageLC("Sin(x) = "+strconv.FormatFloat(sin, 'E', -1, 64), 0xFF0F0F)
gotracy.TracyPlotDouble("sin(x)", sin)
gotracy.TracyZoneEnd(zoneid)
gotracy.TracyFrameMark()
}
}
```
The result of is similar to:
[](https://i.stack.imgur.com/VaSyW.png)
The plugin is placed in:
[https://github.com/grzesl/gotracy](https://github.com/grzesl/gotracy)
The Tracy is placed in:
[https://github.com/wolfpld/tracy](https://github.com/wolfpld/tracy)
| null | CC BY-SA 4.0 | null | 2022-11-22T19:01:25.623 | 2022-11-22T19:01:25.623 | null | null | 5,173,085 | null |
74,537,818 | 2 | null | 74,537,408 | 0 | null | On the Formulas tab, there is a button, Show formulas. You can toggle the formulas with that.
| null | CC BY-SA 4.0 | null | 2022-11-22T19:06:01.593 | 2022-11-22T19:06:01.593 | null | null | 3,246,362 | null |
74,538,288 | 2 | null | 14,242,227 | 0 | null | In BS 5.2.2, I got it to work by using the view-height (in-line style). H-100 didn't work.
```
<div class="modal-body" style="height:100vh">
Body Here
</div>
```
| null | CC BY-SA 4.0 | null | 2022-11-22T19:57:26.980 | 2022-11-22T19:57:26.980 | null | null | 5,128,440 | null |
74,538,315 | 2 | null | 74,538,092 | 0 | null | It's happening because the stuff above the buttons have different heights. You can fix this by putting those items in their own div and giving that div a height.
```
<div>
<div class="card">
<div class="card-header-row">
<img class="thumb" width="300" height="300" src="/Pages/games/wpnfire/wpnfire.jpg" alt="#" />
<h1 style="color: white;">Text</h1>
<p class="desc">Text</p>
<div style="margin: 24px 0;"> <i class="fa-solid fa-keyboard"></i> </div>
</div>
<a class="game" href="/Pages/games/wpnfire/">Press to play</a>
</div>
</div>
```
```
.card-header-row: {
height: '120px';
}
```
| null | CC BY-SA 4.0 | null | 2022-11-22T19:59:39.433 | 2022-11-22T19:59:39.433 | null | null | 12,817,213 | null |
74,538,608 | 2 | null | 74,537,206 | 0 | null | It looks like you've named both functions openWin(). When you click the button it's finding the the top function and never makes it to the second one since it thinks it found what it was looking for. JS runs from top to bottom in order so as soon as it finds the first function it will stop.
You need to change one of the function names when you declare it, such as openWin() and openWin2().
I would also recommend that you move all of your JS code to a single `<script>` tag in order to avoid errors in the future.
| null | CC BY-SA 4.0 | null | 2022-11-22T20:29:54.370 | 2022-11-22T20:29:54.370 | null | null | 16,096,837 | null |
74,538,829 | 2 | null | 74,538,266 | 0 | null | You can use `stringr::str_sub()` to remove the last 3 digits and then ensure a match to your list of accepted start values (e.g. 1-10).
```
library(tidyverse)
d <- structure(list(Kennziffer = c(1001L, 1002L, 1003L, 1004L, 1051L, 1053L, 1054L, 1055L, 1056L, 1057L, 1058L, 1059L), Raumeinheit = c("Flensburg. Stadt", "Kiel. Stadt", "Lübeck. Stadt", "Neumünster. Stadt", "Dithmarschen", "Herzogtum Lauenburg", "Nordfriesland", "Ostholstein", "Pinneberg", "Plön", "Rendsburg-Eckernförde", "Schleswig-Flensburg"), Aggregat = c("kreisfreie Stadt", "kreisfreie Stadt", "kreisfreie Stadt", "kreisfreie Stadt", "Landkreis", "Landkreis", "Landkreis", "Landkreis", "Landkreis", "Landkreis", "Landkreis", "Landkreis"), Langzeitarbeitslose = c(30.58, 36.47, 34.28, 35.49, 28.1, 33.43, 37.16, 30.58, 27.15, 27.38, 27.48, 30.12)), class = "data.frame", row.names = c("1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"))
# create list of "first two digits" you want to match
digits2keep <- as.character(1:10)
# extract first 2 digits and filter to matches
d %>%
mutate(start_digits = str_sub(Kennziffer, 1, nchar(Kennziffer) - 3)) %>%
filter(start_digits %in% digits2keep)
#> Kennziffer Raumeinheit Aggregat Langzeitarbeitslose
#> 1 1001 Flensburg. Stadt kreisfreie Stadt 30.58
#> 2 1002 Kiel. Stadt kreisfreie Stadt 36.47
#> 3 1003 Lübeck. Stadt kreisfreie Stadt 34.28
#> 4 1004 Neumünster. Stadt kreisfreie Stadt 35.49
#> 5 1051 Dithmarschen Landkreis 28.10
#> 6 1053 Herzogtum Lauenburg Landkreis 33.43
#> 7 1054 Nordfriesland Landkreis 37.16
#> 8 1055 Ostholstein Landkreis 30.58
#> 9 1056 Pinneberg Landkreis 27.15
#> 10 1057 Plön Landkreis 27.38
#> 11 1058 Rendsburg-Eckernförde Landkreis 27.48
#> 12 1059 Schleswig-Flensburg Landkreis 30.12
#> start_digits
#> 1 1
#> 2 1
#> 3 1
#> 4 1
#> 5 1
#> 6 1
#> 7 1
#> 8 1
#> 9 1
#> 10 1
#> 11 1
#> 12 1
```
[reprex v2.0.2](https://reprex.tidyverse.org)
Although this seems unnecessarily complicated. Since `Kennziffer` is already numeric I can't see why `d %>% filter(Kennziffer < 11000)` wouldn't work.
| null | CC BY-SA 4.0 | null | 2022-11-22T20:52:17.057 | 2022-11-22T20:52:17.057 | null | null | 13,210,554 | null |
74,539,002 | 2 | null | 30,207,467 | 2 | null | I used thie code. It's from Basel Face model(BFM), you can find matlab code from their web sites
```
def draw_axis(img, yaw, pitch, roll, tdx=None, tdy=None, size = 100):
pitch = pitch * np.pi / 180
yaw = -(yaw * np.pi / 180)
roll = roll * np.pi / 180
if tdx != None and tdy != None:
tdx = tdx
tdy = tdy
else:
height, width = img.shape[:2]
tdx = width / 2
tdy = height / 2
# X-Axis pointing to right. drawn in red
x1 = size * (math.cos(yaw) * math.cos(roll)) + tdx
y1 = size * (math.cos(pitch) * math.sin(roll) + math.cos(roll) * math.sin(pitch) * math.sin(yaw)) + tdy
# Y-Axis | drawn in green
# v
x2 = size * (-math.cos(yaw) * math.sin(roll)) + tdx
y2 = size * (math.cos(pitch) * math.cos(roll) - math.sin(pitch) * math.sin(yaw) * math.sin(roll)) + tdy
# Z-Axis (out of the screen) drawn in blue
x3 = size * (math.sin(yaw)) + tdx
y3 = size * (-math.cos(yaw) * math.sin(pitch)) + tdy
cv2.line(img, (int(tdx), int(tdy)), (int(x1),int(y1)),(0,0,255),3)
cv2.line(img, (int(tdx), int(tdy)), (int(x2),int(y2)),(0,255,0),3)
cv2.line(img, (int(tdx), int(tdy)), (int(x3),int(y3)),(255,0,0),3)
return img
```
| null | CC BY-SA 4.0 | null | 2022-11-22T21:11:55.530 | 2022-11-22T21:11:55.530 | null | null | 10,943,291 | null |
74,539,072 | 2 | null | 73,251,983 | 0 | null | You can do it by adding an onKeyDown prop to the filterPanel section of the component props
```
const apiRef = useGridApiRef()
return(
<DataGrid
apiRef={apiRef}
rows={rowsData}
columns={myColumns}
componentProps={{
filterPanel: {
onKeyDown: (event) => {
if (event.key === 'Escape') {
apiRef.current.hideFilterPanel()
}
}
}
}}
/>
)
```
| null | CC BY-SA 4.0 | null | 2022-11-22T21:19:56.327 | 2022-11-22T21:19:56.327 | null | null | 6,609,145 | null |
74,539,076 | 2 | null | 70,898,572 | 0 | null | Chart.js [docs](https://www.chartjs.org/docs/latest/general/padding.html) state following
```
let chart = new Chart(ctx, {
type: 'line',
data: data,
options: {
layout: {
padding: {
right: 50
}
}
}
});
```
| null | CC BY-SA 4.0 | null | 2022-11-22T21:20:03.093 | 2022-11-22T21:20:03.093 | null | null | 12,229,187 | null |
74,539,163 | 2 | null | 38,872,954 | 0 | null | Here's the answer, and it reeks of poor quality of android studio.
goto MainActivity.java right at the top
package com.mypackage.appname;
temporarily cut the package name line and build. it will fail but that's alright because then you paste it back in and rebuild.
the .mainactivity red under line in the manifest will go away.
| null | CC BY-SA 4.0 | null | 2022-11-22T21:28:27.100 | 2022-11-22T21:28:27.100 | null | null | 5,551,975 | null |
74,539,773 | 2 | null | 74,524,895 | 2 | null | In the linker script, you can assign a start address for each of your named sections. Use the ". =" syntax to do that, effectively setting the location counter manually:
```
MEMORY
{
ROM(rx) : ORIGIN = 0x00000, LENGTH = 512K
}
SECTIONS
{
. = 0
.MyVectors :
{
KEEP(*(.MyVectors))
} > ROM = 0xFF
. = 0x100
.MyBootloader :
. = 0x10000
...
```
}
| null | CC BY-SA 4.0 | null | 2022-11-22T22:36:34.870 | 2022-11-22T22:36:34.870 | null | null | 5,785,362 | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.