teleren/devto huggingface dataset:
jquery events list example
Tags: jquery, javascript
Published: 2020-02-12 04:44:27

<!-- wp:heading {"level":3} -->
<h3>These are some examples of jQuery events.</h3>
<!-- /wp:heading -->

<!-- wp:list -->
<ul><li> A mouse click,hover etc.</li><li> Selecting a radio button.</li><li> An HTML form submission.</li><li> clicking on an element.</li><li> Scrolling of the web page etc.</li></ul>
<!-- /wp:list -->

<!-- wp:heading {"level":3} -->
<h3>List jquery events methods</h3>
<!-- /wp:heading -->

<!-- wp:heading {"level":4} -->
<h4>Mouse Events</h4>
<!-- /wp:heading -->

<!-- wp:list -->
<ul><li>click</li><li>dblclick</li><li>mouseenter</li><li>mouseleave</li></ul>
<!-- /wp:list -->

<!-- wp:heading {"level":4} -->
<h4>Keyboard Events</h4>
<!-- /wp:heading -->

<!-- wp:list -->
<ul><li>keyup</li><li>keydown</li><li>keypress</li></ul>
<!-- /wp:list -->

<!-- wp:heading {"level":4} -->
<h4>Form Events</h4>
<!-- /wp:heading -->

<!-- wp:list -->
<ul><li>submit</li><li>change</li><li>blur</li><li>focus</li></ul>
<!-- /wp:list -->

<!-- wp:heading {"level":4} -->
<h4>Document/Window Events</h4>
<!-- /wp:heading -->

<!-- wp:list -->
<ul><li>load</li><li>unload</li><li>scroll</li><li>resize</li></ul>
<!-- /wp:list -->

Read more https://www.tutsmake.com/list-jquery-events-handling-methods/
Super Fast Prototyping with Grails Tutorial Available
Tags: grails, tutorial, groovy, webdev
Published: 2020-02-12 08:39:54


One of the greatest benefits of the Grails framework is how it allows you to put together a Proof Of Concept(POC) or a web app prototype in such a short period time.

In a current world where there is lots of focus on UI frameworks and microservice architectures, sometimes, you just need to build something quickly without worrying about different front and backend layers.  

Grails allows you to build apps fast, but with the benefit of sitting on top of the most robust Java-based libraries in existence, Spring, Hibernate, etc. etc.

In this tutorial, you'll see how to build a simple CRM backed by a H2 in-memory database, prepopulating itself with 1000 fictitious records.

The user is provided with basic CRUD screens,  create, edit, and a rich Datatables based list screen to allow filtering, sorting and ajax driven paging of the customer records.

