obstschale Posted April 14, 2013 Share Posted April 14, 2013 (edited) NSC Workflow to convert numbers into other based systems. As a computer scientist student I deal everyday with binary, octal, hex and decimal numbers. Therefore I built this workflow with PHP for Alfred 1 and now I rebuilt it with Python for Alfred 2. Usage: 5 different keywords are used: decimal binary octal hex convert The first 4 act similar. You type the keyword (base of your number) and the number you want to convert. Alfred will show you the same number in the other 3 systems. You can select one of them and copied to your clipboard. To convert from or into another system beside these four, you use the keyword convert. Then you type your number, the base of your number and the base of the destination. NSC will display the decimal notation and the new number. To simplify this use the simple frase: "convert number 42 from with base 6 into base 4" Changelog can be found on GitHub: Changelog Downloadlatest build: NSC Alfred Extension Requires: nonSupports Alleyoop 2 Download | GitHub | README _mk_ made a bash version of NSC. It can be found at GitHub. Edited March 16, 2014 by obstschale _mk_ and bbezanson 2 Link to comment
_mk_ Posted April 14, 2013 Share Posted April 14, 2013 This will make my life a Lot easier. Thanks for sharing. Link to comment
_mk_ Posted April 15, 2013 Share Posted April 15, 2013 Installing lxml was quite a bit effort to get this workflow running. The MacPorts library only supported Python 2.5 so I had to build the lib and the required system libs on my own. I created a version of the workflow based on the command line tool bc which does not require you to install/compile any additional libs. If someone is interested and obstschale agrees, I could upload it and post a link. Link to comment
obstschale Posted April 15, 2013 Author Share Posted April 15, 2013 Hi _mk_, thx for your input. I'm pretty new to python so I didn't know how to make it better so far and I installed lxml for another cmd line tool some time ago, so I know this module exist. Today I just saw another python script which uses not lxml but xml. Either I use this one (if it is a standard lib) or if you have a good suggestion just give me a pull request on github (is saw you forked my repo) and I probably will integrated your improvement. Looks like you have more python experience than me Link to comment
_mk_ Posted April 15, 2013 Share Posted April 15, 2013 Looks like you have more python experience than me I have never really warmed up to the snake. That's the reason I modified your workflow to use the bc command line tool instead. Link to comment
obstschale Posted April 15, 2013 Author Share Posted April 15, 2013 I'd like to see your solution and could publish it. But I probably would also search for another solution with python to get better with the snake Link to comment
obstschale Posted April 16, 2013 Author Share Posted April 16, 2013 I encountered some issues with my workflow and David Ferguson suggested to use the module alp. This Module also includes a XML function and I guess this will also solve the lxml problem, because I will provide the XML lib with v2.1 Anyhow, I still would like to see how you use the bc cmd line tool. Just for learning purpose Link to comment
_mk_ Posted April 16, 2013 Share Posted April 16, 2013 I'll upload my modified version of the workflow this evening. Link to comment
_mk_ Posted April 16, 2013 Share Posted April 16, 2013 You can get the non-python version here. Link to comment
obstschale Posted May 6, 2013 Author Share Posted May 6, 2013 your bash version looks nice. But I think I stick to Python Link to comment
alexburtnik Posted March 15, 2014 Share Posted March 15, 2014 (edited) Hi, guys! I've installed the NSC workflow, but when I try to use it, Alfred end up searching google for "decimal 10" or any other NSC command I type. The only command working is "convert" Does anybody know how can I fix it? Edited March 15, 2014 by alexburtnik Link to comment
obstschale Posted March 16, 2014 Author Share Posted March 16, 2014 Hi alexburtnik, which version did you download? I see this post links v2.01 but on GitHub I already pushed v2.2. So please try this link https://github.com/obstschale/NSC/raw/alfredextension/nsc-v2.2.alfredworkflow I will update my post above. If it is still not working let me know. alexburtnik 1 Link to comment
alexburtnik Posted March 16, 2014 Share Posted March 16, 2014 Thanks, obstschale. I've installed v2.2 and now it works Link to comment
bbezanson Posted September 14, 2016 Share Posted September 14, 2016 Thanks for the NSC Alfred Extension. Solved a problem very easily. I'm suggest for anyone needing to install Python, I would suggest HomeBrew for the Mac. http://brew.sh Yes, you do need to use it via terminal, but if you are using Extensions in Alfred I think you can do that as well . I was able to get NSC installed with one click and working for my conversion needs. Link to comment
deanishe Posted September 14, 2016 Share Posted September 14, 2016 (edited) 1 hour ago, bbezanson said: I'm suggest for anyone needing to install Python, I would suggest HomeBrew for the Mac. Python is a standard component of OS X (/usr/bin/python). It's one of the default languages available in Alfred. There is no need for Homebrew. Indeed, I would strongly discourage anyone writing a workflow in Python from using a non-system Python for the workflow (be it a brewed one or from python.org) unless there's a very good reason not to use the system Python. If you use a non-system Python (or indeed any other interpreter that isn't a standard part of OS X, such as nodejs), other people can't simply download your workflow, install it and run it. Edited September 14, 2016 by deanishe Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now