Python Installation

It's been a few years since I've needed to use python!

If you open Terminal and type "python", it will open the interpreter and tell you the version.  If you need to know where on your computer Python is installed, type the following:
>>> import sys
>>> sys.executable

If you don't already have python:
Notes:
Follow the MacPorts guide, which instructs you to install Xcode  (need Apple ID).  You'll also need to install the Xcod command line tools  ("xcode-select --install") and  accept the license at the command line (it gives you the command).  Next the guide provides a link to download and install Macports.
From there, install Python, nice guide here.
sudo port install python34
# make this new version of python default
sudo port select --set python python34

Example python package installation: 
sudo port install py34-readline
sudo port install py34-pandas

I also installed pip, which is supposed to be better for managing python packages.
sudo port install py34-pip
To ensure the most recent version of pip is default, I did:
port select --set pip pip34

Install python package, SQLalchemy
sudo pip install SQLAlchemy

sudo pip install pandas
sudo pip install pymysql

Next I needed pymssql but this needed freetds first.  First I tired:

sudo port install freetds  But that didn't work so I did:
brew install freetds
 
Then as per the message displayed in Homebrew after I installed freetds,
I had to set some environment variables:

Then manually link my homebrew-installed openssl to pip:
export LDFLAGS="-I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib" 
export CPPFLAGS="-I/usr/local/opt/openssl/include"
export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig"
 
Then pymysql STILL wouldn't install so I did this:
brew unlink freetds; brew install homebrew/versions/freetds091
reference:  https://github.com/pymssql/pymssql/issues/432  

 
I had also tried:
sudo port install freetds +mssql +odbc +universal
ref: http://www.cerebralmastication.com/2013/01/installing-debugging-odbc-on-mac-os-x/
ref: https://gist.github.com/tommct/5749453 
ref: https://github.com/lionheart/django-pyodbc/wiki/Mac-setup-to-connect-to-a-MS-SQL-Server 

The following link was useful when I tried, again with difficulty, to do the above on my laptop.  I had trouble with the below because I couldn't get Homebrew to update.  It was giving Error: /usr/local is not writable. You should change the ownership
and permissions of /usr/local back to your user account:  So I did sudo chown -R $(whom) /usr/local and then changed it back with sudo chown root:wheel /usr/local.  On the last step, I had to do "sudo pip install pymssql" not just "pip install pymssql".
http://gree2.github.io/python/setup/2017/04/19/python-instal-pymssql-on-mac

For FreeTDS, you need to use the configuration file, freetds.conf.
Location of freetds.conf:
It will tell you if you type the following command:
tsql -C

Inside freetds.conf I had to use:
[myhost]
    host = myhost.whatever.ca
    port = 1433
    tds version = 8.0
    use ntlmv2 = yes



 
Then at the command line, you use the "tsql" command to check that FreeTDS is installed correctly.  The -S option links to [myhost] in freetds.conf.
tsql -S myhost -U DOMAIN\\username

Note the two slashes!   Before I figured out you need two slashes, I did lots of debugging . You can create a log file like this:
TDSDUMP=/Users/stephfrost/bin/freetds.log tsql -S DEFSQLDEV -U USASK/slb534
 

Specify TDS protocol version at command line:
TDSVER=8.0 tsql -S DEFSQLDEV -U USASK/slb534 

pip install pymssql
That failed so I did:
sudo pip install git+https://github.com/pymssql/pymssql.git

I had to do this in Eclipse:
Window -> Preferences -> PyDev -> Editor -> Code Analysis -> Undefined -> Undefined Variable From Import -> Ignore
ref:
https://stackoverflow.com/questions/2112715/how-do-i-fix-pydev-undefined-variable-from-import-errors

Useful link about importing Python libs:
https://stackoverflow.com/questions/4631377/unresolved-import-issues-with-pydev-and-eclipse


Hello, blog! Bye for now

I've been posting a lot lately!  It's because I'm on holidays, but today is the last day.  Probably I won't be back for a couple months.  I have to get through my thesis defence, then revisions.  See you later! 

Final Fantasy XV

I’m thoroughly enjoying Final Fantasy XV.  I watched the 5-episode anime twice: once before playing, and once after I’d played the game for a bit.  I’m also watching the Kingsglaive movie.  In the game, I’ve played up to Chapter 3 so far and am excited for the rest.

