Tuesday, October 9, 2018

12 Things Republicans and Democrats Agree On

Politics in America according to social media is nasty. We’re divided along party lines and there are a lot of angry people yelling at each other. You would think that there’s no way to bridge the divide, but all of us have friends who are on the other side. We may avoid certain conversations when we are with them, but somehow we get along. Why? If the other side is so bad, then how is it that our friends can’t see that? Could it be that the two sides agree on much more than they care to admit? Here are twelve things that Republicans and Democrats agree on.

  1. Mass murder is evil.
  2. A strong economy is good.
  3. Children should be protected.
  4. The strong should not be allowed to prey on the weak.
  5. Cops who break the law should be prosecuted.
  6. Skin color doesn’t make one person better than another.
  7. Protecting our environment is important.
  8. Non-citizen criminals should not be allowed into our country.
  9. Individuals should be able to express their opinion.
  10. The police have a responsibility to protect us.
  11. Teachers are important.
  12. People who work should be paid fairly.
I can already hear you thinking, “Yeah, but…” and it’s for that reason that I’ve left these unexplained. I challenge you to lay this list down beside the political platform of any candidate on either side and see how many you can find that they don’t agree with. Ask your friends if they agree with these. Don’t ask for an explanation, just yes or no, do they agree with these or not?

These are not unimportant issues. These are among the most important if not the most important issues that exist in our political debate. If we agree on the most important things then why are we so divided?

It goes something like this: I and my opponent have a common goal, but we disagree on how to achieve it. I can’t see how what my opponent wants to do will achieve the goal, so I assume that my opponent doesn’t want to achieve the same goal as me. Since my opponent doesn’t support what any good person would support then my opponent must be evil. Since my opponent is evil, no one should listen to what my opponent has to say. If they do then they are also evil.

A better approach is this: My opponent advocates something that I believe harms something good. I assume that my opponent doesn’t want to harm this thing, so my opponent either placed a greater priority on some other good thing or doesn’t have enough information to see how his position will do harm. Or it could be that I don’t have all of the information I need.

Given that we’re dealing with individuals, it’s quite possible that the person in question is acting out of evil intentions, but the general case is that those who disagree with us believe they are fighting the good fight. They believe they are fighting to protect the children or putting an end to mass murder or fighting for the oppressed. Telling them they are not (no matter how certain we are) will only make them angry. Instead, we should try to find out what it is they are fighting for. It is probably one of the twelve things in the list above. From there, we can try to show them a better way to achieve what they are trying to achieve. And the good thing is that it probably something that we also want to achieve.

Thursday, September 6, 2018

Still Making Plugins and Scripts Work with Art of Illusion

When a reader of Extending Art of Illusion contacted me about the possibility of updating the Art of Illusion scripts to Groovy, I became concerned. Firstly, because he wasn’t able to download the source code from the location specified in the book. Broken links on a webpage are one thing, but broken links in a book can be costly. Secondly, because I haven’t attempted to keep up with all of the changes to Art of Illusion that have taken place since the publication date of the book. There hasn’t been enough demand for the book to justify a revised edition. To address my concerns, I went back through the examples I included in the book—rebuilding with latest Java compiler and using Art of Illusion 3.03. With joy I’m able to say that they all still work. In spite of the book being seven years old, it remains useful anyone who is looking for instruction on how to create plugins for Art of Illusion.

I did find a couple of things that I would add to the book if I were to revise it. The first is that to use the examples you need to include the Bouy.jar in the list of linked libraries. I’m not sure if this is a result of a change or of an oversight on my part. The second is that I would include scripts written in Groovy in the book. I’ve somewhat corrected this by adding Groovy scripts to the .zip file that contains the examples. At this point, Art of Illusion still support BeanShell even as it is moving toward Groovy, so it is really up to the person writing the script to decide which one they want to use. There are a lot more similarities between BeanShell and Groovy than there are differences, so the only change I made to the axes script was to change the file extension from .bsh to .groovy

There were more differences with the Room script. At line 18 I removed the “private” specifier for the class. At line 105 I deleted “LayoutWindow layout”. At line 106 I removed the “final String” specifier because Groovy couldn’t see windowTitle as a global variable. And at line 116 I deleted “int roomCount = 0”. At 128 I rewrote the declaration as:

    float[] roomSmoothness;
    roomSmoothness = [0.0f, 0.0f, 0.0f, 0.0f]; 

