teleren/devto huggingface dataset:
How do you imagine technology will change our world in the next one, five, or ten years?
Tags: motivation, developer, discuss, beginners
Published: 2020-06-19 03:27:07

---
title: How do you imagine technology will change our world in the next one, five, or ten years?
published: true
description: Curated answers to a question from the Code Connector community Slack channel.
tags: #motivation #developer #discuss #beginners
---
1. In the next 10 years, things like VR and AR will become more commonplace in daily interactions.

2. I imagine that more kids would be home schooled as opposed to opting for schools thanks to improvements in technology and families realizing how constricting the system is.

3. As tech get more intuitive, our kids will learn less from humans and more from computers

4. Brick and motor stores will become a thing of the past.

5. Mobile/instant communications will go past the limitations of cell phones.

6. I think the biggest movement in tech right now is the social and legal responsibility of those who develop software and those who consume it. This tech boom happened SO FAST that legal infrastructure couldn't get up fast enough to protect the rights of the people using software without knowing what they were agreeing to, and so we saw the consequences of that.

7. Whatever it is it won't be done simply for profit. Open source software moves the authorship away from people striving for more profit.

Code Connector Contributors: James Quick, Corey McCarty, Walker Laury, Isaac Arcos Huicochea, Athena Baker, Dennis Kennetz

