teleren/devto huggingface dataset:
Py Project: Key Logger
Published: 2020-04-25 14:32:10

Greetings,

So I wanted to create a project within Python then break down the code to gain understanding while doing. The goal is to become a great software engineer, but I don’t want to be caught in tutorial hell. Great advice from several of the developers were to break each line of code down. Then do some “googling” if you aren’t understanding what you see. It makes total sense and with that I went online to find a project .A great project that was showing a bit in forms to start with was a logger program. With the logger program, it will allow you to type some keys on your screen via keyboard. While pressing the keys, the program should log your keystrokes via a text file. The concept was easy to grasp however when doing projects you don’t want to just write the code, get the concept, and then move on. No… way Jose! lol. So instead I decided to come back this AM to review what the basic project was broken down to via comments. So heads up great people when seeing the projects posted going forward. It’s all about the learning and growth, not just a copy and paste scenario. I hope you enjoy and learn much! 

Keep coding great devs!

Key Logger Program : https://github.com/DesignisOrion/Keylogger-Program/blob/master/main.py
Awesome CSS frameworks (PART 2)
Tags: css, html, javascript, beginners
Published: 2020-04-24 14:47:20

CSS frameworks are great tools for web development.

I have compiled a list of some awesome frameworks.

This is part 2 of that list.

PART 1 is available [here](https://dev.to/totallymustafa/awesome-css-frameworks-part-1-2ko2).


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

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

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

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

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

https://picturepan2.github.io/spectre/
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/j9az2pju4t0ieueywu91.png)
COVIDiary pt. 4.5 - Database Fixes
Tags: beginners, codenewbie, database
Published: 2020-04-24 16:31:08

---
title: COVIDiary pt. 4.5 - Database Fixes
published: true
date: 2020-04-24 16:21:20 UTC
tags: #beginners #codenewbies #database
canonical_url: https://www.codewitch.dev/covidiary_pt_4_5_-_database_fixes
---

<center>
<img alt="Cool Cats and Kittens" src="https://media.giphy.com/media/RGixkYkOKdWATSReHt/source.gif">
</center>

Welcome to Part 4.5 of the COVIDiary project! If you’re just joining us or missed a post, here’s what we’ve done so far:

- [Part 1: Project Introduction](https://dev.to/audthecodewitch/covidiary-a-rails-react-project-2gl6)
- [Part 2: Initial Setup](https://dev.to/audthecodewitch/covidiary-part-2-initial-setup-2g2d)
- [Part 3: Building the Database](https://dev.to/audthecodewitch/covidiary-pt-3-building-the-database-4o04)
- [Part 4: Frontend Setup](https://dev.to/audthecodewitch/covidiary-pt-4-frontend-setup-3cp1)

This week, we’re going to work on our PostgreSQL database in the `CD-api` directory. By the end of today, we will:

1. Fix improper boolean names
2. Add is\_public boolean to entries
3. Update seed file
4. Reset database

## Ch-ch-ch-CHANGES

I was reading up on naming conventions this week, and I came across [this article](https://dev.to/michi/tips-on-naming-boolean-variables-cleaner-code-35ig). I realized the boolean names in our tables did not follow best practices, and I set about changing them.

<center>
<img alt="Good Idea at the Time" src="https://media.giphy.com/media/gKGzjtXVrVPIsgbREz/source.gif">
</center>

I’m going to go into Part 3 and fix the mistakes I made. If you’ve been coding along with me, check out the video below to see how to make the changes yourself!

<center>
{% youtube MVqeF7RTjAk %}
</center>
## Coming Up

Next week, we’ll work on setting up our routes, serializers, and controllers so the front and back ends can talk to one another. Until then, stay well!

<center>
<img alt="Stay Home" src="https://media.giphy.com/media/lQ701BEcCllM2BOQpR/source.gif">
</center>
Step Indicator in SwiftUI
Tags: swiftui, ios, stepindicator, swift
Published: 2020-04-25 01:17:09

This SwiftUI iOS cocoapods library is used for indicating step actions for series of steps involved for any task. For eg: if you wanna illustrate the steps for collecting cash from an ATM , steps involved for any loan application. etc..

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

Here’s the library which does the work with just couple of lines which accepts below View Modifiers

```swift
.addSteps(_ steps: [View]) : array of views to be rendered closer to indicator

.alignments(_ alignments: [StepperAlignment]) : optional defaults to .center, available with custom options either .top, .center, .bottom sections

.indicatorTypes(_ indicators:[StepperIndicationType]): enum provides the options to use .circle(color, width) , .image(Image, width) , .custom(AnyView)

.lineOptions(_ options: StepperLineOptions): color, thickness line customization.

.spacing(_ value: CGFloat): spacing between each of the step views.

.stepIndicatorMode(_ mode: StepperMode): vertical, horizontal display modes.
```
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/j1ll3akrky1sg0mj21c9.png)

```swift
     var body: some View {
         StepperView()
            .addSteps([Text("Account"), Text("MemberShip"))
            .indicators([.center,.center])
            .stepIndicatorMode(StepperMode.horizontal)
            .spacing(50)
           .lineOptions(StepperLineOptions.custom(1,Colors.blue(.teal).rawValue))
      }
```
__References__:

[Cocoapods](https://cocoapods.org/pods/StepperView)

[Github](https://github.com/badrinathvm/StepperView)

[More Documentation](https://badrinathvm.github.io/StepperView/)

Feel free to request any new features or create a pull request.

Happy Coding..!
*Intermediate Algorithm Scripting: Arguments Optional
Tags: replit, node
Published: 2020-04-25 03:25:46

---
title: *Intermediate Algorithm Scripting: Arguments Optional
published: true
tags: replit, nodejs
---

/*Intermediate Algorithm Scripting: Arguments Optional
Create a function that sums two arguments together. If only one argument is provided, then return a function that expects one argument and returns the sum.

For example, addTogether(2, 3) should return 5, and addTogether(2) should return a function.

Calling this returned function with a single argument will then return the sum:

var sumTwoAnd = addTogether(2);

sumTwoAnd(3) returns 5.

If either argument isn't a valid number, return undefined.

**/
function addTogether(a,b) {
if(typeof a === 'number'  && typeof b === 'number' || !isNaN(b)){
a+=b;
}if(typeof a === 'number' && !isNaN(a) && typeof b === 'number' && !isNaN(b)){ 
  return a;
  }if(typeof a === 'number' && !isNaN(a)){
  var sumTwoAnd = function arr(e){
  if(typeof a === 'number' && !isNaN(a) &&typeof e === 'number'){
  e+=a;  console.log(e);  return e
  } 
  
 }
 sumTwoAnd(3);
 return sumTwoAnd ;
} 

}    
addTogether(2);
/*
addTogether(2, 3) should return 5.
Passed
addTogether(2)(3) should return 5.
Passed
addTogether("http://bit.ly/IqT6zt") should return undefined.
Passed
addTogether(2, "3") should return undefined.
Passed
addTogether(2)([3]) should return undefined.*/
/*https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/make-a-person*/

{% replit @oscarhernandez6/Intermediate-Algorithm-Scripting-Arguments-Optional %}
Apache Kafka in a Nutshell
Tags: apachekafka, eventsourcing, eventstreaming, microservices
Published: 2020-04-25 06:15:05

So, you’ve heard of this Kafka thing that’s popping up all over the shop. From green-sprout startups to greedy multi-nationals, in all sorts of weird and wonderful contexts. It appears that someone has figured out a Swiss Army knife piece of über-tech that works for microservices, event-streaming, CQRS, and just about anything else that makes the headlines.

As someone who’s been working with Apache Kafka since 2015, helping several clients build complex event-driven and microservices-style applications, I’ve heard my fair share of questions. First, it was I who was doing most of the asking. Then I found myself on the receiving end. At the time of writing, I’m trending among the [top-ten writers on Quora](https://www.quora.com/topic/Apache-Kafka/writers) — a feat I owe mostly to the mistakes I’ve made along the way, which have made me a little more aware. With the shameless chest-beating out of the way, I thought I’d put together an FAQ-style post that breaks Kafka down, focusing on the aspects that matter.

[Read the rest of the article on Medium](https://medium.com/swlh/apache-kafka-in-a-nutshell-5782b01d9ffb)
Reading Snippets [55 => Scoping]
Tags: codenewbie, beginners, javascript
Published: 2020-04-25 08:51:09

It is important to try and avoid scope pollution when using global variables in a program. Tightly scoping variables using the block scope provides several advantages:

🙂 Makes code more legible as blocks organize code in discrete sections

🙂 Makes code easier to understand

🙂 Makes code easier to maintain

🙂 Saves memory in code


<kbd><small><a href="https://www.codecademy.com/courses/introduction-to-javascript/lessons/scope/exercises/block-scope-ii">Codecademy: JavaScript Course</a></small></kbd>
Twiter
Published: 2020-04-25 12:40:15

https://blog.twitter.com/developer/en_us.html,https://github.com/json-api/json-api.git,https://blog.twitter.com/engineering/en_us/topics/infrastructure/2019/bts-of-launching-the-new-twitter.html,https://blog.twitter.com/engineering/en_us/topics/insights/2018/twitter_silhouette.html
Create a custom report for RCPTT
Tags: rcptt, eclipse, custom, report
Published: 2020-04-26 12:13:52

RCPTT [(RCP Testing Tool)]( https://www.eclipse.org/rcptt/) includes a functionality that allows to generate reports in multiple formats based on the results obtained from executing test cases. However, the default reports might be insufficient for our needs but fortunately; RCPTT is flexible because it supports generating custom reports.

In this post, we illustrate the basic steps needed to create a custom report renderer so it can be used in RCPTT whether IDE or Test Runner. We use Maven to configure and build the plugin and other related artifacts. By the way, we use a specific project to build an update site for our plugin.

The full code is available at the following repository [rcptt-reporting](https://github.com/hichlab/rcptt-reporting).

##Create a report renderer
RCPTT provides the interface <code> IReportRenderer</code> which is the entry point for report generation. Renderers implementing this interface receive a <code>Report</code> iterable object to iterate over all internal reports generated for a given test execution.
```java
public class XMLCustomReportRenderer implements IReportRenderer {

	@Override
	public IStatus generateReport(IContentFactory factory, String reportName, Iterable<Report> reports) {

		// iterate over reports, process their information and create a file in your preferred format ...
		return Status.OK_STATUS;
	}

	@Override
	public String[] getGeneratedFileNames(String reportName) {
		return new String[] { reportName };
	}
}
```
To access to the results of executed tests, we have to iterate over a collection of <code>Report</code> objects and retrieve the information as follows:
```java
Iterator<Report> reportIterator = reports.iterator();
while (reportIterator.hasNext()) {
	Report report = reportIterator.next();
	Node item = report.getRoot();
	Q7Info info = (Q7Info) item.getProperties().get(IQ7ReportConstants.ROOT);
	
	// Q7Info object contains the information of an executed test case
}
```
##Add an extension
Once the report renderer is implemented, we have to add an extension for this plugin to be able to use it. The following entry must be added to plugin.xml.
```xml
<extension point="org.eclipse.rcptt.reporting.reportRenderer">
	<reportRenderer
        class="com.hiclab.rcptt.reporting.XMLCustomReportRenderer"
        description="XML Custom Report Renderer"
        extension="xml"
        id="XmlReport"
        name="Xml Custom Report">
	</reportRenderer>
</extension>
```
The <code>id</code> is needed especially when using Test Runner. For more details, check the description of the argument *report* in [Test Runner documentation]( https://www.eclipse.org/rcptt/documentation/userguide/runner/arguments/).
How does your company handle research and investigation work?
Tags: discuss, agile, estimation, planning
Published: 2020-04-25 14:45:42

---
title: How does your company handle research and investigation work?
published: true
description: Tickets? Spikes? Nothing at all?
tags: discuss, agile, estimation, planning
---

Software companies which follow agile usually do some sort of planning and estimation. It lets stakeholders know how long things will take to get done and can help with how a project plays out. To get better estimations, developers are usually tasked with doing some initial research to find out how difficult things will be, what unknowns exist. 

How does your component do this from a process standpoint? Tickets? Spikes (a form of research ticket familiar to some)? Nothing at all?
Hackathon update #4 - Shoot into the wild blue
Tags: twiliohackathon, cloud, production
Published: 2020-04-25 18:24:21

So this is it, my final update on the hackathon, it's kind of sad really but it's been pushed to a live server (azure to be specific) but I just wanted to let people have a sneak peak into how to get messages.

# Subscribing to an event:
![how-to-subscribe](https://dev-to-uploads.s3.amazonaws.com/i/7yx38wuu49ksubrs681h.png)

When you are logged into the website these buttons will appear, these buttons allow you to subscribe to the updates on the event, once an update is published to the event a message will be sent to all of the subscribers of the event via twilios api.

_Note_ : Oh I should mention that these buttons only appear if you have a mobilenumber associated with your account.

And well.. that's all I have to say. This was a blast to work on 

Checkout the website: https://artemiswebserver.azurewebsites.net

{% github joro550/artemis %}
How to hide Ruby 2.7 deprecation warnings in docker
Tags: docker, ruby, tutorial
Published: 2020-04-25 19:09:25

Tired of Ruby ​​2.7 alerts in your docker application? Put this key into your environment: `RUBYOPT=-W0`. In your docker-compose.yml:

``` docker
# docker-compose.yml

version: '3.6'

services:
  server:
    image: "your_image"
    container_name: "your_application_name"
    ports:
      - "3000:3000"
    environment:
      - BUNDLE_PATH=vendor/bundle
      - BUNDLE_DISABLE_SHARED_GEMS=1
      - RUBYOPT=-W0
```

Cheers :beers:
MySQLDump.js
Tags: mysql, backup, showdev, sql
Published: 2020-04-25 19:23:54

MySQL comes with a built-in program called `mysqldump` to do logical backups. It generates a SQL script of the database so that you can transfer it to another database server. 

I have written a tiny wrapper around `mysqldump` which can be used in Node.js applications:

https://github.com/SirwanAfifi/sqldumpjs

Please give it a try. I would be glad If you would like to contribute.
Is CSS a programming language?
Tags: css
Published: 2020-04-25 23:48:25

A few hours ago I was talking with a friend and asked him this question.

We're both working in our thesis for a software engineering title, but right know we're working on a web dev project, and having worked before with PROLOG I realized CSS is very similar in a sense.

The way I see it, with CSS you can define rules allowing computers to do some math and resolve a problem based on the previous rules. I know there's a lot of discussion in this topic, but I'm kinda new here and wanted to see on first-hand what people have to say about it.
When should you use event.preventDefault()
Tags: beginners, webdev, javascript
Published: 2020-04-26 03:09:50

All too often I see `event.preventDefault()` sprinkled through applications where it doesn't make a whole lot of sense. 

You should be using this method to prevent the default action of an event....easy enough, right?. Well no.

The conversation should **NOT** go:

> Oh theres an `event` being handled, lets add an `event.preventDefault()`

If you take ANYTHING away from this article, please **ASK WHY** if you dont know why something is happening. You will learn and make a much more informed decision.

> Back to my soap box.....

The only examples I can think you would want to use this is during the following cases AND to prevent their default action (please comment below if you can think of any more):

- Checkbox
  - Default action: input being checked
- Button with type submit
  - Default action: Submitting the form data
- Input with an `onChange` handler
  - Default Action: Adding the text to the input
- Link tag
   - Default Action: Visiting the link

### Lets do an example

*What do I want to accomplish?* I want to click a link and do something instead of allow the user to go to the `href` specified in the tag.

*Lets Assume* I have an `a` tag that looks like this

```html
<a class="dev-test" href="https://example.com">Click Here</a>
```

```js
const el = document.getElementsByClassName('dev-test')[0];

el.addEventListener('click', e => {
  e.preventDefault();
  // Do something else.
});
```

[Here is a codepen to play around with this concept](https://codepen.io/sstern6/pen/RwWVaJN)

#### HOT TIP ALERT
1. Click the link and see what happens.
1. Comment out the `e.preventDefault()`, then click the link and see what happens.

What do all of these have in common? They all have a default action that can be prevented.

So, in s u m a t i o n, next time you come across a `preventDefault` in the wild, think, "what action am I preventing and why is this here?"

For more information on the official spec you can read more [here](https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault).

Hope you enjoyed reading! If you have any comments, questions or topics you want me to go over please comment below!
Sass Functions
Tags: sass, beginners, css, stylesheets
Published: 2020-05-04 00:38:49

---
title: Sass Functions
published: true
description: Notes and reference on Sass
tags: sass, beginner, css, stylesheets
series: SASS basics
---
####Functions in Sass
The full list of functions is available in the Sass docs. Only the ones likely to be frequently used will be covered here.
The builtin functions are written in C, and so performance concerns are not a big factor when deciding whether to use them. Functions that are written by us as developers do not necessarily share this trait, so it's something to bear in mind when writing and using your own functions. More on functions:
https://sass-lang.com/documentation/at-rules/function
and the complete list of built-ins: 
https://sass-lang.com/documentation/modules

Note that an entire series on just colors could be written, so use Google to find out more about colors if necessary. A good place to start would be https://developer.mozilla.org/en-US/docs/Web/HTML/Applying_color

#####Color functions
#####Creating color
```sass
rgb($red, $green, $blue);
rgba($red, $green, $blue, $alpha);
red($color);
green($color);
blue($color);
mix($color1, $color2, [$weight]);
```
The above are pretty self-explanatory given the function names and variable names, but research them if needed, to learn more. Some of the more complicated functions are outlined below to get an idea of how functions work.

#####adjust-hue
```sass
adjust-hue(#63f, 60deg)
```
adjust-hue takes the initial color as as the first argument, and the degrees of rotation (clockwise around the color wheel) as the second (the 'deg' is optional, but helpful for remembering later that this value is degrees on a circle). 

#####darken and lighten
```sass
darken($color, $percent);
lighten($color, $percent);
```
Note that the percent value is not multiplicative. In other words, we are subtracting 20% from its brightness value. We are not decreasing its current brightness value by multiplying the current value by 20% and subtracting the product. It is a scale of 0-100.

#####saturate and desaturate
```sass
desaturate($color, $percent);
saturate($color, $percent);
```
Color saturation is essentially how much of a channel is mixed into a particular color. A color saturated to 100% is very vivid, whereas a color with 0% saturation would be grey scale.
Callbacks
Tags: javascript, beginners
Published: 2020-04-26 08:24:52

---
title: Callbacks
published: true
description: Callback Function
tags: javascript, beginner
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/o2025yyq2yfansg2cd3u.jpg
---

The callback function is a simple function that we pass inside another function as an argument.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/y0zdnq5fz9roh29zv7w8.png)
The Callback function allows us to write asyncronus code for example the code above is asyncronus code because javascript can wait for a click before running our callback function and move on with the execution of the code.
In synchronous code javascript executes the code from top to bottom, left to right. Without the callback function in the code above, javascript would freeze (blocked) until the user clicks the button.
Now is a good time to talk about event loops and since we are all sitting on the shoulders of the giants, no one better than [Philip Roberts](https://twitter.com/philip_roberts) explained events loops:
[Philip Roberts event loops video](https://www.youtube.com/watch?v=8aGhZQkoFbQ)
I hope you watched the video;
We may write our callback function also with the arrow function like this:
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/tckov9pbla9nbatam0i5.png)
Weekly report #3
Tags: boostnote, markdown, weeklyreport, noteapp
Published: 2020-04-26 10:51:09

---
title: Weekly report #3
published: true
description: 
tags: boostnote, markdown, weeklyreport, noteapp
---

# ✅ What we did this week

## The legacy app

- Release v0.15.3
- Merged horizontal split mode (It will be shipped in v0.16)
https://github.com/BoostIO/Boostnote/pull/2936

## The new app

- Released v0.4.0 and v0.4.1 of the desktop app
- Rolled out v0.4.1 of the mobile app (In review now. It’ll be published in 3 days)
- Fixed Navigating UX (Shipped in v0.4.0)
- Fixed Emoji bug (Shipped in v0.4.1)
- Fixed app crash after editing (Shipped in v0.4.1)
- Refined UI coloring (This issue has been resolved partially in v0.4.0, but I still need to work more to completely finish it)

# 🏃 What we will do next week

## The legacy app

- Review and merge opening a note in a new window
https://github.com/BoostIO/Boostnote/pull/3110

Opening a note in a separate window is really awesome, but the pull request is affecting the electron main processor, so I need to check that the auto updater is compatible with this feature.

## The new app
- Improve cloud storage sync speed and authentication flow
- Re-implement Bookmark
- Support i18n completely
- Implement initial prototype of File System based storage.

The list isn’t changed from last week because I was working on fixing some critical bugs in both the mobile app and the desktop app. But this week, I think I can fully focus on these issues.

# 🆘 Featured issues

From this week, we want to introduce some issues and pull requests that anyone can tackle and review. If you would like to contribute to our project, please consider the list below.

## Issues to resolve

- Implement synced scrolling for split view
https://github.com/BoostIO/BoostNote.next/issues/247
- Implement PDF export
https://github.com/BoostIO/BoostNote.next/issues/243
- Improve default preview CSS style (Easy)
https://github.com/BoostIO/BoostNote.next/issues/435
- Improve storage deleting message (Easy)
https://github.com/BoostIO/BoostNote.next/issues/434
- Implement option to show notes only in a folder, not in its sub folders
https://github.com/BoostIO/BoostNote.next/issues/419

## Pull requests to review

- Introduce Italian locale https://github.com/BoostIO/BoostNote.next/pull/436