Overall, it wasn’t difficult to make the changes, but it did take some effort and a little research to figure out the differences between the two scripting languages.


Monday, September 3, 2018

Using C++ Resource Files with Eclipse

Using a resource file in Eclipse is possible. While writing a blog about how to develop Windows programs using Eclipse and C++ I ran into a problem that I needed a tool for, namely to quote C++ code in the blog. So, I wrote a little program in C++ using the techniques I was discussing, but later I decided it would be an ideal project to rewrite using a resource file (.rc). There are a few things you have to do to get it to work.

First, Eclipse doesn’t provide the slick resource file editor that you find in Visual C++. This means that to edit the .rc file you will need to use a text editor. This isn’t particularly hard to do, but I did find myself questioning whether I was gaining anything by using the resource file over just making the calls I needed in the C++ code. One thing that I can say that I don’t like is that you must use #define in the header file rather than defining constants with static const or as an enum.

Second, the .rc file has to be compiled using a special compiler and then you have to link to the .o that is generated. In order to prevent yourself from having to remember to do that each time you modify the .rc file, you must create a pre-build step. Even then, changes to the .rc file won’t compile and link unless you’ve mode changes to the C++ source code.

As with the other blog post, you can download the Eclipse project for this program. It isn’t cleaned up, but it should provide you with an example of how to compile a resource file using Eclipse and MinGW. The command to run the winres must be supplied to Eclipse via the settings window of the C/C++ Build properties.

This command is:

c:\mingw\bin\windres.exe --include-dir="${ProjDirPath}" --input="${ProjDirPath}/res.rc" --output="${ProjDirPath}/res.o" --define RESLOC="${ProjDirPath}/resources.h"

Notice that I provide the project directory path for both the input and the output. For some reason, MinGW doesn’t seem to recognize –include-dir, but I populate it anyway. I also define a macro RESLOC. You will see this used within the .rc file where we include resources.h, since winres can’t find the local directory on its path.

#define Q(x) #x
#define QUOTE(x) Q(x)
#include QUOTE(RESLOC)

#define APSTUDIO_HIDDEN_SYMBOLS
#include "windows.h"
#undef APSTUDIO_HIDDEN_SYMBOLS

The rest is pretty much the same as you would expect for a resource file and in many cases you can copy on that has been created with Visual Studio, if you don’t want to edit it by hand.

The Eclipse Project is located at: http://www.timothyfish.com/Examples/Windows4Eclipse/BlogCodeFormat.zip

Sunday, September 2, 2018

Developing Windows Programs using Eclipse C++

Eclipse CDT (C/C++ Development Toolkit) is perfectly fine for developing Windows applications in C++. But you might be asking, why would I want to do that when Visual Studio is so readily available?

I started down this path because I spend most of my time with the Eclipse IDE (Integrated Development Environment) running on my machine and often with multiple workspaces on both Windows and Linux, but the C++ code I develop isn’t intended to run on Windows. But ever so often I will develop a simple tool with a Graphical User Interface (GUI). Since I’m familiar with Eclipse, I would prefer not to have to switch to another IDE just for a simple tool. But one thing you notice when you look at an IDE like Visual Studio is that it generates a significant amount of code for you and it makes use of various libraries, but how much of this do you really need?

I assume you’ve built with the Eclipse CDT. If not, follow this guide first:
https://www.codeproject.com/Articles/14222/C-Development-using-eclipse-IDE-Starters-guide

Also, if you want to skip ahead, the source projects are located in the following locations:

http://www.timothyfish.com/Examples/Windows4Eclipse/HelloMsg.zip

http://www.timothyfish.com/Examples/Windows4Eclipse/ExampleWin.zip

I started down this path because I spend most of my time with the Eclipse IDE (Integrated Development Environment) running on my machine and often with multiple workspaces on both Windows and Linux, but the C++ code I develop isn’t intended to run on Windows. But ever so often I will develop a simple tool with a Graphical User Interface (GUI). Since I’m familiar with Eclipse, I would prefer not to have to switch to another IDE just for a simple tool. But one thing you notice when you look at an IDE like Visual Studio is that it generates a significant amount of code for you and it makes use of various libraries, but how much of this do you really need?

