Posted in Bioinformatics, How-to, Python, Software Development, Uncategorized

Quickly Setting up a Python Virtual Environment in Ubuntu


Notes on using Python’s virtualenv

One-time work
Installing virtualevn: sudo pip install virtualenv

Getting Up and Going (Most important)
Creating virtual environment: virtualenv <project_name>
Activating: source <project_name>/bin/activate
Deactivate: deactivate
Documenting Dependencies: pip freeze –local > requirements.txt
Destroy virtualenv: rm -rf <project_name>

Misc.
Packages in virtualenv: pip list
Determining if virtualenv is used: which python
Python Path (DO NOT USE IN VIRTUAL ENVIRONMENT): which python
Specific Python-version virtualenv: virtualenv -p <python_version_path><project_name>
Pulling dependencies from requirements.txt: pip install -r requirements.txt

Reference

Docker as an Alternative

 

 

Advertisements
Posted in Software Development, Uncategorized

Common Github Markdown and Hidden Files


The power of Github lies in not merely using it as a source control. Rather, the power lies in using it as source control, bundled with a means of social media. Different files, features and the vary nature of git are designed to be a social media-communication tool to convey information to developers and scientist (they use git too.) For example, tagging lets people know you have releases. Seeing a branch communicates to others you are working on something and do not want to affect a major branch (like fixing a bug or adding a new feature.)

In looking at numerous git projects, I have seen a number of files that are hidden (beginning with a period) or are markdown (ending with “.md”) that occur repeatedly and are not related meant for third-party dependencies (like .babelrc for babel.js). I do not believe there is a standard. Nevertheless, they tend to have similar information across different projects. Here are the ones I frequently see:

.gitignore: Files you do not want git to pull into source control.
You can find a pre-made file for your current project off this site: https://www.gitignore.io

.editorconfig: Instructs text editors that support this on how to format code. It is best to have this to prevent a colossal geek-battle between the guy who uses 2-spaces with another guy who uses tab- this file is the definitive answer. A tutorial and sample file can be found at- http://editorconfig.org

README.md: Is information users see at the bottom of a git project. It informs them of the purpose. It is one of the first things they see despite it being it being at the bottom of the page. I have seen this vary from a basic introduction to a full blown documentation.

CONTRIBUTING.md: Provides guidelines everyone contributing to the code needs to follow (primarily developers).

COMMITTER.md: Provides guidelines to anyone with admin-power, like people that can have pull request on Master-branch. This might not be a consider problems in a small project. But it is something to consider in big codebases with core contributors scattered across difference time zones.

ChangeLog.md: A listing of what are changes in every release.

DEVELOPER.md: Instructions potential contributors on how to get the codebase running locally.

Author.txt: Listing of contributors

LICENSE.md or License.txt or License: This expresses to consumers of a code how the creator wants you to use it.  THIS IS IMPORTANT! It is vital for the code creators to write a license and the code consumer to read. If can only remember just one thing from this blog, remember that the license file should be given serious consideration. Some licenses say basically you can use the code but the creator is not liable for damages (MIT.) Some other license say if you use this code, you must open source the code you use it with; which may be your company’s $5 million codebase (like GPL.) Other say you can use the code for free if you do not modify it or contribute modifications to open source; otherwise you must pay the creators (I know MySQL used to have this.) Again, read the license. Ask the creator if you do not see a license.

You can do a web search and find information on licenses. One I like is wikipedia’s comparison- https://en.wikipedia.org/wiki/Comparison_of_free_and_open-source_software_licenses

This list does not cover them all. There are  others like .gitattributes (used for configuring individual folders) and .mailmap (e-mail listing of contributors). Some third-party dependencies uses some like npm uses .npmignore. You can also create one yourself. I personally like to use .Acknowledgement to recognize anyone, codebases or sites that helped me out a lot while working on a project in Github. Some do not end with .md nor are hidden files but seems important like PATENTS in react.js

Posted in Software Development, Uncategorized

Creating a tag in git


This blog post shows you how to create an annotated tag in git; using github. I assume you already have git installed and have at least a working knowledge of the basis.

Steps
Create the tag
git tag -a v1.0.0 -m 'some message'

