The Ruby map method is a simple but powerful tool in any Ruby developer’s arsenal. The map method is used when you need to transform data, and can be used on arrays, hases, and ranges. If you have one of the aforementioned data structures and need to alter each item in the collection in the same manner, then map is the method to use.
The Rails console is a very powerful and very important tool when working with the Ruby on Rails framework. The console is bbuilt upon IRB and funcitons much in the same way. Within the console you can perform many different actions which can be helpful for troubleshooting, testing out ideas, or even changing data directly in your database without having to use your Rails app at large. When testing ideas, the Rails console can be launched using the --sandbox
flag. This enables you to test code without actually changing any data.
Gosu is a popular 2D game development library for Ruby (also available for C++). Gosu has support for Windows, Mac OS, and Linux. This would lead one to believe that it will be compatible with the Windows Substyem for Linux, or WSL. If you are unfamiliar with WSL, I would suggest reading the previous link, but at a high level it enables the use of a GNU/Linux environment directly within Windows itself. However, after installing the Gosu gem, and setting up a basic project that would create the game window, users will run into error(s) including:
What’s something that every software engineer will inevitably come across in their career? Learning a new programming language. Maybe it will be because you want to increase the number of jobs you’re eligible for. Or maybe it will be because you’ve been transferred to a new team, or your current team is introducing something new to your tech stack. Perhaps you just want to learn another language for yourself, or you saw an interesting framework you want to try out but it’s in a language you’re not familiar with. Whatever the reason is, when the time comes, it will be easier if you have a directed approach to learning the language.
Need to find the length of an object in Python? Meet your new friend, the len()
function. The official Python documentation’s definition of len()
is: