Languages & Syntax
Spoken and programming languages treated as the same kind of system: Python and Ruby syntax alongside Spanish and Italian cognate patterns.
-
Enumerables–A Cleaner Way to Iterate!!! [Ruby Programming Language Notes]
ENUMERABLES Enumerables–a cleaner way to iterate. Enumerable Methods–a way to quickly iterate thru an array or string array. array .each The ‘.each’ method takes in a {block-of-code} instead of (parameters). ‘.each’ passes on just the element. {block-of-code}–uses curly brackets{} to represent it. .each_with_index The ‘.each_with_index’ passes on the element, with the index, to the block of code. string .each_char .each_char.with_index Range enumerable–allows us to control where we start iterating & where we stop. (start..end).each iterate from start to end (inclusive!) (start…end).each iterate from start to end (excluding end!) A range can also be used on letters & other patterns, not just numbers!) Array Syntax for it: months = [ “Jan”,…
-
Ruby Programming Language Notes
General Notes: “Commands” are also called “functions” and “methods”. Functions do 3 things: They name pieces of code the way variables name strings and numbers. They take arguments the way your scripts take ‘ARGV’. Using steps 1 & 2, they let you make your own “mini-scripts” or “tiny commands”. *You can create a function by using the word ‘def’ in Ruby. ‘def’ means ‘define’. Functions (aka Commands aka Methods) To Remember: open –Opens the file close –Closes the file. Like “File –> Save…” in your editor. read –Reads the contents fo the file. You can assign the result to a variable. readline –Reads just one line of a text file.…
-
Notes: List of Terminal Commands
List of Terminal Commands: Note: These were for Windows but some commands work on Mac/Linux). pwd print working directory hostname my comuter’s network name mkdir make a new directory cd change directory forward cd.. change to previous directory (or ‘cd../../..‘ to go back 3 times, etc.) ls list storage (list directory) ls -l -long listing (gives more info with the ‘-l’ flag option) rm remove a file rmdir remove directory rm -rf<dir> to force remove, if needed. pushd push directory popd pop directory cp copy a file or directory robocopy robust copy mv move (rename) a file or directory more (or cat) page through a file type print the whole…
-
Computer Science (CompSci) Notes
Step 1–Define the problem to solve Step 2–Define a solution Step 3-Write a program that implements the solution Step 4-Compile the program Step 5-Link object files Step 6-Test program Step 7-Debug C++ (C plus plus) files should end in a “.cpp” extension to indicate a C++ source file. (ex: name.cpp) Use a C++ compiler to compile a C++ (.cpp) program. The C++ compiler sequentially goes through each source code (.cpp) file in your program and does 2 important tasks: FIRST, it checks the code to make sure it follows the rules of the C++ language. If it does not, the compiler will give you an error to help pinpoint what…
- Languages & Syntax, Life & Reflections, Mindset & Upskilling, Programming Languages, Technology, Vibes
Learning To Program Is Hard…
Learning to program is hard. Learning to program on your own is REALLY hard. In my journey, I’ve come across many different courses, books, videos and other seemingly endless ways of learning. Some more confusing than others. But by way of self-studying, while frustrating, I’ve also gained the confidence of accomplishment from learning on my own and knowing how to get the information I need. There are time’s I want to quit. Many times. Sometimes, just having the right learning materials and methods of instruction can make ALL the difference. I firmly believe this. Similar to what separates a good trainer from and bad trainer, or a good teacher from…
-
Vim–The Vi IMproved Text Editor
As happens SO MANY times when I am learning to program, I start off on one topic, and then, the journey quickly swerves into unchartered territory and I find myself in the deep reaches of the Google-verse searching up topics I didn’t even know existed or previously knew little to nothing about. It was during one such journey that I stumbled across Vim. Upon first learning about it, I quickly opened it up in my command line to see what it was, and then, just as quickly, I ended up hating it. As seems to be the norm for many a Vim newbie. But seeing that is was a lightweight…
-
Learning To Program Frustrations…
Sometimes I get so frustrated learning this programming. I find myself just seeming to go through the motions of reading and re-reading the material, analyzing each chapter over and over again. I follow the exercises, typing them in repetitively and seeming to just go through the motions. At points it feels like nothing is sinking in and that I’m not even recalling the previous lessons I’ve learned, which further adds to my frustration. It’s these lows that counter-balance and depress the highs that I receive when I actually get a concept and it seems to sink in.



