import rasterio
import numpy as np
mars = rasterio.open('Mars_MGS_MOLA_DEM_mosaic_global_463m.tif')
mars = mars.read()
print(mars.shape)
print(np.amin(mars[0]))
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import matplotlib.pyplot as plt | |
| fig, ax = plt.subplots() | |
| fig.set_size_inches(14, 7) | |
| ax.imshow(mars[0], cmap="viridis") | |
| ax.axis('off') | |
| plt.show() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import time | |
| s = time.time() | |
| tsum = 0 | |
| for i in range(100000000): tsum += i | |
| print(f'Sum: {tsum}') | |
| print(f'For loop: {time.time() - s} seconds') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import time | |
| s = time.time() | |
| tsum = sum(range(100000000)) | |
| print(f'Sum: {tsum}') | |
| print(f'Sum/range: {time.time() - s} seconds') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import time | |
| import numpy as np | |
| s = time.time() | |
| tsum = np.sum(np.arange(100000000)) | |
| print(f'Sum: {tsum}') | |
| print(f'Duration: {time.time() - s} seconds') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import time | |
| import numpy as np | |
| rscores = np.random.randint(1, 100, size=100000010) | |
| s = time.time() | |
| cfailed = 0 | |
| sfailed = 0 | |
| for score in rscores: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import time | |
| import numpy as np | |
| rscores = np.random.randint(1, 100, size=100000010) | |
| s = time.time() | |
| mean_failed = (rscores[rscores < 70]).mean() | |
| print(mean_failed) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name Modify Slider Max Value | |
| // @namespace http://tampermonkey.net/ | |
| // @version 1.0 | |
| // @description Change max value of a specific range slider | |
| // @author Mohit | |
| // @match *://*/* | |
| // @grant none | |
| // ==/UserScript== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Time (s) | Altitude (m) | Vertical velocity (m/s) | Vertical acceleration (m/s²) | Total velocity (m/s) | Total acceleration (m/s²) | Position East of launch (m) | Position North of launch (m) | Lateral distance (m) | Lateral direction (°) | Lateral velocity (m/s) | Lateral acceleration (m/s²) | Latitude (°) | Longitude (°) | Gravitational acceleration (m/s²) | Angle of attack (°) | Roll rate (°/s) | Pitch rate (°/s) | Yaw rate (°/s) | Mass (g) | Motor mass (g) | Longitudinal moment of inertia (kg·m²) | Rotational moment of inertia (kg·m²) | CP location (cm) | CG location (cm) | Stability margin calibers () | Mach number () | Reynolds number () | Thrust (N) | Drag force (N) | Drag coefficient () | Axial drag coefficient () | Friction drag coefficient () | Pressure drag coefficient () | Base drag coefficient () | Normal force coefficient () | Pitch moment coefficient () | Yaw moment coefficient () | Side force coefficient () | Roll moment coefficient () | Roll forcing coefficient () | Roll damping coefficient () | Pitch damping coefficient () | Coriolis acceleration (m/s²) | Refer |
|---|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <cuda_runtime.h> | |
| // A CUDA kernel that uses inline PTX to add 1 to each element. | |
| __global__ void addOneKernel(int *data) { | |
| int i = threadIdx.x; | |
| // Inline PTX: move immediate value 1 into a temporary register, then add it to i. | |
| asm volatile ( | |
| "add.s32 %0, %1, 1;\n" | |
| : "=r"(data[i]) // Output operand: write the result into data[i] |