2018/10/16

1. The Key to Becoming a Software Consultant

https://daedtech.com/key-becoming-software-consultant/

But, to achieve your objective, you need to position yourself as an actual consultant, getting paid for advice.

He talks about four phases of solving problems for companies.  Those include diagnosis, prescribing a cure, application of the cure, and re-application of the cure.  Software developers and most so-called software consultants involve themselves almost exclusively in phase three: application.  But that’s a pretty low leverage place to be. Consultants exist almost exclusively in phases one and two: diagnosing and prescribing.  They let laborers take care of phase three and even lower status laborers take care of phase four.

2. How Lisp Became God’s Own Programming Language

https://twobithistory.org/2018/10/14/lisp.html

But people learn Lisp instead because they know that, for twenty years or so, the Lisp point of view was thought to be so useful that MIT taught Lisp to undergraduates before anything else.

What happened instead is that more and more Lisp-y features have been incorporated into everyone’s favorite programming languages.

Do not buy a Huawei phone

Source: https://threader.app/thread/1051204370543648770

THREAD: I’m looking at a Huawei P20 from China, let see what can I found

The 1st app I reversed is an app called Decision

Look at the name of the files contains in the assets folder:
– airport_china.txt
– city_china.txt
– cityinfo.db
– parkinglot_china.txt
– railwayinfo.db
– trainInfo.db
– trainstation.db

Interesting, no?

Continue reading “Do not buy a Huawei phone”

Why Nobody Understands Blockchain

Source: https://patrickmn.com/security/why-blockchain-is-so-hard-to-understand/

One of the biggest problem with blockchain (“crypto”) seems to be that nobody really understands it. We’ve all heard the explanation that you have blocks, and transactions go into blocks, and they’re signed with signatures, and then somebody mines it and then somehow there’s a new kind of money…? My friend says so, anyway.

Continue reading “Why Nobody Understands Blockchain”

Calculating longitude length in miles?

https://gis.stackexchange.com/questions/142326/calculating-longitude-length-in-miles

It doesn’t matter at what longitude you are. What matters is what latitude you are.

Length of 1 degree of Longitude = cosine (latitude in decimal degrees) * length of degree (miles) at equator.

Convert your latitude into decimal degrees ~ 37.26383

Convert your decimal degrees into radians ~ 0.79863

1 degree of Longitude = ~0.79863 * 69.172 = ~ 55.2428 miles

More useful information from the about.com website:

Degrees of latitude are parallel so the distance between each degree remains almost constant but since degrees of longitude are farthest apart at the equator and converge at the poles, their distance varies greatly.

Each degree of latitude is approximately 69 miles (111 kilometers) apart. The range varies (due to the earth’s slightly ellipsoid shape) from 68.703 miles (110.567 km) at the equator to 69.407 (111.699 km) at the poles. This is convenient because each minute (1/60th of a degree) is approximately one [nautical] mile.

A degree of longitude is widest at the equator at 69.172 miles (111.321) and gradually shrinks to zero at the poles. At 40° north or south the distance between a degree of longitude is 53 miles (85 km)

Note that the original site (about.com) erroneously omitted the “nautical” qualifier.

Left join and Left outer join in SQL Server

http://stackoverflow.com/questions/406294/left-join-and-left-outer-join-in-sql-server

As per the documentation: FROM (Transact-SQL):

<join_type> ::=
    [ { INNER | { { LEFT | RIGHT | FULL } [ OUTER ] } } [ <join_hint> ] ]
    JOIN

The keyword OUTER is marked as optional (enclosed in square brackets), and what this means in this case is that whether you specify it or not makes no difference. Note that while the other elements of the join clause is also marked as optional, leaving them out will of course make a difference.For instance, the entire type-part of the JOIN clause is optional, in which case the default is INNER if you just specify JOIN. In other words, this is legal:

SELECT *
FROM A JOIN B ON A.X = B.Y

Here’s a list of equivalent syntaxes:

