teleren/devto huggingface dataset:
How C Programming is Developing and Helping Out
Tags: java, cprogramm
Published: 2021-09-17 11:38:45

There are many technology write for us programming languages in use today, one of which is C. There are many offshoots of the C programming [moviesda](https://www.techgogoal.com/2021/08/30/moviesda/) language, including Objective-C, C++, and C#. None of these are the same language. So, how did C begin?

The C programming language came out of Bell Labs in the early 1970s. write for us technology  According to the Bell Labs paper The Development of the C Language by Dennis Ritchie, “The C programming language was devised in the early 1970s as a system implementation language for the nascent Unix operating system.

Derived from the typeless language BCPL, it evolved a type structure; created on a tiny machine as a tool to improve a meager programming environment.” Originally, Ken Thompson, a Bell Labs employee, desired to make a programming language for the new Unix platform. Thompson modified the BCPL system language and created the Breathe season 2.

However, not many utilities were ever written in B due to its slow nature and inability to take advantage of PDP-11 features in the operating system. This led to Ritchie improving on B, and thus creating C.
Introducing Graph Permissions Explorer
Tags: graph, microsoft, permission, azuread
Published: 2021-09-17 11:29:24

If you are a developer in the Microsoft 365 ecosystem you will be well versed with the [Microsoft Graph API reference docs](https://docs.microsoft.com/en-us/graph/api/overview?view=graph-rest-1.0) and most probably know about permission scopes (eg. User.Read).

The docs are an awesome resource geared towards developers and lets you navigate by APIs and view the permissions required and includes code samples.

What is missing in the docs however is a view that shows the APIs and resources that are exposed by a permission.

Let's say you are the Azure AD administrator or a security/compliance officer in your organisation and a developer asks for the Files.Read.All permission. 

Until today it's not been very easy to find this out. You would need to search by permission and then click through to each API. 

To solve this created the Graph Permissions Explorer. This site lets you navigate by a permission scope and view all the Graph APIs and resources for a given permission.

For example here is the view for [Files.Read.All](https://graphpermissions.merill.net/permission/Files.Read.All.html).  

Hopefully you find this site useful when working with apps in Azure Active Directory and Microsoft 365. In my next post I will show how I built the solution and set up the automation to update the site everyday as the Microsoft Graph docs are updated.

Give it a try at [https://graphpermissions.merill.net](https://graphpermissions.merill.net).

{% twitter 1435233522109792258 %}
How to do a Select clause comparison of LocalDateTime in JPA
Tags: java, jpa, sql, codever
Published: 2021-09-17 11:24:36

The native SQL query we want to map in JPA is similar to the following:

```
select *
from PARTNER
where EVENT_TIMESTAMP >= timestamp '2021-09-17 10:00:00'
  and EVENT_TIMESTAMP < timestamp '2021-09-17 11:00:00'
```

where the two timestamps should come as query parameters.

With JPA you can use a `TypedQuery` for example and set the `LocalDateTime` values to query parameters via the `setParameter` method:

```java
@Stateless
public class PartnerDataRepository {

    @Inject private EntityManager em;

    public List<PartnerData> findPartnerDataWithinInterval(
      LocalDateTime fromDatetime, LocalDateTime toDatetime) {
        TypedQuery<PartnerData> query =
            em.createNamedQuery(
                PartnerData.FIND_PARTNER_DATA_IN_TIME_INTERVAL, PartnerData.class);

        query.setParameter(PartnerData.FROM_DATETIME, fromDatetime);
        query.setParameter(PartnerData.TO_DATETIME, toDatetime);

        return query.getResultList();
    }
}
```

In the named query itself you can directly pass the parameters before `:` as usual, and the implementation (in my case Hibernate) takes care of the rest :

```java
@Entity
@Access(AccessType.FIELD)
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@Table(name = PartnerData.TABLE_NAME)
@NamedQueries({
 @NamedQuery(
      name = PartnerKerndaten.FIND_PARTNER_DATA_IN_TIME_INTERVAL,
      query = "select m from PartnerData m where eventTimestamp >= :fromDatetime and eventTimestamp < :toDatetime")
})
public class PartnerData {
  public static final String TABLE_NAME = "PARTNER";

  public static final String FROM_DATETIME = "fromDatetime";
  public static final String TO_DATETIME = "toDatetime";

  public static final String FIND_PARTNER_DATA_IN_TIME_INTERVAL =
      "findPartnerDataWithinInterval";

  //... rest ignored for brevity
}
```

<hr>

> Shared :heart: from [Codever](https://www.codever.dev/snippets/614479dcfb0221040e46d62a/details).  :point_right:  use the [**copy to mine**](https://www.codever.dev/snippets/614479dcfb0221040e46d62a/details) functionality to add it to your personal snippets collection.
Function, loops js (Lesson 3 with Hassan) 
Tags: function, javascript, loops
Published: 2021-09-17 11:22:44

###_FUNCTION_
A JS function is a block of code designed to perform a particular task and is executed when "something" invokes it (calls it).
We can submit 0, 1, or more parameters to a function.

#####ex.
    function functionName(parameter1, parameter2, parameter3) {
      // code to be executed
    }

###_FUNCTION & RETURN STATEMENT_
The return value is "returned" back to the "caller".

#####ex.

    function myFunction(a, b) {
      return a + b;
    }
    console.log(myFunction(5, 6))// Function returns 11

###_LOOPS_
Loops are used in JS to perform repeated tasks based on a condition. Conditions typically return _true_ or _false_ when analysed. A loop will continue running until the defined condition returns _false_.

####_FOR LOOP_
    for ([begin]; [condition]; [step]) {
       // statement
    }

#####ex.
    for (let i = 0; i < 10; i++) {
	    console.log(i)
    }

####_WHILE LOOP_
The while loop starts by evaluating the condition. If the condition is _true_, the statement(s) is/are executed. If the condition is _false_, the statement(s) is/are not executed. After that, while loop ends.

    while (condition)
    {
      statement(s);
    }

#####ex.
    let i = 0;
    while (i < 10) 
    {
      console.log(i);
       i++;
    }
Axie Infinity Clone Script | Create your NFT Gaming Platform Like Axie Infinity | Developcoins
Tags: blockchain, news, analytics, gamedev
Published: 2021-09-17 11:12:28

OVERVIEW OF AXIE INFINITY:-
Axie Infinity is a type of battling game and trading, which can be fractionally owned and managed by players and it can be functioning on a blockchain network, It was inspired by the popular game pokemon like that it allows users to collect, breed and trade tokenized battle creatures which were called Axies (Game Character)  Its native cryptocurrency is an ERC-20 token called Axie Infinity Shard (AXS).

https://www.developcoins.com/axie-infinity-clone-script 

AXIE INFINITY CLONE

Axie Infinity Clone is embedded with features and functions of the NFT Gaming Platform like  Axie Infinity. This Axie Infinity Clone can also be built on Binance Smart chain, EOS as well as TRON as per your requirements that helps you to launch your own NFT Gaming Platform like Axie Infinity to trade non-fungible tokens.

Functionalities In Our Axie Infinity Clone Script:-

Staking
Governance
Payment
Native Tokens
Marketplace
Axie Breeding

ADVANTAGES OF OUR AXIE INFINITY CLONE SCRIPT:-

High-Level Security 
Uniqueness
Scarcity
Indivisibility
Transparency
Interoperability
Ownership

WHY CHOOSE DEVELOPCOINS FOR NFT gAMING Development Company?

Developcoins is one of the best NFT Marketplace Development Company helps to Launch Your NFT Gaming Platform like Axie Infinity Clone Script with 100 % decentralized. We helps to create and developed your non-fungible #tokens on the Top of the Blockchain Platform like Ethereum, Tron, EOS, Binance Smart Chain that suit your Business essentials. 

We Also Provides clone like,
Rarible Clone Script
Enjin Clone Scrip
Opensea Clone Script
Xeno Clone Script
Zed Run Clone Script - https://www.developcoins.com/zed-run-clone-script

We provides,

Technical support
Skillful blockchain developers
Multiple token standards
Increased security
Quality assessment
ICO launch

MORE Visit: [https://www.developcoins.com/axie-infinity-clone-script](https://www.developcoins.com/axie-infinity-clone-script) 
Book A Free Consultation via #Call/Whatsapp: +91 9843555651 

Original Source : www.developcoins.com
Enable Dark mode in chrome on Ubuntu
Tags: ubuntu, linux
Published: 2021-09-17 11:09:03

Recently I started using Ubuntu as my default OS for programming and I am loving working in it!

But there was an issue which I faced, By default in Google Chrome dark mode is not enabled and it was kind of a letdown.

After digging up the Internet I found that In order to enable the Dark mode I needed to edit the `google-chrome.desktop` file.

If you are also dealing with a similar issue then, just follow along

Firstly open, the `google-chrome.desktop` file using,
`sudo gedit /usr/share/applications/google-chrome.desktop`

After the file has been opened, you will need to edit two lines

1\. Search for the line-

```bash
Exec=/usr/bin/google-chrome-stable %U
```

replace it with-

```bash
Exec=/usr/bin/google-chrome-stable %U --enable-features=WebUIDarkMode --force-dark-mode
```

2\. Search for the line-

```bash
Exec=/usr/bin/google-chrome-stable
```

replace it with-

```bash
Exec=/usr/bin/google-chrome-stable --enable-features=WebUIDarkMode --force-dark-mode
```

Now, Save the file and restart Chrome. Dark mode should be enabled now

Thanks for reading!
Have a nice day!😇
Get a Dating App built with React Native
Published: 2021-09-17 11:07:43

![React Native Dating app](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/aee4etim4pmqvj3omb71.png)

Reduce your development time tremendously with a fully functional [Dating app](https://www.quickcomponent.com/app-templates) for both IOS and Android build with React Native.
With the React Native Dating app, You get a clean codebase that can be easily modified and maintained. Created with React Native, easily editable and ready to launch.

### Features include:

* **Matching Algorithm for recommendations**

* **Swipe for Like, Super like and Dislike - like Tinder**

* **Filter**
  * Age
  * Distance
  * Location
  * Gender Interest

* **Video and Audio calling**
  * Connection Service integration for Android
  * PushKit & CallKit integration for iOS
  * Foreground, Background and Locked Screen calls
  * Group and 1:1 calls

* **Messaging**
  * Real-time 1:1 Private conversation
  * Real-time Group conversation
  * Share photos, videos, and audio file.
  * Typing indicator
  * Online indicator
  * last seen
  * unread message count
  * clickable URL
  * copy text feature
  * caption photos and videos

* **Push Notification**
  * New match
  * New messages

* **Settings**
  * switch Show me
  * push notifications settings for chat and new match

* **Account**
  * Profile Details
  * Edit Profile Info

* **Customer Authentication and Registration Flow**
Friends App (Simple Blazor PWA)
Tags: blazor, pwa, webassembly
Published: 2021-09-17 11:03:05

A Blazor Web Assembly Progressive Web App To Manage A List Of Your Friends. C# source code can be downloaded from {% github benjaminsqlserver/https://github.com/benjaminsqlserver/MyFriends %}


{% youtube FxfSvbxe5JM %}
Clive Sinclair 1940 - 2021
Tags: watercooler, discuss
Published: 2021-09-17 11:02:10

If you were born in or around the late seventies, then there is a strong chance you used a Spectrum computer. The Spectrum was and still is one of the best first home computers ever released. 

In 1980 Sir Clive Sinclair released the first Spectrum computer via the company Science of Cambridge Ltd, the ZX80 was a computer that the normal family could afford, boasting a less than £100 (US$200) price tag for the ready-made and ready shouldered kit and £79.95 for the do-it-yourself version. The ZX80 was named after the Z80 processor that the computer housed, with the X being the mystery ingredient. Overall, the computer was a huge success and joined what would be known as the personal computer boom of the eighties. 

![Sinclair Computer](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/46vs0uc169ycavu9g9td.jpg)

The Sinclair company released a further 5 home computers with the very popular ZX range making the company 14.8 million in profit by 1984. On 28 May 1985, Sinclair Research had announced it wanted to raise an extra £10m to £15m to restructure the company. Given the loss of confidence in the company, the company failed to find investment. In June 1985, business magnate Robert Maxwell announced a takeover of Sinclair Research, through Hollis Brothers, the deal never happened and was cancelled in August 1985.

The future of Sinclair Research remained rocky until 7 April 1986, when the company sold its entire computer product range, and the "Sinclair" brand name, to Amstrad for £5 million. Sinclair Research became and research and development company with many other 'spin-off' companies forming to work with the new products produced by Sinclair. But none of these products ever made the same impact as the computers released in those early days. 

![Clive and his Sinclair](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6j4iut95eiv5aa2y9ck9.jpg)

Clive Sinclair was a visionary, an engineer, a businessman, and an inventor. He with his little ZX chip and forward-thinking moved home computing and its benefits to everyone. Every home could afford his little box and with his company, he made sure that everyone was part of the technology age. 

Although he was not an Internet User and preferred the telephone to Email there is no denying the impact, he had on the way we use computers today, he was and will forever be one of the grandfathers of the technology age. 

The US and Apple had Steve Jobs and Steve Wozniak, Microsoft and Bill Gates and we in the UK had Sinclair and Clive! RIP sir and have a good rest!

> "Once you start to make machines that are rivalling and surpassing humans with intelligence, it's going to be very difficult for us to survive. It's just an inevitability" - Clive Sinclair
Ideas for a second coding project
Tags: programming, beginners, mentor
Published: 2021-09-17 13:58:02

---
title: Ideas for a second coding project
published: true
date: 2021-09-17 11:00:00 UTC
tags: programming,beginners,mentor
canonical_url: https://craignicol.wordpress.com/2021/09/17/ideas-for-a-second-coding-project/
cover_image: https://craignicol.files.wordpress.com/2017/03/dsc_0482.jpg?w=1200
series: mentor
---

_You’ve done the tutorial, what to build next?_

Maybe one of the following:

- To-do app
- Shopping cart (up to the point of collecting payments)
- Bouncing balls

Don’t worry about building something unique. If you’re building something with lots of examples, you’ll have something to refer to when you get stuck.

Find something you know. Something where you can write down 5 requirements now without research because it’s something you use or an itch you have. And then you can work back from those requirements to the features you need to build. That’s the heart of programming. Not writing for the computer, but translating from human to machine, breaking things down and formalising them into simple rules.

And that’s when you realise programming usually doesn’t involve maths. It’s about thinking logically. What are the mechanics of the feature?

It’s not: _I want list of tasks._ It’s:

- When I open my tasks, then I can add a new one or mark an existing one as complete.
- When I type in a text box and hit Enter, then a new task is added to the list.
- When I click the checkbox next to the task, then the task is removed from the list.

There’s an action and a reaction that the machine understands. There’s choices of actions that the user can make.

Use what you learned in the tutorial to translate those actions into simple functions, and to translate the choices into a user interface, whether web, native, command line or API. Then look at it, and make it easier, faster, more secure, or add more features.

The goal here isn’t to learn a specific language, although it will help you do that, it’s to think about how to take an idea, or a requirement, and translate it into something the computer will understand. I think this is the hardest part of the journey, but it’s the most important. I’d also recommend [trying programming challenges](https://dev.to/craignicol/how-i-approach-coding-challenges-301) such as [Advent of Code](https://adventofcode.com/) or [Project Euler](https://projecteuler.net/) to get practice of writing and thinking.

_Good luck on the next, biggest, step of your programming journey._
How to list Azure VM potentially affected by the OMI RCE
Tags: azure, infosec, security, omi
Published: 2021-09-17 10:36:08

There is Remote Code Execution (RCE) vulnerability in the Open Management Infrastructure (OMI) framework used in several Azure extension you can add to your Linux workload.

Details can be found [here](https://msrc-blog.microsoft.com/2021/09/16/additional-guidance-regarding-omi-vulnerabilities-within-azure-vm-management-extensions/?WT.mc_id=AZ-MVP-5003620).

But how can you list affected VM? Azure Resource Graph is the answer. It is fast, can scan all your subscriptions and be integrated in various scripting language. 
But you will need to query two table virtualmachines and virtualmachines/extensions.

```
Resources
| where type == 'microsoft.compute/virtualmachines'
| extend
	JoinID = toupper(id),
	OSName = tostring(properties.osProfile.computerName),
	OSType = tostring(properties.storageProfile.osDisk.osType)
| where OSType =~ 'Linux'
| join kind=leftouter(
	Resources
	| where type == 'microsoft.compute/virtualmachines/extensions'
	| extend 
		VMId = toupper(substring(id, 0, indexof(id, '/extensions'))),
		ExtensionName = name
) on $left.JoinID == $right.VMId
| where ExtensionName in ('OmsAgentForLinux', 'OMSExtension')
| summarize Extensions = make_list(ExtensionName) by subscriptionId, resourceGroup,name, OSName
```

The extension list is not complete in 
```
where ExtensionName in ('OmsAgentForLinux', 'OMSExtension')
```
You will need to add the complete extension list from the [Microsoft post](https://msrc-blog.microsoft.com/2021/09/16/additional-guidance-regarding-omi-vulnerabilities-within-azure-vm-management-extensions/?WT.mc_id=AZ-MVP-5003620)

Edit: You can also use this script published by Microsoft on [GitHub to find and update VM in your subscriptions](https://github.com/microsoft/OMS-Agent-for-Linux/tree/master/tools/OMIcheck)
You MUST stop doing this now, really!
Tags: rant, watercooler
Published: 2021-09-17 10:19:30

#### What? Using titles like the one above!

It might only be me, but I hate [these types](https://dev.to/search?q=you%20MUST) of titles. 

I think it would be much better if you focused the title on why you should do a thing, rather than just telling me I should. You should not just assume I don't know the thing, give me some value. Just because you, a random person on the internet, say so, I won't be doing it (not even reading the post, you see). 

The content of the post may be good, and maybe you MUST do the thing, but there are better ways of presenting it and probably perform better (_note that this is just my opinion_).

For example instead of: 
**You MUST do this \<thing>!**

You could rephrase it as: 
**If you do \<thing>, you will increase performance by 25%**


Or instead of: 
**If you are a manager you MUST do this!**

You could rephrase it as: 
**As a manager I implemented \<thing> and made our team 2x faster**

See the difference?
* The first ones are just plain clickbait, making me feel like I'm missing out on something and making me feel somewhat attacked by not doing the thing.
* The second ones offer more value (I know why I should do the thing) and invites me to learn a bit more

----

Rant over, quite a quick one. But one that bothers me quite a bit, do you feel the same way?
Page scrolling moves when auto slider is activated.
Tags: javascript, react, typescript
Published: 2021-09-17 10:19:06

The page scroll moves by itself while the auto slider I made by myself works.

I don't know how to solve it.
I've googled, but no progress, so I'm asking here.

```javascript
const delay = 3000;

export default function Banner() {
  const [index, setIndex] = useState(0);
  const timeoutRef = useRef<any>(null);

  const banners = [...];

  const handleIndex = (prop: number) => {
    if (prop <= 0) {
      setIndex(0);

      return;
    }

    if (prop >= banners.length - 1) {
      setIndex(banners.length - 1);

      return;
    }

    setIndex(prop);
  };

  const resetTimeout = () => {
    if (timeoutRef.current) {
      clearTimeout(timeoutRef.current);
    }
  };

  useEffect(() => {
    resetTimeout();

    timeoutRef.current = setTimeout(() => {
      if (index >= banners.length - 1) {
        setIndex(0);

        return;
      }

      setIndex(index + 1);
    }, delay);

    return () => {
      resetTimeout();
    };
  }, [index]);

  return <Template index={index} banners={banners} handleIndex={handleIndex} />;
}
```
Debug Vercel Serverless Functions Locally
Tags: debug, vercel, serverless, functions
Published: 2021-09-17 10:11:23

---
title: Debug Vercel Serverless Functions Locally
published: true
description: A vlog showcasing how I debug Vercel Serverless Functions locally
tags: debug, vercel, serverless, functions
//cover_image: https://direct_url_to_image.jpg
canonical_url: https://www.therdnotes.com/debug-vercel-serverless-functions-locally
---


This note is about how I managed to debug Vercel Serverless Functions locally.

## VLog
If you prefer to watch the video instead of reading article,  
its available at https://youtu.be/giEL-ZLE6C4  
Length: 05:22 mins  


## debug.js 

As the vercel functions are exporting a function which takes `(req, res)`,  
I imported this function in another file and called it by passing fake/empty `(req, res)`.  
For this, created a file `src/debug.js` with following content:  
```js
const api = require("../api/hello");
console.log("Debug started");
api({}, {});
console.log("Debug ended");
```

## Debug config
Then added a file `.vscode/launch.json`, with following content:  
```json
{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "pwa-node",
      "request": "launch",
      "name": "Launch Program",
      "skipFiles": ["<node_internals>/**"],
      "program": "${workspaceFolder}\\src\\debug.js"
    }
  ]
}
```

With the above file, I have now got a debug configuration in VS Code's `Run and Debug (CTRL+SHIFT+D)` side window.  
Now I can click(play button) and start the debugging.  

Do not forget to add the breakpoint(s) in your Vercel Function script file.  


## Fake more
At this point, I was able to debug and fix my code, but the API function didn't run till end as I was using `res.json()` method to return the response, which clearly was missing in our fake `res` object passed initially.  

Debugging output:  

![Debug output](https://raw.githubusercontent.com/raevilman/the-rd-notes/master/notes/vercel/debug-stopped.webp)

So to make it work, I passed fake `json()` method as part of `res` object, which just prints to the console.  

Now the `debug.js` file looks like this  
```js
const api = require("../api/hello");
console.log("Debug started");
api({}, { json: (response) => console.log("RESPONSE", response) });
console.log("Debug ended");
```

Debugging now prints as below:  

![Debug output](https://raw.githubusercontent.com/raevilman/the-rd-notes/master/notes/vercel/debug-output.webp)
---


That's it about this note.  
HIH

~ [@raevilman](https://twitter.com/raevilman) 🐦