To handle DICOM images in the medical field, there are numerous tools available, both paid and free. Based on my experience, one of the free tools that offers considerable functionality is the DVTK toolkit. This toolkit comprises various individual tools, and in this article, I'll introduce three commonly used ones.
Mutable Object In JavaScript And How To Change From Mutable Object To Immutable Object
Data type in JavaScript has been analyze to 2 type Primitive and Reference. By default, reference data types are mutable including function, array, object..
1. What is Mutable in JavaScript?
Let's consider the following example:
let arr1 = [2, 3, 4];
let arr2 = arr1;
arr2[0] = "javascript";
console.log(arr1);
// ['javascript', 3, 4]
Variable arr1 has data type Array, variable arr2 is created from variable arr1. But when we change the value of variable arr2, variable arr1 is also changed. So, if a data type is mutable it will allow you to modify existing values without creating new values.
When the array or object is created, a pointer is added to the stack and this pointer points to a value on the Heap.
When we create the variable arr2, another pointer is added to the stack, but both point to the same object on the heap. When doing let arr2 = arr1; Reference data does not copy values on the heap, but only pointers on the stack.
2. How to copy values Object, Array are mutable?
The solution is to always create a reference for each new object when you want to clone an object. There are many ways to clone an Object, now I will only introduce the two ways that are considered the most practical: using the Object.assign() method and the rest operator (...).
Here's the syntax:
Object.assign(target, source)
The target: clone the source properties into the target and return the final result.
The source: is the place where the original drugs are stored.
Note: The target can be an empty object {}.
For example:
const obj1 = { name: "Java", age: 20 }
const obj2 = Object.assign({}, obj1);
obj2.age = 40;
console.log(obj1.age); // 20
console.log(obj2.age); // 40
The value of obj2.age has been converted to 40 and does not affect the value of obj1.
The rest operator (...) is quite simple to use, just add the sign ... in front of the name of the object to be copied.
For example:
const obj1 = { name: "Java", age: 20 }
const obj2 = { ...obj1};
obj2.age = 40;
console.log(obj1.age); // 20
console.log(obj2.age); // 40
3. How to create immutable Objects in JavaScript?
Normally Objects in javascript are mutable. However, you can also create immutable Objects. In this article, we will cover the usage of Object.defineProperty.
To create an immutable Object with Object.defineProperty, just define the property with writable as false (the default value of writable is false so you can ignore this).
Writing Cleaner CSS Code With The BEM Naming Convention
As we know, in most programming languages nowadays there are some common naming conventions, such as:
Camel Case (Ex: firstName and lastName)
Snake Case (Ex: first_name and last_name)
Kebab Case (Ex: first-name and last-name)
Pascal Case (Ex: FirstName and LastName)
So are there any naming rules in CSS?
We have BEM, so let's find out what BEM is in the next part of this post.
1. What is BEM?
The B in "BEM" stands for "Block".
The E in "BEM" stands for "Elements".
The M in "BEM" stands for "Modifiers".
BEM is a naming convention for HTML and CSS classes that helps developers create maintainable and organized code. It provides a structured format for naming the HTML and CSS classes (block, elements, and modifiers components)
2. Benefits of BEM
Class naming has never been an easy part of CSS. But by using the BEM naming convention, this challenge becomes easy.
Here are a few reasons for you to consider using the BEM:
Clarity
BEM makes cleaner CSS code and makes it easy to understand and maintain.
Reusability
When using the BEM, you will have a friendly structure that will not be confused with other CSS blocks. Thereby it makes reuse easier.
Developer-Friendly
Naming CSS classes is intuitive and easy to understand, helping developers easily understand the code and help each other during the repair or further development process.
Maintainability
BEM provides a clear structure for each block that facilitates changing a specific element of a website without affecting the style of other blocks. Thereby maintenance becomes easier and takes less time.
3. How It Works?
A BEM class name includes up to three parts:
Block
The outermost parent element of the component is defined as the block.
Element
Inside of the component may be one or more children called elements.
Modifier
Either a block or element may have a variation signified by a modifier.
If all three are used in a name it would look something like this:
[block]__[element]--[modifier]
After that brief introduction, let's look at some specific examples.
Example 1: Using the BEM naming convention to indicate [block]__[element]
The person has a head, two arms, and feet.
Using the BEM, it would look something like this:
In HTML code:
In CSS code:
In SCSS code (Recommend):
Through example 1, we learned how to use BEM to represent [Block]__[Element].
To fully demonstrate [Block]__[Element]--[Modifier], let's continue with example 2 below.
Example 2: Using the BEM naming convention to indicate [block]__[element]--[modifier]
There are two persons, person A has a blue head and person B has a red head.
Using the BEM, it would look something like this:
In HTML code:
In CSS code:
In SCSS code (Recommend):
Through the two examples above, we know how to use BEM in CSS.
Within the scope of this post, my purpose is to introduce BEM to you.
To better understand BEM, you can refer to some other post about it on the internet.
4. When should we use BEM?
Large-Scale Projects
When you have a project with a large code base, consists of multiple developers building different parts of the project. Without standard CSS class naming, you'll have a CSS mess. It's very bad when someone on the team changes or further develops someone else's code. That's when you and your team should use BEM, it makes it easier to maintain projects and reduces the risk of errors and code conflicts.
Accessibility-focused projects
When you need to develop a website that prioritizes user access and search engine optimization (SEO). With BEM, your plan will be easier to implement.
5. Conclusion
In this post, we have explored the BEM naming convention of CSS and how it can be used in a Web application. BEM helps build robust and performant applications of any design complexity with less code.
If you are not using BEM currently, I highly recommend it for your next project. BEM naming convention will be a great trend, helping to save time and effort.
Deploy a Flutter web app to Firebase hosting manually
Flutter is an open source framework by Google for building beautiful, natively compiled, multi-platform applications (Mobile, Web, Desktop) from a single codebase.
Firebase Hosting provides fast and secure hosting for your web app, static and dynamic content, and microservices. With a single command, you can quickly deploy web apps and serve both static and dynamic content to a global CDN (content delivery network).
In this blog post, I will show you how to deploy a Flutter web app to Firebase manually.
1. Create a Flutter web app (Skip this step if you have a Flutter web project already)
First, you need to download Flutter SDK to create your Flutter app. Go to Flutter’s Installation page and follow the instructions to install the Flutter framework. After you have installed the SDK, you can create your application.
Open your terminal and run the following command
flutter create web_example
This command will create a project inside the web_example folder.
We may run and debug our project in a Chrome browser by running the below command.
cd web_example flutter run -d chrome
2. Build Release a Flutter project for web
Open your terminal, navigate to project folder and run the following command
flutter build web
After building is completed, contents are contained in /build/web folder as below
3. Create a project on Firebase
From browser, go to Firebase console with your Google Account and create a project in 3 steps:
After the project is created, it will be as below
4. Initialize Firebase Hosting
If you haven't installed Firebase CLI, please follow the installation document to install it.
Run below command to log in Firebase
firebase login
Allow Firebase to collect CLI and Emulator Suite usage and error reporting information?
You can enter No or Yes.
A browser will be opened to link your Google Account.
Select "Allow" to Firebase CLI access your Google Account
Now your Google Account logged in Firebase successfully, you are able to start to initialize Firebase Hosting.
Run below commands:
firebase init hosting
Step by step, select options as below:
? Are you ready to proceed? --> Yes
? Please select an option: --> Use an existing project
? Select a default Firebase project for this directory: --> web-example-72287 (web-example)
? Detect an existing Flutter codebase in the current directory, should we use this? --> No
? Do you want to use a web framework? --> No
? What do you want to use as your public directory? --> build/web
? Configure as single-page app (rewrite all urls to /index.html)? --> Yes
? Setup automatic builds and deploys with Github? --> No
? File build/web/index.html already exists. Overwrite? --> No
5. Deploy to Firebase Hosting
Now, deploy the web app to Firebase Hosting by single command
firebase deploy
After deploy complete, we can check info of site in Firebase Hosting console
And here is the web-example site after being deployed to Firebase Hosting
Conclusion
Deploy a web app to Firebase Hosting is simple so it will reduce time and effort needed. Besides support manual deployment, Firebase Hosting also support automatic build and deploy with Github.
Firebase Hosting is a great choice to host your web application because it supports a lot of features besides basic hosting such as custom domains, HTTPS, and the scalability to handle huge amounts of traffic.
Some Reasons Why Manual Testing Cannot Be Completely Replaced By Automation Testing
Automation testing has many advantages and can greatly enhance the efficiency and effectiveness of software testing. It can help increase test coverage and improve overall testing accuracy. However, there are certain scenarios where manual testing still plays a crucial role and can’t be entirely replaced by automation. Here are a few factors to consider:
Usability Testing:
Usability testing focuses on understanding how users interact with the software and how easy it is to use. This type of testing is often based on the “look and feel” of the application, which automation testing can’t assess. While automation tools can interact with UI elements, human testers assess not only color, size and interaction between UI elements, but also position, inconsistencies in the UI, different screen resolutions and ensure that the UI meets the desired standards. Manual testing is especially useful for evaluating usability of an application, as human testers can provide valuable insights and observations about the user experience that automation may miss.
Exploratory Testing:
Exploratory testing is an important aspect of software testing. It involves unscripted and ad-hoc testing where testers rely on their knowledge, experience, and intuition to identify potential issues. It requires creativity, critical thinking, and the ability to adapt to changing circumstances. Human testers are better suited to perform exploratory testing as they can uncover unknown defects and assess the software's behavior in real-time, whereas automation performs predefined tests.
Short-term Projects:
Automation testing typically requires initial investment in developing test scripts, setting up test frameworks. It takes much time and cost. This is why automation test is suited for long-term and large-scale projects, whereas manual testing is suited for smaller, short-term project. Manual testing can be quickly set up and executed without the need for extensive test script development.
Automated Tests Can Contain Bugs/errors:
Automation tests are written using programming languages or scripting tools. Similar to any software, they can have errors in the code such as incorrect conditional statements or data comparisons. These errors can cause inaccurate test results, leading to false positives which can pose challenges for your team.
Adapting to Changes:
If there are frequent changes in the software requirements or if the test cases need to be updated frequently, manual testing allows testers to quickly modify their approach and test cases accordingly, whereas automation testing can have challenge keeping up with rapid changes because making changes to test scripts can be complicated.
Early-Stage Testing:
During the initial stages of development, when features are still developing and changing rapidly, manual testing is often preferred. Testers can provide early subjective feedback for improvement and help prevent late-stage bugs that are more costly to fix. Automated tests often require a stable environment, well-documented requirements, and a consistent user interface. In the early stages, these prerequisites may not be fully established.
In summary, automation testing cannot completely replace manual testing in all cases. A combination of both methods is ideal to achieve the best software quality. Testers can focus on exploratory testing, usability testing, and other areas where human judgment and creativity are essential, while automation can handle repetitive and predictable tests.
Pleasanter - A no-code/low-code development platform.
Have you ever wondered how can an accountant create a web application without programming? Is there any solution to replace Excel with a web application with the following criteria: quickly setup, stability, ease of use, Granular access control ?
Pleasanter is a no-code/low-code development platform (Opensource) that runs on .NET. It has developed by the Implem Inc Japan since 2014. You can quickly create business applications without programming.
Have you ever thought about using visual interfaces with normal level logic to develop applications that require little or no coding? Low-code model will be a great trend, helping to save time, effort and money.
If you have just known foreign languages (Japanese, English, etc.), you cannot become an IT Comtor.
First, you have to deal with IT Terms. IT Terms are difficult. I don't really understand.
By the time you memorize the words, they are already old, and many new words have appeared.
This impression is often associated with IT Terms.
Information Technology Passport Examination (IP) is a yardstick for measuring basic IT knowledge by asking a range of questions about information security, network, project management, business activities, management strategy, accounting, legal affairs, etc. →
So, have you ever wondered Why are IT Terms so difficult? Because:
They can be imaged like a huge store of words.
No one knows how many IT Terms there are in the world.
Just know that they were born and developed along with n number of
Programming Languages
Tools
Databases
Operating Systems
Application Frameworks
Cloud Technologies
Agile
DevOps
that exist in the current IT market.
They can be imaged like a parade of abbreviations.
To understand an IT term, you have to go through a complicated thought process each time, such as thinking of the official name and then thinking about the meaning of the term.
Most of them are conceptual and cannot be visualized.
This lack of direct connection to the image seems to contribute to people feeling that it is difficult to grasp.
The number of new IT terms increases constantly.
Before you know them, the number of IT terms you don't know is increasing.
New services being released into the world almost every day,
the fast pace of change in technology,
in combination with the complex and ever-evolving nature of IT systems,
can make it seem like an uphill battle to keep up.
There are a lot of IT terms that cannot be understood without prior knowledge.
When looking up an IT term, other IT terms are used to explain that term, so it's common to find that when you look up the meaning of an IT term you don't understand, the number of terms you don't understand increases.
Going deeply into researching related terms can make you lost, not knowing what you are researching. And the less IT knowledge a person has, the more research they have to do.
However, this is necessary for those who have little or no prior IT knowledge.
There are a lot of English alphabets and Katakana words.
There are a lot of IT terms including English letters / Katakana / both.
Ex:
SQL
IDaaS
アカウント
アド
IPアドレス
DATファイル
Even if Katakana is used to transcribe words borrowed from foreign languages such as English, the pronunciation of Katakana and the pronunciation of English are not the same.
Ex: Terms
English Pronunciation
Japanese Pronunciation
SQL
ɛsˌkjuˈɛɫ
エスキューエル(Esukyūeru)
IDaaS
ai di: ei ei ɛs
アイダース(Aidāsu)
アカウント
əˈkaʊnt
Akaunto
アド
ˈædvɝˌtaɪzɪŋ
Ado
IPアドレス
ai pi æˌdɹɛs
Aipīadoresu
DATファイル
Dæt fīl
Dattofairu
It is very difficult to read them fluently even after practicing again and again.
In addition, when meeting with the Japan side, there are definitely English words that you don't know how to pronounce in Japanese, so you pronounce them in English. Most Japanese people will not understand the words you say.
Or vice versa, there are English words that Japanese people say that you cannot figure out which English word they are, then it is very difficult for you to convey accurate information to Dev.
I think IT terms are not only an obstacle for IT Comtors, but also IT engineers certainly have times when they have headaches with IT terms. Because no one knows everything.
Lack of confidence when translating without understanding
I can't use an IT term until I understand it. Even if it is possible to translate without understanding, it makes me lack confidence and it can be frustrating.
For example, the preposition "で" (de) in Japanese has many meanings "in, at, by, due to, with..." so when translating into English, if you don't know what the word before "で" means, it's very difficult to translate correctly.
As example, "FTPでファイルを転送する。"
If I understand that FTP (File Transfer Protocol) is one of the communication protocols for transferring files between clients and servers on a computer network, I translate as below.
FTPでファイルを転送する。 → Send file by FTP.
If I don't understand what FTP is, I'm not confident enough to decide whether to use "in" or "by".
FTPでファイルを転送する。 → Send file in/by FTP.
So in this case, I have to let Dev (who understands what FTP is) select the appropriate preposition.
Summary
Going into IT field is a worthwhile journey but in order to succeed you must dare to challenge yourself because you will burn out quickly if there is no passion behind it. Nothing that’s worthwhile is ever easy.
No matter how much I lament it, it remains difficult. So let's find merit in difficult things. You should be able to study more positively that way. Try to memorize as many IT terms as possible.
Before you end up thinking that "I'm not good at the IT world" equals "IT is difficult", please try to think of ways to deal with it.
I'm sure the day will come when IT terms that you don't understand at all will become a part of your daily life!
The year 2023 is a year of AI explosion in general, and GPT chat in particular. Recent times have seen significant global attention towards ChatGPT due to breakthroughs in artificial intelligence. In this article, I will introduce ChatGPT and analyze the Benefits and Harms for the IT field.
The article is a personal perspective and serves as a reference.
1. What is ChatGPT?
I asked the above question on CHATGPT and here is the answer:
"ChatGPT is a language model developed by OpenAI, based on the GPT (Generative Pre-trained Transformer) architecture. It is designed to generate human-like text based on the input it receives. ChatGPT is trained on a diverse range of text from the internet, allowing it to understand and generate text in a coherent and contextually relevant manner."
We can be easily understood as ChatGPT is a chatbot from OpenAI. As a user, you can ask questions or make requests in the form of prompts, and ChatGPT will respond.
Resource: beebom.com
Being acclaimed as the most intelligent artificial intelligence in the world, it has thus unlocked opportunities and challenges across various fields and industries.
2. Benefits
Code Assistance
ChatGPT can help developers by offering suggestions, code snippets, and solutions to programming challenges. This enhances productivity and supports rapid development. Besides, ChatGPT can analyze and explain the source code, and even optimize the source code. This is of great help to programmers. Especially juniors who have little experience.
Innovation and Idea Generation
ChatGPT can brainstorm with IT teams, offering fresh ideas for projects, feature improvements, and creative problem-solving.
True to the meaning of 'Assistant'. Chat GPT can suggest new perspectives, breakthroughs, and creative new directions.
Multi-Language
ChatGPT is a revolution in natural language processing, allowing for a more sophisticated approach to chatbots and other language-based applications.
So, ChatGPT can facilitate localization efforts by translating software interfaces, content, and user communication in various languages.
3. Risks
Misinformation
As you know, Chat GPT is based on data to generate results. Without sufficient data, Chat GPT may not function effectively.
Particularly, ChatGPT's data has been trained up until 2021, so for information beyond 2021, the system has not been updated.
ChatGPT might generate incorrect or biased information, which can spread misinformation if not monitored and corrected.
There is a significant difference between Google and ChatGPT.
Google's search engine can provide numerous search results, allowing users to choose the most suitable option.
ChatGPT, on the other hand, is a different story. It provides only a single result, which might be the best possible, but that doesn't necessarily mean it's suitable for you.
Dependency
Excessive reliance on ChatGPT might hinder the development of critical thinking and research skills.
When excessively reliant on it, humans might experience a decline in their inherent cognitive abilities.
Instead of using it as a tool for creativity, some individuals lazily copy entire text from it for documentation purposes.
This is indeed lamentable and inadvertently contributes to reducing the intellectual capacity of users.
Security
As you know, ChatGPT learns from user questions. Therefore, if the source code is imported into ChatGPT, there is a risk of data leakage.
Many projects are confidential, and revealing a part of the source code can also have serious consequences.
However, many programmers, especially the younger ones, might not yet be aware of this.
Resource: unica
Conclusion
Above are opinions about the benefits and harms of chatGPT. ChatGPT is a good tool, However, Don't be too dependent on ChatGPT. Use it wisely to enhance productivity and the quality of your work.
At ISB Vietnam, we are always open to exploring new partnership opportunities.
If you're seeking a reliable, long-term partner who values collaboration and shared growth, we'd be happy to connect and discuss how we can work together.