In programming languages, literals are textual representations of values in the source code. This is a syntactical concept.
Some examples:
7 # integer literal
In programming languages, literals are textual representations of values in the source code. This is a syntactical concept.
Some examples:
7 # integer literal
I get asked pretty regularly what my opinion is on merge commits vs rebasing vs squashing. I've typed up this response so many times that I've decided to just put it in a gist so I can reference it whenever it comes up again.
I use merge, squash, rebase all situationally. I believe they all have their merits but their usage depends on the context. I think anyone who says any particular strategy is the right answer 100% of the time is wrong, but I think there is considerable acceptable leeway in when you use each. What follows is my personal and professional opinion:
This project is a tiny compiler for a very simple language consisting of boolean expression.
The language has two constants: 1
for true and 0
for false, and 4 logic gates:
!
(not), &
(and), |
(or), and ^
(xor).
It can also use parentheses to manage priorities.
Here is its grammar in BNF format:
expr ::= "0" | "1"
If you're trying to install the postgresql gem pg
and it is failing with the following error message:
Installing pg 1.2.3 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: ~/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/pg-1.2.3/ext
~/.rbenv/versions/3.0.0/bin/ruby -I ~/.rbenv/versions/3.0.0/lib/ruby/3.0.0 -r ./siteconf20210125-97201-pycpo.rb extconf.rb
#!/usr/bin/env python | |
import os, os.path, stat, sys, base64 | |
# TOTP lib inlined | |
import time, hmac, base64, hashlib, struct | |
def pack_counter(t): | |
return struct.pack(">Q", t) |
import Foundation | |
enum FooType: String, Codable { | |
case bar, baz | |
} | |
protocol Foo: Codable { | |
var type: FooType { get } | |
} |
import UIKit | |
// Based on https://www.stephanboyer.com/post/132/what-are-covariance-and-contravariance | |
// > Denotes "a subtype of" | |
// UIButton > UIView > UIResponder > NSObject | |
// | |
// e.g. `UIButton` is a subtype of `UIView` | |
// | |
// This means that any function that takes a `UIView`, can receive a `UIButton`: | |
// |
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam' | |
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes' | |
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no' |
import React from 'react'; | |
import PropTypes from 'prop-types'; | |
import hoistNonReactStatics from 'hoist-non-react-statics'; | |
import invariant from 'invariant'; | |
import isEmpty from 'lodash/isEmpty'; | |
import isFunction from 'lodash/isFunction'; | |
import isString from 'lodash/isString'; | |
import checkStore from './checkStore'; | |
import createReducer from '../reducers'; | |
import conformsTo from 'lodash/conformsTo'; |
let UserContext = React.createContext(); | |
class App extends React.Component { | |
state = { | |
user: null, | |
setUser: user => { | |
this.setState({ user }); | |
} | |
}; |