Sidenote_21.06.24

Koowoy
references: File sprintf Task and Solution Code From a damaged (or deleted) card data, recover original jpeg images. [details] My Solution #include <stdio.h>#include <stdlib.h>#include <stdint.h> typedef uint8_t BYTE; int main(int argc, char *argv[]) { // Check if parameter validity if (argc != 2) { printf("Usage: ./recover image\n"); return 1; } // Open input file char *infile = argv[1]; FILE *inptr = fopen(infile, "r"); if (inptr == NULL) { fprintf(stderr, "Could not open %s.

Index and Search (2021 Kakao Blind Recruitment)

Koowoy
Task https://programmers.co.kr/learn/courses/30/lessons/72412; My Solution referenced from: https://velog.io/@alvin/%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%98%EB%A8%B8%EC%8A%A4-%EB%AC%B8%EC%A0%9C%ED%92%80%EC%9D%B4-%EC%88%9C%EC%9C%84-%EA%B2%80%EC%83%89-Javascript https://12bme.tistory.com/120 function solution(info, query) { let answer = []; // store every possible combination that every info can match to let combinations = {}; const getCombinations = (arr, score, init) => { let spec = arr.join(''); let value = combinations[spec]; // add score to combination object if (value) { combinations[spec].push(score); } else { combinations[spec] = [score]; } // recursive function, to loop through every possibility for (let i = init; i < arr.

TIL of the Past: 20-10-01

Koowoy
For the Summer Vacation, I have decided to regularly upload the TILs I wrote last year on Notion onto the blog, for recap and archiving purposes. 20.10.01 JS - Advanced Arrays and Objects / ES 7, 8, 10 The lessons for today were so wide spread, starting with the advanced functions and new features of ES5 and ES6, but these were rather similar to the one’s that I have done last month.

TIL - CS50x Week 5 Data Structure

Koowoy
Until this lesson, the term “data structure” reminded me only of the “data types” that variables can have. But I learned that data structure rather referred to how multiple data is stored and accessed in different methods. Array Though I’ve used arrays in so many different languages, since there were a lot of simplification applied to the arrays in Javascript and Python, I only came to know of the restrictions that arrays have.

Setting up Github Profile

Koowoy
After a long break from mending my Github, I returned and started with setting up my github profile. Basics In order to set up the profile page add various personal details on the profile page, a new repository is needed, with the name set up as github username. (for instance, in my case, my id is uk960214, therefore I created a repository with the name “uk960214”) The readme.md file on this repository will be shown in the profile page.

[JS/Problem Solving] Getting the highest possible number

Koowoy
Task Requirements A number between 0 and 1,000,000 and k that is smaller than the first number is given. When k amount of digit is removed, return the highest possible number. My Attemps for Solution No.1) Using Combination On first thought, I wasn’t aware of how big the number could be, and came up with the idea to find all possiblities and to compare these to find the maximum value.

[Sidenote/JS] Using Recursion to Get All Possible Combinations

Koowoy
The definition of combination in mathematics is as follows: In mathematics, a combination is a selection of items from a collection, such that the order of selection does not matter. (from Wikipedia) In order to get all the possible selections, the following formula is used: image-source The first part refers to all the combination that includes a certain value, and the latter part refers to all the combinations that does not include that value.

Enlightenment of the Day 21.02.13

Koowoy
Handling Edge Cases in Image Filtering / Understanding Rounding of Floats in C 1. Handling Edge Cases in Image Filtering Problem Using C, create a program that apllies different filters on images. Each pixel is stored in a two dimensional array. Obsctacle When filtering the image with ‘blur’ and ‘border’ filter, for each pixel in the image, certain values of all surrounding pixels needs to be reached. However, the number of surrounding pixels vary depending on the location of the pixel, more precisely, depending on whether the pixel is in the corner, edge or the middle.

[Javascript Regex] Recommending Alternative ID

Koowoy
Task Requirements The Rules for the ID Length of the ID must be 3 to 15 characters. Only alphanumeric(lowercase) characters and [ -] , [ _ ], [ . ] are allowed. [ . ] can not be used at the beginning and the end, and cannot be used consecutively. Seven Steps in Creating Recommended ID Step 1. Change all the uppercase letters to lowercase.

Identifying the Loser from a Game of Word Chain

Koowoy
Rule of the Game Certain number of players present a word in turns, that begins with the letter of the last word’s ending. For instance, if the last word was apple, the current player needs to present a word that starts with e. No word can be presented twice in the same game. Therefore the loser is a. whose word presented didn't begin with the last word's ending(let's call this following the previous word) or b.