One of my favorite books when I was younger was Programming Windows 3.1 by Charles Petzold. He’s updated it as the Windows OS has moved on, but that book is still in my library. The thing that surprised me when I first read it was that just to display a simple window on the screen required two pages of C code. In the fifth edition of Programming Windows he has that down to a much simpler program:

#include <windows.h>
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
PSTR szCmdLine, int iCmdShow)
{

    MessageBox (NULL, TEXT ("Hello, Windows 98!"), 
                TEXT ("HelloMsg"), 0);
    return 0;
}

While that kind of program will let you test that you are able to compile and run a program from your IDE, it only hints at the more complicated nature of the Windows API (Application Programming Interface). For me, I not only wanted to know that I could write a program in Eclipse that would display a message box, but that I could use Eclipse for more useful programs as well. But I also wanted it to follow a more C++ oriented programming style.

But before we move farther, let’s compile and run a version of his C program from Eclipse. On my machine I have installed the following:

In the Eclipse C++ Perspective, create a new C++ Project.

Select C++ Managed Build and click Next.

Select Empty Project and give it a name. Click Next.

At this next window we could set some specifics, but we’ll ignore it for now. Click Finish.

Right click on the project name and create a new file.

Enter the following code and click the build button:


#include <windows.h>
int WINAPI WinMain (HINSTANCE hInstance,
                    HINSTANCE hPrevInstance,
                    PSTR szCmdLine,
                    int iCmdShow)
{
    MessageBox (NULL, TEXT ("Hello, World!"),
                TEXT ("HelloMsg"), 0);
    return 0;
}

If everything is installed correctly then this program should build, and you should be able to run it by clicking the Run Button. This will display something like the following:

But as I said before, this isn’t particularly useful other than to verify that your development environment is setup properly. What we would like to do is have a program that displays a window in which we specify what controls are used and where they are located on the page. We may even want to open another window.

Create another new project following the same steps as before. Call the project “ExampleWin” and add a file called “start.cpp” to the project.

Going back to Charles Petzold and Programming Windows, because he was writing in C, his WinMain consisted of a page of code that created a window and then went into a message loop. He also had one callback function WndProc that handled the WM_PAINT message by drawing text on the screen. It also handled WM_DESTROY by posting 0 to the message queue so that the loop in WinMain would terminate. We don’t see the code for it, but the MessageBox function is doing all of this in its code. So, there’s really no reason why we have to have such a long WinMain and since we’re working with C++ instead of C, we can create a class that handles it rather than just a function. We still have to put all the details somewhere, but we can keep WinMain simple. This is very useful if you are using a test environment that needs to replace WinMain with its own. It’s much easier to tell it how to replace one call than it is to tell it how to replace a page of code.

The code for start.cpp should look like this:

// *
// * StartApp.h
// *
// *  Created on: Sep 1, 2018
// *      Author: Timothy Fish
// *      Website: http://www.timothyfish.com
// *

#ifndef STARTAPP_H_
#define STARTAPP_H_
#include <windows.h>

class StartApp {
public:
    static StartApp& getInstance();
    virtual ~StartApp();

    int begin(HINSTANCE hInstance,
              HINSTANCE hPrevInstance,
              PSTR    lpCmdLine,
              int       nCmdShow);

    HINSTANCE getHInstance(){ return hInst; }
    void setHInstance(HINSTANCE h){ hInst = h; }
private:
    static StartApp* instance;
    bool running;

    HINSTANCE hInst;
    const char* className = "StartApp";
    const char* appName   = "Example Windows App";
    StartApp();
};

#endif /* STARTAPP_H_ */

Click the build button and you should expect to see the following error:

..\start.cpp:2:10: fatal error: StartApp.h: No such file or directory
 #include <StartApp.h>
          ^~~~~~~~~~~~

