teleren/devto huggingface dataset:
Realtime TextField updating
Tags: ios, swift, beginners
Published: 2019-07-04 15:05:02

I just noticed while making a character count enabled textview that the count is always a few characters behind the actual text.

The problem in this was that the complete string that is entered isn’t updated in the text attributed of your text field until it returns true from the change characters in range function in its lifecycle.

{% gist https://gist.github.com/midhetfatema94/cc356875c283f04b37031f478344cf0c %}

The value of *currentText* in this function will give you the updated value or the complete string you’ve entered.

**Update:** The string gives you the latest character you have entered or deleted, if you want the updated text after each character is updated or deleted, your function will look something like this:

{% gist https://gist.github.com/midhetfatema94/3225b294f5d99baac8d1ee181a3125c8 %}


This removes the backspaced string from your currentText as well as adds it if you have typed it in.

Hope this helped you :)
Manage Groups in Azure
Tags: azure, azuresecurity
Published: 2019-07-04 14:53:37

---
title: Manage Groups in Azure
published: true
description: Manage Groups in Azure
tags: Azure, Azure Security
---
**Manage group membership**

Try to manage group membership for users in your Azure AD tenant. For an explanation of how to do so, refer to “Add or remove group members using Azure Active Directory” at https://docs.microsoft.com/en-us/azure/active-directory/active-directory-groups-members-azure-portal.

**Create a group and add members**

Try to create a group and add members in Azure AD. For an explanation of how to do so, refer to “Create a basic group and add members using Azure Active Directory” at https://docs.microsoft.com/en-us/azure/active-directory/active-directory-groups-create-azure-portal. Use a group to perform management tasks, such as assigning licenses or permissions to several users or devices simultaneously.

**Manage profile information**

Try to add or change profile information for a user in Azure AD. For an explanation of how to do so, refer to “Add or update a user's profile information using Azure Active Directory” at https://docs.microsoft.com/en-us/azure/active-directory/active-directory-users-profile-azure-portal).

✔️ As you have time, experiment with other user and group administrative tasks. If you want to try some of these tasks by using Azure PowerShell, refer to ”AzureAD” at https://docs.microsoft.com/en-us/powershell/module/Azuread/?view=azureadps-2.0.
Fancy Confirm Box with React and GSAP
Tags: codepen, react, html, css
Published: 2019-07-04 14:52:23

<p>These buttons will become a confirm box if clicked.</p>

<p>I tried to study the React JS library.</p>

<p>The animations are built in GSAP.</p>

{% codepen https://codepen.io/takaneichinose/pen/mZLGaj %}
Using special HTML characters in Elm
Tags: elm, webdev
Published: 2019-07-04 14:47:35

---
title: Using special HTML characters in Elm
published: true
description: 
tags: elm, webdev
---

**NOTE:** *Works for Elm 0.19.*

If you attempt to display the copyright symbol using the following:

```elm
view = text "&copy;"
```

Then you'd literally see `&copy;`.

In order to get &copy; you need to use Unicode escape characters.

```elm
view = text "\u{00A9}"
```

It's that simple.

If for any reason you mess up the escaping syntax (maybe you forget the curly braces, like a "friend" of mine did ;)) then Elm has your back with this insanely helpful error message.

![Unicode escape characters error message](https://thepracticaldev.s3.amazonaws.com/i/6e56s1uyyi71yrdztp7i.png)

BTW, you can lookup the hex codes for what you need [here](https://ascii.cl/htmlcodes.htm).

**P.S.** *I needed to figure this out when I had to [output a non-breaking space](https://github.com/dwayne/elm-drum-machine/blob/1c17d9f41af5a4f56b5817f0e05f520f3579c3da/src/Main.elm#L283) in my [Drum Machine](https://github.com/dwayne/elm-drum-machine) project.*
Deploying React App from Github to Netlify
Tags: react, javascript, beginners, webdev
Published: 2019-07-04 14:35:30


I will be doing a walk-through process of deploying a React app from Github to Netlify.


If you have a project structure where the react app is **NOT** nested in a sub-directory like in the example shown below
 
![](https://thepracticaldev.s3.amazonaws.com/i/k6m7qw5aru5yrr4hov8f.png)

You can use the following steps to deploy:
- Push your code to Github
- Connect Github account to your Netlify account
- Select the project to deploy
- Deploy project


![](https://thepracticaldev.s3.amazonaws.com/i/ir0dx8e157r8y3kaj7a6.gif)


In cases where the react app is in a nested directory like the example shown below

![](https://thepracticaldev.s3.amazonaws.com/i/9th5maami9dct1ttqhw7.gif)


 Add a **`netlify.toml`** file to the root of your project, and add the configuration below to the file.

   

    [build]
      command = "npm run build"
      publish="path-to-react-app/build"
      base = "path-to-react-app"




## React Router

If you've made use of react-router in your project, on redirecting and reloading to a new route, you may run into issue where Netlify would throw an error ("page not found") as shown in the example beloww

![](https://thepracticaldev.s3.amazonaws.com/i/s1d1njph3hvj1q5o72zk.gif)
 

You can add the following code to your `netlify.toml` file.

    [[redirects]]
      from = "/*"
      to = "/index.html"
      status = 200
Once added, push the changes to Github. Netlify should automatically deploy the changes, if not, deploy the changes manually. Once deployed, your application should not throw errors, as shown below.

![](https://thepracticaldev.s3.amazonaws.com/i/zpi9ay3vqwe9kqk7gxtz.gif)


**Note:** *`netlify.toml` is a configuration file where you can specify how Netlify should build/run your application. A lot can be accomplished with the `netlify.toml` file. Find out more about the `netlify.toml` file [here.](https://www.netlify.com/docs/netlify-toml-reference/)*


## Environment Variables
If you've made use of environment variables in your project, you can also add them to Netlify by following the steps shown in the image below

![](https://thepracticaldev.s3.amazonaws.com/i/wwt70a8li0bekdy9xg82.gif)


## Conclusion
From the foregoing, we have seen and been able to demonstrate that hosting a react application through Github on Netlify is pretty simple and seamless, hence can be done in little or no time.


If you have any questions or feedback about this article, feel free to reach out.
Thanks for reading.
PHP5 to PHP7 code migration steps for the medium or large code base.
Tags: php7, migration, php7upgrade
Published: 2019-07-04 14:22:48

---
title: PHP5 to PHP7 code migration steps for the medium or large code base.
published: true
description: A better way to migrate the code from PHP5 to PHP7 and some important deprecated functionalities.
tags: php7, migration, php7 upgrade
---

**Note:** The original detailed article is posted in https://www.nalashaa.com/php5-to-php7-migration/ by me.

Php 7 has come with really good features in that most important things are **improved in performance, lower memory consumption, many fatal errors converted to exceptions**.

**Steps to upgrade from PHP5 to PHP7:** 
Three main things are there while doing the upgrade. This below process will be helpful if your code base is medium or large.
1) Choosing an IDE (Jet Brains, Net Beans, Eclipse, and Visual Studio Code, etc.).
2) The code upgrade process.
3) Testing phase.

**Choosing an IDE:**
While doing an upgrade it is hard to know about all the deprecated and removed functions manually, to solve this issue smart IDE will be helpful.
1) Choose a smart IDE and set the environment to PHP 5.6 in that.
2) Open your entire project in IDE and check for the errors and suggestions given by IDE to refactor the code.
**Note:** To see the deprecated suggestions from IDE the configurations have to set properly.
3) If possible do refactoring in localhost rather than in development server connected via SSH.
4) Doing it in localhost will help us in saving the development time and also we can keenly monitor the deprecated and removed functions.


**Code Upgrade Process:**
Resolve all the errors including notice errors, deprecated errors in PHP 5.6.* then your code will run in PHP 7.0 version.
1) Set error reporting to E_ALL as below. Eg: error_reporting(E_ALL ^ E_STRICT);
2) Solve all the errors including notice errors and deprecated errors.
3) If the codebase is large then just resolve the errors to make it work in PHP 7.0. Then you can re-write your code module by module based on your feasibility.
4) If you are not using mysql_* extension in your old version it would be easy to upgrade otherwise it will take time, based on your code base size.
5) If you are using mysql_* extension to make your work simple try to replace it with mysqli_* so that it will be easy to upgrade. If you have time to upgrade then create an abstraction layer for database operations by using PDO extension because PDO supports multiple databases.