A LEFT JOIN B            A LEFT OUTER JOIN B
A RIGHT JOIN B           A RIGHT OUTER JOIN B
A FULL JOIN B            A FULL OUTER JOIN B
A INNER JOIN B           A JOIN B

Also take a look at the answer I left on this other SO question: SQL left join vs multiple tables on FROM line?.enter image description here

What is the difference between UNION and UNION ALL.

http://stackoverflow.com/questions/49925/what-is-the-difference-between-union-and-union-all

UNION removes duplicate records (where all columns in the results are the same), UNION ALL does not.

There is a performance hit when using UNION vs UNION ALL, since the database server must do additional work to remove the duplicate rows, but usually you do not want the duplicates (especially when developing reports).

UNION Example:

SELECT 'foo' AS bar UNION SELECT 'foo' AS bar

Result:

+-----+
| bar |
+-----+
| foo |
+-----+
1 row in set (0.00 sec)

UNION ALL example:

SELECT 'foo' AS bar UNION ALL SELECT 'foo' AS bar

Result:

+-----+
| bar |
+-----+
| foo |
| foo |
+-----+
2 rows in set (0.00 sec)

Send SMTP email using System.Net.Mail via Exchange Online (Office 365)

http://stackoverflow.com/questions/6244694/send-smtp-email-using-system-net-mail-via-exchange-online-office-365

MailMessage msg = new MailMessage();
msg.To.Add(new MailAddress("[email protected]", "SomeOne"));
msg.From = new MailAddress("[email protected]", "You");
msg.Subject = "This is a Test Mail";
msg.Body = "This is a test message using Exchange OnLine";
msg.IsBodyHtml = true;

SmtpClient client = new SmtpClient();
client.UseDefaultCredentials = false;
client.Credentials = new System.Net.NetworkCredential(“your user name”, “your password”);
client.Port = 587; // You can use Port 25 if 587 is blocked (mine is!)
client.Host = “smtp.office365.com”;
client.DeliveryMethod = SmtpDeliveryMethod.Network;
client.EnableSsl = true;
try
{
client.Send(msg);
lblText.Text = “Message Sent Succesfully”;
}
catch (Exception ex)
{
lblText.Text = ex.ToString();
}

What’s the difference between unicode and utf8?

http://stackoverflow.com/questions/3951722/whats-the-difference-between-unicode-and-utf8

This is an unfortunate misnaming perpetrated by Windows.

Because Windows uses UTF-16LE encoding internally as the memory storage format for Unicode strings, it considers this to be the natural encoding of Unicode text. In the Windows world, there are ANSI strings (the system codepage on the current machine, subject to total unportability) and there are Unicode strings (stored internally as UTF-16LE).

This was all devised in the early days of Unicode, before we realised that UCS-2 wasn’t enough, and before UTF-8 was invented. This is why Windows’s support for UTF-8 is all-round poor.

This misguided naming scheme became part of the user interface. A text editor that uses Windows’s encoding support to provide a range of encodings will automatically and inappropriately describe UTF-16LE as “Unicode”, and UTF-16BE, if provided, as “Unicode big-endian”.

(Other editors that do encodings themselves, like Notepad++, don’t have this problem.)

If it makes you feel any better about it, ‘ANSI’ strings aren’t based on any ANSI standard, either.

Call vs Start

http://stackoverflow.com/questions/13257571/call-command-vs-start-with-wait-option

For exe files, I suppose the differences are nearly unimportant.
But to start an exe you don’t even need CALL.

When starting another batch it’s a big difference,
as CALL will start it in the same window and the called batch has access to the same variable context.
So it can also change variables which affects the caller.

START will create a new cmd.exe for the called batch and without /b it will open a new window.
As it’s a new context, variables can’t be shared.

Addendum:
Using CALL can change the parameters (for batch and exe files), but only when they contain carets or percent signs.

call myProg param1 param^^2 "param^3" %%path%%

Will be expanded to (from within an batch file)

myProg param1 param2 param^^3