- Legacy BIOS bootable attribute -- This is the official name of the relevant feature, as described in the UEFI specification (version 2.3.1, p. 105, Table 19). It's set by setting the "legacy_boot flag" in parted or its relatives, or by setting attribute bit #2 using the "a" option on the experts' menu in gdisk. (The wiki to which you linked describes doing this with sgdisk.) It's used by SYSLINUX's GPT support to identify a partition that holds second-stage boot code.
- The "boot flag" on MBR disks -- On MBR disks, the "boot flag" is a bit that can be set using either fdisk or parted. It's analogous to the GPT legacy BIOS bootable attribute, since it serves the same purpose. Note that on a GPT disk, it's possible (although technically a violation of the spec) to set this flag on the protective 0xEE partition. You can do this with fdisk, but not with parted, since the latter lacks a user interface to do anything explicit with the protective 0xEE MBR partition. (This is reportedly changing with in-development
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
// http://michalbe.blogspot.com.br/2013/03/javascript-less-known-parts-bitwise.html | |
// http://jsperf.com/bitwise-vs-math-object | |
// http://united-coders.com/christian-harms/results-for-game-for-forfeits-and-the-winner-is/ | |
// https://mudcu.be/journal/2011/11/bitwise-gems-and-other-optimizations/ | |
// https://dreaminginjavascript.wordpress.com/2009/02/09/bitwise-byte-foolish/ | |
// http://jsperf.com/math-min-max-vs-ternary-vs-if/24 | |
"use strict"; | |
var PI = Math.PI; |
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
{ | |
"editor.tabSize": 4, | |
"[javascript]": { | |
"editor.tabSize": 2, | |
"editor.defaultFormatter": "esbenp.prettier-vscode" | |
}, | |
"[javascriptreact]": { | |
"editor.tabSize": 2, | |
"editor.defaultFormatter": "esbenp.prettier-vscode" | |
}, |
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
# Configuration for Alacritty, the GPU enhanced terminal emulator. | |
# Any items in the `env` entry below will be added as | |
# environment variables. Some entries may override variables | |
# set by alacritty itself. | |
#env: | |
# TERM variable | |
# | |
# This value is used to set the `$TERM` environment variable for | |
# each instance of Alacritty. If it is not present, alacritty will |
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
ENTENDENDO O FORMATO COMP-3 | |
13 Comentarios | | |
Tweet | |
Prezados Leitores, | |
Este Post descreve como os dados são armazenados quando estão no formato COMP-3. | |
COMP-3 é um campo que coloca dois dígitos em cada byte, usando uma notação chamada Binary Coded Decimal, ou BCD. COMP-3 é um tipo de dado comum, mesmo fora do COBOL, e é bastante normal em plataformas - isto é, não é dependente do sistema operacional, língua, ou CPU. Contudo, COMP-3 não é comumente encontrado em linguagens de MICRO. | |
Como os dados são armazenados: | |
O Binary Coded Decimal (BCD) tipo de dados é tal como o nome sugere - é um valor armazenado em notação decimal (base dez), e cada dígito binário é codificado. Uma vez que um dígito só tem dez possíveis valores (0-9), pode ser representada em forma binária, com apenas 4 bits. Quatro bits é chamado de "nybble", e cada nybble contém um dígito do valor. Portanto, você pode obter dois dígitos em cada 8 bits byte. A representação normal de caracteres armazena apenas um caractere (dígito) por byte, isso |
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
const hasCoarsePointer = () => window.matchMedia("(pointer: coarse)").matches | |
const hasMobileWidth = (maxWidth = 639) => | |
window.matchMedia(`(max-width: ${maxWidth}px)`).matches | |
const hasMultipleTouchPoints = () => navigator.maxTouchPoints > 1 | |
const hasTouchEvents = () => "ontouchstart" in document.documentElement | |
export const isMobile = ({ maxWidth } = {}) => { | |
return ( | |
hasCoarsePointer() && | |
hasMultipleTouchPoints() && |
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
Somehow, I ended up without any xmodmap files on my Ubuntu install, so I had to find a different approach to this problem. | |
Take a look at the **xinput** command. | |
xinput list | grep -i mouse | |
which lists information about your mouse. It shows my mouse is "Dell Premium USB Optical Mouse" and also that I have "Macintosh mouse button emulation". Armed with that info, I can | |
xinput get-button-map "Dell Premium USB Optical Mouse" |
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 off | |
set foldername=%1 | |
:: Remove files before removing their folders. It's faster | |
DEL /F /Q /S %foldername%\* | |
:: "RD" is much more fast than "RMDIR" | |
for /D %%i in ("%foldername%\*") do RD /S /Q "%%i" |
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
#!/bin/bash | |
# add this file to your /home | |
setxkbmap -model thinkpad60 -layout br |
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 { useCallback, useState } from "react" | |
export default function useForceUpdate(): VoidFunction { | |
const [, setValue] = useState<number>(performance.now()) | |
return useCallback((): void => { | |
setValue(performance.now()) | |
}, []) | |
} |