**Testing Phase:**
1) Maintain the logs for database errors, as like you should receive a mail and  that you will get
2) Create the logs for php errors date wise.
3) Create a new testing server i.e. it should be a copy of production server and release it few customers for testing and monitor.
4) If everything is ok you can move it to production.


**Note:** The original detailed article is posted in https://www.nalashaa.com/blog/ by me.
A good joke...
Tags: joke
Published: 2019-07-04 14:11:18

CIA – Computer Industry Acronyms

CD-ROM: Consumer Device, Rendered Obsolete in Months
PCMCIA: People Can’t Memorize Computer Industry Acronyms
ISDN: It Still Does Nothing
SCSI: System Can’t See It
MIPS: Meaningless Indication of Processor Speed
DOS: Defunct Operating System
WINDOWS: Will Install Needless Data On Whole System
OS/2: Obsolete Soon, Too
PnP: Plug and Pray
APPLE: Arrogance Produces Profit-Losing Entity
IBM: I Blame Microsoft
MICROSOFT: Most Intelligent Customers Realize Our Software Only Fools Teenagers
COBOL: Completely Obsolete Business Oriented Language
LISP: Lots of Insipid and Stupid Parentheses
MACINTOSH: Most Applications Crash; If Not, The Operating System Hangs
AAAAA: American Association Against Acronym Abuse.
WYSIWYMGIYRRLAAGW: What You See Is What You Might Get If You’re Really Really Lucky And All Goes Well.
Daily Challenge #7 - Factorial Decomposition
Tags: challenge
Published: 2019-07-04 14:00:57

