teleren/devto huggingface dataset:
Fluent interface in python
Tags: python, fluent, interface, discuss
Published: 2020-02-22 01:31:16

---
title: Fluent interface in python
published: true
description: 
tags: python, fluent, interface, discussion
---

# Intro

This is nothing new, Martin Fowler propose [that](https://www.martinfowler.com/bliki/FluentInterface.html) way of expose apis several years ago. This is only a tiny explanation and the reasons because i choosen in certain cases this kind of implementation for my personal projects.

This  past year i have been building a [signalr core python client](https://dev.to/mandrewcito/singlar-core-python-client-58e7), i tried to build the public interface of the objects, as similiar as i can to the other official clients like javascript. That lead me to Fluent interface design. As a first aproximation i will code a toy example explaning the term.

# Examples

```python
class ExampleNonFluent(object):
    foo = None
    bar = None
```

Now if we want assing a value to foo and bar code will be as following:

```python
my_class = ExampleNonFluent()
my_class = "new foo value"
my_class = "new bar value"
```
Changing the way of we implement our object with fluent interface will be similar to this:

```python
class ExampleFluent(object):
    foo = None
    bar = None

    def cfg_foo(self, value):
        foo = value
        return self

    def cfg_bar(self, value):
        bar = value
        return self
```

Object implementation is more extense, yes but now building object will be more readable:

```python
my_class = ExampleFluent()\
    .cfg_foo("new foo value")\
    .cfg_bar("new bar value")
```

What's your thoughts about this topic, place here your opinion, it can be a nice discussion :)
My journey as an iOS Developer 1: The Beginning
Tags: ios, swift, android, mobile
Published: 2020-02-22 00:46:49

Hi, my name is Diego Salcedo. This is my first post here and I would like to share my journey as an iOS developer. First of all, I going to be honest, I am super duper beginner in iOS. I started learning this 4 days ago. The funny thing is that Im currently working as an iOS developer and I have to present an app for a pizza businnes in two and a half months. So, maybe you will ask.

Hey idiot, how do you accept that work?
How they employee you?
Well, that was a funny story, via LinkedIn I got an offer to an Android Developer job. In the interview, now my boss told me about that project od making an app in iOS. I told him that I did not know nothing about that. Nevertheless, he offer me that job. So, I always wantes to make iOS apps, the remuneration was great, I felt in love with the opportunity of create an app from scrath for a huge pizzas businnes. Sooooo, I said YES.

The problem, I just have a mac in the office, in my house I dont have a mac :( (maybe in two months I will buy one).

So I want to share all my experience learning swift from scratch, making this app, trying to program on xcode from a hackintosh (dont worry in two months I will buy my new mac)

Hope you like it!
Comparing identical Objects in Javascript
Tags: javascript
Published: 2020-02-22 00:25:43


Javascript has a funny way of using comparison. If you were to use the strict equality operator like primitives like strings and numbers, it checks the value. However, between plain objects, arrays, and dates, it will compare the reference. This will check to see if the objects both refer to the same location in memory. 

[![Image from Gyazo](https://i.gyazo.com/4f97afb4d555ba80ac147718bf925bc3.png)](https://gyazo.com/4f97afb4d555ba80ac147718bf925bc3)

As you can see here, the apple and cherry comparison comes to false even with the same value, but not the same reference. Between the raspberry and the apple, they are the same as they have both the same value and reference. Again, the comparison is false between raspberry and cherry as the reference is not the same. 

##How do we know if two objects are identical?

Here is a basic approach to checking between two objects:

[![Image from Gyazo](https://i.gyazo.com/6e8c1d74ba73ab89651c224789274b9e.png)](https://gyazo.com/6e8c1d74ba73ab89651c224789274b9e)

For more extreme edge cases, you should rely on a well tested library like [Underscore](http://underscorejs.org/#isEqual) and [Lodash](http://lodash.com/docs#isEqual). They both have a method named _.isEqual that handles deep comparisons.
Drag and Drop File Upload in Laravel 6 Using DropzoneJS
Published: 2020-02-27 10:19:54

---
title: Drag and Drop File Upload in Laravel 6 Using DropzoneJS
published: true
date: 2020-02-22 00:00:00 UTC
tags: 
canonical_url: 
---

In this example you will learn drag and drop file upload in laravel step by step explain dropzone file upload laravel you can see dropzone js in laravel this example will help you multiple file upload laravel dropzone So lets follow few step to create example of upload file using dropzone in
What is your reason? 
Published: 2020-02-21 23:48:08

*"actions shall be judged according to intentions"*, these were the words of prophet Muhammad (S.A.W). We all have reasons for all we do and say. We all have a cause, a decision that stand as basis for our actions. The question you should ask yourself is why do you do the things you do, it is to impress people?, or to impress yourself?. Don't just formulate reasons out of the blue, think them out, nurture them and see them help you do better than you expected. **"if you must act, act with a utilitarian reason, not a selfish one, for you live not only for yourself, but for those around you too"**.
Using Git Emoji :construction:
Tags: gitmoji, git
Published: 2020-02-21 23:37:26

In generally I have viewed the :construction: emoji as one which shouldn't make its way into the mainline, fixup commits should be applied until it is not under construction.

I have recently identify a good use for this emoji that should be preserved in the mainline history. Copy-Paste.

In this situation I have to have a duplication of another section of code and while they are similar it makes sense that they ultimately would evolve without the desire to remain consistent.

Basically it would be a commit made after pasting in some code you found on stackoverflow.com, your commit message would have the url reference etc. 

{% link https://dev.to/jessekphillips/selecting-the-right-emotion-for-your-commit-35kb %}
2019 IN REVIEW
Tags: review, slimcoder
Published: 2020-02-21 23:21:38

---
title: 2019 IN REVIEW
published: true
description: 
tags: review , slimcoder
---

I know i'm late but my last year was very great so here is list of my achievements. 

- 946 Contributions on GitHub.
- 11 Contributions in FreeCodeCamp as contributor.
- 4 Contributions in js.org as contributor.
- 130 Contributions in Techistan as member.
- 2 Contributions Mentor Without Borders as member.
- Joined two organization on github : 
  1) Techistan 
  2) Mentor Without Borders.
- Created 3 Real Time projects in Techistan.
- Become mentor at Mentor Without Borders.
- Become volunteer in Devncode.
- 80 reputation on Stack OverFlow.
- 2k people reached on Stack OverFlow.
- 1 question and 12 answers by me on Stack OverFlow.
- 7 Bronze badge on Stack OverFlow.
- 7 followers on Medium.
- Published 3 articles on Medium.
- 1st article states : 59 views , average reading time : 52 sec , claps : 1.
- 2nd article states : 125 views , average reading time : 1 min 6 sec , claps : 54.
- 3rd article states :  83 views , average reading time : 39 sec , claps : 67.


I'm maintaining a document file for all my contributions please check : https://docs.google.com/document/d/1BifR_3Ds7ibr9QM4u4zTdLyLXAzfQTQg50PhvHgeXTw/edit?usp=sharing

I will update that file on monthly/weekly basis.
I made a chess library in Java
Tags: chess, java, library, github
Published: 2020-02-21 22:23:32


Hey guys, in this post I just wanted to share this project I've been working on for the past couple of weeks.

It's basically a library written in Java that represents the game chess. You can create a board, make moves on it, kill pieces, check if a move is valid, castle kings and rooks, etc. It could be used to make a chess game in java, create a chess AI, create an online chess server, etc.

My project is hosted on GitHub, and I'd appreciate it if you could check out my hard work. ;)
[https://github.com/jaeheonshim/ChessBoard](https://github.com/jaeheonshim/ChessBoard)

You can also find some instructions on how to use the library on GitHub. The library is hosted on maven central and can be downloaded to any project simply by adding my package as a repository.

This project is still a work in progress and there are many features left to implement. I just wanted to share the current state of the project.

Thanks!
Jaeheon
I never deploy on Fridays, but when I do...
Tags: devops, discuss
Published: 2020-02-21 22:21:08

---
title: I never deploy on Fridays, but when I do...
published: true
description: Who else is deploying right now?
tags: devops, discussion
---

![](https://media.giphy.com/media/xT77XGGgWsmn9UmmKk/giphy.gif)

I know you're not supposed to. I may have been the one to tell you not to. And yet, sometimes I can't help myself... 😬

Anybody else deploying today? If so, why? What are you shipping that's so important?

I'll tell if you tell. :)
How To Recover Deleted Pictures On Any Android Phone
Tags: recover, pictures, photo, deleted
Published: 2020-02-21 21:17:32

FonePaw Android Data Recovery is a desktop software that can easily recover deleted pictures and old Android images from phones and tablets. It supports images in .jpg, .png, .gif, .bmp, .webp, .tiff formats and more. And is compatible with most Android phones, and is able to recover deleted images. http://androidpen.com
Defining Structures
Published: 2020-02-21 20:42:37

In this lesson we begin talking about the app’s model, or data model, which is the types of data that an app deals with collectively. Different kinds of apps have different data models, each of which has its own set of types. We have been working with strings, ints, and bools a lot but in this lesson, we learn that you are not limited to the types already in swift; you can create your own types. One way to do this is by declaring a structure. A structure is a way of grouping values of other types together. Once you have declared a new type, you can then create an instance of that type. Also, when you declare a structure, an initializer is automatically created for you. This initializer has a parameter for each member property in the struct, which is called a memberwise initializer. When you begin typing the struct, the autocompletion pop-up menu will include the memberwise initializer. You can make your own structs mutable or immutable, just declare any changeable properties using var and Assign the struct to a variable, not a constant. Your own types can be passed into or out of functions, just like built-in types. A function is declared outside of the struct. A method is declared inside of the struct. Structures are a better way to define data because you can organize data together instead of declaring a series of variables.
Exercism Ruby - Hello World
Tags: exercism, ruby, helloworld
Published: 2020-02-21 20:10:25

---
title: Exercism Ruby - Hello World
published: true
description: The classical introductory exercise. Just say "Hello, World!".
tags: exercism, ruby, helloworld
series: Exercism Ruby
cover_image: https://res.cloudinary.com/practicaldev/image/fetch/s--vZNNvhQv--/c_imagga_scale,f_auto,fl_progressive,h_420,q_auto,w_1000/https://dev-to-uploads.s3.amazonaws.com/i/ugyvp6xn69upc1u5evqa.png
---

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

The classical introductory exercise. Just say "Hello, World!".

"Hello, World!" is the traditional first program for beginning programming in a new language or environment.

The objectives are simple:

* Write a function that returns the string "Hello, World!".

* Run the test suite and make sure that it succeeds.

* Submit your solution and check it at the website.

```rb
# Common test data version: 1.1.0 be3ae66
class HelloWorldTest < Minitest::Test
  def test_say_hi
    assert_equal "Hello, World!", HelloWorld.hello
  end
end
```

My solution is:

```rb
class HelloWorld
  def self.hello
    "Hello, World!"
  end
end
```

I know this time was pretty simple, see you next time!

I'm doing a youtube series about these exercises if you want to follow me, you are welcome, this is the channel [juanvqz](https://youtube.com/juanvqz_)   and this is the [exercism playlist](https://www.youtube.com/playlist?list=PL4yLj0azo9NWrE5C39TkR2ZoaP6o1Ksi7)
Trying to make better quality Python videos and looking for feedback! Here's one of our first videos on Web Scraping and SQLite
Tags: python, discuss, tutorial
Published: 2020-02-21 20:14:19

There's quite a lot of content on Youtube for Python and we've all likely skipped through many videos with bad audio or really small font trying to find an answer to a problem. We want to make better quality and more entertaining content for Python, so we'd really appreciate any feedback on the videos we've made so far, suggestions on what topics you would like us to cover or just your thoughts in general about developer content on Youtube.

Here are the links to our first couple videos.
Web Scraping - https://www.youtube.com/watch?v=ogPMCpcgb-E
SQLite - https://www.youtube.com/watch?v=girsuXz0yA8

Some Feedback so far
- better audio levels
- more depth into a topic
Naming Things: Thoughts on one of coding’s most elusive tasks
Tags: naming, productivity, codequality
Published: 2020-02-21 20:11:57

---
title: Naming Things: Thoughts on one of coding’s most elusive tasks
published: true
description: A new, free online book
tags: naming, productivity
---


Hey Devs! 

I've just released a [free online book called **Naming Things**](https://namingthings.donedone.com). It's a collection of experiences I've had with naming all kinds of things in code--classes, objects, methods, properties, and business concepts.

I've had the unique opportunity to work mainly on one piece of software for many years--I began developing DoneDone in 2008 and I've been deeply involved in its maturation for more than a decade.

DoneDone's codebase is something I look at nearly every day. To care for the same product for so long, it helps to actually love what you're working on. Naming things well is especially important to me because of this.

As Phil Karlton famously wrote:

> There are only two hard things in Computer Science: cache invalidation and naming things.

In this book, I hope to show you a few of the surprising conundrums I've faced with naming and how I ultimately resolved (or did my best to resolve) them. This book is an honest and open discussion about a topic I think is underdiscussed in our industry. I do hope you enjoy it.
My Coding Journey
Published: 2020-02-21 20:06:19

Hello, my name is Richard.  I've decided to blog my coding journey.  I'm recently new to this.  Started about 2 months ago and barely finished a month of consistently coding everyday.  I'll attempt to keep track of my daily coding and continue on honing my technical skills in this field.  Hopefully, at the end of the webdev playbook which is 6 months, I can land a career in tech less than a year.  Wish me luck!
Fix Chrome80 SameSite Issue
Tags: webdev, angular, security, beginners
Published: 2020-02-21 20:05:29

---
title: Fix Chrome80 SameSite Issue
published: true
description: 
tags: #webdev #angular #security #beginners
---

### Problem Statement
Chrome released a new version in January 2020 (v80), it is available now for everyone to consume. Chrome 80 will begin enforcing a new secure-by-default cookie classification system, treating cookies that have no declared SameSite value as SameSite=Lax cookies. Only cookies set as SameSite=None; Secure will be available in third-party contexts, provided they are being accessed from secure connections. *Angular apps won't be able to run locally throwing SameSite error in console.*


#### SSL to the rescue

*What is SSL?*

Secure Sockets Layer (SSL) was the most widely deployed cryptographic protocol to provide security over internet communications. SSL provides a secure channel between two machines or devices operating over the internet or an internal network. One common example is when SSL is used to secure communication between a web browser and a web server. This turns a website's address from HTTP to HTTPS, the ‘S’ standing for ‘secure’.


### Fine, how do I fix my local issue?

Add `--ssl` to your start script in **package.json**, Angular would generate an ssl certificate for you in the background. You need to run Angular CLI over HTTPS instead of HTTP

![ng-start-script](https://dev-to-uploads.s3.amazonaws.com/i/4b9ceqcjxmfky5ul6wwe.png)
 
Now, run `npm run start` to launch your app locally and serve it would serve it over HTTPS. Voila!

##### References:
 
- Running Angular CLI over HTTPS with a Trusted Certificate: https://medium.com/@rubenvermeulen/running-angular-cli-over-https-with-a-trusted-certificate-4a0d5f92747a

- Tips to test with Chrome 80: https://www.chromium.org/updates/same-site/test-debug
Wizar devlog 05 - Advancement on Ravioli
Tags: typescript, sam, gamedev
Published: 2020-02-21 19:59:20

Great advancements on Ravioli this week !

To make it short I am now able to create component instance and add them :
- acceptors
- action
- basic next action predicate

I have also implemented sync, async, cancelable async and composable action.

It remains to implements:
- control state
- more advanced next action predicate
- representation of the model

Here is an example with a mini scenario: A player hits a grunt which auto heals itself twice in reaction.

Next week I will put a live demo online on code sandbox.

```ts
test('A player hits a grunt which auto heal itself twice in reaction.', 
  function() {
    const Grunt = component(
      object({ hp: number() })
    )
      .addAcceptor('setHP', model => ({
        mutator({ hp }: { hp: number }) {
          model.hp = model.hp + hp / 2
        },
      }))
      .addActions({
        hit() {
          return [
            {
              type: 'setHP',
              payload: {
                hp: -2,
              },
            },
          ]
        },
        heal() {
          return [
            {
              type: 'setHP',
              payload: {
                hp: 6,
              },
            },
          ]
        },
      })
      .addNAP("double damage", ({acceptedMutations}, {heal}) => {
        const isHit = acceptedMutations.some(({type, payload}) => type === 'setHP' && payload.hp < 0)
        const isHealed = acceptedMutations .some(({type, payload}) => type === 'setHP' && payload.hp > 0)
        if(isHit) {
          console.log("Thrall is hit: -3")
          console.log("Buff double heal")
          heal()
          heal()
        }
        if (isHealed) {
          console.log("Thrall is healed: +6")
        }
      })

  const Thrall = Grunt.create({ hp: 10000 })

  Thrall.actions.hit()

  expect(getData(Thrall).hp).toBe(10003)
  // Battle log:
  // Thrall is hit: -3
  // Buff double heal
  // Thrall is healed: +6
})
```
Engineer's Week 2020
Published: 2020-02-21 19:51:26

This week (Feb 16-22) is Engineer's week. Similar to other themed weeks throughout the year, this one is focused on appreciating the engineers that work to build, support, or produce the things around you, as well as to inspire the next generation with engineering topics. 

Side note: [DiscoverE](http://www.discovere.org/our-programs/engineers-week) is a great resource for activities and documents you can use to help engage with your local community for introducing people to engineering concepts in a fun and educational way. 

As this Engineer's week comes to an end, we here at DealerOn wanted to take a moment to thank all of our engineers that work hard every day to build and support all of the myriad systems behind our services and products. Thank you all for what you do; for sticking it out until the early morning hours when there's a large migration or system deployment; for reviewing and double checking each other's work to minimize any production issues; for QAing the upcoming builds thoroughly and catching any oversights or missed requirements before they get too far in the pipeline; for considering the user experience and use cases so expertly when designing a new interface for our colleagues or customers.

From all of us here at DealerOn, Thank You.
I could not access newly created web application in SharePoint Central Administration.
Tags: sharepoint, windowsserver, vmware
Published: 2020-02-21 19:51:21

###__"I could not access newly created web application in SharePoint Central Administration."__###
It was the problem that bothered me today.

After strenuous efforts, I resolved it.

I installed __SharePoint Server 2019__ on __Windows Server 2019__ in __VMware Workstation 15 Pro__.
Then I created a new web application using default settings.

![create new web application](https://dev-to-uploads.s3.amazonaws.com/i/xg19k5l2fulnugsoqsqy.jpg)

Web application `jsguru.group.com:29457` was created. See screenshot below.

![jsguru.group.com](https://dev-to-uploads.s3.amazonaws.com/i/txq3zgw1q4tabfl0e4du.jpg)

So far so good.
But when I tried to access the web application in VM machine I had worked on, I could not.

![connection failure](https://dev-to-uploads.s3.amazonaws.com/i/vebd5bjgwtkfodl8ulbx.jpg)


Let me show you how I resolved it.

__Step 1.__ Add the web application name (here `jsguru.group.com`) to the string value of `BackConnectionHostNames` under 
 windows registry `HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0`.
If there is no entry `BackConnectionHostNames`, you have to create it as multi-string value.

![BackConnectionHostNames](https://dev-to-uploads.s3.amazonaws.com/i/mtnvi4s5yc9mgdazl0l5.jpg)

Alternatively, create DWORD-value entry `DisableLoopbackCheck` with value 1 under `HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa`.(This is not recommended)

__Step 2.__ Add the IP address and host name of the web application to the bottom of the hosts file. The hosts file path is `C:\Windows\System32\drivers\etc`

![hosts](https://dev-to-uploads.s3.amazonaws.com/i/79t6ahhwtmp5ooqmpk0f.jpg)

Thus I could get access to the web application.

![success](https://dev-to-uploads.s3.amazonaws.com/i/j551gd9cj73f902mqt79.jpg)

I hope this helps someone who is trying to do the same thing like me.
Function values in Go
Tags: go, beginners
Published: 2020-02-21 19:48:19

In the <a href="https://golang.org/">Go</a> programming language, <a href="https://golangr.com/methods/">functions</a> are values. That means that you can pass a function as parameter in a function.

For example, you can define a function `mul` which multiplies x and y. Then it returns the result.

```go
mul := func(x, y float64) float64 {
    return x*y
}
```

Then you could assign the output to a variable and output it

```go
var a float64
a = mul(3,5)
fmt.Println(a)
```

However, you can directly output it as a result to the print function

```go
fmt.Println(mul(5, 12))
```

The program would then be:

```go
package main

import (
	"fmt"
)

func main() {
	mul := func(x, y float64) float64 {
		return x*y
	}
	fmt.Println(mul(5, 12))
}
```

This results in:

    60
    
    Program exited.

**Related links:**
* <a href="https://golang.org/">Go website</a>
* <a href="https://golangr.com/">Learn Go</a>