Author Archives: amida168

Coursera: R Programming Week 2 Tips

The assignment for week 2 is kinda tough if you have not used R before. The video lectures also did not prepare you for it. If you have not taken the swirl tutorial, I strongly recommend that you finish it at the beginning of the week 2. You also want to start working on the assignment as soon as possible.

Derek Franks wrote a great tutorial. If you follow the step by step tutorial closely, you should have no problem finishing some problems in assignment 1. Here is the link to the tutorial:

https://github.com/derekfranks/practice_assignment/blob/master/Practice_Assignment.pdf

The second challenge I had about this assignment is that I did not know how to return a data frame in a function. After experimenting a bit and I finally got it to work. Here are the code for returning a data frame in a function.

## initiate the data frame
results <- data.frame()

## loop through the files
for (i in id) {
    ## read file and get completed cases
    ## add to the data frame.
     results <- rbind(results, data.frame(id=i,nobs=completed_cases))
}

## return the data frame
return(results)

Function cor is used in one of the problems, but it’s not taught. You are supposed to figure it out by yourself. The usage is actually quite easy. Suppose you read the file and store it in a data frame called data. To calculate the correlation between column 2 and column 3, you use corr this way.

cor(data[,2], data[,3])

Coursera: R Programming Week 1 Tips

After taking The Data Scientist’s Toolbox in the Coursera’s Data Science Signature Track, R Programming is my second Coursera course. The Data Scientist’s Toolbox is very easy, I only spent like a few hours each week to finish the quizz and assignment and I always waited until the last day to do it. When I worked on the first programming assignment for R programming, I still waited until the due day. However, I then realized the lectures did not prepare me for the assignment! After working non-stop for several hours straight, I finally submitted the first assignment on time. Here are some of the tips I gather during the course. I hope it’s useful for someone.

Week 1 is the easiest one, because there is no programming assignment. Remember there is an optional swirl assignment? I strongly recommend finishing this assignment this week. It has a lot of materials which are not covered in the lectures. One added benefit is that you can get bonus points for this assignment. Please check this web site for more details about swirl package.

http://swirlstats.com/

 

Set-Top Media Players Supporting DVD Menu – 2015

We published an article which recommends several set-top media players supporting DVD menu in 2010. Those players are no longer in production. Here is a list of players which you can buy now in 2015.

Macs Running Yosemite Freeze on Booting

We recently had some reports about Macs freeze on booting. The computers are all running the latest Yosemite. Here are the possible fixes for this problem. I listed them here with the detailed instructions on Apple’s website.

  1. Reset NVRam.
  2. Reset SMC.
  3. Boot to Safe Mode and reboot again.

On most machines, you only need to reset the NVRam. There is one machine that I used all three methods to get it to boot normally. Note that these are also the general procedures when you have problems with booting a Mac. You can try them even if the machine is not running Yosemite.

[Update: 4/1/2015]

You could try to delete BootCache.playlist file if all else fails.

  1. Press (Command+S) when the machine boots up to enter single user mode.
  2. Enter the following
    /sbin/mount -uw /
    rm -rf /System/Library/Caches/*
    rm /private/var/db/BootCache.playlist
    reboot
    

Cisco AnyConnect VPN “Failed to initialize connection subsystem” Error after Windows Update on Windows 8.1

After the recent Windows Update applied (February 2015), the Cisco AnyConnect VPN client stopped working on some of our Windows 8.1 machines. Whenever you try to connect, you get this dialog box. “Failed to initialize connection subsystem”.

ciscovpn-error

My colleague has suggested the following fix.

  1. Open Windows Explorer.
  2. Browse to C:\Program Files(x86)\Cisco\Cisco AnyConnect Secure Mobility Client on 64bit machine, or  C:\Program Files\Cisco\Cisco AnyConnect Secure Mobility Client on 32bit machine.
  3. Right click on vpnui.exe and select Properties.
  4. Click on Compatibility tab.
  5. Click on Change settings for all users.
  6. Click on Run this program in compatibility mode for: and select Windows 8.
  7. Click on OK to close the dialog box, click on OK again to close vpnui.exe Properties window.
  8. Reboot the machine or restart Cisco AnyConnect Secure Mobility Agent service.

Windows could not search for new updates – Code 8024402C Windows Update encountered an unknown error

During a recent security scanning of our machines, we found several machines have not been updated for several months. These machines are running Windows 7 and set up to get updates automatically. Something was not right and caused the machine to stop receiving updates. I tried to do manually update on one computer and got this error message.

windows-update-error-01

A quick search found this article which helps me to solve the problem. The problem of my machines were caused by a registry value. Here are the steps I used to fix it.

  1. Click on the Windows logo on the task bar and type regedit.
  2. Right click on the regedit.exe program and select Run as administrator.
  3. Browser to this key:
    HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU
  4. Double click on the value named UseWUServer and change the value data from 1 to 0. If you could not find this value or the value data is already 0, the cause of your problem is different. You’ll have to search for other solution.
    windows-update-error-02
  5. We have to restart the Windows Update service. In a Windows Explorer window, locate Computer. Right click on it and select Manage.
  6. Locate the Windows Update service. Right click on it and select Restart.
    windows-update-error-03

If restarting of the Windows Update service does not help, you can try to reboot the machine. I also found that after the registry change, one machine is still not able to do Windows Update correctly. I downloaded the Windows Update troubleshooter to fix that machine’s problem. Here is the link:

Open the Windows Update troubleshooter

 

How to Setup Inbox Rules for Shared Mailbox on Office 365

When my work email got migrated to Office 365, I found that the inbox rules (filters) were gone. It took me a while to find out how to set up the inbox rules. Here are the steps to get to the site to change them.

  1. Open a browser and visit this page
    https://outlook.office365.com/ecp/shared-mailbox-address/
    Replace shared-mailbox-address with your shared mailbox address.
  2. Click on organize email on the left side.
  3. Click on inbox rules on the top.
    office365-sharedmailbox-rules
  4. Click on the plus sign to add a new rule.