You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You are building a small part of this iOS application that needs to implement a simple key-value type of cache. In Swift, you will need to implement a cache class with the functions add, get, and size.
The add function takes two parameters, a key and value and adds the pair to the local cache. When an item is added to the cache, this function should return the string "added" and if the item already existed in the cache, this function should return the string "overwritten"
The get function attempts to retrieve an item from the cache based on the key parameter passed in. If the item exists in the cache, return the value, otherwise return the string "miss"
The size function simply returns the number of items in the cache.
Your goal is to implement the cache class so the function calls in the main method work properly. The output of your program should be a final string with the function outputs separated by a space.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
We provided some simple React template code. Your goal is to build a weather dashboard application that lets users search for current weather conditions in different cities.
When the app loads, it should display a search bar where users can type in a city's name. Once the city name is entered (case-sensitive) and the user hits the "Search" button, the app should fetch and display the current temperature, humidity, and wind speed for the chosen city. For simplicity, you don't have to make actual API calls; instead, use the predefined data to mimic the weather data for a few cities.
Additionally, all previously searched cities should be listed below the search bar as buttons. When a user clicks on a previously searched city, its weather data should be displayed again.
Ensure the application handles scenarios where the city is not in your mock data by displaying a message: "City not found." You are free to add classes and styles, but make sure you leave the component ID's and classes pr
In a shell environment, the current working directory is the directory 'you' are currently in. Unless specified by an absolute path all file references are made relevant to the current working directory. In short, the current working directory is the first place programs will look.
A CPU, is made of billions of transistors. Little tiny switches that turn on and off. This clever device can be given instructions in the form of binary code. The CPU is the command center. It sets the bits. But if you know its language, you can become the CPUs master.
Each switch is called a bit. The on represents a 1, and the off represents 0. By combining these 1's and 0's together we can create numbers, or bytes. 8 bits to a byte. 256 different combinations from 00000000 to 11111111.
A 64 bit CPU can read 64 of them all at one time.
100111010101110110011001100110010101111110000000011100110110110.
A binary is another term for a process. So, on POSIX systems, the term is used as a directory name. This naming convention lets others know that this is where to find the executable binary code.
Shebang
Not all binaries are actually binary. Some of them are scripts. Written in Python, Bash, or JavaScript. They are not yet compiled into the raw binary instructions fed into the CPU. These programs rely on an 'interpreter'. The interpreter makes the conversion at runtime. As the process runs the script is parsed and converted into binary code.
Sometimes called a command prompt or terminal.app, the shell is an interface to the kernel. A shell can be a GUI (Graphical User Interface), but for the purposes of this guide the shell will only refer to a command line shell. I use a standard POSIX shell.
Windows users, checkout WSL. Also, Visual Studio Code is a great tool for Windows, Mac, and Linux users. Just hit Ctrl+` to open a shell.
Packages are a neat way for coders to quickly extend their project's capabilities. At its core, Python is a programming langauge like any other. It does not have an HTTP server, AI training modules, or even the data analysis tools that Python is known for. These all come from packages.
Python packages are hosted on PyPi.org. PyPI is an open source project developed under the umbrella of the Python Packaging Authority (PyPA) and supported by the Python Packaging Working Group.
Popular Packages
Here are just a few packages that you can download into your Python Environment.