Can an Apple Magic Keyboard Work with a Windows Computer?

Question
Can an Apple Magic Keyboard work with a Windows computer?

Answer
Yes. An Apple Magic Keyboard will work with a Windows 10 desktop/laptop. It is plug and play too. We tried it with the USB cable initially. After that the wireless functionality was normal. (We tried this in December of 2020.) You can buy a Magic Keyboard here.

Why Do Some Job Descriptions Emphasize Object-oriented Programming?

Question
Why do some job descriptions emphasize object-oriented programming as opposed to procedural programming, scripting or other alternatives?

Background
Some people think that OOP is overused in certain contexts (page 379 of Python 3 Object-Oriented Programming and page 1303 of Programming Python by Mark Lutz). For example OOP may not be ideal for something like regexing (or matching string patterns per page 247 of Python 3 Object-Oriented Programming).

How Do You Troubleshoot the Hadoop Error “Connecting to ResourceManager”?

Problem scenario
You run a Hadoop command, but you get this error:

2020-12-20 18:19:33,706 INFO client.DefaultNoHARMFailoverProxyProvider: Connecting to ResourceManager at /0.0.0.0:8032
2020-12-20 18:19:36,068 INFO ipc.Client: Retrying connect to server: 0.0.0.0/0.0.0.0:8032. Already tried 0 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1000 MILLISECONDS)

You tried restarted the start-dfs script with this command: bash /usr/local/hadoop/sbin/start-dfs.sh

It did not help. You ran “jps” to see if Resource Manager was running.

How Do You Get Permanent Variables Set in the MacOS Terminal?

Problem scenario
You are using a Mac and you want an environment variable to be configured. What should you do?

Solution

  1. From a terminal, run this: echo $SHELL
  2. If you see /bin/zsh modify the ~/.zshrc to have the export statement that you need. You can learn more here.
    If you do not see “/bin/zsh”, update the ~/.bash_profile file to have the export statement that you want.

How Do You Troubleshoot Maven Giving You an Error Such as “java.lang.OutOfMemoryError java heap space”?

Problem scenario
You are getting an error such as “java.lang.OutOfMemoryError java heap space”

You have plenty of swap space available, but this error persists. The problem is as if nothing is using swap space you know exists. Why won’t your Java program or Maven build utilize the swap space that is available to it?

Possible solution #1 (for Maven builds)
Run a command like one of these (but uncomment the second one if you want to commit roughly 5 GB of memory to the maven build):

export MAVEN_OPTS=-Xmx512m
# export MAVEN_OPTS=-Xmx5120m

Now retry your mvn command.

How Do You Handle a Discrepancy between NMAP Results?

Problem scenario
From two different servers the nmap results show different ports are open. What is the likely cause of this problem?

Possible Solution #1
Is there a firewall between the two servers? Some firewalls block incoming or outgoing connections exclusively. An OS level firewall or other intermediate firewall could easily produce discrepant nmap results based on the servers running the nmap command.

How Do You Install SUSE when You Encounter “The System cannot be installed because … There is no device mounted at ‘/'”?

Problem scenario
You are trying to install Linux SUSE. You get an error “The System cannot be installed because the following errors were found: There is no device mounted at ‘/’. How do you get passed this problem?

Solution
Use the “Expert Partitioner”. Verify you have one device (e.g., /dev/sda1) that has the Type “BIOS Boot Partition.” Verify you have one device (e.g.,

How Do You Connect to a VM in Oracle VirtualBox from a Desktop?

Problem scenario
You are connecting to a VM in Oracle VirtualBox from a desktop. The pings to the VM are not responding. What should you do?

Solution
Go to Devices -Network -Network Settings
The “Attached to:” setting hould be “Bridged Adapter”
The “Name” setting should what you think is appropriate. Not uncommonly this will be en0 Wi-Fi.
Expand the “Advanced” settings.

How Do You Install CentOS when the Installation Source Option is a URL Exclusively (without an Option for a Local ISO)?

Problem scenario
You are trying to install CentOS in an offline manner. You get to the “Installation Summary” screen. The Software section says “Installation Source…Setting up installation source.” There is a yellow triangle with an exclamation point near the “Installation Source” button. The “Begin installation” button is grayed out. You want to choose a local ISO, and you thought it was installing via a local ISO. You do not have access to the internet.