BCIT

Ed Casas

Cisco Jabber Wakes as Zombie

August 3, 2016 by Ed Casas Leave a Comment

I recently started using Cisco Jabber (version 11.5.1) as a VoIP client at BCIT.  It’s very convenient to be able to control my phone and take calls when I’m away from the office.

Unfortunately, when my PC starts up after sleeping overnight, the error logs indicate that Cisco Jabber seems to be unable to resolve the BCIT VoIP server addresses even though they all resolve fine manually.  I’m guessing something (an encrypted connection?) expired while the PC was sleeping and the software is unable to detect this and recover.  This is particularly annoying because it’s impossible to exit the program when it’s in this state (presumably it’s hung up trying to sign out).  I have to terminate the CiscoJabber process using task manager.

My work-around was to use Windows Task Scheduler to set up two tasks.  The first task runs when the PC is put into sleep mode or hibernates and kills Cisco Jabber.  This has to complete within the two seconds before the PC goes to sleep; luckily Cisco Jabber terminates quickly.  The second task restarts Cisco Jabber when the PC comes out of sleep mode.

The first runs the command:

C:\Windows\System32\taskkill.exe

with options

/f /t /im Cisco*

when the Windows System log receives ID 42 (“The system is entering sleep.“) from Source: Kernel-Power.

The second task runs the command:

"C:\Program Files (x86)\Cisco Systems\Cisco Jabber\CiscoJabber.exe"

when the Windows System log receives ID 1 (“The system has resumed from sleep.“) from Source: Power-Troubleshooter.  I had to add a 30 second delay before starting the Jabber client to work around Task Scheduler detecting a duplicate task.

Since the program doesn’t seem to have any command-line options, I also added the line:

  <userConfig name="HonourLastWindowState" value="TRUE"/>

to:

c:/Program Files (x86)/Cisco Systems/Cisco Jabber/jabber-config-defaults.xml

so that the program comes up in the previous window state (typically minimized).

I still haven’t figured out how to get Outlook to set the “Do not disturb” status during scheduled events in my calendar so they aren’t interrupted by phone calls routed to this VoIP client.

 

Filed Under: Uncategorized

How I Post Marks

May 31, 2014 by Ed Casas Leave a Comment

Introduction

Instructors usually post a list of student numbers and corresponding marks on their office door.   This year I used a method that makes it possible to post the marks on a public internet site without revealing either the student numbers or marks.

Method

I did this by creating an HTML page containing encrypted text and some javascript.  Each student’s mark is encrypted using a different password.  These passwords are handed out in class or distributed by e-mail before the end of the term.

The HTML file has a form for the student to enter their student ID and password.  When the “Show Marks” button is pushed, the script  goes through the embedded array of encrypted text strings trying to decrypt each one in turn.  It displays the cleartext of the first string that can be successfully decrypted using the ID and password entered into the HTML form.

The text strings are encrypted with AES-256 using the openssl command:

openssl enc -aes-256-cbc -in filename -pass pass:pw -e -base64

where pw is the passphrase created by concatenating the student ID and password and filename is the file with the text to be encrypted.  The encrypted output is retrieved from the program’s output by a script (see below).

Below is the HTML file with most of the AES-256 library code and most of the marks removed to make the listing shorter.  It consists of two scripts and an HTML form.  The first script contains the AES functions from the crypto-js libraries.  The second script contains an array with the encrypted marks and the showmarks() function that runs when the “Show Marks” button is pressed.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Marks Retrieval</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />

<script>
/*
CryptoJS v3.1.2
code.google.com/p/crypto-js
(c) 2009-2013 by Jeff Mott. All rights reserved.
code.google.com/p/crypto-js/wiki/License
*/
var CryptoJS=CryptoJS|...
</script>

