Using Emacs - 28 -Rectangles

One of my favorite but little used emacs features is rectangular editing. It's little used because I don't need it all that often. It's one of my favorites because when I do need it, it's just so amazingly useful.

The idea is you can mark a rectangle of text, cut it and later paste it. This means that if you have three columns of text:

a b c
d e f
g h i
j k l

You can easily mark the middle column (b e h k) or even just the b e and h, cut it and paste it elsewhere as a rectangle. You can also open up a rectangular region (filled with whitespace). There are a couple of other niceties but that's the basic idea.

Here's a link to all the functions:

https://www.gnu.org/software/emacs/manual/html_node/emacs/Rectangles.html

And the video:

Enjoy.

A Ground Hog Day Story

This post has nothing to do with computer science, teaching, education, policy or any of the other typical Cestlaz topics.

Natan wrote this last week and it really gave me a chuckle.

I thought some of you might enjoy it so here it is:

UPDATE

Apparently, if you view this on mobile it asks if you want to download the story every time so I changed it from an inline iframe to a link:

Link to the story

Should CS Ed be in bed with the College Board

I'm guessing my views on this aren't very popular -that's OK, every community needs a curmudgeon.

A few years ago, I cautioned if we weren't careful, once the big players got involved, CS Ed would go the way of other disciplines, and not in a good way. It looks like indeed we're well on our way down that road.

I've ranted before about things like non-profits, drop in and summer programs. STEM Oil Salesmen 1 selling easy fixes, exciting kids and parents, using the Think Method just like Professor Harold Hill only to send the kids off where they can blame a future teacher for failure.

I've also ranted about teacher preparation and how all the rage is short term, Superficial PD and scripted curricula and my concern that once the politicians can say CS is in the schools, we'll be done.

I've been working towards getting CS to all students for most of my career and while it's wonderful to see us getting closer to the goal, I'm seeing more and more signs that my caution is becoming reality. and CS Ed is going the way of other Ed - aligned to testing and more to the whims of the power players and politicians than to teachers and students.

The other week I noticed, this post by Code.org trying to encourage more students to take the APCSP exam - not encourage more students take the class or some other class or to have more students be exposed to CS but to actually sit for the APCSP exam. That post was followed by this one which also highlights actually taking the exam.

This didn't sit well with me.

What does the exam do for the kid? It doesn't drive instruction - by that time, any good teacher knows their student and is better served by using their own assessments. The college credit thing? I'm skeptical. Fewer and fewer schools are giving credit for APCSA let alone this new CS0 non major course. Blanket credit? Since full time students pay for a range of credits, I'm still skeptical here. Placement? It's a course for non-majors - what exactly are you placing out of?

Reasons not to take the exam?

  • If it doesn't do anything for the kid, why take it
  • Stress of taking the exam
  • There are other ways of placing out of courses once in college
  • Save the expense

As a general rule, I'm against forcing students to sit for AP exams. At the extreme case, since we've been brainwashed to think that a school that has lots of kids sitting for exams is good, I've seen at least one case of a principal having all his kids sit for, and just about all fail AP Calculus - that is, get a 1 or 2 on the exam. This principal had all his students take the exam, and only 2 scores were 3 or higher. This principal then parlayed his success into a higher profile gig - he's moved up in the world while setting up his students to fail.

This follows last year's announcement that code.org was partnering with the College Board - offering PD to teachers for free if the schools signed up their students for the PSAT 8/9 - another meaningless exam. So, we get teacher training light 2 as long as the school pays for the PSAT8/9 for every kid so that the kid can take yet another test with really no value3.

Why should students pay for an AP exam that doesn't do anything for them? Why should Jane Q Taxpayer pay for exams that only server to enrich the College Board.

True, The College Board is a big player. They already have much more influence of American High School education than they should. It's easy to climb on board the AP train for entre into our schools. The question is, should we use positions of influence to push efforts that might help our end but leave collateral damage to students and the public.

