Archive for the 'Off Topic' category

Using spiffy WordPress themes in an IE environment

Jul 22 2016 Published by under Off Topic

At MPOW we apparently have "compatibility mode" on by default by group policy. So this disables all the cool HTML5 and does weird things in general with a lot of web pages. If you go to the WordPress plugins, there are a few to show nasty messages to visitors that they have to change or update but that's just super unhelpful for those many visitors who don't actually have a choice.

Anyhoo... I pieced this together from a few different sites... If you go into network dashboard to themes to edit the theme and find the header.php file (back it up first just in case).

Then under <head> make the next line:

<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">

and update... works. This tells IE not to show compatibility view.

No responses yet

The smart phone and parenting children - two articles

Sep 27 2015 Published by under Off Topic

This weekend I saw two articles discussing the impact being frequently available on or frequently using a smartphone has on in-person relationships.

In the first, Motherhood, Screened Off by Susan Dominus in Thursday's New York Times (note, links are to the public site but I highly recommend you use your library's subscription) describes how she feels she has to narrate her use of the smart phone when she's using it to check an address or a recipe or something. In the past, when your mother was doing something besides paying attention to you it was obvious - she had her address book out or checkbook. The piece ends with her annoyed that she can't be using a bit of downtime when she's trying to get her child to sleep to get things done on her phone.

The second was by Sherry Turkle, Stop Googling. Let's Talk from today's New York Times, I guess. In it, she talks about what her research has shown about how the use of smart phones during face-to-face conversations messes them up and also possibly messes up empathy in young adults. She calls for "sacred" spaces (or perhaps times) at home and at work during which use of smartphones is banned - even if to check something.

Both of these hit home with me. I do try to narrate when I'm on the phone when the kids are around and I do for sure ban using the phone at the table- well, I ban myself, I can't do much about my spouse but give him a hard time. I also make an effort to make eye contact with my children and spend time with each of them without the devices, but working from home in the afternoons and evenings as I unfortunately do makes it so the computer is competition.

As for at-work times- I'm in the IT department, that's where they moved the information and research functions a few years ago, and boy howdy do those folks love to have meetings.  I have mostly been able to dodge the vast majority of them, but I can't even say how much it enrages me to be taken off an interesting and fun literature search on a cool technology or cool science for actual real sponsor work to be stuck in a meeting where my interlocutor starts texting someone and completely wastes my time.

No responses yet

XKCD is so me and my coding

Apr 17 2015 Published by under Off Topic

Check out the alt text on the original site.

XKCD cartoon from: http://xkcd.com/1513/

Comments are off for this post

Exporting high resolution graphs from RStudio

Feb 12 2015 Published by under Off Topic

This may not be obvious until you look into it but apparently the default export from RStudio -  if you use the nifty little tool in plots tab on the lower right hand side -  is 72dpi. This is fine for showing on web pages, typically, but is not enough for print. Particularly if you're submitting to a journal or something like that. There's lots of advice, but I found it somewhat confusing.

RStudio Interface for Windows from RStudio.com

RStudio Interface for Windows from RStudio.com

I found these posts helpful:

  • http://blog.revolutionanalytics.com/2009/01/10-tips-for-making-your-r-graphics-look-their-best.html
  • https://danieljhocking.wordpress.com/2013/03/12/high-resolution-figures-in-r/
  • http://www.r-bloggers.com/exporting-nice-plots-in-r/

I think someone I was reading just got out of RStudio and did his work in the standard interface. Really, there's no need for that. I also read somewhere that Cairo is not really used any more? There is a way to export to pdf from RStudio and check a box to use Cairo...

Here's what I did.

CairoPDF(file="something.pdf", width=11, height=8.5, family="Helvetica", pointsize=11)

set.seed(1337)

plot.igraph(g, layout=layout.fruchterman.reingold, edge.arrow.size=0.4, edge.color="black", vertex.size=V(g)$degree, vertex.label.dist=V(g)$vertex.label.dist, vertex.label.color="black", vertex.label.family="sans",edge.curved=TRUE, vertex.label.cex=V(g)$vertex.label.cex, edge.lty=E(g)$edge.lty, vertex.frame.color=V(g)$frame.color)

dev.off()

A couple of notes:

  • I found I needed to increase the arrowhead size
  • I needed to decrease the font size
  • I needed to set a seed so I was only changing one thing at a time as I experimented
  • When I did png, my dotted lines didn't look so dotted anymore. I didn't feel like messing with that further


Cairo(file="something.png", type="png", units="in", width=10, height=7, pointsize=12, dpi=300)

set.seed(1337)

plot.igraph(g, layout=layout.fruchterman.reingold, edge.arrow.size=0.1, edge.color="black", vertex.size=V(g)$degree, vertex.label.dist=V(g)$vertex.label.dist, vertex.label.color="black", vertex.label.family="sans",edge.curved=TRUE, vertex.label.cex=V(g)$vertex.label.cex, edge.lty=E(g)$edge.lty, vertex.frame.color=V(g)$frame.color)

dev.off()

One response so far

PyCharm FTW

Oct 12 2014 Published by under Off Topic

Another random Python note. I asked at work again in the Python group of our internal social networking thingy and consensus was that I should try PyCharm as a development environment.

All the stinking tutorials are like use a text editor and command line - and that's what I'd been doing - but with R, RStudio is so fantastic that I thought surely there must be something workable for Python. I had tried the eclipse plugin and I couldn't even get it to run a program and i couldn't figure out what it was doing and ugh.