[Code Connector](https://codeconnector.io/) is a non-profit that's organized tech meetups to help people start their journey into tech. You can join our daily conversations by clicking this link: [Code Connector slack channel](https://bit.ly/2Ywnzqc).
Laravel "Chunk" ... be careful
Tags: laravel, todayisearched
Published: 2020-06-19 03:11:30

Laravel "chunk" method is widely used to split large query into smaller chunks when processing large database. But there is a trick if the attribute used in query would be changed in call back function. It is easy to be ignored and thus often be misused.

## Problem
```php
Post::where('processed', 0)->chunk(100, function($posts) {
    foreach($posts as $post) {
       $post->processed = 1;
       $post->save();
    }
});
```
Assumption: the total number of unprocessed posts is 400 (Id is 1 - 400).
The problem is: Only half of the posts are processed.

## Analyzation
Each chunk is being fetched via single query with limit and offset. Let’s have a look how chunk works.

In the beginning, unprocessed posts are 400 (Ids 1- 400), for 1st chunk query: ``select * from `posts` where `processed` = 0 limit 100 offset 0``, Ids 1-100 are fetched.

After 1st chunk, unprocessed posts are 300 (Ids 101- 400), for 2nd chunk query: ``select * from `posts` where `processed` = 0 limit 100 offset 100``, Ids 201-300 are fetched.

After 2nd chunk, unprocessed posts is 200 (Ids 101- 200 and 301- 400), for 3rd chunk query: ``select * from `posts` where `processed` = 0 limit 100 offset 200``, bummmm ... none of post is fetched.

The result is: 200 posts are processed, but 200 posts are left unprocessed.

## Solution:
"chunkById" is recommended to replace "chunk" in this situation. "chunkById" is similar to "chunk". The only difference is how raw SQL is being constructed. "chunkById" uses `id` and `limit` while "chunk" uses `limit` and `offset`. 
The modified code would be like:
```php
Post::where('processed', 0)->chunkById(100, function($posts) {
    foreach($posts as $post) {
       $post->processed = 1;
       $post->save();
    }
});
```
When using "chunkById", each chunk query sql sentence would be like below:

1st chunk query: ``select * from `posts` where `processed` = 0 and `id` > 0 order by id asc limit 100``

2nd chunk query: ``select * from `posts` where `processed` = 0 and `id` > 100 order by id asc limit 100``

3rd chunk query: ``select * from `posts` where `processed` = 0 and `id` > 200 order by id asc limit 100``

4th chunk query: ``select * from `posts` where `processed` = 0 and `id` > 300 order by id asc limit 100``

Therefore the fetch result would be 1-100, 101- 200, 201 -300, 301- 400 in sequence, and all of the posts are processed.
Does ads can really support a web app?
Tags: discuss, webmonetization
Published: 2020-06-19 02:51:39

In the past, I’ve made a couple of projects just for fun, but now I’m thinking on how to make my next one kind of profitable, I know that there are different factors that can make it work as I expect or not, so I don't intent to gain a lot of money on my first try, but I would like to know if in your experience a web app can be fully maintained (at least) based on the ads income with a platform like Google Adsense?
Day 18 of #100daysofCode - 3 challenges
Tags: ruby, codenewbie, womenintech, codewars
Published: 2020-06-19 02:10:11

<h1> Codewar Challenges </h1>

Today I worked on three coding challenges, while I KNOW there are easier ways to do all of these, I was happy to find a solution nonetheless. Feel free to comment on the best ways to accomplish these challenges. 

<h1> Challenge 1 </h1>

<b> Write a function that accepts an array of 10 integers (between 0 and 9), that returns a string of those numbers in the form of a phone number. </b>

For example, 

```
createPhoneNumber([1, 2, 3, 4, 5, 6, 7, 8, 9, 0])
 # => returns "(123) 456-7890"
```
<h1> My Solution </h1>
```
def createPhoneNumber(numbers)
  one = numbers[0]
  two = numbers[1]
  three = numbers[2]
  four = numbers[3]
  five = numbers[4]
  six = numbers[5]
  seven = numbers[6]
  eight = numbers[7]
  nine = numbers[8]
  ten = numbers[9]

  "(#{one}#{two}#{three}) #{four}#{five}#{six}-#{seven}#{eight}#{nine}#{ten}"
  
end
```

<h1> Challenge 2 </h1>

<b> An isogram is a word that has no repeating letters, consecutive or non-consecutive. Implement a function that determines whether a string that contains only letters is an isogram. Assume the empty string is an isogram. Ignore letter case.</b>

For example, 
```
is_isogram("Dermatoglyphics" ) == true
is_isogram("aba" ) == false
is_isogram("moOse" ) == false # -- ignore letter case
```
<h1> My Solution </h1>

```
def is_isogram(string)
s = string.downcase
("a".."z").all?{|c| s.count(c) <= 1}

end
```

<h1> Challenge 3 </h1>

<b>You probably know the "like" system from Facebook and other pages. People can "like" blog posts, pictures or other items. We want to create the text that should be displayed next to such an item. Implement a function likes :: [String] -> String, which must take in input array, containing the names of people who like an item. It must return the display text as shown in the examples: </b>

```
likes [] // must be "no one likes this"
likes ["Peter"] // must be "Peter likes this"
likes ["Jacob", "Alex"] // must be "Jacob and Alex like this"
likes ["Max", "John", "Mark"] // must be "Max, John and Mark like this"
likes ["Alex", "Jacob", "Mark", "Max"] // must be "Alex, Jacob and 2 others like this"
```

<h1> My Solution </h1>

```
def likes(names)
  #your code here
  if names.empty? 
    return "no one likes this" 
  elsif names.length == 1
    return names[0] + " likes this"
  elsif names.length == 2
   return names[0] + " and " + names[1] + " like this"
  elsif names.length == 3
   return names[0] + ", " + names[1] + " and " + names[2] + " like this"
  else names.length > 3
    total = names.length - 2
    return names[0] + ", " + names[1] + " and " + total.to_s + " others like this"
  end
end
```

As I learn more, I plan to keep doing coding challenges. I will post more as I do them and hopefully we can learn from each other.
Could Apple Be Forced to Reduce App Store Fees?
Tags: news, ios, discuss
Published: 2020-06-19 01:57:19

Just ahead of Apple's World-Wide Developer Conference, the company is getting _a lot_ of heat about their app store fees.

### **[👉 Verge Story: Apple’s App Store Fees Are ‘Highway Robbery,’ Says House Antitrust Committee Chair](https://www.theverge.com/2020/6/18/21295778/apple-app-store-hey-email-fees-policies-antitrust-wwdc-2020)**

{% tweet 1273720080291950593 %}

TLDR: The Basecamp folks are being **loud** about their treatment under App Store rules and Apple's attempts to earn 30% fees. These rules more or less date back to the inception of the app store, and somehow Apple has avoided much scrutiny in the matter.

**Nobody** is better at causing a fuss about this kind of stuff than DHH and Basecamp.

How do you predict this will shake out?
Using Imagemagick to easily split an image file
Tags: imagemagick
Published: 2020-06-19 01:12:08

---
title: Using Imagemagick to easily split an image file
published: true
description: convert command of ImageMagick is very useful to split an images file.
tags: ImageMagick
---

`convert` command of [ImageMagick](https://imagemagick.org/) is very useful to split an images file.

To use the `convert`, you'll need to install ImageMagick beforehand.

```
brew install imagemagick
```

## Split the image to the left and right

input.png

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

```
convert -crop 50%x100% input.png output.png
```

output-0.png

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

output-1.png

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

## Split the image to the top and bottom

input.png

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

```
convert -crop 100%x50% input.png output.png
```

output-0.png

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

output-1.png

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

## Split the image into 4 parts

input.png

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

```
convert -crop 50%x50% input.png output.png
```

output-0.png

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

output-1.png

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

output-2.png

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

output-3.png

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/xv59lhlbuxcmni77qsls.png)
Top 15 Free Hacking Tools For Ethical Hackers
Tags: ethicalhacking, hacking, ethicalhackers, hackingtools
Published: 2020-06-19 01:02:42

---
title: Top 15 Free Hacking Tools For Ethical Hackers
published: true
date: 2020-06-19 01:02:42 UTC
tags: ethicalHacking, hacking ,EthicalHackers, HackingTools 
canonical_url: https://www.ma-no.org/en/security/top-15-free-hacking-tools-for-ethical-hackers
---

![Top 15 Free Hacking Tools For Ethical Hackers](https://dev-to-uploads.s3.amazonaws.com/i/7hy8xahe827411qk1iyd.jpg)

Intrusion tests, known as "Penetration Analysis" or "Ethical Hacking", are now a common practice to know the level of security a website has.

These tests assess the type and extent of system and network vulnerabilities in terms of confidentiality and integrity. They check the security of the network and empirically verify the resistance of applications and services to misuse.

The so-called Ethical Hacking tests constitute an evaluation of the security and vulnerability of the web, in which the analyst actually tries to compromise the target machines or networks.

The ethical hacker may use various tools and techniques. Each of these techniques has its own steps, methodology and software used.

Even Google is used by hackers and attackers to perform something called 'Google hacking': by using basic search techniques with advanced operators, it can become a powerful tool to search for vulnerabilities.

Using advanced operators shown in the image, in combination with some specific terms, Google can be used to discover a lot of sensitive information that should not be revealed.

Searching for information with Google is not in itself an 'unethical' action, but using the information or certain vulnerabilities found without the permission of the owner of the page or document for malicious purposes is.

Today we propose a list of 15 useful tools to test the vulnerability of your website.

[Read all](https://www.ma-no.org/en/security/top-15-free-hacking-tools-for-ethical-hackers)
How and Where to learn Python
Tags: python, beginners, help, tutorial
Published: 2020-06-19 00:39:25

Hello Fellows, 
I am a Ruby on Rails/React/Full-Stack Developers. I want to learn Python, searched only , watched few videos on YouTube but I thought I would ask dev community. I have faith in you people to guide me properly. So please tell me how and where to learn Python. I am mainly going to focus on web development but eventually I would like to move into data analytics and machine learning. please guide me.
Everything you want to know about Authorization Headers
Tags: http, authorization
Published: 2020-09-10 05:45:49

---
title: Everything you want to know about Authorization Headers
published: true
date: 2020-06-19 00:00:00 UTC
tags: HTTP,Authorization
canonical_url: https://www.loginradius.com/engineering/blog/everything-you-want-to-know-about-authorization-headers/
---

This blog will give an insight into the Authorization Request Header. Before we dive into the blog let's get a brief Idea about Authorization Request Headers. What is an Authorization Request Header? The HTTP Authorization request header contains the credentials to authenticate a user…

   
[Read On](https://www.loginradius.com/engineering/blog/everything-you-want-to-know-about-authorization-headers/)
Clearing twitter
Tags: twitter, webdev
Published: 2020-07-04 10:34:03

---
title: Clearing twitter
published: true
date: 2020-06-19 00:00:00 UTC
tags: twitter, webdev
canonical_url: https://remysharp.com/2020/06/19/clearing-twitter
---

It's no surprise that twitter and similar sink holes are constantly trying to "engage" you so you can be sucked into their void. As someone who believes that the web belongs to its users and I browse the way _I want_ I frequently change and block content on these sites so I can use them the way I would like.

So here's a quick share on how I'm doing that.

This is a simple example of how _I think_ twitter can be improved - the picture below shows, highlighted in red, the "trending news" which really isn't news - or at least not news that I would recommend consuming. I certainly don't want to get my COVID-19 advice from the latest trending bullshit. More recently they have launched (possibly in split tests) a DM … "thing"? so I can use that to message people instead of…what, email? WhatsApp? Not sure. Anyway, it's shit that I don't need in my life, so it's getting ejected.

![](https://remysharp.com/images/clean-twitter.png)

Step 1: get yourself [uBlock Origin](https://github.com/gorhill/uBlock/) (the origin bit is important) available for [most browsers](https://github.com/gorhill/uBlock/#installation)

Step 2: use the right click - block element picker to stop content from bothering you

When you fire up the picker, you'll notice that Twitter (and other sites that don't believe in writing actual CSS classes) are using something to generate their CSS, which makes picking element using CSS selectors tricky.

Except, the trick is to look for aria roles or even data properties. As much as I dislike these big companies, they _do_ try to support a broad range of users via good use of accessibility and we can use that to our advantage.

![](https://remysharp.com/images/picking.png)

The uBlock Origin element picker will need a selector like `##div[aria-label="Timeline: Trending now"]`, I'm not sure what the double hash is about, but it works.

So now we can surf web pages the way _we want_.

_Originally published on [Remy Sharp's b:log](https://remysharp.com/2020/06/19/clearing-twitter)_
How to make a property or a method in an object immutable in JavaScript?
Tags: javascript
Published: 2020-06-19 00:00:00

---
  title: How to make a property or a method in an object immutable in JavaScript?
  published: true
  tags: JavaScript
  date: Fri Jun 19 2020 05:30:00 GMT+0530 (India Standard Time)
  canonical_url: https://melvingeorge.me/blog/make-property-immutable-objects-javascript
  cover_image: https://melvingeorge.me/_next/static/images/main-44f7d6f85940ff98c9dfca2eac06eed5.jpg
  ---
  [Originally posted here!](https://melvingeorge.me/blog/make-property-immutable-objects-javascript)
  
Let's say you have an object called `John`.

```javascript
const John = {};
```

Now we can add the `name` property and assign it a value of `John Doe` and also make it a not changing or immutable property.

We can acheive this through the `Object.defineProperty()` static method.

```javascript
const John = {};

// setting property name: "John Doe"
// and also making it immutable
Object.defineProperty(John, "name", {
  value: "John Doe",
  writable: false,
});
```

The method accepts:

- The object to add the property as the first parameter, in our case `John`.
- The name of the property you want to add to the object as the second parameter, in our case the `name` property.
- The third parameter is called descriptor where we are setting the `value` option to the value we want in our `name` property in our case "John Doe" and `writable` property to `false` for making it immutable.

Now if you try to change the value of the `name` in object `John`, It will throw an error in strict mode.

```javascript
// will throw an error
John.name = "Lily";
```

### There are many other options you can set in the descriptor including `writable`, `enumerable`, and `configurable`.

### Check more about these options in [MDN Docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty)

### Feel free to share if you found this useful 😃.

---
Migrating WordPress to Gatsby in 3 steps
Tags: gatsby, wordpress, webdev
Published: 2020-06-18 23:21:18

*This article is for those who want to stop using WordPress and would like a fast-loading static website instead.*

Moving from WordPress to [GatsbyJS](https://www.gatsbyjs.org/) can be useful in some cases. Below I describe an easy approach for migrating and deploying your new Gatsby website. After this you can delete your WordPress installation. The three steps involved:

1. Install [WP Gatsby Markdown Exporter](https://wordpress.org/plugins/wp-gatsby-markdown-exporter/) plugin in your WordPress
2. Export your data
3. Use the data in your Gatsby website

Needless to say step 3 is where you’ll spend most of your time, but if you’re willing to follow a tutorial and write some code, you’ll make it work.

Outline for the rest of the article, feel free to skip sections:

1. Why use Gatsby 
2. How to move data into Gatsby
3. How to deploy Gatsby easily

**Part 1: Why use Gatsby**

Gatsby is a static website that can load quickly for your visitors. It can be easier to customize the look and behavior of your website with Gatsby than with WordPress. Writing a new blog post requires creating a new markdown file using the markdown formatting and optional inline HTML. It is easy to create custom pages as well.

There is a way to use Gatsby along with your WordPress ([Headless](https://www.gatsbyjs.org/docs/glossary/headless-wordpress/), without having to migrate your data, but this article isn’t about that).

**Part 2: How to move data into Gatsby**

The [WP Gatsby Markdown Exporter](https://wordpress.org/plugins/wp-gatsby-markdown-exporter/) plugin will save a zip file with all your pages and posts as individual markdown files (they will include some metadata too!) and all your images/uploads in their original folder structure. When set up, Gatsby will render each markdown file as an individual page / post. 

I started with a Gatsby starter project (pick any; I used [fabe/gatsby-universal](https://github.com/fabe/gatsby-universal)) and followed the official tutorial for [programmatically creating pages from data](https://www.gatsbyjs.org/tutorial/part-seven/). I then customized the look of the pages and it was ready. My working code is available [here](https://github.com/whyboris/yboris.com).

**Part 3: How to deploy Gatsby easily**

Gatsby generates a static website, so when you are done developing, you can build the assets (run the gatsby build command in your terminal) and put them on any static webhost. You are done.

Another alternative is to use some cloud platform to deploy your website. I used [Vercel](https://vercel.com/) (formerly Zeit) which monitors my GitHub repository and builds a new version of my website when my code changes.

Happy coding!
The Tech community’s response to Racial Justice Reform is led by IBM.
Published: 2020-06-18 23:14:27

A link to IBM CEO’s letter to Congress on Racial Justice Reform has been added to our news site. I will more than likely be writing a blog post on our tech blog which will essentially be a commentary on this letter and may also reference the statements made by Microsoft and Salesforce on this issue. Possibly more than one post.

As I mentioned before, a high school student can understand everything in this letter, and you may even encourage them to not only read it but also to use it as a template to write his/her own letter to Kamala and Cory. While we’re on this topic, I should also say one feature we will be adding to the news site is marking articles that can comfortably be read by a high school student. We just have to update the data model to allow for this. Parents, I think you’ll know what to do with this information
:-).


References

1.  IBM CEO’s Letter to Congress on Racial Justice Reform. https://www.ibm.com/blogs/policy/facial-recognition-susset-racial-justice-reforms/. Last Accessed: 6/17/2020.
97/100 100daysofcode Flutter
Tags: 100daysofcode
Published: 2020-06-18 23:04:49

day 97/100 of #100daysofcode #Flutter
Learning Flutter , courses Udemy from
@maxedapps

Today learn about firebase function oncreate, firebase deploy, n little node.js
https://github.com/triyono777/100-days-of-code/blob/master/log.md
Day 157: Sign
Tags: hiphop, code, coding, lifelongdev
Published: 2020-06-18 23:02:21

_liner notes_:
- Professional : Today was the judging day for the projects done for the internal hackathon. Got to see the final project for the team I was helping yesterday. The projects made were awesome! A lot of people said they will be continuing to work on their projects after the hackathon. To me that's a great sign of a successful event. Other than that, I helped out with a question in our community Slack. Glad we were able to get it working. Did a final overview of a report the team has been working on and filling any gaps in for JavaScript. Also looked into some ways around an issue I'm having building and deploying this Web Component I'm working on. Pretty full day.

- Personal : Edited last week's show and submitted it to be played on the radio for this week. Also watched a couple of more episodes of "Parasyte" on Netflix before going to bed.

![Country road in Glenorchy, New Zealand in a field with mountains in the distance](https://dev-to-uploads.s3.amazonaws.com/i/7boujfko217rjpepklvz.png)

After work, I must have been super tired or because it was raining, but I fell right to sleep. haha. Going to work on the animations for my side project and go through tracks for the radio show. Maybe watch some more of the "Parasyte" anime.

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube mkXvik99JDY %}