teleren/devto huggingface dataset:
Request location and telegram bot
Tags: rust, telegram, tutorial, beginners
Published: 2023-03-12 06:34:43

Back in the spring/summer of sad 2022 I made a bot for an advertising agency in Tbilisi. (I did the work for free) This bot sends the user 3 nearest cafes. This bot needs to be simplified by making one button labeled "Send your location please". The Telegram API allows that. It took me a long time to solve that problem. Why? Let's figure it out.
```Rust
[dependencies]
carapax = "0.12.0"
```
How do we create a button for some telegram bot with carapax? A simple button with text like this:
```Rust
api.execute(SendMessage::new(
    chat_id.clone(),
    "Please send your location to the chat room ☺️",
)).await?;
```
Button with the function, for example, to go to the google map would be look something like this:
```Rust
api.execute(SendMessage::new(
        chat_id.clone(), &museum.description).reply_markup(vec![vec![
        InlineKeyboardButton::with_url("Open google map",  &museum.google),
    ]]),
).await?;
```
Notice anything in common? How would you create a button to query a user's geo location? Same way. In Python, by the way, it's about the same logic for creating a button requesting geo location.
But carapax will resent that you didn't give it "self"... I.e. the button should refer to itself. And this is what it should look like in the end:
```Rust
let send_location = KeyboardButton::new("Send location");

api.execute(SendMessage::new(
        chat_id.clone(), "Hi! To find the nearest museum, please send your geo-location to the chat.").reply_markup(vec![vec![
        KeyboardButton::request_location(send_location),
    ]]),
).await?;
```
Not
```Rust
KeyboardButton::request_location("Send location"),
```
Not
```Rust
KeyboardButton::request_location("Send location", true),
```
And that's pretty weird.

Now that you've seen how it's done, it doesn't look too difficult. But when you don't know how to do it, especially when you've been studying programming for less than half a year like me, you feel like you're at a dead end. And the documentation doesn't come to your aid.

Why don't I swap the carapax library for some other library? The others are no better.

<a href="http://www.youtube.com/watch?feature=player_embedded&v=v6Rv281E74k
" target="_blank"><img src="http://img.youtube.com/vi/v6Rv281E74k/0.jpg"</a>
"[eslint] Delete `CR` [prettier/prettier]"
Tags: vscode, typescript, prettier, window
Published: 2023-03-12 05:33:22

If you are getting the error, an easy solution is to add an exception to your .**eslintrc.js** under object **"rules"** as following"
`'prettier/prettier' : ['error', {
      'endOfLine': 'auto'
    }]`
Connect Four Terminal Game
Tags: python, portfolio, gamedev, beginners
Published: 2023-03-12 05:32:08

This is a terminal game that I have developed using basic python as a portfolio project in my Computer Science CodeCademy career path. I chose thsi game as it seemed challenging for me to come up with the proper data structures and the logics behind it.

![Game Main Menu](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p9ltb6g1xfxlpmu8pqds.jpeg)

I have taken 6 lists with 7 empty spaces representing the rows as the original game has a 6x7 board. These 6 list are then in another list called board. Any change in the board is done via different functions, but all changes can be seen in the "board" list. There is also a function to properly print the contents of the board using two nested loops.

You can find the different steps I've taken and the code comments on [gitHub](https://github.com/ma5hti/connect-four-2p).
Using angular universal / ssr in google cache displays blank page
Tags: angular, ssr
Published: 2023-03-12 05:15:02



I have used angular 14 with universal / SSR in Google cache version its is showing me a white page.
Below I have attached Screen shot.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y74jqtgy96jyvidyt5df.png)

So Please suggest best solution
5 Digital Marketing Strategies to Boost Your B2B Business
Published: 2023-03-09 11:23:39



Digital marketing is a vital component of any B2B business's growth and success. However, with so many options and channels available, it can be overwhelming to decide where to focus your efforts. Here are five effective digital marketing strategies to consider:

