teleren/devto huggingface dataset:
100daysofcode Flutter
Tags: 100daysofcode, flutter
Published: 2020-03-24 16:15:30

day 15/100 of #100daysofcode #Flutter
Belajar Flutter , dari kursus Udemy from
@maxedapps

Learning about Navigation named route with static const, adding model, enum, function in List (like where, contains),
https://github.com/triyono777/100-days-of-code/blob/master/log.md
golang, why doesn't string type inherit all the methods of strings package?
Tags: go
Published: 2020-03-24 16:11:19

---
title: golang, why doesn't string type inherit all the methods of strings package?
published: true
description: 
tags: golang
---

I am too scared to write this question on stackOverflow because those guys will feed me to the wolves, something unique about golang community! they are a ruthless bunch on SO. 

Getting back to the point, basically the question. i know you can do something like

```golang
type Str string

func (s Str) toByteArr() {
    fmt.Println([].byte(s))
}

func main()  {
    Str("Looking good today!").toByteArr()
}
```

But this kind of open gates for all kind of types floating around and i imagine could become harder to handle at some point.

I am just thinking wouldn't it be easy like any other language <code>"string".method();</code> to have all those methods from <code>strings</code> package available to you, rather then you trying to find ways how to make this more easy to write <code>strings.doSomething(myString)</code>.

If not, what is the reason?
React: A guide to making apps that someone will gladly pay for
Tags: react, mobx, javascript, tutorial
Published: 2020-03-24 16:02:15

Greetings, dear dev.to friends.

I created a React dev guide. It's available here: https://enterwell.net/react-development-guide/

You can find a lot of materials for learning React online, but from my experience there is just so much noise out there that you don't know what to learn. Because of that I created a guide with a clear list of technologies that you need to learn in order to develop production-ready React apps.

I hope this will help someone and I am interested in all comments and suggestions 😀
How To Start Web Development With Django 3.0.4
Tags: django, python, webdev
Published: 2020-03-24 16:00:00