This is telling us that it doesn’t know where StartApp.h is. You could put it into quotes, but since some coding standards tell us not to do that sort of thing, let’s add the source directory to the include directories. To do that, Right click on the ExampleWin project name and select properties. Select C/C++ General and go to the Includes tab. Add ${ProjDirPath} to the GNU C++ Language all configurations. (You may add it to the other languages if you like, but we’re only using C++ here. Apply and close.

Now when you build you should get the following errors:

start.o: In function `WinMain@16':
C:\Users\timot\Eclipse4Windows\ExampleWin\Debug/../start.cpp:9: undefined reference to `StartApp::getInstance()'
C:\Users\timot\Eclipse4Windows\ExampleWin\Debug/../start.cpp:9: undefined reference to `StartApp::begin(HINSTANCE__*, HINSTANCE__*, char*, int)'
collect2.exe: error: ld returned 1 exit status

These are both linker errors. They exist because we haven’t added the functions to the StartApp.cpp file yet. To do this, create another new file StartApp.cpp and add the following code:

// *
// * StartApp.cpp
// *
// *  Created on: Sep 1, 2018
// *      Author: Timothy Fish
// *      Website: http://www.timothyfish.com
// *

#include <StartApp.h>

#include <iostream>
#include <windows.h>
#include <windowsx.h>

StartApp* StartApp::instance = 0;

StartApp& StartApp::getInstance(){

    if(instance == 0){
        instance = new StartApp();
    }

    return *instance;
}

StartApp::StartApp(): running(0), hInst(0) {
}

StartApp::~StartApp() {
}

int StartApp::begin(HINSTANCE hInstance,
                    HINSTANCE hPrevInstance,
                    PSTR    lpCmdLine,
                    int       nCmdShow)
{
    return 0;
}

Another thing that I would recommend doing at this point is add static linking of gcc by adding the following to you link command: -static -static-libgcc -static-libgcc. This will save you having to find the dll to run outside of Eclipse.

At this point, you should be able to build and run without errors. With multiple projects in Eclipse you may need to specify which one to run by selecting the project and then selecting Run As|Local C/C++ Application.

If you run it at this point, it will appear that it did nothing, since we haven’t yet created a window and we don’t have a message loop. If you like, you can run it using the debugger (click the bug button) and step through the code to verify that it is actually running something. Otherwise the code will run and exit without showing you anything. To correct this, we need to modify the begin function.

int StartApp::begin(HINSTANCE hInstance,
                    HINSTANCE hPrevInstance,
                    PSTR    lpCmdLine,
                    int       nCmdShow)
{
    UNREFERENCED_PARAMETER(hPrevInstance);
    UNREFERENCED_PARAMETER(lpCmdLine);

    if(running) return 0; // only run one copy

    MyRegisterClass(hInstance);

    if (!InitInstance (hInstance, nCmdShow))
    {
        std::cout<<"Start - GetLastError - InitInstance: "<<GetLastError()<<std::endl;
        return FALSE;
    }

    MSG msg;

    while (GetMessage(&msg, nullptr, 0, 0))
    {
        TranslateMessage(&msg);
        DispatchMessage(&msg);
    }

    return (int) msg.wParam;
}

We are introducing some new functions here, so you will also need to modify StartApp.h to add the following as private member functions to the class:

    ATOM MyRegisterClass(HINSTANCE hInstance);
    BOOL InitInstance(HINSTANCE hInstance, int nCmdShow);
    static LRESULT CALLBACK WndProc(HWND hwnd, 
                                     UINT message, 
                                     WPARAM wParam, 
                                     LPARAM lParam);

Building at this point should result in the following errors:

StartApp.o: In function `_::ZN8StartApp5beginEP11HINSTANCE(char *, int) static':
C:\Users\timot\Eclipse4Windows\ExampleWin\Debug/../StartApp.cpp:42: undefined reference to `StartApp::MyRegisterClass(HINSTANCE__*)'
C:\Users\timot\Eclipse4Windows\ExampleWin\Debug/../StartApp.cpp:44: undefined reference to `StartApp::InitInstance(HINSTANCE__*, int)'
collect2.exe: error: ld returned 1 exit status

We will implement MyRegisterClass and InitInstance in a moment, but first let’s look at begin.

    UNREFERENCED_PARAMETER(hPrevInstance);
    UNREFERENCED_PARAMETER(lpCmdLine);

These like trick the compiler into thinking that these unused variables are actually used, so we don’t see warnings.

if(running) return 0; // only run one copy

This line prevents begin from being called twice.

    MSG msg;

    while (GetMessage(&msg, nullptr, 0, 0))
    {
        TranslateMessage(&msg);
        DispatchMessage(&msg);
    }

    return (int) msg.wParam;

This code is the standard message loop for a Windows program. We retrieve the message from the queue and pass it back to Windows. We keep doing this until we GetMessage returns 0. If we need to do something special within this loop we can, but we have no need to at this point.

Add the following code to StartApp.cpp:

ATOM StartApp::MyRegisterClass(HINSTANCE hInstance)
{
    WNDCLASSEX windowClass; //window class

    windowClass.cbSize              = sizeof(WNDCLASSEX);
    windowClass.style               = CS_HREDRAW | CS_VREDRAW;
    windowClass.lpfnWndProc         = WndProc;
    windowClass.cbClsExtra          = 0;
    windowClass.cbWndExtra          = 0;
    windowClass.hInstance           = hInstance;
    windowClass.hIcon               = LoadIcon(0, IDI_APPLICATION);
    windowClass.hCursor             = LoadCursor(0, IDC_ARROW);
    windowClass.hbrBackground       = GetSysColorBrush(COLOR_WINDOW);
    windowClass.lpszMenuName        = 0;
    windowClass.lpszClassName       = className;
    windowClass.hIconSm             = LoadIcon(0, IDI_WINLOGO);
    return RegisterClassEx(&windowClass);
}

BOOL StartApp::InitInstance(HINSTANCE hInstance, int nCmdShow)
{
    hInst = hInstance; // Store instance handle in our global variable
    RECT    windowRect;

    int width = 300;
    int height = 200;

    windowRect.left =(long)0;       //set left value to 0
    windowRect.right =(long)width;  //set right value to requested width
    windowRect.top =(long)0;        //set top value to 0
    windowRect.bottom =(long)height;//set bottom value to requested height

    AdjustWindowRectEx(&windowRect, WS_OVERLAPPEDWINDOW, FALSE, WS_EX_APPWINDOW | WS_EX_WINDOWEDGE);

    HWND hwnd = CreateWindowEx(0, className,  //class name
            appName,       //app name
            WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS,
            400, 300,                         //x and y coords
            windowRect.right - windowRect.left,
            windowRect.bottom - windowRect.top,//width, height
            0,                 //handle to parent
            0,                 //handle to menu
            hInstance,    //application instance
            0);                //no xtra params

    if (!hwnd)
    {
        std::cout<<"Start - GetLastError - CreateWindowEx: "<<GetLastError()<<std::endl;
        return FALSE;
    }

    ShowWindow(hwnd, nCmdShow);
    UpdateWindow(hwnd);

    return TRUE;
}

LRESULT CALLBACK StartApp::WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
    static HINSTANCE hInstance;
    UNREFERENCED_PARAMETER(hInstance);

    switch (message)
    {
    case WM_CREATE:
        hInstance = ((LPCREATESTRUCT)lParam)->hInstance;
        break;
    case WM_PAINT:
        {
            PAINTSTRUCT ps;
            HDC hdc = BeginPaint(hwnd, &ps);
            UNREFERENCED_PARAMETER(hdc);
            // TODO: Add any drawing code that uses hdc here...

            EndPaint(hwnd, &ps);
        }
        break;
    case WM_DESTROY:
        PostQuitMessage(0);
        break;
    default:
        return DefWindowProc(hwnd, message, wParam, lParam);
    }
    return 0;
}