PyCharm now has a community edition so you don't even have to prove you're a student or pay for it. It's lovely, really. I don't see why I should have to use VI like it's 1991 or beat on something with rocks to see where I'm missing a quote or have the wrong indents. Why not have help? I'm trying to accomplish a task not create art.

I really do have to continue coding and stop playing with Python. Particularly since when I do I end up losing hours of my life when I'm supposed to be sleeping!

2 responses so far

What I want/need in a programming class

Aug 08 2014 Published by under Off Topic, Uncategorized

Abigail Goben (Hedgehog Librarian) has a recent blog post discussing some of the shortcomings she's identified in the various coding courses she's taken online and the self-study she has done.

I think my view overlaps hers but is not the same. Instead of try to compare and contrast, I'll say what I've seen and what I need.

I'm probably pretty typical of my age: I had BASIC programming in elementary and high school. This was literally BASIC and was like

10 print "hello"
20 goto 10

I think we did something with graphics in high school, but it was more BASIC.  In college, they felt very strongly that physics majors should learn code, so I took the Pascal for non-CS majors in my freshman year.  That was almost like the BASIC programming: no functions, no objects... kinda do this, do this, do this... turn it in. I never did see any connection whatsoever with my coursework in physics. I never understood why I would use that instead of the Mathematica we had to use in diffeq

In the workforce, I did some self study javascript (before it was cool), html, CSS - not programming, obviously. And then I needed to get data for an independent study I was doing and my mentor for that study wrote a little Perl script to get web pages and pull out links. The script she wrote broke with any modifications to the website template, so after waiting for her to fix for me, I ended up fixing it myself... which I should have done to start with. ... In the second stats class another student and I asked if we could use R instead of Stata. He was going back to a country with less research funding and I was going to work independently. But then, we just used the regression functions already written out and followed from a book. Elsewhere in the workforce I've read a lot about R and some co-workers and I worked through a book... I did the CodeAcademy class on Python.

All of these classes - if they weren't in interactive mode, they could have been. What are the various data types. How do you get data in there and back out again. How do you do a for loop. Nobody really goes into any depth about lists in R and they pop up all over the place. I couldn't even get Python installed on my computer at first by myself because everyone teaching me was on a Mac. (btw, use active python and active perl if you're on Windows - not affiliated, but they just work).

The R class on Coursera (same one she complains about) and the data science class by JH there were the first that even really made me do functions. What a difference. I really appreciated them for that.

So here's what I think:

People new to programming - truly new - need to understand the basics of how any program works including data types, getting data in and out, for loops. But also architectural things like functions and objects. They probably need to spend some time with pseudocode just getting through the practice.

Then if you're not new to programming, but you're new to a language - different course. In that course you say this is how this language varies, this is what it does well with, here's where it fails.

Then there needs to be an all about software design or engineering or process course that talks about version control and how to use it. How to adequately document your code. How to write programs in a computationally efficient way. The difference between doing things in memory or not.  What are integrated development environments and when would you use one. This is what I need right now.

If it's something basic, I can follow along a recipe I can read off of stack overflow, but I know nothing about efficiency. Like why use sapply vs. a for loop? Is there a better way to load the data in? Why is it slow? Is it slower than I should expect? I love RStudio - love, love, love! But I tried something like that for Python and could never get it to work. I'm still learning git, but I don't really understand the process of it even though I can go through the steps.

Anyhow, more about me, but I think I'm probably pretty typical. I think there's a huge gap in the middle in what's being taught and I also think that a lot of people need the very basics of programming almost minus the specific language.

6 responses so far

Silencing women

Feb 21 2014 Published by under Off Topic

"That's an excellent suggestion, Miss Triggs. Perhaps one of the men here would like to make it."

This is so true you have to laugh and not cry. This was pointed out by Mary Beard, The Public Voice of Women, February 14, 2014, online at http://www.lrb.co.uk/2014/02/14/mary-beard/the-public-voice-of-women . Originally from Punch (here) and drawn by Riana Duncan.

2 responses so far

RIP F.W. Lancaster

Aug 31 2013 Published by under Off Topic

I don't believe I ever met F.W. Lancaster but I so value his work. His books and articles are so practical and useful. Clearly written. They're pretty much timeless, too. For example, his book: Lancaster, F. W. (1993). If you want to evaluate your library (2nd ed.). Champaign, IL: University of Illinois Graduate School of Library and Information Science, is on my bookshelf at work, and I do pull it down from time to time to reference various parts.

There's a blog post from UIUC with his bio.

Comments are off for this post

Donor's Choose matching funds!

Nov 01 2012 Published by under Off Topic

Give now through the end of the campaign and you can get matching funds for your projects. As you're checking out, enter SCIENCE in the "match or gift code" box. My site is at: http://www.donorschoose.org/donors/viewChallenge.html?id=263580 or pick any projects from any Scientopian's page!

Comments are off for this post

Donor's Choose 2012

Oct 22 2012 Published by under Off Topic

I'm a little late so please help me catch up! Donor's Choose is a great charity that collects small donations to put toward teachers' projects. There's accountability for where the money goes and you get to pick the projects. Each year groups of science bloggers have a competition to see who can raise the most.

I've selected a few interesting projects from my home state, so please consider donating to them. See them on the sidebar or go directly to the page at: http://www.donorschoose.org/donors/viewChallenge.html?id=263580  Not your cup of tea? Then please donate to another Scientopian's projects (see where we stand on the motherboard).

Comments are off for this post

Older posts »