I don't doubt code.org's sincerity in wanting good CS in all schools nor the efforts or value as an advocate for CS Education. I'm concerned that the desire to win big and win now is moving us in a direction that we'll regret years from now.

Footnotes:

1
Not my term, but I really like it
2
If you think that PD based teacher training is OK, ask yourself if you want your own child's chemistry teacher to be a history teacher with a few weeks summer training in chemistry
3
And I'm guessing the exam will be offered during the day so teachers will proctor for free rather than be allowed to, you know, teach their students.

It's not one issue, it's the President and his enablers

Like many of my fellow bloggers and tweeters, I generally keep this site clear of political issues with the exception of those that are directly related to education.

Also, like many of my fellow bloggers and tweeters, this week has provided a reason to break with that tradition.

Many people, including some friends, all more eloquent than I have already posted, tweeted, and Facebooked about the behavior of our President and government.

Long time blogger Dave Winer put together trumpstatus.org where he's collecting many of the issues that we're all so alarmed with.

I would add cabinet appointments to his list with my particular personal concern over DeVos and the department of education. I've been meaning to blog about that for a while - perhaps this week.

My concern for today is something else. Every day, I see a new Trump induced crisis and every day I see a different subset of my circles respond. It's not quite as bad as:

First they came for the Socialists, and I did not speak out— Because I was not a Socialist.

Then they came for the Trade Unionists, and I did not speak out— Because I was not a Trade Unionist.

Then they came for the Jews, and I did not speak out— Because I was not a Jew.

Then they came for me—and there was no one left to speak for me.

People are indeed speaking out, but I am concerned that people are going to rise up for their personal issue and when placated go back to business as usual - this is NOT the time for business as usual.

With the ACA repeal, I saw concerns from my working class friends and friends that work with lower earning populations.

Going into the DeVos hearing, mostly educators - real educators not astroturf reformers.

With Friday's order, the whole tech community came out.

Here's part of a thread by tech activist Anil Dash calling out, calling on, and crediting assorted tech players.

We have to remember that all these order, policies, appointments, and plans are coming from the same place - Donald Trump and those politicians that are enabling him.

If he backs off on immigration, education issues remain, if he backs off there, we still have ACA, if that eases up, what about Women's rights and on and on.

This means we all have to get involved and stay involved.

What have I been doing?

  • I finally joined the ACLU and set up a monthly donation.
  • I subscribed to Daily Action so that I get a reminder each day of someone I can call to make a difference.
  • I'm starting to accumulate my representatives phone numbers as I make those calls and am trying to make at least a call a day to remind our representatives who they work for.
  • Education and advocacy

And if you suggestions for me - please post them here.

Thus ends my not business as usual post. What's going on in America is not someone else's problem - it's all of our problem and we all have to be active and vigilant to make it through tough times to come.

Using Emacs - 27 - shell and eshell

While I use emacs for all all sorts of things, one of the things I haven't done much is run shells from within emacs. I'm not sure why. I'm a command line wonk and adding command line goodness and emacs together seems like a natural. Maybe it's because back in the day I spent a lot of time on MS-DOS systems. You could get a reasonable Unixy facsimile using tools like the MKS toolkit and I like so many other young computer scientists wrote our own small shells when we learned C so I used that insted of command.com.

In any event, I'm trying to use the shell within emacs more.

Here's a quick video showing both shell, which runs whatever your default shell is in an emacs buffer and eshell which is emacs own shell.

I use a couple of packages to smooth over a couple of things.

Virtuelenvwrapper smooths things voer with the python virtaulenv and virtualenvwrapper linux packages:

(use-package virtualenvwrapper
      :ensure t
      :config
      (venv-initialize-interactive-shells)
      (venv-initialize-eshell))

Only relevant if you use Python and virtualenvs.

and more importantly, better shell:

(use-package better-shell
    :ensure t
    :bind (("C-'" . better-shell-shell)
	   ("C-;" . better-shell-remote-open)))

cleans things up when using a termianl to connect to a remote machine.

