All posts by Social marketing master

Microsoft’s new Invite app makes scheduling meetings on iPhone a breeze

Anyone who has ever tried to schedule a meeting with a group of people knows how much of a hassle it can be. People have their own schedules with different idiosyncrasies, so setting up a time that’s convenient usually involves a lengthy email or chat chain just to figure out when the meeting can happen. 

Calendar invitations through apps like Outlook are supposed to make that process easier, but sending an invite without knowing when recipients are available often just leads to more frustrating back-and-forth for everyone.

read more

Using FOR loop for finding out the sum of variables?

I have a data frame that has 6,497,651 observations of 6 variables that I got from the National Emissions Inventory website and it has the following variables:

fips    SCC    Pollutant     Emissions    type    year

Basically, I have to plot a simple line plot to showcase the change in the level of emissions according to each year. Now, the year 1999 alone has some over a thousand observations; same goes for the rest of the years till 2008. The problem is not at all difficult since I can easily form a new data frame for each year with the sum of all the emissions recorded and then row bind all those subsetted data frames. But a more efficient and tidier way to accomplish this might be to use the FOR loop where I can calculate the sum of all the values under ‘Emissions’ according to each year and store all that information into a new data frame, but I am stuck on where to start. How do I enter the exact syntax that will calculate the sum of values according to each year?

read more

have git track changes on a renamed file (with new file to complicate matters)

We have a file that contains models that live in root_dir/model/__init__.py. This is obviously not ideal and it is preferable that this code lives in root_dir/models.py. The problem is that there are older versions of this that need to be maintained, and I expect that there will be changes to the older models.

If I use git mv root_dir/model/__init__.py root_dir/models.py changes to __init__.py are merged forward into models.py as expected.

There is a problem though: root_dir/model/ still requires an __init__.py and when I create one, the merge forward no longer works and leads to challenging merge conflicts.

read more

clojurescript unit testing recommendations

Trying to setup basic unit testing with clojurescript. Looked at:

https://github.com/clojure/clojurescript/wiki/Testing

In my project.clj file I have:

:cljsbuild {
            :builds [{:id "dev"
                      :source-paths ["src" "test"]
                      :figwheel { :on-jsload "my-proj.core/on-js-reload" }
                      :compiler {:main figreag.router
                                 :asset-path "js/compiled/out"
                                 :output-to "resources/public/js/compiled/my_proj.js"
                                 :output-dir "resources/public/js/compiled/out"
                                 :source-map-timestamp true }}

read more

Rstudio package development: Add -std=c++11 as compiler flag in Makevars

I am developing a project in Rstudio where I need to use C++11. So I wanted to specify the -std=c++11 compiler flag. I followd the R extensions manual, and have looked at other discussions (e.g this post). I put my Makefile in the src directory of my package, and this is what it contains:

PKG_CXXFLAGS = `-std=c++11`

However, I continue to get the same error after compilation fails:

read more