Tumgik
#Coding Tips
izicodes · 2 months
Text
【☆】 Coding Study Tips
Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media
Some study info + tips on cramming coding/programming concepts~!
252 notes · View notes
packetpixie · 5 months
Text
pro tip for programmers - how to alias
hey, so you know that annoying thing that happens when you're coding, and you need to run/test the same program 100 times in a row, so you end up typing "python3 testScriptWithASuperLongName.py" into the terminal about 80,000 times?
well, there's a better way! it's called aliasing :D
in your bash shell (or zsh, or whatever shell you use, but bash is the default on VSCode and most people on tumblr use VSCode, so I'm using bash as the default to explain this concept) you can set an alias, essentially a shortcut command, that runs longer commands.
(yes you can just use the up arrow key to re-run the same command, but sometimes you're typing other things into the terminal too and you don't feel like hitting the up arrow key four times in a row, and also this is just a cool and useful tip to get comfortable with aliasing so shhhh)
so, in your terminal shell, just type this:
alias run="python3 testScriptWithASuperLongName.py"
now, you can run that entire super long command, just by typing the word "run" into your terminal. Here's a screenshot of an example on my computer to make it make more sense:
Tumblr media
in this example, i just created a simple python file that contains one line of code: print("it works!")
then, as you can see, by setting the alias to run, i can now run that file, runningatestscript.py, simply with the command 'run'.
the best part is, this alias is temporary - it only lasts as long as your shell session is open. so once you close the terminal, the run alias is cleared and you can set it again next time to any file or task you're currently working on, to save yourself a lot of typing, typos, and time.
so if you want to, you can get in the habit of always setting a run alias in the VSCode terminal for whichever file you're working with as soon as you get everything open. that way, when you need to run the same file 50 million times, you have a super easy way of doing it! you can even set it to a single letter if you want to go for maximum speed, but i prefer to use whole short words, because they're easy for me to remember.
note: if you do want to set an alias to work for all sessions, you can simply add it to your ./bashrc file. this is a common way to automate repeatable tasks, and simply to set easier-to-remember commands for terminal commands that are really complicated/confusing/hard to remember.
for example, i saved the alias checkboot="[ -d /sys/firmware/efi ] && echo 'UEFI mode' || 'BIOS mode'" into my zshrc file (zsh equivalent of bashrc file). this way, no matter how many times i rebooted my machine, i would always be able to quickly check which boot mode was running by simply typing 'checkboot'.
yesterday i was updating my boot mode from BIOS to UEFI on my very old machine that is technically compatible with UEFI, but not configured for it by default. So it was extremely helpful and saved me the time and headache of having to remember and type that long-ass command a thousand times in between many different reboots and new shells.
if you have any tasks like that, or terminal commands that you know would be useful to you, but you can never remember them when you need them, i highly recommend getting comfortable with aliasing! it can be super useful to simply set custom aliases for all the commands you don't want to remember, so that you can automate things away and not have to worry about so much linux syntax all the time when you're tring to focus on programming.
i know this may seem like a simple tip to some, but i only learned about it recently and it's been extremely helpful to integrate into my workflow and customize my OS with! so i thought it might be worthwhile to some people if i share :) hope it helps!
86 notes · View notes
ramonag-if · 1 year
Note
hullo! um- this is my first time sending an ask so sorry if i just start rambling lmao. i really, really love your IF it’s amazing (also, irus has me straight up cackling at the worst times lol) <3
anyways, i love creative writing and stuff like that and i’ve only recently found IFs so i was curious about what it would be like to make one. i didn’t think it’d be that hard 🥲 it is a struggle. i’m still trying to figure out coding, then my laptop broke. so. yeah :)
anyways (i feel like i’m saying that too much…), i had two questions. sorry if you already answered them already -v-‘
how do you do the music? do you create it yourself or download it?
do you have any tips for coding? little nuggets for beginners or something?
thank you! i hope you have a nice day/night! :3c
Hi Anon 😊 There is no right way to send an ask, and the way you've asked is perfectly fine 🌼
Thank you so much for playing and I'm really happy to know that you're enjoying Irus 💖
Gosh, writing IF always seems easy at first then you start writing one and you think, crap, I was so wrong.
1. For music, I download it from Pixabay - the music is free and you can use it for commercial use as well - mix it, edit it etc and it's fine. What I've done is search through the different songs available and went for atmospheric music (rarely do they contain voices) and stuff that pertains to the story (a lot of the songs for Crown of Exile have Middle-Eastern or Indian themes).
2. As for little tips, I'm not nearly as experienced in coding as others - I only started in June last year to use Twine Sugarcube and I did dabble in Choicescript a few years before that 😅 But I'll try my best to help.
Choose the coding language that fits you best. There are a ton of different ways to code an IF game - I use Twine Sugarcube because it let me customise the way the game looks (and I've always wanted to learn how to use it).
Learn to code the basics. It's quite daunting to start off when you're new to coding (I didn't even know how to offer custom names to players or figure out why I kept getting errors when testing the game). If you're using Twine Sugarcube, i suggest this guide. It explains everything quite simply and it's what helped me a great deal when I started using Twine.
Do a test game - learning to code means actually using the code in a game. Start with small things - creating a link or stats and then testing them. It doesn't have to be fancy, but once you get the hang of basics, you quickly realise it's not nearly as hard as you think and you'll slowly build your confidence up to actually figuring out how to add music to your game 😅
Don't be afraid to ask for help. There's a ton of people online who are willing to help or have already put up guides. Also don't be afraid to do a search online for answers - the internet can save you hours of time because someone out there has already had the same question as you and it's been solved.
I hope this helps you and if you do have anything specific in mind you need help with, you can always ask 😊 I'll do my best to help.
32 notes · View notes
gthiah-if · 10 months
Note
How did ypu create the settings, saves, etc. Icon links? I'm very stumped on how to do that.
Heyy ~
It's just a stylised <<link>> macro. The icons are from Font Awesome (make sure you import the icons in your Javascript file) so you can directly use the icons in html on the StoryInterface passage or wherever your UI is. I'm using cerberus' template and I have a separate passage for the menu. You'd write it like this for example :
<<link '<i class="fa-solid fa-gear"></i>'>><<script>>UI.settings()<</script>><</link>>
You have to write your Html inside the single quote, inside the link macro. You can add multiple html tags and classes to style the links however you want in CSS. After closing the first <<link>>, you can write what script that button is supposed to trigger. You can use <<script>> for something like UI.settings() or UI.saves(). If you want, instead of a script, to have a link to another passage or a website, you can write it just like you would with a normal <<link>> :
<<link '<a href="https://gthiah-if.tumblr.com/" target="_blank"><i class="fa-brands fa-tumblr"></i>tumblr</a>'>><</link>> <<link '<i class="fa-solid fa-heart"></i>credits' 'credits'>><</link>>
Hope that's what you were asking about, if not or if you still have questions, let me know :^)
15 notes · View notes
the-pipistrelle · 1 year
Text
It is time! My tutorial has been live since this morning but i have finally crawled out of bed for coffee and am now functioning.
once again i am just so proud and excited to show this tutorial to you. it is based off of just one function i have built in my personal tarot bot named grimalkin. if this tutorial is any fun to you, let me know and i’ll write more on the other commands grimalkin-bot has!
thanks for all of your support. i will see you soon with a new one!
14 notes · View notes
brainlesstechnerd · 8 months
Text
Introduction: As a high school student in the 21st century, there's no denying the importance of computer science in today's world. Whether you're a seasoned programmer or just dipping your toes into the world of coding, the power of computer science is undeniable. In this blog, I'll share my journey as a 12th-grader venturing into the fascinating realms of C, C++, and Python, and how this journey has not only improved my computer science profile but also shaped my outlook on technology and problem-solving.
Chapter 1: The Foundations - Learning C
Learning C:
C, often referred to as the "mother of all programming languages," is where my journey began. Its simplicity and efficiency make it an excellent choice for beginners. As a high school student with limited programming experience, I decided to start with the basics.
Challenges and Triumphs:
Learning C came with its fair share of challenges, but it was incredibly rewarding. I tackled problems like understanding pointers and memory management, and I quickly realized that the core concepts of C would lay a strong foundation for my future endeavors in computer science.
Chapter 2: Building on the Basics - C++
Transition to C++:
With C under my belt, I transitioned to C++. C++ builds upon the concepts of C while introducing the object-oriented programming paradigm. It was a natural progression, and I found myself enjoying the flexibility and power it offered.
Projects and Applications:
I started working on small projects and applications in C++. From simple text-based games to data structures and algorithms implementations, C++ opened up a world of possibilities. It was during this phase that I began to see how the knowledge of programming languages could translate into tangible solutions.
Chapter 3: Python - The Versatile Language
Exploring Python:
Python is often praised for its simplicity and readability. As I delved into Python, I realized why it's a favorite among developers for a wide range of applications, from web development to machine learning.
Python in Real-Life Projects:
Python allowed me to take on real-life projects with ease. I built web applications using frameworks like Flask and Django, and I even dabbled in data analysis and machine learning. The versatility of Python broadened my horizons and showed me the real-world applications of computer science.
Chapter 4: A Glimpse into the Future
Continual Learning:
As I prepare to graduate high school and venture into higher education, my journey with C, C++, and Python has instilled in me the importance of continual learning. The field of computer science is dynamic, and staying up-to-date with the latest technologies and trends is crucial.
Networking and Collaboration:
I've also come to appreciate the significance of networking and collaboration in the computer science community. Joining online forums, participating in coding challenges, and collaborating on open-source projects have enriched my learning experience.
Conclusion: Embracing the World of Computer Science
My journey as a 12th-grader exploring C, C++, and Python has been an enlightening experience. These languages have not only improved my computer science profile but have also given me a broader perspective on problem-solving and technology. As I step into the future, I'm excited to see where this journey will take me, and I'm ready to embrace the ever-evolving world of computer science.
If you're a fellow student or someone curious about programming, I encourage you to take the plunge and start your own journey. With determination and a willingness to learn, the world of computer science is yours to explore and conquer.
2 notes · View notes
innovatehub-techtalk · 9 months
Text
Welcome to InnovateHub TechTalk: Unleashing the Tech Frontier
Greetings, fellow tech enthusiasts, and welcome to the inaugural edition of InnovateHub TechTalk! I am Lucas Redford, your guide on this thrilling expedition into the boundless realms of technology. With each keystroke and pixel, we'll embark on a journey to unravel the mysteries, embrace the innovations, and discuss the trends that shape our digital world.
Charting New Horizons:
In the age of rapid technological advancement, it's impossible to ignore the transformative impact that technology has on our lives. From the moment we wake up to the time we rest our heads, technology surrounds us, empowering, entertaining, and evolving at an unprecedented pace.
Our Quest:
At InnovateHub TechTalk, our mission is simple yet profound: to ignite your curiosity and keep you informed about the dynamic world of technology. Whether you're a seasoned coder, a budding entrepreneur, a digital artist, or just someone intrigued by the possibilities, this platform is your haven.
What Awaits You:
As we embark on this voyage together, here's a glimpse of what you can expect from InnovateHub TechTalk:
Innovative Spotlights: Venture into the heart of innovation as we showcase groundbreaking technologies and inventions that are reshaping industries and society.
Tech Chats with Experts: Join me in engaging conversations with thought leaders, industry experts, and visionaries who are shaping the course of technology.
CodeCraft Corner: Whether you're a coding novice or a seasoned pro, our CodeCraft Corner will be your source for coding tips, projects, and insights to elevate your programming prowess.
FutureTalk: Delve into the crystal ball as we discuss emerging trends, speculative tech, and the potential future landscapes that await us.
Be a Part of the Conversation:
InnovateHub TechTalk is not just a blog; it's a community. Your thoughts, questions, and insights are the catalysts that will drive our discussions forward. Don't hesitate to jump into the comment section, share your perspectives, and connect with fellow tech aficionados.
With great excitement, I invite you to journey with me through the digital maze, the electronic wonderland, and the data-driven universe that defines our age. Together, we'll decode complexities, celebrate achievements, and ponder the limitless possibilities that lie ahead.
As we dive into the sea of 1s and 0s, remember that innovation knows no bounds, and at InnovateHub TechTalk, we're poised to explore it all.
Welcome aboard, tech voyagers!
Lucas Redford
Founder and Chief Explorer, InnovateHub TechTalk
2 notes · View notes
cozymogai · 2 years
Text
fun fact: you can put links in your bios section on tumblr dot com! Just put this "<a href="url">link text<;/a>" (w/out quotations) into the bio under settings > edit blog
it'll look like this
Tumblr media
and it should show up on your blog! (also, yes, that's my age/petre blog lmao it's agenpetre)
the only downside to this is that if you wanna quickly edit your bio you'll HAVE to go through the settings > edit blog > change bio because it'll default back to plain txt if you don't!
edit: the "<br>" stands for break, and can break the text you put in the desc! it's not needed for this code, but it does make it look neater if needed!
6 notes · View notes
Text
anyone have any easy toyhouse HTMLs that match my overall aesthetic on here that I could use for my toyhouse? since my coding/HTML skills really suck.....
any help is appreciated!
4 notes · View notes
tutort-academy · 2 months
Text
Tumblr media
If you're looking to improve your competitive programming and data structures and algorithms (DSA) skills, here are some friendly tips to help you navigate the process effectively.
Tumblr media
Understand the Difference: DSA vs CP
When diving into competitive programming and DSA, it's important to recognize the distinction between the two:
- DSA: Focuses on solving real-world problems using programming concepts relevant to computer science. It involves finding suitable solutions for real-world scenarios and implementing them using code.
- Competitive Programming (CP): Often described as a "mind sport," CP involves competing with other coders to solve problems using programming, logic, and analytical skills within a limited time and memory. While DSA can help with real-world problem-solving and job readiness, CP hones problem-solving skills and critical thinking.
Set Your Goal
Define your ultimate goal behind engaging in competitive programming and DSA:
- If you aim to excel in programming interviews and enhance your development skills, focus on honing your problem-solving skills through platforms like LeetCode, GeeksForGeeks, and HackerRank.
- If you're keen on training your brain and improving problem-solving and critical thinking, consider diving into competitive programming to utilize various programming aspects to solve problems efficiently.
Start Gathering Information
Once you've decided on your path, take some time to gather essential resources, including books, roadmaps, YouTube playlists, websites, and advice from experienced individuals. Engaging with those who have prior experience can provide valuable guidance.
Clear Your Fundamentals
Before delving into problem-solving, ensure your fundamentals are solid. This includes:
- Language: Choose a language like C++, Java, or Python, as they are commonly allowed in interviews and can offer efficiency in competitive programming.
- Programming Fundamental*: Brush up on data types, functions, decision-making, and language-specific features to bolster your understanding and problem-solving capabilities.
- Mathematics: Familiarize yourself with concepts such as number theory, modulo arithmetic, prime numbers, and other mathematical principles relevant to problem-solving.
Start with Baby Steps
Take a gradual approach to problem-solving, understanding that it's a learning process. Embrace challenges and setbacks, and allow yourself time to grasp and solve problems effectively.
Document Your Progress
Maintain a record of your learning journey, including problems you've solved and the approaches used. This documentation can help identify patterns and improve your problem-solving strategies over time.
Don't Beat Yourself Up
Remember to take breaks and engage in activities outside of programming to avoid burnout. It's okay to encounter challenges; perseverance and learning from setbacks are central to growth in competitive programming and DSA.
By following these tips, you can embark on your competitive programming and DSA journey with a clearer understanding and a friendlier approach to learning and improvement.
Good luck!
0 notes
spwebdev · 3 months
Text
SpWebDevsBlogs
SpWebDevsBlogs :&quot;Discover valuable insights on web development from SpWebDevsBlogs. Stay updated with the latest trends and tips.&quot https://www.spwebdevsblogs.com/ #SPWebDevsBlogs
#Web Development
#SP Blogs
#Tech Articles
#Coding Tips
#Web Design
1 note · View note
izicodes · 7 months
Text
Tumblr media
This is what I keep saying!!!
Just build! 🙋🏾‍♀️
221 notes · View notes
crowcoding · 3 months
Text
HTML & CSS Comment Tips
One valuable thing I have learned when starting any project is to include comments on your pages to provide a more structured layout.
For example, in HTML files, comments can be made with <!-- --->; anything within that space won’t appear on the page or be read by the browser.
A good way to use this in a page is to outline your areas, like in the image below.
Tumblr media
Anywhere on your pages where you have a new section, you should use comments to outline what they are. This helps in a few ways. First, it increases readability for yourself and anyone else reading your code. Second, as your projects grow, doing this helps keep them organized. 
It’s easier to add to and edit when you can find the area where you want to make changes or add classes based on the comment tags rather than trying to narrow it down through many <div> tags. Third, it helps with remembering what you were doing.
The same principles apply to CSS files, although comments are left in a CSS file type with /*     */.
Tumblr media
Using comments to outline the different style groups you intend to use in your projects can help you find the parts you want to edit. In general, using comments is something everyone should do. They are very helpful in JavaScript and other languages when making notes about what a function does or should be doing. You can also leave yourself notes about what you were working on. 
1 note · View note
gthiah-if · 11 months
Note
I have a question about coding : how did you make the passage for the ritual where things are greyed out if you have already the item?
Hello nonny ~ It's a mix of if, else and hasVisited(). Basically, the passage with the greyed out options is called prologue.4save and every time you click on an option and get one of the items, you go back to the passage except now you've filled one of the if condition which is to have visited prologue.5save (where you get the chalice) for example.
Here's part of the code for the dagger, I removed the html class for the button's styling to make it a little less cluttered though the code is still messy haha;;; The stuff after '//' is an explanation of what the line of code does, let me know if you'd like a better explanation :^)
<<if not hasVisited("prologue.5save")>> //this means you won't see anything and the line will be empty if you haven't first visited the passage 5save where you get the chalice. <<else>> <<if hasVisited("prologue.3kill")>>You have the dagger. //if you went for the kill route beforehand and already got the knife in 3kill, it's greyed out <<elseif hasVisited("prologue.6save")>>You have the dagger. //if you went back to the passage prologue.4save after getting the dagger through the save route (ritual) in 6save, it's greyed out <<else>><<link>>'You remember the dagger used for the sacrifices, it should be in its box in another classroom.' 'prologue.6save'>><</link>> //if you didn't go for the kill route and haven't gotten the knife yet = after getting the chalice, you'll be able to click this link <</if>> <</if>>
One last thing about if statements : the order of your elseif statements matters. The program is read from top to bottom and as soon as it finds one condition to your if/elseif statement that reads as true, it will stop reading the rest of the if. So, for example :
On the relationships page, you'll get a special line indicating your friendship / love status for each character to get a general sense of how they feel about MC. There'll be a different line if your friendship is between 0 and 20, 20 and 40, 40 and 60 etc. I have to write the else if statement from highest friendship (greater than or equal to 90) to lowest (greater than or equal to 0).
If I wrote :
<<if $Mfriend gte 0>>They're distrustful of you <<elseif $Mfriend gte 20>>They're not sure what to think of you
Then you'd always only ever see the first statement since no matter if you have 5 friendship or 79 friendship with them, it'll always be greater than 0 and so the program will never bother reading anything else below that statement, and every elseif you write will be ignored. So you have to write it the other way :
<<if $Mfriend gte 20>>They're not sure what to think of you <<elseif $Mfriend gte 0>>They're distrustful of you
Now, it'll make a difference if you have friendship higher than 20 or higher than 0 but lower than 20.
I'm not great at explaining stuff haha but I hope that made sense, ask again if you want more precisions !
7 notes · View notes
digindeals · 6 months
Text
MacBook Air M1: Your Ultimate Laptop for Coding and Programming
The MacBook Air M1 stands as the top choice for coding and programming, offering a compelling blend of power, extended battery life, and portability. In this comprehensive guide, we'll explore how to maximize your MacBook Air M1 for programming. Additionally, we'll provide valuable laptop reviews to assist your decision-making process.
Setting Up Software: To make the most of programming on MacBook Air, you need to equip your device with essential tools and software. This includes renowned code editors like Visual Studio Code and compilers/interpreters such as GCC or Python. Don't forget to incorporate version control systems like Git, along with crucial debugging tools such as LLDB. Efficient terminal emulators like iTerm2 are also vital for establishing a robust development environment.
Choosing the Ideal IDE: Selecting the perfect Integrated Development Environment (IDE) is pivotal for enhancing productivity on your MacBook for coding. Opt for widely-used IDEs like Xcode, Visual Studio Code, and IntelliJ IDEA. Ensure your choice aligns with your preferred programming language—consider PyCharm for Python or CLion for C/C++. Equally vital is scrutinizing laptop specifications, with a special focus on the MacBook Air M1, to make an informed selection.
Leveraging the Power of the M1 Chip: When it comes to programming on MacBook Air, the M1 chip plays a pivotal role in delivering exceptional performance. Ensure that your software is always updated and optimized for the M1 chip to maximize its potential. When you compile code, don't forget to incorporate the -arch arm64 flag to unlock unparalleled performance.
Battery Life Advantages: One of the most remarkable features of the MacBook Air M1 is its exceptional battery life, enabling you to work on your coding projects without being tethered to a power source. Prolong your coding sessions by making simple adjustments, such as fine-tuning screen brightness, closing redundant applications, and leveraging the built-in power management features.
Additional Tips for an Enhanced Experience: Enhance your coding and programming experience on the MacBook Air by harnessing the versatility of the Terminal app for executing command line tasks. Boost your workflow with time-saving keyboard shortcuts, such as ⌘+C for copying and ⌘+V for pasting. Keep your projects well-organized by creating multiple desktops, seamlessly accessible through Mission Control. When searching for the best deals on laptops, explore various options that suit your needs. Additionally, laptop reviews provide valuable insights to ensure an informed decision.
The MacBook Air M1 is the ultimate laptop for coding and programming on MacBook. Capitalize on the best deals available to get the most value from your purchase. Utilize laptop reviews to make an informed decision when considering MacBook for coding. By following these comprehensive guidelines, you'll unlock the full potential of your MacBook Air M1, ensuring a seamless and highly efficient programming experience on MacBook.
0 notes
tradermade · 7 months
Text
Tumblr media
Would you like to learn how to fetch real-time exchange rates and perform conversions effortlessly? https://tradermade.com/tutorials/how-to-use-the-currency-conversion-api-with-php-python-r-c-golang-javascript-examples-on-our-website. Whether you're a developer or just curious about currency conversion, this tutorial will help you get started.
0 notes