I'm not aware of how to use Google, how do I do this basic thing in Language X?
tagged coding, question
edited by Grammar Nazi (2.5M), asked by 1337z0r (2)
haiku = -> | |
adjs = [ | |
"autumn", "hidden", "bitter", "misty", "silent", "empty", "dry", "dark", | |
"summer", "icy", "delicate", "quiet", "white", "cool", "spring", "winter", | |
"patient", "twilight", "dawn", "crimson", "wispy", "weathered", "blue", | |
"billowing", "broken", "cold", "damp", "falling", "frosty", "green", | |
"long", "late", "lingering", "bold", "little", "morning", "muddy", "old", | |
"red", "rough", "still", "small", "sparkling", "throbbing", "shy", | |
"wandering", "withered", "wild", "black", "young", "holy", "solitary", | |
"fragrant", "aged", "snowy", "proud", "floral", "restless", "divine", |
from PIL import Image, ImageDraw | |
def main(): | |
# Open the original image | |
main = Image.open("12voltm.jpg") | |
# Create a new image for the watermark with an alpha layer (RGBA) | |
# the same size as the original image | |
watermark = Image.new("RGBA", main.size) | |
# Get an ImageDraw object so we can draw on the image |
There are two ways to authenticate on IRC server:
NickServ
;PASS
command in the IRC
protocol (not supported in the Thunderbird UI).If your server or bouncer requires [2], set the following preferences as string values:
messenger.account.accountN.options.serverPassword
messenger.account.accountN.options.username
import javax.enterprise.context.Dependent; | |
import javax.enterprise.context.RequestScoped; | |
import javax.enterprise.inject.Produces; | |
import javax.persistence.EntityManager; | |
import javax.persistence.PersistenceContext; | |
@Dependent | |
public class EntityManagerProducer { | |
@PersistenceContext(name = "persistence-unit") // name is Persistence Unit Name configured in persistence.xml | |
private EntityManager entityManager; |
#!/usr/bin/sbcl --script | |
;;; brainfuck compiler written in Common Lisp (SBCL) | |
;;; author: TANI Kojiro | |
;;; usage: `sbcl --script brainfuck.lisp` or `chmod +x brainfuck.lisp; ./brainfuck.lisp` | |
(declaim ((simple-array (unsigned-byte 8) (*)) *memory*)) | |
(defvar *memory* (make-array 30000 :element-type '(unsigned-byte 8))) | |
(defvar *pointer* 0) | |
(defvar *bf-readtable* (make-instance 'readtable)) |
Patch for ex-vi (Release 050325, "Version 4.0 (gritter) 3/25/05"). | |
Changes: | |
* Use the correct path for 'install'. | |
* Use ncurses instead of termlib in order to prevent the following error when | |
starting vi: | |
xterm-256color: Unknown terminal type | |
Visual needs addressible cursor or upline capability | |
To apply this patch: | |
$ cd ex-050325/ |
#lang racket | |
;;;; Unification algorithm. | |
;;;; Racket implementation based on Chapter 11 of "Paradigms of Artificial | |
;;;; Intelligence Programming" by Peter Norvig. | |
;;;; | |
;;;; Example usage: | |
;;;; | |
;;;; (unify '(1 ?x ?y) | |
;;;; '(?y 2 ?y)) | |
;;;; ;; Returns: '((?x . 2) (?y . 1)) |
(* OCaml implementation of Haskell's Data.List intersperse and intercalate. *) | |
let rec intersperse sep ls = | |
match ls with | |
| [] | [_] -> ls | |
| x::xs -> x :: sep :: intersperse sep xs | |
let intercalate = String.concat |
;;;; Reader macro that implements Scheme's SRFI 62 S-expression comments in Common Lisp. | |
;;;; SRFI 62: https://srfi.schemers.org/srfi-62/srfi-62.html | |
;;;; Adapted from: https://stackoverflow.com/questions/69248229/reads-recursive-p-argument-when-used-inside-a-reader-macro | |
(eval-when (:compile-toplevel :load-toplevel :execute) | |
(set-dispatch-macro-character #\# #\; | |
(lambda (stream char n) | |
(declare (ignore char)) | |
(when n | |
(error "No number allowed between # and ;")) |