Develop a Strong Content Strategy: Content marketing is a powerful way to attract and engage potential customers. Develop a content strategy that aligns with your target audience's needs and interests, and provides valuable information that establishes your business as an authority in your industry. This can include blog posts, whitepapers, case studies, and more.

Leverage Social Media: Social media platforms offer a unique opportunity to connect with potential customers and promote your brand. Identify the platforms where your target audience is most active, and create a social media strategy that includes regular posting, engaging with followers, and paid advertising campaigns.

Optimize for Search Engines: Search engine optimization (SEO) can help your business appear higher in search engine results pages, making it easier for potential customers to find you. This includes optimizing your website's content and structure, using relevant keywords, and building high-quality backlinks from reputable sources.

Implement Email Marketing: Email marketing is a cost-effective way to reach potential and existing customers directly. Create targeted email campaigns that provide value and encourage engagement, such as newsletters, promotional offers, or event invitations.

Invest in Account-Based Marketing: Account-based marketing (ABM) is a targeted approach that focuses on specific accounts or companies rather than a broad audience. This involves creating personalized campaigns and content tailored to the needs and interests of individual accounts, and can lead to higher conversion rates and stronger customer relationships.

Implementing these digital marketing strategies can help your B2B business increase brand awareness, generate leads, and drive sales. However, it's important to continually evaluate and adjust your strategies based on data and results to ensure ongoing succes
KlinterAI Ancillary Services
Tags: legal, ancillary, dispute, privatesecuredataexchange
Published: 2023-03-12 02:55:38


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

## **Business Cases of KlinterAI**

### **Labour & Contract POs**

A Punch List is created on a monthly or bi-monthly basis by a Site Inspector, which requires manual identification over a Quality Inspection. Our database is used to produce Safety incidents detected over a Computer Vision Depth-Camera into the Punch Lists. A Daily Report is sent to the Client weekly or monthly, consisting of the Number and Types of Piles, and its measures. These would be generated from our AI Platform, KlinterAI, that supports counting of Number of Piles, recording the type of Activities involving any Repairs or Maintenance, and using the BIM to obtain the Types of Piles, Measures into the Daily Report. We are researchers of the FPS (Federation of Piling Specialists) and AGS Data Format because we need to improve the Security not only for Open Sites, but also for Computer Vision and IoT related tasks, in the Cloud too.  

### **Costing and Classification Codes**

To integrate Costing into BIM, there are Costing sheets, Bill of Materials (BOM), Labour & Contract Purchase Orders integrated into the BIM. These are overall costs affecting the Construction Project, and will only convey the Productivity in terms of a Quotient. To report on the Multi-Factor Productivity, which is low in the UK from 1972 onwards, it requires us to understand whether we are actually prioritizing the Costing based on Materials, Labour, Maintenance, and Repairs. How do we efficiently report the Classification Code against an Activity that Revit has developed for a Construction Site work? 

### **Environmental Incident**

Consider you have an oil leakage, and you want to use an Ancillary Equipment for mitigating the risk, such as an Oil Absorbing Carpet. You also would like to approach ancillary processes such as the Regulatory Authorities and Media, then it would be best to use a Platform that would enable you to reduce the reputation damage caused due to a delayed site work and improve your branding. 

### **Resolving Disputes and Conflict Resolution**

How would you approach, if you had a legal claim or litigation against your corporation for an oil leakage, for whom the client is not satisfied with what you produced or communicated towards a Daily Report? 

### **WiFi Crack and Cyber Security Threat**

Consider an individual or a hacker group, wants to collect data on machinery and IoT devices installed, by cracking the WiFi network. What would you do to integrate a Private & Secure Data Transfer?
KlinterAI Costing Labour Contract POs
Tags: classificationcodes, activityrecognition, ganttchart, foreman
Published: 2023-03-12 02:45:32


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

## **Business Cases of KlinterAI**

### **Labour & Contract POs**

