Everything posted by Sensei
-
Rador: Light and Impact.
The only "shock wave" we have reading layman's post on the forum..
-
Crazy people in Canada also
It is also the result of propaganda.. If you prevent people from openly sharing extremist ideas, it doesn't mean that those people will automatically disappear.. They still have their worldview, but hidden underground, sharing it only with people similar to themselves.. Spreading to children and family..
-
Confused about recursion in python-depth first search-:
General tip: Search net for "python online debugger". It will give you for example: https://www.onlinegdb.com/online_python_debugger Copy'n'paste code, and debug it, step-in, step-out, step-over etc. Observe what Python interpreter is doing. Observe how variables change every line.
-
How to make 133kv
@Johnn From the regular electrical grid? There is a couple possibilities. Usually fairly inexpensive, as long as you create them yourself. Cockcroft-Walton generator: https://en.wikipedia.org/wiki/Cockcroft–Walton_generator Marx generator: https://en.wikipedia.org/wiki/Marx_generator Tesla coil: https://en.wikipedia.org/wiki/Tesla_coil Van de Graaff generator: https://en.wikipedia.org/wiki/Van_de_Graaff_generator
-
spotlight optics
Experimenting with simulated spotlight inside a 3D application (for a quick check of results): The mathematical equation is rather self-explanatory.
-
spotlight optics
Why is it in physics? Sounds like a Computer Science topic, Ray-Tracing, to me.. https://en.wikipedia.org/wiki/Ray_tracing_(graphics) In simulations of real world, we usually have light sources with different types: distant, point, spotlight, area, environment, dome, IES. The main difference between them is the direction vector of the light sample. The distant light type has a uniform vector of light sample direction. It is used to simulate sunlight that is nearly parallel (due to the great distance between the Sun and Earth). The point light type has the light sample direction vector is calculated by the formula: Normalize( hit_position - light_position ) The spotlight type is a compilation of the point light type with the distant light type. You have a vector like in distant type and calculate a vector like in point type (both must be normalized!) and if you will do a dot-product between them you will get a cosine, use arc-cosine to get the angle in radians/degrees, and pass to the gradient function which will return 0 for no light in that direction, or 1 for full intensity, and 0...1 for a smooth transition between the two extremes. When you have both the surface normal vector and the light sample direction vector calculated, you do -dot_product( surface_normal, light_sample_direction ) (note: MINUS!). Then you should get rid of the negatives by max(x,0). Repeat the procedure with more samples from the same light (for multi-sample lights like IES, dome, environment, area), and iterate through all the lights in the scene. To have shadows in backward ray-tracing, the programmer should cast the ray from the hit_position in the direction REVERSE to the direction of the light sample (as in the point light type). If the ray-cast function hits another object before reaching the light position, the evaluated spot is in shadow, and the light sample has no effect on that spot. I hope it will help a bit.
-
What is the best tools/method to draw honeycombs(hexagon)?
Where? In a 3D app? In OpenGL/Direct3D? In the Unity/Unreal etc. game engine? In C/C++/C#/Java etc. ? C/C++ code: void moveTo( int x, int y ) { // fill me } void lineTo( int x, int y ) { // fill me } void hexagon( int x, int y, int radius ) { for( int i = 0; i < 6; i++ ) { double angle1 = 2.0 * M_PI * 360.0 * i / 6; double angle2 = 2.0 * M_PI * 360.0 * ( i + 1 ) / 6; moveTo( x + sin( angle1 ) * radius, y + cos( angle1 ) * radius ); lineTo( x + sin( angle2 ) * radius, y + cos( angle2 ) * radius ); } } In the 3D application. I used the Sphere tool, set Z to 0 to have a circle, changed the number of segments to 6, and then used the Array tool:
-
America bucks the world omicron trend
How many % of these people are obese? https://www.weforum.org/agenda/2020/05/this-is-why-people-with-obesity-are-more-likely-to-die-from-coronavirus
-
A decent free backup software
@StringJunky The keyword here are "laptop", "preinstalled OS"/"OEM OS".. https://en.wikipedia.org/wiki/Original_equipment_manufacturer All of the laptops I bought came with Windows OEM pre-installed. The older ones came with a label on the back with a license key. The newer ones have it encoded into the hardware. All of the desktop computers (x86, Macs excluded) that I bought did not have an operating system pre-installed. They were simply separate pieces of hardware...
-
A decent free backup software
Aren't you talking about laptops that have the OS preinstalled by default? https://www.google.com/search?q=read+license+key+from+laptop+motherboard
-
A decent free backup software
Disk failure (especially HDD which takes more energy than SSD) can be a sign of cable problems or PSU problems.. 1) replace SATA cables. 2) replace PSU. Measure the voltages on the power supply. Without a heavy load and with a heavy load. ps. All my problems with PC for the last year were caused by the PSU giving too low a voltage at random times. Periodic heavy use of the CPU/GPU, plugging in DVD drives and several drives caused them to occur faster. PSU does not have to be permanently damaged. It just can give you 4.5V instead of 5V and 11V or 13V instead of 12V. When there is heavy HDD usage, HDD is shutting down, and cannot start spinning again, until reboot. Data on NTFS is lost and logical errors start appearing on volumes. And OS becomes unstable.
-
Don't Look Up (Film)
I saw the movie and enjoyed it. Personally, I think real politicians would have fared worse in a similar crisis. Humanity is facing a climate change crisis. All the politicians have done is raise taxes on CO2 emissions, which has only hit ordinary people in the pockets.. Any reason to raise taxes is good for politicians, all kinds of politicians.. People who have less money in their pockets are less likely to buy expensive electric cars, install renewable power generators, upgrade their homes to zero emission, etc. etc. Which causes people to turn away, to become discouraged, to start fighting change because it affects them personally.. If a crisis similar to the one depicted in the movie were to happen for real, we can expect to see taxes raised..
-
James Webb Telescope and L2 Orbit Question
BTW, if anyone is interested in where JW Telescope is, there is an online tracker available: https://www.jwst.nasa.gov/content/webbLaunch/whereIsWebb.html
-
A decent free backup software
Configure RAID in mirror mode. https://en.wikipedia.org/wiki/Standard_RAID_levels
-
Electron transfer reactions question (ElectroChemistry)
As usual in these kinds of questions... Answer them accordingly to your knowledge.... Otherwise it will be a lie! If you don't know the answers to the questions, then you need to read and learn something that is still missing...
-
Merry Christmas!
Merry Christmas! Dear friends, during Christmas we share gifts, so I did not come empty handed, but I have gifts for you. C# scripts that you can compile yourself on your Windows computers (sorry Linux geeks!). ScreenCapture Compilation: On Windows 7+ it should work without any additional installation. On Vista change the version from v3.5 to v3.0, or install .NET Framework v3.5, if needed. On WinXP install .NET Framework v3.5+, if needed. Start, cmd, cd [the location where you stored ScreenCapture.cs] %SYSTEMROOT%\Microsoft.NET\Framework\v3.5\csc ScreenCapture.cs If you are having problems, you can change from v3.5 to the version you have installed. Verify it by dir %SYSTEMROOT%\Microsoft.NET\Framework\v* Usage: e.g. ScreenCapture -d -v %TEMP%\picture.png ScreenCapture -d D:\screen-shots\picture.jpg ScreenCapture D:\screen-shots\image.bmp It will generate image files e.g. picture_20211226_173530.png picture_20211226_173532.jpg image.bmp with datestamp i timestamp included in the file name (thanks to -d option). File name is unique per second. If you want to add milliseconds, modify the dateformat string in line #115 to e.g. string dateformat = "_yyyyMMdd_HHmmss_fff"; https://docs.microsoft.com/en-us/dotnet/standard/base-types/how-to-display-milliseconds-in-date-and-time-values Assign it to the 3rd mouse button and/or hotkey for quick access and press on demand. Image files will be created in the desired location. Source code: // ScreenCapture v1.0.1 (c) 2021 Sensei // Capture the screen to an image file // // Usage: // ScreenCapture [-d|--datestamp] [-v|--verbose] filename // // Compilation: // %SYSTEMROOT%\Microsoft.NET\Framework\v3.5\csc ScreenCapture.cs // using System; using System.IO; using System.Runtime.InteropServices; using System.Drawing; using System.Drawing.Imaging; using System.Collections.Generic; public class ScreenCapture { private class GDI32 { public const int SRCCOPY = 0x00CC0020; [DllImport("gdi32.dll")] public static extern bool BitBlt( IntPtr hDCDst, int nXDst, int nYDst, int nWidth, int nHeight, IntPtr hDCSrc, int nXSrc, int nYSrc, int dwRop ); [DllImport("gdi32.dll")] public static extern IntPtr CreateCompatibleBitmap( IntPtr hDC, int nWidth, int nHeight ); [DllImport("gdi32.dll")] public static extern IntPtr CreateCompatibleDC( IntPtr hDC ); [DllImport("gdi32.dll")] public static extern bool DeleteDC( IntPtr hDC ); [DllImport("gdi32.dll")] public static extern bool DeleteObject( IntPtr hObject ); [DllImport("gdi32.dll")] public static extern IntPtr SelectObject( IntPtr hDC, IntPtr hObject ); } private class User32 { [StructLayout(LayoutKind.Sequential)] public struct Rect { public int left, top, right, bottom; } [DllImport("user32.dll")] public static extern IntPtr GetDesktopWindow(); [DllImport("user32.dll")] public static extern IntPtr GetWindowDC( IntPtr hWnd ); [DllImport("user32.dll")] public static extern IntPtr GetWindowRect( IntPtr hWnd, ref Rect rect ); [DllImport("user32.dll")] public static extern IntPtr ReleaseDC( IntPtr hWnd, IntPtr hDC ); [DllImport("user32.dll")] public static extern int SetProcessDPIAware(); } public static Image CaptureScreen() { return CaptureWindow( User32.GetDesktopWindow() ); } public static Image CaptureWindow( IntPtr hWnd ) { IntPtr hDCSrc = User32.GetWindowDC( hWnd ); User32.Rect rect = new User32.Rect(); User32.GetWindowRect( hWnd, ref rect ); int width = rect.right - rect.left; int height = rect.bottom - rect.top; IntPtr hDCDst = GDI32.CreateCompatibleDC( hDCSrc ); IntPtr hBitmap = GDI32.CreateCompatibleBitmap( hDCSrc, width, height ); IntPtr hBitmapOld = GDI32.SelectObject( hDCDst, hBitmap ); GDI32.BitBlt( hDCDst, 0, 0, width, height, hDCSrc, 0, 0, GDI32.SRCCOPY ); GDI32.SelectObject( hDCDst, hBitmapOld ); GDI32.DeleteDC( hDCDst ); User32.ReleaseDC( hWnd, hDCSrc ); Image image = Image.FromHbitmap( hBitmap ); GDI32.DeleteObject( hBitmap ); return( image ); } public static void CaptureScreenToFile( string filename ) { string extension = Path.GetExtension( filename ); if( String.IsNullOrEmpty( extension ) ) throw( new Exception( "Missing extension" ) ); ImageFormat format = GetImageFormatByExtension( extension ); Image image = CaptureScreen(); image.Save( filename, format ); } public static ImageFormat GetImageFormatByExtension( string extension ) { Dictionary<String, ImageFormat> formats = new Dictionary<String, ImageFormat>(); formats.Add( "bmp", ImageFormat.Bmp ); formats.Add( "emf", ImageFormat.Emf ); formats.Add( "exif", ImageFormat.Exif ); formats.Add( "jpg", ImageFormat.Jpeg ); formats.Add( "jpeg", ImageFormat.Jpeg ); formats.Add( "gif", ImageFormat.Gif ); formats.Add( "png", ImageFormat.Png ); formats.Add( "tiff", ImageFormat.Tiff ); formats.Add( "wmf", ImageFormat.Wmf ); try { extension = extension.Substring( 1 ); extension = extension.ToLower(); return( formats[ extension ] ); } catch( Exception e ) { throw( new Exception( "Unknown extension " + extension, e ) ); } } public static void Help() { Console.WriteLine( "ScreenCapture v1.0.1 (c) 2021 Sensei" ); Console.WriteLine( "Usage:" ); Console.WriteLine( "ScreenCapture [-d|--datestamp] [-v|--verbose] filename" ); } public static void Main( string [] args ) { if( Environment.OSVersion.Version.Major >= 6 ) { User32.SetProcessDPIAware(); // Added in Vista OS. } if( args.Length > 0 ) { string dateformat = "_yyyyMMdd_HHmmss"; bool datestamp = false; bool verbose = false; for( int i = args.Length - 2; i >= 0; i-- ) { string arg = args[i]; if( arg.Equals( "-d" ) || arg.Equals( "--datestamp" ) ) { datestamp = true; } else if( arg.Equals( "-v" ) || arg.Equals( "--verbose" ) ) { verbose = true; } } string filename = args[ args.Length - 1 ]; if( datestamp ) { string extension = Path.GetExtension( filename ); filename = filename.Substring( 0, filename.Length - extension.Length ); filename = filename + DateTime.Now.ToString( dateformat ) + extension; } try { CaptureScreenToFile( filename ); if( verbose ) Console.WriteLine( "Screen captured to " + filename ); } catch( Exception e ) { Console.WriteLine( e.Message ); } } else { Help(); } } } Please don't hesitate to share your ideas for improvement. ScreenCapture.cs
-
Tunnel effect
Tunnel effect or quantum tunneling? https://en.wikipedia.org/wiki/Tunnel_effect https://en.wikipedia.org/wiki/Quantum_tunnelling
-
Warp drive theories
...the science forum warped colors after analyzing your thread...
-
Introductory Algorithms and Data Structures in Python-book recommendations
Keywords for the search engine: binary search, binary tree, quad tree, octree, kd-tree, bsp-tree, hash map/hash table. Read Wikipedia of these space-partitioning algorithms. They work with 1D and/or 2D and/or 3D.
-
By which physical properties do isotopes actually differ
There are ~ 3131 isotopes of 118 elements. The vast majority unstable or extremely unstable. Which one do you want to know? You need to be specific. The vast majority of these isotopes have not been isolated in sufficient quantity to properly test their physical and chemical differences from the most abundant stable isotopes of the element. The differences between the isotopes are used to isolate them. The most noticeable differences are only apparent at the quantum level, i.e., to isolate a single isotope or element, a mass spectrometer can be used. Isotopes/elements with different m/e deflect differently in a strong magnetic field and accelerate differently (due to mass difference) in an electric field. Mass vary significantly from isotope to isotope, from element to element. In the case of Hydrogen-Deuterium-Tritium it is +100% / +200%. In the case of Uranium-235 vs U-238 it is just +1%...
-
The next pandemic : What have we learned ?
..these fines are generally senseless.. It is procedure "how to produce domestic terrorists" | "how to produce criminals".. etc. etc. ..restaurants can sell on-line (and should! as long as they are not luxury restaurants they can operate pretty fine with on-line sales, if people can't go any restaurant nor shop, and there is a reliable delivery system) but there are businesses which completely rely on client coming in physically, and 1) unable to freely operate and 2) have to pay debts, office rents, fines (?) and 3) get fined if they are open... An endless loop... Not possible to pay fine, if you don't operate, and can't operate unless breaking the law which prohibits being open.. Complete madness.. Mutually exclusive..
-
The next pandemic : What have we learned ?
The stupidest action that was done was the evacuation of tourists, businessmen, citizens, to the homeland.... https://en.wikipedia.org/wiki/Evacuations_related_to_the_COVID-19_pandemic Which was basically importing the disease into the country.. What tourists do when they return home after a week or two of vacation? They go to the store or mall to buy food, where they spread disease to the local population (hard/impossible to track).. Then they meet family, friends, colleagues, neighbors (possible to track, if people are honest) and the disease spreads..
-
The war in China ? What can provoke and stop such events if it ever were to happen ?
Bizarre you listed some (pretty sci-fi) reasons for war in Asia with China, or even initiated by China, and "forgot", omitted the most obvious reason.. (and obviously I did not mean COVID-19..) The modern design of nuclear power plants is designed to reduce the possibility of an explosion whether it is attacked or affected by a natural disaster. Fukushima Daiichi Nuclear Power Plant was even older design than Chernobyl Nuclear Power Plant (~50 years ATM).
-
Help needed over a "three body" orbital calculator
Searching net for "online three body calculator" e.g. https://www.google.com/search?q=online+three+body+calculator gives this: https://www.desmos.com/calculator/icaqw49qeq where icaqw49qeq is data about initial condition.
-
Was Pangea, a Moon?
No. Pangea is part of the Earth. The Moon is a non-artificial satellite of the Earth.... No. It was the protoplanet Theia: https://en.wikipedia.org/wiki/Theia_(planet) The collision of the protoplanet Earth with the protoplanet Theia formed the present Earth and the present Moon from their debris. Scientists use simulations to confirm or deny such a hypothesis. Learn programming, create an algorithm, run the simulation with some input parameters, and observe the results. Change the parameters to observe something else. Repeat millions of times...