Skip to main content
Filter by
Sorted by
Tagged with
5 votes
0 answers
265 views

In this earlier SO question: What is a smart pointer and when should I use one? Ten years ago, I gave a relative simple answer and got a bunch of upvotes. One paragraph in my answer reads: Use std::...
einpoklum's user avatar
  • 139k
1 vote
1 answer
133 views

The title pretty much says it all. So far I've tried Fast-Quadratic-Mesh-Simplification, but as the documentation on the original c implementation says, it only preserves watertightness if there are ...
Богдан Станков's user avatar
1 vote
1 answer
100 views

I'm trying to solve a cubic with a parameter r, for x. The cubic is the awful expression poly = b*(-(10 + x)*b - 10*b) - ((8/3) + x)*((10+x)*(1+x) - 10) where b = sp.sqrt((8/3)*(1 - a)) which ...
null_set's user avatar
0 votes
2 answers
139 views

This Python script: from shapely import simplify, points, contains, Point circle = Point(0, 0).buffer(1.0, quad_segs=8).exterior simple = simplify(circle, 0.1) simplifies polygon circle (red) and ...
Paul Jurczak's user avatar
  • 8,744
0 votes
2 answers
105 views

I have the following sympy expression >>> a ⎛2⋅π⋅(x - y)⎞ 2 - 2⋅cos ─────────── ⎝ P ⎠ which I would like to simplify to 2 ⎛π⋅(x - y)⎞ 4⋅sin ───────── ...
joaoFaria's user avatar
  • 125
2 votes
3 answers
664 views

I have a polygon shapefile which was vectorized from a raster layer (second image). This shapefile contains thousands of features with just one column which represent polygon level (ranging 1-5). The ...
Naama's user avatar
  • 63
1 vote
3 answers
131 views

I need to match 20 numbers in a string as follows,and then do a text replacement: 0.61 -0.60 0.06 0.46 1.07 0. 0.47 0.07 0.61 -176. 1.53 1.15 -176 176 ...
MasterLu's user avatar
  • 103
0 votes
0 answers
72 views

The following code unexpectedly simplifies f(1)=xf(0) to f(1)=0. Is it because undefined functions are not to be used without further assumptions? Running this should not change the expression, but it ...
Mikolas's user avatar
  • 121
0 votes
2 answers
69 views

I am looking to simplify the following: > model$coefficients (Intercept) x1 x2 c -1.51730659 0.28487690 0.10034603 0.08629699 b0_i = model$coefficients[1] ...
CTR's user avatar
  • 1
0 votes
0 answers
97 views

I am self-taught in R and would like to improve my coding skills. My codes often contain repetitive commands and produce many individual results. I also often find it difficult to combine them into a ...
Sas's user avatar
  • 73
-6 votes
5 answers
732 views

Powershell can add custom properties with somewhat messy syntax, as described in the about_Calculated_Properties help topic; e.g.: Get-Date | Select-Object Year, @{name='foo'; expression={123}} Year ...
Ted Shaneyfelt's user avatar
1 vote
0 answers
59 views

Is there a way to collect derivatives w.r.t. the same symbol in a sum? There are several questions that go around this point, but I haven't found an answer for the simple situation: from sympy import *...
JuanPi's user avatar
  • 801
0 votes
1 answer
53 views

I have the following code: update tble set offer_id_02 = offer_id_03, offer_id_03 = offer_id_04, offer_id_04 = offer_id_05, offer_id_05 = offer_id_06, offer_id_06 = offer_id_07, offer_id_07 = ...
Michael Norman's user avatar
0 votes
2 answers
340 views

I not understand how the first Boolean expression on the question can be simplified into the last. Please help me. My attempt: 1. (xy)' + (yz) 2. (x' + y') + (yz) # Using de Morgan's law. 3. x' + (y' +...
Alix Blaine's user avatar
0 votes
1 answer
43 views

I have a string W := lx1sx1ph11alpha1ph12beta2-lx1sx1ph12alpha2ph11beta1+lx2sx2ph11alpha1ph12beta2-lx2sx2ph12alpha2ph11beta1 I want use the simlify with the condition to remove sx1 and sx2: Right := ...
Rashid Valiev's user avatar
0 votes
2 answers
63 views

