본문 바로가기

전체 글344

[JavaScript] Control Flow Statements Conditional Statements if ... else statement JS's if/else statement is similar to other programming languages. if (conditions_1) { statements_1 } else if (conditions_2) { statements_2 } else { statements_last } If the conditions_1 is true, the statements_1 is executed, and if the conditions_1 is false and conditions_2 is true, the statements_2 is executed. Lastly, all conditions are false, the s.. 2022. 6. 22.
[JavaScript] Operators The operators of JS are not much different from other languages. Assignment Operators Assignment: = Addition assignment: += Subtraction assignment: -= Exponentiation assignment: **= Multiplication assignment: *= Division assignment: /= Remainder assignment: %= Left shift assignment: = Unsigned right shift assignment: >>>= Bitwise AND assignment: &= Bitwise XOR assignment: ^= Bitwise OR assignmen.. 2022. 6. 21.
[JavaScript] Data Types JS is a dynamic typing language, i.e. the data type of a variable is inferred by its value. In other words, variables don't have a type, but values have a type. JS has several primitive data types and an object type. However, I will explain it from the point of the developer. If a data types are not a primitive type, it is an object type. All primitive types are immutable. Let's find out about t.. 2022. 6. 19.
[JavaScript] Variable There are two types of variables in JS. One is a mutable type and the other is an immutable type. And, we use var, let, and const keywords for defining a variable. Mutable Variable We use the var and let keyword for defining mutable variables. In the past, we used var, but now, we usually use let because var has issues like scope and hoisting. let mutable_var = 'I am a mutable variable.'; consol.. 2022. 6. 18.
[Python] Using PostgreSQL In this posting, we will check out how to use PostgreSQL with Python on MAC. Installation We can simply install PostgreSQL using Homebrew. $ brew install postgresql Then, the default DB named postgres is initialized. You can restart the service at any time with the below command. This is the official guide. https://www.postgresqltutorial.com/postgresql-getting-started/install-postgresql-macos/ h.. 2022. 5. 19.
[Python] Using Telegram Bot API Let's make a telegram chatbot using Python. Creating ChatBot Let's assume that you are using Telegram. If you add BotFather, you can see it below. If you scroll the menu, you can see the all available commands. Let's select the "Create a new bot" menu (/newbot command). Now, give the name of the bot and username. Then, the telegram will give you the API key. The token looks like this. 123456:ABC.. 2022. 5. 13.
[Python] Usage of .env .env file is commonly used for configuration. Python also has 3rd party library for this. Installation It can be installed by pip. $ pip install python-dotenv Create .env File .env file consists of key-value pair. # .env TEST=test TEST_URL=${TEST}.com You can expand the config using ${} syntax. TEST1="test string" TEST2="Test\nString" You can use a value as multiple lines using escape characters.. 2022. 4. 23.
[Flutter] Animation Animation makes applications look more gorgeous. AnimatedContainer Widget Flutter provides an AnimatedContainer widget for easy use of animation. Let's take a look at the full code first. import 'package:flutter/material.dart'; import 'dart:math'; void main() { runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @override Widget build(BuildCo.. 2022. 4. 3.
[Flutter] File Handling In this posting, we will learn about file handling. path_provider Package This package supports getting commonly used locations on the filesystem. It supports Android, iOS, Linux, macOS, and Windows, but not all methods are supported on all platforms. Refer to the below page for the detailed supported list. https://pub.dev/packages/path_provider Usage Directory tempDir = await getTemporaryDirect.. 2022. 4. 2.