<script>

  // display AES-256-encrypted marks

  // each string in marks[] is encrypted using a different key formed by 
  // concatenating the student ID and password

  // shows the first string successfully decoded or an error message

  // Ed.Casas 2014.5.20

  var marks = [
   "U2FsdGVkX1+1n6THnLZjnd+fww+qxOpE++J5oqdByEyYXXsqHv6/Qm99wqZ+Xeph8+aFrA/r+zkvYGYMzemcCF5snTJ41ArJR7x5JFWHu2hIl60YD/zHEwyAMEbEVLIwxBtm8tARBu/C32B/CiOzx0BlM6q2F5w+Cbk78y5+0HUptNsgIc8CTyRFlaNmssJypj39VXYUHyTNL34mG8FvhC3L6yu+hp45F/XZkwMK/VjUmn7iwLqFsYuJtp0x8VkhlJPLBMGHe9Is+1E1D/3BHP4C4n7iOjHjntS9YxFhrcZNd80KzvylOdfNLLQ6+Zg1VhBY3rkA2xi4u4Yd9puhMoVBK4Q887GPNBgdvTntl8nl5Yf/o4OKHMhRqDftbu7aGIqbUSsOyo4/uxF5KUQf/Ja7gT3COK2nUqrMZD6UZM6VOhA6pbXZZqrsYotDI3HjpKdRizrAUt/Sp4NC12tfTBUYQxC1fcYPxNZhbjNlXQEi9oHpJTFDP+93LtqMeu5GPpV8dAWMY06GEE3sbwp6sLcbiVix4hPbNiJNGax0psGXL9hfTeCJqBFL0slUKy+ZkyAXGi9q9pKgdZ0RJnBYHg6OWStCDjBXBJLo/J1gYdyJOiZ+l2cAYA2hcsQ3H4sCeBzDtGM2r0eppA9Gkq6BG3rbzhvmgJROQ/6n2rtimnlM0Or3EELiKUbt6oM+vweyUlVr3BUm7yAvup1HwtbkkztSqoeB2OqnFvSBABOP8EHsxuF9lSJItAkibNDCMWXyxBXVR4KpkW+80j2wpjzJ04/J9swLgogpUsfR9l1BhPW1Uzs5Vr33oD5VhzYZsGfYXp+IqG8L3Rd9D7JeiqHzeSSa/x+T7aN876KARb8HnbtEXVbN/eJutmvvnxIbWiHrxYQa5nGkB6mJ2ItYTIGCvt4TIa0DJjTB5kAdb/cHxosFelV75yU61pBjC04r/uhFHRnQs8Bft/2NKhqNvp6rcf7LCkgtW6Psfv8NHnosm9fZgxq6Uiji7YCUq0By6lmDmhKT8yduvbJT2rbnRhm5irfcbLMgge6XJyuhy4Y15Q2pj0fPpnQm2zTU4VuDvzjsOr5bx09vQvjiVQYiJfnXyc31jx+yzmlLg1etUxGV1+9tTSjDCYdAmduvXF0PLh7Q"
  ] ;

  function showmarks() {

    var form = document.getElementById( "form" ) ;

    var key = form.elements[ "id" ].value + 
              form.elements[ "pw" ].value ;

    for ( var i in marks ) {

      try {
         var decrypted = CryptoJS.AES.decrypt( marks[i], key ) ;
         var s = decrypted.toString(CryptoJS.enc.Utf8) ;
         break ;
      } catch (e) {
         continue ;
      }

    }

    document.getElementById( "marks" ).innerHTML = 
       s || "Marks not found.  Check ID and password." ;

  }

</script>

</head>

<body onload="document.getElementById('warning').innerHTML=''">
<h2>Show Marks</h2>
<span id="warning" style="color:red">Warning: Your marks are displayed by a script but Javascript may not be enabled.</span>
<form id="form">
BCIT ID (starting with A): <input type="text" id="id"><br>
mark retrieval password: <input type="password" id="pw"><br>
<input type="button" value="Show Marks" onclick="showmarks()">
</form>
<hr>
<pre id="marks"></pre>
</body>

Where does the text come from?  In this case it comes from a spreadsheet used to calculate the marks.  The spreadsheet is exported in CSV format and an AWK script is used to add some formatting and encrypt each line using an ID and password found in specific columns of the spreadsheet.  This is done using the system and getline awk functions.

The AWK script also automates the process so that only one command needs to be entered to create the new HTML file each time the spreadsheet is updated.

Example

Below is a screen capture of the interface and output when accessed via the D2L LMS for one of my courses.  Each row of the output corresponds to the contents of one spreadsheet column for this (fictional) student:

marks

Alternatives

Why didn’t I just use the D2L grading system which makes the marks available to the students in secure fashion?  I found the D2L system was not flexible enough and much more cumbersome to use than a spreadsheet.

Why not distribute the marks using D2L or by e-mail?  As far as I know, D2L provides no (simple) mechanism to distribute confidential material to students in an automated fashion.

Other Applications

The advantages of this technique are:

  • almost any browser can be used to decrypt and retrieve the information, and
  • the information can be distributed using a public web site or a mailing list without compromising the privacy of the data.