---
title: Daily Challenge #7 - Factorial Decomposition
published: true
series: Daily Challenge
description: Day #7, Factorial Decomposition challenge. 
tags: challenge
---
Today's challenge will require a bit of mathematical prowess. Those who were fans of the Project Euler challenges might have some fun with this one from user [_g964_ from CodeWars](https://www.codewars.com/kata/5a045fee46d843effa000070):

> The aim of this [challenge] is to decompose `n!`(factorial n) into its prime factors. Prime numbers should be in increasing order. When the exponent of a prime number is 1, don't print the exponent. 

>#####Examples:
>n = 22; decomp(22) -> "2^19 * 3^9 * 5^4 * 7^3 * 11^2 * 13 * 17 * 19"
>n = 25; decomp(25) -> "2^22 * 3^10 * 5^6 * 7^3 * 11^2 * 13 * 17 * 19 * 23"

>#####Explanation:
>n = 12; decomp(12) -> "2^10 * 3^5 * 5^2 * 7 * 11"
>12! is divisible by 2 ten times, by 3 five times, by 5 two times and by 7 and 11 only once.


***
_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 for a future post?  Email **yo+challenge@dev.to** with your suggestions!_
Reasons why I think it is good 👍 to be a developer 🖥
Tags: career, programming, discuss, jobs
Published: 2019-07-04 13:26:53

In the last years I started enjoying more and more my job as developer. I have to admit this is in large measure related to the fact that I started working almost entirely with :heart: frontend technologies :heart:. But aside from this, there are also many other benefits that we cannot find in other professions.  

Below I created a short list of reasons why I love my IT job:

1. Face new challenges every day and feeling proud when we fix a problem.
2. Not a repetitive tasks (otherwise we automatise the process! :smile:).
3. Being able to fix grandma's 👵 Pc and explain her how to use Skype!
4. The possibility of learning something new almost every day.
5. Usually free coffee/tea :coffee: beverages offered by the the employer.
6. Being able to collaborate with a world wide community. 
7. Developers demand increases constantly, therefore it will be a stable job for the future.
8. Being able to *create* something that works (most of the time  :astonished:) starting from nothing. 
9. Writing articles to share personal know how and being able to reach potentially anyone in the world.
10. Allowing to start a private business with a very low to no budget available.
11. The possibility to attend international conferences and meet many great colleagues.
12. Linked to the previous one, the possibility to give talks to public tech events and spread knowledge.
13. Remote work 🏝 We can work whenever we want and from wherever we like!  
14. Being pushed to think `out of the box` to find creative solutions.

&nbsp;
**Do you have any other positive reasons to add?**
If so, leave a comment referring to your experience!!