A Punch List is created on a monthly or bi-monthly basis by a Site Inspector, which requires manual identification over a Quality Inspection. Our database is used to produce Safety incidents detected over a Computer Vision Depth-Camera into the Punch Lists. A Daily Report is sent to the Client weekly or monthly, consisting of the Number and Types of Piles, and its measures. These would be generated from our AI Platform, KlinterAI, that supports counting of Number of Piles, recording the type of Activities involving any Repairs or Maintenance, and using the BIM to obtain the Types of Piles, Measures into the Daily Report. We are researchers of the FPS (Federation of Piling Specialists) and AGS Data Format because we need to improve the Security not only for Open Sites, but also for Computer Vision and IoT related tasks, in the Cloud too.  

### **Costing and Classification Codes**

To integrate Costing into BIM, there are Costing sheets, Bill of Materials (BOM), Labour & Contract Purchase Orders integrated into the BIM. These are overall costs affecting the Construction Project, and will only convey the Productivity in terms of a Quotient. To report on the Multi-Factor Productivity, which is low in the UK from 1972 onwards, it requires us to understand whether we are actually prioritizing the Costing based on Materials, Labour, Maintenance, and Repairs. How do we efficiently report the Classification Code against an Activity that Revit has developed for a Construction Site work? 

### **Environmental Incident**

Consider you have an oil leakage, and you want to use an Ancillary Equipment for mitigating the risk, such as an Oil Absorbing Carpet. You also would like to approach ancillary processes such as the Regulatory Authorities and Media, then it would be best to use a Platform that would enable you to reduce the reputation damage caused due to a delayed site work and improve your branding. 

### **Resolving Disputes and Conflict Resolution**

How would you approach, if you had a legal claim or litigation against your corporation for an oil leakage, for whom the client is not satisfied with what you produced or communicated towards a Daily Report? 

### **WiFi Crack and Cyber Security Threat**

Consider an individual or a hacker group, wants to collect data on machinery and IoT devices installed, by cracking the WiFi network. What would you do to integrate a Private & Secure Data Transfer?
nano-pinia
Tags: vue, pinia
Published: 2023-03-12 02:21:19

One of the best qualities of Pinia is that it is actually a way to properly implement the singleton pattern. You define it as a function that always returns the same value.

I thought, since Vue already exposes the reactivity system as  a separate package, can I implement singletons just like Pinia does - just without Pinia? What if I chose to only use the composition API?

```javascript
function defineSingleton(cb) {
  const state = cb()
  return () => state
}
```

That's it - nano-pinia in 4 lines or less :).

You use it just like you would use Pinia:

```javascript
const useStore = defineSingleton(() => {
  const x = ref(1)
  const y = ref(2)
  const sum = computed(() => x.value + y.value)

  function incY() {
    y.value++
  }

  return { x, incY, sum }
})

// use the store instance directly
const s1 = useStore()
s1.x.value = 5
// or destructure the content
const { incY, sum } = useStore()
incY()

// it doesn't matter - it's a singleton
console.log(sum.value) // outputs: 8
```

I think it's cool that you can do that with so little effort :) And it's a nice example of how to use closures - but who cares, right?
React Hooks Fundamentals -useState()...
Tags: beginners, javascript, react, frontend
Published: 2023-03-12 01:54:37

React.js is a front-end Library of JavaScript which is Opensource that supports a feature called Virtual DOM, which is not that different from the real DOM, its just a kinda another DOM in the Browser itself. Making it more interactive to built and user friendly, basically its just divided in  Components based architecture that helps in isolate the code and reuse whenever required.
Hooks are are the Special feature of react as introduced after 16.8 version making it more accessible to user/dev as the functions are predefined in react itself that have the primary role
Before You Learn About Hooks...

**Before you think of hooks, think of plain-old (aka vanilla) JavaScript functions.**

In Js, functions are reusable code logic to perform repeated tasks. Functions are composable. 

