Text

The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

Monday, August 12, 2019

How to resolve linker error LNK2005

The C runtime libraries define the DllMain function used in all DLL components.  But MFC enabled DLL component projects also have an MFC specific version of this function that gets bound in by default.  So what happens when a project binds with both the DLL versions of the C runtime and the MFC libraries?  Since each of those has their own version of DllMain already defined, there can be a conflict.


LNK2005 _DllMain@12 already defined in MSVCRT.lib(dllmain.obj) mfcs100.lib(dllmodul.obj)

So how can this ever NOT be a problem?  Well, the C runtime DLL is smart enough to use trickerly to protect itself from there already being a DllMain defined at compile time.  This is good, as otherwise none of our "user" DLL components that define their own version of this function could ever bind with the C runtime.

This linker error can still be a problem though, because the MFC libraries do NOT protect themselves from the possibility that this function already exists.  They must think that anyone only ever wrote "pure" MFC components that would never include any other libraries or ever define such functions ourselves.

So to resolve this is a matter of making sure that the MFC libraries are bound first.  How can we do this?


  1. Remove the conflicting libraries from being included by searching the linker search paths in the default manner.
  2. Add the libraries explicitly in a specific order.
In the case of the specific error above, this resolution ends up looking like this:



The two libraries are ignored from among the "default" libraries.  Then they are added as "additional" dependencies instead.  Note that the MFC library is placed first in the Additional Dependencies, followed by the C runtime.  This must be done separately for release mode and debug mode configurations as the libraries are named slightly differently for each mode.

Saturday, August 10, 2019

Deep Learning Professional Certificate Program (edX)


Formal education makes a living, but self-education makes a fortune,” - Jim Rohn

Professional Certificate in Deep Learning

https://www.edx.org/professional-certificate/ibm-deep-learning

Due to the heavy use of Data Science when working on Deep Learning, I've decided take an entirely different certification course first...
    ·         oDeep Learning Fundamentals with Keras
o   Prerequisites:
§  Python Programming.
·        See prerequisites of next section for more Python related courses
·         https://www.edx.org/course/python-basics-for-data-science-2 þ
§  Machine Learning with Python. 
§  Partial Derivatives. edX recommended Khan Academy.  I also traded a sushi dinner to my son for some tutoring, where I posted my notes here and here.
·         https://www.youtube.com/watch?v=AXqhWeUEtQU Introduction þ
·         https://www.youtube.com/watch?v=kdMep5GUOBw Formal definition þ
·         https://www.youtube.com/watch?v=dfvnCHqzK54 And Graphs þ

·         oDeep Learning with Python and PyTorch
o   Prerequisites.  Here I elect to use Pluralsight courses I deemed similar to the edX courses.
§  Python & Jupyter notebooks
·         Python
·         Jupyter notebook
§  Machine Learning concepts
§  Deep Learning concepts

·         oDeep Learning with Tensorflow  
o   Prerequisites:
§  Same prerequisites as previous course.

·        oUsing GPUs to Scale and Speed-up Deep Learning  
o   Prerequisites:
§  No prerequisites.

·         oApplied Deep Learning Capstone Project  
o   Prerequisites:
§  Completed all courses in the Deep Learning Professional Certification Program  o


Partial Derivatives


Although this applies to higher dimensions too, this example sticks with a three variable equation because it can be visualized in three dimensional space.  It will look like a sheet that is tilted and/or bent in various ways.

Example equation



Graphed at geogebra



Partial derivative

This is essentially picking a point along one of the planes to get the equation for the line that is formed out of the sheet right there with respect to the other two planes.

Process

Starting with the original equation graphed above 

Pick a point along the Y axis.  In the graph above, the “sheet” crosses the Y axis at position 0, so using that it gives us this equation for the line that forms where the sheet passes that axis.





This is the slope along the z and x axes, it can be helpful to express it as 2/1.  If the image is turned to view edgewise along the sheet with respect to the z and x axes, this slope becomes observable:






























Derivatives

A two variable equation can be graphed on a simple two dimensional grid.  It will often be some sort of curved line.  The derivative is an equation that gives the slope of that line at a given point.

Example Equation


Can also be expressed as

Derivative


How was it derived?

The following power rule is applied to each term:


The way I think of it is that the “t” in the power rule is the entire term, which is usually a constant, a variable, and an exponent.

First term

The first term of the example equation is


Which when thought of as the “t” in the power rule with constant, variable, and exponent looks like this:



Applying the power rule means taking the exponent as the value “n”.  In this case 4.  Multiplying it by the front of the term is (4 x 1) or 4.  Changing the exponent to n-1 is (4-1) or 3.  So the first term derives to:


Second Term

Looking at the second term of the example equation and what it derives into shows the 3 being multiplied by the 2 and the exponent decreasing to 2.

Third Term

The third term is similar and becomes 8x.  The exponent was reduced to 1 so it need not be displayed anymore.

Fourth Term

The fourth term sees the exponent reducing down to zero, and since anything to the zeroth power is one, the x to the zeroth power becomes 1 and doesn’t need to be displayed anymore.  It just multiplies by the 5 and becomes the value 5.

Fifth Term

The fifth term is just a constant so like all constants, it derives to zero, so is effectively just dropped.  Why?  Because to get it into the “t” form for the power rule, it becomes:


With the starting exponent of zero, that means “n” is zero, and since the whole thing is going to be multiplied by “n” on the front, the whole term solves to zero.

Wednesday, August 7, 2019

Intentional Error

