teleren/devto huggingface dataset:
Best Camel Safari in Winds Desert Camp
Published: 2024-05-01 05:03:42


Experience the [best camel safari in Jaisalmer sand dunes](https://www.windsdesertcamp.com/camel-desert-safari-jaisalmer.html) with Winds Desert Camp. Our guided safaris offer unforgettable journeys through the mesmerizing desert landscape. Witness breathtaking sunsets and immerse yourself in the beauty of the golden sands on our expert-led camel excursions.
Expert Siding Contractors in La Conner, WA: Enhancing Homes with Quality Craftsmanship
Published: 2024-05-01 04:46:41

One of the defining features of La Conner is its picturesque surroundings, characterized by lush greenery, breathtaking views of the Skagit Valley, and the serene waters of the Swinomish Channel. Amidst such natural beauty, homes stand as havens of comfort and refuge, and their exteriors play a crucial role in blending seamlessly with the scenic landscape. Siding contractors in La Conner recognize the importance of preserving this harmony while providing homeowners with siding solutions that meet their functional and aesthetic needs.

From traditional cedar siding to modern fiber cement options, siding contractors in La Conner offer a wide range of materials to suit every homeowner's preferences and budget. With their expertise in installation, repair, and maintenance, these professionals ensure that each project is executed with precision and attention to detail. Whether it's replacing worn-out siding, upgrading to more energy-efficient materials, or simply giving a home a fresh new look, La Conner's siding contractors have the knowledge and skills to deliver exceptional results.

In addition to their technical proficiency, siding contractors in La Conner prioritize customer satisfaction above all else. They understand that every homeowner has unique requirements and work closely with clients to understand their vision and goals for their homes. From the initial consultation to the final inspection, these contractors maintain open communication, providing regular updates and addressing any concerns along the way. This commitment to excellence has earned them the trust and loyalty of homeowners throughout La Conner and the surrounding areas.

http://laconnersidingco.com
Exploring the Latest ECMAScript Features in JavaScript
Published: 2024-05-01 04:40:35

JavaScript continues to evolve rapidly, bringing new and exciting features that make our code more robust, easier to understand, and more powerful. With the latest ECMAScript updates, JavaScript developers have even more tools at their disposal to craft cutting-edge web and server applications. In this article, we’ll dive into some of the most compelling features introduced in the recent ECMAScript updates, complete with coding examples to help you understand how these can be integrated into your projects.

. Top-Level Await (ES2021)
The introduction of top-level await allows developers to use the await keyword outside of async functions within modules. This is particularly useful when dealing with module dependencies that rely on asynchronous resource fetching.

```
// Importing a module that exports a promise
import { fetchData } from './dataModule.js';

// Using top-level await to wait for the promise to resolve
const data = await fetchData();
console.log(data);  // Logs fetched data without wrapping inside an async function
```
. Logical Assignment Operators (ES2021)
Logical assignment operators combine logical operations with assignment expressions. This feature introduces three new operators: &&=, ||=, and ??=.

let options = { verbose: false };

```
// Set default to true if not already set
options.verbose ||= true;
console.log(options.verbose);  // Output: true

// Only update settings if they are undefined
let settings = null;
settings ??= { theme: 'dark' };
console.log(settings);  // Output: { theme: 'dark' }

```
. Numeric Separators (ES2021)
Numeric separators improve the readability of numeric literals in code by allowing developers to visually separate groups of digits.

```
let billion = 1_000_000_000;  // Much easier to read
console.log(billion);  // Output: 1000000000

```
. Class Fields (ES2022)
ECMAScript 2022 introduces class fields, making it simpler to define and access properties directly within class declarations.

```
class Counter {
  count = 0;  // Public field

  increment() {
    this.count++;
  }
}

const myCounter = new Counter();
myCounter.increment();
console.log(myCounter.count);  // Output: 1

```
. RegExp Match Indices (ES2022)
Regular expressions in JavaScript now support match indices, providing the start and end positions of captured groups.

```
const regex = /(ab)+/d;
const match = regex.exec('cababc');
console.log(match.indices);  // Output: [[1, 5], [3, 5]]

```
Conclusion
These features are just a glimpse of how JavaScript is continuously improving to meet the needs of modern web development. As you integrate these features into your projects, you'll find that your code can become cleaner, more efficient, and easier to manage. Stay tuned to the JavaScript community and experiment with these new capabilities to fully leverage their potential in your work.

---

Thank you for reading my article! For more updates and useful information, feel free to connect with me on LinkedIn and follow me on Twitter. I look forward to engaging with more like-minded professionals and sharing valuable insights.
Earn Cash (and Coding Cred) by Building Review Site Plugins or Themes
Tags: beginners, productivity
Published: 2024-05-01 04:25:20

Let's be honest – we all want to make some extra money from our coding skills. While freelancing and contract work are solid options, building a product like a review plugin or theme offers the potential for ongoing income and the chance to level up your development abilities.

Think beyond giant platforms like Amazon or Yelp.  There's a massive demand for reliable reviews in specific areas. Passionate communities exist around board games, craft beers, local pet groomers, indie software tools – you name it.  This is where a focused review plugin can shine.

**1. Find Your Niche**
**2. WordPress vs. Going Solo**
**3. Nail the Essentials**
**4. How Will You Make Money?**
**5. It's Not Just About Code**

I run a site called "**Earn More Cash Today**" focused on honest reviews to help people find legitimate ways to make money. If you've found this article helpful, check out [earnmorecashtoday.com](https://earnmorecashtoday.com/).

Even if you start small, creating review functionality is a fantastic way to earn and learn. Do you have any niche review projects in the works? Please share them in the comments!
Learn SwiftUI (Day 7/100)
Tags: swift
Published: 2024-05-01 04:17:23

## Swift

* functions
* function parameter names
* return one value & return multiple values
* call function without explicit parameter name


### Define functions

We need to write the parameter name as part of the function call. This isn’t common in other languages, but I think it’s really helpful in Swift as a reminder of what each parameter does.

```swift
func printTimesTables(number: Int, end: Int = 10) {
    for i in 1...end {
        print("\(i) x \(number) is \(i * number)")
    }
}
printTimesTables(number: 2)
```

With return value:
```swift
func rollDice() -> Int {
    return Int.random(in: 1...6)
}
for i in 1...6 {
	print("\(i): \(rollDice())")
}
```

Take a list of int as parameter:
```swift
func square(numbers: [Int]) {
	for number in numbers {
		let squared = number * number
		print("\(number) squared is \(squared).")
	}
}
square(numbers: [2, 3, 4])
```

Return an arrary:
```swift
func abc() -> [Int] {}
```

Return a dictionary:
```swift
func abc() -> [String: Int] {}
```

Return a tuple that contains multiple values:
```swift
func getUser() -> (firstName: String, lastName: String) {
    return (firstName: "John", lastName: "Doe")
}
let user = getUser()
print(user.firstName)
print(user.lastName)
// or
let (firstName, lastName) = getUser()
print(firstName)
print(lastName)
```

Or:
```swift
func getUser() -> (String, String) {
    return ("Taylor", "Swift")
}
let user = getUser()
print(user.0)
print(user.1)
```

Use `_` to omit the parameter name:
```swift
func isUppercase(_ string: String) -> Bool {
    string == string.uppercased()
}

let string = "HELLO, WORLD"
let result = isUppercase(string)
```
Free tool: Tailwind CSS Colors ✨
Tags: tailwindcss, colors, webdev, cheatsheet
Published: 2024-05-01 04:08:42

If you work with Tailwind CSS, I'm almost certain that you've searched for '_tailwind colors_' or '_bg-gray-200 hex_' or similar before.

And in some cases, you'd search up the hex value of the color you need, only to search '_hex to hsl_' and convert it afterwards.

Am I right 👀?

That's what I ran into almost daily. And that's why I decided to build a cheatsheet/tool, meet [Tailwind CSS Colors](http://tailwindcsscolors.com) ✨.


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

A free (forever!) tool to copy any Tailwind color in any format, with a dark mode and the value type you select stored so whenever you come back; just click the color you need, that's all!

If you like it, don't forget to bookmark it 🔖🙌

Anything you think I should improve? Open for any feedback or ideas!

👉 go to [tailwindcsscolors.com](http://tailwindcsscolors.com)
React Custom Hooks (useRefs)
Published: 2024-05-01 03:33:28

INTRO 🔔
Hello World! 👋
Today we are discussing another custom hook🪝 is `useRefs`🔥. It is an extension of `useRef`💥. Now we will see the code and how to use it.

## USAGE 🔔
As a `React` developer🧑🏻‍💻 , we all know what [useRef](https://react.dev/reference/react/useRef)💥 hook is. `useRef`💥 helps to access the DOM elements. One `useRef`💥 will help to access one element but sometimes we need to access more than one element 🤔. That time we need to create multiple `uesRef`💥 hooks. To avoid this problem we are creating a `useRefs`🔥 custom hook.

> Note📌 :- As discussed earlier hook [useLocal](https://dev.to/sundarbadagala081/react-custom-hooks-uselocal-4bj4)🚀. This is not a hook, it is the helper. But for our convenience, we are calling it a hook🪝.

## CODE 🔔
```js
export const useRefs = () => {
  const refs = [];
  return [refs, (el) => el && refs.push(el)];
};
```

## USE CASE 🔔

**TRADITIONAL MULTIPLE `useRef` HOOKS** 🕯️
```jsx
import React, { useEffect, useRef } from "react";

function App() {
  const headerRef = useRef(null);
  const inputRef = useRef(null);
  const btnRef = useRef(null);
  useEffect(() => {
    console.log("header", headerRef.current.innerText);
    console.log("input", inputRef.current.defaultValue);
    console.log("button", btnRef.current.offsetWidth);
  }, []);
  return (
    <>
    <main>
        <div id="header" ref={headerRef}>Header</div>
        <input type="text" defaultValue={'hello world'} ref={inputRef}/>
        <button id="click" ref={btnRef}>Click Here</button>
    </main>
    </>
  );
}

export default App;
```

**USING `useRefs` HOOK** 💡
```jsx
import React, { useEffect } from "react";
import { useRefs } from "./useRefs";

function App() {
  const [refs, handleRef] = useRefs();
  useEffect(() => {
    console.log("header", refs[0].innerText);
    console.log("input", refs[1].defaultValue);
    console.log("button", refs[2].offsetWidth);
  }, []);
  return (
    <>
      <main>
        <div id="header" ref={handleRef}>Header</div>
        <input type="text" defaultValue={"hello world"} ref={handleRef} />
        <button id="click" ref={handleRef}>Click Here</button>
      </main>
    </>
  );
}

export default App;
```
It also gives the same output as using multiple `useRef` hooks.

Please practice in your Code Editor, you will get full clarity on this hook.

## CONCLUSION 🔔
I hope this hook is helpful. We will meet with another hook in another post. 

Peace 🙂
2024-04-29: It's gonna be May
Tags: devjournal
Published: 2024-05-01 03:21:30

I have some exciting news to share: finally getting pre-seed funds in within 3 weeks, which is great.

Let's detail what I got done last week:

Monday and Tuesday were pretty light and same as usual, where I spent more time doing some research. I got back and continued my work on that RAG prompt that the other devs wanted me to give them so that it can retrieve the proper documentation for what we want it to do. I had some personal trouble figuring out how I wanted to organize it (like which file to put it in and where, since it's kind of a jumbled mess at the moment), so I just gave it as text to one of them and hopefully he put it where it needs to go. I also took the time to specifically research the best way to be chunking the text in the documents since apparently the other dev did it in a naive way instead of by paragraphs/sections (so that semantically similar things are more reliably grouped). He was complaining about latency in the chat part of the application so it's currently in the post-processing part only. That needs to be optimized for sure.

Wednesday I took off for Armenian Genocide Memorial, so not much to report there. 

When I got back on Thursday, I met with the product team again where we started talking about more architectures that we wanted to implement into the system, taking our original prompts and adapting them to the practical applications that we want. Again, I have to be vague since the topic of the application is under wraps, but all I can say is that it's a wellness application, not unlike Comigo. But anyway, after that meeting, I did some more research. I needed some more to go off of for the architectures, so I waited on them to give me that (which hasn't happened yet to the date I'm writing this, but it's fine).

Friday, the CEO came across a cool video on YouTube that demonstrated a technology that he wants to add to the platform. Now, he really wants to keep this one a secret, so I unfortunately am not going to be able to talk about this one at all, but he wants me to spearhead that effort as a future product feature, which is going to be great. With this, the news about funding, and a new coworker that I've been closely working with, I have a renewed enthusiasm for the role here, which is awesome.

But anyway, that's all for this week. Until next time, cheers.
Day 0: JavaScript
Tags: webdev, javascript, programming
Published: 2024-05-01 02:53:08

Another day, another server to crack. But today's weapon isn't a zero-day exploit or some fancy social engineering trick. Today, it's the mundane, the ordinary, the very building block of the web itself: JavaScript.

They call it "ECMAScript" officially, some corporate committee jargon no doubt. But who cares about suits? **ECMAScript is just a fancy way of saying the rules for how this scripting language works.** Like a hacker's guide to manipulating the system from the inside.

Learned about this group called TC39. Bunch of nerds, I presume, who get their jollies by deciding what goes into this virtual toolbox. **Apparently, it takes them forever to agree on anything.** Bureaucracy even in the digital world, figures. Must be why that ES6 update took half a decade. Sloppy work, if you ask me.

Picked up some basic tools today.  Numbers, variables, those sorts of things. **Like labeling jars in a dark room.** You gotta know what you're grabbing before you start building your code grenades.  Primitive types, they call them.  Simple enough for now.  But there's more out there, I can feel it.  More complexity, more power to exploit.

**Started with some quizzes. Easy stuff, really.** Adding numbers, messing with variables. Grade school arithmetic with a hacker twist.  But it's a start. Gotta build the foundation before you can reach the penthouse.

They say to use Chrome and some editor called VS Code. Fine by me.  **Tools are tools.**  Whichever ones get the job done.  Though, I gotta say, this whole "official resources" thing feels like a trap.  Can't trust anything these corporations put out.  Always gotta keep an eye peeled for the backdoor.

Just gotta remember one thing: **don't get sucked into the system.**  These tools can be powerful, sure.  But they can also be a cage.  Gotta use them, not let them use you.

(Later, maybe I'll take a look at that MDN they mentioned. Gotta have some backdoors of my own.)
１３章58
Published: 2024-05-01 02:37:12

このJavaコードは文字列を操作して最終的な出力を得るものです。コメントを加えて、各ステップを解説します。

```java
public class Sample {
    public static void main(String[] args) {
        String a = "A";       // 文字列aに"A"を代入
        a = a.concat("B");    // 文字列aに"B"を連結して、aは"AB"になる
        String b = "C";       // 文字列bに"C"を代入
        a = a.concat(b);      // 文字列aにbの値"C"を連結して、aは"ABC"になる
        a.replace('C', 'D');  // 文字列a内の'C'を'D'に置換しようとするが、置換された結果は保存されない。もしもa = a.replace('C', 'D');だったら保存された。
        a = a.concat(b);      // 文字列aに再びbの値"C"を連結して、aは"ABCC"になる
        System.out.println(a); // 文字列aを出力、"ABCC"が出力される
    }
}
```

このコードにおいて重要なポイントは、`a.replace('C', 'D');`の行です。このメソッドは文字列の中の文字を置換するものですが、JavaのStringは不変なので、このメソッドを呼び出しても元の文字列`a`は変更されません。そのため、この操作の結果は保存されず、`a`の値は変わらないままです。その後、`a.concat(b);`で`"C"`が再び連結されるため、最終的な出力は`"ABCC"`となります。

したがって、選択肢C「[ABCC]」が正解となります。
The Struggles Of a Junior Software Developer
Tags: webdev, beginners, programming, codenewbie
Published: 2024-05-01 02:27:00

You are working on too many different things at once.

As a new developer, you want to look competent. And you want people to think that you are very efficient.

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

That you just happen to be this coding prodigy that came out of nowhere.

But take a look at senior to mid level devs.

They reject the extra work because they are in the middle of something. They are in the middle of, one thing.

They have a really good grasp of that one thing, and the requirements for that one thing.

And they get it done well.

You, on the other hand, have 3 things going on. Of which you don't fully understand. And your brain has to jump back and forth between them.

As a new dev, don't be embarraced to say, "I'm currently in the middle of something. Let me get this done first, then I will jump on that."

Stop volunteering for everything.

Get your one assignment, understand the requirements well, and then knock out the park.

Be a dev that always delivers over one that is always in the middle of 10 different things. And always has to give updates and excuses for all the things that you are doing.

Take one task assignment at a time, and complete it.

And commit to a new task only when the previous task is delivered as requested.

In fact, building software is a slower process than you think. Especially if you want to do it right.

Rooting for you,

Karl ⛹️

Ps. If you liked this post, you will like [my superb private newsletter](https://karlgusta.gumroad.com/l/gcdmka). Join now for my next banger post coming tomorrow!
All Aboard! Exploring Pakistan by Rail
Tags: rails, testing, news, mobile
Published: 2024-05-01 02:01:52

Embark on an unforgettable journey through Pakistan with the country's iconic railway system. From the bustling streets of Karachi to the majestic mountains of the north, Pakistan Railways offers a unique and scenic way to explore the beauty and diversity of this incredible nation. Sit back, relax, and let the rhythm of the rails carry you to your next adventure! 

For more information on Pakistan Railways and to plan your journey, visit [Move in Pak](https://moveinpak.com).
１３章53
Published: 2024-05-01 01:29:10

まず、元の設問のコードとその結果について説明します。その後、`this.val = val;`を設定するように変更したコードについて説明します。

### 元の設問のコード

```java
public class Main {
    private String val; // String型のフィールド
    private int num; // int型のフィールド

    // numを引数として受け取るコンストラクタ
    public Main(int num) {
        this.num = num; // numフィールドに引数の値を設定
    }

    // デフォルトコンストラクタ
    public Main() {
        this.val = "test"; // valフィールドに"test"を設定
        this.num = 10; // numフィールドに10を設定
    }

    public static void main(String[] args) {
        Main m = new Main(20); // 引数20でMainのインスタンスを作成
        System.out.println(m.val + ", " + m.num); // valとnumを出力
    }
}
```

このコードの結果は以下の通りです：

- `Main m = new Main(20);`では、引数`20`を持つコンストラクタが呼び出され、`num`フィールドに`20`が設定されます。
- `val`フィールドは設定されないため、デフォルト値の`null`のままです。
- 出力は`null, 20`となります。

したがって、元の設問の答えはAの「null, 20」と表示されるです。

### `this.val = val;`を設定したコード

次に、`val`フィールドを引数として設定するように変更したコードを見てみましょう：

```java
public class Main {
    private String val; // String型のフィールド
    private int num; // int型のフィールド

    // valとnumを引数として受け取るコンストラクタ
    public Main(String val, int num) {
        this.val = val; // valフィールドに引数の値を設定
        this.num = num; // numフィールドに引数の値を設定
    }

    // デフォルトコンストラクタ
    public Main() {
        this.val = "test"; // valフィールドに"test"を設定
        this.num = 10; // numフィールドに10を設定
    }

    public static void main(String[] args) {
        Main m = new Main("custom value", 20); // valとnumを引数に持つMainのインスタンスを作成
        System.out.println(m.val + ", " + m.num); // valとnumを出力
    }
}
```

このコードの結果は以下の通りです：

- `Main m = new Main("custom value", 20);`では、引数`"custom value"`と`20`を持つコンストラクタが呼び出され、`val`フィールドに`"custom value"`、`num`フィールドに`20`が設定されます。
- 出力は`custom value, 20`となります。

この方法で、`val`フィールドを適切に設定して出力することができます。

## 補足

```java
1. public class Main {
2.     private String val;  // 文字列を格納するプライベート変数val
3.     private int num;     // 整数を格納するプライベート変数num
4. 
5.     public Main(int num) { // 整数numを引数にとるコンストラクタ
6.         this.num = num;    // 引数で受け取ったnumでインスタンス変数numを初期化
7.         this.val = "initialized"; // ここでvalを"initialized"で初期化
8.     }
9. 
10.    public Main() {        // 引数なしのコンストラクタ
11.       this.val = "test";  // インスタンス変数valを文字列"test"で初期化
12.       this.num = 10;      // インスタンス変数numを整数10で初期化
13.    }
14. 
15.    public static void main(String[] args) {
16.        Main m = new Main(); // Mainクラスのオブジェクトmを作成、引数なしコンストラクタMain()を呼び出す
17.        System.out.println(m.val + ", " + m.num); // mのvalとnumを表示
18.    }
19. }
```

この変更後の`main`メソッドでは、`Main()` コンストラクタを使用してオブジェクト`m`を作成します。この場合、`val`は"test"に、`num`は10に初期化されるため、`System.out.println(m.val + ", " + m.num);` の出力は `"test, 10"` となります。
AWS Fargateを利用した時刻固定したシステムテストの方法について
Tags: fargate, faketime, japanese
Published: 2024-05-01 01:25:50

この記事は先日英語版で投稿した[How to system test with fixed time on Fargate](https://dev.to/aws-builders/how-to-system-test-with-fixed-time-on-fargate-2469)の日本語訳です。

AWS Fargateでの時刻を固定したシステムテストをどのように実現していますか？

`aws ecs execute-command`を使用してコンテナにログインし、dateコマンドを使用して時刻を変更しようとしても、[AWS Fargateでは特権コンテナがサポートされていない](https://docs.aws.amazon.com/eks/latest/userguide/fargate.html)ため、次のエラーが発生して変更することができません。

`date: cannot set date: Operation not permitted`

ところが、libfaketime を使用するとシステム時刻を調整することができます。
バージョンは古いですが、Keycloak 19.0.2のイメージで検証したDockerfileを以下に示します。

```
FROM quay.io/keycloak/keycloak:19.0.2 AS builder

USER root

RUN microdnf install -y git make gcc
RUN git clone https://github.com/wolfcw/libfaketime.git
WORKDIR /libfaketime/src
RUN make install
ENV LD_PRELOAD=/usr/local/lib/faketime/libfaketime.so.1

ENV FAKETIME="2025-04-24 10:30:00"
RUN date

WORKDIR /opt/keycloak

ENTRYPOINT [ "/opt/keycloak/bin/kc.sh" ]
```

上記で作成されたイメージから実行されたコンテナに以下のように入ってdateコマンドを実行すると、FAKETIME変数で指定した値が固定されていることがわかります。

```
% aws ecs execute-command --cluster _clustername_ --task _taskID_ --interactive --command "/bin/bash"

The Session Manager plugin was installed successfully. Use the AWS CLI to start a session.

Starting session with SessionId: ecs-execute-command-xxxxxxxxx
[root@ip-NNN-NNN-NNN-NNN keycloak]# date
Thu Apr 24 10:30:00 UTC 2025
```

ぜひ試してみてください。