Press "Enter" to skip to content

Tag: problems

On a return to blogging after a hiatus

With the winter holiday I returned to my lazy, non-blogging habits. A New Year's resolution did little to change the situation. I suppose one just jumps in, though. I'll try to keep up with things more this semester. Really.

Plans for this semester

I'm currently taking a seminar on statistics education and an introductory course on qualitative methods. While the former is clearly my area of interest, the latter is proving to be more enjoyable than I had anticipated. One of the books for the course is Crotty's The Foundations of Social Research: Meaning and Perspective in the Research Process which is a bit more abstract than I was expecting, focusing on epistemologies and theoretical perspectives. It is a refreshing change, and I'm currently working my way through Feyerabend's Against Method after having my views on post-positivism challenged. (They seemed to be most aligned with Popper before this academic year.) Other plans include a trip to San Diego for LOCUS-related things and In-N-Out Burger, insha'Allah.

Dealing with Protected/Secured PDFs

Occasionally I'll come across a PDF that is Protected/Secured (it says 'SECURED' in the title bar of Adobe Reader) which are rather annoying to deal with. I've been using Mendeley to organize the articles/books I've read, and I copy the abstract into the software so that it can be searched. Alas, one journal whose articles I often read secure every single PDF so that copying cannot be done. Really frustrating.

Thankfully, this "secured" state is not encrypted or password protected. From what I gather, the state is determined by setting a bit in the file to disable certain features and Adobe, upon finding this information, respects the file's instructions. Not all software respects the file's instructions, and those that don't allow copying without issue. Two such readers are Evince (part of GNOME) and Okular (part of KDE). Both are open source, and both at least have options for disabling the DRM on the files. They are also both available on Windows (as well as many other platforms and are exceedingly common on Linux); if you're just looking for a quick download on Windows, Evince might be better. Either way, problem solved.

Leave a Comment

Fixing truncated strings in SAS

SAS, as powerful as it is, behaves oddly at times. The behavior is usually very well-documented, so it is just something that one has to account for. When SAS is creating a string variable, the maximum length it chooses is the length of the first value it encounters: any string longer than the first value is truncated (the end letters are just ignored). For example, if 'CAfter' and 'EBefore' are values, and 'CAfter' is encountered first, then the maximum value for all strings will be 6 and 'EBefore' will be shortened to 'EBefor'. If 'EBefore' were encountered first, there wouldn't be a problem. This can sometimes prove tricky if the data is read in unsorted once and then sorted later.

To correct this, one should manually specify the length the variable should be when it is created, like so:


data ling.vowel;
 set ling.vowel;
 length Group $ 7;
 Group = Class || When;
 obs = _N_;
run;

In the above, the length of the variable Group is fixed at 7. (Group is created by concatenating the variables Class and When).

Sometimes, the truncation is caused instead when the data are imported. By default, SAS only looks at the first 20 observations in a datasetto determine the maximum length of string variables. This can be changed by adding a guessingrows=32767 statement to PROC import (32767 is the maximum value):


proc import datafile="&mypath/vot-data-0921.csv" out=ling.vot dbms=csv replace;
 getnames=yes;
 guessingrows=32767;
run;

These are the two solutions I've found for truncated strings, and I was tired of having to find the SAS files that I had used them in.

Leave a Comment

"End" key not working

Part of my issue with getting CompizFusion to work was the lack of working keyboard shortcuts. For example, Expo (the OS X Expose-like feature) would work when my mouse was placed in the correct corner but not when using <super>-e (the "super" key is what the "Win" key is called on Linux). One recommendation I saw online was to create a file in one's home directory called .xmodmaprc which contains

keycode 115 = Super_L
add Mod4 = Super_L

Not only did this not fix my problem, but I later discovered that my end key no longer worked. Unloading this file from xmodmap (removing the file and logging back in) returned my end key to working status. Two things I didn't think to try at the time:

  • Would End+e trigger expo?
  • I have Third Level enabled, and super is the key to change levels... would this have an effect?

Those are questions for another time, but getting the end key working again was enough for now.

(This is my current, working xmodmap configuration:


[Doug@FLASHMAN-SL ~]$ xmodmap
xmodmap: up to 3 keys per modifier, (keycodes in parentheses):

shift Shift_L (0x32), Shift_R (0x3e)
lock Caps_Lock (0x42)
control Control_L (0x25), Control_R (0x69)
mod1 Alt_L (0x40), Alt_R (0x6c), Meta_L (0xcd)
mod2 Num_Lock (0x4d)
mod3
mod4 Super_L (0xce), Hyper_L (0xcf)
mod5 ISO_Level3_Shift (0x5c), Mode_switch (0xcb)

Not sure what all it does, but it seems to get the job done.)

Leave a Comment

Quite a few minor issues today