Let take an example that some-function() function composes (uses) functions a() and b(). The b() function uses the function c(). so its composable regarding the feature of Js 
Components are basically State-full(locally stored) State-less(- a pure function & not stored locally and with side-effects) so removing the side effects and stateful (isolating) we have the stateless component with stateful logic , so here comes react in picture So, we can now isolate all the stateful logic in hooks and use (compose them, as hooks are functions, too) into the components.

Now the Crises of Stateful logic ? here its any thing that is used to declare and manage a function , Now that we have a blur picture of Components , state-Full and State-less , and there logic we can understand the react Hooks as 

**Hooks let you split one component into smaller functions based on what pieces are related (such as setting up a subscription or fetching data)**rather than forcing a split based on lifecycle methods. You may also opt into managing the component’s local state with a reducer to make it more predictable.
    

-    **useState:** To manage states. Returns a stateful value and an updater function to update it.
-    **useEffect:** To manage side-effects like API calls, subscriptions, timers, mutations, and more.
-    **useContext:** To return the current value for a context.
-    **useReducer:** A useState alternative to help with complex state management.
-    **useCallback:** It returns a memorized version of a callback to help a child component not re-render unnecessarily.
-     **useMemo**: It returns a memorized value that helps in performance optimizations.
-     **useRef**: It returns a ref object with a .current property. The ref object is mutable. It is mainly used to access a child component imperatively.
-     **useLayoutEffect**: It fires at the end of all DOM mutations. It's best to use useEffect as much as possible over this one as the useLayoutEffect fires synchronously.
-     **useDebugValue**: Helps to display a label in React Dev Tools for custom hooks.

if we see clearly that use is used frequently yes it is the Standard practice to identify the hooks in reacts 
For more understanding let me know
Setting Up a Soroban Development Environment on Windows Using Ubuntu-WSL: A Beginner Tutorial
Published: 2023-03-12 00:14:28

here is a step-by-step beginner tutorial on how to set up a Soroban development environment on Windows using Ubuntu-WSL:

Install Ubuntu-WSL: The first step is to install Ubuntu-WSL on your Windows machine. You can do this by following the instructions provided by Microsoft on their website.

Open the Ubuntu terminal: Once you have installed Ubuntu-WSL, open the Ubuntu terminal. You can do this by searching for "Ubuntu" in the Start menu and clicking on the Ubuntu app.

Install a Soroban emulator: You will need an emulator to simulate the Soroban on your computer. There are many Soroban emulators available online, but a popular one is the "Virtual Soroban" emulator. You can install it using the following command in the Ubuntu terminal:

csharp
Copy code

```
sudo apt-get install soroban
```
Install a Soroban font: To display Soroban characters properly in your code editor, you'll need to install a Soroban font. A popular one is the "Soroban Regular" font. You can install it using the following command in the Ubuntu terminal:

csharp
Copy code

```
sudo apt-get install fonts-soroban
```
Choose a text editor or IDE: Next, choose a text editor or Integrated Development Environment (IDE) to write your Soroban code. Some popular options include Visual Studio Code, Sublime Text, and Notepad++. You can install your preferred text editor or IDE using the following command in the Ubuntu terminal:

php
Copy code

```
sudo snap install <text editor or IDE name>
```
Configure your text editor or IDE: Once you have installed your text editor or IDE, you need to configure it to use the Soroban font. You can do this by going to the preferences or settings of your text editor or IDE and selecting the Soroban font.

Create a new Soroban project: You are now ready to start writing Soroban code in your text editor or IDE. Create a new Soroban project and start coding!
Scala google summer code 2023 is here
Tags: scala, camp, opensource, challenge
Published: 2023-03-11 23:57:00


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