If you use a shell from within emacs as part of your workflow, please post how, or better, make a video!!!!

Enjoy

Essential topics for an intro course (not)

What essential topics should we teach in our intro courses? This seems to be a recurring topic recently.

It can be an important topic but, unfortunately, too often, it seems that people have too myopic a view

I remember thinking about this years ago when APCS moved from C++ to Java. Both languages have good and bad points both for practical and educational use. A big loss in the move to Java was memory management and the topics you could cover when memory issues arose.

Of course one might say that memory management shouldn't be in the first year of CS. That's fine, as long as you put it back in somewhere later on - something that didn't seem to happen universally.

That's the myopic view - far too few look at the overall picture.

C++ to Java ended up in removing a topic. I've also seen the reverse. I was talking to a friend about intro topics. He told me that it was critical to cover (insert topic here) in an intro course. Why, I asked? Because the kids absolutely needed to know that material in the third year course he was teaching.

I pressed a bit – "how many kids actually remember (insert topic here) and do you have to reteach anything." The answer - pretty much no one remembered and he always retaught the subject.

Did this mean that no one taught the topic in the earlier class? Unlikely. More likely is that the topic was taught without purpose or context, just because it was supposed to be taught and thus the knowledge wasn't retained. Sounds to me like the topic wasn't in the right place to begin with. Maybe it should have just been taught in that 300 level course to begin with.

Alfred Thompson wrote a post earlier today asking about teaching number bases.

Is it important? Maybe. Is it essential for an intro course? Probably not.

Binary makes sense when you start talking about low level stuff. If your intro course never gets close to the machine then why muddy the water with a topic that's out of place. The topic probably won't be appreciated and retention and understanding will be low.

If your intro course gets close to the machine or if you decide to talk about compiled code or similar topics, you have an entre to talk binary which leads to the convenience of hexadecimal. At Stuyvesant, it was much more sensible to talk about number bases in our systems course when we looked at C code in a debugger rather than in our intro our AP course.

You also might work on some application where bitmaps or similar as useful. That might be another good time to talk about number bases.

Is it important for a CS person to understand binary and it's relation to digital computers? Certainly. Does it have to be studied day one? Certainly not.

We need to keep an eye on the big picture. You can't get everything into a single class or a single yea. The question to ask is - do our students know what they have to by the time they leave our charge?

Using Emacs - 26 - Google Calendar, Org Agenda

A while ago I did a couple of videos on how I use org-capture (part 1, part 2). I didn't get into a big part of org-capture - how I use org-mode and capture to manage my calendar and todo lists.

I was waiting to see if I liked my current setup - using org-gcal to sync with my Google Calendar for appointments while using my main org file for my todo list.

Coincidentally, Rainer König recently put up a video on how he syncs with his Google calendar. He uses a different method than the one I present in this video so make sure to check out his approach. In fact, you should check out his entire series on org-mode.

Here's the code I use install org-gcal. The video steps through setting up things on the Google side. You'll have to replace the client ID and client secrets in the code below as well as use your calendar name and whatever org file you want to sync with.

(setq package-check-signature nil)


