Thursday, July 14, 2022

Enable Samba1 so Windows 95 on VirtualBox can access the network dirve

 There is a post on the web talking about that

http://www.troubleshooters.com/linux/win9x_samba.htm

but I need to refer to another one here

https://askubuntu.com/questions/1213759/allow-smb-1-with-lanman-authentication-with-samba

to make it fully work.

The key point is to check /etc/samba/smbpasswd 

Make sure that the entry doesn't look like 

james:1508:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:278AC243ABDE22263F8C90EDD3793C82:[U          ]:LCT-6A8C3B16:

 

Tuesday, May 3, 2022

TAOCP Exercise 1.2.4-35

 TAOCP

Excise 1.2.4-35

$ \lfloor \frac{ (x + m) }{n} \rfloor = \lfloor \frac{  \lfloor x \rfloor +m }{n} \rfloor $, where $x$ is real, $m$ and $n$ are integers, $n >0$


Proof:

Obviously  $\lfloor(x+m)/n \rfloor \geq \lfloor(\lfloor x \rfloor + m)/n \rfloor $, the only case that it is not equal is $(\lfloor x \rfloor +m)/n $and $(x+m)/n$ lies on different sides of an integer $k$, which means 

$$1 > k -(\lfloor x \rfloor + m ) / n > 0 $$ 

and 

$$ (x+m)/n - k > 0 $$ ......(1)

furthermore, $\lfloor x \rfloor + m $is integer, thus 

$$k - (\lfloor x \rfloor + m)/n \geq 1/n $$......(2)

from (1) and (2)

$(x+m)/n -k + k - (\lfloor x \rfloor + m)/n = (x- \lfloor x \rfloor)/n > 1/n$  which is impossible. so only equal relation is valid.