Jump to content


Senior Members
  • Content Count

  • Joined

  • Last visited

  • Days Won


Sensei last won the day on March 26

Sensei had the most liked content!

Community Reputation

1001 Glorious Leader


About Sensei

  • Rank

Profile Information

  • Interests
    Quantum Physics, C/C++/.NET Framework/Java programming.
  • Favorite Area of Science
    Quantum Physics

Recent Profile Visitors

49243 profile views
  1. ...did not you just posted thread with title "what is the 3rd dimension?"..... ?
  2. That's job of personal firewall. When I was using WinXP, in the past, I was using Sygate Personal Firewall. Unfortunately it does not work with any new Windows. During making connection from unknown app, to the Internet, it was asking and blocking connection, showing user dialog, with question whether to make such connection with the all details about it, IP, port, protocol, packet details etc. Packets could be logged, diagnosed, analyzed etc. etc.
  3. Correct. Using built-in C/C++ srand()/rand(). But you are free to use alternative pRNG.. Pick up one https://en.wikipedia.org/wiki/List_of_random_number_generators That's not true (i.e. it can be easily bypassed).. You just need to restart with different random seed at random moment.. but you have to use milliseconds, microseconds or nanoseconds timers to initialize random seed for a start. That's also not true (i.e. it can be easily bypassed).. You just need to generate two or more random values, rather than just one. e.g. ( rand() * ( RAND_MAX+1 ) + rand() ) will give you RAND_MAX ^2 = 1 073 741 824 values between. Casting to float (32 bit) will even cut some digits (mantissa of single IEEE 754 has 23 bits). If intended to be used with double (64 bit), you can use 4x rand() merged together like above in a row. People learn on mistakes. So they must be clearly stated. If somebody will read these posts in the future, must know that there was some issue with it. Otherwise will think it's correct and will repeat your mistake by himself/herself. In your link there is example source code with much better implementation of pRNG code (with high precision timer, and better quality pRNG)... and you cut it out in your reply..
  4. If you have script checking log file *) every second you will have just one second delay between connection and information to user. User won't be even able to read information in such short time.. So tell me why such delay is a problem? *) or use tail -f with grep. any update to a file will be printed to console. https://shapeshed.com/unix-tail/#how-to-watch-a-file-for-changes https://www.networkworld.com/article/3529891/watching-activity-on-linux-with-watch-and-tail-commands.html You could also try TCP proxy. Original app should connect to your proxy, and proxy make connection for real. Then you can even make it interactive with user consent or rejection of the connection.
  5. Simply, it is not true. Regular expression has some special characters with special meanings. "U" is not one of them. It is normal letter from point of view of regex. https://www.google.com/search?q=regular+expression+special+characters "In the regex flavors discussed in this tutorial, there are 12 characters with special meanings: the backslash \, the caret ^, the dollar sign $, the period or dot ., the vertical bar or pipe symbol |, the question mark ?, the asterisk or star *, the plus sign +, the opening parenthesis (, the closing parenthesis ), (....)"
  6. Download, install and play with some 3D software. e.g. Blender, Lightwave, Maya etc (but majority of 3d apps have 30 day trials)..
  7. If it is already in this file, why not to use e.g. grep on it, to extract it? or make Perl or Python or bash script to parse it..
  8. @VenusPrincess Why are you adding 1 in the line: sample = (double)rand() / (RAND_MAX + 1.0); rand() result can be up to RAND_MAX, so RAND_MAX / ( RAND_MAX + 1 ) will never ever give you sample = 1.0 ... 32767 / 32768 = 0.999969482421875
  9. Sensei


    Read the textbooks for the next year school season during summer holidays.
  10. Triangles (in 2D and 3D space) are exclusively convex and planar. Quads can be convex or concave. in 3D they are also often non-planar. https://en.wikipedia.org/wiki/Convex_polygon https://en.wikipedia.org/wiki/Concave_polygon There is many ways quads (or n-gons, typical name for polygons with more than four vertexes) can be triangulated. The most simple triangulation algorithms are triangle strip and triangle fan. https://en.wikipedia.org/wiki/Triangle_strip https://en.wikipedia.org/wiki/Triangle_fan They work reliably only with quads and n-gons which are planar and convex. With non-planar and concave polygons they can result in many kinds of issues. They are used just because they are extremely fast for CPU/GPU. 3D non real-time renderer is typically using ray-tracing. It is much faster to find intersection between ray and triangle (or ray and plane), than ray and quad/n-gon. Example ray-triangle algorithm: https://en.wikipedia.org/wiki/Möller–Trumbore_intersection_algorithm
  11. No, in regular expressions it does NOT mean union.... https://stackoverflow.com/questions/8020848/how-is-the-and-or-operator-represented-as-in-regular-expressions You mixed two different independent things. Regular expressions with mathematics (set theory).. If you would enter a sample regular expression with a sample text string into the online debugger, you should see that it doesn't work as you think.
  12. No. It is used to calculate distance between two points. Length of line/segment. Pythagorean Theorem is used at the lowest-level. I mentioned example usages that you might know from your daily life. Zooming-in might not work if programmer wanted/predicted it. Curve can be dynamically sub-divided to single pixel precision on the display.. In typical 3D games everything is made of triangles. If you would be able to zoom-in infinitely, you will reach triangle, with flat surface. Even though object looked like sphere at full scale, at the end it is made of triangles, in enough quantity to pretend sphere. But if programmer knew users will be zooming in, could use adaptive sub-division techniques. https://www.google.com/search?q=adaptive+subdivision Seriously? Do you know C/C++? Calculate point on Catmull-Rom curve in C/C++ might look like: CVector GetSplinePointAt( const CVector &position0, const CVector &position1, const CVector &position2, const CVector &position3, double time ) { ENTER( "GetSplinePointAt()" ); double time2 = time * time; double time3 = time2 * time; double h2 = 3.0f * time2 - time3 - time3; double h1 = 1.0f - h2; double h4 = time3 - time2; double h3 = h4 - time2 + time; CVector v1 = position1 - position0; CVector v2 = position2 - position1; CVector v3 = position3 - position2; double v1length = v1.Length(); double v2length = v2.Length(); double v3length = v3.Length(); CVector r1 = ( v1 * v2length + v2 * v1length ) / ( v1length + v2length ); CVector r2 = ( v2 * v3length + v3 * v2length ) / ( v2length + v3length ); CVector position = h1 * position1 + h2 * position2 + h3 * r1 + h4 * r2; LEAVE( "GetSplinePointAt()" ); return( position ); } where CVector class method Length() implementation is: double CVector::Length( void ) const { double x = m_Vector[ 0 ]; double y = m_Vector[ 1 ]; double z = m_Vector[ 2 ]; double temp = ( x * x ) + ( y * y ) + ( z * z ); if( temp > 0.0 ) { return( sqrt( temp ) ); } return( 0.0 ); } Which is equation from Pythagorean Theorem. If you never heard of Catmull-Rom spline: https://en.wikipedia.org/wiki/Catmull-Rom_spline eventually https://en.wikipedia.org/wiki/Centripetal_Catmull–Rom_spline In programming it can/will be brute-force summation of the all small segments with required precision (i.e. if something is smaller than 1 pixel on user screen, it is enough, in typical usage). BTW, at the first sight, the above code has error: division by zero. But when we will look at overloaded division operator code, it is handled: CVector operator / ( const CVector &vector1, double value ) { CVector vector = vector1; if( value != 0.0 ) { vector.m_Vector[ 0 ] /= value; vector.m_Vector[ 1 ] /= value; vector.m_Vector[ 2 ] /= value; } return( vector ); }
  13. @koti BTW, I have advice for you Koti, and for other members for the future.. When you're quoting something found on the Internet, don't thoughtlessly copy'n'paste it, but remove any tracking code which allows uniquely identify who you are.. e.g. strip URL to the absolute minimum e.g. without query string and fragment string. Sometimes tracking code is inside of path (and translated by rewrite_engine, but it is minority, at the moment). I can tell when somebody read my e-mails sent to customers with precision to second, and how many times they opened e-mail prior replying with the all details what they used to read it etc etc.. Link https://www.sciencenews.org/article/physics-first-room-temperature-superconductor-discovery Works as good as yours...
  14. Nope. It is just useful mathematical tool. You use Pythagorean Theorem when you're calculating distance between two points, in e.g. Euclidean space: [math]a^2 + b^2=c^2[/math] transform it to solve c : [math]c=\sqrt{a^2 + b^2}[/math] Then in physics we often see it as: [math]ds=\sqrt{dx^2 + dy^2}[/math] and in three dimensions: [math]ds=\sqrt{dx^2 + dy^2 + dz^2}[/math] Programmers can use it to e.g. calculate length of curve. Divide curve to sequence of (very short) straight lines and then sum their lengths together. App which tells how how much you walked per day used by sportsmen or people on diet, taxi/Uber/TIR driver, airplanes etc. , to measure distance of travel, will use it too with coordinates (latitude,longitude) returned by GPS, then transformed to 3D coordinate on sphere.
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.