teleren/devto huggingface dataset:
Avent of Code - Day 06 - Tuning Trouble
Tags: adventofcode, aoc, programming, christmas
Published: 2022-12-06 19:16:58

[Advent of Code](https://adventofcode.com/) occurs at Dec 01 to 25 where each day, you will need to solve a puzzle. It is Festival and the problem statement is mostly related to Christmas.

## Day 06  - Tuning Trouble
https://adventofcode.com/2022/day/6

![image.png](https://cdn.steemitimages.com/DQmSpk71fwpahM1yjG7eqyiPREuGTn2L7n8zas3edvjppD8/image.png)

### Q1
```python
import sys
from collections import defaultdict, deque

file1 = open(sys.argv[1], "r")

while True:
        line = file1.readline()
        if not line:
                break
        s = line.strip()
        break

n = len(s)
i = 4
print(s)
while i < n:
        if len(s[i-4:i]) == len(set(s[i-4:i])):
                print(i)
                break
        else:
                i += 1
```

### Q2
```python
import sys
from collections import defaultdict, deque

file1 = open(sys.argv[1], "r")

while True:
        line = file1.readline()
        if not line:
                break
        s = line.strip()
        break

n = len(s)
x = 14
i = x
print(s)
while i < n:
        if len(s[i-x:i]) == len(set(s[i-x:i])):
                print(i)
                break
        else:
                i += 1
```

Q1 and Q2 are basically the same - except one is looking for 4 characters and another for 14 characters. Checking String contains unique characters:  See [How to Check if a Given String has Unique Characters?](https://helloacm.com/how-to-check-if-a-given-string-has-unique-characters/)


<hr/>

### [Steem](https://steemyy.com) to the Moon!
Web Design and Marketing Services Are Tailored To Meet Your Needs
Tags: wordpress, webdesign, websitedesigner
Published: 2022-12-06 18:54:38

[WordPress Website Designer](https://blackwebspider.com/)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9k762lnmmqz8boj7r3zw.jpg)
Give your business a new look with our web design services
With our web design services, we can give your business a new look. With our wide range of services, we can safely and quickly design a website that is unique to your needs. We are experts in web design and development and offer custom solutions that are tailored specifically to you.

We offer [website design services](https://blackwebspider.com/services/) that will make your business stand out from the crowd. Our designers are experts in delivering websites that are easily navigable and enhance your brand’s identity. With our wide range of services, we can quickly create a new online presence for your company or nonprofit organization.

[We offer free web design consultations](https://blackwebspider.com/free-website-design-estimate/)
Dual-booting Ubuntu and Windows
Tags: linux, tutorial
Published: 2022-12-06 18:37:01

# Introduction
Hello! My name is Ivin. I am a first year B. Tech student and today, I'll be quickly teaching you how to dual-boot Ubuntu alongside Windows on UEFI systems in 10 shorts steps.

## Step 1
Head over to [Ubuntu's website](https://ubuntu.com/download/desktop) and download your ISO image. While you wait, proceed to step two.

## Step 2
Open _Disk Management_ tool on Windows and free up some space for Ubuntu. You can shrink an existing volume by right-clicking on the preferred volume. 

## Step 3
Download either [Universal USB Installer](https://www.pendrivelinux.com/universal-usb-installer-easy-as-1-2-3/) or [Rufus](https://rufus.ie/en/) to create a live Ubuntu USB. I'll be using Rufus for this tutorial.

## Step 4
Plug in a USB and open Rufus. Set the partition scheme to _GPT_ target system as _UEFI_. Then click on _Start_ and wait till the process is finished.

## Step 5
Search for Advanced Startup on Windows and open _Change advanced startup options_. Click on _Restart now_

## Step 6
Choose _Use a device_ and select your USB disk. Ubuntu should boot up.

## Step 7
Proceed with _Install Ubuntu_ option. Select language, opt for a normal installation and then for Installation type, choose _Something else_.

## Step 8
Divide the free space you created in **Step 2** into three. You can select the unallocated space and click on the _+_ sigh to create a partition. Choose _Beginning of this space" for the location and use _Ext4 journaling file system_ for both / (root) and /home mount points. The third partition will be for swap area.

## Step 9
Proceed with the installation by selecting your timezone and setting up your credentials.

## Step 10
Wait for the installation to finish and restart your computer when prompted to do so. Remove the disk and wait for GNU Grub screen on bootup to select Ubuntu or Windows. 


That's it! With a bit of luck, you should have reached this point without any errors just like I did. But in case you did or if you're confused on how to proceed, I'd recommend watching a tutorial on YouTube instead of reading guides. 

Have a fantastic rest of your day, mate.
Release 0.4 Planning
Tags: beginners, opensource, javascript, react
Published: 2022-12-06 18:33:27

## The Project I chose
For 0.4, I plan to create the UI for [my-photohub](https://github.com/humphd/my-photohub). I am choosing this project because I thought the concept of it was interesting. Also, I wanted to work on a React project, I had previously worked on a personal project using React and wanted to put that practice to use on a real project. Another reason I chose this project was because did not want to spend too much time looking for an external project to work on that was viable. 

## My Plan
I first looked at the UI at already existed for the project. Then, I created a mock-up for the changes that I was proposing. 

![UI Mock-up](https://user-images.githubusercontent.com/61764259/204909003-8bf42c5d-f573-4699-97c0-102d535bee13.png)

First I will create a UI allowing for submission of project details. There is already an [existing issue](https://github.com/humphd/my-photohub/issues/6) for this. Then, I will add the functionality for the form. Currently, it is being contributed to by others who are adding the different components for the project. Hopefully, the project will be closer to being function through my contributions.

## Goals
I plan to create the basic UI for the project, and have the form perform its functionality. I do not want to aim so high that I will not be able to achieve my goal by its deadline, but I also want to contribute something substantial to the project. Hence, I will aim to contribute as much to the project regarding the UI as possible.
I was banned...
Published: 2022-12-06 18:15:59

Finding a home to post content and build a community is hard.

I want to be more involved, but it's been hard to crawl out of the shell my former employer imposed because we weren't allowed to participate in many community events for fear of being seen as representing the company, rather than ourselves.  Now, free of those restrictions I have tried to grow more and participate more.  I heard about a community effort to link 50 blogs in a [C# Advent calendar](https://csadvent.christmas/) to help share ideas and build the community so I applied to join in.  I got the Dec 4th spot and needed to write an article to link and participate.  

I don't yet want to discuss the site I used for my participating entry, I've since moved the content [here](https://dev.to/aztecconsulting/invoking-legacy-javascript-from-blazor-webassembly-using-the-jsruntime-1df3) but I wanted to document what happened.  

On Sunday my post when live...

On Monday I saw over 350 people had clicked through to see my article...

On Tuesday I was banned...

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

Not my post was removed...
not we need to discuss your post...
but GTFO, you've been banned!

I'm trying to backchannel an appeal, but this is an impressively hardcode response.  

More to come...
Importance of 3 auspicious yogas auspicious time will be made on the full moon of the last month of Marshish
Tags: jyotishwithakshayg, vastuwithakshayg, numerologywithakshayg
Published: 2022-12-06 17:55:00



![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hukh8ax75mxy8saxwko0.jpg)Apart from this, Ravi Yoga is also being formed on this day. These three auspicious yogas are making Marshish Purnima very special.

Importance of 3 auspicious yogas, auspicious time will be made on the full moon of the last month of Marshish
Also read :Very rare yoga formed after 1500 years on Hindu New Year Know the effect on your life


The special importance of a full moon: -
The special importance of a full moon has been told in Sanatan Dharma. Margashirsha i.e. Agahan month is very dear to Lord Shri Krishna, therefore the worship of Lord Shri Krishna, Lord Vishnu, and Mother Lakshmi is considered very special on Margashirsha Purnima. On this day, bathing in holy rivers and doing charity work are considered very auspicious. Marshish Purnima is also special because it is the last full moon of the year. This year, Margashirsha Purnima is falling on Monday, 19th December.

Time of Marshish Purnima:-
This year Margashirsha Purnima will be from 08.02 am on 7th December to 09.36 am on the next day on 08th December. But the fast of Marshish Purnima will be observed on 7th December.

Worship of Moon on Marshish Purnima:-
Also read :हिंदू नववर्ष पर 1500 साल बाद बना अत‍ि दुर्लभ योग! जानें आपके जीवन पर असर
On the full moon date, the moon completely affects the earth and water elements. This day is considered the day of divinity. It is said to be the last day of the holiest month among the months. Meditation, donation, and baths are especially beneficial on this day. Shri Hari or Shiva must be worshiped on this day. On this day the moon was irrigated with nectar, so worship of the moon should [also be done on this day.](https://www.jyotishwithakshayg.com/2022/12/Importance-of-3-auspicious-yogas-auspicious-time-will-be-made-on-last-month-of-Marshish.html)
[Click Here To Read More](https://www.jyotishwithakshayg.com/2022/12/Importance-of-3-auspicious-yogas-auspicious-time-will-be-made-on-last-month-of-Marshish.html
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mha4o2sa7ek9w8ws5swp.jpg))
Sinatra
Tags: webdev, ruby
Published: 2022-12-06 17:44:59

We all know that the internet sends and receives data. But how does it really work? Where is the information stored and how? 

Sinatra is a web framework that helps build small web applications. with rack-based application, we can now handling HTTP request and response which is how the internet operates. 

Within our code we will want to include `gem 'sinatra'`. Then we will want to run "bundle install:" in our terminal to get the Sinatra gem from the Gemfile.

then you can create a file with any name and end it with a .rb ex: file_name.rb

within that file, include at the top `require 'sinatra'` and in order to start a simple run we will include this code:

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



then in the terminal run ruby file_name.rb. Now in the output after running the .rb file we will see a line that is showing "listening on tcp::// XXX.X.X.X.XXXX. the last four digits will be the local host port.

putting locahost:XXXX into your browser will display the code we had inputted earlier. Now we have a simple Sinatra application running.

Sending HTML & JSON Responses:
A feature of note in Sinatra is it's ability to send responses back in different formats, such as ruby into HTML or to JSON. This simplifies our server side code and provides flexibility.
You can simply write string method into your Sinatra code for it to be output. 

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



While a JSON strong can be created by utilizing the `.to_json` method at the endo the code you want to output 


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



This will be an ongoing blog as I learn more about the usages of Sinatra. For a further dive into the different routes with Sinatra, take a look at this link: 



https://sinatrarb.com/intro.html
🎄JS Advent #5 - Strict vs loose equality🎄
Tags: javascript, beginners, webdev, programming
Published: 2022-12-06 17:33:26

#### For the month of December I have challenged myself to write 24 articles about JS up until Xmas.
#### The fifth installment in this series about strict and loose equality.

### Double equals (loose equality)
The double equals will compare two values:
```javascript
console.log('test' == 'test'); // true
console.log(1 == 1); // true
console.log(2 == 1); // false
```

This also will return true:
```javascript
console.log('1' == 1); // true
```
Why is this?
- The double equals (or loose equality) will perform a type conversion. 
- Strings are always converted to the Number type to be compared, so in this example the `'1'` string will be coerced to a Number type before the comparison.

### Triple equals (strict equality)
- The triple equals will again compare two values:
```javascript
console.log('test' === 'test'); // true
console.log(1 === 1); // true
console.log(2 === 1); // false
```

But it will not perform a type conversion prior to the comparision:
```javascript
console.log('1' === 1); // false
```

So to compare types always use the triple equals.

In general it is best practice to use the triple equals to avoid any unwanted behavior.
如何通過生髮激光治療打造美麗、健康的頭髮！
Published: 2022-12-06 17:12:58

**簡介：**
多年來，您一直在使用生髮激光來打造美麗、健康的頭髮。但是你身體的其他部分呢？您是否充分利用了激光治療？你看到任何實際結果了嗎？這就是我們的切入點。我們有一種毛髮生長激光治療，可以幫助您獲得美麗、健康的全身毛髮。閱讀更多 [https://perfect-hair.com/f8/](https://perfect-hair.com/f8/)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6hmrjf7one2cjca00kfj.jpg)

**如何通過生髮激光治療打造美麗、健康的頭髮。**
毛髮生長激光是一種能量治療，它使用光來刺激毛髮生長。激光治療的工作原理是使用脈衝光束刺激頭髮中的毛囊。這個動作導致毛細胞分裂並產生新的毛髮。

**頭髮生長激光如何工作？**
毛髮生長激光通常針對頭髮生長最快的頭部特定區域（例如頭皮的前額或頂層）起作用。然後激光使用強烈的光脈衝來破壞和破壞這些細胞，從而導致它們分裂並產生新的毛髮。此過程最多可能需要幾分鐘，因此在接受治療時耐心等待很重要。

**如何開始毛髮生長激光治療。**
如果您是此類治療的新手，請務必在開始任何治療之前先與您的醫生或治療師參加介紹性會議！之後，與毛髮生長激光專家預約，他將指導您完成治療的每一步。

**如何通過生髮激光治療打造美麗、健康的頭髮。**
獲得美麗、健康頭髮的第一步是為您選擇合適的生髮激光治療。有多種治療方法可以幫助人們達到預期的效果。如果您正在尋找有助於長出新頭髮的更通用的激光治療，有很多選擇。但是，如果您想專注於長出更濃密、更健康的頭髮，生髮激光治療可能更適合您。

**了解毛髮生長激光治療的好處。**
如果您希望看到激光生髮治療的驚人效果，那麼首先了解其益處非常重要。使用生髮激光的主要好處是：

- 增加頭髮的密度和厚度 - 這種激光有助於增加頭髮的厚度和厚度，同時還能刺激新的生長。

- 更快 – 通過更快的毛髮生長激光治療，您可以預期療程之間的等待時間更短，並且在外觀和健康方面的整體效果更好。

- 更少的疼痛——由於傳統醫學治療帶來的疼痛更少，患者在接受毛髮生長激光治療後通常會比使用其他類型的激光時感覺更少不適。

- 減輕壓力——許多人發現，化療或放療等傳統藥物治療後增加的壓力水平會導致頭皮周圍的焦慮和緊張感增加。通過使用生髮激光治療，您可以減輕甚至完全消除這些症狀！

**使用生髮激光治療打造美麗、健康頭髮的技巧。**
如果您希望通過生髮激光治療獲得美麗、健康的頭髮，請務必花時間護理您的治療。維護不當的激光會導致脫髮和損傷，因此保持激光清潔無碎屑非常重要。您還應該使用適合您的生髮激光治療——如果您沒有足夠的空間或想嘗試不同的治療，請在開始治療前諮詢醫生。

**使用適合您的生髮激光治療。**
許多人在試圖獲得健康的頭髮時錯誤地使用了太多不同類型的激光治療。通過僅使用一種專為頭髮生長設計的激光治療，您將更有可能在整個頭部獲得一致且均勻的結果。要找到這種類型的激光治療，請尋找保健食品商店或在線搜索引擎，您可以在其中了解用於此類治療的各種類型的激光。

**定期使用生髮激光治療。**
保持頭髮健康的最佳方法是定期使用它——尤其是當您計劃在未來再次長出頭髮時。通過遵循這些提示，您將能夠讓他們保持最佳狀態，同時仍然享受自然成長！

**結論**
通過生髮激光治療，您可以獲得美麗、健康的頭髮。仔細遵循說明並花時間護理您的治療，您可以確保頭髮長得漂亮。使用適合您的生髮激光治療，定期使用可保持頭髮健康。[https://perfect-hair.com/f8/](https://perfect-hair.com/f8/)
Compare Composition API and Options API in VueJS CLI Life-cycle
Tags: vue, compositionapi, optionsapi
Published: 2022-12-06 17:07:55

Introduction:
In Vue 3 composition api alone with Typescript is available and gaining popularity in web and application development industry. In this lecture, we will talk about the usage and adventages of  options API and composition API in term of Life-cycle.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h9agvj2pt3pg3t3ezbiv.png)
Why Life-Cycle?
Because JavaScript is a single-threaded, non-blocking, asynchronous, concurrent programming language, which allows you to open parts of web pages at the same time and single crush doesn’t cause the shut down of the entire website, and Vue Cli is mainly built with JavaScript. Therefore we need to define a procedure for data fetching and operational logic. Otherwise if the logical function run before the data is ready, it will cause error. If you choose to use options API, you always need to remember or try which part of your events are and where your data are coming from. 

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

Here it is the grammar of the options API. Async is required when await even it defined inside.
Note that setup() is called before data() and components, so inside setup there is no access to data(), such as this.name in async mounted(). 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kxusn160oq58eoruq781.png)
How to get and post data in setup()?
Suppose the data provided from other component, you need an inject package from ‘vue’ then therefore async setup can have access to the inject(‘id’). To post a data from setup, we need return it, for example trylist, audioList here. In async beforeUpdate(), we can directly use audioList.

Console.Log Problems
In JavaScript synchronous function, console.log can't execute until the method it called is done. In async function console.log executes independently and doesn’t wait till the response. It may cause error sometimes, so a better way to check data validation is to use it in <template> or Html to show data on pages.
Composition API
Instead of thinking about the sequence of life-cycle in options API. In composition API with TypeScript, everything can be defined inside setup function. The syntax followed:
<script setup lang="ts">
import { inject } from 'vue'
import { defineComponent } from 'vue'
import {useStore} from ‘vuex’
const store = useStore()
const onsubmitresult = () =>{
}
</script>

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


We can consider composition API is in options setup function without return. With TypeScript, which is object-oriented programming language, you can use it like Java or  C++.

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


Therefore with the concept of object- oriented programming, we don’t need to check the life-cycle of API and step procedure, such as await then ... ,and we only need to think about how logic of function,data types, etc.
MySQL Variables – Definition and Examples
Tags: mysql, database, dbforge
Published: 2022-12-06 16:51:14

---
title: MySQL Variables – Definition and Examples
published: true
description: In this article you can learn more about the useful properties of user-defined variables.
tags: #mysql #databases #dbforge
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2022-11-21 21:38 +0000
---
MySQL variables serve to store data, mark up data, and allow developers to write more precise and efficient code by turning long and complex character strings into one simple variable. Read more - https://blog.devart.com/mysql-variables-html.html
25 STM32F0 flashed in less than 30 seconds
Tags: opensource, microservices, productivity, luos
Published: 2022-12-06 16:30:53

One of the Luos Creators Viktoria, flashed 25 STM32F0 with the Luos Bootloader in less than 30 seconds. 

⏩Check out her [project](https://www.youtube.com/shorts/NrDbMe79TNA)

If you have been working on any projects using Luos and you want us to give them a platform, upload a video of your project to Youtube and send us the link via discord!
Fix vetur can't find package.json Error
Published: 2022-12-06 15:55:39

Working with vs code and vue project, we may encounter error from vs code “vetur can't find
package.json” .
The problem,sometimes, causes by vetur, because it looks for the package.json in root directory of
opening folder. We need to add a vetur.config.js file in the root folder of the project.
The content follows:
// vetur.config.js
/** @type {import('vls').VeturConfig} */
module.exports = {
// **optional** default: `{}`
// override vscode settings
// Notice: It only affects the settings used by Vetur.
settings: {
"vetur.useWorkspaceDependencies": true,
"vetur.experimental.templateInterpolationService": true
},
// **optional** default: `[{ root: './' }]`
// support monorepos
projects: [
'./packages/repo2', // shorthand for only root.
{
// **required**
// Where is your project?
// It is relative to `vetur.config.js`.
root: './packages/repo1',
// **optional** default: `'package.json'`
// Where is `package.json` in the project?
// We use it to determine the version of vue.
// It is relative to root property.
package: './package.json',
// **optional**
// Where is TypeScript config file in the project?
// It is relative to root property.
tsconfig: './tsconfig.json',
// **optional** default: `'./.vscode/vetur/snippets'`
// Where is vetur custom snippets folders?
snippetFolder: './.vscode/vetur/snippets',
// **optional** default: `[]`
// Register globally Vue component glob.
// If you set it, you can get completion by that components.
// It is relative to root property.
// Notice: It won't actually do it. You need to use `require.context` or `Vue.component`
globalComponents: [
'./src/components/**/*.vue'
]
}
]
}
Easy way to create tables in database
Published: 2022-12-06 16:16:10

rails db:rollback in the terminal drops the most recent table in database.

Discard changes in Git.Then type rails generate draft:resource movie title:string description:text director_id:integer

this line in the terminal creates the routes for you, as well as the specific controller and in views as well!

At the end of that, ensure that you type rails db:migrate in the terminal so that is can be properly placed. If not then an error message saying "Migrations pending" will appear.