[Download full source on github](https://github.com/tucanoo/crm_grails) Download the full source on github 

and [Read the full tutorial](https://www.tucanoo.com/how-to-build-a-simple-crm-with-grails-4/)
Upcoming webinar on Amazon SageMaker
Tags: aws, machinelearning, tutorial
Published: 2020-02-12 15:15:19

---
title: Upcoming webinar on Amazon SageMaker
published: true
date: 2020-02-12 10:19:52 UTC
tags: aws, machinelearning, tutorial
canonical_url: https://medium.com/@julsimon/upcoming-webinar-on-amazon-sagemaker-c72de5206a2c
---

If you’re curious about Amazon SageMaker and its latest Machine Learning capabilities (model debugging, model monitoring, AutoML, etc.), please join me on February 27th for a hands-on session. I’ll run several demos, and you’ll get a chance to ask questions too.

Information and free registration [here](https://pages.awscloud.com/AWS-Online-Tech-Talks_2020_0226-MCL.html?&trk=el_a131L0000083Y2dQAE&trkCampaign=February_2020_0226-MCL&sc_channel=el&sc_campaign=pac_Q1-2020_exlinks_blog_OTT_02DGAB&sc_outcome=Product_Adoption_Campaigns&sc_geo=NAMER&sc_country=mult)!

![](https://cdn-images-1.medium.com/max/1024/1*CtR9iZ1-MNhVOcPizlDuqw.png)
Database triggers not working
Tags: database, postgres, help, question
Published: 2020-02-12 10:44:35

Here's the SQL query for the function which get the `post_id` whenever there is a new entry in the table `voters` and based on that it count all the posts having same ID and set that value in the `post` table in a column.

**Function**

```sql
CREATE OR REPLACE FUNCTION update_vote_count()
RETURNS trigger
LANGUAGE 'plpgsql'
AS $BODY$
BEGIN
  UPDATE post SET votes = (SELECT COUNT(*) FROM voters WHERE post_id = NEW.post_id) WHERE post_id = NEW.post_id;
  RETURN NEW;
END;
$BODY$
```

**Trigger**

```sql
CREATE TRIGGER voters_count
  AFTER UPDATE
  ON voters
  FOR EACH ROW
  EXECUTE PROCEDURE update_vote_count();
```

The problem is that, this function is not triggering and I don't even know how to debug these database functions/triggers.
Tailwind Nord plugin!
Tags: javascript, css, tailwindcss
Published: 2020-02-12 13:03:01

Recently I've been using the Nord theme in more and more of my projects, and I noticed myself repeating the same procedure at the start of each one. Setting up my `tailwind.config.js` to use the Nord palette for the colours. Which can be a pretty lengthy process copying the values back and forth.

To get around this, I have written a super tiny plugin for Tailwindcss that pulls in the Nord palette and uses the colour names as described by the maintainers of Nord. (e.g `nord0`, `nord11` etc etc)

This was purely made for myself, but hopefully it can help some of you out!

Grab it through npm: `npm i tailwind-nord`
Or check out the repo for more details: [Tailwind Nord](https://github.com/crumb1e/tailwind-nord)
How to measure deployment frequency for WordPress plugin
Tags: wordpress, github, codequality
Published: 2020-03-03 15:02:40

One year ago I read a very great book about DevOps science ["Accelerate"](https://www.goodreads.com/book/show/35747076-accelerate).

There was a chapter about measurements that can be used to answer the question: Does your company has High-performance team in the development?

These measurements:

* Deployment Frequency
* Lead Time for changes
* MTTR
* Change Failure rate

One of the most interesting points is **Deployment Frequency** and we had a long discussion about this in my team about that. The book says that the high-performance team should deliver on-demand, multiple deploys per day. 

The problem is that if we will publish one plugin every day multiple times in ["WordPress.org"](https://wordpress.org/plugins/visualcomposer/) people won't like it because there are no automatic updates for Wordpress plugins in the admin dashboard.

So, Publishing so frequently isn't an option, but the concept to have a deliverable product as often as the possible sound really useful. 

We use a [trunk-based development](https://trunkbaseddevelopment.com/) branching model. What does it mean?

> A source-control branching model, where developers collaborate on code in a single branch called ‘trunk’(master), resist any pressure to create other long-lived development branches by employing documented techniques. They, therefore, avoid merge hell, do not break the build, and live happily ever after.

There is a master branch were we merge all pull requests. Is it safe? From point of continues integrations, we run tests pipeline for every commit and every merge. Sound safe! How true is it? Not sure. No one during the merge of the pull request thinks it can be delivered to the customer at once.

The only thing left is to update the release brunch as frequently as possible. Here is our scenario:

1. Developer crates pull request. Before all CI pipeline's tests have been successfully completed. 
2. A reviewer checks code and confirms this pull request as valid.
3. A reviewer merges pull request.
4. Release engineer checks during the day the state of the master branch and if it has updates, decides are this code safe for the update in the current release branch.

So every update counts as deployment. Makes sense, isn't it?

## Conclusion

If you have any suggestions or you want to share what kind of practices you use in your company, please welcome to write comments :)

Thanks and Good Luck :rocket:
Focus of Coding
Tags: tutorial, javascript
Published: 2020-02-12 16:01:00

What is everyone thoughts on WHY we code? And the reasons to learn

I have been learning web development for about a year yet I am very far from being able to gain a employment I have at least 1 to 2 years left. But that made me think why do we learn how to code and design? Is it only to gain a job with a FANG or is it to create. I think maybe we should change the focus to teach this not with goal of gaining work but to be able to simple create. I think that is why so many people get discouraged when learning. My coding heroes are Rekka and Devine from 100 Rabbits. I think I will follow their creative path.
https://100r.co/site/home.html

What do you all think?
On.NET Episode: Streaming and Batching with the Cosmos DB SDK for .NET
Tags: dotnet, azure, database, cosmosdb
Published: 2020-02-18 20:43:06

In this episode, [Matías Quaranta](https://twitter.com/ealsur) returns to talk to us about some more features of the Cosmos DB SDK for .NET. This time, his covers some interesting features like the estimator API, the change feed processor, running bulk operations and also transactions.


{% youtube zEscjbdGLZ4 %}

If you liked this video and would like to see some more of our .NET content, please subscribe to our [.NET Developers YouTube Channel](https://www.youtube.com/channel/UCvtT19MZW8dq5Wwfu6B0oxw).


## Useful Links

* [GitHub repo with the sample code](https://github.com/ealsur/ondotnet-cosmosdb)

* [Performance tips for Azure Cosmos DB and .NET](https://docs.microsoft.com/en-us/azure/cosmos-db/performance-tips?WT.mc_id=ondotnet-devto-cephilli)


* [Work with NoSQL data in Azure Cosmos DB](https://docs.microsoft.com/en-us/learn/paths/work-with-nosql-data-in-azure-cosmos-db?WT.mc_id=ondotnet-devto-cephilli)

* [Cosmos DB .NET Standard SDK release notes](https://docs.microsoft.com/en-us/azure/cosmos-db/sql-api-sdk-dotnet-standard?WT.mc_id=ondotnet-devto-cephilli)
Learning TypeScript
Tags: discuss, typescript, types, learning
Published: 2020-02-12 19:00:30

---
title: Learning TypeScript
published: true
description: Learning TypeScript
tags: discuss, typescript, types, learning
---

I have written a 16 part [__"Notes on TypeScript"__](https://dev.to/busypeoples/notes-on-typescript-pick-exclude-and-higher-order-components-40cp) series, which is an unstructured collection of TypeScript related notes. Trying to convert this series into a more structured learning resource. Here are some questions, where I would be very interested in some feedback.
 
- What do you find hard about __TypeScript__ and what would you like to learn more about?

- How could a good learning experience look like?
Looping over array in JavaScript
Tags: javascript, tutorial
Published: 2020-02-12 19:45:30

Looping over arrays-
There’s a few methods for looping over arrays in Javascript. We’ll start with the classical ones and move towards additions made to the standard.

While -
let index = 0;
const array = [1,2,3,4,5,6];

while (index < array.length) {
  console.log(array[index]);
  index++;
}

for (classical)-
const array = [1,2,3,4,5,6];
for (let index = 0; index < array.length; index++) {
  console.log(array[index]);
}

forEach-
const array = [1,2,3,4,5,6];

array.forEach(function(current_value, index, array) {
  console.log(`At index ${index} in array ${array} the value is ${current_value}`);
});
// => undefined

map-
The last construct was useful, however, it doesn’t return a new array which might be undesirable for your specific case. map solves this by applying a function over every element and then returning the new array.

const array = [1,2,3,4,5,6];
const square = x => Math.pow(x, 2);
const squares = array.map(square);
console.log(`Original array: ${array}`);
console.log(`Squared array: ${squares}`);
The full signature for map is .map(current_value, index, array).

reduce-
The reduce() method applies a function against an accumulator and each element in the array (from left to right) to reduce it to a single value.

const array = [1,2,3,4,5,6];
const sum = (x, y) => x + y;
const array_sum = array.reduce(sum, 0);
console.log(`The sum of array: ${array} is ${array_sum}`);

filter-
Filters elements on an array based on a boolean function.

const array = [1,2,3,4,5,6];
const even = x => x % 2 === 0;
const even_array = array.filter(even);
console.log(`Even numbers in array ${array}: ${even_array}`);

every-
Got an array and want to test if a given condition is met in every element?

const array = [1,2,3,4,5,6];
const under_seven = x => x < 7;

if (array.every(under_seven)) {
  console.log('Every element in the array is less than 7');
} else {
  console.log('At least one element in the array was bigger than 7');
}

some-
Test if at least one element matches our boolean function.

const array = [1,2,3,9,5,6,4];
const over_seven = x => x > 7;

if (array.some(over_seven)) {
  console.log('At least one element bigger than 7 was found');
} else {
  console.log('No element bigger than 7 was found');
}
How to avoid half-assing all things
Published: 2020-03-07 12:28:53

The other day I was thinking, 

I do not have a lack of ideas, I do not have a lack of enthusiasm to start a project, but I possess an incredible track record for stashing half-done things at different stages of their lifecycle. I don't think I am alone. 

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/52bwd6kdbjf9a6fhz4fi.jpg)
Seven years back for example, after a few [culinary posts](https://italianmondays.com/tagged/cheese) sent into the obvious void and even an attempt to [be on camera](https://www.youtube.com/watch?v=_740fJOabYo) immediately destroyed by hate comments, I "realized" the world needed [a GitHub for recipes](https://cookq.herokuapp.com) and jumped headfirst into the project. It went well, iterating rapidly from napkin sketch to mockup to production (with a [side of social](https://cookq.tumblr.com)) where it slowly died, maybe because of the engineering effort drying me up or simply because *If you build it, they will come* is one huge bias of programmers.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/7ip0g9600vtozinpt8rp.png)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/mhvl7bsf94tdvxk8b7hv.png)

This project (and several others) died and it will never serve a purpose, and it's a shame because - possibly - someone, somewhere might be commencing the development of a similar web app, from scratch. 

I've thought of selling the app (that idea lasted 12 seconds), I thought of open-sourcing the project (making it _yet another unmaintained codebase_), but maybe what we need, **hear me out**, is a convention to transfer a project and retain a fractional interest: a standard agreement and a common tag to find opportunities!

Example: *Here is 95% of the thing I've developed over years of sweat and tears,
let me keep 5% as I guide you and bring you up to speed with all what I think you need to know to succeed...*

It could be as easy as tagging your next project as ![#NEXT_IN_LINE](#) or ![#TAKE_OR_LEAVE_IT](#) or ![#CODE_CODE_PASS](#) ... 

Oh, by the way #CODE_CODE_PASS on https://algebro.herokuapp.com/pages/about https://gitlab.com/etozzato/algebro
Chaining a method on a do...end block in Ruby
Tags: beginners, ruby
Published: 2020-02-14 03:50:10

I am brand new to coding and working with Ruby so I learn something new every day!  I am also a student at the Austin Flatiron School.  Sometimes I need to use a method on the returned array from a Ruby do...end block.  Usually, I would set the do...end block equal to a variable and then call a method on this variable.  

But I learned an easier way. I wanted to enumerate through an array of Ruby objects (ExampleClass.all) and return some data from each object.  Then I wanted to use the .sum method to find the total number of pets.

```ruby
ExampleClass.all => [<@name= "Sydney", @pets= 3>,
               <@name= "Sophie", @pets= 4>,<@name= "Phineas", @pets= 1>,
               <@name= "Mark", @pets= 6>]
```
```ruby
array_of_number_of_pets = ExampleClass.all.map do |object|
                             object.pets
                           end  

array_of_number_of_pets  => [3, 4, 1, 6]

array_of_number_of_pets.sum => 14
```

Or you could just chain the sum method onto the "end" in the do...end block

```ruby
ExampleClass.all.map do |object|
  object.pets
end.sum
  
  => 14
```
Web development companies in India

Tags: webdev, webdesign, digitalmarketing
Published: 2020-02-13 08:15:38

Tacty Solutions   basically focus on the skills, the technology and domain expertise to design, deliver and support optimal IT-enabled services to all the vertical industry segments such as Banking and Finance, Manufacturing, Education, Oil &amp; Gas, Telecom Sector etc. Our delivery methods meet the most stringent standards of quality and are delivered on schedule, enabling it to build long-term relationships with customers.

Tacty Solutions  was founded in 2013 with one goal in mind - to deliver the finest quality of IT-enable services to its Clients worldwide. Our service-level driven delivery platform based on pro-active IT infrastructure management and remote IT support ensures maximum applications availability and optimal performance for your network. This makes your business more efficient and productive.

We would like you to think of us as your in-house design team, and you're the boss! Whatever you need, whenever you need it. Select a service to learn more about what we can do for you!

web development company in india refers to building, creating, and an maintaining websites. It includes aspects such as web design, web publishing, web programming, and database management. 

https://tactysolutions.com
The Meaning Behind the Names of the Major JavaScript Frameworks
Tags: todayilearned, beginners, javascript
Published: 2020-02-13 12:12:00

We programmers are known for having a language of our own, which makes people who are not in the industry see us as wizards. When we build something for our community (such as a framework or a library), the names we give it are often even more obscure - at least to outsiders.

React, Angular, Vue, Mithril. Have you ever wondered what the names of all those JavaScript frameworks actually mean?

The question recently came up on a Q&A platform and we thought of settling the score once and for all.

The names are pretty self-explanatory - but only if you’re a developer (or a Tolkien fan). Otherwise, not so much.

 

**React** - a front-end framework developed for applications where data is always changing (think Quora). As the user clicks around, types, submits forms, the view reacts to those user actions. So the name stands for its one-way reactive data flow.

 
**Angular** - HTML has angular brackets and the namespace is called ‘ng’ because it’s supposed to make you think of ‘Angular’. Oh, and JS stands for JavaScript, the language of this framework.

 
**Vue** - this one really does what it says on the box. It’s another JS framework for building user interfaces whose core library is focused on the view layer. View - Vue. Potato - potata.

 
**Mithril** - [‘as light as a feather and as hard as dragon scales’](https://www.youtube.com/watch?v=4G7py-x4kMw&feature=youtu.be&t=25). Or at least that’s how Bilbo describes the fictional metal in the Lord of the Rings world. Now I don’t know what the creators of the JavaScript framework were thinking, but I’d assume it was something similar. Mithril is light (< 8kb gzip and fast), but it has been described as ‘very intelligent and powerful’ and robust all-round. It’s great for beginners and small projects (as per the conversation [here](https://www.reddit.com/r/javascript/comments/98b965/mithril_js_lightweight_and_simpler_alternative_to/)), while being a strong JS framework. Kinda like a very light but sturdy shirt of chainmail.

 
If you have any other questions or curiosities, go ahead and leave a comment.
Make sound volume presets for your chromecasts
Tags: chromecast, python, music
Published: 2020-02-18 07:15:55

Read the original article on [GKDV](https://gkdv.net/chromecast-auto-reset-volume-presets/)

<p>Sometimes, I tell to Google “Up the volume”, or “Down the volume” on one or several chromecast devices. But the next day, when I want to listen music again, the volume of each device does not match with my mood. I would love to reset all the volumes in few secondes, but I have to open the home application, and reset each device… Boring… With <code class="highlighter-rouge">chromecast-reset-volume</code> I can now configure some presets to autoreset the volumes as it was previously: reset all in one cli command :)</p>

<h2 id="what-do-you-need">What do you need</h2>
<ul>
  <li>1 raspberry pi with python3</li>
  <li>chromecasts… (of course)</li>
</ul>

<h2 id="get-source-files-and-install-it">Get source files and install it</h2>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">$ </span>git clone https://github.com/gpenverne/chromecast-reset-volume
<span class="nv">$ </span>make <span class="nb">install</span>
</code></pre></div></div>

<h2 id="configure-it">Configure it!</h2>
<p>Open the <code class="highlighter-rouge">config.py</code> and customize your presets. For example:</p>
<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">VOLUMES</span> <span class="o">=</span> <span class="p">{</span>
    <span class="s">'default'</span><span class="p">:</span> <span class="p">{</span>
       <span class="s">'123.123.123.123'</span><span class="p">:</span> <span class="mf">0.5</span><span class="p">,</span>
       <span class="s">'tv'</span><span class="p">:</span> <span class="mf">0.4</span><span class="p">,</span>
       <span class="s">'room'</span><span class="p">:</span> <span class="mf">0.1</span>
    <span class="p">}</span>
<span class="p">}</span>
</code></pre></div></div>
<p>You can write the chromecast name or its ip address (ip address will be faster).</p>

<h2 id="lets-the-magic-does-the-magic-">Let’s the magic does the magic :)</h2>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">$ </span>make apply
</code></pre></div></div>
<p>And all your configured chromecasts volumes will be setted :)</p>
Daily Challenge #191 - Alphabetical Addition
Tags: challenge
Published: 2020-02-18 14:44:30

---
title: Daily Challenge #191 - Alphabetical Addition
published: true
series: Daily Challenge
description: Implement a function to add letters together. 
tags: challenge
---
###Setup

Write a function that can add letters together. Each letter will be valued based on their position in the alphabet. 

**Rules:**
- Letters will always be lowercase.
- Letters can overflow (see second to last example of the description)
- If no letters are given, the function should return 'z'

###Examples
<pre>
addLetters('a', 'b', 'c') = 'f'
addLetters('a', 'b') = 'c'
addLetters('z') = 'z'
addLetters('z', 'a') = 'a'
addLetters('y', 'c', 'b') = 'd' // notice the letters overflowing
addLetters() = 'z'</pre>
***

###Tests    
`addLetters('a', 'b', 'c')`
`addLetters('z')`
`addLetters('a','b')`
`addLetters('c')`
`addLetters('y', 'c', 'b')`
`addLetters()`


Good luck!

_This [challenge](https://www.codewars.com/kata/5d50e3914861a500121e1958) comes from steffan153 on CodeWars. Thank you to [CodeWars](<https://codewars.com/>), who has licensed redistribution of this challenge under the [2-Clause BSD License](<https://opensource.org/licenses/BSD-2-Clause>)!_

_Want to propose a challenge idea for a future post?  Email **yo+challenge@dev.to** with your suggestions!_