Posts
There comes a time when you just need to take a little off the top of a file, see what you are working with. That is where knowing how to use a utility like
<a href="http://man7.org/linux/man-pages/man1/head.1.html">head</a>can help. Just running:$ head filename.txt
Will get you
Print the first 10 lines of each FILE to standard output.
But what if that file does not have nice lines? Large SQL dump files come to mind.
headhas an answer. Use the-cflag to print the beginning bytes of a file instead of lines. Change the command above to:Imagine a scenario where one party wants to check whether a name they have exists in a list of names kept by the another party. But I do not want the other party to know what name I am searching. This problem may seem unrealistic but imagine a data breach where tons of personal information is leaked. You want to check whether you were impacted in the breach but do not trust the party hosting the personal information to keep your query safe. This is possible with the help of homomorphic encryption, specifically Paillier encrytption.
Collecting memories from people is an excellent way to celebrate the experience of others. I have found it helps me learn more about why people hold certain beliefs, how they overcame hardships, and the world we live in. Interviewing other people has helped me learn more about myself, which is why I wanted to write up a guide for collecting the stories of other people.
The most obvious aspect of collecting stories is interviewing. There are a ton of resources by people much more experienced than myself on how to conduct an oral history interview. It is important to come up with a sample outline and use that as a starting point. I continue to consult the following resources to help me prepare for interviews.
The Windows Subsystem for Linux (WSL) is one of the best features on Windows 10. It makes development so much easier than it used to be but still has a few hiccups. Kinda like Linux, some things don’t “just work.” One pesky thing that I recently dealt with was getting SSH to work with a keypair file from WSL. Here is how to get SSH working on WSL.
Goal
Given a keypair file, we want to invoke ssh from the command line and establish a tunnel to another server. This is a common task when connecting to remote servers. Think AWS, Azure, or Digital Ocean. It is a simple command:
Below are some notes on getting
<a href="https://github.com/edenhill/kafkacat#build">kafkacat</a>installed on an Amazon workspace with admin access.The commands listed on the GitHub page will not work without a little preparation. A Linux Amazon Workspace image is based on Amazon Linux. Attempts to use a package manager like
yumgo through a plugin,amzn_workspaces_filter_updates. This filter only has a handful of packages (30 at the time of this writing) that can be pulled. The first thing to do is add Extra Packages for Enterprise Linux, EPEL, to the instance’s package repository. Following the instructions on the Fedora FAQ run:I have been working on collecting a family’s oral history for the past few months. During the process I took notes with simple descriptions of what the speaker was describing or telling and a rough timestamp of when in the file the conversation took place. After collecting hours of stories, I realized that having a transcription would make things much easier to search and perhaps more useful to those interested in these particular histories. Why not get a transcription of the contents via one of the cloud offerings? Amazon offers a service called Transcribe that is available via the AWS suite of services. Since I have a small account and some credits to burn I figured why not kick the tires and see how Transcribe would perform on meandering oral history interviews. But before I jump into the how, let me describe my particular use case.
Once a year I need to free up space on my work machine. Once a year I find myself searching for an efficient way to identify the largest files that I do not need any longer without installing third party software. Here is the solution I stumbled on this year and it couldn’t be simpler.
- Open File Explorer
- Navigate to the drive you want to search. Normally, C:\
- Type “size:gigantic” in the search bar
- Wait for the search to complete
- Sort the results by size
This search will scan your computer’s file system for files that are larger than 128mb. You can then identify files that are no longer needed.
Recently, I have been working with the Requests library in Python. I wrote a simple function to pull down a file that took more than a minute to download. While waiting for the download to complete I realized it would be nice to have some insight into the download’s progress. A quick search on StackOverflow led to an excellent example. Below is a simple way to display a progress bar while downloading a file.
“Logic has both seductive advantages and bothersome disadvantages.”
Patrick Winston, Artificial Intelligence, pp 283
Logic in artificial intelligence can be used to help an agent create rules of inference. It provides a formal framework for creating if-then statements. Formal logic statements can be difficult for beginners because of the symbols and vocabulary used. Below is a cheat sheet for some of the basic symbols and definitions.
Symbol <td> Definition </td>∧ <td> Logical conjunction. In most instances it will be used as an AND operator. </td>∨ <td> Logical disjunction. In most instances it will be used as an ORoperator. </td>∀ <td> Universal quantifier. Placed in front of a statement that includes ALL entities in the agent’s universe. </td>∃ <td> Existential quantifier. Placed in front of a statement where it applies to at least one entity in the agent’s universe. </td>¬ <td> Negation. The statement is only true if the condition is false. </td>Word <td> Definition </td>Conjunction <td> And. Means the truth of a set of operands is true if and only if all of its operands are true. Symbol used to represent this operator is typically ∧ or &. </td>Conjuct <td> An operand of a conjunction. </td>Disjunction <td> Or. Means the truth of a set of operands is true if and only if one or more of its operands is true. </td>Disjunct <td> An operand of a disjunct. </td>Predicates <td> A boolean valued function or a relationship. A ∧ B = True or A and B have a specific relationship. </td>modus ponus <td> The rule of inference. Given A is true and B is true then (A and B) is true </td>monotonic <td> A property that states a “function is monotonic if, for every combination of inputs, switching one of the inputs from false to true can only cause the output to switch from false to true and not from true to false” </td>Logic focuses on using knowledge in a provable and correct way. When it is used in AI it does not prove out that the claims are true. If an agent is taught that all birds can fly, it will be able to use logic to infer that a dog is not a bird. However, it will run into problems when classifying a penguin.
Have you ever tried to describe the color red to someone who suffers from protanopia, deuteranopia, protanomaly, or deuteranomaly? It is nearly impossible since those who are red-green color blind are missing the corresponding photoreceptors. The experience of seeing red is so familiar to those who have experienced it. And that type of experience, one which is difficult to communicate, does not change based on other experiences, is unique to the individual experiencing it, and immediately recognized, is qualia.