Before playing, I knew the game revolved around 4 male characters.  I thought: It would have been easy to make 2 of them or even just one of them a girl.  Prompto, the best friend from school could have been a girl.  Gladio, the super fighter, could be a girl.  The butler/cook/driver Ignis could have been a girl.  Even Noct could have been the Princess instead of the Prince.  But, whatever.  The game is so good I’m enjoying it as is.  Most games are centered around men and I’m used to it.  Previous final fantasy games have allowed women to be the main character (ex. Terra) so it’s much easier to accept the current story because I still have faith in the Final Fantasy franchise - their next game will probably even out the genders a little better, and maybe even have some non-conforming characters, too!  (or maybe not... There have been great advances in equality recently, but I also know there is a backlash.  see: 2016 US federal election)

After playing the game for a bit, I’m loving the friendship that is obvious between these 4 guys.  They're going through a lot together.  I love how during the game combat, Ignis always seems to be closer to Noct.  The king personally asked Ignis to take care of Noct and even in the game combat you can see Ignis takes this seriously.  I love how when Noct is “down” the guys come closer to protect him - the way they stand and keep watch around their Prince while he recharges his MP.  I love their banter as they drive or walk around the world, how they play games around the campfire and enjoy food together.  It reminds me of times I’ve done all of these things with my own friends and family. 

I think this game is also filling a void, so I’m glad to see these 4 males and their friendship.  There’s a real shortage of male heroes having vulnerabilities and emotions that are actually discussed between each other.  For example, Prompto says how he feels he doesn’t belong because he’s just a “pleb” whereas Ignis and Gladio actually had a formal position in the palace.  He had a heart to heart conversation with Noct and as a result, they’ll be able to work together even better in the future.  With 4 males there's lots of opporunity for man-on-man friendship development.  For this reason, I’m glad to see the 4 males in the game.  There's not enough of this stuff out there.

But it really hurt when the game designer said the whole reason there are 4 males is that they thought that the presence of a woman would wreck this sense of friendship and camaraderie.  They say "men act differently when there are no women around".   By removing woman, they think the environment will be better for friendship and camaraderie.  

By allowing in women, maybe they are worried they would introduce sexual tension.  But, what if one or more of the 4 males were gay?  What if the woman were a lesbian?  Or what if - gasp! - a woman could be a great friend just like what exists between Noct/Prompto/Gladio/Ignis?  The hurtful thing to me is that it’s clear the designers aren’t even willing to try.  They have this preconceived notion about women and have decided to lock them out.  It hurts because this has been happening for generations in the real world - this fear of women that leads to us being locked out.  I've been on the outside a lot, often being one of the only women in a Computer Science class or member of an IT department.

It’s like the Final Fantasy designers think women are the cause of sexual tension and men are not.  Wrong!  Anyone - male or female or otherwise - can crush over someone else or, or the other way around.  Men can fall in love with women, or men, or other.  Women can fall in love with women, or men, or other.  LGBT people exist.  Love may or may not be reciprocated.  This is something all humans share. 

It hurts that the designers would say that love can only exist between men and women.  It hurts that they’re saying the one who wrecks it is the woman.  It hurts that they’re saying women exist to be fallen in love with but can’t be a regular person who is your buddy and teammate. 

But, whatever.  I’ll weather this one and keep playing the game.  So we push the Regalia into Hammerhead and what do you see?  The camera focuses on some high heel boots that go up to Cindy’s thighs, then you see shorts so short that her butt cheeks are showing, and her thong.  And her short jacket is zippered open so her push-up bra gives you full view of boobs every time she says something.  I literally shouted “AWE, COME ON!!”.  This is the first woman character in the game, and this is how you designed her?

But, whatever.  I’ll weather this one and keep playing the game. (there is a theme here!) So I play a little more and bump into another female character, Monica.  Apparently she is a badass who had a high up position like Ignis and Gladio.  I meet her and she had drab clothing.  Fair enough, but how come Noct/Prompto/Gladio/Ignis get cool costumes and she doesn't?  Oh well.  Maybe hers was more of an office job.  But they could have still given her an interesting coat or hat or something.  Oh well.  Then I find you don’t even get to play as her.  But you get to play her male superior officer, Cor.  Nothing against him, he was cool -- I remember in earlier games trying things like disequipping his gear before he leaves the party so you could use the higher level stuff or sell it.  I enjoyed partnering with him because as Noct I was responsible for getting the enemies who were high up -- I had to use my warp-strike.

