teleren/devto huggingface dataset:
Writing Typescript unit tests with ArchiTest
Tags: typescript, test, oop, news
Published: 2024-02-17 12:06:38

Have you ever wrote unit tests for your code and struggled on the "what" to test in your code?
Have you ever wondered why you have to learn new terms and concepts to write tests?
Have you ever thought that writing tests should not be that hard and counterintuitive?

If you responded positively to one of those, your have to try _"ArchiTest"_, a new way to write test.

## What is it?
**ArchiTest** is an set of principles that breaks down the testing practices as we know it. It's objective is to use Object Oriented Programing basic principles to:
- Ease the tests writing
- To improve your coding skills

It is mainly based on four principles:
- _"No new terms"_: you don't have to learn vocabularies like "describe", "it", "expect", "mock", .... Let's use already available terms in our programming language
- _"Class and method as unit of test"_: Let's use OOP correctly and test behaviors of our classes and objects, not some procedures or functions.
- _"Inheritance as mocking system"_: Let's use inheritance to override dependencies or external coupling of our code
- _"Test transparency"_: Let's not worry about, side-effects and complex test expectations _(notNull, isTruthy, isNotEqual, haveProperty, and other shenanigans)_. Your code will be better!

## Implementation
For now, a **Typescript** implementation of those principles is available. We are working on bringing more languages supports in the future. Your help is very welcome 

## Quickly try it
Take a look and try **ArchiTest** for **Typescript**. I promise it will take you less than five minutes.

### Install
In your typescript project, install the package

```bash
npm install -D @archikoder/architest
```

### Configure
In your package.json file, add a script to launch your test with the command "architest"

```json
   "scripts": {
       "test": "architest",
       ...
   }
```
### Test
Choose a class to test. For example, if you have a class like this:

```typescript
export class User{
    private firstname: string;
    private lastname: string;

    constructor(firstname: string, lastname: string){
        this.firstname = firstname;
        this.lastname = lastname;
    }

    public printName(): string{
        return firstname + " " + lastname;
    }
}
```

In the same file, import the test decorator and you can write your test class like this:

```typescript
import { test } from "@archikoder/architest"; 
...
export class WilliamShakespeare extends User{
    constructor(){
        super("William", "Shakespeare");
    }

    @test 
    public printName(): string{
         return "William Shakespeare";
    }
}
```

Run the test

```bash
npm run test
```

See the magic happen!
SQLtest.online - the site where you can test your SQL skills
Published: 2024-02-17 12:00:35

Hello friends! I'll tell you about my new project - [SQLTest.online](https://SQLTest.online). This is a platform for those who are learning SQL and want to test their skills by solving practical problems.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3w7envmj2gmrrsnjyd3p.png)

The using of the site is very simple - select a problem from the list on the left and try to solve it! So far there are more then 220 questions on MySQL, several questions on Firebird. For tests, public databases Sakila (MySQL), Bookings (PostgreSQL) and Employee (Firebird) are used. In the future, I plan to expand both the list of available databases and the number of questions for each of them.

The table structure of the database relevant for each task is displayed on the right side of the screen and helps you in solving.

If you are at a loss with a solution, you can use the hint or run a query and see the result. Validation of a solution is performed in two stages: a basic check using regular expressions and then checking the result against the correct solution.

If you are interested in the project and decide to pass all the tests, you can log in to the site. Login is currently available via Google, Yandex and GitHub. When you log in to the site, no personal information is collected, only data about your progress in solving problems. However, even without registration, you get access to all functions of the site without restrictions!