Now, when you Build and Run you should see a small window appear on the screen.

While this is a small success, to be useful we need it to either provide information to the user or to request information from the user. As a proof of concept, lets display an edit box that accepts a character and displays the ASCII representation of it when the user clicks the Submit button. We need to add an edit box, a static, and a button to the window. We do this by modifying the InitInstance function. Add the following code to InitInstance just before ShowWindow:

    CreateWindow(TEXT("edit"), TEXT("A"),
                 WS_VISIBLE | WS_CHILD | SS_CENTER|WS_BORDER,
                 width/2-10, 20, 20, 25,
                 hwnd, (HMENU) IDM_CHAR, NULL, NULL);

    CreateWindow(TEXT("static"), TEXT("65"),
                 WS_VISIBLE | WS_CHILD | SS_CENTER,
                 width/2-10, 45, 20, 25,
                 hwnd, (HMENU) IDM_INT, NULL, NULL);

    CreateWindow(TEXT("button"), TEXT("Submit"),
            WS_VISIBLE | WS_CHILD ,
            200, 140, 80, 25,
            hwnd, (HMENU) IDM_SUBMIT, NULL, NULL);

Add the following to the private section of the StartApp class:

    enum ControlIds{
        IDM_CHAR = 100,
        IDM_INT,
        IDM_SUBMIT
    };

