Cover photo
Tim McDonald
Works at Electro Magnetic Applications
Attended Columbia University
Lives in Golden, CO
62 followers|9,230 views


Tim McDonald

Shared publicly  - 
Add a comment...

Tim McDonald

Shared publicly  - 
Here are a couple little functions I find handy when I'm moving data back and forth between Python and Excel via the clipboard. The code for writing to the clipboard is portable but the code for reading from the clipboard is specific to Windows.

import os
import win32clipboard

def toclip(obj):
    os.system('echo ' + str(obj).strip() + '| clip')

def fromclip():
    c = win32clipboard.GetClipboardData()
    return c
Add a comment...

Tim McDonald

Shared publicly  - 
"Please use the comments to demonstrate your own ignorance, unfamiliarity with empirical data, ability to repeat discredited memes, and lack of respect for scientific knowledge. Also, be sure to create straw men and argue against things I have neither said nor even implied. Any irrelevancies you can mention will also be appreciated. Lastly, kindly forgo all civility in your discourse . . . you are, after all, anonymous." -
Add a comment...

Tim McDonald

Shared publicly  - 
Quick crash course in #Qt  C++ API:
• signals and slots: think M:N callback mechanism (and don't write the parameter names in the connect call, just the type)
• if you need signals or slots, you derive from QObject; otherwise, you don't have to
• Qt classes that don't derive from QObject (like QString, QList, QNetworkProxy) should be used like you'd use int -- new QString("Hello") =~= new int(42) (implicitly shared, atomic copy-on-write)
• QString contains human text, not arbitrary binary data (that's QByteArray); to get data into it, you must know the encoding of what you're giving
• QString and QByteArray automatically null-terminate
• signals are named after verbs in the past and usually indicate a state change
• slots are named after verbs in the imperative and indicate an action to be taken
• properties are named after nouns or adjectives; the setter has "set" prefixed, the getter has no prefix (except for booleans, which sometimes get "is" prefixed)
• events are not signals, usually denoting an external factor (e.g. key or mouse press)
• anything visible derives from QWidget or QWindow and must only be used from the GUI thread
• widgets are positioned using layouts inside the parent widget
• Model-View classes are complex; read more in a book
• QObject (thus QWidget) deletes all its children on destruction
• QThread manages a thread, it's not the thread
• all I/O functions (besides QFile) are non-blocking and operate in the event loop, except those whose name starts with "waitFor"
• QSocketNotifier works with any file descriptor on Unix, but only real sockets on Windows; if you need to wait for something on Windows, use QWinEventNotifier (Qt 5) or a thread
• moc expands Q_OBJECT; if you add or remove a Q_OBJECT, you may need to tell your buildsystem about it
• uic parses .ui and creates a .h, but it's entirely optional: you can write the UI by hand
Add a comment...
Have him in circles
62 people
Patrick Hofmann's profile photo
Jeff Swetnam's profile photo
Sean Polvino's profile photo
Physicist, EM Effects Scientist
  • Electro Magnetic Applications
    Physicist, 2007 - present
  • National Renewable Energy Lab
    Research Assistant, 2004 - 2007
  • National Institute of Standards and Technology
    Postdoc, 2007 - 2007
Map of the places this user has livedMap of the places this user has livedMap of the places this user has lived
Golden, CO
Hollis, OK - New York, NY - Golden, CO
EM Effects Scientist, Physicist
Dr. McDonald is an experienced scientist with success in nanoscience and solar cell R&D, publication in high-impact journals such as Nano Letters and Physical Review Letters, performing mission-critical simulations for NASA/DoD major prime contractors, and writing scientific proposals.

If you are interested in partnering to commercialize high-risk technologies or are in need of nanomaterial processing or EM effects consulting, contact at Electro Magnetic Applications,
  • Columbia University
    Applied Physics, 2002 - 2007
Basic Information
Best Mexican in Lakewood. The open air breeze feels good on a nice day.
Food: ExcellentDecor: Very goodService: Very good
Public - 9 months ago
reviewed 9 months ago
3 reviews