Git: How to know if your directory is already under version control?

There are of course several options to find out if a directory is under version control, depending on what you need, such as do it manually in command line or in your program in python, etc. For that, just Google it and you’ll find solutions, such as this one on stackOverflow.

Now, I just want to determine if my directory is under control.

First option: Go to the command line, move to your directory and type:

$ git status

The result is shows that there are no changes, thus, nothing to commit.
Note that I used

$ git status -u no

From the Git documentation, you see that -u no is not to show untracked files. I had tried before without it and it showed a long list of untracked files that did not allow me to see anything else. Since my goal here is just to see if it is under version control, that message is enough to know that it is.

Just before, you see that I tried with another folder, which is not under version control, and the error message confirms that it is not a git repository.

Second option: Using SourceTree:

1) Open to SourceTree
2) Click on “Create/New”
3) Click on “Add Working Copy”

4) See on the list of “Unstaged files” that files are:
- Clean
- Modified
- Missing
- Not tracked
For the modified: On the right, you can see what was changed in the content.

On the top left: you can see how many files were:
- Added
- Modified
- Not tracked

5) When you click on the master branch, you see that a commit was done and see all the files that were committed at the bottom and their content on the right.

Now that you are sure your directory is already under version control, you can drag and drop the files to the list of “Staged files” on top, which will be included in the next commit.

For more references, check out the Coursera Course on Data Scientist Toolbox available on github (create new repo, fork and clone a repository, git workflow, basic Git Commands) as well as this quick Git guide from the Data School and more on the data scientist’s toolbox site.

Posted in Data Analysis, Git | Leave a comment

Changing R library path

I’ve been using R to do data analysis for process improvement for some time now. I’ve learned so much in the past year that I want to write many posts in a specific order, but they end up being kept in my mind. That’s no good. This year, I’ve decided to start posting every little new thing I learn in no particular order and no particular importance. Even if it’s simple, if I’ve just learned it, I’ll share it.

So, here is my most recent problem:

I use R Studio in a corporate machine in which I’m not the admin. There, the packages were installed in a temporary folder that is cleaned from time to time. I didn’t pay attention to that until the packages were deleted and I was blocked on re-installing them. I had to repair the application from time to time. And today,  I got a new warning stating that the library was not writable.

> install.packages("lubridate")
Installing package into ‘C:/Users/Public/R/libraries_i386’
(as ‘lib’ is unspecified)
Warning in install.packages :
  'lib = "C:/Users/Public/R/libraries_i386"' is not writable

I thought the best would be just to install the packages in a local folder that I have control over. So, I’ve added a new library to my library path.

> .libPaths( c( .libPaths(), "H:/My Documents/data analysis/R") )  
> .libPaths() 
[1] "C:/Users/Public/R/libraries_i386" 
"Q:/RSTUD301.001/R-3.2.2/library" "H:/My Documents/data analysis/R"

Now, every time I install a package, I select my local folder and the packages will not be deleted.

Source in StackOverflow.

Posted in Data Analysis, IT, R, R Studio | Leave a comment

I don’t like boxes, do you?!

The CIO stands up suddenly and looks to the horizon through the walls of glass, leaving behind his business analyst.
- I don’t like boxes! Do you?!
The consultants feel threatened by that statement after so much work gathering information and drawing many business process diagrams.
- What? Boxes? Ok, looking at a business process that shows the flow of activities among participants, you only see boxes and arrows. That’s fine!
The CIO insists on his statement, but this time challenging the analyst.
- I mean, isn’t it too simplistic? Are they useful at all to us?
And the analyst replies with an irony sauce.
- I see, you prefer to have your procedures textually. No one needs to learn what that diamond shape in the middle of all those boxes mean. I just have to write “If this happens, then do that. Otherwise, do something else”. Everyone will understand and they will follow the procedure properly. Good! But how did you get to the procedure? How do you know if it is efficient? I’m not saying that processes solve it all, there is monitoring of activities and everything else that comes with it. But what if using “boxes” could help you realise gaps, bottlenecks, links,…? You’ve just added a single line of text in your procedure: “participant x validates doc y”. It’s saved, published and now everyone can follow the updated procedure. But, wait, by adding this single activity in the process, you can visually see the need for additional communication with external participants. This extra communication represents a bottleneck in a process already filled with time constraints….For one, that’s something you did not see by adding a simple line in a long document. Think about it! Let’s at least use the “boxes” for making sound decisions on changes. You could throw them away later, if you’d like. But in your place, I would actually recycle them ;-)

The analyst just saved months of hard work on clarifying business to everyone.

Posted in Business, Business Process | Leave a comment

Need a solution to integrate a BPM and IT

I’m currently discussing with IT analysts about our needs for a tool that integrates both BPM and IT needs, modelling business processes and system specifications. I’m now sharing it to get other perspectives.

Here are some of the needs I believe we currently have:

  • First, we need to share a common repository of models between BPM team and IT teams. All the business processes we do in collaboration need to be done using the same tool and stored in the same repository to enable reusability, integration and avoid double work, inconsistencies, etc. Which leads me to think of the second need.
  •   Considering the current situation where there are several models already done: We need to continue using the same tool (Aris Business Architect) or find an import/export solution to another tool, if this new tool fulfills all the needs we have today and is economically more interesting. This way, we avoid re-writing unnecessarily hundreds of existing models (for processes and systems as well).
  •   On the perspective of business process management, we are modelling a lot of processes, but we also apply the entire BPM methodology, there is a lot of work to be done concerning execution and monitoring of processes. Therefore, the solution to be adopted needs to offer or interoperate with a BPM platform (e.g. ARIS MashZone or open source solutions, such as Activiti, BonitaSoft).
  •   Of course, as we have repeatedly discussed together, bridging the gap between business and IT, we need a solution to link business processes and IT requirements that eases requirements management (creating requirements linked to processes, following them up, etc).
  •   In summary, we need a solution that is cost-effective, concerning costs of licenses and resources needed, to import/export efficiently without much effort on re-writing. Managers expect all of us as analysts to be working more on harmonising processes and deeper analysis than re-writing models in another tool.

This is a starting point for further discussion. What are your views on this? Which solutions are you adopting?

Posted in Business, Business Process, IT | Leave a comment