## Creating a virtual setup for Django
- [install conda (miniconda or anaconda)](https://conda.io/projects/conda/en/latest/user-guide/install/linux.html)
- `conda create --name env_name django`
- `conda activate env_name`

### Create new project 
- `django-admin startproject project_name`

- `cd project_name`

#### Create application (you can create as many applications under a project)
  
- `python manage.py startapp app_name`

 **start project** : `python manage.py runserver`


## Database :
### Models :
- `python manage.py migrate`
- `python manage.py makemigration app_name`
- `python manage.py migrate`

### create superuser :
- `python manage.py createsuperuser`


### Use bootstrap in django forms

- install crispy : `pip
 install django-crispy-forms`
- [Documentation](https://simpleisbetterthancomplex.com/tutorial/2018/08/13/how-to-use-bootstrap-4-forms-with-django.html) 

## Password Authentication 
- install Bcrypt : `pip install bcrypt`
- install Django Argon : `pip
 install argon2-cffi`


### Important Documentations :
- [Getting Started](https://docs.djangoproject.com/en/3.0/)
- [Form and field validation](https://docs.djangoproject.com/en/3.0/ref/forms/validation/?fbclid=IwAR31WkOA0nKRSUIJ9mCU3MnkF7d_jwIMZstbA6tEeo-j2A6ISz-Pk0NS_no)
- [Validators](https://docs.djangoproject.com/en/3.0/ref/validators/)
- [clean](https://kite.com/python/docs/django.db.models.Model.clean)
- [Model field reference](https://docs.djangoproject.com/en/3.0/ref/models/fields/)
- [Custom Template](https://docs.djangoproject.com/en/1.11/howto/custom-template-tags/)
- [The Django template language](https://docs.djangoproject.com/en/3.0/ref/templates/language/)
- [Django’s Templates](https://djangobook.com/mdj2-django-templates/)
- [#27956 closed Bug (fixed)](https://code.djangoproject.com/ticket/27956)
- [Template Filter](https://docs.djangoproject.com/en/3.0/topics/templates/#filters)
- [Built-in filter reference](https://docs.djangoproject.com/en/3.0/ref/templates/builtins/#ref-templates-builtins-filters)
- [Writing custom template filters](https://docs.djangoproject.com/en/3.0/howto/custom-template-tags/#howto-writing-custom-template-filters)
- [How to Use Bootstrap 4 Forms With Django](https://simpleisbetterthancomplex.com/tutorial/2018/08/13/how-to-use-bootstrap-4-forms-with-django.html)
- [form.as_p](https://teamtreehouse.com/community/what-is-advantage-of-formasp)
- [Password Authentication](https://docs.djangoproject.com/en/3.0/topics/auth/passwords/)


**interested people can view my learning repo in github here [Django-Test](https://github.com/jspw/Django-Test)**
Lessons Learned: Offline Time / Holidays
Tags: english, java, opensource
Published: 2020-05-19 07:06:52

---
title: Lessons Learned: Offline Time / Holidays
published: true
date: 2020-03-24 15:52:26 UTC
tags: English,Java,open source,oss
canonical_url: https://salaboy.com/2020/03/24/lessons-learned-offline-time-holidays/
---

I just came back from holidays in Cuba, it was an amazing experience (including rushing back due to COVID-19) but I’ve learned some valuable lessons from being completely offline for at least 9 days. Internet access was limited, to say the least, usually restricted to hotel lobbies and paid by the hour. Because I really needed some holidays I was avoiding getting online as much as I could so the environment was perfect for that.

Some interesting things that I’ve learnt from this experience:

- After 3 days of being offline, you don’t miss it anymore, and you start caring less about going online again. 
- After 3 days of being offline, creativity starts to kick in again, I found myself writing a lot of interesting ideas about tech and other stuff that I am interested in. This is something that I find hard to do after a normal day of work. 
- Being offline allows you to step back and reprioritize with an external point of view. This is very productive when you need to balance between things such as conferences, coding, initiatives, networking with different groups, etc. Stepping back from the day to day helps you to have a clear view of how important each of these things is and how they will impact your productivity and life/work balance. 
- Being offline and isolated even for a week allows you to have a fresh perspective on the really important things that will not change. It was quite fascinating to see how fast companies are changing nowadays and how if you just miss a week 
- I’ve learned about **_“Screen Time -> Downtime” in iOS_** to automatically block apps, which I set to From 20:00 to 7:30 every day. So now that I get back online I control myself with some time off. 
- I’ve reminded myself of having at least a couple pet projects, those projects that you just do for fun. In my career, pet projects have been a source of inspiration and learning.   
- The power of Open Source and how it affects my priorities. I ended up realizing that priorities were easy to set if the focus is made on the open-source aspect of each project/initiative. 

Having loads of ideas and some inspiration from [Jordan Mechner](https://www.jordanmechner.com/)‘s books pushed me to have now a dairy (with daily entries) full of potential pet projects and reminders about what things are important.

I know.. this is not a tech blog post, but it might help someone else out there to share their experiences around their time off / holidays preferences.

Stay tuned! more tech blog post are coming!
Why VPN is a must when you browse the internet
Published: 2020-03-24 15:28:06

Well, from the last decade there have numerous changes in how a user browses the internet especially when it comes to online shopping, paying online and more. But the user must be aware that there are a lot of scams online. If you ignore those situations you will be in big trouble.

What is a VPN, today's point of the moment? A VPN is a software that connects with your browser and safely routes all your traffic and important data through its intermediate servers thus saving you in big time. All free VPN cannot do the job perfectly as it involves painting a lot of servers and infrastructure. 

When you are not paying to a company, obviously you become the customer with your data. So, I request you to use the <a href="https://waytohunt.org/top-7-best-vpn-fast-secure-anonymous/">paid VPN</a> instead of a free one. That cost only a few bucks a month.

If you are looking for more ways to secure your internet connection you can use a TOR browser for free, But the problem with that is it routed through number of servers and making the internet connection slow.

To safely and quickly do your transactions online I prefer you to use a paid VPN like Nord VPN or Express VPN they both do the job the same.
What Do You Think About Togetherness In The Situation of These Days?
Tags: togetherness, humanity, attitude, coronavirus
Published: 2020-03-24 15:48:35

Hello there, I'm Reynald from Indonesia, this is my first post on dev.to.

Right now, in my country have been hit by coronavirus, as of today the number of total cases is 686 persons and total deaths is 55, it starting to spread exponentially recently.

Suddenly it feels like almost everybody in Indonesia starting talk a lot about it, I find myself people in Indonesia still not having enough of togetherness of humanity, everyone like have their own argumentation (did me too?).

I just want my country to be more together facing these situations, caring themselves and caring others focusing on optimism ways whatever happen next!

So I made a website at https://crocodication.github.io/covid19messages/# , the website is a maps that contains posts from everybody that who want submit their hope or information post from instagram to my website.

I have share it to many friends and lot of acquaintances, not getting any significant responses.

Even my website not engaged enough, I can accept it, I'm just want the people together-like about these situations.

I believe when we feel like together in these situations, our number will be more exponentially than the virus spread.

Stay healthy everyone! Thank You
How It’s Changing the Future of Augmented Reality
Tags: webar
Published: 2020-03-24 15:10:02

![WebAR Application](http://perfectial.com/wp-content/uploads/2020/03/WebAR-Application-1024x421.jpg)

Augmented Reality is becoming more and more popular with developers and smartphone users but it still hasn’t taken its place among omnipresent technologies. To experience AR, users have to install a dedicated application but often they delete it after a few uses or don’t even bother to download it at all. WebAR is set to become the solution for users’ reluctance to experience it via apps, and there’s some pretty good evidence that it’ll actually succeed.

##What is WebAR?

WebAR is an Augmented Reality experience that is accessed via a web browser instead of an app. It provides this web-based AR experience by using technologies like WebGL, WebRTC, WebVR and APIs. In simple words, you just need a phone to access it.

WebAR enables smartphone users to discover AR technology in the easiest way— via the web— without the burden of installation. It simply breaks barriers and creates interactive 3D models one can access through QR-code or a link. For now, WebAR offers limited functionality compared to an app-based AR, but it already includes simple animations, video, and a certain degree of interactivity. Also, WebAR supports image target detection.

The post [How It’s Changing the Future of Augmented Reality](https://perfectial.com/blog/webar/) appeared first on [IT Consulting Company Perfectial](https://perfectial.com/).
ColdFusion SetCookie UDF (Supports “SameSite”)
Tags: coldfusion, cfml, java
Published: 2020-03-24 15:07:44

I attempted to post the following response regarding a ColdFusion bug that I reported back in March 2018, but Adobe's CFTracker web application wasn't working and refused to accept my post for an undisclosed reason.

**CFCookie "samesite" support**
[https://tracker.adobe.com/#/view/CF-4201688](https://tracker.adobe.com/#/view/CF-4201688)

A third-party site's API recently triggered the following warning message in Chrome 78:
> A cookie associated with a cross-site resource at http://jetio.streamguys.com/ was set without the `SameSite` attribute. A future release of Chrome will only deliver cookies with cross-site requests if they are set with `SameSite=None` and `Secure`. You can review cookies in developer tools under Application&gt;Storage&gt;Cookies and see more details at [https://www.chromestatus.com/feature/5088147346030592](https://www.chromestatus.com/feature/5088147346030592) and [https://www.chromestatus.com/feature/5633521622188032](https://www.chromestatus.com/feature/5633521622188032)
> 
> I reported it to them and they fixed it within 2-3 days on their PHP platform.

As a workaround for CF2016 (and CF10 & 11), I'm using this modified [UDF](https://gist.github.com/JamoCA/bc34e27704eac277fcaf7053c54912b6) to set a [CFCookie](https://cfdocs.org/cfcookie) &amp; a fallback "set-cookie" [CFHeader](https://cfdocs.org/cfheader). It's duplicates the response headers, but if CFCookie isn't used, the value isn't added to the COOKIE scope. (The 2nd set-cookie header automatically overwrites the first one set by CF.)

## Source Code

{% gist https://gist.github.com/JamoCA/bc34e27704eac277fcaf7053c54912b6 %}

-------------------------------------------

## 1/17/2020 Update

Adobe has indicated that this will be fixed in CF2016+, but it's 20 days away and nothing has been made available yes. On 1/16/2020, Google published [Get Ready for New SameSite=None; Secure Cookie](https://webmasters.googleblog.com/2020/01/get-ready-for-new-samesitenone-secure.html) and listed other platforms that had [same-site examples](https://github.com/GoogleChromeLabs/samesite-examples).

-------------------------------------------

## 3/24/2020 Update

Adobe has posted manual patches for CF2016 & CF2018 on the [bug report](https://tracker.adobe.com/#/view/CF-4201688). (If using CF2016, download the CF2018 attachment as the instructions for CF2016 are incorrect.)

If you are still using ColdFusion 10 or 11, you can use this [UDF](https://gist.github.com/JamoCA/bc34e27704eac277fcaf7053c54912b6) or Pete Freitag's solution for [IIS](https://www.petefreitag.com/item/850.cfm) or [Apache](https://www.petefreitag.com/item/894.cfm).
2020-03-25 - Code with me - hangout
Tags: phalcon, phalcon4, wuhanvirus, codewithme
Published: 2020-03-24 15:32:15

---
title: 2020-03-25 - Code with me - hangout
published: true
date: 2020-03-24 14:56:20 UTC
tags: phalcon,phalcon4,wuhanvirus,codewithme
canonical_url: https://blog.phalcon.io/post/2020-03-25-code-with-me-hangout
---

Another code with me hangout! Join us tomorrow at 17:00 EST (21:00 UTC)

Similar to our _Code with me_ hangout of last week, come join us tomorrow for a chat, code a bit and just have a nice time!

The hangout will be held on YouTube here:

[https://www.youtube.com/watch?v=ttuRMW7WefI](https://www.youtube.com/watch?v=ttuRMW7WefI)

Free format, just come and have fun, ask questions, bring beer!

Stay safe and keep coding!

* * *

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)
- [Brighteon](https://phalcon.io/brighteon)
- [LBRY](https://phalcon.io/lbry)
- [YouTube](https://phalcon.io/youtube)

<3 Phalcon Team
Daily Challenge #211 - Product Partitions
Tags: challenge
Published: 2020-03-24 14:55:00

---
title: Daily Challenge #211 - Product Partitions
published: true
series: Daily Challenge
description: How many ways can you express numbers as products of others?
tags: challenge
---
Given a natural number `n`, we want to know in how many ways we can express these numbers as product of other numbers.

For example, the number 18:
<pre>18 = 2 x 9 = 3 x 6 = 2 x 3 x 3 #(3 ways) </pre>

See this example, a bit more complicated:
<pre>60 = 2 x 30 = 3 x 20 =  4 x 15 = 5 x 12 = 6 x 10 = 2 x 2 x 15 = 2 x 3 x 10 = 2 x 5 x 6 =  3 x 4 x 5 = 2 x 2 x 3 x 5 #(10 ways)</pre>

We need to implement the function prod_int_part(), that receives a number n, and outputs the total amount of different products with all the products of max length sorted in this way:

1) each product will be expressed in a list of its factors in increasing order from left to right

2) if there is more than one list-product, these lists should be ordered by the value of the first term, but if two lists have the same term then it should be ordered by the value of the second term.

Let's see some cases:
`prod_int_part(18)` == `[3, [2, 3, 3]]`
`prod_int_part(60)` == `[10, [2, 2, 3, 5]`

If we have only one list-product with the maximum length, there is no use to have it with two nested braces, so the result will be like this case:
`prod_int_part(54) == [6, [2, 3, 3, 3]]`

Now, let's see examples when n cannot be partitioned:
`prod_int_part(37) == [0, []]`
`prod_int_part(61) == [0, []]`

###Examples
`prod_int_part(60)`
`prod_int_part(54)`
`prod_int_part(37)`

Enjoy!

***
_This [challenge](https://www.codewars.com/kata/56135a61f8b29814340000cd) comes from raulbc777 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!_
Customizing Python Docs Generated by Sphinx
Tags: python, documentation, css, sphinx
Published: 2020-03-24 14:33:48

---
title: Customizing Python Docs Generated by Sphinx
published: true
description: I tried to add customized css to Sphinx for the TerminusDB Python Client. I was not sure that it works, it's a blind let's code.
tags: Python, Documentation, CSS, Sphinx
---
I tried to add customized css to Sphinx for the TerminusDB Python Client. I was not sure that it works, it's a blind let's code.

See more at my [YouTube Channel](https://www.youtube.com/channel/UCie_J9IohYO4hSsz4O2mDfQ)
Follow to catch me live on [Twitch](https://www.twitch.tv/cheukting_ho)
Help - Accessing js file present on localhost:8080 from localhost:4200
Tags: help, javascript
Published: 2020-03-24 14:28:30

Hi, I have an angular project (running on localhost 4200) wherein I am displaying html content in an iframe by using innerHtml. The html content has js files which are present on localhost:8080. HTML file is not able to render completely as it is not able to access the js files. How do I make this work? 

<script type="text/javascript" src="http://localhost:8080/WebAplusServer/js/jquery.js"></script>
In times of crisis, help others!
Tags: javascript, remote, covid, programming
Published: 2020-03-24 14:07:28

In a beautiful #stayhome Sunday, my fourth day in quarantine, I found myself in an internal brainstorming session on how to exploit this situation, which is a horrible moment for most people, to help. I don't like to think about how sad COVID-19 can be and how my family and friends could get hurt with it. I'd like to stay positive about this whole situation and try to find a way in which I can help others. I was shocked with my family spending their time at home spreading bad news on WhatsApp all day long. This was destroying my relative's peace of mind. Why were they doing this? Why couldn't they stop thinking about COVID-19? So, I had an idea.

## The problem
The main reason why they were talking to each other and spreading bad news on social media was that there wasn't another way of knowing about the situation besides checking every minute on what people were posting and how COVID-19 was affecting other lives. Most of the informative website about COVID-19 is written in English. Here in Brazil, most people, including my relatives, can't speak nor read in English.

## The idea
My idea was to build a website that was simple enough for my grandparents, and with real data in order to keep them daily posted about the situation in the world, country, states, and cities. By doing this, I hope they could get on with their lives and occupy their minds with constructive and productive thoughts.

## The solution
I built [this website!](https://covid-19.t10.digital/) using [John Hopkins University CSSE API](https://coronavirus.jhu.edu/map.html) and [Brasil.io API](https://brasil.io/home). Data gets updated daily according to government informative bulletins.

## Final considerations
Everyone is or at least should be staying at home. We, as developers, are one of the few professionals that can continue being productive even at our homes. So, find yourself some time in a quiet #stayhome weekend and put your awesome mind to work! You can help others too!

P.S: I'm not very good with design
Adding days to a date using Vanilla JS
Tags: javascript, vanilla
Published: 2020-03-24 14:01:36

This is a short post about how we can manage a common situation with our propper implementation.

Despite the JavaScript `Date` warts, it’s straightforward to add days to a date in JavaScript.

> Today we have a ton of libraries and external modules to work with dates. It's overwhelming!

While it would be very easy to reach for `moment.js` or another date manipulation library (`date-fns`, `luxon`, `dayjs`) to do something as simple as adding days to a Date in JavaScript, writing a short helper function might just be easier.

## A utility function that creates a Date copy

```javascript
function addDays(date, days) {
  const copy = new Date(Number(date))
  copy.setDate(date.getDate() + days)
  return copy
}

const date = new Date();
const newDate = addDays(date, 10);
```

## Mutating the Date directly

```javascript
const date = new Date();
date.setDate(date.getDate() + 10);
```

## Gotchas and examples
This actually works as expected, eg. the month rolls over.

```javascript
const d = new Date('2019-04-14');

const monthRollsOver = addDays(myDate, 31);
console.log(monthsRollOver)
// 2019-05-15
```

Of course, if you’re already using a data manipulation library elsewhere in your code, you should leverage that since you’re already paying the download/parse cost.