[Official blog of the Scala center](https://www.scala-lang.org/blog-detail/2023/02/28/acceptd-to-gsoc-2023.html)

The Google Summer of Code is like the ultimate opportunity for students to level up their skills in Scala. This is a program where you can work on dope open-source projects that are mentored by the best in the biz.

Imagine this, you're working on real-world projects, and you have legit devs guiding you through the process. It's like being part of a guild of wiz with the best wizards teaching you how to cast spells! By working on these projects, you can learn the best practices for software development, like testing and version control.

And yo, Scala is a new language, not many universities teach it. So by joining the Summer of Code, you can enhance your Scala game. You can learn how to write slick, efficient, and scalable code. It's like mastering those magic spells that only the most powerful wizards know!

But wait, there's more! You can contribute to open-source projects too! Yeah, you heard it right, you can be part of something that's used by millions of peeps worldwide. Plus, it's a great way to flex your skills to potential employers. Show them what you got!

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

Lastly, let's talk about networking. You can connect with experienced devs and mentors, and build your professional circle. It's like being part of a secret society of wizards, but for your career. These connections can guide you, provide advice, and help you grow in the industry.

So, all in all, if you're looking to up your Scala game, get involved in some cool projects, contribute to open-source, and connect with experienced devs, then the Google Summer of Code is where it's at, my friends! It's like the ultimate power-up for your career, and you don't want to miss out on that, do you?

If you are looking to contribute to the Scala community, this is the perfect opportunity to work on exciting projects and gain valuable experience with guidance from experienced mentors. To participate, please check out all the proposed projects at https://github.com/scalacenter/GoogleSummerOfCode and get in touch with the mentors for the project you are interested in.

The GSoC contributor application opens on March 20th at 18:00 UTC and closes on April 4th at 18:00 UTC. Reach out to our mentors to discuss project ideas and submit your application before the deadline!!!!
Essential SQL statements for Data Science
Published: 2023-03-11 23:42:40

> I love SQL - it's like a Swiss Army knife for data science. Except instead of a knife, it's a query language. And instead of a corkscrew, it's a JOIN statement. And instead of a toothpick, it's a GROUP BY clause...


As a data scientist, being proficient in SQL is essential to wrangle data, conduct analyses, and draw insights from your datasets. SQL, or Structured Query Language, is the standard language for managing and manipulating data in relational databases. In this article, we’ll walk you through some essential SQL statements that every data scientist should know.

**SELECT**: The SELECT statement is used to retrieve data from a database. It’s a fundamental SQL statement that you’ll use in almost every query. You can use it to select specific columns, aggregate data, or join tables.

**WHERE**: The WHERE statement is used to filter data based on specific conditions. It allows you to extract only the data that meets certain criteria, such as filtering by date range, location, or other relevant attributes.

**JOIN**: The JOIN statement is used to combine data from multiple tables into a single result set. There are several types of joins, including inner join, left join, right join, and full outer join, depending on how you want to combine the data.

**GROUP BY**: The GROUP BY statement is used to group data based on one or more columns. It allows you to aggregate data, such as counting or summing, and to calculate statistics, such as averages or medians, for each group.

**ORDER BY**: The ORDER BY statement is used to sort data in ascending or descending order based on one or more columns. It allows you to view data in a specific order, such as sorting by date or by the number of occurrences.

**LIMIT**: The LIMIT statement is used to restrict the number of rows returned by a query. It’s particularly useful when dealing with large datasets, allowing you to focus on a specific subset of the data.

**HAVING**: The HAVING statement is used to filter data based on conditions applied to the result of an aggregate function. It allows you to extract data that meets certain criteria after grouping and aggregating.

By mastering these essential SQL statements, you’ll be able to query and analyze your data with ease. Whether you’re extracting insights from a large dataset, conducting A/B testing, or building predictive models, SQL is a crucial skill that every data scientist should have in their toolkit.

In conclusion, understanding these essential SQL statements is crucial for any data scientist looking to effectively manage and analyze data. With the ability to filter, join, group, and aggregate data, as well as sort and limit results, you can easily extract valuable insights and make data-driven decisions. So, brush up on your SQL skills and start exploring the power of data science today!