Therefore this technique may also be useful  when it’s necessary to distribute confidential information to people who may not have specific decryption software (e.g. due to legal restrictions).

Filed Under: Uncategorized

Software for Lecturing with Tablet PCs

January 26, 2014 by Ed Casas 1 Comment

Introduction

For the past year I’ve been using a tablet PC and a video projector in my classes. I use them to present lecture notes and to work out solutions to exercises in the same way that I used to use an overhead projector.

use-of-projector-in-class

As you can tell from the diagram above, I am no artist.  But the tablet lets me write text, equations, diagrams and graphs.  Compared to an overhead projector the tablet never runs out of transparencies or pens, it’s easy to put the notes on-line and I don’t end up with a binder full of useless transparencies at the end of the term.

I’ve found it easier to write with a stylus on a tablet PC than to use a separate graphics tablet and both are much easier to use than a mouse.

I’ve tried many drawing programs to try to find ones that work well for this application.  This post summarizes my findings.

Requirements

The most important requirement is that the software must be written to input from a graphics tablet driver in order to accurately capture pen strokes. Most drawing programs are designed to use a mouse.  But mouse drivers cannot deliver the resolution required to accurately reproduce pen strokes.

Secondly, the user interface must work efficiently using only a stylus. Interfaces that require a keyboard or mouse are awkward to use while giving a lecture.

