Latest

Perl Commands for Cygwin

Substitution: perl -pi -e ‘s/oldstring/newstring/g’ file_name(for 1 file), */(for all files in current dir)

General Linear Model in Minitab

This procedure gives almost similar results to the Pipestat!!!

  1. In our design Accommodation had three levels (Coll, consist, mp) and the Participants were nested inside the accommodation (one Participant could participate in only one condition or a between-subject design)
  2. These both were crosses with Distance (5 levels)
  3. All of these were again crossed with repetition of distances.
  4. The trick is to consider the nested variables as a single unit when describing the model in Minitab
  5. So the model for this design would be
    • condition participant(condition)
    • distance distance*condition distance*participant(condition)
    • repetition repetition*condition repetition*participant(condition) repetition*distance  repetition*distance*condition repetition*distance*participant(condition)
  6. It is much better to do it in Pipestat as it figures out the model itself rather than us specifying it.

My original motivation to study the model was to do post-hoc test REGWQ etc. in Minitab but it looks like it does not provide that test.

Analysis of variance and Ryan’s post-hoc in SPSS

  1.  Arrange data in columns
  2. Analyze -> General Linear Model -> Univariate
  3. Select the Dependent Variable as the value based on which the ANOVA will be run or Grouping in the REGWQ will be done (Error)
  4. Select Fixed Factors as the independent variables of which the effects need to be found (Distance , Repetition for Anova) (only Distance for REGWQ)
  5. Select the Random Factor (Participant) [This one is important]
  6. Select the post-hoc tests you need.
  7. Click OK

 

ANOVA vs. MANOVA

ANOVA MANOVA
One dependent variable Multiple dependent variables
Univariate F value Multivariate F value (Wilks’ lambda)
Multiple independent variables (Multi-Factor ANOVA) is not MANOVA
based on a comparison of the Mean square error (Within-group variability) and the mean square effect (Between-group variability) based on a comparison of the error variance/covariance matrix and the effect variance/covariance matrix
After getting a significant Multivariate effect, next step is to run Univariate test on each dependent variable to find which dependent variable was affected most and hence contributed in main multivariate effect.

“R”

R Commands:

  • getwd(): returns the current working directory
  • setwd("C:/R/tables"): Sets the current directory
  • source("src.R"): run the R source file
  • y<-edit(y): opens up a notepad/spreadsheet with data from y
  • data1<-edit(data.frame()): opens up a spreadsheet for data entry
  • tbl<-read.table("table.dat", header = T, sep =""): reads table.dat with header and space as delimiter.
  • dat.collim$Part <- factor(dat.collim$Part): It removes the unnecessary or empty levels for a variable.

 

Useful R Links:

 

Internet connection shows yellow exclamation mark

If you can connect to your home network but not the internet then most probably the problem is because of your computer being connected to multiple connections (check under Control Panel->Network and Internet -> Network and Sharing Center: view your active networks)

Some tricks that have worked for me in past are:

  1. Disable the Bonjour service/ Double click on the service and select Automatic (delayed start).
    • This service can also show up as ##Id_String2.6844F930_1628_4223_B5CC_5BB94B879762##
    • It is usually installed by Adobe CS3 or Itunes
    • To permanently disable (A harsh step): rename the folder Bonjour to BonjourOld in Program Files(x86)
  2. Run Command Prompt as Administrator
    • Type   NETSH   INT   IP   RESET,  press ENTER
    • IPCONFIG    /FLUSHDNS,   press  ENTER

Make sure to Disable and Enable your Network Adapter after every solution. You never know when you will get lucky.

Some other things I tried in the process, which may have nothing to do with the problem

  1. Disabling Wired AutoConfig service
  2. Disabling WLAN AutoConfig service

 

ART tracker body transformations

When we mount a tracker on HMD, haploscope or camera (for video AR/VR), we need to do lot of transformations to bring the origin of tracking body to the eye position. These transformations results into lot of complexity in an otherwise simple code (not to mention an increased probability of bugs)

Luckily, The ART tracker gives the ability to shift the origin of a tracking body to any position (that position can be the eye position in our case)

  1. Attach the Tracking body to the hmd/haploscope/camera.
  2. Place the camera such that the camera lens (virtual eye) is at a known position w.r.t. the world coordinate origin.
  3. Measure the difference between actual position and the position measured by ART tracker.
  4. E.g Zreq = 500, Zactual = 395,  ZoffsetZactualZreq  = -105
  5. Open DTrack
  6. Go to Calibration -> Body Adjustment
  7. Select the appropriate body
  8. Go to Translation  by Vector tab
  9. Put the value of Zoffset in Z
  10. Hit Apply (Caution: Press only once, If you hit twice it will add twice of the offset )
  11. Press Reset Vector
  12. Enter values for Xoffset, Yoffset
  13. You can set all X, Y, Z values together, the trick is to press Apply only once. If you decide to do it separately make sure to press Reset Vector. The previously applied values stays in the box and if you won’t press Resent Vector before pressing Apply, it will be applied again.
  14. Good Luck!!!

Unresolved External Symbol ERROR

Sometimes the error of format:

DTrack.obj : error LNK2019: unresolved external symbol _gethostbyname@4 referenced in function "unsigned int __cdecl ip_name2ip(char const *)" (?ip_name2ip@@YAIPBD@Z)
1>istest_haplo.obj : error LNK2001: unresolved external symbol _gethostbyname@4

can be solved by linking Ws2_32.lib to the Project Properties->Linker-> Input-> Additional Dependencies.

GLUT

  • Download GLUT from Nate Robin’s Site
  • Put
    • glut.h to C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include
    • glut32.lib to C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Lib
    • glut32.dll to C:\Windows\System32\ or C:\Windows\SysWOW64
  • And, we are done

 

Linking to OpenGL libraries

When you have created an Empty project in VS 2008, add a new c++ source file (.cpp).

  • Open Project properties
  • Configuration Properties -> Linker -> Input
  • Select Configuration Drop-down box
    • Select All Configurations
    • It changes settings for both Debug and Release configurations
  • In the Additional Dependencies box, add opengl32.lib glu32.lib
  • Click OK