When you run this code you should see something like the following:

But while it looks like we would expect, nothing happens when we click the Submit button. To correct that, we need to add some code that handles the button clicks. Add the following code to the switch statement in WndProc:

    case WM_COMMAND:
    {
        int wmId = LOWORD(wParam);
        switch (wmId)
        {
        case IDM_SUBMIT:
        {
            char buf[5];

            GetDlgItemText( hwnd, IDM_CHAR, buf,2 );

            int asciiVal = int(buf[0]);
            itoa(asciiVal, buf, 10);

            SetDlgItemText( hwnd, IDM_INT, buf );
        }
            break;
        default:
            return DefWindowProc(hwnd, message, wParam, lParam);
        }
    }
        break;

Each time a button is clicked the WM_COMMAND message is sent with an Id in LOWORD(wParam). In the internal switch we check to see if that Id is IDM_SUBMIT, which is the id we gave the Submit button when we created it. When it is, we get the text from the Edit Box, which has Id IDM_CHAR, place it in buf, convert the first character to an int, then we convert that int to ASCII and place the value in buf. We set the text in the static with Id IDM_INT to the value in buf.

If you are able to do this much within the Eclipse IDE, you can do the rest by researching the specifics of the Windows API. You can download the Eclipse projects, which include the source code in this example plus some more code that implements a menu that calls an About Dialog that is implemented as a separate class.

You will notice that some of what we are doing here could be done using a resource file. I stayed away from resource files in this example because having additional files makes it harder to follow where things are coming from. To use a resource file you will need to call windres on the .rc file to generate a .o while that you can link with your program.

The source projects are located in the following locations:

http://www.timothyfish.com/Examples/Windows4Eclipse/HelloMsg.zip

http://www.timothyfish.com/Examples/Windows4Eclipse/ExampleWin.zip

Saturday, August 4, 2018

When God Lies

So, when God desired to show more convincingly to the heirs of the promise the unchangeable character of his purpose, he guaranteed it with an oath, so that by two unchangeable things, in which it is impossible for God to lie, we who have fled for refuge might have strong encouragement to hold fast to the hope set before us. – Hebrews 6:17-18(ESV)

Therefore, God sends them a strong delusion, so that they may believe what is false, in order that all may be condemned who did not believe the truth but had pleasure in unrighteousness. – II Thessalonians 2:11-12(ESV)

Does God lie? The writer of Hebrews based the certainty of God’s promise on the unchangeable truth that it is impossible to lie. It’s the sort of thing you expect to see written with needlepoint and hanging on a wall next to a cross. But what about what Paul wrote to the assembly at Thessalonica? “God sends them a strong delusion.” Can they both be true? We certainly can’t write it off as a mistake because the Bible gives us multiple situations in which people were deceived as a result of an act of God. Exodus 7-9 repeatedly tells us that the Lord hardened Pharaoh’s heart. I Kings 22 and II Chronicles 18 tell a story of the Lord sending a “lying spirit” to be in the mouth of the prophets. And that doesn’t even consider the times that God blessed the lies of people like Rahab or Jael. How do we resolve this?

First, consider that we never see God utter a lie, but the deception is carried out by those sent by God. This may be because it is truly impossible for God to lie. God spoke, and the world came into being from nothing. It may be that if God were to speak a lie that the whole Universe would be torn apart trying to deal with the paradox. But that doesn’t keep him from sending messengers who are deceitful at his command or keep him from “hardening” a heart.