This means that most drawing functions must be available without having to switch out of “ink capture” mode. Examples of these features, not all of which are available in any single program, include:

  • shape recognition that recognizes and inserts a geometric shape (line,  circle, polygon, arrow) when an approximate shape is drawn,
  • a stroke eraser that uses the dedicated eraser tip or a scratch-out gesture,
  • a stylus button that starts lasso selection of pen strokes and switches to drag/scale/rotate mode when the selection is done,
  • a visible grid or `snap’ feature to line up objects, and
  • gesture controls using the pen button for commands such as  zooming, undo, cut/paste, etc.

Finally, one non-requirement.  Although you can also use the tablet PC input panel to enter text into any  program, I haven’t found text or math recognition features particularly useful because the delays caused by the occasional recognition error seem to outweigh any improvements in the look of the results. You may have different preferences.

Programs Evaluated

Useful Tablet-Oriented Drawing Software

The programs I’ve found that meet these requirements are:

  • Windows Journal
  • Corel Grafigo
  • Microsoft OneNote
  • Xournal

Their features are compared in more detail below along with examples of the same diagram drawn with each program.

Windows Journal

This is a basic program included with Windows for Tablet PCs.  It has excellent pen stroke input.  It has basic shape conversion and ink to text conversion features. The shape conversion feature was used to generate the circles in the diagram below.

QPSK-WindowsJournal

Corel Grafigo

Corel Grafigo is a program that was freely distributed by Corel around 2002. It is now available via the Internet archive.  It must be run in Windows XP compatibility mode. The only additional feature compared to Windows Journal is rudimentary shape recognition which produces the round circles and straight lines in the diagram below.

QPSK-Grafigo1

Microsoft OneNote 2013

OneNote has many tablet-oriented features including a shape palette, snap to grid and conversion from ink to text and from ink to math.  OneNote 2013 has a bug that prevents you from using the eraser pen unless in automatic switching mode but in this mode you cannot use the pen to select text.  The diagram below was prepared using the circle, square and arrow-terminated line shapes.

QPSK-OneNote-ink

The next diagram below shows the improvement in quality from applying the ink-to-text and ink-to-math conversions. Unfortunately, it took several minutes to correct the conversion errors in this example.

QPSK-OneNote

Xournal

Xournal is an open-source program similar to Windows Journal.  Xournal has shape recognition but no snap mode.

A mis-feature of Windows 7 pen input causes the input driver to switch to mouse input mode after a short pen tap.  This results in a loss of input resolution.  The Fix my Pen script configures Windows 7 pen input to avoid these problems. The Linux version does not have this bug.

QPSK-Xournal

Other Tablet-Oriented Drawing Software

Other tablet-oriented drawing applications evaluated include:

  • Corel Grafigo 2 has more features than the original version of Grafigo described above but the program has not been updated since 2003 and the evaluation period expired before I could get it to work reliably under Windows 7.
  • Ink Seine and Stylus Labs Write are simple programs designed for handwriting capture from tablets but offer no compelling advantages compared to Windows Journal for this application.
  • Skitch is a very simple application with a minimal feature set.

General-Purpose Drawing Software

Many other general-purpose drawing programs were also tested. These programs are designed for use with a mouse and do not capture pen strokes accurately enough to capture handwriting.  These programs include:

  • Visio 2013 has an ink capture mode that seems to use mouse input and then draws smoothed text. I found no advantages compared to the other programs.
  • Inkscape has a promising calligraphy mode that unfortunately does not  generate dots required for periods and dotting letters like ‘i’ and ‘j’.
  • Xara Photo and Graphic Designer 9 did not detect stylus pen-down.
  • LibreOffice Draw/Impress has a freehand drawing mode that cannot be used for writing since the mode terminates on single click (a dot).
  • CreativeDocs.Net has a freehand tool whose finest smoothing is too coarse to accurately capture handwriting.
  • SmartDraw: a drawing program oriented to creating diagrams.
  • DrawPlus: a malware vector with an awkward user interfaces when used with a tablet.

Painting Software

A few painting programs such as Autodesk Sketchbook Pro, Krita and Gimp were also tried.  They don’t work well for this application because their bit-map drawings are not easily edited.

PDF Viewer Software

The Foxit Reader and PDF-XChange PDF viewers have good annotation features and are smaller and faster than Bluebeam Vu although the annotation features do not capture handwriting well enough to replace a drawing program.  The Nitro PDF Reader does not have freehand annotation.

Conclusion

Xournal is the best solution I’ve found so far.  It combines the high-quality pen stroke capture of Windows Journal, the shape recognition features of Grafigo and an efficient user interface.  OneNote would be a second choice although I find its user interface slower than that of Xournal.  OneNote is also the only one of the four acceptable programs that is not free.

Tips

Some suggestions for working with these programs:

  • work at several times the final scale (e.g. 400%) to make drawing and lettering look smoother and more accurate
  • use cut, paste, and resize to draw repetitive or similarly-shaped elements
  • use a grid page style to help line up drawing elements

Other Options

Capacitive Tablets

Tablet PCs use a Wacom ‘Penabled’ digitizer display and stylus (or more recently, a Synaptics solution).  These have higher resolution than the capacitive touch sensors found in most Android and Apple tablets.  Touch-controlled capacitive-sensor tablets work well for presenting prepared material but are not as convenient for writing.

Web-Based Applications

There are web browser plugins (e.g from Wacom) that provide digitizer pen stroke input for browser applications.  I have not investigated web-based drawing software  because I can’t be sure that I will have a network connection during lectures.

Filed Under: Uncategorized

Parts Kits (3rd Term, Telecom Option)

November 6, 2013 by Ed Casas Leave a Comment

For the fall term of 2013, these are the parts that BCIT 3rd-term Telecommunications students are expected to have to do their electronics labs.

There are 3 parts kits lists in the Parts Kits PDF file , one for each of the first three terms.

Filed Under: Uncategorized

Lab Marking Policy

October 25, 2013 by Ed Casas Leave a Comment

Purpose

  • The lab marking policy should encourage students to be:
    • safe,
    • careful,
    • efficient, and
    • independent

    when working in the lab.

  • The marking scheme should encourage students to seek help when necessary.
  • Students should not be penalized for factors beyond their control.

Marking Scheme

  • Ten percent (10%) will be deducted from the lab mark for each student-initiated request for assistance that that the instructor decides meets one of the criteria described below.
  • To encourage timely completion of lab work, a student may request assistance three (3) times per lab session without penalty.
  • Marks will not be deducted if the instructor volunteers the assistance.

Deductions

Marks will be deducted for errors due to carelessness such as:

  • misreading documentation (lab procedures, specifications, data sheets, …) resulting in:
    • skipping steps,
    • incorrect component orientation, pin numbers, supply voltage, logic levels, …,
  • selecting incorrect components or component values,
  • wiring errors,
  • incorrect use of test equipment (x10 probe correction, trigger source or level, voltage or sweep rate, AC coupling, H/V position, …), or
  • calculation errors.

Marks will be deducted if a student asks the instructor for help before isolating the cause of a problem.  The student should first check all of the following, preferably with an oscilloscope:

  1. Power supply and ground voltages at IC terminals.
  2. Clock or oscillator input frequency and level.
  3. Input and output signals of each accessible stage in order from input to output.

In each case the student should have compared the measured and expected values.

Exceptions

Marks will not be deducted if the problem is caused by:

Cause of Problem Action Taken
missing, ambiguous or incorrect documentation documentation will be supplied, corrected or replaced
faulty lab equipment equipment will be removed from service
faulty component component will be discarded

 

Filed Under: Uncategorized

Matlab Programming Links

October 24, 2013 by Ed Casas Leave a Comment

  • Vectorization (from Mathworks)
  • Techniques for Improving Performance
  • Freemat (a free Matlab-like program)
  • Octave (another free Matlab-like program)

Filed Under: Uncategorized

Using LTspice to Simulate ELEX 3530 Circuits

October 21, 2013 by Ed Casas Leave a Comment

Modern engineering practice is to simulate circuits before building them.  Simulation allows you to work more efficiently because you can build and test simulation models more quickly than actual circuits.  Simulations allow you to quickly test your circuit under many conditions (different input signals, supply voltages, bias levels, temperature, component tolerances, etc).

Simulation is particularly important for integrated circuits because the NRE (non-recurring engineering) costs for an IC are very high and it can take several months to redesign a part to correct an error.

Simulations can’t duplicate every detail of the behavior of the physical circuit so whenever practical the design should be tested by building a prototype.

Many of the circuits you will build in the ELEX 3530 lab are simple enough and operate at low-enough frequencies that you can use a widely-used analog circuit simulator called SPICE (Simulation Program with Integrated Circuit Emphasis).

Linear Technology makes a version of SPICE called LTspice that you can download for free. This software includes models for many of Linear Technology’s ICs but it can also be used to simulate circuits that use other parts.  Other IC manufacturers often make simulation models available for their components.

Instruction in analog circuit simulation and the use of LTspice is beyond the scope of this note.  A tutorial presentation on LTspice should help you get started.  For the  circuits given below, you load the file, right-click to change parameter values if desired, run the simulation and then left-click on the schematic to select the node(s) to examine.

The files below contain LTspice models for some (actually, one) of the ELEX 3530 lab circuits.  You can use these to simulate the circuits before you build them in the lab. Working through the lab with the simulated circuit eliminates some potential issues and can help you better understand the behavior of the circuit.

Differences between the simulated and measured signals can help you identify the cause of any problems.  However, remember that differences may also be due to limitations of the simulator or the models rather than to a problem with your circuit.

The accuracy of the simulation results will depend on how accurately you specify the components.  For example, the resonant frequency will vary from the simulated values due to component tolerances.  Q’s will typically be lower than in the simulation because of losses in real components.  You can measure the model parameters (up to 4 for capacitors and inductors) of the actual components you are using and enter them in your simulation if you want to get a better match to your measurements.

Lab 5 – Class C Amplifier

You can use small-signal analysis to find the resonant frequency of the output tank circuit.

However, you have to use transient analysis for Class C operation because the transistor is operating outside its linear operating range.  In this case a simulation duration of a few milliseconds is required to make sure the circuit has reached steady-state.

Lab 6 – Quartz Crystal Characteristics

A crystal can be modeled as a capacitor. The series-resonant frequency is determined by the model’s series inductance and capacitance.

The manufacturer will also specify the maximum equivalent series resistance, parallel capacitance and parallel resistance.  These values can be used to predict “worst-case” performance.  However, since these are maximum values you cannot use them to predict the behavior of the specific component you will measure in the lab.

You can get specifications from manufacturer’s data sheets, for example CTS MP Series Quartz Crystal or ECS HC-49UX Quartz Crystal. Manufacturer’s web sites often have useful application notes such as this one on Quartz Crystal Design Parameters.

A simulation for Lab 6 could use a crystal (capacitor) model with values equal to half of the maximum specifications for series resistance (25Ω, 3.5pF and 250 MΩ) for the CTS  5 MHz crystal. The inductance and capacitance can be computed by assuming a Q (e.g. 100,000).

Lab 7 – LC and Crystal Oscillators

You can use a .step simulation directive to simulate the effect of changing the potentiometer to vary the amount of feedback:

Lab7a

The schematic is available in Lab7a.zip.

Filed Under: Uncategorized

Recent Posts

  • Cisco Jabber Wakes as Zombie
  • How I Post Marks
  • Software for Lecturing with Tablet PCs
  • Parts Kits (3rd Term, Telecom Option)
  • Lab Marking Policy

Recent Comments

  • Bob Gill on Software for Lecturing with Tablet PCs

Copyright © 2025 · BCIT · BCIT Commons