Exercise 08

Exercise 08

Exercise08
Computers have become truly 1 incredible .We are walking around with supercomputers in our pocket. How amazing is that?So it is disappointing that the way we use computers,the way we interact with them, hasn't really changed in the last 50 years.We still use a mouse and 2 keyboards

We're clicking on screens and buttons.Mobile phones are the same. We're just using fingers instead of a mouse.So is that it? Is that what the future looks like?We're going to be stuck in the screens with our faces not seeing the world around us?That's not the future I imagine, or the future I'm attracted to.What I've been always interested in is things, physical things we use every day,like things on this table that the family doesn't pay attention to.Things tell our story. They tell who we are. They tell a lot about us. Let me give you an example.These are photographs of things a person touched during 24 hours.What can you tell about him? He loves his motorcycle. Right?The biggest thing in his picture. What can you tell about this girl?She spends all her time on the beach. There's a surfboard. She lives by the sea.What can you tell about this guy? He's a chef.Look at all the ingredients he touched during the day, while he was preparing the food,and the computer is a tiny part of his life, this sad thing in the corner.So if we are using things all the time, and this is a big part of our lives,can things become the way for us to interact with our digital life?Can the world become your interface? That was my idea. I've been working for 20 years on it.My idea is that in order to interact in digital life, you don't need to have
3 screens and keyboards and mouses.You can interact with your digital life just by using the things you use every day.And to realize this idea, I need to solve three big 4 challenges . Let me tell you about them.The first one, obviously: Is it even possible?How can you take an everyday thing you use every day and turn it into a computer 5 interface ? Now I was inspired by the book "Hackers."I read it when I was a teenager, and one of the essential ideas of this book is thatyou can change the purpose of things by inventing new 6 technology and then hacking into things and changing them.So I've been thinking what kind of technology I can invent so that I can hack into things you use every day and make them interactive.So when I was working on this thing,I invented this 7 sensor which injects structured electric fields into objects and turns them into gesture interfaces.So this doorknob, unmodified, can become a gesture sensor.It can know how you're touching it. It can feel how you're touching it.It makes a circle, or can I grasp. And this doorknob isn't modified.There's nothing special about doorknobs. Anything can become interactive. What about plants?So plants are interesting, because with plants, they can know where you're touching.You can see the line moving up and down on the image. And that can turn into a musical interface.Now, we do have also practical 8 applications : a calendar plant for those who are obsessed about practicality.We can give things a personality.So in this particular example, the orchid can communicate to you through images and sounds.It doesn't like to be touched, so it's created these electric images that are hissing at you.This plant, for example, is more robust, it's a snake plant, and it likes playing with you.It engages you. So every thing can be different, and every thing can represent what it feels.So everything can be 9 hacked , all the things, including your body.In this example, we hacked your body so you can measure how you're folding your hands and then using your hand gestures to control something else,so if you don't want to listen to some music thousands of times, you simply can cover your ears to turn it off.So everything can be hacked, and research is important,but the second challenge we have is how can we go from R and D, and prototypes, to real products?How can we make real things that are also interfaces?And you may ask yourself, who would do this? Silicon Valley? Is it through Shenzhen?Now the challenge there is that the world of things is huge.Every year, the apparel industry produces 150 billion garments.In comparison, the technology industry only makes 1.4 billion phones.The world of things is much bigger than the world of technology.The technology world cannot change the world of things.Instead, we need to create technology which changes makers of things,people who make your chairs and clothes and everything else, into makers of smart things, enable them to do that.So to test this challenge, we came up with a very simple idea and challenge: Can a tailor make a 10 wearable ?Now we don't want to take a tailor and turn the tailor into an electrical engineer.We still want to have some tailors around.But what we would like to do is create technologywhich looks, feels and behaves like a raw material used by the tailor to make their clothes.For example, a touch panel made for a tailor would look like this,made out of textiles, so you can cut it with scissors and sew it in.At the same time, it has to retain the performance.The way to make this textile touch panel also requires a very different
approach than for making consumer electronics.In our case, we have to go to the mountains of Tokyo to a small factory which was making kimono garments for generations.We worked with my collaborators, who were not engineers.It was an artisan who knows how to make things and an artist who knows how to make things beautiful.

点击查看【youtube】

