Geek Poetry

A friend sent this to me. A fun bit of poetry:

 

Untitled
======

Tiger, Tiger burning bright
Like a geek who works all night
What new-fangled bit or byte
Could ease the hacker's weary plight?

To the most despised collections' cast
We'll bid a fond farewell at last
With generics' burning spear
The need for cast will disappear

While Iterators have their uses
They sometimes strangle us like nooses
With enhanced-for's deadly ray
Iterator's kept at bay

When from the collections ints are drawn
Wrapper classes make us mourn
When Tiger comes, we'll shed no tears
We'll autobox them in the ears

The int-enum will soon be gone
Like a foe we've known too long.
With type safe-enum's mighty power
Our foe will bother us no more

And from the constant interface
We shall inherit no disgrace
With static import at our side
Our joy will be unqualified

As for noble metadata
I'll have to sing its praises later
Its uses are so numerous
To give their due, I'd miss the bus

O joyless nights, o joyless days
Our programs cluttered with arrays
With varargs here, we needn't whine;
We'll simply put the args inline

Tiger, Tiger burning bright
Like a geek who works all night
What new-fangled bit or byte
Could ease the hacker's weary plight?

Moodle SQL for users online

This works for Postgresql:

select count(*) from mdl_user where
mdl_user.lastaccess > (date_part('epoch'::text, now())::bigint - 300);

or

select firstname,lastname  from mdl_user where
mdl_user.lastaccess > (date_part('epoch'::text, now())::bigint - 300)
order by 2,1;

Moodle SQL

Handy queries for Moodle.

Count number of users who are are in courses:

select count(distinct ra.userid) from mdl_role_assignments ra,mdl_context c
where ra.contextid=c.id and c.contextlevel=50

Show users who are users in Moodle, but not  in a class:

select * from mdl_user where not exists (select * from mdl_user_lastaccess where mdl_user.id =  mdl_user_lastaccess.id);

Number of users who have classes:

select count(distinct ra.userid) from mdl_role_assignments ra,mdl_context c
where ra.contextid=c.id and c.contextlevel=50</div>

Jesusita Fire

Some vids I took from SBCC. The fire is close by. In the morning, I hope my friends still have their homes.

Crabby old woman

When an old lady died in the geriatric ward of a small hospital near
Dundee Scotland , it was believed that she had nothing left of any
value. Later, when the nurses were going through her meager possessions,
they found this poem. Its quality and content so impressed the staff that
copies were made and distributed to every nurse in the hospital. One
nurse took her copy to Ireland . The old lady's sole bequest to posterity
has since appeared in the Christmas edition of the News Magazine of the
North Ireland Association for Mental Health. A slide presentation has
also been made based on her simple, but eloquent, poem. And this little
old Scottish lady, with nothing left to give to the world, is now the
author of this 'anonymous' poem winging across the Internet:

Crabby Old Woman

What do you see, nurses................What do you see?
What are you thinking......When you're looking at me?
A crabby old woman..........................Not very wise,
Uncertain of habit,......................With faraway eyes?

Who dribbles her food ................ And makes no reply.
When you say in a loud voice.......'I do wish you'd try!'
Who seems not to notice ..........The things that you do,
And forever is losing ......................A stocking or shoe?

Who, resisting or not, .............. Lets you do as you will,
With bathing and feeding, .............. The long day to fill?
Is that what you're thinking?......... Is that what you see?
Then open your eyes, nurse,.....You're not looking at me.

I'll tell you who I am ........................As I sit here so still,
As I do at your bidding, ................... As I eat at your will.
I'm a small child of ten..............With a father and mother,
Brothers and sisters........................Who love one another.

A young girl of sixteen ....................With wings on her feet
Dreaming that soon now ...................... A lover she'll meet.
A bride soon at twenty, .................... My heart gives a leap,
Remembering the vows ............... That I promised to keep.

At twenty-five now,..................... I have young of my own,
Who need me to guide ............... And a secure happy home..
A woman of thirty,..................... My young now grown fast,
Bound to each other...................... With ties that should last.

At forty, my young sons...............Have grown and are gone,
But my man's beside me.....................To see I don't mourn
At fifty once more,....................Babies play round my knee,
Again we know children,................... My loved one and me.

Dark days are upon me,.......................My husband is dead,
I look at the future,..............................I shudder with dread.
For my young are all rearing .................Young of their own,
And I think of the years........... And the love that I've known.

I'm now an old woman.......................... And nature is cruel;
Tis jest to make old age .............................. Look like a fool.
The body, it crumbles,...................... Grace and vigor depart,
There is now a stone..................... Where I once had a heart.

But inside this old carcass................. A young girl still dwells,
And now and again,....................... My battered heart swells.
I remember the joys,........................... I remember the pain,
And I'm loving and living................................ Life over again.

I think of the years..................... All too few, gone too fast,
And accept the stark fact......................That nothing can last.
So open your eyes, people,.............................Open and see,
Not a crabby old woman;...........Look closer......see,.....ME!!

Moodle: CAS and Cookies!

I am using CAS authentication in one of my Moodle set ups. Sungard Luminis is being used as the CAS server. We have a 3 hour cookie time out for inactivity because of some long quizes and DSPS students. What was happening was that one student could log in, quit and another student could pick up there session and start work as the original student.

Two settings in Moodle had to be set in order to prevent this from happening:

Under Site Administration, Authentication, CAS

Set Logout CAS</em> to yes</strong>

Under Site Administration, Security,  HTTP security,

Click Only http cookies</em>