I have working code that changes my HTML and arranges classes and data from highest to lowest, but it is very lengthy. I would like to make it shorter. I recently learned JavaScript this week, so it ...
user23520479's user avatar
0 votes
1 answer
100 views

I am using Unyt module for python and found unexpected, resp. "unintuitive" results. In simple code I tried to brake down problem. What I am trying to achieve: a = 23\*kN/m b = N/m c = a/b ...
Robert's user avatar
  • 1
0 votes
1 answer
92 views

I am simplifying and summarizing my data so that I can run an ANOVA on it so I want to compress the rows in one column into less rows. I feel like it only makes sense looking at the data so, this is a ...
Kay's user avatar
  • 3
2 votes
1 answer
54 views

My code is : N = 500; % D_1=ones(N,N);% D_2=ones(N,N);% For simplicity. B=zeros(N,N); for i = 1:N for j = i+1:N basis_vector = zeros(N, 1); basis_vector(i) = 1; ...
Jie zhou's user avatar
-1 votes
1 answer
106 views

if( auto id:{k_b0,k_b1}){ auto baseIndex = 0; auto count = false; if(!rmt){ switch(src){ case a: {if(slow) {count = Getconfig(); baseindex =0;} else {count = GetslowConfig(); baseindex =4;}}...
Zazy's user avatar
  • 87
2 votes
1 answer
146 views

I have a CGAL 2D Arrangement, and I would like to simplify each sequence of egdes separated by degree-2 vertices using CGAL::simplify. Is there a simple way to do that, or do I have to do something ...
Clement's user avatar
  • 35
0 votes
0 answers
44 views

Good day! I'm trying to write a python script that can model the temperature of a space. I've chosen an 11x11 matrix to represent this space, the edges are 20 degrees, and the centre is 3000 degrees. ...
SollyPolly's user avatar
-2 votes
1 answer
223 views

I am currently trying to learn how to simplify logical expressions. But I'm stuck on this problem where I have to simplify this expression using the laws of logic (Boolean algebra).I would like some ...
Listochek's user avatar
0 votes
1 answer
82 views

I am using this bit of javascript code to create a string with css variables in it. It helps me to specifically set a size for each breakpoint on a webpage. This is my code: const sizes = { xs: 0.9, ...
Jonas Q.'s user avatar
-1 votes
1 answer
44 views

So I want to simplify this Code by moving it for (let i = 0; i <= 15; i++) { const generationId: number = shuffeledIdArray[i]; cards.push({ element: ( <Card ...
TheKamek's user avatar
0 votes
0 answers
73 views

I have code which a user will select different perameters from 5 dropdown menus, these can be: "None", 'Name', 'Manager', 'AccessLevel', 'Inhabitant' and 'Location' these will be matched ...
Thomas Humphreys's user avatar
0 votes
0 answers
38 views

I have a useful commented codes in every classes as below which are used for future references .Is there is any alternative way to effectively maintain commented codes in difference class and can be ...
jansy's user avatar
  • 27
0 votes
1 answer
88 views

My question is exactly like the title of my post. Attached is an image with an example of what I would like to achieve. Description of problem I have updated this file after the original post and ...
Data Lark's user avatar
1 vote
0 answers
79 views

I am working on testing whether a function lies in a given range. Somehow, the function Simplify does not provide the correct (obvious) answer. Why is that ? The main function corresponds to the ...
T.A.'s user avatar
  • 41
3 votes
2 answers
156 views

I need to create 10 functions that are very long and identical in every way except for a single line of code in each function. This single line of code is a function call. Is there a way to condense ...
quant's user avatar
  • 47
4 votes
1 answer
139 views

I have a huge expression, something like this: x49 + t49 + FUNC1(y49 + z49 + FUNC1(w49 + h49 + FUNC1(v49) + RET(v49, t49, z49) + movr[50] + m1[50]) + RET(w49 + h49 + FUNC1(v49) + RET(v49, t49, z49) + ...
HabibS's user avatar
  • 382
0 votes
2 answers
51 views

I do not understand why the two methods written below perform differently. Any insights into why the simplified statement in xyz_there() fails for this test case would be appreciated! str = "...
Pat Loranger's user avatar
-2 votes
1 answer
83 views

I would to know how to simplify theses function calls by chaining them. Is there a way to chain forEach, push, destructuring array and map. let selectorsForLoader = ['a', 'b']; let loadingElements = ...
Dotista's user avatar
  • 451
0 votes
2 answers
278 views

Is there a simpler way of writing this Rust code? For full context, see this PR. impl FromArgValue for FlakeRef { fn from_arg_value(s: &str) -> std::result::Result<FlakeRef, String> { ...
Sridhar Ratnakumar's user avatar
0 votes
1 answer
66 views

I'm trying to use Simplify Modifator, but every time I upload my .glb file I've tried dozens of them, I've also tried different models directly from the examples in three.js, and none of them work ...
Radim Holub's user avatar
1 vote
1 answer
130 views

Currently I have my codes working. However, my [ngClass] conditions are very bulky. Having it repeated in many components in the html makes it difficult to maintain if any change is needed and makes ...
Minim's user avatar
  • 13
-2 votes
3 answers
211 views

This is what I have: class Vector3 { private: float x; float y; float z; public: Vector3(float x = 0, float y = 0, float z = 0) { this->x = x; ...
Gabriel Fernández's user avatar
1 vote
1 answer
139 views

I need to simplify Admin 0 – Details > map units 10m NaturalEarthData ( file ). It is 25mb and I would like to get it down to around 1mb or less. This should be easy because the 110m near-...
Eric G's user avatar
  • 816
0 votes
1 answer
155 views

how can I use Maple to simplify sum ( sin(n*t) / n, n=1..infinity) to (Pi-t)/2 for 0 < t < 2*Pi ? Thanks for your help Pavel I tried assume (0 < t and t < 2*Pi): s := sum ( sin(n*t)/n, n=1....
Pavel's user avatar
  • 29
0 votes
2 answers
104 views

I've an expression that after simplify method looks like this: 5*y**3/2 I would like to see expression in this view: (5/2) * y ** 3 but I have no idea how to do this. Thanks in advance.
Davidebe's user avatar
1 vote
2 answers
931 views

I am currently working on a class project to build the game Battleship in Python. Another user here graciously helped me understand the coding for my board, and now I have come to the step to ...
Ros's user avatar
  • 35
-1 votes
1 answer
93 views

if p11 == "+": loc = 11 elif p12 == "+": loc = 12 elif p13 == "+": loc = 13 elif p14 == "+": loc = 14 elif p15 == "+": loc = 15 I ...
w1ndnd's user avatar
  • 47
0 votes
1 answer
105 views

In graphics programming I often deal with values in the 0-1 range and perform various mathematical operations on them, one being raising values to a power to achieve an exponential effect: Math.pow(0....
rebane2001's user avatar
0 votes
1 answer
187 views

enter image description here I am wondering if there is an easier way to do exactly this. I often have code that is theoretically useful for later if I run into a problem, but currently do not want it ...
Maxwell Klein's user avatar
0 votes
1 answer
174 views

I have a linear equation in two variables that I am simplifying using simplify from sympy and I want to extract all the coefficients of the equation. This is what I have for the coefficients of x and ...
new-to-coding's user avatar
0 votes
1 answer
258 views

I am working on a JSON database that stores multiple choice questions. I defined a function that takes some arguments that are NOT obligatory in order to fetch questions based on your needs (...
MachineNeil's user avatar
0 votes
1 answer
70 views

I have two functions that do the same thing, but are used differently. I currently have a popup that is triggered on actions based on device. On desktop, if the mouse leaves the page, it triggers the ...
Schneider G's user avatar
1 vote
1 answer
1k views

I would like to know if the same answer should be obtained when simplifying an expression using a karnaugh map and the mccluskey method. I guess that it does but I would prefer to get a confirmation.
bestgamer14's user avatar
0 votes
1 answer
2k views

I have an insert statement where I only need to fill 15 columns out of 70 - and all the other columns can remain NULL. I would like to find a way to write this statement in a shorter matter without ...
Michael Norman's user avatar
0 votes
1 answer
43 views

These 3 functions I have written are all very similar, they all do the scatterplot of 2 variables. Is it possible to create a single function with parameters, instead of having to repeat 3 times ...
Kkura's user avatar
  • 7

1
2 3 4 5
16