Giter Site home page Giter Site logo

codename's Introduction

Generation of Code Names for Organizations, People, Projects, and Whatever Else

{codename} allows for users to create short, pithy code names for their organizations, their work projects, themselves, other people, or whatever else. The core of this package is the eponymous codename() function, which allows the user to create various types of code names. The code names returned from this function, by in large, are a two-word character vector of an attribute and an object. Right now, options include “any” (which is default and incorporates a battery of adjectives and nouns), “gods” (in which the object is the name of a deity or saint from some religion), “ubuntu” (in which the code name is alliterative but the object is always an animal), ‘nicka’ (in which code names are partly derived from conventions spelled out by the old U.S. NICKA system) and “wu-tang” (in which the code name is derived from the classic Wu-Tang Name Generator). codename() also features the ability to use reproducible seeds, including character seeds, for maximum transparency and reproducibility.

Installation

You can install this on CRAN.

install.packages("codename")

You can also install the development version of this package through the {devtools} package.

devtools::install_github("svmiller/codename")

Usage

There isn’t much to belabor here and usage should be self-explanatory. Here is some sample output.

library(codename)

# Generate console message about package version.
# Successive updates may break the expected output of a reproducible seed.
# This just adds some layer of transparency/clarity.
codename_message()
#> code name generated by {codename} v.0.4.9. R version 4.1.2 (2021-11-01).

# defaults to any
codename()
#> [1] "burnt red helium"
codename()
#> [1] "unrealistic half"
codename()
#> [1] "straight digestive"
codename()
#> [1] "limited coonskin"

codename(type = "gods")
#> [1] "jaunty yahweh"
codename(type = "gods")
#> [1] "these auseklis"
codename(type = "gods")
#> [1] "honored chernobog"
codename(type = "gods")
#> [1] "dark blue grey dagon"

codename(type = "nicka")
#> [1] "ill myth"
codename(type = "nicka")
#> [1] "twin worship"
codename(type = "nicka")
#> [1] "frivolous barn"
codename(type = "nicka")
#> [1] "definite metronome"

codename(type = "ubuntu")
#> [1] "reflecting rattlesnake"
codename(type = "ubuntu")
#> [1] "wintergreen weasel"
codename(type = "ubuntu")
#> [1] "virtuous vole"
codename(type = "ubuntu")
#> [1] "hoarse hippopotamus"

codename(type = "wu-tang")
#> [1] "Mighty Worlock"
codename(type = "wu-tang")
#> [1] "Mighty Beggar"
codename(type = "wu-tang")
#> [1] "Violent Commander"
codename(type = "wu-tang")
#> [1] "Vulgar Lover"

variety_pack(seed = "A Reproducible Character Seed")
#> [1] "afraid patriarch"
#> [1] "meaty ausrine"
#> [1] "xiphoid xenarthra"
#> [1] "banana barnacle"
#> [1] "Scratchin’ Commander"
variety_pack(seed = 8675309)
#> [1] "yellow orange twist"
#> [1] "scholarly wakan tanka"
#> [1] "wavy wear"
#> [1] "moss mandrill"
#> [1] "Thunderous Wizard"

Hall of Fame Entries

This is an incomplete and running list of some of my favorite returns from this function. Because most of the sample output on the README is a one-off return, these are prone to disappear every time the README is updated. No matter, I want to preserve some of these, for posterity.

  • electric lime agenda
  • second-hand shovel
  • reckless azimuth
  • x-pert anesthesiology
  • sunny sunroom
  • improbable boris
  • criminal outlaw
  • gregarious denominator
  • lawn green insurgence
  • corrupt chickadee
  • realistic democrat
  • creamy escalator
  • recent prior
  • sapphire guacamole
  • deserted samurai
  • subtle girlfriend
  • critical father
  • short-term opposition
  • favorite weakness
  • lavender pawnshop
  • pungent pigeon
  • gifted gerbil
  • guilty gorilla
  • sniveling snail
  • foolish soma
  • baby poop buddha
  • sizzling sawfish

{codename} in the Wild

Here’s a running list of projects that make use of {codename}. If you would like your project included, please raise an issue on the project’s Github.

codename's People

Contributors

pkoaz avatar svmiller avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

codename's Issues

NICKA nicknames

Note to future Steve: look into this when you finally get settled in Sweden and your life isn't in the shambles/boxes it is now. This is definitely doable, though I won't bother with a content analysis of the patriotic rah-rah that the U.S. military sprinkles onto this stuff ad hoc.

http://www.designation-systems.net/usmilav/codenames.html
https://www.thedrive.com/the-war-zone/29353/how-the-pentagon-comes-up-with-all-those-secret-project-nicknames-and-crazy-code-words

I think you could mimic this in a way that's in orbit of what the U.S. government would do, and distinct from a generic grab bag, by combining the adjectives and nouns into a sample for the first word, and then the nouns for the second one. You'd have to subset to just the single word ones as well.

Basically, I think you can create a reproducible seed, which then becomes fodder for a sample(1:101, 1). The result of that can be compared to the assignment blocks, creating potential options for the first word based off a grepl() filter that finds suitable words that match the block.

Something to think about anyway.

I need to improve `char2seed()`

I'm astonished it happened this quickly, but I found two character seeds that produced identical numeric seeds. I won't spell both out here, but one of them is "A Reproducible Character Seed" (which is in the README). That's how I immediately knew it was a problem.

I'm labeling it a bug---it's not really a bug, per se---but it is a case where something is not working the way I want it to work. So, my intuition is this. I'm going to keep char2seed() as is for when version 0.2.0 goes on CRAN. For the next release after that, I'm going to mess with char2seed() to make it behave like this.

x <- "A Reproducible Character Seed" # set seed to
tmp <- c(1:26, 1:26, 0:9) # notice the change from 0:25 to 1:26. This is going somewhere.
names(tmp) <- c(LETTERS, letters, 0:9)

x <- gsub("[^0-9a-zA-Z]","",as.character(x))

xsplit <- tmp[ strsplit(x,'')[[1]] ]
xsplit

the_seed <- as.numeric(paste(xsplit, collapse="")) # We're just going to paste the split into a seed
the_seed # look at it

as.integer( the_seed %% (2^31-1) ) # same division as before

For old-timey's sake, I'll probably rename the current version to be something like char2seed_v1() but this will be the new char2seed() going forward.

Long character strings to char2seed() always make a seed of 0

With codename v0.5.0 (and maybe before?), strings that are longer than 9 alphanumeric characters result in the same seed: 0:

library(codename)

char2seed("My project title is really long")
#> Warning in char2seed("My project title is really long"): probable complete loss
#> of accuracy in modulus
#> [1] 0
char2seed("Here's another really long seed")
#> Warning in char2seed("Here's another really long seed"): probable complete loss
#> of accuracy in modulus
#> [1] 0

codename(type = "ubuntu", "My project title is really long")
#> Warning in char2seed(seed): probable complete loss of accuracy in modulus
#> [1] "sapphire stoat"
codename(type = "ubuntu", "Here's another really long seed")
#> Warning in char2seed(seed): probable complete loss of accuracy in modulus
#> [1] "sapphire stoat"

The documentation for char2seed() currently says

The function may warn of "loss of accuracy", but this just means you supplied it a really long character vector.

But in practice that "loss of accuracy" warning means that the really long character vector will always generate a seed of 0.

I don't know what to do about it though :( so I've just been making sure my character seeds stay at ≤9 characters

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.