GithubHelp home page GithubHelp logo

nsc's Introduction

NSC

Number System Converter -- an Alfred extension


Author: Hans-Helge Bürger
Date: 07. May 2013 Version: v2.1 Licence: Attribution 3.0 Unported (CC BY 3.0)

Quick Installation

Download NSC v2.1


Introduction

NSC is a little Alfred workflow to convert a number into another number system. I study computer science and therefore I daily deal with different number systems. The most common ones are probably binary, octal, decimal, and hexadecimal but I got tiered to calculate them by hand, calculator or a webpage. Alfred is only a key stroke away and so I started programming this workflow.

I started to learn Python and to pratice that the new Alfred 2 workflow is written in Python insteed of PHP. You know, only if you use a language you get better ;) So your welcome to send a pull request if you have any improvement done.

Functions

Like I mentioned above, you can convert numbers. In the first version I implemented binary, decimal, and hexadecimal. And you can even convert any number from any system into another. But be warned: I didn't implemented a letter-replacement-function which would display the number 10 with an A. I will definitely do this soon, but in this first version I had other problems (especially to get started with Python :) )

Usage

But how can I use NSC? It is really simple.

You call NSC with the different keywords (this is new in v2.0) and according the number you want to convert. E.g. if you want to convert a decimal number you just type decimal and the number. Alfred 2 will show instantly the converted number in binary, octal, and even hex.

So the 4 basic keywords are:

  • decimal
  • binary
  • octal
  • hex

and it looks like that:

screenshot of Alfred converting the decimal number 42

I really love this feature, displaying live updates in Alfred :)

Beside these 4 keywords a fifth is implemented: convert. It is used if a number needs to be converted which is no to base 2, 8, 10 or 16. It uses the following syntax:

`convert` `number` `base of number` `base of new system`

Imagine it like a sentence: Convert number X with base B into system with base Y

screenshot of Alfred converting the number 42 with base 6 into base 4 system Convert 42 with base 6 into system with base 4

Clipboard and Notification

Another cool feature of Alfred 2 is that you can pass arguments to other parts of your workflow. In case of NSC, if you select a result and click enter, the number will be copied to your clipboard and a notification will pop up.

Examples

  • decimal 10 → result: B: 1010 // O: 12 // H: a

  • binary 1011 → result: D: 11 // O: 13 // H: b

  • octal 150 → result: D: 104 // B: 1101000 // H: 68

  • hex FF2 → result: D: 4082 // B: 111111110010 // O: 7762

  • convert 119 11 3 → result: D: 141 // Base 3: 12020


Changelog

v.2.1

  • add: conversion upto base 62 (case-sensitive letters if base is greater than 35)
  • add: add info.plist to repo
  • add: all scripts uses now alp to generate XML feedback

v2.01

  • bug: base 1 led into an infinite loop (thx to @kevinlsw | #2)
  • add: new int2base function which uses now letters as input/output within convert
  • add: NSC uses alp to generate XML feedback

v2.0

  • NSC is now an Alfred Workflow and works with Alfred 2
  • add: convert from/into decimal, binary, octal, hex
  • add: new keywords decimal, binary, octal, hex and convert
  • add: update made easy with Alleyoop
  • change GitHub link

v1.4

v1.3

  • bug: minor bugfixes
  • add: display letters if digits larger than 10

v1.2

  • add: convert to decimal with an own function
  • add: convert from decimal to other number system upto base 35

v1.1

  • add: convert between binary, deciaml, and hexadeciaml with PHP builtin functions

v1.0

  • first version of NSC
  • add: can convert from decimal to binary and hexadecimal with PHP builtin functions

Roadmap

  • convert floating numbers

Licensing

I'm a huge fan of CreativeCommons and so it's my first choice for licensing. I choose the CC BY 3.0 so you can use it for free. It's also allowed to adapt the work, for an own tutorial or a new game. But if you use it link to the tutorial.

nsc's People

Contributors

akupila avatar dalemyers avatar

Watchers

 avatar  avatar  avatar

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.