So, Happy testing with [SQLTest.online](https://SQLTest.online)

If you find problems on the site, write about them below in the comments to the article.
Pink Diamond Catering
Published: 2024-02-17 11:54:22

At Pink Diamond Catering  we have an inspirational team with a passion for food, an eye for style and attention to detail.With over 30 years experience catering in homes, marquees and prestigious venues in and around London, we are devoted to supplying both corporate and private clients with an event to remember.
[Wedding breakfast](https://www.pinkdiamondcatering.co.uk/)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/im3xpoqs9zkx6txiudfj.png)
Can you have variables in a GitHub README file?🤔
Tags: variables, github, readme, markdown
Published: 2024-02-17 11:44:42

I wanted to change how my Github profile looks so I changed the contents of my profile's README.md file. I am sure you know how to do that. 😜👍.

While checking for the best tips for changing the look of my profile. I checked Forrestknight's GitHub profile (https://github.com/ForrestKnight/ForrestKnight) and saw something that caught my attention on his profile. It was a system of adding variables, especially regarding the link section. [Reddit time 🤣]

It is not really a variable system but a way to give links a name and use the link name. One cool thing about this is that you can use these variables before defining them.[Most C developers Would die to have that feature🤣😭]

I also found a useful link that gave so many insights about this behavior, and I recommend you check it. (https://www.markdownguide.org/basic-syntax/#reference-style-links).

TL;DR 🤔

> Reference-style links are a special kind of link that make URLs easier to display and read in Markdown.

This kind of variable system is usually referred to as Reference-style links and they allow for easy reading of the markdown and remove redundancy by ensuring that you can reuse a link without having to type it more than once. The exact way variable works in programming[except that you can change the value and format it🤣. Let's call it a dumb variable].

They usually have two parts: The part stored inline and the part where the links are referenced. I have only used it for social media links and don't really know much about advancing and automating this process. I hope you can improve this experience though.

You can check out my profile (https://github.com/fasakinhenry) for a demo of how this works. To be specific, check the (https://github.com/fasakinhenry/fasakinhenry) repository to know how this works.

Thanks to ForrestKnight for making me aware of this feature. You can also check out his profile (https://github.com/ForrestKnight/ForrestKnight).

Wait don't go yet, Engage with this by commenting and making suggestions. Also help me by linking or clapping as they say🤣 if this post helps you a lot and you like my writing style.
ログ出力時にLogcatからコードにジャンプ出来るようにしておくと便利かもしれない
Published: 2024-02-17 11:43:35

`ファイル名:行数` を出力すると、Android StudioのLogcatからジャンプすることが可能です。

Timberライブラリを使った、コード例を示します。

```kotlin
Timber.d("message (MediaStoreUtils.kt:125)")
```

これを実行すると、次のようにLogcatに出力されます。

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/47ycfuh7m0hvkqxjehkz.png)

Android Studioの、Logcatのファイル名の部分がリンク形式になっていることが分かります。
これをクリックすると、コードにジャンプすることが出来ます。

また、このコードのように都度 `ファイル名:行数` を書いてもいいのですが、次のように関数にまとめることも出来ます。

```kotlin
fun logd(message: String) {
  if (!BuildConfig.DEBUG) return
  val stackTrace = Thread.currentThread().getStackTrace()[3]
  Timber.d("$message (${stackTrace.fileName}:${stackTrace.lineNumber})")
}
```

Timber.DebugTreeを使っているのであれば、DebugTreeを拡張しても動きます。
`val newMessage` のあたりをプロジェクトに合わせて修正して下さい。 

```kotlin
Timber.plant(object : Timber.DebugTree() {
  private val fqcnIgnore = listOf(
    Timber::class.java.name,
    Timber.Forest::class.java.name,
    Timber.Tree::class.java.name,
    Timber.DebugTree::class.java.name,
  )

  private val stackTrace: StackTraceElement
    get() = Throwable().stackTrace
      .filter { it.className !in fqcnIgnore }[2]

  override fun log(priority: Int, tag: String?, message: String, t: Throwable?) {
    val newMessage = if (priority == Log.DEBUG) {
      val stackTrace = stackTrace
      "$message (${stackTrace.fileName}:${stackTrace.lineNumber})"
    } else {
      message
    }
    super.log(priority, tag, newMessage, t)
  }
})
```

このログどこで出力しているんだっけ、ってなることが多い場合には検討してみて下さい🐱
Introducing Kumar City: A Township by Kumar Properties
Published: 2024-02-17 11:40:15

Welcome to [Kumar City](https://www.kumarcitymanjri.co.in/), a sprawling township project by Kumar Properties located in the serene locale of Manjri, Pune. This prelaunch endeavor offers a diverse range of 2 & 3 BHK apartments along with plots, promising a holistic living experience for its residents.

Project Overview:

Type: Township
Project Stage: Prelaunch
Location: Manjri, Pune
Builder: Kumar Properties
Floor Plans: 2 & 3 BHK Apartments & Plots
Price: Rs. 69.9 Lacs* Onwards
Total Land Area: 140 Acres
Total Units: 234
Size Range: 700 - 1050 Sq Ft
Approvals: NA
RERA No: NA
Launch Date: 2023
Completion Date: 5 years from launch
Possession Date: Dec 2028
Location Highlights:
Nestled in Manjri, Pune, Kumar City enjoys a tranquil ambiance while being conveniently connected to key areas of the city. With easy access to major highways and close proximity to essential amenities, this township ensures a seamless blend of comfort and convenience.

Amenities:
Kumar City boasts an array of amenities catering to every aspect of modern living:

Landscaped Gardens
Clubhouse
Gymnasium
Children's Play Area
Jogging Track
Multi-purpose Hall
24/7 Security
Design and Architecture:
With meticulous planning and attention to detail, Kumar City offers meticulously crafted homes and plots designed to maximize space utilization and comfort. Experience the epitome of contemporary living amidst lush green surroundings and thoughtful architecture.

Price and Payment Plans:
Starting at Rs. 69.9 Lacs*, Kumar City offers competitive pricing and flexible payment plans to suit every budget. Get in touch with our sales team for more details and special offers.

Book Your Dream Home Today:
Don't miss the opportunity to be a part of Kumar City, where luxury meets tranquility. Whether you're looking for a cozy apartment or a spacious plot to build your dream home, Kumar City has something for everyone. Contact us today to schedule a site visit and embark on a journey towards owning your piece of paradise in Pune
Trade GPT Plixi Reviews
Published: 2024-02-17 11:38:53


Upheld Digital currencies
While considering an exchanging stage like Trade GPT Plixi, it's fundamental to assess the scope of digital currencies it upholds. Trade GPT Plixi is basically centered around Bitcoin, the spearheading advanced cash that has acquired boundless fame lately. As the name recommends, Trade GPT Plixi means to furnish clients with an open and novice well disposed road for exchanging and putting resources into Bitcoin. Nonetheless, it's vital to take note of that [Trade GPT Plixi](https://www.tradegptplixi.com/
) likewise upholds other significant digital currencies past Bitcoin.

One of the vital qualities of Trade GPT Plixi is its different determination of upheld digital currencies, which gives clients a more extensive scope of speculation choices. Notwithstanding Bitcoin, clients can investigate other famous cryptographic forms of money like Ethereum, Litecoin, Wave, and some more. This permits merchants to enhance their venture portfolios and make the most of expected open doors across various advanced resources.

Very much like a financial exchange financial backer who expands their portfolio by putting resources into different organizations from different businesses, approaching various digital forms of money through Trade GPT Plixi empowers dealers to spread their gamble and possibly boost their profits.

Significantly, by supporting an assortment of cryptographic forms of money, Trade GPT Plixi recognizes the developing scene of computerized monetary standards and guarantees its clients approach arising potential open doors on the lookout. This mirrors their obligation to giving a complete exchanging experience that takes care of both prepared brokers and rookies looking for openness to different digital currencies.

[https://www.tradegptplixi.com/
](https://www.tradegptplixi.com/
)
[https://twitter.com/tradegptplixi
](https://twitter.com/tradegptplixi
)
[https://www.facebook.com/tradegptplixi
](https://www.facebook.com/tradegptplixi
)
[https://www.pinterest.com/tradegptplixi
](https://www.pinterest.com/tradegptplixi
)
[https://www.instagram.com/tradegptplixi](https://www.instagram.com/tradegptplixi)
A search engine in 80 lines of Python | Alex Molas
Tags: webdev, beginners, programming, python
Published: 2024-02-17 11:24:48

This week's pip Trends newsletter is out. Interesting articles by Adrian, Alex Molas, Armin Ronacher, Antonis Stellas, mic & Gaurav Kumar are covered this week

{% embed https://newsletter.piptrends.com/p/a-search-engine-in-80-lines-of-python %}
Power Of Gemini
Tags: digitalworkplace, gemini, google, ai
Published: 2024-02-17 10:46:02

The digital landscape is rapidly evolving, and artificial intelligence (AI) is playing an increasingly prominent role. While AI offers tremendous potential, it's crucial to use it as a tool to augment our efforts, not as a replacement.

## The Shift from Effort to Reliance:

Previously, we actively searched for information, analyzed data, and drew our own conclusions. However, with the emergence of AI chatbots like ChatGPT and now Gemini, a concerning trend has emerged: overreliance.

The Power of AI:

ChatGPT revolutionized search by providing seemingly effortless answers to complex queries. Similarly, Gemini boasts advanced features like multimodality and personalization, offering a dynamic and user-centric experience.

## The Impact on SEO:

The introduction of AI tools like SGE sparked concerns about the future of SEO. However, these tools, especially Gemini, present an exciting opportunity to create more engaging and informative content.

Check how [Gemini is going to impact various sectors in future](https://techbound.in/google-unveils-biggest-update-of-2024-gemini/).

## AI: A Tool, Not a Replacement:

It's crucial to remember that AI complements human expertise, not replaces it. The ability to harness the power of AI effectively will become an essential skill for SEO professionals.

The Future of SEO:

SEO is not dead; it's evolving. AI acts as the oxygen that fuels our efforts, but it's up to us, the users, to convert it into meaningful results.


## Conclusion:

Let's embrace AI responsibly and use it as a powerful tool to enhance our SEO strategies, not as a crutch. Remember, content remains king, and human ingenuity is still the driving force behind success.



Start experimenting with AI tools, develop your skills, and play an active role in shaping the future of SEO. The game is on, and it's time to rise to the challenge!
Hello help me please with my project nest js && ejs, mysql
Published: 2024-02-17 10:45:28

1. Registration and Authentication:
•Secure user registration and authentication system.
2. User Profile:
•Creation, display and update of the user profile.
3. Financial Operations:
•Deposit money into the user account.
•Withdrawal of money from the user account.
•Money transfer between users.
4. Transaction History:
•Detailed recording of transactions carried out by each user.
Useful insights I got while building web development projects
Tags: webdev, javascript, beginners, programming
Published: 2024-02-17 10:42:04

Building a music player web app like spotify using HTML, CSS and Javascript!

Currently working on building a section for showing the list of songs in the library. Here are some interesting insights:

Using CSS, the list style of an unordered list (UL) can be modified to none if we want to remove bullet points, it can be set to any other style as well. We can modify the list-style-type to number to use it as an ordered list.

The getElementByTagName returns array of the tags present, for the particular tag we are searching, to use a particular one we have to refer to the position in the array like arr[0], it can also be nested with querySelector if we want to use it in a particular element having an id, similarly, multiple getElementByTagName can be combined by referring to their respective positions in their arrays.

Forof loop can be used for iteration in an array. To return it in HTML in the desired format we can use a template literal to concatenate the outputs of the iteration. Ex: use `songUL.innerHTML += <li> ${song} </li>` where songUL is a UL with that id, and ‘song’ is the output of iteration in ‘songs’ array.

If we fetch data from a URL of our server, for instance here I want to fetch the list of songs in my database, it will return the array with special characters replaced with encoding. For example: spacebar (‘ ‘) will be returned with ‘%20’, so while returning the output we need to use replaceAll (not ‘replace’ because it will only replace the first instance). Also, using ‘split’ to break the string into 2 parts will give an array with 2 elements, one left part of the string and another one right part, so use [1] in the output array to get the right part of the string.

I wanted to put a ‘play now’ text to appear if i am hovering over an associated image of the play icon. The hovering happening on one element to bring effect on another element can be brought by keeping the text element’s display as none and then keeping the following CSS:
```
#imgToBeHovered:hover ~ #textToBeDisplayedUponHover{
    display: block;
}
```
//here imgToBeHovered and textToBeDisplayedUponHover are id names of the elements.


Associated github repository: https://github.com/Harshitnitw/spotify-clone/


– I am Harshit from Varanasi, India, anyone interested in science, technology, etc and would like to learn and grow together, feel free to DM 😊

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vczfv8uups165grs9wxg.png)
What is AI?: A human guide to artificial intelligence
Tags: webdev, ai, javascript, python
Published: 2024-02-17 10:37:00

As with what constitutes intelligence in humans, AI is hard to neatly draw a box around. 

In the broadest possible sense, artificial intelligence is a machine that's able to learn, make decisions, and take action—even when it encounters a situation it has never come across before.

In the narrowest possible sci-fi sense, many people intuitively feel that AI refers to robots and computers with human or super-human levels of intelligence and enough personality to act as a character and not just a plot device. In Star Trek, Data is an AI, but the computer is just a supercharged version of Microsoft Clippy. No modern AI comes close to this definition.

In simple terms, a non-AI computer program is programmed to repeat the same task in the same way every single time. Imagine a robot that's designed to make paper clips by bending a small strip of wire. It takes the few inches of wire and makes the exact same three bends every single time. As long as it keeps being given wire, it will keep bending it into paper clips. Give it a piece of dry spaghetti, however, and it will just snap it. It has no capacity to do anything except bend a strip of wire. It could be reprogrammed, but it can't adapt to a new situation by itself. 

AIs, on the other hand, are able to learn and solve more complex and dynamic problems—including ones they haven't faced before. In the race to build a driverless car, no company is trying to teach a computer how to navigate every intersection on every road in the United States. Instead, they're attempting to create computer programs that are able to use a variety of different sensors to assess what's going on around them and react correctly to real-world situations, regardless of if they've ever encountered it before. We're still a long way from a truly driverless car, but it's clear that they can't be created in the same way as regular computer programs. It's just impossible for the programmers to account for every individual case, so you need to build computer systems that are able to adapt.

Of course, you can question if a driverless car would be truly intelligent. The answer is likely a big maybe, but it's certainly more intelligent than a robotic vacuum cleaner for most definitions of intelligence. The real win in AI would be to build an artificial general intelligence (AGI) or strong AI: basically, an AI with human-like intelligence, capable of learning new tasks, conversing and understanding instructions in various forms, and fulfilling all our sci-fi dreams. Again, this is something that's a long way off. 

What we have now is sometimes called weak AI, narrow AI, or artificial narrow intelligence (ANI): AIs that are trained to perform specific tasks but aren't able to do everything. This still enables some pretty impressive uses. Apple's Siri and Amazon's Alexa are both fairly simple ANIs, but they can still respond to a wide number of requests.
Thống kê XSMN
Published: 2024-02-17 10:30:47

Thống kê XSMN - Thống kê kết quả xổ số miền nam hôm nay chính xác, nhanh nhất. Thống kê chi tiết xổ số miền nam với cặp loto về nhiều, loto gan và những cặp lô đẹp nhất: https://kqxs.blog/thong-ke-xsmn
Thông tin liên hệ:
Website: https://kqxs.blog/thong-ke-xsmn
Mail: Kqxsblog@gmail.com
Địa chỉ: Số 143 ngõ 1194 Đường Láng, Láng Thượng, Đống Đa, Hà Nội
Zip/code: 100000
Task 3
Published: 2024-02-17 10:23:23

Difference between Functional and Non-Functional Testing

Functional Testing

1. It is a type of testing done based on the business requirements of the application. 
2. It is a part of black box testing.
3. This testing is done by integrating the application or system to check the application works as per the given requirements and the testing is done by looking into functional specification.
4. This testing cab be carried out manually by executing test cases or with help of automation testing by executing the test scripts
5. Once the development team completes the coding and white box testing, the 1st testing which is carried out is the functional testing and then it is followed by non-functional testing

Examples of Functional Testing:
- Unit Testing
- Smoke Testing
- Integration Testing
- Regression Testing

Non- Functional Testing:
1. It is testing control out once we are done with functional testing.
2. This testing is done based on the non-functional requirements this testing forces mainly on the readynes of the software
3. We mainly focus on customers perspective such as security, performance, look and feel.

Examples of Non-Functional Testing:
- Performance Testing
- Load Testing
- Stress Testing
- Scalability Testing