![positive](https://media.giphy.com/media/l0Nwz1ehUndfqL9MQ/giphy.gif)
Automate Android with Python
Tags: python, android
Published: 2019-07-04 13:19:17

---
title: Automate Android with Python
published: true
description: python, android
tags: python, android 
---
<img src="https://media.giphy.com/media/D63BmEGlxJYLC/giphy.gif">

Android phones can be controlled through Python scripts. To do so, adb must be installed and the phone connected.

Then you can use adb shell commands to control the phone like

    #!/usr/bin/python3
    import os
 
    ...

    os.system("adb shell input tap 350 715")

which will click on the screen. You can also type text

    #!/usr/bin/python3
    os.system('adb shell input text "insert%syour%stext%shere"')

combined with time.sleep(seconds) you can automate any android app. Keeping in mind you don't have to use the phone at the same time.

## Script

You can wrap it around functions to make it easy. Connect your device with a usb cable, type

    adb usb

Then run the script below in your favorite chat program

    #!/usr/bin/python3
    import os

    def android_tap(x,y):
        os.system("adb shell input tap " + x + " " + y)
    
    def android_type(text):
        os.system('adb shell input text "' + text + '"')

    android_type("great")

The program adb can do a lot more, a wrapper like this makes your android phone scriptable

Learn Python:

* https://pythonbasics.org
* https://pythonprogramminglanguage.com
Pirate Bay Proxy
Tags: piratebay, tpb, piratesbay
Published: 2019-07-04 13:12:59

Is it accurate to say that you are scanning for The Pirate Bay, <a href="https://vpnalist.com/proxy-mirror-the-pirate-bay">Piratebay</a> intermediaries or privateer cove choices? 

Extraordinary, you're on the correct page that incorporates the most recent Piratebay news and rundown of best downpour locales. 

The Pirate Bay is one of the world's most well known and best downpour web indexes. The downpour search website enables clients to download free programming, motion pictures deluge, music. 

Piratebay se keep running on 21 attack evidence servers, facilitated with different cloud facilitating servers. 

Sitting in front of the TV arrangement or films online is an incredible method to engage yourself. Yet, the fun could be considerably more on the off chance that they want free with no problem. 

Deluges are phenomenal, yet it is anything but a smart thought to download copyright-ensured content. 

The idea of torrenting, trackers, or torrentz isn't unlawful. 

Likewise utilizing downpour customer programming like utorrent, BitTorrent isn't unlawful. 

Yet, on the off chance that you discovered blameworthy of copyright encroachment, you can be requested to pay harms. The individuals who download copyrighted substance without authorization are infringing upon the law. 

Numerous nations even force a robust fine or detainment on privateers. Like in India, you could be condemned to three-year jail whenever found visiting a deluge site. 

Piratebay Down? Privateer Bay Blocked? 

Because of lawful issues, some ISPs has blocked access to piratebay com. 

Yet, clients can in any case get to downpour destinations utilizing piratebay intermediaries or a protected VPN administration. 

Other than this, the site additionally here and there gets down because of specialized issues or mistakes. 

Just about two months prior, the piratebay site was down worldwide for reasons unknown. It left clients frustrated by incapable to download magnet connections or downpour records. 

Most recent Piratebay News 

In the event that you use privateer straight to download downpours, you should realize that the webpage could utilize your framework assets. 

Piratebay downpour site found mining computerized monetary forms utilizing its guests' PCs. 

In the same way as other best deluge locales, privateer straight likewise mines cryptographic forms of money to profit. 

he Pirate Bay is a standout amongst the best webpage utilized worldwide for downloading deluges. 

In the wake of accepting numerous protests, Pirate Bay communicated lament for mining without clients' assent. 

Likewise, administrator answered: "No doubt, no doubt, whatever. The time it takes to download downpour documents is totally and unessential. All you need from Pirate Bay is magnet joins. Open the site. Discover a downpour. Snap the magnet joins. Close the site. End of the digger."
I got hook...
Tags: react
Published: 2019-07-04 13:08:16

---
title: I got hook...
published: true
description: 
tags: #react
---
into "Hooks"


Why?

I found out that hooks are simple and easy to use without having a prior knowledge in constructor, binding and other javascript concepts before you finally meet React and learn it!

With "Hooks" you can just dive into the React itself by just simply just knowing the basics of the *Pancake* (HTML, CSS, JS). And this is what I would prefer to learn for My older self if He asks Me the "Which is which" question.

If you are a beginner in React and reading this.
Remember this:


I envy you. 😈
just kidding...

You know why?

Because "Hooks" saves you from peeling out the layers of onion concepts in javascript.

So Good Luck! if you are just starting in React you got a good starting point with "hooks" right there.

I also recommend you to learn more of Javascript concepts instead of just React. :)