Sadly, there's a constant barrage of jabs against women in the game.  While I enjoy most of the banter the characters have with each other as they're walking around or driving, they're also constantly talking about Cindy's sexual availability and the chances they have with her.  Even Iris... she reminds me of what I looked like as a teenager!  I love her!  I was so excited when Iris joined my group briefly for a tour of Lestallum, but then the game had to go and ask me if I thought the walk was a date.  AWE, COME ON!!

Why doesn't the game ever allow women to exist without some comment or jab about their relationship to men?  Even the men in Lestallum talk about the wive's promotions as being some sort of dig on their own egos.

A few days later, I learn about the Kingsglaive movie.  I was delighted to meet Crowe, a female magic user.  I thought she would be great in a role just like Ignis and Gladio — somebody important from the castle to come along with Noctis.  I hoped I would meet her later in the game.  But then in the movie, her story ends abruptly.  (I won’t say in detail to avoid a spoiler).  Her story is taken over by a male character Libertus because of his reaction to what happened to her.  If the game is consistent with the movie, then I probably won’t get to play as Crowe in the game.  Again I'm like, "AWE, COME ON!!!"

I love Noctis, Prompto, Ignis and Gladio.  I really do.  But please give me a girl who is a whole person, not a sex object, and not just a person to serve as the motivation for one of the male characters.  You could dress Cindy as a real mechanic - how about some cool overalls full of cool gizmos -  and let her come along on some quests with me.  Or send Crowe to meet me in Lestallum and have her join me on some quests.  Or Luna  - she's the Oracle, right?  She must have some super powers.  I realize she’s probably on the other side of the continent right now, but maybe you could add in a mini-chapter where I could play as her for a while, or let me switch back and forth between advancing Luna’s side of the story and the guys.   Maybe this is coming later in the game.

Anyway, I’m enjoying this game, but I had to blow off some steam.  Special nod to my husband who sympathizes with me and got me Recore - I’m looking forward to trying that next!  But I'm not done with Final Fantasy.  I have faith they can do better!

Handling the controls

As a kid, I played lots of Nintendo games.  I was adept with the video game controller.  I knew the codes and could hit a long sequence of buttons correctly and quickly to beat the toughest bosses.

But then something happened.  Years later, I was one of those people who lagged behind everyone else.  When it was mainstream, I'd still never sent a text message before.  I wasn't adept on my phone.  There were a couple main buttons I used for the basics, but the rest were a mystery.  Those extra buttons were for other people who were better at this.  I watched others texting really quickly, like there was a connection between their fingers and the controls that I didn't have.  I remember thinking "I used to be good at this".  With mobile phones, I was one of those people who didn't "get it".

And then it happened to video games.  Many years had passed since those childhood days playing Nintendo in the basement.  One day I picked up a new Metroid game.  Technology had changed - the came was in 3D instead of 2D.   I was excited to get back into it and re-experience my youthful triumphs.  But, I failed miserably at aiming the gun.  I died over and over.  And not the good kind of dying where you learn a bit each time and each death means you are practicing more and getting better.  No, I was dying because I couldn't use the controls.  I sucked, and I wasn't having any fun.

I knew that to get better, I'd need to invest serious time in learning these new controls.  This would come at a high cost.  The thing most rare and precious to me these days was free time.  With so many demands with the baby, work, family obligations and everything else, I wasn't willing to spend whatever rare free minutes I had.  I knew the demands of the game would be higher than what I had.  So, I gave up on the video game before ever really starting.  Because of the barrier to learning the new controls - whether they be a mobile phone or a modern video game controller --  I wondered if there was something inherent in being a mom in her late 20s who was "supposed" to lose touch with video games by now because I was too slow at learning. 

Today I'd like to tell you not to lose hope!  If this has happened to you -- your "gaming" skill disappeared because you had a baby, because of hard times, or what -- I can tell you it doesn't have to be permanent!  The magic connection between you and the controls can be re-built.  Just by using my phone more and more often (given the upgrade from my clamshell phone to an iPhone, and new apps that give more reasons to use the phone), I can now text quickly like "those people" I envied not long ago.  And now that my kid is old enough, I picked up a video game (Final Fantasy XV recently!) and with practice I've become good at it!  I can do warp-strikes, link attacks, target enemies, block, parry, cast spells, switch weapons, and swap out to other characters' special abilities.  I own this -- BOOYEAH!

