跳到主要內容

發表文章

目前顯示的是 2017的文章

[Python] For Loop for 9x9 Multiplication Table

 "Just Share and Record my learning track" #For loop to show 9 X 9 matrix i=1 j=1 for i in range(1,10,1): for j in range (1,10,1): print (i*j, end= " ") print() For Loop Example in One line     Check the following blog to know it. http://pythonnote.blogspot.tw/2010/01/blog-post.html

[Python] While Loop for 9x9 Multiplication Table

  "Just Share and Record my learning track" #While Loop to display 9 x 9 matrix # Example 1 with i, j variables i = 1 j = 1 while i <= 9: while j <= 9: print(i * j, end = " ") j += 1 i += 1 j = 1 print() # Example 2 with x, y variables x=1 y=1 while x<=9: while y<=9: print(x*y, end=' ') y+=1 x+=1 y=1 print() # Error IndentationError: unexpected indent #Example 2 failed because of print() alignment problem

MQTT Origin Purpose and Hands On Connect Raspberry Pi and iPhone

    "Top-down doesn't work", quoting from Arlen Nipper,  President and CTO of Cirrus Link, speaks at Advantech 2016 Industrial IoT World Partner Conference. Youtube Link The following MQTT Broker application structure is from GTWang Blogger . I think this structure delivers a clear spirit of MQTT that is M2M, Device to Device, Tag to Tag communication. It is a flat structure and just like Arlen said, Top-down doesn't work, because there is no master-slave or top-down relation in it. The Origin of MQTT     MQTT(Message Queuing Telemetry Transport) was invented by Andy Stanford-Clark (IBM) and Arlen Nipper (Arcom, now Cirrus Link) back in 1999, when they faced AT&T regulation issue and turned to VSAT(satellite communication) solution to get data and control oil pipeline system. However, they could not use the traditional way to poll devices thru satellites due to data cost expensive and propagation delay. MQTT Benefits - Do More With Less ...

Demo MongoDB function in Raspberry Pi 3 with Node Red

Free source is every where on the internet especially for Linux system. Today, I wants to share how to run MongoDB on Raspberry Pi 3 and then use Node Red to get data and send data back to the database we just created. By doing this, you can just spend little money on Raspberry Pi 3 hardware and then you could start your way to build a data collection site with the latest flow-based programming tool, Node Red. Prepare  1. Refer to the detail and great instruction already post by http://recipes.item.ntnu.no/using-node-red-mongodb-to-gather-and-publish-data-on-a-raspberry-pi/ 2. Use SSH to log in Raspberry Pi 3 and start Node Red 3. Enter URL to Node Red at port 1880 and start draw the flow MonogoDB 1. Drag MongoDB block and Assign the Server IP address and DB name 2. Assign the Collection and Define operation as "Insert" 3. After Deploy, Go to Node Red UI and Test the switch function 4. Use SSH command to enter mongoDB shell and "use myDB"...