Next, consider the situations in which these messengers have been sent. In I Kings 22 and II Chronicles 18 the Lord sent the lying spirit to lure King Ahab out to battle so that he would fall as had be prophesied. Ahab was an evil king who didn’t want to believe the Lord. So, even when Macaiah told him that the Lord had sent a lying spirit Ahab followed the lie. And let’s look again at II Thessalonians 2:11-12. Why did God send strong delusion? Because they didn’t believe the truth and had pleasure in unrighteousness.

Can we summarize this by saying that when God lies it is because people have rejected the truth? The deception that comes from God is used to move people into a position where they will receive justice for their unrighteousness. How many times have we seen people who have done evil things and were caught because they thought they could get away with it. They believed a lie and it exposed their unrighteousness. Could it be that God sent a messenger to persuade them to believe the lie? They preferred the lie over the truth, so God gave them what they wanted.

What you might be asking is whether it is okay for us to lie. Rahab hid the spies and was blessed by God. Jael offered a man protection and then slew him while he slept, but she too was blessed by God. But Ananias and Sapphira lied about how much they were paid for their land and they died at the word of Peter. There seems to be two kinds of lies. One lie is the usual kind in which we tell something that is untrue because we desire unrighteous gain. The other kind is one in which we tell something untrue because it will prevent unrighteousness or bring about justice. An example of this might be that a gunman enters a school and asks someone where others are hiding. To say that there are no others would be a lie, but it would prevent the death of those students. Contrast this with someone telling the police that the gunman ran in the opposite direction of what he did.

It seems that a lie in and of itself may not be sin, but the evilness of the lie is determined by the evilness of the result. We must be extremely careful because it is so easy for us to convince ourselves that we are lying for good reasons and yet the results turn out otherwise. When in doubt, tell the truth, but don’t aid those who do unrighteousness.

Monday, May 21, 2018

The Reason for Mass Killings and How to Prevent Mass Shootings

Once more we hear the news of another mass killing. And once more we hear much talk about what we need to do to prevent it from happening again. Though there is much expressed anger on all sides I have yet to see anyone present a solution that would’ve prevented one of the recent mass killings, let alone all of them. Some people have focused on gun control, but the most recent shooting involved guns that the gun control advocates thought were safe. And then there are the killings like the New York truck attack and the Boston Marathon bombing that wouldn’t have been stopped by even the strictest gun ban.

For all the talk of what we need to do about these killings there’s been little talk about why they are taking place. How can we prevent them if we don’t know why they are happening? One person said they knew why they are happening, “It’s Satan.” I don’t disagree, but I also don’t think that answer is helpful. Even if Satan himself is whispering in the ear of each of these killers we still need to understand why they are listening to Satan. Why would they plan their attack with every intention of taking their own lives? If that’s what Satan were telling you to do, don’t you think you would say, “Get thee behind me, Satan?”

Some of these attacks are terrorist attacks and we sort of understand those, though people are still trying to figure out how these guys become radicalized so quickly. It’s quite likely that the terrorists are killing for the same reason the non-terrorists are killing, so the question of radicalization may not matter. But why are the non-terrorists killing?

The shooter in Santa Fe and the left leaning woman who hot up YouTube in San Bruno, California may give us a clearer understanding than the other killers. The kid in Santa Fe made an interesting statement when he said that he shot people he didn’t know because he wanted the people who knew him to be able to tell his story. And the YouTube shoot did what she did because she believed YouTube was preventing people from watching her YouTube channel. Neither had mainline views, and they had views that were dissimilar to each other, but the thing they had in common was that they wanted to be heard.

I’m convinced that all these killers are trying to be heard. This is different from your typical killer who is trying to exercise authority or to get revenge. In a typical killing the killer may act in rage or may plan on getting away. In these mass killings the killer goes in with the expectation that he will not survive. It may seem senseless, but this is the act of someone who believes they are doing something of greater importance than themselves. They are using a gun, a knife, a bomb, or a car to kill but it is their way of yelling their message as loudly as they possibly can. To them, being heard is more important than life itself.