Granted, I sucked at first.  I mashed the wrong buttons and I accidentally wasted a Mega potion because I was pressing "use" over and over instead of "cancel" to back out.  I couldn't remember the difference between the "item menu" screen and the "target" button.  I used to forget which button was attack.  But it didn't take long at all.  I found a comfort zone, did that for a while, then I re-played the tutorial again to pick up on subtleties I forgot.  At the age of 35 I am more purposeful with my learning:  "I am going to learn this now" and I deliberately set out to learn it, and I do.  As a kid I don't remember doing this, it just kinda happened by osmosis.  Or probably by learning it from my siblings through repetition!

The point is, I have experienced the loss of "it".  I wondered if my days as a gamer were over, if I was no longer good enough.  But then I fought to get it back again. 

There are probably lots of gamers out there who got "it" as kids and have never experienced the loss of "it".  Maybe those gamers think less of me.  I'm sure there are others who'd cheer me on even though they will never experience the loss I did. 

And now I am here, and I keep on playing. 

Cool links about the JQuery DatePicker



http://www.hongkiat.com/blog/jquery-ui-datepicker/

http://www.simplecodestuffs.com/date-time-picker-in-struts-2-using-jquery/

http://jsfiddle.net/MBwSe/2/

http://find-code.com/src//com.jgeppert.struts2.jquery/struts2-jquery-plugin/2.1.0/com/jgeppert/struts2/jquery/components/DatePicker.javadoc.html
       
http://stackoverflow.com/questions/27292512/struts2-jquery-datepicker-enable-only-particular-dates-in-calendar
http://stackoverflow.com/questions/10224415/populate-existing-array-with-json-data
http://stackoverflow.com/questions/3961963/beforeshow-event-not-firing-on-jqueryui-datepicker/
http://stackoverflow.com/questions/2735207/javascript-jquery-datepicker-simple-highlighting-of-specific-days-who-can-he
   
http://www.jquerybyexample.net/2012/05/highlight-specific-dates-in-jquery-ui.html
https://code.google.com/archive/p/struts2-jquery/wikis/DatePickerTag.wiki
//datepicker docs http://api.jqueryui.com/datepicker/#option-beforeShow

https://github.com/struts-community-plugins/struts2-jquery/wiki/DatePickerTag
//onBeforeShowDayTopics

Cool links about load balancing

The first time I load balanced several Tomcat nodes behind an Apache using mod_jk was in the early 2000s.  Mayb 2002, I'm not sure.  Anyway, here is a spot where I will gather my various references on the topic. 


White screen of death and how to coordinate the maxConnctions and timeout settings between workers.properties and Tomcat server.xml

Pretty much anything you do will be useful

I've been a grad student for 6 years now.  If I could go back in time and talk to myself as a new (or aspiring!) graduate student, here is something I'd tell me.

You probably won't really know what your research contribution is going to be until after you've done it.  Don't worry about picking the perfect research problem ahead of time.  It's going to change, it might not be what you set out to do in the first place, and that's OK and normal. 
It is true that as graduate students, we are expected to make a research contribution that will advance human knowledge in some way.  But, don't let this worry you!  There is so much out there for us humans to explore that pretty much anything you do will be a useful contribution.  So, follow your heart!!

What's the big deal, then?  Why is grad school so much work if anything you work on is going to be useful?  The place where you will really put in your hard labour of love is in creating that "in between" place of your project and the rest of human knowledge.  You keep on building this thing that is made up of a combination of your own work and all the research others have done in your area.  Sometimes, you are building it actively (i.e. while you are reading others' work).  Other times, this base is just in the back of your mind while you are focusing on your own study.  So long as you are showing up, this base of understanding will be forming.  Over and over as you read about other's work, you might keep bumping into research papers that seems like they have already solved your problem.  But don't worry, these are your friends!  Look closer -- your own work is going to be slightly different in some way.  These papers will actually strengthen what you have done because they give you a solid step on your base to reach even higher!  Then, you create a guide (your thesis) that will show others what your contribution is.  As you explain it, the reader will create their own links between your work and their own understanding of human knowledge in this area.

You can't really predict what your contribution will be - it kind of ends up where it just so happens to end up.  It's the same with collective human knowledge - we don't know where it will go, and it just kind of ends up where it ends up.  Nobody else will have done whatever it is your work turns into.  That's why pretty much anything you do will be useful!

Translate