teleren/devto huggingface dataset:
Kotlin and it's extenstions
Tags: kotlin, kotlinlanguage, firstarticle
Published: 2020-01-15 05:02:13

---
title: Kotlin and it's extenstions
published: true
description: How is Kotlin always has a fix for our problem
tags: kotlin, kotlinlanguage, firstarticle
---

Here are a few of my favourite shortcuts to work with Kotlin. If you have others, don't hesitate to mention them.

#### 1. chunked [doc](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/chunked.html)

Works on Iterables that are most common to us, like `List`s or `Sequence`s.
It does exactly what it sounds like, splits a collection in equal parts (if possible) and enables us to transform each resulting sublist, all in the same operation.

```kotlin
val initialList = listOf("chair", "table", "couch")
val chunkedTwo = initialList.chunked(2)
// chunkedTwo -> [["chair", "table"], ["couch"]]
val transform = initialList.chunked(2) { subList -> subList.last() }
// transform -> ["table", "couch"]
```

You may have needed this or not, but it's nice to know it's there. Sometimes when you think about it, it's not that difficult to do, but reimplementing the same things may cause you to slip up somewhere, somehow.

#### 2. with [doc](https://kotlinlang.org/docs/reference/scope-functions.html#with)

Scoped functions like `with` enable us to write more verbose code. This one can cut down on the length of the line by scoping to a nested variable in your object. But I think an example is most fit here.

```kotlin
data class Birthday(val year: Int, val month: Int, val day: Int)
data class Person(val name: String, val birthday: BirthDay)
data class Employee(val position: String, val person: Person)

// having a method that receives an employee and computes a string
fun nameAndBirth(employee: Employee) = with(employee.person.birthday) {
    // in here, the scope is actually Birthday
    "${employee.person.name}: $day/$month/$year"
  }
}
```

Another cool fact about `with` is that, like the other functions `run`, `let` and so on, it will return the last value that was computed. In our case, the `String` that contains the name and birth of the employee.

#### 3. associateBy [doc](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/associate-by.html)

This is a great shortcut to create maps for objects that you need to find later on, by certain keys (id, name, length and so on). You could find it really useful, since this, in many cases is repeatable.

```kotlin
data class Room(val id: Long, val name: String, val area: Double)

val rooms = listOf(Room(1, "living", 40.5), Room(2, "living", 39.3))
val associated = rooms.associateBy { it.name }
// associated -> { "living"=Room(2, "living", 39.3)}
val associated2 = rooms.associateBy { it.id }
// associated2 -> { 1=Room(1, "living", 40.5), 2=Room(2, "living", 39.3)}
```
Be careful since if two keys match, only the last one will be present in the resulted map.

Hope you can try these out if you didn't already.

Thanks for Reading
🗞️Edge Chromium, NOAA Datasets, Craft.js, Rete.js, Tiny-Helpers, Diary Email, The Odin Project
Tags: news, webdev, edge, javascript
Published: 2020-01-17 01:51:18

---
title: 🗞️Edge Chromium, NOAA Datasets, Craft.js, Rete.js, Tiny-Helpers, Diary Email, The Odin Project
published: true
date: 2020-01-15 05:00:00 UTC
tags: news, webdev, edge, javascript
canonical_url: https://ajonp.com/blog/aj-s-week-in-web-january-15-2020
cover_image: 
series: ajweekinweb
---

{% youtube 6DhSsWMF3TY %}

# AJ's Week In Web Links

## Edge Chromium

