As required by Database course, both software is expected to be installed on the laptop. Unfortunately, there are no mac versions for neither SQL Server 2019 nor SQL Server Management Studio (SSMS). So, here is the plan. I will not talk about details, please use Google.

  1. Register and get a free ‘Personal Use’ License for VMware Fusion
  2. Install VMware Fusion and activate it using the license
  3. Install Windows 10 on VMware Fusion
  4. Install SQL Server 2019
  5. Install SQL Server Management Studio (SSMS)

Register and get a free ‘Personal Use’ License for VMware Fusion

Go to VMware Fusion website and create a personal account
https://my.vmware.com/web/vmware/evalcenter?p=fusion-player-personal#tab_register

After your account is activated (email confirmed), login and you will see the license information and download packages link. Download it and install.

Install VMware Fusion and activate it using the license

In the previous step, you should have received your personal license for VMware Fusion. Just use it.

Install Windows 10 on VMware Fusion

Go to Microsoft website to download Windows 10 Disc Image (ISO File)
https://www.microsoft.com/en-ca/software-download/windows10

Select edition: Windows 10
Select product language: English

Then you will have the ISO file, go and install it (without a Product Key) on VMware Fusion. Don’t worry about Windows 10 activation (for now).

Install SQL Server 2019

Since you have Windows 10, the rest will be easy.

Download the express version of SQL Server 2019 and install. (Choose basic mode when you install it, so you don’t need to worry about the configurations.)
https://www.microsoft.com/en-ca/sql-server/sql-server-downloads

Install SQL Server Management Studio (SSMS)

Here is the link.
https://docs.microsoft.com/en-ca/sql/ssms/download-sql-server-management-studio-ssms

That’s it.

Update:

If you are a student, your school might offer free Product Keys for windows 10 Education version.
https://onthehub.com

Once you have the Product Key, activate your windows as you always do.

I am back.

“Let it be told to the future world…that in the depth of winter, when nothing but hope and virtue could survive… that the city and the country, alarmed at one common danger, came forth to meet [it].”

I am on the road to somewhere, hopefully we will get there.

It feels great when receiving the very first star on github for the open-source project I shared without any marketing.

Actually, I am surprised. Thank you no matter who you are.

Got promotion on Project Euler to Level 2. Yesterday, I tried to run some code on iOS Pythonista and actually answered 2 problems on the way home by taxi. It feels good when I can leverage the Python power to crack some code.

By the way, even after adding https to the src of the external link of 163 music, it still seems not working.

One nice module to find.

1
2
3
4
from fake_useragent import UserAgent
ua = UserAgent()
ua.random # this would be enough
ua.update() # once a while

Again, doc first.
https://docs.python.org/3.6/library/os.html

This module provides a portable way of using operating system dependent functionality. If you just want to read or write a file see open(), if you want to manipulate paths, see the os.path module, and if you want to read all the lines in all the files on the command line see the fileinput module. For creating temporary files and directories see the tempfile module, and for high-level file and directory handling see the shutil module.

1
2
3
4
5
6
7
8
import os.path
import time

print('File :', __file__)
print('Access time :', time.ctime(os.path.getatime(__file__)))
print('Modified time:', time.ctime(os.path.getmtime(__file__)))
print('Change time :', time.ctime(os.path.getctime(__file__)))
print('Size :', os.path.getsize(__file__))

1
pip3 install itchat

You could find its Github page:
https://github.com/littlecodersh/itchat
This module has a complete and graceful API for WeChat.

1
2
3
4
import itchat

#login on Mac terminal with white background
itchat.auto_login(enableCmdQR=-2)

itchat API could be found on its core.py
https://github.com/littlecodersh/ItChat/blob/master/itchat/core.py

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
def search_friends(self, name=None, userName=None,
remarkName=None, nickName=None, wechatAccount=None):
return self.storageClass.search_friends(name, userName,
remarkName, nickName, wechatAccount)

def search_chatrooms(self, name=None, userName=None):
return self.storageClass.search_chatrooms(name, userName)

def send_msg(self, msg='Test Message', toUserName=None):
''' send plain text message
for options
- msg: should be unicode if there's non-ascii words in msg
- toUserName: 'UserName' key of friend dict
it is defined in components/messages.py
'''
raise NotImplementedError()

# or you could use

def send(self, msg, toUserName=None, mediaId=None):
''' wrapped function for all the sending functions
for options
- msg: message starts with different string indicates different type
- list of type string: ['@fil@', '@img@', '@msg@', '@vid@']
- they are for file, image, plain text, video
- if none of them matches, it will be sent like plain text
- toUserName: 'UserName' key of friend dict
- mediaId: if set, uploading will not be repeated
it is defined in components/messages.py
'''
raise NotImplementedError()

For example, if you know the name of one particular chatroom is ‘abc’, then you could:

1
2
3
some_chatroom_username = itchat.search_chatrooms(name='abc')[0]['UserName']
# then you enter the chatroom to say hi
itchat.send('Hello everyone', some_chatroom_username)

I know there are blank pages for previous blogs. I know.

1
import argparse

Docs here:
https://docs.python.org/3/howto/argparse.html

The argparse module makes it easy to write user-friendly command-line interfaces. The program defines what arguments it requires, and argparse will figure out how to parse those out of sys.argv.

1
2
3
4
5
6
7
8
9
parser = argparse.ArgumentParser(description='Process some integers.')
parser.add_argument('integers', metavar='N', type=int, nargs='+',
help='an integer for the accumulator')
parser.add_argument('--sum', dest='accumulate', action='store_const',
const=sum, default=max,
help='sum the integers (default: find the max)')

args = parser.parse_args()
print(args.accumulate(args.integers))
0%