teleren/devto huggingface dataset:
PCF primary entity info
Tags: d365, pcf, powerapps, dataverse
Published: 2021-04-21 19:03:43

---
title: PCF primary entity info
published: true
date: 2020-06-10 18:59:36 UTC
tags: D365,PCF,PowerApps,Dataverse
canonical_url: http://www.oliverflint.co.uk/2020/06/10/PCF-primary-entity-info/
categories:
  - Power Apps Component Framework
  - PCF Tips 'n' Tricks
description: At present the PCF Template provided by the Power Apps Cli gives us lots of opportunity and scope to improve functionality, but the type definitions are missing some objects that are present api. Now this could be for many reasons, one being support. Anyway, I'm a rogue so here is one I've already used a lot!
excerpt: At present the PCF Template provided by the Power Apps Cli gives us lots of opportunity and scope to improve functionality, but the type definitions are missing some objects that are present api. Now this could be for many reasons, one being support. Anyway, I'm a rogue so here is one I've already used a lot!
---
## Getting the primary entity info

At present the PCF Template provided by the Power Apps Cli gives us lots of opportunity and scope to improve functionality, but the type definitions are missing some objects that are present api. Now this could be for many reasons, one being support. Anyway, I'm a rogue so here is one I've already used a lot!

![](http://www.oliverflint.co.uk/2020/06/10/PCF-primary-entity-info/pcf-entityinfo.png)

### The entity id (guid)

```typescript
const entityId = (context.mode as any).contextInfo.entityId;
```

This is the equivalent of the following in the Client API

```typescript
const entityId = formContext.data.entity.getId();
```

### The entity type (entity logical name)

```typescript
const entityTypeName = (context.mode as any).contextInfo.entityTypeName;
```

This is the equivalent of the following in the Client API

```typescript
const entityTypeName = formContext.data.entity.getEntityName();
```

### The record name (primary attribute value)

```typescript
const entityTypeName = (context.mode as any).contextInfo.entityRecordName;
```

This is the equivalent of the following in the Client API

```typescript
const entityTypeName = formContext.data.entity.getPrimaryAttributeValue();
```

Hopefully this will be helpful to some of you!

Thanks for reading
Ollie

_Disclaimer!_
_Some of the tips 'n' tricks in the [PCF Tips 'n' Tricks](http://www.oliverflint.co.uk/categories/Power-Apps-Component-Framework/PCF-Tips-n-Tricks/) category are to be used with caution. Although they may work at the time of writing, they may or may not be officially supported by Microsoft_
Using the Bing API in a Java Application
Tags: java, api
Published: 2020-06-10 18:48:06

---
title: Using the Bing API in a Java Application
published: true
description: 
tags: Java, API
//cover_image: https://searchengineland.com/figz/wp-content/seloads/2015/07/bing-maps-word5-ss-1920-800x450.png
---
### Setting Up

My main task today has been to integrate Bing locations API within our platforms JAVA API so that we can do location lookups from the front-end. 

To do this I first went and had a read of the documentation from Microsoft, giving myself a good overview of what the task would take, what I'd need to pass as parameters, and then what the response would be.

[Locations API - Bing Maps](https://docs.microsoft.com/en-us/bingmaps/rest-services/locations/)

These are the 2 calls from the above link that I needed, the first being *Find a Location by Query*, and the second was *Find a Location by Point.* By using these 2 calls, they would allow me to search for an address using either a search term, like "London" or latitude and longitude values. I went ahead and took a look through these 2 calls to make sure I understood what they did and what was returned, I then copied the URL into my code so that I had it ready.

I then needed to make sure that I have an API key to actually authorize the API. This link showed me how to get that: 

[Getting a Bing Maps Key - Bing Maps](https://docs.microsoft.com/en-us/bingmaps/getting-started/bing-maps-dev-center-help/getting-a-bing-maps-key)

### Calling API using RestTemplate

Then came the part of using the java restTemplate to call the API, this is quite simple and just requires some parameters, here's my code: 

```java
String locationUrl = "http://dev.virtualearth.net/REST/v1/Locations/" + point + "?key=" + key;

ResponseEntity<String> result = restTemplate.getForEntity(locationUrl, String.class);

return result.getBody();
```

This then returns the response that is specified on the URL, from there I created an object which had all of the JSON properties so that I could use GSON, and convert the JSON to an object. With that object, I then just picked out the properties I needed and put them in my response object which gets sent to the front-end.
Let Us React
Published: 2020-06-10 17:50:46

As a beginner we often struggle a bit to find out how to start learning a new programming language or a framework.I have faced the same problem hence,i thought of linking the resources here I have used or preferred personally.We all know React is in so much of demand and so there are many tutorials on internet.According to me,you can go through following tutorials:

1.Youtube-
https://www.youtube.com/watch?(v=DLX62G4lc44&list=LLCoVYBp2TCDy5dMvlI48zbw&index=2&t=0s(My Personal fav👈)

2.UDEMY-https://www.udemy.com/course/complete-react-developer-zero-to-mastery/learn/lecture/15146708?start=90#overview(Andrei is Good)

3.W3Schools-https://www.w3schools.com/react/default.asp(We all know this one)

You can go through other tutorials if you find it better.Do share with us 😊

Now the next question comes,where should I practice.
1.You can use Visual Studio and follow the steps given at:https://create-react-app.dev/docs/getting-started/

2.https://scrimba.com/-Here you can code and run your project online and download the zip file on your computer.

Feel free to give suggestions.

Happy Reacting 😉
You can follow me on Github , Twitter
What is git? Why should i use git ?  (List of Basic git commands)
Tags: codenewbie, git, beginners
Published: 2020-06-10 17:22:56

Git is a version control system. For example, if you have a file on which you’ve been working on and reworking for a long time, all the versions of it are saved in Git, and you can easily get back to every version.

####What is it for?

The version control system has the following benefits:

• You have access to all versions of all files in Git repository at any time, it’s almost impossible to lose any part of a code.

• Multiple developers can work on one project at the same time without interfering with each other, and without fear of losing any changes made by a colleague. In Git, the possibilities of collaborative work are unlimited.

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

###Here is a list of some basic Git commands to get you going with Git.

| Git Task      | Notes         | Git Commands  |
| ------------- |:-------------:| -----:        |
| Create a global repository     |  | git init       | 
| To add files     | Add one or more files to staging (index):     |   git add *        |
| Commit | Commit changes to head (but not yet to the remote repository):      |    git commit -m "Commit message"        |
| Push | Send changes to the master branch of your remote repository:      |   git push origin master         |
| Status |List the files you've changed and those you still need to add or commit:      |    git status        |
| Check out a repository | Create a working copy of a local repository:     |   git clone /path/to/repository        |
| Tell git who you are | Configure the author name and email address to be used with your commits.    |  git config --global user.name "Sam Smith" git config --global user.email sam@example.com       |



###Summary
As a developer it is important to know git commands and one should have a github profile.Be sure to sign up on GitHub or Bitbucket. These services offer great manuals on how to start working with remote repositories.GitHub is way ahead of bitbucket, and has turned into the standard and Mecca of the whole open source community.Hope this above post helped you. 

Hope you enjoyed the above post
#006 Install Docker
Tags: docker, devops, tutorial
Published: 2020-06-10 17:22:46

#  Introduction

this is part 6 from the journey it's a long journey(360 day) so go  please check previous parts , and if you need to walk in the journey   with  me  please make sure to follow because I may post more than once   in 1  Day  but surely I will post daily at least one 😍.

And I will cover lot of tools as we move on.
***
# Install on Debian

## Why Debian? 

I use mx-linux 19.2 it's an debian based distro , I will post reference for Windows / macOs / Ubuntu (Ubuntu is Debian based also please some one test same steps in Ubuntu and comment if also work on it)
***
## Installation

* if you are already root user no need to use sudo

1. we need to uninstall any old version

```bash
sudo apt-get remove docker docker-engine docker.io containerd runc
```

2. we need to update the system

```bash
sudo apt-get update
```

3. we need to install the tools (some of them are already built-in with Debian so the installer will skip them

```bash
sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
```
4. Add Docker official GPG key

```bash 
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
```

5. to setup realese build 

```bash
sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/debian \
   $(lsb_release -cs) \
   stable"
```
6. update system

```bash
sudo apt-get update
```
7. install docker community edition , docker-cli , deamon

```bash
sudo apt-get install docker-ce docker-ce-cli containerd.io
```
***
# Add docker to sudo

basically this used to make docker run without type sudo docker every time we need to run it.

1. create the docker group
```bash
sudo groupadd docker
```
2. Add your user to the docker group.
```bash
sudo usermod -aG docker $USER
```

3. to activate those changes
```bash
newgrp docker
```
4. Verify that you can run docker commands without sudo
```bash
docker run hello-world
```
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/p4hnbrr9op0rrs2fq98y.png)
if you get this result congrats!
***

# Important for windows


if you use a custom build for windows for gaming or whatever (like me , i use teamOs gaming edition) the version I use delete a lot of packages from windows so docker doesn't work . So a official build is better in general and I recommend you to use [latest powershell](https://github.com/PowerShell/PowerShell) in windows , in the installation wizard there is an option to add it to the menu , so when u are in folder you press right mouse click it give you an option to run powershell here . 

![proof](https://dev-to-uploads.s3.amazonaws.com/i/hy7h709qrzzpq8kwzcge.png)

# Other OS installation

go [to this](https://docs.docker.com/engine/install/) official docker docs it's well explain to all operation systems
Journey to Machine Learning (Day 005)
Tags: machinelearning, database, datascience, python
Published: 2020-06-10 16:38:03

Helloo Devs! It's another day and once again I'm here. I'm thinking I'll not be adding references to previous posts anymore as it's quite troublesome :p If someone is interested to read previous posts kindly check my profile. 

Today I finished pandas section, after that there was control section ( if - else - loops ), It took me like 15 mins to complete all the exercises (Duh! I'm an android developer remember? :p ) Idk why they added this in the advanced python course though! I'm gonna be done with this course by tomorrow. There's a project at the end of the course. I'm excited about it *_*

I was able to debug the problem [Merge K sorted list](https://leetcode.com/problems/merge-k-sorted-lists/). The problem was that I forgot to define a way to compare elements in the heap. I'm thinking of writing more details about these problems, probably in another thread. 

As for Django, I watched more tutorials than I should've last night. Mainly because it's very easy to understand and fun to do. I learned about urls, views and templates. Created a static page with template extension. 

I'm looking a bit into statistics as it is required for one of the exercises of ML. I'm thinking of watching this [Gaussian Distribution](https://www.youtube.com/watch?v=iYiOVISWXS4) tutorial. Maybe I'll watch it after posting this :p 

That's it for today folks! Hope to write another one tomorrow! Thanks for reading <3
Top Reasons To Choose PHP Developer As Your Career
Tags: careerinphpdeveloper, phpdevelopercareergrowth
Published: 2020-06-10 16:32:19

PHP is an open-source scripting language that mainly used for web development and business application. It is a server-side language with a combination of HTML to create websites and web applications. In order to expand & create a customer base, the organization might be big or small needs to be online.
 
The website page needs to be attractive to be more traffic. Developing web portals using PHP is one of the most effective ways and the preferred choice of business Online web portals like Facebook, Wikipedia, etc. Various e-commerce websites use PHP as a server-side language. This shows how much a PHP developer is demanded in the web development option and every conventional role and the PHP developer career growth are highly redefining to the on-trend markets

•	PHP as a web development tool
•	Easy to Learn
•	Open Source
•	Framework Availability
•	Compiler-Based Applications
•	Compatible with a host of OS
•	Dynamic and Flexible
•	Resources & CMS Development
•	Job Opportunities 
•	Salary Packages for PHP Developer

Future Scope of PHP Developer	

PHP is the most used web programming language all over the world for web development.  PHP is utilized more than 85% for the webserver. Most of the MNC company is hiring PHP Developers and the future scope of PHP developer rapidly increases. The career path in PHP developers is huge job opportunities and a bright future.

To visit: https://blog.courseinn.com/php-developer-career/
Vue Down Under
Tags: vue, webdev, javascript, australia
Published: 2020-06-13 10:09:13

---
title: Vue Down Under
published: true
date: 2020-06-10 16:32:04 UTC
tags: Vuejs,WebDevelopment,JavaScript,Australia
canonical_url: http://wildermuth.com/2020/06/10/Vue-Down-Under
---

![Adeliade .NET Users Group](https://wilderminds.blob.core.windows.net/img/adeliadednug.jpg) Yet another of my talks that resulted from being bored at home and on Twitter. I had a great time talking to this great group.

Even though it was a .NET group, they were open to me digging into why I think Vue is a great choice for the right project. They had great questions too!

As promised here are links from the talk:

> [Slides](https://www.slideshare.net/shawnwildermuth/vue-getting-started-from-adelaide-net-users-group)

> [Code](https://github.com/shawnwildermuth/PresentationDemos/tree/master/AdeliadeDNUG/2020)

Here's the video:

<iframe src="https://www.youtube.com/embed/Ffww90s6hrw" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe>

[![Creative Commons License](http://i.creativecommons.org/l/by-nc-nd/3.0/88x31.png)](http://creativecommons.org/licenses/by-nc-nd/3.0/)

          This work by [Shawn Wildermuth](http://wildermuth.com) is licensed under a [Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License](http://creativecommons.org/licenses/by-nc-nd/3.0/).  
          Based on a work at [wildermuth.com](http://wildermuth.com).

* * *

If you liked this article, see Shawn's courses on [Pluralsight](http://shawnw.me/pscourses).
 ![](http://feeds.feedburner.com/~r/ShawnWildermuth/~4/ih4HAIyo8XY)
SimplQ, a Modern Web Based Queue Manager
Tags: webdev, react, java, productivity
Published: 2020-06-10 16:31:54

I've recently been inspired by services like [jit.si](http://meet.jit.si/), [scribble.io](https://skribbl.io/) where you go, generate an instant link and share it with others. As an experiment on how this model can be applied for crowd management, me and a few friends have developed [SimplQ.me](https://simplq.me), a website where anyone can go create a queue and use it to keep people in a... queue. :p

Some screenshots...

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

The web app is really simple, the first screen shows how someone can create a queue and the second screen is the queue admin page, where you can manage people who have joined. The third screen is what a person who is waiting in the queue will see.

Once people start queuing up, you can notify users by clicking on the bell icon. People can give phone numbers while joining the queue, so you can click on the person to call them.  We are working on integrating with an SMS service, so that the users can also be notified via SMS. Also a design overhaul is being planned.

The frontend is built with React, backend in Java and all the code is open source and is available [here](https://github.com/SimplQ) on gitHub. Feel free to fork and improve if you have any cool ideas in mind :)

https://simplq.me
What is the worst question you have ever been asked in a job interview?
Tags: discuss, career, beginners
Published: 2020-06-10 16:26:01

Oh interviews! 
Some people are afraid of them, but I am always looking forward. It's the skill that you need to develop constantly. No matter how good you are at what you do, you need to be able to present it to new people during the short conversation. 
And I think, everyone agrees that interviews are the tests of not only technical skills, but adaptability to the new team. 

What is the worst question you have ever been asked in a job interview?

My experience: 

1) If I had 7+ years of experience on the software that exists only for 3 years.

and there were many more.......much more......
Prevent routing if unsaved changes exist [VueJS]
Tags: vue, javascript, webdev, beginners
Published: 2020-06-10 16:24:51

---
published: true
title: "Prevent routing if unsaved changes exist [VueJS]"
description: "Apply a very small hack to prevent the user from accidentally switching to another page without saving changes [VueJS]"
tags: vue, javascript, webdev, beginners
series:
canonical_url:
---

Let's say you have a input field and routes configured:

![](https://raw.githubusercontent.com/YOUR-USERNAME/YOUR-REPO/master/blog-posts/vuejs-avoid-routes/assets/form.jpg)

How can you avoid that the user navigates to a route if the inputfield contains unsaved text? I made a few tries to find a solution for that but did not found anything. So here is what I have done to solve this problem.

Find the full runnable example here: [Click me!](https://github.com/gabbersepp/dev.to-posts/tree/master/blog-posts/vuejs-avoid-routes/code/example)

# Solution
First, define a new global function:

```ts
let isRouteChangeBlocked: boolean = false;

export function blockRouteChange(set?: boolean): boolean {
    if (arguments.length == 1) {
        isRouteChangeBlocked = !!set;
        return isRouteChangeBlocked;
    }

    return isRouteChangeBlocked;
}

```

Then use it to set the flag after the user make some input:

```ts
  @Watch("input")
  private inputChange(to: string) {
    if (to && to.length > 0) {
      blockRouteChange(true);
    } else {
      blockRouteChange(false);
    }
  }
```

After a successful saving, reset the flag:

```ts
  private save() {
    blockRouteChange(false);
    alert("saved");
  }
```

Now replace the router's `push` function:

```ts
const originalPush = VueRouter.prototype.push;
VueRouter.prototype.push = function(location: RawLocation) {
    if (blockRouteChange()) {
        if (confirm("There are unsaved changes, do you want to continue?")) {
            blockRouteChange(false);
            return originalPush.call(this, location) as any;
        }
        return;
    }
    return originalPush.call(this, location) as any;
};
```

# Result
Here is what I got:

![](https://raw.githubusercontent.com/YOUR-USERNAME/YOUR-REPO/master/blog-posts/vuejs-avoid-routes/assets/vuejs-route1.gif)

# Conclusion
This workaround works really well but I'm wondering whether there isn't a better possibility? Do you know how this can be achieved using a native solution? Maybe I just was not clever enough to type in the correct search terms into google :sweat_smile: Just let me know.

----

# Found a typo?
As I am not a native English speaker, it is very likely that you will find an error. In this case, feel free to create a pull request here: https://github.com/gabbersepp/dev.to-posts . Also please open a PR for all other kind of errors.

Do not worry about merge conflicts. I will resolve them on my own.
Build Personalized Discord Bots with WayScript
Tags: discord, wayscript, automation, python
Published: 2020-06-10 16:05:31

Introduction
------------

Creating bots can be tedious depending on the software you use. Discord bots are no exception to this. While other platforms have unnecessary limitations, WayScript provides a solution that is robust enough to cover every use case. If we don't have it, then we give you the tools to create it for yourself using a programming language. Let's see how we can create custom discord bots using WayScript!

Prerequisites
-------------

No prerequisites but some content you might find helpful:

*   [Working with Discord](https://docs.wayscript.com/library/modules/discord)
*   [Working with python](https://docs.wayscript.com/library/modules/python)

Monitoring Discord Messages
---------------------------

In this example, we want an action to occur whenever an event happens in discord. We can accomplish this using the discord trigger provided by Wayscript. We can pull this into the trigger slot of our workflow.  
  

![](https://cdn.wayscript.com/blog_img/83/2.png)

  
  
The first time you use discord, you will be accessed to authorize it and choose the channel you want to connect your bot to.  
  

![](https://cdn.wayscript.com/blog_img/83/3.png)

  
  
You are also able to choose the authorizations you want to provide to Wayscript. Next, we need to configure our discord trigger's settings. We have multiple options here such as mode and the channel we want to monitor.  
  

![](https://cdn.wayscript.com/blog_img/83/4.png)

  
  

Creating Bot Responses
----------------------

There are several different ways we can create these responses in WayScript. Since we provide fully customizable tools in the programming language modules, you're able to build advanced bots very easily with your programming language of choice. In this example, let's pass the entire message text to a python module, preform some regular expression matching, and return a response.  
  

![](https://cdn.wayscript.com/blog_img/83/5.png)

  
  
We're matching these keyword searches against a python dictionary of keywords and actions created with the create variable step. The python code would look something like this:
<pre>
keywords = variables['keywords'] 
import re 
command = re.compile(r'\\!\[a-z\]\*') 
matches = command.findall(󰀂v.1.message-Discord\_Message.message󰀂)
'''The above line references a wayscript variable with the boxes'''
print(matches) 

action = keywords.get("matches") 
variables['action'] = action  
</pre>

Sending back a Discord Response
-------------------------------

Once we match keywords to our dictionary of keys and actions, we can write back a discord response as the bot.  
  

![](https://cdn.wayscript.com/blog_img/83/6.png)


#### Questions, Concerns?

If you have any questions feel free to message us on discord. We're happy to help! If you want to see this full script template, you can find it [here](https://wayscript.com/user/derricks/rLntoEqY)

{% youtube sWpAfML5h0I %}