Jump to content

Sensei

Senior Members
  • Posts

    7949
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by Sensei

  1. 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.
  2. 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..
  3. 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.
  4. 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 ), (....)"
  5. Download, install and play with some 3D software. e.g. Blender, Lightwave, Maya etc (but majority of 3d apps have 30 day trials)..
  6. 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..
  7. @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
  8. Sensei

    Cramming

    Read the textbooks for the next year school season during summer holidays.
  9. 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
  10. 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.
  11. 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 ); }
  12. @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...
  13. 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.
  14. You have similar thing in French. If you have a vowel, the letter "s" followed by the next vowel, although part of the next word in a sentence, changes the pronunciation of "s" to "z". As in this example: "parlez vous anglais?" (put it in Google Translate and press the speaker icon). It has "u", "s", and "a" in two different words. then try: "parlez vous japonais?" (listen to Google Translate: s becomes silent!)
  15. (text) creates "capturing group", which can be referenced during replacing by e.g. $1, $2 etc. (or other following digit) Use one of many on-line regular expressions debuggers, if you have any objections. Like this one for example: https://regex101.com/
  16. Anonymization of exams is a good idea. A person should be judged by knowledge, not by the surname or the depth of the pockets of the parents.
  17. "Massless" means "having no rest-mass".. i.e. "having no frame of reference in which particle is at rest". In the case of massive particle e.g. electron or proton, you can use external forces like electrostatic, to keep particle at rest. In electromagnetic trap.
  18. https://en.wikipedia.org/wiki/Area_of_a_circle "Modern mathematics can obtain the area using the methods of integral calculus or its more sophisticated offspring, real analysis." e.g. you can calculate area of any shape using calculus.. "Using calculus, we can sum the area incrementally, partitioning the disk into thin concentric rings like the layers of an onion. This is the method of shell integration in two dimensions. For an infinitesimally thin ring of the "onion" of radius t, the accumulated area is 2πt dt, the circumferential length of the ring times its infinitesimal width (one can approximate this ring by a rectangle with width=2πt and height=dt). This gives an elementary integral for a disk of radius r."
  19. Make screen-shot and attach.. Problem with display CRT, LCD or LED, is completely different problem than e.g. UTF-8/Unicode issues during translation, or entire network transmission being passed through hacker's proxy server without HTTPS anywhere..
  20. Your question is ambiguous. I am wondering whether you're talking about instructions of TCP protocol or instruction like command-line or what else? If you want to learn PID you can try: Dump all active processes to a text file before running something, dump it again after running something, compare the differences between text files.. and you will know which processes were created by "something". You can make a script. Dump, compare, display differences, wait 0.1-1s, repeat.
  21. Too long to quote. It will be fun only for programmers. https://hackernoon.com/how-it-feels-to-learn-javascript-in-2016-d3a717dd577f
  22. (if you're on Windows) did you try winsound.Beep? https://docs.python.org/3/library/winsound.html
  23. Write your own code?
  24. ...."Then a voice came from Heaven and said: go to the elections next month and vote properly, and your prayers will be heard, my beloved children".....
×
×
  • 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.