Programming & CS
All posts in Programming & CS. Korean originals are linked until English translations are approved.
Programming, systems, algorithms, and computer science notes.
- Programming & CS pyimage1 doesn't exist error
Problem summary: When `AutoComplete.autocomplete()` is executed in `main.py`, the PostgreSQL connection displays a success message, but the actual data retrieval (`User.get_random_meme()`) does not work, or the GUI raises an error (`pyimage1 doesn't
- Programming & CS What is daemon?
In computing, a daemon is a program that runs as a background process, rather than being under the direct control of an interactive user.
- Programming & CS What is a POMDP?
POMDP
- Programming & CS Python getter → What Is __getitem__?
`__getitem__` is a method in Python that is called when an object is indexed (`obj[key]`) or sliced (`obj[start:stop]`). Defining this method inside a class allows instances of that class to be used like lists or dictionaries. 📌 Basic Usage 🎯 Key Features When `obj[key]` is called, `obj.__getitem__(key)` is called automatically....
- Programming & CS How to Map a Func to Elements of Multiple Nested Data Structures
Create nest_map https://dotiromoook.tistory.com/28
- Programming & CS Stack -> Finding the Minimum Value
Two arrays: stack and min_stack. The stack is implemented as is, while min_stack repeatedly assigns the minimum value to each index whenever the stack is updated. The stack is implemented using an Int index called top as a cursor. Odd-numbered indexes are stack, and even-numbered indexes are min_stack.
- Programming & CS Interpretation of Bayes' Theorem
This is the author's interpretation, so please point out any mistakes! Probability from a Bayesian perspective: a concept of predicting future 'possibilities,' that is, future uncertainty, based on existing evidence (clues that have already occurred, expressed as probabilities) and a hypothesis(). (Induction)\\-> Existing: regarding specific events
- Programming & CS Expected Value vs. Mean: Why Do LLM Papers Use Expected Value?
Expected value: a value calculated based on probabilities to predict the future; a prediction of possible future outcomes (induction—judgment predicting the future based on experience, observation, and evidence) Mean: a value calculated from existing data from a frequentist perspective; a definite value based on data that has already been observed (deduction—based on data that is already known
- Programming & CS What It Means for a Model to Learn
I only learned this recently, so please let me know if there are any errors. A series of processes for adjusting a model’s weight values. The model has learned the “method” of converting relationships among words or the meaning of sentences into vectors.
- Programming & CS Bayes' Theorem
Bayes' theorem is a law of probability used to infer the cause after an event has occurred. It is used in the process of updating a model's probability when new data is provided.
- Programming & CS If a Problem Only Tells You That A and B Are Dependent, Without Giving the Intersection Probability or Conditional Probability
Before the LLM era, I had questions in high school but could not formulate them clearly, so I ended up lost in a maze. What should I do if a problem does not provide the probability of an intersection or a conditional probability, and only tells me that A and B are dependent without directly giving a conditional probability?
- Programming & CS What is a class method? How do you access methods of a nested class from a nested class?
The reason for using a class method rather than an instance method when using methods in a nested class stems from the relationship between the nested class and the outer class and the differences in how instance methods and class methods work. A nested class (nested class) is an outer
- Programming & CS (NumPy Broadcasting) Why do the values come out strange when scoring in NumPy?
In structured data modeling, there was a very large difference between scoring the entire dataset and scoring by stratification when scoring. Calculation error. One shape is a pandas Series, and the other is a pandas DataFrame. The difference between a 2D array and a 1D
- Programming & CS Error When Validating GPT Analysis with a JSON Schema
Even when I define the JSON schema I want, GPT sometimes fails to extract it correctly. In this case, you can set the item of a property that is allowed to have a null value to ["string", "null"].
- Programming & CS ModuleNotFoundError: No module named 'modAL'
Unfair nonsense
Uninstall and reinstall
- Programming & CS Explaining OpenAI Async Processing: The GOAT
https://python.useinstructor.com/blog/2023/11/13/learn-async/
- Programming & CS Results Don't Come Out in Order in Async
The results of asynchronous processing come out all jumbled!!
- Programming & CS How Asynchronous Processing Works
How Asynchronous Processing Works
- Programming & CS OSError: [Errno 8] Exec format error: '/Users/naya/.wdm/drivers/chromedriver/mac64/127.0.6533.88/chromedriver-mac-arm64/THIRD_PARTY_NOTICES.chromedriver'\n
Chrome driver getting unfairly blamed
- Programming & CS What Is an Environment Variable?
A variable that maintains state in the background behind a running program. Since it is dynamic, it can be changed during execution.
- Programming & CS When You Shouldn't Use load_dotenv
When you need to load multiple API keys, they may get mixed up.
- Programming & CS Design Pattern in ML (Asynchronous pattern)
Reference 1\\. Reference for the GOAT ml design pattern summary: https://github.com/mercari/ml-system-design-pattern/blob/master/README_ko.md
- Programming & CS Reflections on a Semester of Surviving Linux
Linux Torvalds
- Programming & CS linux Survival D-12 (Docker Installation)
Docker, let’s go
- Programming & CS Linux Survival Log D-11 (Installing PyCharm)
Let's go, PyCharm
- Programming & CS Linux Survival Log D-8 (MongoDB Installation)
When I participated in an open-source RAG project, the database used for RAG was MongoDB. Since connecting to the database was not my task, I did not have the opportunity to do it myself, but after installing and using it directly on Linux during “Living with Linux for a Semester,” I came up with the idea that I would use it right away whenever I had an interesting project idea
- Programming & CS Linux Survival Log D-7 (Installing Slack)
Install Slack
- Programming & CS Linux Survival Log D-6 (Git Installation)
Version control, let's go
- Programming & CS linux Survival Log D-5 (Installing DVC (Data Version Control))
Data version control
- Programming & CS Linux Survival Log D-4 (Trying out a local LLM after installing Ollama)
Local LLM, let’s go
- Programming & CS Linux Survival Journal D-3 (PostgreSQL Installation)
I want to remotely access and control an unused laptop. Carrying both an unused laptop and the laptop I use is too heavy. To solve this, I’ll look into a real-time device called AnyDesk that allows access to another computer~
- Programming & CS Playing Around with unittest
Let’s go, TDD
- Programming & CS Linux Survival Log D-1 (Anaconda Installation)
I took another step toward creating a Python AI development environment. Very good.
- Programming & CS Linux Survival Log D-2 (VS Code Installation)
\n🍳 VS Code Installation Tutorial\nFirst, you need to import Microsoft's GPG key and add the repository.\n\nThe package lists need to be updated.\n\nInstall Visual Studio Code~\n\n🍳 Thoughts\nInstalling VS Code itself is not particularly difficult. De
- Programming & CS Linux Survival Log D-0 (Installing Ubuntu in WSL)
Cold Linux
- Programming & CS Object lifecycle (whether the destructor is called depends on the object's lifetime)
When the destructor is called and when it is not (keyword: object lifecycle)
- Programming & CS Those Ambiguous Pointers
A collection of ambiguous ones
- Programming & CS When you're frustrated because you still don't understand it after searching for the algorithm, don't fucking use a library
If you don't understand the principles behind an algorithm or are told not to use a library, just copy and paste the library itself! ex) Finding all combinations, matching them, and comparing them
- Programming & CS An Algorithm That Returns the Largest Element Among All Elements in a C++ vector
A useful algorithm – an algorithm that returns which element is the largest among all vector elements
- Programming & CS Algorithm for deleting C++ vector elements without the algorithm library
A neat piece of code for deleting vector elements without using the algorithm library
- Programming & CS Why the Heck Won’t Debugging Work!
I don’t know why this solves the problem, but this is the site I referred to. I think I still need to get more familiar with using VS Code. Ah, since I’m already using PyCharm, should I just use CLion too?
- Programming & CS The GOAT Recursive Algorithm: Euclid’s Algorithm
The sheer brilliance that Thanos-snaps away 30 minutes of head-scratching.......
- Programming & CS Setting up a Mac VS Code development environment
Development environments are always unfairly brutal.
- Programming & CS What is a YAML file?
It's a rule for exchanging files between systems, and YAML files are really tasty.
- Programming & CS An error that occurs when concatenating columns with the same names
[InvalidIndexError: Reindexing only valid with uniquely valued Index objects]
When an error like this occurs, the problem is that data with the same columns was concatenated. Alternatively, the error may have occurred because data sets with mismatched numbers of items were concatenated. A nice explanation
- Programming & CS What is config.py?
What is a configuration file?
- Programming & CS What are .env environment variables?
Defining and using environment variables
- Programming & CS Selectively Upload Files to GitHub
Create and use a .gitignore file.
- Programming & CS A Legendary Explanation of How to Protect a Branch
\bLegendary Explanation
- Programming & CS Legendary Explanation of Merge
Types of merge
- Programming & CS A new application of list comprehension
A new application
- Programming & CS Test code is damn important!
If you don't want to get smacked by Dr. Oh Eun-young, write your test code properly.
- Programming & CS Why does null appear even though I used concat?
Use reset_index~
- Programming & CS Easily combining pandas dataframes
Until then, I had only used the pd.concate method, but I discovered some mind-blowing code!
- Programming & CS Why do I keep getting a key error when using apply?
Set the axis, y'all.
- Programming & CS UUID
ㅠㅠID?
- Programming & CS Wrong Abstraction
Moderation
- Programming & CS What is a decorator (@)?
It literally means decorating a function; you can think of it as the concept of composite functions that we learned in mathematics. Decorators are used to implement additional functionality without modifying existing functions.
- Programming & CS What Is Abstraction?
Definition: Grouping common attributes and methods together and giving them a name is called abstraction.
- Programming & CS Retrying Functions with Tenacity
Using a Dormammu-style loop to retry when an error occurs
- Programming & CS Is there a function called by another function? (Callback Function)
Pikachu function, I choose you! Come out!
- Programming & CS The Unspoken Rules of Naming
Naming contest
- Programming & CS What Are Synchronous and Asynchronous?
Synchronous: Executing tasks one after another. → synchronous programming: developing programs so that multiple tasks are executed sequentially. Asynchronous: Executing tasks simultaneously rather than in sequence.
- Programming & CS list comprehension in functional style
Another use of list comprehensions
- Programming & CS When should you use static methods?
Static methods are mainly used when implementing utility methods.
- Programming & CS Calling a static method from a method of the same class or a different class
Use the class name.method name format for a static method.
- Programming & CS Hiding Methods or Property Names by Starting Them with _ to Make Them Private
Adding _ to a method or property prevents it from being called from outside (making it private).
- Programming & CS How to Redefine an Inherited Method for Each Dataset = Method Override
Method override: adapting an inherited method to suit the characteristics of a child class~
- Programming & CS Checking with a Boolean whether a specific value exists in a pandas DataFrame
Let's check whether a specific value exists in a pandas DataFrame using true or false.
- Programming & CS Trying out the useful and thaaankful groupby, agg methods
Grouping by a specific column
- Programming & CS How to merge row values based on duplicate values in a pandas DataFrame
Pandas is useful. To use useful tools, I guess you need to encounter situations where you have to deploy pandas in various situations. Thaaaank you, groupby method and agg method~
- Programming & CS What is random_state?
Shuffle using pandas' sample method and fix the results when running it multiple times
- Programming & CS How to Index DataFrames (loc, iloc, df[whatever])
Understanding pandas
- Programming & CS Let's Learn About Python's sample
I used sample because sampling is more efficient than randomly shuffling the data frame in this situation.
- Programming & CS Pandas: How to Drop Rows that Contain a Specific Value without drop() method and for loop?
Thanks a looooot, Pandas, for letting me avoid writing an algorithm—you little punk~ drop() the beat~
- Programming & CS Raising an Error with pytest.raise()
Answer me, Jarvis!!
- Programming & CS When Returning Multiple Values in Functional Programming with the `apply` Function
What happens if the function passed as the `apply` parameter in functional programming returns multiple values? -> Create a zip and unpack it!
- Programming & CS Creating multiple dataframes with apply
This is an article organizing the ideas I came to realize while thinking about how to write code that is Pythonic, readable, and efficient. I unpacked it with Zip.
- Programming & CS Flattening
Misuse of list comprehension
- Programming & CS apply function
You can make it more pandas-like by putting function logic inside the apply function.
- Programming & CS Loading a File with the OS
I really don't understand what this code means. I need to put a relative path in file_path—what should I do? Nice explanation
- Programming & CS Why are some parameters fine with just a variable, while others require you to always include a value with `=`? (Positional argument vs. keyword argument)
Why are there parameters that require a value to be provided and parameters that don't?
- Programming & CS Shallow Copy copy(), Deep Copy deepcopy()
Clone technique!
- Programming & CS Dictionary.pop(Key)
pop
- Programming & CS About the sorted() parameter key and lambda values
Lambor-lambda
- Programming & CS What is yield? (feat. generators)
To yield
- Programming & CS What is __init__.py?
Why isn't import working? / Why can't I call the class even though I created it? (TypeError: 'class' object is not callable)
- Programming & CS What are : and ->?
Let's become a permanent commenter, not a temporary one
- Programming & CS How to Use PyCharm with Mac
A MacBook is a Mac drum. This is a document meant to be used like an encyclopedia. Use command + F to find the feature you want~
- Programming & CS Mastering Classes
Let's figure out this fucking object-oriented stuff
- Programming & CS PyCharm error note (using fetch to pull changes from the GitHub website)
Conflict issue
- Programming & CS DOM Concepts
What is the DOM?
- Programming & CS Deploying a Goorm IDE Next.js Project to Vercel
A successful deployment forged through countless attempts and prayer over three months
- Programming & CS When git add doesn't work even though the file is perfectly fine
Try deleting the .git file and pushing again
- Programming & CS How to Merge
Fuuusion~~
- Programming & CS About add/push-commit/pull-fetch
Organizing the concepts
- Programming & CS goorm IDE GitHub Manual
On ending up back at square one because I didn't know how to use GitHub....
- Programming & CS Information Processing Craftsman Wrong-Answer Notes
Muyaho
- Programming & CS Error report: The following signatures could not be verified because the public key is not available in Goorm IDE
fucking error
- Programming & CS Error report: Goorm IDE "The following signature is invalid" issue
Not an easy one
- Programming & CS Git flow
Don't touch the main branch
- Programming & CS Error report: Be Careful of Typos
As expected, the awesome folks at Stack Overflow!!
- Programming & CS ErrorNote: error - TypeError: Cannot read properties of undefined (reading 'map') — Solution
The conclusion is that I’m a dummy~
- Programming & CS Error note: "Could not find database with ID: 4f7c1e96-8935-4cbb-bcbb-d2d8d392145d. Make sure the relevant pages and databases are shared with your integration."
An error when using the Notion API in Postman
- Programming & CS Error note: Invalid dom property ---. Did you mean ---?
Why className instead of class?
- Programming & CS Error note: Invalid <Link> with <a> child. Please remove <a> or use <Link legacyBehavior\n
Tag <link> error
- Programming & CS Error report: Expected corresponding JSX closing tag for <input>
An error that occurred while adding code to the footer file of Tailwind CSS's Tailblock
- Programming & CS GitHub Terminology Guide
GitHub
- Programming & CS Error report: Issue resolved—Tailwind CSS not being applied to Next.js on goorm IDE
5 days of trial and error
- Programming & CS Goorm IDE GitHub Integration
Five days of trial and error
- Programming & CS goorm IDE Next.js installation log
Next.js installation
- Programming & CS Cloud IDE Expo Installation
Linux errors, go... go away! (Anyone who can't install Expo, come on, come on~)
- Programming & CS What is Counter in collections?
Let's count the number of items in a dictionary
- Programming & CS What is enumerate()?
Want to extract the indices and elements from a list all at once?
- Programming & CS Regular Expressions: re
Let's analyze string patterns
- Programming & CS Python Class Terminology Summary
class villain terms
- Programming & CS Understandable IT Knowledge for Non-Majors
I don't know, I really don't know that kind of thing.
- Programming & CS The Zip Function, Variable Arguments (*/Variadic Arguments), and Keyword Arguments (**), Those Villainous Things
What on earth is *~~~~~
- Programming & CS Calculating Time Complexity
Efficiency Issues
- Programming & CS Top-Down vs Bottom-Up
"As Planned"