(use-package org-gcal
  :ensure t
  :config
  (setq org-gcal-client-id "oauth 2.0 client ID"
	org-gcal-client-secret "client secret"
	org-gcal-file-alist '(("zamansky@gmail.com" .  "~/Dropbox/orgfiles/gcal.org"))))

I use these two hooks to sync things semi-automatically. The first hook syncs whenever I load the agenda. Since this happens in the background, if I just added something to my calendar, I might have to reload the agenda by hitting r in the agenda view.

The second hook syncs with my Google calendar when I capture.

(add-hook 'org-agenda-mode-hook (lambda () (org-gcal-sync) ))
(add-hook 'org-capture-after-finalize-hook (lambda () (org-gcal-sync) ))

Here are the rest of my settings. The org files I want to include in my agenda views:

  • gcal.org – the one I'm syncing
  • i.org – my main org file for todo items (the todo capture places things in here)
  • schedule.org – my old schedule before I was syncing with Google. Not active anymore. I should probably remove it.

Also, my capture settings:

(setq org-agenda-files (list "~/Dropbox/orgfiles/gcal.org"
			     "~/Dropbox/orgfiles/i.org"
			     "~/Dropbox/orgfiles/schedule.org"))


(setq org-capture-templates
      '(("a" "Appointment" entry (file  "~/Dropbox/orgfiles/gcal.org" )
	 "* %?\n\n%^T\n\n:PROPERTIES:\n\n:END:\n\n")
	("l" "Link" entry (file+headline "~/Dropbox/orgfiles/links.org" "Links")
	 "* %? %^L %^g \n%T" :prepend t)
	("b" "Blog idea" entry (file+headline "~/Dropbox/orgfiles/i.org" "Blog Topics:")
	 "* %?\n%T" :prepend t)
	("t" "To Do Item" entry (file+headline "~/Dropbox/orgfiles/i.org" "To Do")
	 "* TODO %?\n%u" :prepend t)
	("n" "Note" entry (file+headline "~/Dropbox/orgfiles/i.org" "Note space")
	 "* %?\n%u" :prepend t)
	("j" "Journal" entry (file+datetree "~/Dropbox/journal.org")
	 "* %?\nEntered on %U\n  %i\n  %a")
	("s" "Screencast" entry (file "~/Dropbox/orgfiles/screencastnotes.org")
	 "* %?\n%i\n")))

The end result is that I can add an event in my Google calendar (or accept a calendar invite) and it appears in my org-mode agenda. Likewise, I can add a scheduled event using capture and it will sync up to Google. I can also just add an event by editing gcal.org but then would have to run org-gcal-post-at-point to send it up to Google.

Now, I can use bring up a regular agenda C-a a, my todo list C-a t or by adding a custom agenda command:

(setq org-agenda-custom-commands
      '(("c" "Simple agenda view"
	 ((agenda "")
	  (alltodo "")))))

a combined agenda and todo view using C-a n

Finally, there's calfw. It's a nice tool to view calendars in Google. I don't use it much anymore but it is nice:

(use-package calfw
  :ensure ;TODO: 
  :config
  (require 'calfw) 
  (require 'calfw-org)
  (setq cfw:org-overwrite-default-keybinding t)
  (require 'calfw-ical)

  (defun mycalendar ()
    (interactive)
    (cfw:open-calendar-buffer
     :contents-sources
     (list
      ;; (cfw:org-create-source "Green")  ; orgmode source
      (cfw:ical-create-source "gcal" "https://somecalnedaraddress" "IndianRed") ; devorah calender
      (cfw:ical-create-source "gcal" "https://anothercalendaraddress" "IndianRed") ; google calendar ICS
      ))) 
  (setq cfw:org-overwrite-default-keybinding t))

(use-package calfw-gcal
	:ensure t
	:config
	(require 'calfw-gcal))

Enjoy.

Better version:

Old, bad version:

BS? - BA - addendum

Over on Facebook, a friend commented on my last post. He commented on the rigor of BA vs BS degrees. The comment mentioned Physics and Math degrees but I thought Id follow up a bit on CS degrees.

I took a quick look at three computer science programs - Cornell, UMich, and Queens College. Cornell because my daughter is there, UMich, my son, and Queens College because it's a CUNY college that offers both a BS and a BA in computer science.

Cornell

Here's a link to Cornell's CS Major page. Same requirements for a BA through their School of Arts and Sciences as for their BS in the School of Engineering. The differences are limited to the fundamental school differences.

University of Michigan

Info on their program can be found here. They note:

  • Identical Core Computer Science requirements
  • Similar Senior Design experiences
  • Identical Upper Level Elective requirement
  • Slight difference in Flexible Technical Elective hours and list

Again, the difference is fundamentally in the base school requirements.

Queens College

This page has links to degree requirements. THe page states that "The B.S. augments the B.A. with more computer science, mathematics, and experimental laboratory courses" but when you look at the actual BS and BA requirements, they're the same.

In all cases, the differences are the fundamental difference between the extra liberal arts and distribution requirements in an Arts and Sciences school and the extra science and math courses required of an engineering school.

Which is better? It all depends. For me, personally, the liberal arts education is very important. For others, it will be the deep dive into science. Maybe more phyics will better enable a CS major to solve some technical problem but then again, maybe a culteral anthropology course will help a CS major see the world and people differently and also color her work.

To my original point - the important thing is that we do a better job informing guidance counselors, teachers, and high school students as to the possibilities so that they can make informed decisions.

BS? - BA

I didn't know Hunter College had computer science.

I heard that refrain more than once during my fall visits to high schools. Part of the reason for this is due to Hunter CS's low profile and small size in spite of its high quality.

Part, though, was also because of some misconceptions about Computer Science programs. I'd hear things like "but they only offer a BA not a BS," or "but Hunter isn't an engineering school."

I've come to realize that we have to do a better job educating kids as to what can come next after high school.

I'm not entirely sure why many assume that CS has to be under engineering. When I was applying to college, most of my choices were Arts and Science schools offering BAs in CS. Maybe it's because people don't disagregate STEM subjects. Even though it's not a computer science program many schools seem to associate FIRST robotics with computer science. Likewise any class with even a modicum of coding becomes computer science and as makerspaces and robotics are a percieved as easy entry STEM classes that appear to be CS (something I'll rant about in a future post), CS becomes associated with engineering.

It's easy enough to explain the difference between a BA in CS and a BS in CS and it's equally easy to show that you can have tremendous success either way. All you have to do to show the validity of a BA in CS is look at succesful people from places like NYU, Courant, Columbia College (as opposed to Columbia Engineering), Cornell school of Arts and Sciences, etc to balance successful people from the engineering schools.

As I'm sure you know, I'm pretty high on Hunter CS and it's certainly one of the best value CS educations out there. Personally, I'm a big believer in a liberal arts education but in any case, as a community we have to do a better job educating the high schools so that graduating seniors are best informed when deciding on their futures.

Using Emacs - 25 - Tramp

Today's video talks about using emacs Tramp mode.

Tramp mode allows you to edit remote files using your local emacs. I usually do this over ssh.

To edit a file on a machine www.cstuy.org I would first find-file using C-c C-f and then for the file name to open:

/ssh:www.cstuy.org:/home/zamansky/sc/testfile

this would open the file testfile in the absolute directory /home/zamansky/sc. If my username on the remote machine is different:

/ssh:username@www.cstuy.org:/home/zamansky/sc/testfile

And I can also work relative to my home directory:

/ssh:username@www.cstuy.org:sc/testfile

If I just hit enter after the machine name and : -

/ssh:username@www.cstuy.org:

I end up in a dired buffer on the remote machine.

Likewise if I run a shell or eshell in the tramp buffer, it will run the shell on the remote machine. In the video I showed how shell didn't work because locally, I'm configured to use zsh and I don't have zsh installed remotely. Eshell, however, worked fine.

Using tramp in this way gives us all of the power of our local emacs configuration to edit a file on a remote machine.

You can also use tramp to edit local files as root using sudo:

sudo::/tmp/sc/rootfile

Note the double colon.

Finally, you can do the double-whammy - remote root editing:

ssh::www.cstu.org|sudo:www.cstuy.org:/home/zamansky/sc/rootfile

If you use zsh and any of this freezes, just do a search on "zsh tramp" and the top couple of hits will tell you what to add to your configuration files to fix things.

Finally, I mentioned in the video that I don't use tramp all that much anymore. That's mostly because I don't do much remote editing anymore. I used it more when I was administering a number of machines at Stuyvesant.

I still use it periodically, but I also use sshfs, a Linux tool (which may be available for other operating systems) that allows me to mount a directory tree from a remote machine and use it on my local machine.




Enter your email address:

Delivered by FeedBurner

Google Analytics Alternative