-
Posts
7956 -
Joined
-
Last visited
-
Days Won
26
Content Type
Profiles
Forums
Events
Everything posted by Sensei
-
Configure RAID in mirror mode. https://en.wikipedia.org/wiki/Standard_RAID_levels
-
Electron transfer reactions question (ElectroChemistry)
Sensei replied to Dhamnekar Win,odd's topic in Homework Help
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! 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 or quantum tunneling? https://en.wikipedia.org/wiki/Tunnel_effect https://en.wikipedia.org/wiki/Quantum_tunnelling
-
...the science forum warped colors after analyzing your thread...
-
By which physical properties do isotopes actually differ
Sensei replied to IndianScientist's topic in Inorganic Chemistry
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 ?
Sensei replied to mistermack's topic in Microbiology and Immunology
..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 ?
Sensei replied to mistermack's topic in Microbiology and Immunology
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.. -
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
Sensei replied to GeeKay's topic in Classical Physics
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. -
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...
-
..did you mean Steven Frayne.... ?? https://en.wikipedia.org/wiki/Dynamo_(magician)
-
Can I mock from your mockery? The God Jesus..
-
Journalists like such click-bait, eye-catchy, subjects.. I would ask "for how long?" the hottest place.. If e.g. a proton hits an antiproton, either in a particle collider or as a result of cosmic radiation, at close to the speed of light, the temperature in that case is so high that it is counted in GeV or TeV, not K... https://en.wikipedia.org/wiki/Electronvolt#Temperature
-
A newbie's problem with making a navigation dropdown
Sensei replied to Wilfred Thompson's topic in Computer Science
It should be ☰ in the first place. W3Schools has nice example how to make animated hamburger menu icon: https://www.w3schools.com/howto/tryit.asp?filename=tryhow_css_menu_icon_js Non-animated version: https://www.w3schools.com/howto/tryit.asp?filename=tryhow_css_menu_icon -
Shared atoms among humans
Sensei replied to runninglama1130's topic in Biochemistry and Molecular Biology
If you smell something, your nose has picked up atoms of something, such as the smell of skin... -
A newbie's problem with making a navigation dropdown
Sensei replied to Wilfred Thompson's topic in Computer Science
@Wilfred Thompson I checked your source code. It will work better if you replace line: document.getElementById("navdrop").style.width = "100"; by document.getElementById("navdrop").style.width = "100%"; More info about units in HTML/CSS: https://www.w3schools.com/cssref/css_units.asp If you want to test this thoroughly, open your page in a separate window and change the width (several different widths) of the window (and play with UI). There are other problems evident if you start changing the width of the window... -
A newbie's problem with making a navigation dropdown
Sensei replied to Wilfred Thompson's topic in Computer Science
Hello! What HTML, CSS, JS tutorial sites do you use? I think one of the best is https://www.w3schools.com There is a sample dropdown code there: https://www.w3schools.com/css/css_dropdowns.asp Curtain Menu example: https://www.w3schools.com/howto/howto_js_curtain_menu.asp Best Regards! -
In adding (or subtracting) a physical quantity to another physical quantity, the scalars are added together and the units must match. e.g. 1 m + 10 m = 11 m If they do not match, even if they both represent e.g. length, they cannot be added or subtracted. e.g. 1m + 1 inch Inches must be first converted to meters, or meters must be converted to inches, so the two units match to add them together. In multiplying (or dividing) physical quantities, the units need not match. A scalar is multiplied by a scalar, a unit is multiplied by a unit. e.g. 3m * 10m = 30m^2 e.g. 10 m / 5 s = ( 10/5 ) [m/s] = 2 m/s e.g. 10 N * 5 m = 50 J Dividing a physical quantity by physical quantity with the same units yields a dimensionless/unitless scalar. e.g. 100 s / 50 s = 2 100 m/s * 10s = 1000 m (Unit cancellation)
-
Why does an electric car needs so many more chips than an IC car?
Sensei replied to TheVat's topic in Engineering
Trabants were made of bad quality plastics (recycled wastes).. ??? 4th paragraph on Wiki "The Trabant's build quality was poor,[13] reliability was terrible,[10][11][14] and it was loud, slow, and poorly designed.[3]" -
Does this math explain lights speed ?
Sensei replied to Pbob's topic in Modern and Theoretical Physics
Scientists don't make up their formulas.. You need source data, and from that you derive formula in the area of interest. e.g. velocity is derived from analyzing the change in position of an object e.g. x0 at time t0, x1 at time t1, dx = x1-x0, dt = t1-t0, so v=dx/dt. -
Does this math explain lights speed ?
Sensei replied to Pbob's topic in Modern and Theoretical Physics
Didn't you have dimensional analysis on physics lessons in your elementary school ? https://en.wikipedia.org/wiki/Dimensional_analysis h*f has unit J = kg * m^2 * s^-2 F has unit N = kg * m * s^-2 c has unit m/s If you divide J/N the result will have a unit in meters.. so it will dismatch with m/s.. so the simple answer to your question is, no it's not correct.. -
Retention time calculator for peptides
Sensei replied to BabcockHall's topic in Biochemistry and Molecular Biology
If you know formula, you can use Excel or Open Office Spreadsheet.. If you don't know formula, but know website which is giving correct results, press ctrl-u to show HTML and JavaScript source code, and then find it, and copy it to Spreadsheet. -
Does Gauss's Law explain a Higgs field and universal inflation ?
Sensei replied to Pbob's topic in Speculations
Charge Q (in Coulombs, C unit) is integer multiply of e (elementary charge) (also in C). https://en.wikipedia.org/wiki/Elementary_charge Q/V would have unit C/m^3