Since that’s the case, one thing we can do to prevent future killings is to do a better job at listening. But that’s not the complete solution. Some of these people are absolute nut jobs and our listening to them isn’t an option. They will confuse even a well-reasoned rebuttal of their position with ignoring them. But that might tell us something about the kind of people we should be leery of. How do they respond when people disagree with them? Do they consider the other side or do they become angry because the person won’t be swayed?

It also might tell us something about what we need to be teaching. People need to learn how to have a reasoned discussion. They also need to learn how to deal with people ignoring them. This is something that is best taught from an early age and yes, I think having a father in the home would help with this. Father’s roughhouse with their children and by doing so they teach them to fight without bringing blood. This carries over into other things. It can be how a person learns to state their case in an argument without escalating to actual harm to the other person. But it may be possible for similar things to be taught in schools. We need to bring back recess, because that’s where students learn part of these. They may also learn it if they are required to defend a point of view in class. There are some who cannot be taught and for those we may need physical prevention methods, but teaching students to deal with the insult of not being heard will only reduce the need for physical prevention measures.

Friday, April 27, 2018

Google Censoring Religious Speech?

It was a post shared by Mike Huckabee that caught my attention. "Google Rejects Christian Publisher's Ads Because They Mention Bible and Jesus" the title read. In the current political climate it's the kind of thing that people are likely to point to as more persecution from the left or to point to as much ado about nothing from the right, depending on what their political leaning might be. So, which is it? While I respect Mike Huckabee a great deal, he isn't always so great about verifying his sources and "The Western Journal" which is were the article is located often gets things wrong. I really began to question it when I noticed that it was talking about "AdWords" and "personalized content."
For those of you who don't know, "AdWords" is the term Google uses to describe advertising that targets a particular audience based on what keywords they search for. For example, if you type "coffee" into the Google search engine you are likely to start seeing ads for Starbucks, or Folgers, or coffee pots. This is because these companies are trying to target their ads at people who drink coffee. A Christian publisher like Concordia Publishing House is likely to try to target their ads at Christians, but this left me wondering why Google would tell them that they would need to remove any mention of Jesus and the Bible from their website. It didn't make sense.
So, I did what anybody should do when faced with information like this. I went to the original press release. While the original press release paints a similar picture and also has things are confusing about it there are things here that indicate that things are not quite what they seem. Here they refer to "remarketing ads." Remarketing ads are ads that pop up when you are trying to leave a website. Most of us find them irritating, but the basic concept is that a user visits a website and doesn't buy anything, so rather than the website getting nothing from the user the website puts an ad in front of the user so that the user will click to go to another website. Google pays a small amount for the privilege of redirecting users to another website.
What many people have assumed is that Google is telling Concordia Publishing House that they can't advertise on their platform because of the content of their website, but when read the advertising policy it appears something else is going on. To paraphrase the policy, Google will not allow advertising that targets people based on a number of hot button issues. One of those is religion, but it includes other things like sexual identity, union membership, political affiliation, etc. If I'm trying to target advertising at Christians then I might want to target the keywords "Jesus" or "Bible" since those are most commonly used by Christians, but Google will reject those ads. If I were writing homosexual erotica then I might want to target "LGBT", but Google policy would reject those ads as well. Why? I suspect it is because it would be possible to use AdWords and the ads people click on for a third party to find out personal information about people. But that's still no reason for Google to suggest that Concordia Publishing House remove Jesus from their website.
But let's go back to this "remarketing ads" concept. Keep in mind that Google is trying to keep third parties from finding out what the religion of the people who click on their ads is. Now, suppose that Concordia Publishing House wants to make money by allowing Google to place ads on their site. Previously, Google would've been willing, but with the concern over Cambridge Analytica they don't want the advertisers knowing that the people who clicked on their ads are coming from a religious website. So they simply say that they won't place ads on religious websites. Likewise, if they are consistent with their policy, they won't place ads on LGBT websites or on a number of other websites.
Is what Google is doing a good idea? No, I don't think it is. I think there are a lot of people who are trying to advertise who won't be able to get their message to their desired audience because of this. But at the same time I'm not convinced that what they are doing with this is religious discrimination. It's more likely that this is an overreaction in an attempt to fill a huge hole in their privacy settings. As for us on the right, I think we need to be careful about jumping to conclusions.