teleren/devto huggingface dataset:
Http logs in Flutter app with talker is easy as possible
Tags: dart, flutter, api, opensource
Published: 2022-10-13 20:08:17

A major update of the talker package has recently been released. 
New release contains updated TalkerScreen with more actions and logs file sharing, fixed logs generation and etc.

😳 But another one big thing in update is [talker_dio_logger](https://pub.dev/packages/talker_dio_logger) package that **can integrate http logs as simple as it can ever be done**. 

Let's take it in turns.

## How it will works 

![talker_dio_logger](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/147yt2nkptv3w8kz49i9.png)


talker_dio_logger is a separate package that works on the basis of [talker](https://pub.dev/packages/talker) error handler and logger package and [dio](https://pub.dev/packages/dio) most popular and powerful dart http client.


When you connect it, all information about your work on the network gets into talker's history and the console of the running application.

## Get Started
Follow these steps to run talker_dio_logger in your project and see all http logs

### Add dependency
```yaml
dependencies:
  talker_dio_logger: ^0.1.3
```

### Usage
Just add **TalkerDioLogger** to your dio instance and it will work

```dart
final dio = Dio();
dio.interceptors.add(
    TalkerDioLogger(
        settings: const TalkerDioLoggerSettings(
          printRequestHeaders: true,
          printResponseHeaders: true,
        ),
    ),
);
```

### Using with Talker
You can add your talker instance for TalkerDioLogger if your app already uses Talker.

In this case, all logs and errors will fall into your unified talker tracking system

```dart
final talker = Talker();
final dio = Dio();
dio.interceptors.add(
    TalkerDioLogger(
        talker: talker,
        settings: const TalkerDioLoggerSettings(
          printRequestHeaders: true,
          printResponseHeaders: true,
        ),
    ),
);
```

😎 Go to the [GitHub repository page](https://github.com/Frezyx/talker)! 
🥵 Here you can see beautiful examples of usage and code snippets. 

Show some ❤️ and star the repo to support the project!
Calculate values in background and use the result after with Swift concurrency
Tags: ios, swift, structuredconcurrency
Published: 2022-10-14 07:59:07

---
title: Calculate values in background and use the result after with Swift concurrency
published: true
date: 2022-10-13 20:07:08 UTC
tags: ios, swift, structuredconcurrency
canonical_url: https://tarikdahic.com/posts/calculate-values-in-background-and-use-the-result-after-with-swift-concurrency/
---

If you need to compute a value and don’t want to block the main thread you can do so by calculating that value in a Swift Task structure that will return that computed value. Prior to Swift concurrency you would probably jump to a background queue and compute the value that you need and proceed with some action if necessary.

Let’s jump into an example. I defined a struct called `Example` that will create a Task at its init in which it will try to compute and return a `String` value. The struct will also have an async method called `value()` which will return that computed value.

```swift
struct Example {
  
  private var someTask: Task<String, Error> = Task {
    // Some calculation
    try await Task.sleep(nanoseconds: 3_000_000_000)
    return "example"
  }

  func value() async throws -> String {
    return try await someTask.value
  }
}
```

When we want to access the computed value we can use the `value` property that is defined on the Swift Task structure. If the task hasn’t completed, accessing this property waits for it to complete and its priority increases to that of the current task.

To use the `Example` structure we need to instantiate it and read the value from an async context:

```swift
let example = Example()

Task {
  do {
    print("Value is:", try await example.value())
  }
}
```

If the Task will not throw an error then its type would be `Task<ReturnType, Never>` and we wouldn’t need to use `try` keyword when accessing the task’s value.

This has helped me in some situation where I want to calculate something in advance and if user requests it that I instantly have it. For example, I wanted to compress the image from camera in case user presses the button to send the image. I start the compression on the image preview screen and then when user wants to send it I have the compressed image ready.
Digital Marketing Requirements
Tags: digitalmarketing, beginners, career
Published: 2022-10-13 20:06:35

## Digital Marketing means _promoting brands to connect with potential customers using Internet or other digital communication._

Digital Marketing Requires **6** things at the very beginning.

1.**Patience**
You will have to waste a long time to be an intermediate marketer. So, if you think you'll earn money within a month then you're on the wrong path. Learning the white hat marketing will cost you time and hard work.

2.**Motive to learn first**
As i mentioned before, you can't earn if you don't learn first. So be calm and learn. It'll develop your skills learning ability.

3.**Set Goal**
Set a goal or industry from where you want to start and then work for it.

4.**Research Ability**
You shouldn't stop after researching a few information. Remember, the more you research the more latest information you'll gather.

5.**Practical Practice**
Practice every single thing practically after you read blogs or watch tutorials. It'll help you to overcome your errors.

6.**Improvement**
Keep Improvising yourself. Work with new technologies and "Be a better version of yourself"
Discussion and Comment of the Week - v20
Tags: bestofdev
Published: 2022-10-13 19:44:05

This weekly roundup highlights what we believe to be the most thoughtful and/or interesting discussion of the week. We're also be highlighting one particularly cool comment in each installment. 🙌

The DEV Community is particularly special because of the kind and thoughtful discussions happening between community members. As such, we want to encourage folks to participate in discussions and reward those who are initiating or taking part in conversations across the community. After all, a community is made possible by the people interacting inside it.

## Discussion of the Week

For this week's discussion of the week, I'd like to give it up for @adam_cyclones' "[😬 Company takeovers, what now?](https://dev.to/adam_cyclones/company-takeovers-what-now-5hfl)"

{% embed https://dev.to/adam_cyclones/company-takeovers-what-now-5hfl %}

If you've yet to experience a company takeover, it can be a wild ride (speaking from personal experience).

> "I love where I work and I don't want it to change"

Adam's apprehension is very relatable and no doubt others who have experienced similar situations are familiar with the worry of potential big changes a company takeover may bring.

Notably, Joe (@theaccordance) chimed in with a shout-out worthy comment full of great advice:

{% embed https://dev.to/theaccordance/comment/228d7 %}

## Comment of the Week

The Comment of the Week is a tie this week! We're rewarding it to both @mykezero & @codingchili for the awesome advice they each dropped in response to @amabdev's thoughtful prompt [How do you promote knowledge sharing?](https://dev.to/amabdev/how-do-you-share-knowledge-inside-your-team-1p16)

{% embed https://dev.to/mykezero/comment/2263d %}

@mykezero's comment does a fantastic job of outlining methods for both acquiring and sharing knowledge. It's a punchy, bullet point list and very actionable.

{% embed https://dev.to/codingchili/comment/225ne %}

@codingchili's responded with a link to their awesome post here:

{% embed https://dev.to/codingchili/tips-for-boosting-knowledge-sharing-1f93 %}

This excellent (first!) post by Robin dives deep and offers some really great guidance for knowledge sharing! I particularly loved the wrap-up section with the "recipe for knowledge". 

Some of the guidance in Robin's post intersects with the suggestions in Mykezero's comment, but both resources really compliment each other! Nicely done, y'all — and great prompt, AmabDev.

## What are your picks?

There's loads of great discussions and comments floating about in this community. These are just a few we chose to highlight. 🙂

I urge you all to share your favorite comment and/or discussion of the past week below in the comments. And if you're up for it, give the author an @mention — it'll probably make 'em feel good. 💚
Building HTML for your Jupyter book
Published: 2022-10-13 19:44:00

Here, we will convert a Jupyter book to an HTML Gitlab page.

Before we start, see [Max's guide](https://dev.to/mmyros/jupyter-notebooks-on-gitlab-pages-4p8e) on how to set up a Jupyter book on your computer.

1. Ensure your book’s content is in your book folder and you’ve defined your book’s structure in _toc.yml.

2. In terminal, change the directory to your book folder.
`cd projects/mpfc_sst_project`

3. Build your book's HTML.
`jb build mpfc_sst_project`

4. Preview your built HTML in a web browser.
[file:///C:/Users/hsiangm2/PycharmProjects/projects/mpfc_sst_project/mpfc_sst_project/_build/html/intro.html](file:///C:/Users/hsiangm2/PycharmProjects/projects/mpfc_sst_project/mpfc_sst_project/_build/html/intro.html)

5. Sync changes to Gitlab.
`Git add *`
`Git commit -m "message"`
`Git push`

6. View your updated Gitlab page!
[https://hsiangm2.gitlab.io/mpfc_sst_project/](https://hsiangm2.gitlab.io/mpfc_sst_project/)
RTSP Stream to Chrome or a stand alone application that runs on Windows 11
Published: 2022-10-13 19:42:44

I am looking for some help in developing software that can pull rtsp streams from multiple cameras and place them in a chrome or Edge browser. In addition, if it is easier to write an application that can run for Windows 11 that would be fine as well.

Most of the software that comes with the different cameras have banners and extra information that I would prefer to NOT have displayed.

See the example below of 4 hik-vision cameras viewed via Internet explorer. I clicked on a button that displays full screen.


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

Thank in advance for any help or direction.
Bob Janelli
How to automate your web developer's routine with Gulp
Tags: productivity, gulp, automation, optimization
Published: 2022-10-13 19:22:01

I was on a complete mess while i was trying to minify CSS, JavaScript and image files in my daily routine at the office. I was mainly using software installed on PC and online tools per case!

I felt tired really soon as one tool was better in f.e image compression than the other one. Some others went offline etc. Then i realized that i should search for a better solution and found an open-source JavaScript toolkit named **Gulp**! 
Ye, ye i have not discovered the wheel i know :) however it was important for me to simplify the repeated tasks and at the same time stay organized on the heavier ones.

That was the reason behind the creation of this Gulp tool!  

## All in one
What i tried is to implement a number of functionalities in one place. I will do a quick presentation below and quote the link on my GitHub for more details.

###Export in WebP format
`gulp exportWebp`
Converting a WebP image file format from **png**, **jpg** and **gif** images was a complex process. That's exactly, it was!

###Minify almost everything
This group of processes is so important in web performance sector nowadays. We have now a vary options of minifying images, CSS, JavaScript and html files! Amazing! 

###Beautify the files
We can beautify a file when it's already minified and we want to apply some changes. I know it's hard that's why this option was implemented!

###Remove all files
`gulp clean` 
This command will remove all the files.

## My Gulp tool on Github
{% embed https://github.com/webgiftdev/gulp-project %}

Hope this tool help you.
Developed and used by [webgift dev](https://webgift.dev) office.
Update.
Tags: python, beginners, programming, crashcourse
Published: 2022-10-13 18:43:07

As of today I finished Ch 14 of the Python Crash Course book. To be honest, it was overwhelming. However, I did get a good grasp of what it takes to build a full video game project. It showed me how important the fundamental concepts are. I will continue working on the final two projects(Data visualization, Django). My goal is to grasp the what it takes to build these projects, and then I will review the fundamental concepts AGAIN. I try my best to understand the code that I followed to create Space Invaders, but I understand I still have a long way to go.
Installing Graphviz for Windows 10
Published: 2022-10-13 18:32:39

Datajoint uses Graphviz to generate ERDs (entity relationship diagrams). This guide will show you how to install GraphViz and PyDot, a Python interface to Graphviz’s Dot language. Adapted from [DataJoint Python Windows Install Guide](https://docs.datajoint.org/python/setup/02-DataJoint-Python-Windows-Install-Guide.html?highlight=graphviz).

1. Install the latest version of Graphviz for Windows [(64-bit EXE installer)](https://graphviz.org/download/).

2. Select "Add Graphviz to the system PATH".

3. Verify Graphviz has been added to the system path by typing `dot -V` in a fresh command window.

4. If dot is not found, manually add the path of the folder containing the Graphviz binary.

Start Search>"Edit the system environment variables">Advanced>Environment Variables>System variables>Path>New>C:\Program Files\Graphviz\bin

5. Verify Graphviz has been added to the system path by typing `dot -V` in a fresh command window.

6. Install the PyDotPlus library using `pip install pydotplus`.
Babel (transcompiler)
Tags: javascript, beginners, webdev, programming
Published: 2022-10-13 18:27:51

> The transpiler Babel currently has the best coverage in terms of new language features. You can use it for all your real world programming needs without a problem.


https://en.owl.institute/my-account/my-courses/363602/947713/appendix-a-language-versions-and-transpilers-from-js-to-js#toc_ref_24.3

> Babel is a free and open-source JavaScript transcompiler that is mainly used to convert ECMAScript 2015+ (ES6+) code into backwards-compatible JavaScript code that can be run by older JavaScript engines. It allows web developers to take advantage of the newest features of the language.[4]

> 
Developers can use new JavaScript language features by using Babel to convert their source code into versions of JavaScript that a Web browser can process.[5] Babel is used to compile TypeScript into JavaScript.[6] The core version of Babel was downloaded 5 million times a month in 2016, and this increased to 16 million times a week in 2019.[7][8]

> 
Babel plugins transform syntax that is not widely supported into a backward-compatible version. For example, arrow functions, which are specified in ES6, are converted into regular function declarations.[9] Non-standard JavaScript syntax such as JSX can also be transformed.[10][11]

> 
Babel can automatically inject polyfills provided by core-js[12] for support features that are missing entirely from JavaScript environments. For example, static methods such as Array.from and built-ins such as Promise are available only in ES6 and above, but they can be used in older environments if core-js is used.

https://en.wikipedia.org/wiki/Babel_(transcompiler)

https://babeljs.io/
JS Arithmetic Operators
Tags: javascript, webdev, programming, beginners
Published: 2022-10-13 18:20:00

JavaScript Arithmetic Operators

https://www.w3schools.com/js/js_arithmetic.asp

https://en.owl.institute/my-account/my-courses/363602/947713/operators-data-types-and-other-priorities-javascript-as-a-pocket-calculator-arithmetic-operators#toc_ref_3.2

https://en.owl.institute/my-account/my-courses/363602/947713/type-conversion-and-numbers-which-aren-t-numbers#toc_ref_7.1
Problem in C Pointer
Tags: c, pointer, struct, enum
Published: 2022-10-13 18:17:44

I Have a problem in my C code.
I can't explain the topic name as I am not sure exactly but expecting it may be in pointer.
the portion of code has been given below:

`typedef struct Node{
}Node;
typedef enum{
}
int main(){
Node *add = (*makeFunc(ADD))(10, 6);
Node *mul = (*makeFunc(MUL))(5, 4);
calc(add);// result is: 16
calc(mul);//result is 20
}`

**Now the question is should I create a function named makeFunc(int a, int b) ? if i create the I know I can sent (10 ,6) as parameter but why (ADD) or (MUL) is processing here?**


Help me by at least how to solve or topic name,else give me the solution please.
Thanks!!!
API, Array-API
Tags: api, javascript, webdev, programming
Published: 2022-10-13 18:11:20

https://en.owl.institute/my-account/my-courses/363602/947713/one-for-all-and-all-for-one-arrays-keeping-things-neat-and-tidy-using-sort#toc_ref_15.7

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array?retiredLocale=de

https://www.w3schools.com/jsref/jsref_obj_array.asp
How to change the WordPress website to Wix?
Tags: websit, webdev, programming
Published: 2022-10-13 18:08:24

If you're looking to change your WordPress [website ](https://agclandscapes.com.au/)to Wix, there are a few things you'll need to do. You'll need to export your content from WordPress, create a new site on Wix, and then import your content into Wix.
The first thing you'll need to do is export your content from WordPress. You can do this by going to Tools > Export in your WordPress dashboard. Once you've exported your content, you'll be able to import it into Wix.
To create a new Wix site, go to www.wix.com and click "Create a Site." You'll be able to choose from various templates and designs for your new site. Once you've chosen a template, you can begin importing your content from WordPress.
How to select a screen element in Shirates
Tags: appium, android, ios, testautomation
Published: 2022-10-13 18:05:40

This article is an introduction of how to use [Shirates](https://dev.to/wave1008/introducing-shirates-a-mobile-testing-automation-tool-3nmc), a mobile testing automation tool.

## How to select a screen element
You can select by following methods.
- text
- accessibility(content-desc)
- id(resource-id)
- class
- xpath

### By text

You can select an element by simple code.

```kotlin
select("text")
```

You can also select an element with scrolling as follows.

```kotlin
selectWithScrollDown("text")
```

### By accessibility(content-desc)

You can select an element by content-desc with putting prefix "@" before the content-desc value.

```kotlin
select("@Navigate up")
```

### By id(resource-id)

You can select an element by resource-id with putting prefix "#" before the id value.

```kotlin
select("#id1")
```

### By class

You can select an element by className with putting prefix "." before the class value.

```kotlin
select(".android.widget.TextView")
```

### By xpath

You can select an element by xpath.

```kotlin
select("xpath=//*[@resource-id='android:id/icon']")
```

See [select](https://github.com/ldi-github/shirates-core/blob/main/doc/markdown/basic/function_property/select_element/select.md) for detail.

---

## Material
You can get complete sample project from [https://github.com/wave1008/shirates-samples-selectors].

### SelectorTest
```kotlin
import org.junit.jupiter.api.Order
import org.junit.jupiter.api.Test
import shirates.core.driver.commandextension.*
import shirates.core.testcode.UITest

class SelectTest : UITest() {

    @Test
    @Order(10)
    fun selectByText() {

        scenario {
            case(1) {
                action {
                    it.select("Network & internet")
                }.expectation {
                    it.textIs("Network & internet")
                }
            }
            case(2) {
                action {
                    it.selectWithScrollDown("System")
                }.expectation {
                    it.textIs("System")
                }
            }
        }
    }

    @Test
    @Order(20)
    fun selectByAccessibility() {

        scenario {
            case(1) {
                condition {
                    it.tapWithScrollDown("System")
                }.action {
                    it.select("@Navigate up")
                }.expectation {
                    it.accessIs("Navigate up")
                }
            }
        }
    }

}
```

### Test Result

![Test Result](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6lx2j398z7r7vxarbgwf.png)

---

## Conclusion

In Shirates, you can select a screen element in simple description.
API, String-API
Tags: javascript, webdev, api, programming
Published: 2022-10-13 18:00:40

> (...)the JS String API provides you with a few functions(...)

https://en.owl.institute/my-account/my-courses/363602/947713/a-veritable-string-potpourri#toc_ref_12

> Strings are useful for holding data that can be represented in text form. Some of the most-used operations on strings are to check their length, to build and concatenate them using the + and += string operators, checking for the existence or location of substrings with the indexOf() method, or extracting substrings with the substring() method.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String?retiredLocale=de

https://developer.mozilla.org/en-US/docs/Learn/JavaScript/First_steps/Useful_string_methods


String-API functions:

- charAt
- includes
- startsWith
- endsWith
-indexOf
- lastIndexOf
- repeat
- substr 
- toLowerCase
- trim

https://en.owl.institute/my-account/my-courses/363602/947713/a-veritable-string-potpourri-reference#toc_ref_12.7
API, Math-API
Tags: api, javascript, webdev, programming
Published: 2022-10-13 17:50:19

> JS developers will often also refer to this object as the Math API. You can think of an API (application programming interface) as a human-machine interface which allows a programmer to access the functionality essential for developing software. Depending on the given situation, this functionality can involve definitions, protocols, etc. In JS, an API generally refers to a set of functions which all relate to a specific topic. For example, the Math API allows you to access all the mathematical functionality available in JS.

https://en.owl.institute/my-account/my-courses/363602/947713/math-because-the-whole-is-greater-than-the-sum-of-its-parts#toc_ref_8.1