Finally an Edge that I might use! Edge version 79 is now using [Chromium Project](https://www.chromium.org/Home) as an engine.

[https://blogs.windows.com/windowsexperience/2020/01/15/new-year-new-browser-the-new-microsoft-edge-is-out-of-preview-and-now-available-for-download/](https://blogs.windows.com/windowsexperience/2020/01/15/new-year-new-browser-the-new-microsoft-edge-is-out-of-preview-and-now-available-for-download/)

[https://blogs.windows.com/msedgedev/2020/01/15/upgrading-new-microsoft-edge-79-chromium/](https://blogs.windows.com/msedgedev/2020/01/15/upgrading-new-microsoft-edge-79-chromium/)

### Download

[https://www.microsoft.com/en-us/edge?form=MO12GB&OCID=MO12GB](https://www.microsoft.com/en-us/edge?form=MO12GB&OCID=MO12GB)

## NOAA datasets on Google Cloud

[https://cloud.google.com/blog/products/data-analytics/weather-climate-big-data-from-noaa-now-in-cloud](https://cloud.google.com/blog/products/data-analytics/weather-climate-big-data-from-noaa-now-in-cloud)

The agency is providing public access to its environmental datasets in the cloud in accordance with its open data policies.  
  
[https://cloud.google.com/public-datasets](https://cloud.google.com/public-datasets)

## Craft.js

[https://craft.js.org/](https://craft.js.org/)

🚀 A React Framework for building extensible drag and drop page editors

[https://github.com/prevwong/craft.js](https://github.com/prevwong/craft.js)

## Rete.js

[https://rete.js.org/#/](https://rete.js.org/#/)

JavaScript framework for visual programming and creating node editor

[https://github.com/retejs/rete](https://github.com/retejs/rete)

## Tiny Helpers

[https://tiny-helpers.dev/](https://tiny-helpers.dev/)

A collection of free single-purpose online tools for web developers

## Diary Email

[https://diaryemail.com/](https://diaryemail.com/)

Diary as simple as it getsWrite private diary using good old email!

## The Odin Project

[https://www.theodinproject.com/home](https://www.theodinproject.com/home)

A full stack curriculum is free and supported by a passionate open source community.

> This is the website we wish we had when we were learning on our own. We scour the internet looking for only the best resources to supplement your learning and present them in a logical order.
module 2 discussion
Published: 2020-01-15 04:50:19

Module 2 Discussion
Write code to mark the text Gourmet Thai Cooking as a heading with the second level of importance.
<i><h2>Gourmet Thai Cooking</h2></i>
What is the div element and why will you often encounter it in pre-HTML5 code?
The div element contains a generic grouping of elements within the document. You will often encounter it in pre-HTML5 code because prior to HTML5, sections were defined as divisions created using the div element.
What element would you use to indicate a change of topic within a section?
The <hr> tag
Write the code to mark the text Daily Special as emphasized text.
<em>Daily Special</em>
Write code to mark the text H2SO4 with subscripts.
	<i><p>H<sub>2</sub>SO<sub>4</sub></p></i>
Write the code to link the web page to the CSS file mystyles.css.
	<link href=”file” rel=”mystyles.css” />
Write the expression to insert the em dash into a web page using the character code 8212.
&#8212
Write the code to insert an inline image using the source file awlogo.png and the alternate text Art World.
	<img src=”awlogo.png” alt=”Art world”
How to decorate any object in Ruby in 3 lines
Tags: ruby, metaprogramming
Published: 2020-01-15 04:07:28

Here is a quick and easy way to decorate any object instance in Ruby. 


{% gist https://gist.github.com/synth/1c91093bc1efd04db91ae3f9139ae166 %}

This is useful if you don't know or care the object type you are working with but would like to add accessor methods to just that instance. This is a very pure decorator because adding accessors does not rely on internal knowledge of the object. 

We're just dynamically adding functionality to the instance as we need it. 

NOTE: This could clobber existing functionality, so you want be sure you are decorating it with a method name that won't interfere with the object class.
What is an execution plan?
Tags: sql, azure, devops
Published: 2020-01-15 03:31:16

Execution plans can tell you how a query will be executed, or how a query was executed. They are, therefore, the DBA’s primary means of troubleshooting a poorly performing query. Rather than guess at why a given query is performing thousands of scans, putting your I/O through the roof, you can use the execution plan to identify the exact piece of SQL code that is causing the problem. For example, it may be scanning an entire table-worth of data when, with the proper index, it could simply backpack out only the rows you need. All this and more is displayed in the execution plan.
Hobby Project: Dev.to API
Tags: dlang, showdev, sideprojects
Published: 2020-01-15 03:15:14

# Preamble 

First off, a shout out to this article for the inspiration to start this. 

{% link https://dev.to/maxime1992/manage-your-dev-to-blog-posts-from-a-git-repo-and-use-continuous-deployment-to-auto-publish-update-them-143j %}

The first post should actually goto this other post I made.

{% link https://dev.to/jessekphillips/engaging-in-projects-40j4 %}

# The Objective 

I want to create a gitlab pipeline which will publish written articles to Dev.to.

The publication will be done utilizing D in Linux docker containers. How to utilize the project is yet to be determined. 

# The Timeline 

There isn't one. 

# This Series

I have decided to create a blog series to discuss the development efforts. It isn't about doing it "right" but maybe I'll be able to write about where I fell short and why.

# The Repo

https://gitlab.com/jessephillips/devarticlator

I have chosen to utilize gitlab for this project. I have been using gitlab at work and become familiar with the CI tools and the docker integration.

# The Content 

https://gitlab.com/jessephillips/devarticlator/tree/v0.0.1

At this juncture I have code which will pull me articles using a key provided as an environment variable. 

I have chosen the Vibe.d http library as it provides a good selection of tools and quite popular. 

What you will not see is the first attempts where the key was just pasted in.

Refamiliarizing myself with the Vibe.d Json api was the biggest effort.

## TDD

One thing to note is that I have no tests. TDD folks are screaming at me. But here is a confession, I don't know what I am doing. I don't know what interface I want exposed, and I don't know what a good interface would be. I see two ways out of this.

After exploring the api and what I'm doing I could throw out all the code. This would allow me to take what I learned and solidify a test for what I want. 

The other is to affirm that is the point of TDD, I need to create a design upfront and know what I'm trying to do.
Svelte await blocks
Tags: svelte, javascript
Published: 2020-01-15 02:03:55

Few weeks ago I came across Svelte, a radical new approach to building user interfaces (quote from [Svelte homepage](https://svelte.dev/)). Svelte is actually a compiler, not tradional framework like React, Angular or Vue, but it can do pretty much everything as the mentioned ones. It doesn’t use virtual DOM, but instead it compiles to vanilla JavaScript and access the DOM directly. As a consequence, Svelte generated JavaScript is very small comparing to competition, but also quite fast.

But the best think about Svelte is it’s syntax. It looks so easy but in the same time powerful that it intrigued even me as a backend developer. Within few minutes I decided to start learning it and try something new. I had lot of fun since.

Here is a piece of Svelte code (component) to illustrate the simplicity and power:

``` svelte
<script>
  async function fetchData() {
    const res = await fetch("https://jsonplaceholder.typicode.com/todos");
    const data = await res.json();

    if (res.ok) {
      return data;
    } else {
      throw new Error(data);
    }
  }
</script>

{#await fetchData()}
  <p>loading</p>
{:then items}
  {#each items as item}
    <li>{item.id}. {item.title}</li>
  {/each}
{:catch error}
  <p style="color: red">{error.message}</p>
{/await}
```

The code lying in the script tag is just ES6 JavaScript, but the await block beneath is a syntactic sugar from Svelte. So, instead of handling await in plain JavaScript, you can actually handle it in Svelte’s await block. While waiting for asynchronous function to finish, you can also show your loading message or spinner , you can catch and display errors, so basically this block fully handles async calls.

You can play with the code at Svelte’s REPL [here](https://svelte.dev/repl/fdd5034d023146f49614d3b087515df5).
Day32:macro_rules! - 100DayOfRust
Tags: rust
Published: 2020-01-15 02:03:01

We can use `macro_rules` to match a pattern and generate code.

```rust
macro_rules! say_hello {
    () => {
        println!("hello");
    }
}

macro_rules! test {
    ($left:expr; and $right:expr) => {
        println!("{:?} and {:?} is {:?}",
                 stringify!($left),
                 stringify!($right),
                 $left && $right)
    };
    
    ($left:expr; or $right:expr) => {
        println!("{:?} or {:?} is {:?}",
                 stringify!($left),
                 stringify!($right),
                 $left || $right)
    };
}

macro_rules! calculate {
    (eval $e:expr) => {
        let val: usize = $e; // Force types to be integers
        println!("{} = {}", stringify!{$e}, val);       
    };
}

fn main() {
    say_hello!();
    test!(1+1 == 2; and 2+2 == 4);
    test!(true; or false);
    calculate!(eval 1+2);
}
```

Run it:
```
hello
"1 + 1 == 2" and "2 + 2 == 4" is true
"true" or "false" is true
1 + 2 = 3
```

Another example:

```rust
use std::collections::HashMap;

macro_rules! map {
    () => {
        HashMap::new()
    }
}

fn main() {
    // use map! to make a new HashMap
    let mut m = map!();

    m.insert("Bo", 23);
    if let Some(age) = m.get("Bo") {
        println!("Age: {}", age);
    } else {
        println!("No key found");
    }
}
```
MySQL reserved words checker for Laravel migrations on PhpStorm
Tags: laravel, php, sql, phpstorm
Published: 2020-01-15 00:58:11

In this article we are going to setup a kind of "typo checker" on PhpStorm to look for MySQL reserved words being used as column names in your Laravel migration files. Although it's fine to name columns whatever you like, there is one small issue when writing raw SQL queries against the database when you do use reserved words as column names.

This article was moved to my personal blog. [Click here to see the full post](https://claudsonmartins.com/mysql-reserved-words-checker-for-laravel-migrations-on-phpstorm).
Moving web development from Windows to Linux: Key tips? 
Tags: webdev, linux, watercooler
Published: 2020-01-15 00:46:52

I've been a Windows user for as long as I've used computers. I've also been a Windows hater for that amount of time. I'm no stranger to Linux and always have a linux machine to hand for various tasks and tinkering but I've never actually moved my workload over to it.

Well, I've decided it's time to give the big W a big fat L and go full-time with Linux. I'm using a soft distro called Elementary OS which is based on Ubuntu 18.04. I've been tinkering away all day and I'm very happy so far. Now it's time to dive into my web development setup. I've install my usual suspects like node, Atom, a Markdown editor and such, but I'm wondering: **How do I take my Linux webdev station to the next level?**

What are some of the key packages, software and tweaks that will send my web development into orbit?
Modern web accessibility 💪
Tags: a11y, opensource, javascript
Published: 2020-01-15 00:16:51

We're excited to help enable a more accessible & inclusive web via [Ta11y](https://github.com/saasify-sh/ta11y), an open source suite of modern web accessibility testing tools.

## Intro

We've tried to design Ta11y to be as simple to use as possible.

The easiest way to get started is via the [CLI](https://github.com/saasify-sh/ta11y), but you can also use it programmatically from Node.js via [@ta11y/core](https://github.com/saasify-sh/ta11y/blob/master/packages/ta11y-core).

Ta11y uses [Puppeteer](https://pptr.dev/) to crawl and extract content from websites, so you can be sure you're testing any dynamic, JavaScript-powered content that your users will see.

Ta11y supports a large number of output formats such as JSON, Excel, CSV, and HTML.

## Features

- **Accessibility as a service**
  - Audit your websites with a range of test suites including WCAG 2.0/2.1 A, AA, AAA, Section 508, HTML validation, as well as our own best practices.
- **Flexible and automated**
  - Run manual tests during development and then integrate into any CI pipeline. Supports generating reports in XLS, XLSX, CSV, JSON, HTML, and more.
- **Runs in any environment**
  - Easy integration that supports localhost, firewalls, custom auth, as well as any public production environment.
- **Modern dynamic websites**
  - Ta11y treats all websites as dynamic with full JavaScript support, so you'll test pages as your users actually experience them.
- **Free to try**
  - Simple to get started for free, then [sign up](/pricing) once you're ready to remove rate limits. Have a non-profit use case? [Get in touch](mailto:support@saasify.sh).
- **Private & secure**
  - Ta11y is built using serverless functions and never stores any of your data or audit results.

## Examples

---

This example runs the wcag2a and wcag2aa audit test suites on the given URL and outputs the results to an Excel spreadsheet (supports any `xls`, `xlsx`, or `csv` file).

```bash
ta11y https://example.com -o audit.xls
```

---

This example runs the wcag2a and wcag2aa audit test suites on the given URL and outputs the results to a comma-separated-value file (`csv`).

```bash
ta11y https://example.com --suites wcag2a,wcag2aa -o audit.csv
```

---

This example will crawl all pages of a local site and then perform an audit of the results.

Note that the local site does not have to be publicly accessible as content extraction happens locally.

```bash
ta11y http://localhost:3000 --crawl -o audit.json
```

## Feedback

Ta11y is a new open source project written in JavaScript and built on the shoulders of other OSS giants.

We're looking for feedback and contributors, so please try it out and let us know if you have any thoughts. Thanks! 🙏

<p align="center">
  <a href="https://ta11y.saasify.sh" title="ta11y">
    <img src="https://raw.githubusercontent.com/saasify-sh/ta11y/master/media/logo.svg?sanitize=true" alt="ta11y Logo" width="256" />
  </a>
</p>
Jquery Get all Selected Checkbox Values
Published: 2020-01-16 11:59:01

---
title: Jquery Get all Selected Checkbox Values
published: true
date: 2020-01-15 00:00:00 UTC
tags: 
canonical_url: 
---

Hi GuysIn this exampleI will leran you how to get all checked checkbox values using jqueryyou can simplay get all checked checkbox values using jqueryIf you have multiple checkbox list or in table rows then we can get all checked checkbox value in string or array in jqueryI will give
How to remove the .NET Core Runtime and SDK
Tags: dotnetcore, dotnet, powershell
Published: 2020-01-25 22:44:16

---
title: How to remove the .NET Core Runtime and SDK
published: true
date: 2020-01-15 00:00:00 UTC
tags: dotnetcore,dotnet, powershell
canonical_url: https://solrevdev.com/2020/01/15/how-to-remove-the-net-core-runtime-and-sdk.html
---

Today I noticed a windows machine I look after had absolutely loads of version of the dotnetcore framework installed on it.

As in every major and minor version from 1.0 to the latest 3.1 and many previews in-between.

To see if your machine has the same try this command in your terminal:

```powershell 
dotnet --list-sdks
```

Microsoft has a page titled [How to remove the .NET Core Runtime and SDK](https://docs.microsoft.com/en-us/dotnet/core/versions/remove-runtime-sdk-versions?tabs=windows) which explains how to remove older versions.

There is also a [tool to help uninstall these](https://docs.microsoft.com/en-us/dotnet/core/additional-tools/uninstall-tool?tabs=windows) for you.

So I downloaded and installed the tool and ran the command to see list what could be uninstalled for me.

```powershell
dotnet-core-uninstall list
```

![2020-01-15_12_27_19.png](https://solrevdev.com//media/2020-01-15_12_27_19.png)

The tool is smart in that it knows which versions are required by Visual Studio.

So I began to uninstall the undeeded dotnetcore SDK’s on the system, I started by removing all preview versions of the dotnetcore sdk.

```powershell
dotnet-core-uninstall remove --sdk --all-previews
```

![2020-01-15_12_27_48.png](https://solrevdev.com//media/2020-01-15_12_27_48.png)

I then re-ran the tool to check these were uninstalled and to see what was left

```powershell
dotnet-core-uninstall list
```

Then I built my final command to remove the older versions that were not needed by Visual Studio.

```powershell
dotnet-core-uninstall remove --sdk 2.2.300 2.2.102 2.2.100 2.1.801 2.1.701 2.1.700 2.1.604 2.1.602 2.1.601 2.1.600 2.1.511 2.1.509 2.1.508 2.1.507 2.1.505 2.1.504 2.1.503 2.1.502 2.1.500 2.1.403 2.1.402 2.1.401 2.1.400 2.1.302 2.1.301 2.1.300 2.1.201 2.1.200 2.1.104 2.1.103 2.1.102 2.1.101 2.1.100 2.1.4 2.1.3 2.1.2 1.1.7
```

![2020-01-15_12_42_37.png](https://solrevdev.com//media/2020-01-15_12_42_37.png)

One final check…

```powershell
dotnet-core-uninstall list
```

![2020-01-15_13_17_44.png](https://solrevdev.com//media/2020-01-15_13_17_44.png)

Success 🎉
Phalcon v4.0.2 Released
Tags: release, phalcon, phalcon4, rc
Published: 2020-01-11 23:52:23

---
title: Phalcon v4.0.2 Released
published: true
date: 2020-01-11 21:18:43 UTC
tags: release,phalcon,phalcon4,rc
canonical_url: 
---

![](https://blog.phalcon.io/assets/files/20200111-phalcon4.0.2.png)

New release! (same as the one before really)!


We blame gremlins in the code…

![](https://blog.phalcon.io/assets/files/gremlins.jpeg)

Earlier today we released [4.0.1](https://dev.to/phalcon/phalcon-v4-0-1-released-3ooe). Unfortunately, the version of the extension was not updated properly and as a result, `echo phpversion("phalcon")` was returning `4.0.0` instead of `4.0.1`.

Since we have already published the release and do not wish to mess up all the GitHub hashes, we are releasing exactly the same release with a different (and now correct) version number.

You can check the [GitHub tag](https://github.com/phalcon/cphalcon/releases/tag/v4.0.2) but in reality the changelog is that of [4.0.1](https://github.com/phalcon/cphalcon/releases/tag/v4.0.1).

Apologies for the inconvenience caused!

* * *

Chat - Q&A

- [Discord Chat](https://phalcon.io/discord)
- [Forum](https://phalcon.link/forum)

Support

- [OpenCollective - Support Us](https://phalcon.io/fund)
- [Store - Merchandise](https://phalcon.io/store)

Social Media

- [Telegram](https://phalcon.io/telegram)
- [Gab](https://phalcon.io/gab)
- [MeWe](https://phalcon.io/mewe)
- [Parler](https://phalcon.io/parler)
- [Reddit](https://phalcon.io/reddit)
- [Facebook](https://phalcon.io/fb)
- [Twitter](https://phalcon.io/t)

Videos

- [BitChute](https://phalcon.io/bitchute)
- [LBRY](https://phalcon.io/lbry)
- [YouTube](https://phalcon.io/youtube)

![](https://assets.phalcon.io/phalcon/images/emoji/heart.png) Phalcon Team
Just launched our productivity software, Focus task tracking for self-management and teams on ProductHunt!
Tags: productivity
Published: 2020-01-14 22:53:29

Greetings!
Hope everyone’s doing awesome. DueFocus just launched on Product Hunt, and it would be GREAT if you'd show us some LOVE!
DueFocus is a time tracking software that creates a new perception of effective time management and definitely will take your productivity to the next level.
Hopefully, you’ll like it!Any feedback, reviews or suggestions will be highly appreciated! Thanks in advance.Cheers.
https://www.producthunt.com/posts/duefocus