"sgmediation.zip" 是一个包含 UCLA(加利福尼亚大学洛杉矶分校)开发的 sgmediation 插件的压缩包。该插件专为统计分析软件 Stata 设计,用于进行中介效应分析。在社会科学、心理学、市场营销等领域,中介效应分析是一种关键的统计方法,它帮助研究人员探究变量之间的因果关系,尤其是中间变量如何影响因变量与自变量之间的关系。Stata 是一款广泛使用的统计分析软件,具备众多命令和用户编写的程序来拓展其功能,sgmediation 插件便是其中之一。它能让用户在 Stata 中轻松开展中介效应分析,无需编写复杂代码。 下载并解压 "sgmediation.zip" 后,需将解压得到的 "sgmediation" 文件移至 Stata 的 ado 目录结构中。ado(ado 目录并非“adolescent data organization”缩写,而是 Stata 的自定义命令存放目录)目录是 Stata 存放自定义命令的地方,应将文件放置于 "ado\base\s" 子目录下。这样,Stata 启动时会自动加载该目录下的所有 ado 文件,使 "sgmediation" 命令在 Stata 命令行中可用。 使用 sgmediation 插件的步骤如下:1. 安装插件:将解压后的 "sgmediation" 文件放入 Stata 的 ado 目录。如果 Stata 安装路径是 C:\Program Files\Stata\ado\base,则需将文件复制到 C:\Program Files\Stata\ado\base\s。2. 启动 Stata:打开 Stata,确保软件已更新至最新版本,以便识别新添加的 ado 文件。3. 加载插件:启动 Stata 后,在命令行输入 ado update sgmediation,以确保插件已加载并更新至最新版本。4
### Exercise 3C: Different IPv4 #### Problem Statement Given an IPv4 address in dot-decimal notation, your task is to output both its binary and hexadecimal representations. #### Input A single line containing an IPv4 address in dot-decimal notation. #### Output Two lines in total: - The first line should be the binary representation of the given address (8 digits for each byte). - The second line should be the hexadecimal representation of the given address (2 digits for each byte). #### Sample Input ``` 192.0.2.1 ``` #### Sample Output ``` 11000000.00000000.00000010.00000001 c0.00.02.01 ``` #### Solution ```c #include <stdio.h> #include <string.h> #include <stdlib.h> // Function to convert decimal IPv4 to binary format void dec2bin(char decAddress[], char binAddress[]) { char *token = strtok(decAddress, "."); int i = 0; while (token != NULL) { int num = atoi(token); char temp[9]; sprintf(temp, "%08d", num); for (int j = 0; j < 8; j++) { binAddress[i++] = ((num >> (7 - j)) & 1) ? '1' : '0'; } token = strtok(NULL, "."); if (token != NULL) { binAddress[i++] = '.'; } } binAddress[i] = '\0'; } // Function to convert decimal IPv4 to hexadecimal format void dec2hex(char decAddress[], char hexAddress[]) { char *token = strtok(decAddress, "."); int i = 0; while (token != NULL) { int num = atoi(token); char temp[3]; sprintf(temp, "%02X", num); strcat(hexAddress, temp); token = strtok(NULL, "."); if (token != NULL) { hexAddress[i++] = '.'; } } hexAddress[i] = '\0'; } int main() { char decAddress[20], binAddress[50], hexAddress[20]; // Read the IPv4 address from input fgets(decAddress, sizeof(decAddress), stdin); decAddress[strcspn(decAddress, "\n")] = 0; // Remove newline character // Convert decimal IPv4 address to binary and hexadecimal formats dec2bin(decAddress, binAddress); dec2hex(decAddress, hexAddress); // Output the results puts(binAddress); puts(hexAddress); return 0; } ``` #### Explanation 1. **dec2bin Function**: - Tokenizes the input IPv4 address by splitting it at each dot. - Converts each octet to an 8-bit binary string. - Concatenates the binary strings with dots in between. 2. **dec2hex Function**: - Tokenizes the input IPv4 address by splitting it at each dot. - Converts each octet to a 2-digit hexadecimal string. - Concatenates the hexadecimal strings with dots in between. 3. **main Function**: - Reads the IPv4 address from the input. - Calls `dec2bin` and `dec2hex` to convert the address to binary and hexadecimal formats. - Prints the results. This solution ensures that the binary and hexadecimal representations are correctly formatted and meet the requirements of the problem statement.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

qing影

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值