Here is a links of resources if you want to learn hooks:
[React Today and Tomorrow and 90% Cleaner React With Hooks](https://youtu.be/dpw9EHDh2bM)
[Introducing Hooks (from the official React docs)](https://reactjs.org/docs/hooks-intro.html)


If you have any feedback, please feel welcome to leave a comment below.



Salamat.
Six Months to Prove Myself
Tags: java, impostersyndrome
Published: 2019-07-04 12:40:46

---
title: Six Months to Prove Myself
published: True
description: Making the most of every chance I have 
tags: Java, imposter syndrome,
---

Over the last 9 months I have been on a journey to really sharpen my skills as a C# developer. With those refined skills I was hoping to land a job as a developer in my company. This was not an easy task and one that I knew was going to take time and a lot of effort. When you work for company that employs over 5,000 people you are a small fish in a big pond. Especially when you are trying to get into IT with a goal of being a developer. 

I applied for a few positions, but each one was met with silence. I finally realized I needed to talk to a guy I knew and worked with about what I needed to really work on to land a position as a developer. He was aware of my skills and was already starting to put a bug into his managers ear about me. He suggested that I go and network with him next. 

After our meeting I immediately went back to my desk and fired off an email to the manager. I simply asked if I could meet with him and get his advice on what steps I needed to take. Two weeks later we got to meet and discussed what my goals were. The conversation went better then I could have expected. He brought up that he was made aware of my abilities and while he couldn't hire anyone to the team he would investigate the idea of "borrowing" me from my current team. 

From there I waited. Almost three months passed. BUT...he pulled me into a meeting room one day and asked if I would be interested in working on his team for the next six months. On the inside I was jumping up and down, but I remained calm on the outside. 

For the next six months I get to prove myself and build up my skills in a corporate setting. How did this happen? Because I pushed myself to step outside of my comfort zone. Because I took the initiative to ask "What can I for our company that will allow me to utilize my skills for them?"

And I'm going to do everything I can to make the most of this opportunity. 

To coincide with this I am going to write about my dev journey here. To succeed in this role I have to learn Java (already have a foundation in C++ and C#), API's, SQL, Solr, and ZooKeeper along with a few other things. so my posts will be about my learnings and best practices...I hope. 

Any feedback that comes my way I will welcome with open arms.
Python to Executable
Tags: python
Published: 2019-07-04 12:36:18

---
title: Python to Executable
published: true
description: python
tags: python
---
<img src="https://media.giphy.com/media/349qKnoIBHK1i/giphy.gif">

You can convert Python to executable programs (exe, elf, dmg). These programs can then be run like any other program on the users computer.

This is great, because you don't want to have to explain "install python, open the command line, type this command", but you share a one click program.

## Meet Pyinstaller

To do that, one option is pyinstaller.

    pip install pyinstaller

Create your program, then

    pyinstaller --onefile hello.py

And your program will be available in the dist directory. You'll get the distributable program for the operating system you are currently using.

On windows you'll get an exe, on mac a dmg and on linux an elf file. In the case of hello world you still need to run it from the command line ;)


Learn Python?

* https://pythonbasics.org
* https://pythonprogramminglanguage.com
403 forbidden error Django restful request.
Tags: django, python, restful
Published: 2019-07-04 11:41:55

---
title: 403 forbidden error Django restful request.
published: true
description: To resolve the 403 forbidden error in Django restful request.
tags: Django, Python, restful
---

Add the below statement on top of each and every view function definition (views.py). 

```
@api_view(["POST", "GET"])
```
eg:
```
@api_view(["POST", "GET"])
def GivenInput():
   return Response(e.args[0],status.HTTP_400_BAD_REQUEST)
```

Note*: I don't know any alternative way to make it global throughout the file.
How to properly manage migration files
Tags: discuss
Published: 2019-07-04 11:09:09

---
title: How to properly manage migration files
published: true
tags: discuss
---

So I recently started working with `mySQL`, coming from MongoDB background and I've never really had to manage migrations.

So what is the best way to manage migration files? Do you commit them? etc etc. Do you sync your local migration files with that of the server?