Python is by far one of my favorite programming languages. Actually, I think it is my favorite language because of its versatility. It can be used anywhere and for anything. Lets go through some basic tools you need for a quick lesson in Python: 1. Some Syntax and Basic Rules
A simple snippet of code with conditional statements in Python
2. Mathematical Operations
Mathematical Operations in Python
See how easy that was! I love how useful and convenient the built-in functions are in Python, and honestly learning the basic syntax is very fun and easy!
0 Comments
What are IP addresses? and what are they used for? If you type in "ipconfig" on your command prompt in Windows, you can see your current IPv4 address of your device. But how does all of this work? Every device on a network has a certain unique address or identifier. This address is used to send data to other computers in a network, and is known as an IP address (Internet Protocol). There are two different standards for IP addresses: IPv4 and IPv6. The IPv6 format is a newer system, and many computers are also starting to use the IPv6 format as well. The main difference between these two standards is that the IPv4 address uses 32 bits to represent a unique address and IPv6 uses 128 bits to represent a unique address on the network. IPv4 Address The IPv4 address is represented by 4 numbers (that are 8 bit binary) so anything between 0.0.0.0 to 255.255.255.255. Although, there are some address that are meant for other purposes in the IP networks. For example, the 0.0.0.0 address represents an unknown target or a default network. 255.255.255.255 address is a broadcast address; it sends a broadcast packet to all of the computers in a particular network. The address 127.0.0.1 is called the loopback address so that the computer knows how to identify itself, regardless of having an IP address. Computer Networking Now that we know more about IP addresses, lets talk about the Networking Basics! Computers were connected to each other to form a network using a cable called Ethernet. Ethernet can transport lots of data. In order to successfully build a good network, people used network hubs. A network hub is where the Ethernet cables from every computer are connected to a device (hub). So, if computer 1 wants to send a message to another computer, it first has to send it to the hub (through the Ethernet cable), and then the hub sends it to all the other connected computers. This way may not be too efficient and may slow things down if 2 or 3 of these computers were sending messages at the same time. To make this efficient, these networks uses switches to send messages to the intended computer. So if Computer 1 wants to send a message only to Computer 4, the switch will be enabled so that the message doesn't unnecessarily reach the other computers in the network, and only Computer 4.
However, if a message needs to be sent to a device in another network, a router will need to be used. A router is essentially a networking device that can transfer data between networks, and it facilitates the exchange of data packets via the Internet. When a data packet comes from a data line (that the router is connected to), the router reads the address of the packet and determines where its destination is. It then directs the packet to the next network to reach the destination. The Computer History Museum located in Mountain View, California, aka where most of the tech giants are nearby, was an incredible experience for me since I got a glimpse of the major progressions of computers. From the biggest IBM computers, to the smallest micro chips, computers have gone through a huge transition in order to be a useful asset. Our first stop was at the IBM 1401 Processing Unit, which is essentially a computer processing unit used a loooong time ago. The IBM computer had several separate huge components, such as the processor, the printer, and memory storage. The IBM 1403 printer takes in a specific input from the memory storage and the processor, and prints out the desired message. The memory storage consists of punch cards which are essentially cards that are punched in a specific pattern to translate to a message. However, many people thought that the cards were too much of a tedious task, and plus if they make a single mistake in punching into the wrong place, they would have to repeat the whole pattern onto another card. Therefore, tapes were being used as an alternative. Each section on the tape would store many bits, which was much more convenient compared to the punch cards. In order for the information processed by the IBM 1401 to reach the printer, the processor and printer was connected by a huge, thick wire. And I am not joking. The wire was very thick. Our second stop was the software side of things, which was super interesting because it was definitely one of the things we, as individuals living in the 21st century, can relate to. One of the signs I really liked there was the 'intro to software' sign, which talked about how amazing the play between hardware and software is. We then headed off to the telephone station where they displayed the transition of phones from a while ago in the 1980s-90s time period. I even asked my parents to see whether they remembered seeing these phones, and they told me that they had a clear memory of using these phones and how different they where from our now smart phones with touch screens. Next, we went to a crash car simulator, which uses computerized technology to simulate car crashes to get to know more about the damages in the car, and how it can be prevented in the real world. I had to take a picture with one of the dummies that was used as the driver in the car. We then saw a cool connection between the tech world and medicine by learning the development of the MRI machine, and how it scans someone's body with extreme detail. We also learned a lot about the revolution of self driving cars, and how it is soon going to be implemented in the real roads. Most of the car crashes/accidents happen because of human error, so the development of self driving cars is an excellent way to combat the the increasing rate of road crashes. Our third and last stop was the best one ever. We visited one of the oldest galleries ever, with over a 1000 artifacts represented the first 2000 years of computing. Obviously, we couldn't read every single exhibit, especially since we only had an hour left till the museum closes. But it was insane. It was unbelievable to see how computing ruled the world thousands of years ago. There were 19 galleries to visit in the exhibit, and I would say we probably only read about 5-6 galleries and understood them in depth. We just walked through the rest of the galleries since we were in a time crunch and had to go through the whole museum. So a suggestion from me would be to come back another day because the pass for the museum is good for 7 days. Or come to the museum really early, like as soon as it opens. But anyways, one of the first developments was the calculator. This gallery was probably one of my favorites. I have plenty of more to write and talk about this amazing place, but I don't want to ruin it for you. Go for yourself, and visit this museum. It is soooo fun walking through the exhibits and learning about the revolutions of these tools that we continue to use today. Good luck!
Artificial Intelligence has its own way of impressing us with its potential and wonders. It is an incredibly growing field and will definitely have an immense effect on our lives. In my opinion, automating manual labor and work sounds like an amazing idea; people wouldn't need to bother about whether there is going to be traffic in their route to work, or you wouldn't have to review through spelling/grammar errors in your lengthly research paper for English. AI does it all for you. Which is what makes this field sooooo interesting. And amazing.
However, when something comes with this many advantages, there is always critical side to it as well. There are many people who say that AI will take over the world and "replace" human jobs, which will lead to laying off many people in the workplace. A lot of people assume that AI will eventually replace human intelligence. Whenever I hear that, I always wonder about when the "eventually" will come. AI has just started to grow out recently, and there is something we, as humans have that machines don't know anything about. That is, emotion and psychological intelligence. Yes, maybe in about 10-20 years from now, humans won't be needed for manual labor in factories, but machines don't understand emotion. That is something we have and we can use to overpower the domination of machines. However, that is a long way from now. Like I said, AI has just started to grow out. We need such automation in our lives to make simple jobs in our lives easier. For example, Google uses location enabling to find the fastest route to work when you're a couple minutes late because you slept in (that's me for school). In fact, Google has also implemented apps to enable smart message reply, which will automatically suggest replies based on the email in your inbox. Your essay reader, TurnItIn goes through to check for plagiarism. These examples demonstrate the expanding growth of AI around the world. Good luck! ahh..game design!! One of my favorites. As some of you guys may know, I am currently working on a game project for my game design class. If you want to see the GDP for my project, just scroll down some blogs, or just click here. My game design consists of a spatial setting, and I have coded some small parts of it, including importing images, making the title screen of the game and of course, the transition into the actual game. I have started working on it, and I have the beginner code for it so far. I used BlueJ as my IDE (integrated development environment). So, let me show you how I organized my code through different classes. So far, I have a simple home page (aka a title screen) for my game. Some objects are moving to provide a 'space object'. This is how the whole feel looks like. So first I have the text laid out clearly, and then I transition into the next screen by asking the user to press the up arrow. To be honest though, I think I should change it to space key, so that its more convenient. Have you ever seen a game which asks you to press the 'up' arrow? Not so sure about that lol. I am still trying to make the mini shaped rocket you see in the bottom actually move around in the whole screen, to provide that effect. I will be adding asteroids and comets as well. And of course, I still have to change the boring font I have at the top! This is a glimpse of my code for the movement and pressing the key:
I really want this game to be a success, and adding more features and enhancements into my program will be a great experience ahead! I'll keep on updating you guys with the status, but until then, I'll see ya somewhere in my math blogs! Good luck!
A matrix is basically an 'array of arrays' in Java. Matrixes can be used to store data in a more of an efficient way while coding. In order to declare a matrix object, you would write: The 2 in the first bracket represents the number of rows and the 3 represents the number of columns. So what does this matrix represent? Lets first initialize arbitrary values in this matrix: By initializing this matrix, we have created this matrix (like the image above). There are three rows and three columns, and the numbers which are chosen are displayed in their specific locations as well. So if we would want to access one of these locations/number, we would simply display it: So this statement would display the number 9. We can use matrixes to store multiple things, such as names, student's GPAs, or even age. But, what if we wrote a statement like this: This statement would indicate an error, an out of bounds error since there is no column 3 in the matrix. That column doesn't exist. I hope you were able to learn some things about matrixes, and hopefully you're planning to use them in your code soon! Good luck!
Currently, I am on a project of building a game baed on space which is a survival game using Java based on space where the character has tools to tackle the obstacles that show up. In this game, there will multiple subsystems to enhance the experience of the player. I learnt a lot about the developments of a game, and I wanted to share my game development document with ya'll: Good luck,
I wanted to take on a project that seemed to be pretty cool - building a financial advisor for people using the Java language. Java is my favorite coding language by far, and I wanted to see if I can successfully complete this task. So let me show you my attempted program for accurately advising someone what to do with their money. The "Advise" ClassThe Advise class here is the main class. Now, what exactly is the main class you ask? The main class combines all the other classes to obtain the inputs and calculate the financial status of the person based on the inputs. So, first, I ask a question that is the whole purpose of this project, "are you spending the right way?" After I prompt the user, I start out with salary, and then initialize the variable 'salary' and print the statement out for them. I then carry out the getSpent method which gets the amount you spend from the getSpent class. Then, I carry out the credit card balance class to get the estimated balance. I then implement the 'if' and 'else' statements here for the user to find out whether they are spending well enough. |
Step 4Finally, as we approach the end, if pirate A was also on board, it would have to gain 3 people including himself to stay on the ship. Therefore, it will propose 1 coin to the pirates who will get none if A weren't there and 0 to B and D. A will get 98 coins, and it will still get at least 50% of the vote. |
Good luck,
My views on Computer Science and Engineering + Why do I want to become a computer science engineer?
7/2/2017
Computer Science is something that opens up many possibilities and solutions that can bring change to our world one step at a time. That's what I thought of computer science in general. When I started to code or got 'exposed' to coding, I was about 15 years old, which is actually only a year ago since the day of this blog. I first got exposed to segments of code in an online course my parents enrolled for me. It was a course in Python, and when I started to follow along, I really enjoyed the simplicity of writing lines of code to accomplish a task. Simple. And I liked simple. As I kept on progressing through the course, I remember there would be certain problems that were challenging and hard to create a program for. But, I'll tell you what. I LOVED that idea of a challenge. It helped me plan out in my head what parts I am missing in my program, and what parts I should add to help it function better.
This experience gave me a better understanding of computer science and the idea of SOLVING and UNDERSTANDING problems, and arriving at a SOLUTION. These three words describe the experience of any STEM related career, especially a career in computer science and engineering. I really liked to find solutions to problems via coding. There are many stereotypes to engineering/computer science, one especially being that 'all computer professionals only code'. Engineers are problem solvers, they just USE a certain technology to find solutions to problems. It's not just the idea of coding or writing 1000 lines of code every day. It's about WHAT IMPACT that program will bring to the world. And HOW it's going to do it. That's the main idea.
Good luck!
This experience gave me a better understanding of computer science and the idea of SOLVING and UNDERSTANDING problems, and arriving at a SOLUTION. These three words describe the experience of any STEM related career, especially a career in computer science and engineering. I really liked to find solutions to problems via coding. There are many stereotypes to engineering/computer science, one especially being that 'all computer professionals only code'. Engineers are problem solvers, they just USE a certain technology to find solutions to problems. It's not just the idea of coding or writing 1000 lines of code every day. It's about WHAT IMPACT that program will bring to the world. And HOW it's going to do it. That's the main idea.
Good luck!
Archives
March 2021
June 2020
April 2020
February 2020
December 2019
September 2019
August 2019
May 2019
April 2019
March 2019
July 2018
March 2018
February 2018
November 2017
September 2017
August 2017
July 2017
Topics
All
Artificial Intelligence And Machine Learning
#buildwithRushi
Careers In Computing
C/C++
Circuits
Cloud Computing
Computational Problems
Computer Hardware
Computer Networking
Data Structures
Electricity
Java
My Projects
Python
#randomaccessmememory
Systems