I've been doing a lot of writing in Microsoft Word lately (there are others working on the same document and LibreOffice Writer can't seem to get it right), so I've been living in Windows-world. Yesterday I needed to access an R package that is UNIX-only apparently (heR.Misc - really? No Windows binaries?) and was greeted by Scientific Linux with some updates to take care of. Most of the updates installed fine, but five did not. The five that did not were all related to Qpid (packages like qpid-cpp-client). These could not be installed because yum could not resolve some dependency issues. Apparently the issue was that these updates were related in some way to the matahari package, which was deprecated by Red Hat (according to this forum post at least). A quick sudo yum remove matahari in the terminal and the updates installed correctly.

I figured while I was updating software that I would try to get an Aero Snap-like feature working in Linux.  As much as I like the stability of Linux, I dislike the lack of some should-be-standard features in GNOME. In Windows 7, there are some great features like Aero Snap (automatically half-maximize windows) and windows grouped on the taskbar. CompizFusion can... somewhat perform these features, but not with the polish and consistency that I've come to expect.

I just care about my computer supporting my productivity, and I am therefore not attached to any particular window environment. KDE 4 seems to have implemented some of these features without the use of add-ons, so I figured that I would give it a try. However, installing KDE using YUM wasn't immediately obvious. Searching for "kde" resulted in tons of packages, but none seemed to be a wrapper for the entire environment. Eventually I went to the command line and executed (as root):

yum groupinstall "KDE desktop"

However, I should have realized that Scientific Linux doesn't have the latest, greatest packages. The KDE that was installed was version 4.3 and... didn't do what I wanted it to. I promptly switched back to GNOME and started playing around with CompizFusion.

Long story short, I got frustrated and gave up for the time being. I am determined to get this to work, but I don't have the time to devote to it right this second. I think this is where things went wrong: I wanted to uninstall KDE and did

yum groupremove "KDE desktop"

which uninstalled all KDE-related packages and not just the ones that had been installed above (I had previously installed some packages like kdegraphics which contains Okular (a great PDF reader)). While I would like to figure out how to remove an entire group  except for certain packages, that's something to solve later. No big deal, I didn't use them much and could always add them back later. I rebooted my computer to complete some updates and...

No internet when it came back. The GNOME panel icon was just... gone. Now, my first instinct was to search the internet for related issues. I was able to get online by plugging in an ethernet cable and running, as root,

ifconfig eth0 up
dhclient eth0

This gave me wired internet, though Yum Extender didn't want to believe it had internet. I ended up having to run from the terminal

yumex --root

to be able to install packages.

Most of the resources I found related to Ubuntu which can be rather different from Scientific Linux/CentOS/RHEL. I tried to see if the network manager was still installed by running


[Doug@FLASHMAN-SL ~]$ service network-manager status
network-manager: unrecognized service

Seems like a problem... except the network manager is not called network-manager in Scientific Linux. It is actually called NetworkManager.


[Doug@FLASHMAN-SL ~]$ service NetworkManager status
NetworkManager (pid  2077) is running...

I spent way too long reinstalling NetworkManager when that was never my issue. What it turned out to be was the program nm-applet was missing (uninstalled at some point), and I just needed to (re)install the package NetworkManager-gnome.

That was a headache that was mostly my fault, but the lack of solid documentation (and vague search terms like "gnome internet icon missing") made this difficult to figure out. Maybe putting all of these search terms in one place will help other people.

As an aside, my school (UF) now offers Red Hat Enterprise Linux to students... and I am toying with the idea of switching from Scientific Linux to RHEL. However, UF is running RHEL 6.1 and I'm running SL 6.2, and I would prefer to not do a clean install. Unsurprisingly, Red Hat does not support cross-grading (I asked), and I don't want to fiddle with a simultaneous cross/downgrade. Though I must say, the support would be nice for situations like this...

Leave a Comment

A gripe with the default SAS GUI

SAS is a great piece of software. Really, it is. As far as getting statistics done (and done well) it is in a league of its own. However, the user interface leaves a lot to be desired.

The little icon above the green arrow? Run all code (or run selected code).
The little icon above the red arrow? Delete all code and close the active file without saving with no confirmation.

Two small, black, similarly-shaped icons. One I use dozens of times in each session. One which I cannot think of a use for. And they put them right. Next. To. Each. Other.

Admittedly, this UI is not the latest and greatest out of North Carolina. SAS products ship with "Enterprise Guide" - a modern, workflow-oriented IDE for SAS. Enterprise Guide has incredible features and is thoroughly modern... but it is (in my experience) slow and overkill for many things. I just want to write some SAS code, see syntax highlighting, and run my code without worrying that I'll accidentally delete what I've been working on. I learned to use SAS through batch jobs on a UNIX system, so any UI is more friendly than the command line... but there has to be a middle ground somewhere.

Leave a Comment