- GC is extremely efficient, more efficient than
malloc()
, costs less CPU if done right. - Dead objects cost nothing to collect. So do not set dead objects (during
finalize()
stage) tonull
, costs a lot more resources. - GC will find all dead objects (including cyclic graphs) and clean them.
This file contains 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
@REM Simple batch script to download and install Hyper-V manager on devices running Windows 10/11 Home, | |
@REM so that you can run both Docker and a full-fledged, hardware-accelerated, virtualized OS alongwith Windows on this Type-1 hypervisor | |
@REM How to run? | |
@REM Open a conhost as administrator (in PowerShell, use "Start-Process cmd.exe -Verb runAs"), and then | |
@REM execute this script, simply by calling "hyper-v-on-windows-home.bat" | |
pushd "%~dp0" | |
dir /b %SystemRoot%\servicing\Packages\*Hyper-V*.mum >hyper-v.txt |
The following steps will install the Linux Mint driver for the TP-Link Archer T4U Plus AC1300 USB Wifi adapter.
- Open a Linux terminal and run the following commands to download and build the driver.
This file contains 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
/** | |
Area Calculator | |
Write a method named area with one double parameter named radius. | |
The method needs to return a double value that represents the area of a circle. | |
If the parameter radius is negative then return -1.0 to represent an invalid value. | |
Write another overloaded method with 2 parameters x and y (both doubles), where x and y represent the sides of a rectangle. |
This file contains 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
function allEven(arr){ | |
// check if all are even numbers | |
return arr.every(num => { | |
return num%2 === 0; | |
} | |
); | |
} | |
// alt, check if all are even | |
const allEvens = (arr) => {return arr.every(num => {return num%2===0;});}; |
This file contains 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
$swkotorPath = "$env:ProgramFiles (x86)\Steam\steamapps\common\swkotor" | |
$swkotorIniPath = "$swkotorPath\swkotor.ini" | |
# Modify the configuration file | |
(Get-Content $swkotorIniPath) | | |
ForEach-Object { $_ -replace 'FullScreen=1', 'FullScreen=0' } | | |
Set-Content $swkotorIniPath | |
Add-Content $swkotorIniPath "`n[Graphics Options]`nAllowWindowedMode=1" |
This file contains 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 java.util.Scanner; | |
public class App { | |
static Scanner sc = new Scanner(System.in); | |
public static void main(String[] args) throws Exception { | |
// program for matrix operations | |
System.out.println("Enter the operation to be performed : "); | |
System.out.println("1. Addition"); |
This file contains 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
# echo everything | |
$VerbosePreference = "Continue" | |
# escalate to administrator and install winget | |
# check if running as administrator | |
if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { | |
# relaunch as administrator | |
Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs | |
Exit |
This file contains 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
package testcache; | |
public class StaticBlock { | |
static String prometheusUrl = null; | |
static String billing_service_name = null; | |
static { | |
prometheusUrl = System.getenv("PROMETHEUS_URL"); | |
if (prometheusUrl == null) { |
This file contains 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
------------------------------------------------------------------------- | |
USEFUL ONE-LINE SCRIPTS FOR SED (Unix stream editor) Dec. 29, 2005 | |
Compiled by Eric Pement - pemente[at]northpark[dot]edu version 5.5 | |
Latest version of this file (in English) is usually at: | |
http://sed.sourceforge.net/sed1line.txt | |
http://www.pement.org/sed/sed1line.txt | |
This file will also available in other languages: | |
Chinese - http://sed.sourceforge.net/sed1line_zh-CN.html |
NewerOlder