limits

Set points outside plot to upper limit

橙三吉。 提交于 2019-12-12 11:09:50
问题 Maybe this question exists already, but I could not find it. I am making a scatter plot in Python. For illustrative purposes, I don't want to set my axes range such that all points are included - there may be some really high or really low values, and all I care about in those points is that they exist - that is, they need to be in the plot, but not on their actual value - rather, somewhere on the top of the canvas. I know that in IDL there is a nice short syntax for this: in plot(x,y<value)

Why is numeric_limits<int>::max() > numeric_limits<int>::infinity()?

我与影子孤独终老i 提交于 2019-12-12 09:29:00
问题 I was reading Setting an int to Infinity in C++. I understand that when one needs true infinity, one is supposed to use numeric_limits<float>::infinity() ; I guess the rationale behind it is that usually integral types have no values designated for representing special states like NaN , Inf , etc. like IEEE 754 floats do (again C++ doesn't mandate neither - int & float used are left to the implementation); but still it's misleading that max > infinity for a given type. I'm trying to

R outer function Error in persp.default(x, y, z) : invalid 'z' limits

断了今生、忘了曾经 提交于 2019-12-11 10:55:30
问题 could someone explain to me why these two pieces of codes return two diferent things? the first one : x<-y<-seq(from=-1,to=1,by=0.1) one<-function(x,y){ x } z<-outer(x,y,FUN=one) persp(x,y,z) returns the surface it should. while : x<-y<-seq(from=-1,to=1,by=0.1) one<-function(x,y){ array(1, dim=length(x)) } z<-outer(x,y,FUN=one) persp(x,y,z) returns : "Error in persp.default(x, y, z = outer(x, y, one)) : invalid 'z' limits" 回答1: For the second case, plotting the plane z=1 , you just need to

How would I print the largest possible float and double in C?

十年热恋 提交于 2019-12-11 02:53:57
问题 For the following code, #include <stdio.h> #include <limits.h> #include <float.h> int main(void) { printf("double max = %??\n", DBL_MAX); printf("double min = %??\n", DBL_MIN); printf("double epsilon = %??\n", DBL_EPSILON); printf("float epsilon = %??\n", FLT_EPSILON); printf("float max = %??\n", FLT_MAX); printf("float min = %??\n\n", FLT_MIN); return 0; } what specifiers would I have to use in place of the ??'s in order for printf to display the various quantities as appropriately-sized

How to use bash to test directory limits of filesystem

泪湿孤枕 提交于 2019-12-10 23:13:04
问题 I need to test how many directories and files I can create on a filesystem (network mounted and local (usb) drives). I now use this bash line: for i in {0..999999}; do mkdir -p $i; pushd $i; done I know that it probably can be done better and I'd like to know how to. (in bash, not too complicated) 回答1: while (true); do mkdir a cd a done Creates something like ./a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/ ... 回答2: Any file/directory is represented using an inode, take a look at df -i and you

Delphi EOutOfResources (GDIError)

我怕爱的太早我们不能终老 提交于 2019-12-10 18:43:17
问题 I have written an application in which I find ocasionally EOutofResources errors raised by GDIError method of Graphics unit when saving TBitmap32 to a stream. As far as I know it can come from gdi limits or heap limits. i know that for the process there is a default limit of 10000 handles. So my application according to the task manager reports only 620. I have downloaded and run Desktop Heap Information Monitor Tool which reported this: Desktop Heap Information Monitor Tool (Version 8.1.2925

Can an expression be too long in a c program for gcc to compile?

℡╲_俬逩灬. 提交于 2019-12-10 18:23:54
问题 Let's say I input a very long equation on to a single line of c code (either a .c or .h file) that is thousands (perhaps tens of thousands) of characters long; for example y = (2*(36*pow(x,2)*pow(A[n][j],5)*B[n][j] + (several thousand more such expressions) ) ; (here just take x to be a variable, A, B to be double pointers, etc). Is there a limit for how long a line of code can be in a .c or .h file before say the gcc compiler is unable to correctly compile the code? I've read several related

C++ next float with numeric_limits / epsilon?

落爺英雄遲暮 提交于 2019-12-10 16:59:40
问题 Consider a "normal" real number TREAL x in C++ (not subnormal and not NaN/Infinite) ( TREAL = float , double , long double ) Is the following the good solution to find the previous and next x from a floating-point point of view ? TREAL xprev = (((TREAL)(1.)) - std::numeric_limits<TREAL>::epsilon()) * x; TREAL xnext = (((TREAL)(1.)) + std::numeric_limits<TREAL>::epsilon()) * x; Thank you very much. 回答1: C99 and C++11 have nextafter, nextafterl and nextafterf functions in <math.h> and <cmath> .

Does `sp_executesql` really accepts the `nvarchar(max)` argument?

假如想象 提交于 2019-12-10 15:34:35
问题 Summary: The EXEC sp_executesql @code fails for the content longer than 4000 in the @code , but the @code is not truncated to 4000 unicode characters. I am observing the problem on SQL Server 2014 Developer Edition. More details: my SQL installation script defines some code dynamically because it should modify the code so that it reflects the environment (only once, during the installation). Let the following @datasource variable captures results for the specific environment: DECLARE

Different values returned by ulimit -r

为君一笑 提交于 2019-12-10 14:34:46
问题 I added to my system-wide /etc/security/limits.conf the following two rows: * soft rtprio 55 * hard rtprio 55 After a system reboot, I get two different results according to the way I access my user account on the machine. user@client# ssh user@server user@server# ulimit -r 55 Then I logout and login again as root user@client# ssh root@server root@server# su - user user@server# ulimit -r 0 I have no special settings neither in .bashrc nor in any other places, or, at least, I think so. Why is