Are type variables really only used in mathematical conversation about types?

Are type variables really only used in mathematical conversation about types? i.e. are type variables (meta-variables that only contain the type classification label) only exist in proofs for types but not in real programming languages? At least is this true for monomorphic types? i.e. I can’t actually define:

$ $ \texttt{ let id x = x }: \tau$ $

unless the type $ \tau$ has already been defined or is built in? i.e. type variables only exist for symbolic manipulation of type proofs for humans (at least for monomorphism).

Extra thoughts:

I am trying to understand how one defines the identity function $ \texttt{let id x = x}$ in monomorphic type systems. I believe the motivation for polymorphism is to allow to apply the same syntactic definition of a function to different data types that are NOT the same, like: $ \texttt{id 2}$ and $ \texttt{id true}$ without the type checker freaking out at us when it tries to run those (if the language is dynamically typed…I guess in static the compiler would complain at the first instance of the identity function being applied to the wrong type when we try to compile it to usable code).

So to my understanding, if we define types as a set of possible data values, so say $ \texttt{int}$ defines the set of all integers. Then the set $ Set_{int \to int}$ is the set of all functions that can map integers to integers. But if we have $ Set_{\forall \alpha . \alpha \to \alpha}$ and we consider the identity function corresponding to both sets so $ id_{\forall \alpha . \alpha \to \alpha} \in Set_{\forall \alpha . \alpha \to \alpha}$ and $ id_{int} \in Set_{int \to int}$ then when both identity functions are applied to integers they will behave exactly the same BUT they are not the same function (because they are not the same data value, the data value for one is identity on only integers while the other is give me any type and I will act like its corresponding identity. So in particular $ Set_{\alpha \to \alpha} = Set_{int \to int} \cup \dots \cup Set_{string \to string}$ (i.e. the identity $ id_{\alpha \to \alpha}$ is just the identity function for a specific type but not actually a function that is able to process ANY type, its one and in this case this is why the for all is important).

So my question is, is $ id_{\forall \alpha . \alpha \to \alpha} \in Set_{\alpha \to \alpha}$ ? I guess I am trying to clarify the dots … What does it cover? Perhaps it depends on the context of how the types are formally defined? If the $ \alpha$ stands for type variables, but type variables are only allowed to be monomorphic by definition (i.e. say the type constructor for the meta-langauge is recursive but only in the monomorphism where we can’t introduce the forall quantifier) then the $ id_{\forall \alpha . \alpha \to \alpha} \not\in Set_{\alpha \to \alpha}$ . But if the recursive definition for polymorphic types is recursive at the polymorphic step then perhaps $ id_{\forall \alpha . \alpha \to \alpha} \in Set_{\alpha \to \alpha}$ is true? Actually I don’t think so…

Context: CS 421


  • What does $ \forall \alpha_1, \dots , \alpha_n . \tau $ mean formally as a type?

  • What is the difference between $ \alpha \to \alpha $ vs $ \forall \alpha. \alpha \to \alpha$ ?

Ubuntu 18.04 Samba share out of the blue is really slow

I’ve had a samba share setup on my ubuntu 18.04 server for a few months now, all running very smooth and very fast over my gigabit ethernet from the ubuntu server to another ubuntu laptop running 19.04 as well as a windows 10 laptop.

All of a sudden today, trying to access my share from my ubuntu laptop or windows laptop has been extremely laggy. Any file transfers are at around 2-3MB/s when it should be hovering around 100MB/s.

I’ve re-installed samba, restarted every device connected to my network.

I followed the steps in this tutorial:

here is my smb.conf for the share.

[myusername-share] path = /mnt/storage browseable = yes read only = no force create mode = 0660 force directory mode = 2770 valid users = @sambashare @sadmin

is no system really safe?

It may seem like a very general question but I couldn’t find any detailed debates over it. This is a purely theoretical question as of 2019.

Suppose we are to create our own product and safety design would be our priority. According to what we can see on the media (movies, games, whatever) hackers mention, that “no system is safe” and it got me wondering: is it true, that absolutely no system is safe from the hackers? I was browsing some basics online on what it means to be a hacker (as far as I know it often involves exploiting a security vulnerability). I am aware, that hackers can utilize a range of tools to hack a system (brute force, injections, hijacking, back doors…).

Would it be possible to design a system to be unhackable or are we limited to have a system, that is virtually unhackable? Because for most problems there exists a solution (like temp-banning a certain IP address when DDOS or brute force attacks happen) and this theoretical question takes exactly that into consideration. I am also aware, that security varies greatly by technologies such as HTTPS web servers/FTP, bluetooth, network, operating systems, authentication forms, databases, smart devices, software, bio-metric scanners…

Turn off Wifi really

I want to go out anywhere with my Ubuntu laptop and type on a manuscript with no e-prying. How can I turn off my wifi? I still may wish to plug in hardwire for updates; and I have access to a Cat5 hardwire when needed. I that case I can offload my manuscript to perform updates or add software. That is the goal.

Is Newton’s algorithm really this much better than conjugate gradient descent?

I have a function I’m minimizing. I’m using conjugate gradient descent and the Newton algorithm.

I am experiencing that the Newton algorithm is absurdly faster. Like, it finishes it 5-6 iterations, while the conjugate gradient takes 2000 iterations (and regular gradient descent takes 5000 iterations).

I know what’s causing the problem too: the learning rate. In Newton’s method, a learning rate of $ \alpha = 1$ works. But I can’t use this in the gradient descent methods, where such a choice of $ \alpha$ diverges. In these methods, I am forced to use $ \alpha = 0.01$ .

But anyways, 5 iterations vs thousands of iterations is still an absurd difference. Is Newton’s method really this good??!

Is Objective C (really) affected by buffer overflows?

I’m trying to find a buffer overflow sample code in Objective-C but the only samples I found are written in C (without “bracket style”).

I understand that Objective-C is based on C, but are there any chance of getting buffer overflows (or any kind of overflow) using only Objective-C ?

Would you have a sample code to demonstrate it ?

Thanks in advance.

Having to chmod my samba shares to 0777 feels wrong just to get them to be writeable. Is this really necessary?

Since setting up my samba shares I have been unable to write to either of them. My config:

[minecraft]         path = /opt/minecraft         writeable = yes         browseable = yes         read only = no         guest ok = yes         create mask = 0777  [www]         path = /var/www         writeable = yes         read only = no         browseable = yes         guest ok = yes         create mask = 0777 

I am unable however to write to either of these shares from a Windows machine. I have the folders themselves (and all subfolders) at 755, but still nothing.

The only thing that has allowed me to get the shares to be writeable is making them and their subfolders 777 and that just feels wrong.

Am I missing something?

Do I REALLY need to change my email password when Dark Web Monitoring recommends?

I occasionally get alerts from Dark Web Monitoring, such as this one:

08/31/2019   COMPROMISED EMAIL ADDRESS Email Addresses:    Jt*** Date Found: 08/26/2019 Password ************************* Potential Site DUBSMASH.COM Immediately change the password for the email address that was found compromised. 

My thoughts:

  1. My email account uses 2-factor authentication. So unless I know for sure that someone somehow learned my actual password, I don’t know why I’d want to change my password every time I get one of these alerts.
  2. The amount of asterisks in the “Password” in these alerts differs. Some alerts say ************************* and others say ********. I don’t know if the lengths are reliable, but if the length doesn’t match my real password, I wonder if that means I don’t need to change it.
  3. What the heck does Dubsmash have to do with anything? That app sounds only vaguely familiar. I checked my password manager and don’t seem to have an entry for it.