async, await and Promises 

JavaScript adding Promises greatly improved the use of callbacks, because callbacks can now be defined after calling the function instead of before. This allows the code to be cause then effect, rather than reversed as with callback functions.

await and async are boilerplate saving language constructs.

An async function always returns a Promise, but the function is written as if it returns the Promise resolve value. It also enables the use of await inside the function.

Putting await in front of calling a function that returns a Promise automatically waits for the Promise to resolve, and provides the resolving value.

These future language features can be used in current environments, such as NodeJS or web browsers, through the use of a transpiler, such as Babel.
[ add comment ] ( 58 views ) permalink
Barycentric coordinates 

If working with points on a 2d triangle, or a line (defined by two points) on the plane defined by a triangle, then barycentric coordinates are an excellent method of representing the points. In particular, it allows you to find the point where the line crosses the edge of the triangle in a very simple way.

Guide I'm using re: barycentric coordinates: BlackPawn: Points in triangle

[ add comment ] ( 71 views ) permalink
Symvol Community Edition Released 

Symvol Community Edition has been released.
[ add comment ] ( 54 views ) permalink
MFC Tooltips 

Today I worked on adding custom tooltips for a CSliderCtrl. The CSliderCtrl was an alternative interface to using a drop-down combo box, and the tooltips had to show what option was currently associated. Attempting to do this from the parent window via WM_NOTIFY didn't work, but the following example did:

[ add comment ] ( 70 views ) permalink
Sending email through Task Scheduler 

The Task Scheduler action "Send an e-mail" needs to be able to authenticate before sending.
To do this, I enabled the SMTP Feature in Windows, went into the firewall, disabled all the external access rules (just to be on the safe side), and allowed to relay.
The Send Email action I set to use localhost for the SMTP server. The "From" setting is not used in the authentication process, rather the user account the Task is acting as.

The error messages I got through this process are:
Error Value: 2147746319 - Relay not permitted
Error Value: 2147746321 - Account not authenticating
[ add comment ] ( 39 views ) permalink

| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Next> Last>>