Sometimes it is difficult to test error handling.  Exceptions in different layers of the coding.  If an exception happens you want it to be logged, displayed, or otherwise findable.  If the exception handling doesn't properly make the exception details findable by the support analyst, they will have a tough time positively diagnosing the cause.

Yet to test the exception handling in every layer, one might need to sabotage various things.  Remove a file.  Lock down the permissions.  Temporarily remove an assembly.

Depending on the environment the test is conducted on, the ability to sabotage elements on the server may be difficult or impractical.  Especially for a QA tester that may not have access to the box, or the training to "correctly sabotage" elements on it.

One approach is to pick one of the free form fields of a data record, and establish a series of testing values.  Something easy enough to remember, but not prone to be added to real records.  Like the key words "Intentional Error" followed by a six digit number.

Different sections of the code that process that record can check the field for the key words and a unique number related to that code section.  If the key words and number are detected, the code immediately throws a defined "IntentionalErrorException".  The testing scripts include the key words and numbers to use, where the exception is to be reported, and key elements that must be included for the error to be useful to support analysts.



Tuesday, June 25, 2019

Working From Home

Advantages


Custom tailored schedule. Eat, nap, take breaks, focus on work, when and how it works best for you. You'll probably need to "keep an eye on e-mail", have your phone handy, and "stay close" during "business hours", but otherwise you are more free to tailor your schedule to be when you are most productive.

All the comforts of home. Cook your lunch at home in your own kitchen, with all your supplies and cookware available. Forget to apply deodorant that morning? Weather change so you are now dressed too warmly? Everything you need to address any eventuality is right here.

Flexibility. Sunny day? Mow the lawn now, work later when it's dark or raining. No need to have dentist appointments only with that person on the far side of town who is open until midnight.

Control of work space. The room where you do your work. The number and type of computer screens. The type of desk, chair, decor, lighting. Items that help you take breaks or think deeply. It can all be according to your preferences to set the conditions that work best specifically for you to be productive. You won't be forced to work in an open floor plan just because your company CEO somehow decided that was best for everyone.

Disadvantages


Interruptions. While you might think co-workers talking around you might interrupt you more, there are actually more interruptions at home.

Even if you live alone: If the delivery guy arrives, you'll be tempted to go retrieve the package right away. If you notice your floor is getting dusty, you might think that's a good time to sweep it. If your plumbing malfunctions, you'll need to fix it yourself right away.

But of course even more if you live with others: You plan when you want to "work on work" and when you want to "be home from work", but physically you are at home. Your family members and roommates know this, so not only do you need the discipline to stick to your your own plan, but they do too. And you can only control yourself.

Lack of structure. Whatever structure you need, you have to expend effort to make it happen. When you work away at an office, those managing that office impose schedules and other work related things on you. You don't have to worry about figuring those out; they just happen. But even outside the office, you get a transitional period during the commute to get yourself awake and mentally prepared before beginning work. On the way home, you'll also have some time to wind down and transition to a better mental state for home without any special effort or discipline. It just happens as a side effect of your commute. It's a balancing act to artificially impose these types of structure enough to transition well without starting to degrade the "flexibility" advantage.

Communication. Although technology is always improving this area, the people at the office are focused on what is around them. If you are never there but as a voice on the phone, it's harder for people to connect with you. If you are in a highly collaborative or deliberative industry, you will need to be present there in person so everyone is able to think of you as a real person and not just that annoying voice on the phone that is always reminding everyone to grab a mic or repeat the question. You need to connect before you can be a strong voice in a conversation or be able to successfully argue a point in a discussion. People need to know you before they will take you seriously. At one job I was the only remote attendee that used a webcam. In the main conference room I appeared by default on an 8 foot screen behind the main presenter. Better to be a joke than to be invisible. Just remember to meet the dress code, from the waist up, so nobody there gets flexibility envy.

Neglect. You really need to aggressively stay on top of things and form relationships with many people at the office, or you will be out of touch with things going on there. So much is communicated by word of mouth by people in the office that you won't hear unless you are asking about what's been happening. If you do not do this, you'll eventually find that the reason your work software doesn't work anymore is because everyone in the office is two versions ahead of you.

See the special section for remote jobs in my Links post.

Links

Technical

Decomposing Systems into modules - https://prl.ccs.neu.edu/img/p-tr-1971.pdf
https://www.fixtrading.org

Data Science / Machine Learning

https://www.anaconda.com/download - Data Science distribution (Python, Jupyter Notebook, over a thousand more packages)
https://www.anaconda.com/pycharm - PyCharm for Anaconda.
https://www.numpy.org
https://notebooks.azure.com - Jupyter Notebook as a service.
flask.pocoo.org - Flask.  Web Framework.
https://pypi.python.org/pypi - Python Package Index
www.jrsoftware.org/isinfo.php - Inno Setup.  Free installer for windows programs.

Career

Key Values — https://www.keyvalues.com/
https://www.monster.com/career-advice/article/going-back-to-work
https://www.thebalancecareers.com/job-search-4161939

Resumes

https://www.resumehelp.com/
https://www.livecareer.com/
https://resumegenius.com/

Job Boards

Indeed — https://www.indeed.com
Career Builders — https://www.careerbuilder.com/
LinkedIn — https://www.linkedin.com
Monster — https://www.monster.com
Simply Hired — https://www.simplyhired.com
Dice — https://www.dice.com

Remote Jobs

https://www.indeed.com/q-Remote-Work-From-Home-jobs.html
https://www.glassdoor.com/blog/companies-that-let-you-work-remotely/
https://www.skipthedrive.com/
virtualvocations.com

Me


JeffBohn.com