text
stringlengths
1
1.11k
source
dict
php, object-oriented, mysql /** * @param mixed $qtitle */ public function setQtitle($qtitle) { $this->qtitle = $qtitle; } public function __construct($dbh) { $this->dbh = $dbh; } public function voted() { $sql = "SELECT vote_type from questions_vote WHERE questiontitle=:questiontitle"; $stmt = $this->dbh->prepare($sql); $stmt->bindValue(':questiontitle',$this->getQtitle()); $stmt->execute(); $exists = $stmt->rowCount(); if($exists) { return true; } else { return false; } } public function redirect() { header("Location:" . $_SERVER['REQUEST_URI']); exit(); } public function deleteVote() { $sql = "DELETE FROM questions_vote WHERE username=:username and questiontitle=:questiontitle"; $stmt = $this->dbh->prepare($sql); $stmt->bindValue(':username',$this->getVoter()); $stmt->bindValue(':questiontitle',$this->getQtitle()); $stmt->execute(); $this->subtractVote(); $this->redirect(); } public function addVote() {
{ "domain": "codereview.stackexchange", "id": 23257, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "php, object-oriented, mysql", "url": null }
algorithms, data-structures, search-algorithms I wish to find multiple queries for the maximal value that is less than a queried value $V$, in $o(K)$ and $o(N)$ time per query, with $o(K^2)$ and $o(N)$ preprocessing. (Assume that the array has already been stored in terms of the K linear subarrays, perhaps in terms of the constant C and length of each subarray, with the subarrays ordered. Therefore, you are given the array with the starting and ending points of all the linear subarrays, as well as the linear constant C, as described before. So, one does not need to derive the linear subarrays in the first place.) Otherwise, a proof (formal or not) that it is not possible to do so would be appreciated. Of course, a balanced binary search tree (BBST) or simply sorting achieves the purpose, but it requires $O(NlogN)$ preprocessing, which is too much. Checking the largest valid value within each subarray takes $O(K)$ per query, which is again too much. Would it be possible for something to combine both of these, perhaps?
{ "domain": "cs.stackexchange", "id": 15315, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "algorithms, data-structures, search-algorithms", "url": null }
ros Originally posted by sgvandijk with karma: 649 on 2021-06-10 This answer was ACCEPTED on the original site Post score: 0 Original comments Comment by mschickler on 2021-06-10: Thanks! It worked. I am a little surprised that it still looks like there is about 100-200 microseconds of latency while running in my environment, but at least the addresses now match!
{ "domain": "robotics.stackexchange", "id": 36511, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros", "url": null }
c++, beginner, algorithm, programming-challenge, c++17 Title: LeetCode 665: Non-decreasing Array I'm posting a solution for LeetCode's "Non-decreasing Array". If you'd like to review, please do. Thank you! Problem Given an array nums with n integers, your task is to check if it could become non-decreasing by modifying at most 1 element. We define an array is non-decreasing if nums[i] <= nums[i + 1] holds for every i (0-based) such that (0 <= i <= n - 2). Example 1: Input: nums = [4,2,3] Output: true Explanation: You could modify the first 4 to 1 to get a non-decreasing array. Example 2: Input: nums = [4,2,1] Output: false Explanation: You can't get a non-decreasing array by modify at most one element. Constraints: 1 <= n <= 10 ^ 4 -10 ^ 5 <= nums[i] <= 10 ^ 5 Code // Most of headers are already included; // Can be removed; #include <iostream> #include <cstdint> #include <vector>
{ "domain": "codereview.stackexchange", "id": 39795, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, beginner, algorithm, programming-challenge, c++17", "url": null }
gazebo, kobuki @jorge Where can I see anything related to the URDF and tags in Gazebo 5? Any changelog or something. I cannot find anything. Thanks! Comment by jorge on 2015-07-15: I also failed to find any information about integrating ROS robots with Gazebo 5. However, as JAde uses Gazebo 5, I expect that new tutorials will come soon. Comment by Javier V. Gómez on 2015-07-15: Taking a look at the change log, I saw the following line: Change behavior of Joint::SetVelocity, add Joint::SetVelocityLimit(unsigned int, double) * Pull request #1218 * Issue #964 for Gazebo 5.0.0. I will go deeper into this Comment by Javier V. Gómez on 2015-07-15: @jorge I found the reason :) Check my edited answer. It could be helpful for you as well. It is a Gazebo 5 problem as pointed out in the comments of the original post. I solved it installing the latest Gazebo4 version. EDIT: And I finally found the reason!! https://bitbucket.org/osrf/gazebo/pull-request/1218/change-behavior-of-odejoint-setvelocity/diff
{ "domain": "robotics.stackexchange", "id": 21675, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "gazebo, kobuki", "url": null }
GMAT Question of the Day - Daily to your Mailbox; hard ones only It is currently 18 Nov 2018, 17:34 ### GMAT Club Daily Prep #### Thank you for using the timer - this advanced tool can estimate your performance and suggest more practice questions. We have subscribed you to Daily Prep Questions via email. Customized for You we will pick new questions that match your level based on your Timer History Track every week, we’ll send you an estimated GMAT score based on your performance Practice Pays we will pick new questions that match your level based on your Timer History ## Events & Promotions ###### Events & Promotions in November PrevNext SuMoTuWeThFrSa 28293031123 45678910 11121314151617 18192021222324 2526272829301 Open Detailed Calendar • ### How to QUICKLY Solve GMAT Questions - GMAT Club Chat November 20, 2018 November 20, 2018 09:00 AM PST 10:00 AM PST
{ "domain": "gmatclub.com", "id": null, "lm_label": "1. Yes\n2. Yes\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9092645025250771, "lm_q1q2_score": 0.8067036476118283, "lm_q2_score": 0.8872045981907006, "openwebmath_perplexity": 2781.7335561924683, "openwebmath_score": 0.629133403301239, "tags": null, "url": "https://gmatclub.com/forum/which-of-the-following-inequalities-has-a-solution-set-that-127820.html" }
java, multithreading, generics, concurrency, scheduled-tasks /** * a generic scheduler that may be extended to provide fixed-delay execution to tasks * @author Willie Scholtz * @param <T> the type of bean to be scheduled */ public abstract class Scheduler<T extends Callable<T>> { private static final Log LOG = LogFactory.getLog(Scheduler.class); private static final int MAX_THREADS = Runtime.getRuntime().availableProcessors(); private Timer timer = null; private final int delay; /** * creates a new scheduler * @param delay the delay in seconds between executions */ public Scheduler(final int delay) { this.delay = delay; } /** * creates a new timer for executing tasks * @param seconds number of seconds between each execution * @return a Timer */ private Timer getSchedulerTimer(int seconds) { final String cName = this.getClass().getSimpleName();
{ "domain": "codereview.stackexchange", "id": 10204, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "java, multithreading, generics, concurrency, scheduled-tasks", "url": null }
java, console, csv public Course(int credits, int grade) { this.credits = credits; this.grade = grade; } public int getCredits() { return credits; } public int getGrade() { return grade; } } With our new Course class, we can replace the two List<Integer>s with a single List<Course>. But wait, something interesting can now happen here. We've pulled the data we need for calculating our credit-weighted grade into here, so why don't we also pull the calculation as well? public int getCreditWeightedGrade() { return getCredits() * getGrade(); }
{ "domain": "codereview.stackexchange", "id": 19083, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "java, console, csv", "url": null }
real-time Title: Implement a software PID for the first time in real time software, I can find P what about I and D? Here we have the basic formula of a Proportional Integral Derivative controller. This is the formula from the Wikipedia page on the subject I want to implement this type of controller in my system. Currently the system (function in the software) is fed a psi value and told to set an analog output to a value so that this pressure is achieved. The function, lets call it SetPressure(int psi), has access to a table of psi vs analog signal output, it does quick binary search and finds the closest match and sets the analog output to that match. This is not good enough for when the machinery/valves "wears in". So now I have access to a pressure transducer to tell me the actual pressure in the line I am trying to control. It gives me an analog input to my function. I would like to figure out, given these values of commanded and actual values, how to create a software PID.
{ "domain": "dsp.stackexchange", "id": 928, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "real-time", "url": null }
Dear @Anuradha, I have two questions for you. 1. Can you please rethink on the cases you have mentioned here? there the cases you have mentioned, 3 of those cases add up to 5 entities. can you please think again that what these entities are and state here? To remind you, there can be two types of entities here. i) points, ii) Integer coordinates. 2. Secondly, are you sure all the cases suggest Characteristics of one specific set? then why some of them add up to $$5$$ while one adds up to $$3$$. Also i am not sure about what you denote by saying “all”, in first and last case. If you are interested, i can let you know about what other aspects , thoughts i have on this problem. Please Let me know. #24460 Ananya Bhattacharya Participant
{ "domain": "cheenta.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9871787883738262, "lm_q1q2_score": 0.8161123387755929, "lm_q2_score": 0.8267117855317474, "openwebmath_perplexity": 623.0927596621258, "openwebmath_score": 0.5338582992553711, "tags": null, "url": "https://www.cheenta.com/forums/topic/pigeonhole-principle/" }
discrete-signals, fourier-transform, continuous-signals, spectrogram My questions are: 1- Is my understanding correct? 2- Can we apply Hann Windowing on discrete signals? Your understanding is correct and you can apply Hann windowing on discrete signals. The choice of your window depends on how easily you can visually resolve two sinusoids that are closely spaced in the spectrogram. $$STFT = X(m,\omega) = \sum_{n=-\infty}^{n=+\infty}x_nw_{n-mL}e^{-j\omega n}, $$ where $L$ is the step size of spectrogram (interval after which you place next window). and $W$ is the size of window, which decides resolution of frequency (row-wise separation of frequencies). Higher the $W$, more finer the resolution. You can see there is overlap between adjacent windows, the overlap being $W-L$.
{ "domain": "dsp.stackexchange", "id": 8576, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "discrete-signals, fourier-transform, continuous-signals, spectrogram", "url": null }
c#, sql, recursion, sql-server, reflection (Also, I should note that I'm a junior dev and this has been my most complex task yet, so there may be many basic mistakes that I've made) The Gist: I'm using reflection and recursion to store complex data objects, and would like to know:
{ "domain": "codereview.stackexchange", "id": 23763, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#, sql, recursion, sql-server, reflection", "url": null }
Reference 1. Choquet, G., Lectures on analysis, Vol I, Benjamin, New York and Amsterdam, 1969. 2. Deb, G., Stategies gagnantes dans certains jeux topologiques, Fund. Math. 126 (1985), 93-105. 3. Engelking, R., General Topology, Revised and Completed edition, 1989, Heldermann Verlag, Berlin. 4. Haworth, R. C., McCoy, R. A., Baire Spaces, Dissertations Math., 141 (1977), 1 – 73. 5. Willard, S., General Topology, 1970, Addison-Wesley Publishing Company. ____________________________________________________________________ Revised 4/4/2014. $\copyright \ 2014 \text{ by Dan Ma}$
{ "domain": "wordpress.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9833429619433693, "lm_q1q2_score": 0.8278033273593683, "lm_q2_score": 0.8418256492357358, "openwebmath_perplexity": 239.6477656412658, "openwebmath_score": 0.995428204536438, "tags": null, "url": "https://dantopology.wordpress.com/tag/baire-category-theorem/" }
mechanical-engineering, car Speed Limiters -- It's worth mentioning that production vehicles are almost always speed limited in the ECU (Engine Control Unit) for safety or legal reasons. If the ECU detects the wheels are spinning at a fast enough speed, it will cut power to the engine to prevent the vehicle from going faster. It's possible to circumvent this protection with an aftermarket ECU or with a modification to the stock one. As an example, some model years of the Honda Civic are speed-limited to around 120 mph (190 km/h). Tire Ratings -- All tires have a certain speed rating, which is likely much less than the actual top speed of your vehicle. The speed rating is a single letter and is part of the tire code (see here for more information). For example, temporary spare tires may be limited to only 80 mph (130 km/h) before they are in imminent danger of suffering a blowout.
{ "domain": "engineering.stackexchange", "id": 2710, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "mechanical-engineering, car", "url": null }
Take the function The domain is all real values of x. List the interval(s) on which fis decreasing. y = F(x) + 5 8. 42 10 5 5 10 x y Find the domain and range of each function. State the domain and range for each graph and then tell if the graph is a function (write yes or no). If you want to know how to find the range of a function, just follow these steps. Question 4 Find the domain and range of the following function f (x) = p-x 2-3 x + 10. Function Notation Practice Worksheet. The graph of a function f. The range of the inverse of a function is identical with the domain of the original function. and the range is $(-\infty,0)$ and $(0,\infty)$ notice unbounded below and open notation, the parenthesis instead of brackets, and the open and unbounded above, again the. Ifx is positive or 0, then the absolute value of x is x itself. In function notation, questions are often asked like this: 3 2 1 f (x) x Find f(4): This is a fancy way of saying plug 4 in. The domain of f(x) = x 2 is all
{ "domain": "cefalugibilmanna.it", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.971563966131786, "lm_q1q2_score": 0.842380693226348, "lm_q2_score": 0.8670357512127872, "openwebmath_perplexity": 429.69633344663407, "openwebmath_score": 0.6847590804100037, "tags": null, "url": "http://yme.cefalugibilmanna.it/questions-on-domain-and-range-of-a-function-pdf.html" }
nuclear-engineering, accelerator-physics, particle-accelerators On another subject, this is a direct reaction which means it should occur for times in the order of $10^{-21} s$ so is very fast. The same holds for the next reaction involved in the process which also works good for the total process, because the slowest is the last one where the $T_{1/2}$ of $^{12}B$ for beta decay (100% by the way) is $20ms$ (see Nuclear Data tables). Let us average the total cross section of all these possible processes to $\sigma_1 = 0.3 barn$. Neutron thermalization for $^{11}B$ capture and its cross section
{ "domain": "physics.stackexchange", "id": 24679, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "nuclear-engineering, accelerator-physics, particle-accelerators", "url": null }
Question 46 Consider a machine with 64 MB physical memory and a 32-bit virtual address space. If the page size is 4KB, what is the approximate size of the page table? A 16 MB B 8 MB C 2 MB D 24 MB Memory Management    GATE-CS-2001 Discuss it
{ "domain": "geeksforgeeks.org", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.962673111584966, "lm_q1q2_score": 0.8182443945985391, "lm_q2_score": 0.8499711737573762, "openwebmath_perplexity": 1730.2345813167385, "openwebmath_score": 0.4198146164417267, "tags": null, "url": "http://quiz.geeksforgeeks.org/gate-cs-2001/" }
javascript, node.js, promise, rest, express.js error differentiation avoids if then else hell and generalized catchers (although you will use try/catch in your code, and you still have access to a generalized catcher if you need one). Using generators is, in my opinion, more flexible and makes for easier to read code. Not all cases are cases for generator usage (like mpj suggests in the video) but in this specific case, I believe it to be the best option. Conclusion Solution 1: good classical approach to the problem, but has issues inherent to promise chaining. You can overcome some of them by nesting promises, but that is an anti pattern and defeats their purpose. Solution 2: more versatile, but requires a library and knowledge on how generators work. Furthermore, different libraries will have different behaviors, so you should be aware of that.
{ "domain": "codereview.stackexchange", "id": 24998, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "javascript, node.js, promise, rest, express.js", "url": null }
For $\theta^\prime$ in QI: $\theta = \theta^\prime$ For $\theta^\prime$ in QII: $\theta= \pi - \theta^\prime$ For $\theta^\prime$ in QIII: $\theta = \pi + \theta^\prime$ For $\theta^\prime$ in QIV: $\theta = 2\pi - \theta^\prime$ The value for $\theta$ must be solved for in this manner because for all values of $\theta$, $\tan\theta$ is only defined for $-\frac{\pi}{2}<\theta<+\frac{\pi}{2}$, and is periodic (with period $\pi$). This means that the inverse function will only give values in the domain of the function, but restricted to a single period. Hence, the range of the inverse function is only half a full circle. Note that one can also use $r=\sqrt{x^2 + y^2}$ $\theta = 2 \arctan \frac{y}{x+r}$ ### To Cartesian coordinates from log-polar coordinates $\begin{cases}x = e^\rho\cos\theta, \\ y = e^\rho\sin\theta.\end{cases}$ By using complex numbers $(x,y)=x+iy'$, the transformation can be written as $x + iy = e^{\rho+i\theta} \,$
{ "domain": "wikipedia.org", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9904406020637528, "lm_q1q2_score": 0.8210146502950978, "lm_q2_score": 0.828938806208442, "openwebmath_perplexity": 1032.7566102935496, "openwebmath_score": 0.9637818336486816, "tags": null, "url": "http://en.wikipedia.org/wiki/List_of_canonical_coordinate_transformations" }
pl.programming-languages, type-systems, object-oriented, program-logic Yang Zhao and John Boyland. A fundamental permission interpretation for ownership types. In Second IEEE/IFIP International Symposium on Theoretical Aspects of Software Engineering, TASE 2008, June 17-19, 2008, Nanjing, China. IEEE Computer Society, 2008., pages 65–72. Shuling Wang, Luís Soares Barbosa, and José Nuno Oliveira. A relational model for confined separation logic. In In Second IEEE/IFIP International Symposium on Theoretical Aspects of Software Engineering, TASE 2008, June 17-19, 2008, Nanjing, China. IEEE Computer Society, 2008., pages 263–270. Shuling Wang and Zongyan Qiu. A generic model for confinement and its application. In In Second IEEE/IFIP International Symposium on Theoretical Aspects of Software Engineering, TASE 2008, June 17-19, 2008, Nanjing, China. IEEE Computer Society, 2008., pages 57–64.
{ "domain": "cstheory.stackexchange", "id": 1707, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "pl.programming-languages, type-systems, object-oriented, program-logic", "url": null }
- The lower limit topology on $\mathbb R$ is strictly finer than the Euclidean topology on $\mathbb R$, as you figured out by your construction of $(7,8)$. If $[1,2]$ were open, then its complement would be closed. Can you reach a contradiction? –  Ian Coley Mar 22 '13 at 1:07 It seems like $[1,2]$ should be closed since it's complement $(-\infty,1) \cup (2,\infty)$ is open. I'm not sure thought. –  mtiano Mar 22 '13 at 1:08 @FrankMcGovern You opened my eyes :) Thanks! –  MyUserIsThis Mar 22 '13 at 1:31 @MyUserIsThis No problem! Glad to help. –  Ian Coley Mar 22 '13 at 1:32 If the set $[1,2]$ was open, then $2$ would have an open neighborhood $[a,b)$ such that $2\in[a,b)\subset[1,2]$. Now take any element $p$ such that $2<p<b$. It belongs to $[a,b)$, hence to $[1,2]$, and is greater than $2$...
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9748211553734217, "lm_q1q2_score": 0.8123424367328353, "lm_q2_score": 0.8333245870332531, "openwebmath_perplexity": 184.70635731553162, "openwebmath_score": 0.9129961729049683, "tags": null, "url": "http://math.stackexchange.com/questions/337446/are-these-open-sets" }
c#, cache, asp.net-core, redis /// <summary> /// When called, it will return the formatted key /// </summary> /// <returns></returns> public override string ToString() { var result = string.Format(FormatTemplate, typeof(T).Name, Value); if (Parameters != null) { result = string.Format(result, Parameters); } return result.ToLowerInvariant(); } } having this base abstraction, we can do this : public class UserCacheKey : CacheKey<User> { private const string _defaultEnvironmentName = "ExampleEnvironment"; public UserCacheKey(object value) : this(value, null) { } public UserCacheKey(object value, IEnumerable<string> parameters) : base(_defaultEnvironmentName, value, parameters) { } } from there we can use ICacheKey on other caches and use ToString to get the formatted key. You can then extend it as needed.
{ "domain": "codereview.stackexchange", "id": 43474, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#, cache, asp.net-core, redis", "url": null }
cosmology, spacetime, universe, curvature, cosmological-inflation $$ s^2 = x^2 + y^2 \tag{1} $$ If we extend this to three directions by including motion along the $z$ axis then we get: $$ s^2 = x^2 + y^2 + z^2 \tag{2} $$ What your teacher didn't tell you is that this is only true when the space is flat. For example if you try (the 2D version of) this experiment moving on the surface of a sphere then you'll find that: $$ s^2 \lt x^2 + y^2 $$ When we say the universe is flat we mean that for any three displacements $x$, $y$ and $z$ equation (2) correctly gives the distance between the starting and ending points. Incidentally, spacetime is not flat. When we say the universe is flat we mean that if we take a moment in time, i.e. a spatial hypersurface, then equation (2) applies.
{ "domain": "physics.stackexchange", "id": 28726, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "cosmology, spacetime, universe, curvature, cosmological-inflation", "url": null }
# prove that $\lfloor x\rfloor\lfloor y\rfloor\le\lfloor xy\rfloor$ How can I prove that if $x$ and $y$ are positive then $$\lfloor x\rfloor\lfloor y\rfloor\le\lfloor xy\rfloor$$ - Do you mean $\lfloor x\rfloor \lfloor y\rfloor$? – Dan Oct 4 '13 at 9:24 $x \ge \lfloor x\rfloor$ and $y\ge \lfloor y\rfloor$ imply $xy \ge \lfloor x\rfloor \lfloor y\rfloor$. – njguliyev Oct 4 '13 at 9:25 @Dan yes, I edit it. – user95733 Oct 4 '13 at 9:27 First note that $f:\mathbb R\rightarrow \mathbb Z$ given by $f(x)=\lfloor x\rfloor$ is an increasing function that is the identity on the integers. Then note that for positive $x$ we have $0\leq f(x)\leq x$. With this we get $$f(x)f(y)\leq xy$$ and applying the increasing function $f$ on both sides above noting that the left hand side is an integer we then get: $$f(x)f(y)=f(f(x)f(y))\leq f(xy)$$ which proves the claim. - (+1) nice answer. – Mhenni Benghorbal Oct 4 '13 at 11:48
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.978712649448364, "lm_q1q2_score": 0.8001704751914038, "lm_q2_score": 0.8175744695262775, "openwebmath_perplexity": 438.4095228308825, "openwebmath_score": 0.9999780654907227, "tags": null, "url": "http://math.stackexchange.com/questions/514407/prove-that-lfloor-x-rfloor-lfloor-y-rfloor-le-lfloor-xy-rfloor/514409" }
ros, gazebo, ros-kinetic, trajectory-msgs int num_joints = 6; trajectory_msgs::JointTrajectory traj; traj.header.frame_id = "B_Link"; traj.header.stamp = ros::Time::now(); traj.joint_names.resize(num_joints); for(int i=0;i<num_joints;i++){ traj.joint_names[i] = joint_names[i]; } traj.points.resize(3); double joint_values_1[6] = {M_PI/2, M_PI/3, M_PI/2, M_PI, -M_PI/3, M_PI/2}; traj.points[0] = jointTrajectory_point(1.0, 6, joint_values_1); double joint_values_2[6] = {-M_PI/2, -M_PI/3, -M_PI/2, -M_PI, M_PI/3, -M_PI/2}; traj.points[1] = jointTrajectory_point(2.0, 6, joint_values_2); double joint_values_3[6] = {M_PI, 0.0, 0.0, 0.0, M_PI/3, 0.0}; traj.points[2] = jointTrajectory_point(3.0, 6, joint_values_3); while(ros::ok()) { arm_pub.publish(traj); ros::spinOnce(); loop_rate.sleep(); } return 0; }
{ "domain": "robotics.stackexchange", "id": 35573, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros, gazebo, ros-kinetic, trajectory-msgs", "url": null }
are in various situations. In Mathematics, a permutation with repetitions is an arrangement of items which can be repeated in various orders. Deprecated: Function create_function() is deprecated in /home/clients/f93a83433e1dd656523691215c9ec83c/web/i2fx9/oew. Combinations with Repetition Example. To permute a list is to rearrange its elements. Below is the syntax highlighted version of Permutations. Enter "4" for "Number of sample points in each combination". What about 20! or 100!? Most calculators including the TI 's series will only calculate factorials up to 69!. Meanwhile, you can also check permutations formula, permutations calculator, permutations examples, how to do permutations from the next sections in a detailed manner. Given a set of n elements, the combinations with repetition are different groups formed by the k elements of a subset such that: The order of the elements does not matter. Choosing Letters from an Alphabet. From GeoGebra Manual. The permutations with
{ "domain": "shakemymag.it", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9845754492759498, "lm_q1q2_score": 0.8161527954645642, "lm_q2_score": 0.8289388040954683, "openwebmath_perplexity": 515.5049484889851, "openwebmath_score": 0.6424293518066406, "tags": null, "url": "http://nzko.shakemymag.it/permutation-calculator-with-repetition.html" }
organic-chemistry, physical-chemistry, reaction-mechanism, physical-organic-chemistry Whereas, transition state is just the state before formation of new molecule(involves breaking of bonds of reactants and formation of new ones) An intermediate differs from a transition state in that the intermediate has a discrete lifetime (be it a few nanoseconds or many days), whereas a transition state lasts for just one bond vibration cycle. Intermediates may be unstable molecules (in which case they are called reactive intermediates) or highly stable molecules. The difference between them can be better described through the energy profile diagram. Transition states are local energy maximums and have partial bonds. This might be one of the reasons why they cant be isolated as intermediates.
{ "domain": "chemistry.stackexchange", "id": 9283, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "organic-chemistry, physical-chemistry, reaction-mechanism, physical-organic-chemistry", "url": null }
javascript, canvas, snake-game function Snake() { this.segments = [ new Block(7, 5), new Block(6, 5), new Block(5, 5) ]; this.direction = directions.right; this.nextDirection = directions.right; } Snake.prototype = { checkControls() { var i; for (i = 0; i < 4; i++) {
{ "domain": "codereview.stackexchange", "id": 30531, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "javascript, canvas, snake-game", "url": null }
rviz, hector-slam, ros-kinetic nav_msgs/OccupancyGrid [3381f2d731d4076ec5c71b0759edbe4e] rosgraph_msgs/Log [acffd30cd6b6de30f120938c17c593fb] sensor_msgs/LaserScan [90c7ef2dc6895d81024acba2ac42f369] sensor_msgs/PointCloud [d8e9c3f5afbdd8a130fd1d2763945fca] tf2_msgs/TFMessage [94810edda583a504dfda3829e70d7eec] topics: /diagnostics 31 msgs : diagnostic_msgs/DiagnosticArray /map 17 msgs : nav_msgs/OccupancyGrid /map_metadata 1 msg : nav_msgs/MapMetaData /poseupdate 479 msgs : geometry_msgs/PoseWithCovarianceStamped
{ "domain": "robotics.stackexchange", "id": 31940, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "rviz, hector-slam, ros-kinetic", "url": null }
c++, parsing, boost, math-expression-eval t_expression<double> e; parse_expression(s, e); t = t_var_definition<double>(move(name), std::move(e)); } } template <typename Iterator> void parse_root(parser_state<Iterator>& s, t_statement<double>& t) { if(s.lookahead.type == token_tag::Identifier && boost::get<std::string>(s.lookahead.value) == "define") { s.scan(); parse_definition(s, t); } else { t_expression<double> e; parse_expression(s, e); t = std::move(e); } if(s.lookahead.type != token_tag::EOI) throw_parse_error(s, "root", "end-of-input"); }
{ "domain": "codereview.stackexchange", "id": 8707, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, parsing, boost, math-expression-eval", "url": null }
To add to Robert Bryant's answer, the coadjoint orbits of a Lie group always have a natural symplectic structure, the (Lie-)Kirillov-Kostant(-Souriau) form. These are the symplectic leaves of the natrual Lie-Poisson structure on $\mathfrak{g}^\ast$. For $x \in \mathfrak{g}^\ast$, we can identify the coadjoint orbit $\mathcal{O}_x$ with $G/H_x$, where $H_x$ is the stabilizer of $x$ under the coadjoint action. For $x$ such that $H_x$ is Cartan (which should happen generically), this endows $G/H$ with a symplectic structure. However, this depends on the choice of $x$. For example, even in the absolute simplest case of $G = SU(2)$, the coadjoint orbits are spheres of different radii, so the orbits $\mathcal{O}_x$ and $\mathcal{O}_y$ are not symplectomorphic unless $y$ is conjugate to $x$.
{ "domain": "mathoverflow.net", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9777138118632621, "lm_q1q2_score": 0.8038656688751573, "lm_q2_score": 0.8221891305219504, "openwebmath_perplexity": 199.63251919296806, "openwebmath_score": 0.897797167301178, "tags": null, "url": "http://mathoverflow.net/questions/106014/does-g-h-quotient-of-a-real-semisimple-lie-group-by-a-cartan-subgroup-have-a" }
c, library, socket, wrapper, client You are already doing a lot of error handling, which is good, but you need to pay a little bit more attention to what kind of errors functions can return, and how to respond to them. For example, send() can return -1 in situations that are recoverable. You should check errno, and if that is set to EINTR, you should retry sending the same data. Also, if send() returns zero, that is technically not an error, and you should just treat that as a short send, see also this StackOverflow question. Also note that for many socket functions, only -1 is an error, and other negative numbers might be valid. So in main(), check for sock_fd == -1 instead of sock_fd < 0. Exit codes The proper exit code to signal an error is usually 1, not -1. Even better is to use EXIT_SUCCESS and EXIT_FAILURE instead of numeric codes. Consider removing the typedefs
{ "domain": "codereview.stackexchange", "id": 43618, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c, library, socket, wrapper, client", "url": null }
terms are the two middle terms. Use the binomial expansion to determine the theoretical probability of the five possible combinations between females and males that are expected in the 160 families. Typically, we think of flipping a coin and asking, for example, if we flipped the coin ten times what is the probability of obtaining seven heads and three tails. The exponents of a start with n, the Its helpful in the economic sector to determine the chances of profit and loss. It calculates the binomial distribution probability for the number of successes from a specified number of trials. Binomial Expression: A binomial expression is an algebraic expression that contains two dissimilar terms. Cumulative binomial probability refers to the probability that the value of a binomial random variable falls within a specified range. To get to this menu, press: followed by. A binomial is a two-term algebraic expression. These are the coefficients of the binomial expansion and it tells us that we
{ "domain": "calleemason.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9790357573468175, "lm_q1q2_score": 0.8115607360678023, "lm_q2_score": 0.8289388104343893, "openwebmath_perplexity": 440.7888487863707, "openwebmath_score": 0.8252242207527161, "tags": null, "url": "https://www.calleemason.com/echinacea/top/19941721e3b81979bca09b1541a7d874" }
ros, ros-kinetic, offline Originally posted by anonymous36363 on ROS Answers with karma: 20 on 2018-07-10 Post score: 0 Hi I install some software offline in this way but i don't test it with ros, for this way we have two pc A with internet and B no internet the source of ubuntu installation on both computer must be same. 1_install ros on A 2_go to /var/cache/apt/archives 3_ copy all pkg 4_paste to another computer with same directory 5_update your pkg in B Originally posted by Hamid Didari with karma: 1769 on 2018-07-10 This answer was ACCEPTED on the original site Post score: 0
{ "domain": "robotics.stackexchange", "id": 31235, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros, ros-kinetic, offline", "url": null }
fasta, format-conversion, plink Title: Converting aligned fasta to plink ped/bed I have an alignment of multiple sequences in a FASTA file (output from MAFFT), for which I would like to simulate a phenotype using plink, but for that I need to have my alignment in a PED file or plink BED. There's plenty online about converting in the other direction, but the only mention I found of converting FASTA to BED is about aligning a raw FASTQ file for use in plink - my data is already aligned! How can I do this conversion? Note that How to convert FASTA to BED is about the UCSC BED format, not the plink binary PED. An alignment can be the result of two slightly different analyses: There is multiple sequence alignment (which is what you get from MAFFT) where sequences are aligned so that similar regions are on top of each other. This may require introducing indels (insertions / deletions) if a particular region is absent in some of the sequences.
{ "domain": "bioinformatics.stackexchange", "id": 1514, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "fasta, format-conversion, plink", "url": null }
electric-circuits, electric-current, electrical-resistance, electromagnetic-induction, inductance Title: How do non-ideal inductors behave in a circuit? I cannot comprehend how can we break a seemingly non-ideal choke coil into just a pure resistor and inductor in series according to the following solution of a question.
{ "domain": "physics.stackexchange", "id": 97967, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "electric-circuits, electric-current, electrical-resistance, electromagnetic-induction, inductance", "url": null }
electromagnetism, electric-current, voltage This principle is used in the construction of the Hendo hoverboard.
{ "domain": "physics.stackexchange", "id": 23741, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "electromagnetism, electric-current, voltage", "url": null }
bacteriology, temperature, sterilisation Title: How long can Legionella survive at 60°C? I'm coding some stuff for water heaters and one of the functions is anti-Legionella. Anyway, I've read on wikipedia that 90% Legionella dies in first two minutes if the water temperature is 60°C, but I'm interested in how long should the temperature be 60°C for 99.99999% of Legionella to die? (I guess I can never get to 100%) Follow-up question: On what intervals should this be done so that the water isn't contained? Should it be one week, two weeks, several days? Final question: If the water in a water heater has 60°C for 30 minutes every 2 weeks, would the water be safe? Usually cell death would follow first order kinetics. $$X=X_0e^{-kt}$$ where $X$ is the number of cells at time $t$, $X_0$ is the initial number of cells and $k$ is the death rate constant. You can get the constant by solving for 90% reduction in 2 minutes. Then just substitute and get the time required for 99.99999% reduction — 10 minutes.
{ "domain": "biology.stackexchange", "id": 9883, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "bacteriology, temperature, sterilisation", "url": null }
electricity, visible-light, voltage So, these bulbs are filled with gas, generally mercury vapor. When you turn it on, you're really creating an electrical arc at the end of the bulb. This arc ionizes the gas, and that is the flickering you see. Eventually, the entire length of the bulb can arc, and a plasma stream is created (plasma is just a gas of free-moving ions and electrons). When it is cold, or if the starter arcs are wearing out (and can't produce sufficient voltage), then the flickering lasts longer. By touching the bulb, you actually provide a shorter path for the plasma stream! In effect, you get two short plasma streams, each terminating at your touch point. Then, once the plasma streams interact, and since the voltage required to maintain the stream is less than the voltage needed to establish it, the streams merge into one and the lamp will light.
{ "domain": "physics.stackexchange", "id": 36819, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "electricity, visible-light, voltage", "url": null }
python, comparative-review, unit-conversion #If 6 is selected it starts conversion from newton if user_input == ("6"): def newton(): print("\nWhat temperature are you converting too?") print("Enter 1 for Celcius\nEnter 2 for Fahrenheit\nEnter 3 for Kelvin\nEnter 4 for Rankine") print("Enter 5 for Delisle\nEnter 6 for Newton\nEnter 7 for Reaumer\nEnter 8 for Romer") #Gets user input for converting celcius_type = input('''''') #COnverts to celcius if celcius_type == ("1"): temp = int(input('''\nType the value for conversion.\n''')) print("\nThe conversion calculated") print(temp) #Converts to fahrenheit if celcius_type == ("2"): temp = int(input('''\nType the value for conversion.\n'''))
{ "domain": "codereview.stackexchange", "id": 17952, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, comparative-review, unit-conversion", "url": null }
ros2, imu, gazebo-ignition, ignition-fortress I have tried to add frameID to the plugin parameters, as I did in Gazebo Classic, but it didn't work. My questions are: How to change the frame published in the messages? What parameters are available for the IMU plugin? Is there any documentation or where can I read the source code? Thank you! From the source code it appears you can use the tag gz_frame_id or the older ignition_frame_id (deprecated) as a child of the sensor tag. The relevant source code is here.
{ "domain": "robotics.stackexchange", "id": 38625, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros2, imu, gazebo-ignition, ignition-fortress", "url": null }
newtonian-mechanics, gravity, relativity Is this difference due to the fact that in Newtonian physics the deflection depends on the energy of the light (using the formula $E=m*c^2$) and, in the experiment, it was calculated to be about 0.87, while, in Relativity, such deflection is for the most part independent of the energy of the photon?
{ "domain": "physics.stackexchange", "id": 58086, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "newtonian-mechanics, gravity, relativity", "url": null }
curve. f ( 1) = − 5 f ( 1) = - 5. Sal finds the absolute maximum value of f(x)=8ln(x)-x² over the interval [1,4]. earn credit. Python List max() Method - Python list method max returns the elements from the list with maximum value. True You are given that the function f ( x ) = 2 ( x + 3 ) x 2 + x − 2 has an absolute maximum on the interval − 2 < x < 1. Find the absolute maximum and absolute minimum values of f on the given interval. We usually distinguish between local and global (or absolute) extreme values. The smallest y -value is the absolute minimum and the largest y -value is the. On the interval, fnmin then finds all local extrema of the function as left and right limits at a jump and as zeros of the function's first derivative. The maximum will occur at the highest value and the minimum will occur at the lowest value. Roll your mouse over the Extreme Value Theorem to check your answers. A closed interval like [2, 5] includes the endpoints 2 and 5. For this data set, the
{ "domain": "rciretedimpresa.it", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9890130576932457, "lm_q1q2_score": 0.8520725317968266, "lm_q2_score": 0.86153820232079, "openwebmath_perplexity": 373.11161112116935, "openwebmath_score": 0.6303600668907166, "tags": null, "url": "http://hefc.rciretedimpresa.it/absolute-maximum-and-minimum-calculator-on-interval.html" }
javascript, jquery, html, twitter-bootstrap </select> <input class="form-control" type='text' id='salutation2' placeholder="Dear Ms. Smith,"/>
{ "domain": "codereview.stackexchange", "id": 8591, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "javascript, jquery, html, twitter-bootstrap", "url": null }
machine-learning, python, pandas, feature-extraction Results: 0 Id feature 2 Ccol 292 3 Ccol 2392 0 Id feature sub-feature 2 Ccol T 292 3 Ccol T 2392
{ "domain": "datascience.stackexchange", "id": 1751, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "machine-learning, python, pandas, feature-extraction", "url": null }
homework-and-exercises, thermodynamics, ideal-gas If they stay in the same position, then they are in equilibrium, so the forces pushing against the 2 cylinders are equal + tension are equal (but we have $F_1+T=F_2+T$ so tension is eliminated and we remain with $F_1=F_2$, right ?) From the formula for force I calculate that $p_1 \cdot 2S_2=p_2 \cdot S_2$ Then from Charles's law for the transformation in both cylinders I end up with $p_1=\frac{p_0 \cdot (300+x)}{300}$ and $p_2=\frac{p_0 \cdot (300+50)}{300}$ but calculating x gives me -125, so a change of 125°C while the textbook says it should be 25°C Treating the combination of the two pistons and the intervening rod as a free body, the equilibrium force balance is: $$p_{g1}(2S_2)-p_0(2S_2)+p_0S_2-p_{g2}S_2=0$$where $p_0$ is the atmospheric pressure. Initially, $p_{g1}=p_{g2}=p_0$ and finally $p_{g1}$ and $p_{g2}$ are given by the equations you wrote. Writing the above equation in a slightly different form, we have: $$(p_{g1}-p_0)(2S_2)=(p_{g2}-p_0)S_2$$
{ "domain": "physics.stackexchange", "id": 83354, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "homework-and-exercises, thermodynamics, ideal-gas", "url": null }
javascript, array, unit-testing test('contains more than one element with a 0', () => { expect(moveZeroToLeft([1, 0])).toStrictEqual([0, 1]); }); test('contains more than one element without 0', () => { expect(moveZeroToLeft([1, 3])).toStrictEqual([1, 3]); }); test('contains more than one element with a 0 somewhere in the middle', () => { expect(moveZeroToLeft([1, 0, 3])).toStrictEqual([0, 1, 3]); }); test('contains random number of zeros and non-zero elements', () => { expect(moveZeroToLeft([1, 0, 3, 0, 0, 44, 1, 0, 2])).toStrictEqual([0, 0, 0, 0, 1, 3, 44, 1, 2]); }); My solution function moveZeroToLeft(arr) { if (arr.length < 2) { return arr; } if (arr.some(x => x === 0)) { let zeroCounter = 0; const res = arr.filter(el => { if (el !== 0) { return true; } zeroCounter++; }); const leadingZeros = Array(zeroCounter).fill(0); return leadingZeros.concat(res); } return arr; }
{ "domain": "codereview.stackexchange", "id": 36614, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "javascript, array, unit-testing", "url": null }
algorithm-analysis, data-structures, amortized-analysis Title: The Potential function for Fibonacci heaps I am trying to get a better understanding of Fibonacci Heaps. I noticed the following definition for the potential function. $$ \Phi(F)=|W| +2\cdot \text{# marks}. $$ I do not understand why it is defined that way, or what its significant is. I am hoping somebody can explain it to me. Because it works. In amortized analysis, you pick the potential function. While it's usually related to some insight about the data structure or algorithm work, is it per se completely arbitrary. The only important thing is that if you write down the telescoping sum -- which is always set up in the same way! -- you can derive a good estimate.
{ "domain": "cs.stackexchange", "id": 10844, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "algorithm-analysis, data-structures, amortized-analysis", "url": null }
astrophysics, astronomy, stars, galaxies, white-dwarfs Title: What does a redder galaxy mean? I've been reading on the subject and I've repeatedly read that red galaxies are those with redder stellar populations which means (according to my readings) older star populations, with low star formation rates. Typical examples are elliptical galaxies (which I also read are populated mainly by less massive stars). Yet following a star's life in a Hertzsprung-Russel diagram, the less massive stars grow 'bluer' during their life time, eventually ending up in the white dwarf area of the diagram (an also 'blueish' area). It seems to be contradictory, what am I missing here? What you are missing is that what is important for the overall colour of a galaxy is the colours of the constituent stars and their luminosities and how many exist in a particular evolutionary stage.
{ "domain": "physics.stackexchange", "id": 45257, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "astrophysics, astronomy, stars, galaxies, white-dwarfs", "url": null }
carbonyl-compounds Title: Why is Benzaldehyde more reactive than propanone in nucleophilic addition, even though it has resonance? I am not 100% sure that this is true but this was given in the JEE Main 2020 (03 Sep Shift 2). Benzaldehyde has resonance and propanone has just +I effect why is then benzaldehyde more reactive in nucleophilic addition? The carbonyl carbon exhibits reactivity towards nucleophilic addition reactions due to its partial positive charge resulting from oxygen.
{ "domain": "chemistry.stackexchange", "id": 17849, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "carbonyl-compounds", "url": null }
c++, matrix, classes Linear search in amplitudes is going to get expensive when this gets large. Consider a pair of std::map instead. Or a single std::map if write_to_file is infrequent. There's nothing to prevent us adding duplicate entries, and no way to retrieve any element that's stored. write_to_file() is usually implemented as operator<<. Then it's easier to test (as we can write to a std::ostringstream and examine that), and it has a standard way to report failure (through the fail bit of the stream). This implementation gives us no way of knowing whether write_to_file() successfully wrote the whole contents to file or not. There's no way to reliably read back from file, as we have no way to tell where each amplitude element ends and the next one begins. f << std::flush is pointless, as that's implied by the immediately following f.close().
{ "domain": "codereview.stackexchange", "id": 43977, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, matrix, classes", "url": null }
tensorflow, convolution From the tensorflow documentation: https://www.tensorflow.org/api_docs/python/tf/keras/layers/MaxPool1D “Downsamples the input representation by taking the maximum value over a spatial window of size pool_size. The window is shifted by strides. The resulting output, when using the "valid" padding option, has a shape of: output_shape = (input_shape - pool_size + 1) / strides)
{ "domain": "datascience.stackexchange", "id": 11674, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "tensorflow, convolution", "url": null }
cosmology, dark-matter, cosmic-microwave-background, oort-cloud The CMB is an almost perfect black body spectrum. A blackbody spectrum is emitted by perfect blackbodies. The thermal emission from dust is not blackbody radiation. Thermal radiation $\neq$ blackbody radiation. To become blackbody radiation the emission has to come from something that is "optically thick" to that radiation - i.e. it should have a surface that we can see. In other words if we had an opaque sphere of dust around us that had somehow come into perfect thermal equilibrium at 2.7K then this would produce something that looked like the CMB. Unfortunately we would then be unable to see anything else beyond that! For a cosmological interpretation that isn't a problem. We cannot see (at any wavelength) "beyond" the CMB at a redshift of $\sim 1100$. It is a fatal problem for any model where the CMB is optically thick emission from a sphere surrounding the Solar System, since we wouldn't be able to see anything beyond the Solar System!
{ "domain": "astronomy.stackexchange", "id": 3297, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "cosmology, dark-matter, cosmic-microwave-background, oort-cloud", "url": null }
php, mysqli, sql-injection Avoid using global to make a variable available in function scope. You are much better off passing the dependency to the code that needs it as a parameter. This allows you to do things like type hinting the parameters to validate you have the proper dependency before working with it (like a valid mysqli object for example). Make sure you do not just consider happy path. For example when working with your DB object, what happens if prepare() fails? How does your code recover? You have too much vertical white-space (i.e. empty lines) in your code where there isn't really a need for it. Some of your lines of code are too long, making your code harder to read. Consider trying to limit line length to ~80 characters. Your code indentation (especially around brackets) is inconsistent. Do this in a consistent fashion so it is clear at a glance where code is nested. Don't echo out errors to standard output. Log them!
{ "domain": "codereview.stackexchange", "id": 21464, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "php, mysqli, sql-injection", "url": null }
from Figure 2 where the array formula =ELIM(U4:X7) in range U10:X13 produces the solution x = -0. Latent Semantic Indexing'' uses SVD to index and sort natural language documents according to their content. Calling svd for numeric matrices that are not symbolic objects invokes the MATLAB ® svd function. • Review of linear algebra • HW 0. Solving the system is a two phases process: first the coefficient matrix is decomposed in some way and then a solver. , many different right-hand sides that are associated with the same system matrix). Numerical methods for finding the singular value decomposition will also be addressed in this lab. In this case we need to compute the factorization A = LU only once, and. A multilevel adaptive cross approximation solver with singular value decomposition recompression (MLACA-SVD) was recently proposed for FastHenry, as an alternative to the MLFMA. By voting up you can indicate which examples are most useful and appropriate. svd =
{ "domain": "cesenaticoopen.it", "id": null, "lm_label": "1. Yes\n2. Yes\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9848109485172559, "lm_q1q2_score": 0.8227933346453876, "lm_q2_score": 0.8354835371034368, "openwebmath_perplexity": 1043.0111490718846, "openwebmath_score": 0.6158665418624878, "tags": null, "url": "http://yjcg.cesenaticoopen.it/svd-solver.html" }
c#, object-oriented, console if (inputAccount.CardPin.Equals(account.CardPin)) { selectedAccount = account; if (selectedAccount.IsLocked) { // This is when database is used and when the app is restarted. // Even user login with the correct card number and pin, // If IsLocked status is locked, user still will be still blocked. AtmScreen.PrintLockAccount(); } else { selectedAccount.TotalLogin = 0; isLoginPassed = true; break; } } } } if (isLoginPassed == false) { Utility.PrintMessage("Invalid card number or PIN.", false);
{ "domain": "codereview.stackexchange", "id": 35137, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#, object-oriented, console", "url": null }
probability of 1 success is 43. Poker Dice Probability Calculator (Using the Monte Carlo Method) Coding Language: Java. Cook Probability and Expected Value Page 1 of 12 Probability and Expected Value This handout provides an introduction to probability and expected value. 5th version; What is the Martingale system? HOWTO: Just fill the following form, base bet: is the starting amount you want to bet, balance (bankroll): the balance you are prepared to risk, multiply on loss: is the value you multiply base bet to each loss like 2 for martingale,bet. When rolling two dice, the probability of rolling "N or less" is given by the multiplicative law as: (N/6)(N/6). 26 On average you should expect to lose 26 cents per play Practice Problems Problem 36. Probability In this section we summarise the key issues in the basic probabilityteach-yourselfdocument and provide a single simple example of each concept. • The games are intended for a mature audience. These events are important both inside
{ "domain": "antonellarinaudo.it", "id": null, "lm_label": "1. YES\n2. YES\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9879462222582662, "lm_q1q2_score": 0.8054058647699628, "lm_q2_score": 0.8152324960856177, "openwebmath_perplexity": 637.8023285644374, "openwebmath_score": 0.5443531274795532, "tags": null, "url": "http://merf.antonellarinaudo.it/dice-probability-calculator.html" }
python, plugin, geospatial ########################## ######### AREA 3 ######### # Meh and Terrible # Set area to 0 area3_score = 0 area3_cat1 = QgsExpression( """ ( "Category_A" = 'Meh') AND ( "Category_B" = 'Terrible') """ ) area3_cat1_feat = map_layer.getFeatures( QgsFeatureRequest( area3_cat1 ) ) area3_cat1_ids = [i for i in area3_cat1_feat] for f in area3_cat1_ids: area3_score += f.geometry().area() # Bad and Standard area3_cat2 = QgsExpression( """ ( "Category_A" = 'Bad') AND ( "Category_B" = 'Standard') """ ) area3_cat2_feat = map_layer.getFeatures( QgsFeatureRequest( area3_cat2 ) ) area3_cat2_ids = [i for i in area3_cat2_feat] for f in area3_cat2_ids: area3_score += f.geometry().area() # Bad and Terrible area3_cat3 = QgsExpression( """ ( "Category_A" = 'Bad') AND ( "Category_B" = 'Terrible') """ ) area3_cat3_feat = map_layer.getFeatures( QgsFeatureRequest( area3_cat3 ) ) area3_cat3_ids = [i for i in area3_cat3_feat]
{ "domain": "codereview.stackexchange", "id": 24123, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, plugin, geospatial", "url": null }
We know that $\pi$ restricted to $H$ is equivalent to the left regular representation of $H$, so $\pi$ is injective when restricted to $H$. Hence we can identify $H$ with its image under $\pi$, and from now on we will write $H$ instead of $\pi(H)$. Now the conjugation action of $N_K$ on $H$ induces a homomorphism $N_K \to {\rm Aut}(H)=K$, with kernel $C_{N_K}(H)$, so it will be enough to prove that $C_{N_K}(H) = 1$. Let $g \in C_{N_K}(H)$. Now $g$ stabilizes $K$, so $g(K) = K$, and hence $$hK = h(K) = h(g(K)) = (hg)(K) = (gh)(K) = g(h(K)) = g(hK).$$ So $g$ fixes every coset $hK \in \Omega$ and hence $g$ is acting as the identity on $\Omega$. i.e. $g=1$ and $C_{N_K}(H)=1$ as required. I am afraid that I have not used the hint involving Exercises 1 and 2, and I can't see immediately how to do that.
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9658995762509215, "lm_q1q2_score": 0.8049078654948932, "lm_q2_score": 0.8333245870332531, "openwebmath_perplexity": 67.55528685710449, "openwebmath_score": 0.9566318988800049, "tags": null, "url": "https://math.stackexchange.com/questions/1136201/the-normaliser-of-the-left-regular-image-df" }
c++, fizzbuzz, c++17 Once this function is chosen by overload resolution, then it checks that the contents of the range are conformal. So, if I mess up the definition of the structure I pass, rather than just getting “ctor not found” (due to SFINAE), I get an error more suitable to the real problem. (Aside: the static_assert is after the place where the real usage error would occur, both lexically and in program-flow. There seems to be no standard as to the order of error messages anyway. On Visual Studio, I indeed get the static assert message first (only) rather than at the end of a template spew.) results output Imagine implementing a game for real. It probably won’t use console output, but will draw icons and format fancy fonts and whatnot. So I don’t want a string output — I want the results in a usable form for handling in another function. The instance provides a vector of indexes into the configuration array, showing which of them matched. The config data can also be read from the object.
{ "domain": "codereview.stackexchange", "id": 30597, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, fizzbuzz, c++17", "url": null }
quantum-mechanics, atomic-physics, charge $$\Delta E=0.67\:\mathrm{eV}=2\pi\hbar/6.17\:\mathrm{fs}.$$ That experiment is reported in
{ "domain": "physics.stackexchange", "id": 35343, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-mechanics, atomic-physics, charge", "url": null }
c#, multithreading, thread-safety, generics, lazy Title: Generic cached value class mimicking Lazy Before I wrote this I searched and found a number of solutions that make use of a caching provider to handle a set of items. I felt that was too cumbersome of an approach and set out to create a class that could cache a single value, similar to the way Lazy<T> manages the initialization of a single value. I'm having trouble determining the thread-safety of this implementation, specifically where lock statements should be used. Can any experts on working with multi-threaded applications spot where I may have gone wrong? Or is this approach sound? public class Cached<T> { private readonly TimeSpan _duration; private DateTime _expiration; private Lazy<T> _value; private readonly Func<T> _valueFactory; public T Value { get { // Do I need locking while checking the expiration? if (DateTime.Now >= _expiration) RefreshValue(); return _value.Value; } }
{ "domain": "codereview.stackexchange", "id": 9012, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#, multithreading, thread-safety, generics, lazy", "url": null }
question, but since it 's still getting visits, i have method... Check given undirected graph it is easy to check given undirected graph without cycles in this the! Zero as a root of characteristic polynomial ) is the number of connected components and with! 2 vertices, it is called as adjacency matrix is a square matrix to. Edge from the vertex which was chosen at step 2 v ] = and... Matrix used to represent a finite simple graph, the adjacency matrix for the undirected graph, the graph. The special case of a graph Structure with 4 vertices Initialized adjacency matrix i to vertex.... Ith row and each column represents a vertex of connected components '' -1 connected components where. Zero as a root of characteristic polynomial ) is the number of connected components and conclude with related and! And adjacency list are raw '' forms of graph run a (! Check that if the smallest eigenvalue is strictly bigger then zero or the as... Undirected network search and breadth-first search days
{ "domain": "nabdon.com", "id": null, "lm_label": "1. Yes\n2. Yes\n\n", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9664104914476339, "lm_q1q2_score": 0.8496166611735181, "lm_q2_score": 0.8791467690927438, "openwebmath_perplexity": 605.2544029705998, "openwebmath_score": 0.5032801032066345, "tags": null, "url": "http://nabdon.com/p47u7d/check-if-graph-is-connected-adjacency-matrix-dd24f9" }
homework-and-exercises, newtonian-mechanics, angular-momentum, rotational-dynamics, torque Title: Is using conservation of angular momentum correct in this case ? Why or why not? A point mass is tied to one end of a cord, other end of which passes through a hollow tube caught in one hand. The point mass is being revolved in a horizontal circle of radius $r_1$ with a velocity $u$. The cord is then pulled down so that the radius of the circle reduces to $r_2$. Now, my teacher said that to find the final velocity (say $v$) at radius $r_2$ we can use conservation of angular momentum about center of circle. But, I do not think that is correct as torque due to gravity ($mgr$) is acting on the point mass. So we should not be able to use conservation of angular momentum. Please tell me if I am going wrong somewhere. Can we conserve angular momentum or not? And why so ? Angular momentum is always conserved. It may or may not be constant within a defined system, depending on whether the external torque about some point is zero or not.
{ "domain": "physics.stackexchange", "id": 36658, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "homework-and-exercises, newtonian-mechanics, angular-momentum, rotational-dynamics, torque", "url": null }
c# string email = response.email; if (!email.NullOrEmpty()) // maybe they already have an account. { user = userRepository.GetByEmail(email); } if (user == null) // create a brand new account. { string displayName = response.name; user = userRepository.CreateFromFacebook(facebookId, accessToken, email, displayName); userIsNew = true; } else // just connect the existing account to their Facebook account. { userRepository.AddFacebookConnection(user, facebookId, accessToken); } } return new AuthenticationResult { Status = ConnectionStatus.Authenticated, UserIsNew = userIsNew, ConnectionIsNew = connectionIsNew,
{ "domain": "codereview.stackexchange", "id": 2028, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#", "url": null }
stochastic-processes 'number of the reactants' is an ambiguous term: concentration (or even better chemical activity) is more accurate. If we take a simple reaction: $$\text{A}+\text{B}\to \text{C}$$ Then in accordance with kinetic theory the rate of reaction is proportional to: $$\frac{\text{d}[C]}{\text{d}t}\propto [A]$$ and: $$\frac{\text{d}[C]}{\text{d}t}\propto [B]$$ It follows that: $$\frac{\text{d}[C]}{\text{d}t}\propto [A]\times [B]$$ And: $$\frac{\text{d}[C]}{\text{d}t}=k [A][B]$$ Where the bracketed quantities are concentrations.
{ "domain": "physics.stackexchange", "id": 75188, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "stochastic-processes", "url": null }
mechanical-engineering, materials, gears, statics, structures So in this case the primary driver is usually reduced mass of the system and reduced mass inertia. The reduced mass of the gears leads to lighter and more compact mechanisms. Transmitting torque. These gears are usually encountered on motor gear boxes. It is noteworthy that you may have torque transmission without any angular motion (when the torque exactly counteracts the load). That torque generates forces and stresses on the gears. So for gears that are subjected to high forces and transmit torque (and power), removing material and opening holes doesn't make much sense, because essentially you'd be weakening the gear.
{ "domain": "engineering.stackexchange", "id": 5303, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "mechanical-engineering, materials, gears, statics, structures", "url": null }
quantum-mechanics, wavefunction, schroedinger-equation, potential, scattering An interesting thing is that the energies corresponding to complete transmission are $$E_n +V_0= \frac{(n \pi \hbar)^2}{2 m L^2} \ \ \ n \in \mathbb N $$ which are exactly equal to the energies corresponding to the bound states of the infinite square well. Quoting R.W. Robinett, Quantum Mechanics, chapter 11: This effect is easily understood in wave terms as due to the complete destructive interference between waves scattered at the first “step” (for which there is a phase change on reflection) and the second (for which there is no phase change)
{ "domain": "physics.stackexchange", "id": 34602, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "quantum-mechanics, wavefunction, schroedinger-equation, potential, scattering", "url": null }
java, performance } } Before making it faster, it is important to make it better. Scope of variables You currently have 3 static variables in your code static String winner; static String current; static int count; that are only used inside the getWinner method. This is not a good idea: A variable should have a scope as minimal as possible. This means you only declare that variable when you need it and not a moment before. They are not private which means that another unrelated class could even access and modify them, thereby completely destroying the algorithm. You should remove those static variables and have instead: int count = listOfBallots.size()/2; // ... String current = listOfBallots.get(i); // ... String winner = null; // before the if/else part
{ "domain": "codereview.stackexchange", "id": 19659, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "java, performance", "url": null }
star-catalogues, fits 1636148068921376768,Gaia DR3
{ "domain": "astronomy.stackexchange", "id": 6493, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "star-catalogues, fits", "url": null }
c++, beginner, validation, floating-point bool presenceOfHyphen {(*input)[0]=='-'}; //a specific identifier to check the presence of '-' (minus) sign at the beginning of the input (implying negative numbers) unsigned short periodCounter {0}; //an identifier to count the number of period in the input. if > 1 that implies invalid input unsigned short hyphenCounter {0}; //an identifier to count the number of hyphen in the input. if > 1 that implies invalid input if(input->empty()) throw 0; if(input->find_last_not_of("-.0123456789 \',")!=std::string::npos) throw 1; analyzeSeparator(input); for(auto ch : *input) { if(ch=='.') //counting numbers of period ++periodCounter; if(ch=='-') //counting numbers of hyphen ++hyphenCounter; } //std::cout << std::endl << "pC: "<<periodCounter <<"\t"<< "hC: "<<hyphenCounter <<"\t"<< "pOH: "<<presenceOfHyphen <<std::endl; //diagnostic statement
{ "domain": "codereview.stackexchange", "id": 43635, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, beginner, validation, floating-point", "url": null }
type-theory The constructors: Here we need a positivity restriction for the recursive bits (that refer to $K$ itself) in the types of the constructor, and, because we're in dependent type theory, we don't want later types to depend on the recursive arguments of the constructors. Because the types of the constructors are the only important bits in the definition of the inductive type, the body of $K$ itself is just $\Sigma_c(\mbox{the type of the constructor $c$})$. But that means that the "name" of $K$ doesn't actually exist! So, instead, within the type of the constructors, the variable $t$ is used, and it's bound by the $\mu$ construct at the top level of the declaration. For $\mathsf{Vect}_{\mathbb{Z}}$ (integer valued vectors of fixed length), that would be: $$ \mu t.\{\mathsf{nil}: t\ 0\} + \{\mathsf{cons}:\forall n, \forall tl:t\ n, \forall e:\mathbb{Z}, t\ (S\ n)\} + 0$$ The recursor:
{ "domain": "cstheory.stackexchange", "id": 5622, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "type-theory", "url": null }
data-structures, sets Title: What is the name of this positive integer set data structure? Google is failing me, so here goes:
{ "domain": "cs.stackexchange", "id": 8334, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "data-structures, sets", "url": null }
python, performance, programming-challenge, python-3.x, unit-testing which outputs a = 1 9050 function calls in 0.053 seconds 18096 function calls in 0.052 seconds 166169 function calls (158023 primitive calls) in 0.073 seconds a = 2 9050 function calls in 0.069 seconds 17197 function calls in 0.048 seconds 158753 function calls (151431 primitive calls) in 0.071 seconds a = 3 9050 function calls in 0.079 seconds 16373 function calls in 0.045 seconds 151133 function calls (144573 primitive calls) in 0.069 seconds a = 4 9050 function calls in 0.088 seconds 15611 function calls in 0.047 seconds 143862 function calls (137963 primitive calls) in 0.069 seconds a = 5 9050 function calls in 0.096 seconds 14950 function calls in 0.041 seconds 136746 function calls (131440 primitive calls) in 0.066 seconds a = 6 9050 function calls in 0.101 seconds 14357 function calls in 0.039 seconds
{ "domain": "codereview.stackexchange", "id": 27301, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, performance, programming-challenge, python-3.x, unit-testing", "url": null }
organic-chemistry, nomenclature If the compound contains several multiple bonds (double or triple bonds), low locants are given to multiple bonds as a set. If there is still a choice, low locants are given to the double bonds. P-31.1.1.1 The presence of one or more double or triple bonds in an otherwise saturated parent hydride (…) is denoted by changing the ending ‘ane’ of the name of a saturated parent hydride to ‘ene’ or ‘yne’. Locants as low as possible are given to multiple bonds as a set, even though this may at times give ‘yne’ endings lower locants than ‘ene’ endings. If a choice remains, preference for low locants is given to the double bonds. In names, the ending ‘ene’ always precedes ‘yne’, with elision of the final letter ‘e’ in ‘ene’. Only the lower locant for a multiple bond is cited, except when the numerical difference between the two locants is greater than one, in which case the higher locant is enclosed in parentheses. (…)
{ "domain": "chemistry.stackexchange", "id": 5433, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "organic-chemistry, nomenclature", "url": null }
reference-frames, vectors & = \vec{v}_1 + \vec{e} \dot\chi (t) + \vec{\Omega}(t) \times \left( \vec{r}_2(t) - \vec{r}_1(t) \right) \end{align}$$ See related answer: Derivation of Euler's equations for rigid body rotation
{ "domain": "physics.stackexchange", "id": 14272, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "reference-frames, vectors", "url": null }
c++, c++11, pointers // Adding `using std::swap` // Then calling swap (without std::) // Is the normal way of doing this. As it allows for Koenig // look up of a type specific swap first. If that does not // exist then the std::swap version will be used by the compiler. } }; // outside the class void swap(DeepPtr& lhs, DeepPtr& rhs) noexcept { lhs.swap(rhs); } Now that I have done swap. I would change the move operators too: DeepPtr(DeepPtr&& other) noexcept :myPtr( nullptr ) { other.swap(*this); } DeepPtr& operator=( DeepPtr&& other ) noexcept { other.swap(*this); return *this; } Constness const T* const get() const { return myPtr.get(); }
{ "domain": "codereview.stackexchange", "id": 15578, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++, c++11, pointers", "url": null }
slam, navigation, openni, rosmake, openni-camera [rosmake-2] Starting >>> roslib [ make ] [rosmake-2] Finished <<< roslib ROS_NOBUILD in package roslib [rosmake-3] Starting >>> xmlrpcpp [ make ] [rosmake-3] Finished <<< xmlrpcpp ROS_NOBUILD in package xmlrpcpp [rosmake-4] Starting >>> rosgraph_msgs [ make ] [rosmake-4] Finished <<< rosgraph_msgs ROS_NOBUILD in package rosgraph_msgs [ rosmake ] [ make ] [ rosbuild: 0.1 sec ] [ cpp_c... [ 5 Active 1/54 Complete ] [rosmake-5] Starting >>> tinyxml [ make ] [rosmake-5] Finished <<< tinyxml ROS_NOBUILD in package tinyxml [rosmake-6] Starting >>> smclib [ make ] [rosmake-6] Finished <<< smclib ROS_NOBUILD in package smclib [ rosmake ] [ make ] [ rosbuild: 0.2 sec ] [ cpp_c... [ 7 Active 1/54 Complete ]
{ "domain": "robotics.stackexchange", "id": 5712, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "slam, navigation, openni, rosmake, openni-camera", "url": null }
java, beginner, object-oriented, playing-cards A Hand class might be useful. It can calculate and store the hand value. This would also avoid the duplication you currently have (calcHandValue and Hit). Your Dealer class contains a lot of code that I would not place there. It contains the dealer AI (when does the dealer hit?), winning/losing condition check, printing, and counting. With a Hand class, you would already separate out some of it. I would also remove all the prints (they make code reuse difficult, and lead to bad code structure), and separate the AI logic to it's own class (this would make it easier to change the rules, because they are all in one place). Your Blackjack class also does way too much. It prints, it reads input, it handles input, it checks winning/losing condition (again, a duplication, see next point), etc. It is the player as well as the game, which violates the single responsibility principle.
{ "domain": "codereview.stackexchange", "id": 13902, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "java, beginner, object-oriented, playing-cards", "url": null }
c++ Title: C++: Hiding class implementation detail generic It always bugged me that you would have to write your private class members inside the header files in C++. This means that everytime you change you implementation, client code has to be rebuild. I found thise site which describes how to hide implementation detail in C++: http://www.octopull.demon.co.uk/c++/implementation_hiding.html However I also wanted the code to be generic, so that I didn't have to rewrite the same code for each and every class I create. Here is what I got: #define TL_UTILS_IMPL_DECL(member) \ private: \ class impl; \ impl* member; #define TL_UTILS_IMPL_START(t_class, parent) \ class t_class::impl \ { \ public: \ t_class* parent; \ impl(t_class* self) \ : parent(self) \ {} #define TL_UTILS_IMPL_END() \ }; #define TL_UTILS_IMPL_INIT(member) \ member = new impl(this);
{ "domain": "codereview.stackexchange", "id": 737, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c++", "url": null }
TheInfoList In logic Logic is an interdisciplinary field which studies truth and reasoning. Informal logic seeks to characterize Validity (logic), valid arguments informally, for instance by listing varieties of fallacies. Formal logic represents statements and ar ... and related fields such as mathematics Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes and spaces in which they are contained (geometry), and quantities and their changes (cal ... and philosophy Philosophy (from , ) is the study of general and fundamental questions, such as those about Metaphysics, existence, reason, Epistemology, knowledge, Ethics, values, Philosophy of mind, mind, and Philosophy of language, language. Such questio ...
{ "domain": "theinfolist.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9899864281950694, "lm_q1q2_score": 0.8070690958380347, "lm_q2_score": 0.8152324848629214, "openwebmath_perplexity": 2547.0797066490804, "openwebmath_score": 0.7944034337997437, "tags": null, "url": "http://www.theinfolist.com/html/ALL/s/if_and_only_if.html" }
thermodynamics, thermal-conductivity, heat-engine The answer initially seemed obvious to me: the heat engine is an obstacle between the source and sink and therefore must present some effective (positive) thermal resistance and thus result in a greater temperature of the source in case B than in case A. Someone else thought that the engine would have a cooling effect since it acts to remove some heat from the overall system (turning it into work). I find this implausible but can't think of how to prove it either way. Yes, the heat engine can speed up the transport of heat from the heat source to the heat sink if you add external work to make it happen. In fact, we have mechanical devices that are built precisely for this, and both cars and overclocked computers wouldn't work without them. They're called "radiators" and they are heat engines run as refrigerators. Granted, they're not usually reversible, because we value power over efficiency, but heat pumps, refrigerators, and engines are all in the same class of devices,
{ "domain": "physics.stackexchange", "id": 33919, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "thermodynamics, thermal-conductivity, heat-engine", "url": null }
supernova In the case of a type Ia supernova, the process can completely destroy the white dwarf. In a degenerate helium core there is no destruction and in fact no visible sign even at the surface that the flash has taken place, I think this is because the density and level of degeneracy is much lower, so that once the temperature has risen a little the energy is used to expand the core and the overlying envelope. I suppose the total energy released during the helium flash is also much less than the binding energy of the star, whereas in a type Ia supernova the opposite is true, which is why the star is destroyed.
{ "domain": "physics.stackexchange", "id": 34497, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "supernova", "url": null }
mars, night-sky, naked-eye, phobos Brightness of our Moon varies depending how good a reflector it's surface is, and how much of the surface is in shadow. The Moon is particularly cratered so a half moon is significantly less than half as bright as a full moon. Phobos is so close to Mars that from the surface of Phobos, Mars takes up about 40 degrees of arc in the sky. That casts a huge shadow, so there's no such thing, from Mars, as a full Phobos. As Phobos approaches full, it enters Mars' shadow and it's brightness drops significantly (whether it turns red like a blood moon or just vanishes - I'm not sure, perhaps that's best for another question). But Phobos never becomes full, it gets a bit over 3/4s, then it enters Mars' shadow.
{ "domain": "astronomy.stackexchange", "id": 6660, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "mars, night-sky, naked-eye, phobos", "url": null }
java, mathematics, composition Title: Mapping composition in Java (See also the continuation of this post.) This time, I have a mapping type: com.github.coderodde.mapping.Mapping.java: package com.github.coderodde.mapping; import java.util.HashMap; import java.util.Map; import java.util.Objects; /** * This class implements a mapping from a domain set to a range set. * * @param <D> the domain element type. * @param <R> the range element type. * * @author Rodion "rodde" Efremov * @version 1.6 (Sep 3, 2023) * @since 1.6 (Sep 3, 2023) */ public final class Mapping<D, R> {
{ "domain": "codereview.stackexchange", "id": 44975, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "java, mathematics, composition", "url": null }
python, python-3.x, iterator Performance test: def test_deeplen(iters=200): def _make_bignest(): arrays = [np.random.randn(100, 100), np.random.uniform(30, 40, 10)] lists = [[1, 2, '3', '4', 5, [6, 7]] * 555, {'a': 1, 'b': arrays[0]}] dicts = {'x': [1, {2: [3, 4]}, [5, '6', {'7': 8}] * 99] * 55, 'b': [{'a': 5, 'b': 3}] * 333, ('k', 'g'): (5, 9, [1, 2])} tuples = (1, (2, {3: np.array([4., 5.])}, (6, 7, 8, 9) * 21) * 99, (10, (11,) * 5) * 666) return {'arrays': arrays, 'lists': lists, 'dicts': dicts, 'tuples': tuples} def _print_report(bignest, t0): t = time() - t0 print("{:.5f} / iter ({} iter avg, total time: {:.3f}); sizes:".format( t / iters, iters, t)) print("bignest:", deeplen(bignest)) print(("{} {}\n" * len(bignest)).format( *[x for k, v in bignest.items() for x in ((k + ':').ljust(8), deeplen(v))]))
{ "domain": "codereview.stackexchange", "id": 38317, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, python-3.x, iterator", "url": null }
## 29. The Correct Answer is (C) — You can start by drawing a line between A and O. This line segment has length 5, since it is a radius of the circle and the radius is half the diameter. Also, since the length of AC is 8, you know that the length of AB is half of that, which is 4. You can use the Pythagorean Theorem on the triangle ABO to find that the length of the missing side, BO, is 3. ## 30. The Correct Answer is (A) — Since h(t) is the function of the ball’s height, h(t) = 0 when the ball is on the ground. Setting h(t) to 0 and factoring out –2, you get 0 = –2(t2 – 5t – 50). When you factor this, you get 0 = –2(t – 10)(t + 5), meaning t = –5 or 10. Since you are looking for the time after the ball was launched, you know the answer must be a positive amount of time, meaning it must be 10. ## 31. The Correct Answer is (8) — Subtracting the two equations gives you 2x + 7 – (2x – 1) = 2x + 7 – 2x + 1 = 8. ## 32.
{ "domain": "ivyglobal.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9854964190307041, "lm_q1q2_score": 0.8102644374547483, "lm_q2_score": 0.8221891239865619, "openwebmath_perplexity": 245.41625471863878, "openwebmath_score": 0.6740129590034485, "tags": null, "url": "https://ivyglobal.com/study/explanations/79" }
semiconductor-physics In Eq. (45) of http://jap.aip.org/resource/1/japiau/v53/i10/pR123_s1 you can see the empirical expression: $$\epsilon_i(T) = 1.519 - \frac{5.405\times 10^{-4}T^2}{T+204}$$ where $T$ in obviously in Kelvins. It can be noted that $\epsilon_i(297K) = 1.424eV$. The above expression holds for high-purity materials. Or a better way to say this is that the impurity levels that are so low that they influence the energies by less than $1meV$ which are below our tolerance. By the way, don't consider the above formula is magically perfect. There are a couple of articles which follow the one cited above which come up with better and better microscopic models to explain the temperature dependence of the bandgap. But these are just quantitative differences in fitting. The qualitative behavior of the temperature dependence is still the same.
{ "domain": "physics.stackexchange", "id": 5359, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "semiconductor-physics", "url": null }
- "...does occur in some valuation rings": This is in fact the case in every valuation ring. –  Fred Rohrer Feb 9 '13 at 14:48 It is a limit of open subsets (the subsets containing $P$.) Thus, though it is not set-theoretically an open subset, it behaves scheme-theoretically like an open subset. - What do you mean by "behaves scheme-theoretically like an open subset."? –  Martin Brandenburg Feb 9 '13 at 21:39 e.g. if a property holds on every sufficiently small neighborhood of a point, it usually holds on the local ring. –  Will Sawin Feb 9 '13 at 21:57
{ "domain": "mathoverflow.net", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9706877717925422, "lm_q1q2_score": 0.8109936470358672, "lm_q2_score": 0.8354835309589074, "openwebmath_perplexity": 169.75951425603452, "openwebmath_score": 0.9493064284324646, "tags": null, "url": "http://mathoverflow.net/questions/121297/what-kind-of-subset-is-specr-p-in-specr/121303" }
Note rosenbrock is a vectorized function that can compute values for several points at once. See Vectorization. A vectorized function is best for plotting. For a nonvectorized version, enter: %% ROSENBROCK1(x) expects a two-element vector and returns a scalar % The output is the Rosenbrock function, which has a minimum at % (1,1) of value 0, and is strictly positive everywhere else. function f = rosenbrock1(x) f = 100*(x(2) - x(1)^2)^2 + (1 - x(1))^2; 3. Save the file with the name rosenbrock.m. Constraint functions have the form c(x) ≤ 0 or ceq(x) = 0. The constraint ${x}_{1}^{2}+{x}_{2}^{2}\le 1$ is not in the form that the solver handles. To have the correct syntax, reformulate the constraint as ${x}_{1}^{2}+{x}_{2}^{2}-1\le 0$. The syntax for nonlinear constraints returns both equality and inequality constraints. This example includes only an inequality constraint, so you must pass an empty array [] as the equality constraint function ceq.
{ "domain": "mathworks.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9843363494503271, "lm_q1q2_score": 0.8001348504588872, "lm_q2_score": 0.8128673201042492, "openwebmath_perplexity": 2522.812396972379, "openwebmath_score": 0.6252220273017883, "tags": null, "url": "https://it.mathworks.com/help/optim/ug/example-nonlinear-constrained-minimization.html" }
ros-humble, ros2-control, universal-robots, ros2-controllers, ur-driver gpio/digital_output_6 [94m[available][0m gpio/digital_input_6 [94m[available][0m gpio/digital_output_7 [94m[available][0m gpio/digital_input_7 [94m[available][0m gpio/digital_output_8 [94m[available][0m gpio/digital_input_8 [94m[available][0m gpio/digital_output_9 [94m[available][0m gpio/digital_input_9 [94m[available][0m gpio/digital_output_10 [94m[available][0m gpio/digital_input_10 [94m[available][0m gpio/digital_output_11 [94m[available][0m gpio/digital_input_11 [94m[available][0m gpio/digital_output_12 [94m[available][0m gpio/digital_input_12 [94m[available][0m gpio/digital_output_13 [94m[available][0m gpio/digital_input_13 [94m[available][0m gpio/digital_output_14 [94m[available][0m gpio/digital_input_14 [94m[available][0m gpio/digital_output_15 [94m[available][0m gpio/digital_input_15 [94m[available][0m
{ "domain": "robotics.stackexchange", "id": 38995, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros-humble, ros2-control, universal-robots, ros2-controllers, ur-driver", "url": null }
python, python-3.x, interval def __iter__(self): return takewhile(lambda x: x < self.stop, (self.start + i * self.step for i in count(0))) Note we need no custom iterator or lots of logic. itertools can do most of the heavy lifting. Furthermore, we can update the predicate lambda x: to also include some definition of less than or close to like so: lambda x: x < self.stop and not math.isclose(x, self.stop, ...). Look at math.isclose to see what you need to pass (you need two params, not just tolerance). If you really need __len__: def __len__(self): count = 0 for x in self: count += 1 return count
{ "domain": "codereview.stackexchange", "id": 33253, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "python, python-3.x, interval", "url": null }
# Preface This section serves as a collection of special matrices that play an important role in the theory and applications. Introduction to Linear Algebra with Mathematica # Special Matrices There are many special types of matrices that are encounted frequently in engineering analysis. An important example is the identity matrix given by ${\bf I} = \left[ \begin{array}{cccc} 1&0& \cdots & 0 \\ 0&1& \cdots & 0 \\ \vdots& \vdots & \ddots & \vdots \\ 0&0& \cdots & 1 \end{array} \right] .$ If it is necessary to identify the number n of rows or columns in the (square) identity matrix, we put subscript: $${\bf I}_n .$$
{ "domain": "brown.edu", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9941800395535466, "lm_q1q2_score": 0.8009434415069948, "lm_q2_score": 0.8056321889812553, "openwebmath_perplexity": 193.4964166188315, "openwebmath_score": 0.8856301307678223, "tags": null, "url": "https://www.cfm.brown.edu/people/dobrush/am34/Mathematica/ch1/special.html" }
- I guess I described the "annoying method..." –  Arturo Magidin Mar 30 '11 at 18:58 @Arturo: to be fair, my recollection is that when my calculus books discussed this method they left out how to do the third case when $n, m > 2$. –  Qiaochu Yuan Mar 30 '11 at 19:08 I updated the question to include rational functions. Notifying you, in case you think the answer needs editing. –  Aryabhata Mar 31 '11 at 18:50 I feel really awful for necroing, but I can't help but wonder if there's an error. (There likely isn't and I am simply seeing things.) The issue I have is: $$\int_{0}^{2\pi}\cos^{2n} \theta d\theta=\frac{1}{2^n}\int_{0}^{2\pi}\left(e^{i\theta}+e^{-\theta}\right)^{2n} d\theta$$ Using the definition of $\cos \theta$ as $\frac{e^{i\theta}+e^{-i\theta}}{2}$, shouldn't it be: $$\int_{0}^{2\pi}\cos^{2n} \theta d\theta=\frac{1}{2^{2n}}\int_{0}^{2\pi}\left(e^{i\theta}+e^{-\theta}\right)^{2n} d\theta$$ I think you simply forgot the $2$ in the exponent. –  000 Apr 19 '12 at 21:45
{ "domain": "stackexchange.com", "id": null, "lm_label": "1. YES\n2. YES", "lm_name": "Qwen/Qwen-72B", "lm_q1_score": 0.9763105342148367, "lm_q1q2_score": 0.8027119092455175, "lm_q2_score": 0.8221891305219504, "openwebmath_perplexity": 328.01934848602536, "openwebmath_score": 0.9916679263114929, "tags": null, "url": "http://math.stackexchange.com/questions/29980/evaluating-int-p-sin-x-cos-x-textdx/29989" }
java appendFile(sourceToAppend, outputFile); } /** * * @param source file to append * @param output final result file * @throws IOException */ public void appendFile(String source, String output) throws IOException { try (FileOutputStream appended = new FileOutputStream(output, true); FileInputStream toAppend = new FileInputStream(source) ) { byte[] buffer = new byte[1024]; while (toAppend.available() > 0) { int count = toAppend.read(buffer); appended.write(buffer, 0, count); } } } } General architecture A useful architecture guideline is: By introducing classes and methods, I create the high-level language that I want to use for expressing my solution.
{ "domain": "codereview.stackexchange", "id": 38386, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "java", "url": null }
computational-chemistry Title: Conversion of Z-matrix to Cartesian coordinates To begin with, I wrote a script that gets Cartesian coordinates of molecule as input in the below. These are $x,y,z$ coordinates of H2O2 molecule. 1 O -1.7529 -0.5188 1.3324 2 O -0.4737 -0.1091 0.7774 3 H -2.2902 0.1678 0.8933 4 H 0.0636 -0.7957 1.2164 Then, the script constructs a Z-matrix with them, like this: Z-mat : O O 1 1.45335189476 H 1 0.976176039452 2 96.5694760083 H 2 0.976131061897 1 96.5720363573 3 -179.995395182 Now I need to perform the reverse operation and use this Z-matrix as input and define $x,y,z$ coordinates for each atom. This is converting a Z-matrix to Cartesian coordinates. My question is after setting first atom as 0,0,0 1 O 0 0 0 and the second one as 0,0,(distance from first) to put it on the z-axis 2 O 0 0 1.45335189476
{ "domain": "chemistry.stackexchange", "id": 9537, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "computational-chemistry", "url": null }
c#, unit-testing, static, unity-container In my unit test project fake interface and call static init _config = A.Fake<IConfigurationReader>(); HeaderHelper.Init(_config); In my unit test fake call to GetAppSetting A.CallTo(() => _config.GetAppSetting("AES")).Returns(AesKey); You're doing it wrong. You can't do Dependency Injection and have static class dependencies scattered throughout your code: when you do Dependency Injection, you need to go all the way or not at all, else you gain the complexity and lose the benefits. Proper DI goes like this: Register: Set up your IoC container and register dependencies. Resolve: Resolve the entire application's dependency graph - this is ONE method call. Release: Dispose any disposables, clean up and tear down.
{ "domain": "codereview.stackexchange", "id": 21551, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "c#, unit-testing, static, unity-container", "url": null }
object-oriented, coordinate-system, pascal definition function TCoords.ToString(const Delimiter: string = ':'): string; begin // setting empty result for debugging purposes solely Result := ''; // this can happen only if constructor TCoords.Create; has been used if not IsInitialized then begin raise Exception.Create('TCoords.ToString: `FCoords: TPoint` member has not yet been initialized'); end; // it does not make sence for the user to input empty delimiter // as that would lead to concatenating XY without any delimiter if Delimiter.IsEmpty then begin raise Exception.Create('TCoords.ToString: `Delimiter: string` argument is empty'); end; // example: X=0, Y=1, Delimiter=' x ' would return '0 x 1' Result := FCoords.X.ToString + Delimiter + FCoords.Y.ToString; end; unit Coords; ^
{ "domain": "codereview.stackexchange", "id": 34600, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "object-oriented, coordinate-system, pascal", "url": null }
ros-kinetic Originally posted by Gayan Brahmanage with karma: 929 on 2018-03-09 This answer was ACCEPTED on the original site Post score: 3
{ "domain": "robotics.stackexchange", "id": 30240, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "ros-kinetic", "url": null }
species-identification, entomology However, zooming into some of your more-detailed specimens in the 2nd photo immediately made me questions this: Your specimen appears to lack a prominent cauda sticking off the center of their backside; further, they appear to have some sort of palps around the mouth and a fairly hypognathus head -- all of these characteristics are inconsistent with any aphids I know. Lack of a furcula (among other details) rules out springtails. Your specimens appear to have filiform antennae, which doesn't preclude aphids or many other insect orders including beetles, roaches, and orthopterans (e.g., grasshoppers).
{ "domain": "biology.stackexchange", "id": 11750, "lm_label": null, "lm_name": null, "lm_q1_score": null, "lm_q1q2_score": null, "lm_q2_score": null, "openwebmath_perplexity": null, "openwebmath_score": null, "tags": "species-identification, entomology", "url": null }