This is how you push tags to the server (regular push does not move over tags)
git push --tag

Miscellaneous
To view all tags:
git tag -v

To delete a tag (use the view option above to get the tag name )
git tag -d v1.0.0

Posted in Uncategorized

ChicagoVeg Website’s Release #2 now in Prod


The ChicagoVeg site: http://www.chicagoveg.com has been updated; with Release #2. The fixes include the follow:

  • Added new carousel images
  • Images now on most pages
  • Made Facebook page plugin responsive
  • Updated text

To see a list of issues addressed, see:
https://github.com/ChicagoVeg/ChicagoVegSite/issues?utf8=✓&q=%20milestone%3A”Release%202″%20

ChicagoVeg is the largest Chicagoland community for vegetarians, vegans, and raw foodists to socialize and meet like-minded people. We organize a range of fun activities and educational events in the city and the suburbs. Whether you are vegan or not vegan, we welcome everyone who is interested in a vegan/vegetarian/raw lifestyle for any reason – ethical, environmental, health, or spiritual. We support a nonjudgmental community where everyone can feel welcome to express their opinions, socialize, and have fun!

You can find meetings at: http://www.meetup.com/ChicagoVeg/

 

Posted in Uncategorized

My comments on Tyra Bank’s career


I watched a Youtube video on Tyra Banks (https://www.youtube.com/watch?v=FE057BWoLh4)and commented on it. My comments were inspired partially by words I read from Microsoft’s CEO Satya Nadella. I decided to  rephrase it a bit and write it in a blog post. This way, I can remind myself of it periodically. Here it is:

Tyra Banks did some things right. What gives you success today probably will not tomorrow. Therefore, you need career redirections periodically. She did that. She left the catwalk on top and when I believe her career with it would be on the downswing soon. Many have redirected their careers. Michael Jackson (bumble gum kid singer to teen pop/disco sing to adult r&b/funk/pop singer to Rock/pop/New Jack Swing singer), Michael Jordan (slasher/leaper/dunker to outside-shooter and passing the ball a little bit more), Microsoft (PC software maker to cloud provider) and many more others have rebranded and reinvented themselves.

You plan switches while still on top with the current direction. And you do little experiments to see whats next. Then you slowly but surely switch to the next thing. It’s not done necessarily in this order or way. Nevertheless, the point is; you do not want to be stuck without a wave to ride- you always need something big in your career to keep you in demand and on people’s mind and radar. I do not think she did this to a good degree. Kodak had nothing to fall on when digital photography made its business model obsolete. Its top brass did not see beyond what was making money for them when they were big and profitable and were slow to change with the changing consumer demand. Google currently really has nothing to fall on if its search business fails. Android, Google Maps and other of its big products really do not directly bring in income; they just help increase Google Search usage (its primary money-maker). Gmail and Google Cloud I believe are not profitable enough to run a huge company off of. Alphabet can help, just not right now.

Sometimes, despite best effort, things just do not work out for a while. Abraham Lincoln had a terrible life and was a straight up failure, before finally hitting it big and eventually becoming President and revered. John Travolta had a downtown time prior to getting “Pulp Fiction” to bring this back up. She now needs to find her “Pulp Fiction.” Plus, at a point, you have to use more wit and creativity and less beauty and other time-limited things to sell your goods. Beauty fads or gets stale to the eye; but wit and creativity is not limited by age or physicality.

 

 

Posted in Uncategorized

ChicagoVeg’s restaurant application updated (January 23rd 2015)


ChicagoVeg is a non-profit organization in Chicago, whose goal is to promote veganism, vegetarians and raw veganism in Chicagoland. The organization has updated its restaurant application (http://www.chicagoveg.com/restaurants/). The primary goal of the update was to improve users’ mobile experience. Some changes made were:

– Fixed issue with map getting out of bounds on mobile and tablet
– Added warning message for users using IE 8 and lower (Google only supports IE 9 and above so the restaurant app is forced to too)
– Corrected issue in mobile where direction overflowed
– Added ability for users to post information about the site on social media
– Enlarged filtering options (e.g. Name | Distance in Restaurant list) to improve visibility and click-ability in mobile
– Fixed issue with mobile where address boxes was getting misaligned