teleren/devto huggingface dataset:
Accessing User GDPR Settings in AIR
Tags: airsdk, gdpr, ane, advertising
Published: 2022-06-15 01:27:13

---
title: Accessing User GDPR Settings in AIR
published: true
description: Accessing GDPR Transparency and Consent settings from the AIR SDK
tags: airsdk, gdpr, ane, advertising
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y2pt0bvgvwufozpxkxmg.png
---

At some point in your application development when you start to store and share data you will need to handle user GDPR settings. 

> The General Data Protection Regulation (GDPR) is a European Union (EU) regulation that mandates how an organisation should handle personal data. 

If you use personalised advertising or store user related data on your server then you will need to address GDPR concerns in your application.

On mobile devices the GDPR settings are stored through the **IAB Europe Transparency & Consent Framework**. This framework ensures settings are stored in consistent places for developers to access and determine their appropriate behaviour for the user.

These values are stored in [NSUserDefaults](https://developer.apple.com/documentation/foundation/nsuserdefaults#1664798?language=objc) on iOS and in [SharedPreferences](https://developer.android.com/training/data-storage/shared-preferences.html) on Android.

With the AIR SDK we can access these values easily through the [Application extension](https://airnativeextensions.com/extension/com.distriqt.Application). The Application extension allows access to the NSUserDefaults and the SharedPreferences through the [`defaults`](https://docs.airnativeextensions.com/docs/application/defaults) functionality.

Firstly, we set the `useSharedDefaults` flag to ensure we use the application's shared values. 

```as3
Application.service.defaults.useSharedDefaults = true;
```

> If we don't set this flag, then the values retrieved through the `defaults` functionality will be isolated from values set via other methods and you won't retrieve the correct TC data values. 

Once you have set this flag you can retrieve any of the TC data from the framework by using the appropriate key. 

For example:

```as3
var value:String = 
    Application.service.defaults.
        getString( "IABTCF_TCString" );
```

You can then use this value as required for your implementation of GDPR in your application.


For a full list of the available keys and a description of the values and types see the [documentation here](https://github.com/InteractiveAdvertisingBureau/GDPR-Transparency-and-Consent-Framework/blob/master/TCFv2/IAB%20Tech%20Lab%20-%20CMP%20API%20v2.md#what-is-the-cmp-in-app-internal-structure-for-the-defined-api).
Start journey of AI.
Tags: ai, machinelearning, beginners, career
Published: 2022-06-15 01:26:31

Hello, Everyone.
Thanks for all advice of AI Gurus to my previous post.
I researched so many materials and decide to follow Andrew Ng's tutorials on Coursera as my start journey of AI. I hope always be with AI Gurus on my journey and welcome to any advice from you.

I am going to post with what I learned from tutorials and share my projects on Github continuously. If anyone interested in my journey and hope to be with me, please follow me on Dev.to and Github.

https://dev.to/levintech
https://github.com/levintech

Best Regards
Is it easy to install software with Chocolatey on Windows?
Tags: discuss
Published: 2022-06-15 01:22:02

When I moved from Mac to Windows, I found it very convenient to install software with Chocolatey, just like Homebrew on Mac. For example, I can use the `choco install jdk8` command to install jdk8.

https://github.com/chocolatey-archive/chocolatey
Day 573 : For Keeps
Tags: hiphop, code, coding, lifelongdev
Published: 2022-06-14 23:13:26

_liner notes_:
- Professional : Started the day working on some Pull Requests and documentation. Then in the afternoon I drove out to my office space and worked on some videos. I wrote up a script and made some updates I found to the documentation to help make things clearer. Going to try and get everything recorded tomorrow.

- Personal : Last night, I started coding up my new side project. There's a cool effect I saw on the Svelte examples page that I did awhile ago on my personal site https://lifelong.dev and like how they achieved something similar in an easier way. I almost got it working.

![A close up of some blades of tall grass in a field in Great Bookham, United Kingdom](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/28gzjckhxf7423kkd34v.jpg)

Going to keep working on my new site. I'm building in an online editor while I'm playing around with the code and trying things. Once I have it all worked out and things are for keeps, I'll transfer it to my local machine to put the finishing touches on it. I'm still at the office. Going to get some food and head back to my folks place.

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube oZxxx9pOnFI %}
Be Good to me June!
Published: 2022-06-15 01:20:40

Hi readers! Hope you all doing great :-) ... This would be my last month as an intern, and I'm gonna miss writing stuff here. So will not gonna take this long and lemme proceed to my week .

```
Week 10 (June 8 - June 13, 2022) (Day 51 - 55)
```
Hello readers! welcome back to my blog, hope you're having a good week. So for this week, I don't have a lot of work aside from the website because there is a news that the CPM will check it so I need to be hurry on it. So far, I'm almost done on the website.
That's all for this week thank you for reading :-)  


Pictures be uploaded soon (technical error)
Connect To fly.io Sqlite Production Database
Tags: flyio, webdev, sqlite, flydotio
Published: 2022-06-15 01:18:58

Gonna give a quick how to for connecting to and getting your sqlite database
from your production app on fly.io. It can be a bit confusing but once you get
your ssh connection set up and openssh installed on your fly.io server, it's
much easier to replicate. In this tutorial we will be connecting to your fly.io
instance via wireguard and ssh, then insalling openssh on your instance so we
can use `scp` from your local computer to copy the sqlite db file for viewing
locally.

Start by downloading Wireguard [here](https://www.wireguard.com/install/).
You'll also need flyctl which I'm assuming you already have, but if you don't it
can be downloaded [here](https://fly.io/docs/flyctl/installing/).

You'll need to connect wireguard to fly.io by creating a wireguard config file
with the fly CLI. Use `flyctl wireguard create` to create a file called
`wireguard.conf`. Then open wireguard and import that file and activate that ssh
tunnel.

Next you're going to connect to your fly instance via ssh. Type
`fly ssh issue --agent` then `fly ssh console` to ssh into your instance.

Once you're in you'll need to install openssh on the instance to be able to
securely copy files from your instance to your local computer. Do this with the
command: `apt-get install openssh-client`.

At this stage you'll want to create a backup of your database to copy to your
local machine so nothing goes wrong trying to copy the file while a transaction
is happening. You can do this in one of 2 ways:

`sqlite3 data/sqlite.db '.backup data/backup.db'`

OR

`sqlite3 data/sqlite.db "VACUUM INTO 'data/backup.db'"`

You may have to change the path to your database, mine was in the data
directory.

Exit ssh with `exit`;

Now you can copy your sqlite db file to your local computer with
`scp root@[app-name].internal:/data/backup.db fly_backup.db`.

Don't forget to fill in the name of your app on fly.io and change the path to
wherever you backed up your sqlite db on your server. Mine is at
`/data/backup.db`.
Hosco
Published: 2022-06-15 01:18:37

[Hosco](https://hosco.com.vn/)
Chúng tôi mang đến cho khách hàng phần mềm quản bán hàng cho doanh nghiệp vừa và lớn, chuỗi cửa hàng) – phần mềm bán hàng HOSCO Vs2021
Chúng tôi mang đến cho khách hàng phần mềm quản bán hàng cho doanh nghiệp vừa và lớn, chuỗi cửa hàng
The Adventures of Blink #4: I Win When You Win
Tags: empowerment, devrel
Published: 2022-06-15 01:13:42

Over the past few weeks, we've been working on setting up a virtual conference at Twilio Segment (shameless plug, come to [CDP Week](https://cdpweek.com) and check it out, it's free!). And for someone who's only done it a couple of times in my past life, let me tell you... it's a lot to remember!

You're having to find folks to speak.  Then you have to ensure that you can marry their idea to the theme of the event.  Then you're having to send out reminders to get their drafts in by Thursday. Then you're having to find out about what platform is going to be used for the event, and take a brief overview session to make sure you know where the knobs & levers are.  THEN you're having the dry-run with the speakers, and don't forget your RoS (Run of Show) session!  Do you know who's going to do introductions?  Who's going to announce what?  Who's got the Q&A curation?  Uh oh, you might need another practice session with 1 or 2 of the speakers because they're not used to giving conference talks and they need more time to polish their work!  Oh there's a status call with the event planning team, and they mentioned some kind of artwork needed for social media - make sure you get the details over to Creative!  

As you can probably feel from that paragraph, there are lots of moving parts and it's easy to get lost in the details... to forget the "Why" in favor of answering the "How".  I suppose there's a degree of this that's expected, especially for a less-experienced planner of events... but when it happens, it can really throw off your vibe.

## Then you have THAT MOMENT.

You know the one I mean if you've experienced it.  When you stop for a second, and breathe, and look around at all the moving parts coming together to make something that you're proud to be a part of.  When you hear one of your speakers walk through their outline, and you can tell that this person is outside their comfort zone, but they're pouring themselves into it and doing **great** and their topic is _absolute blazing fire_ and you suddenly go "OH. MY. GOSH.  THIS is why I do what I do."

## Epilogue 

I tried a couple of ways to spin this into some sort of deep philosophical post about the core of DevRel and what it means to be a human who empathizes with those around you, but in the end I've decided to just cut it off there for tonight.  I'm celebrating that I was a small part of someone else's win today and it made my day, and I'm just delighted to share it with you.
O que aprendi ao criar um monolito seguindo boas praticas de DDD e Clean Architecture
Tags: typescript
Published: 2022-06-15 01:13:24

Depois de fazer um [estudo](https://dev.to/yanpiing/boas-praticas-para-sistemas-monoliticos-38fc) mais aprofundado sobre monolitos foi a hora de eu implementar um usando as praticas que estudei, principalmente utilizando os conceitos de deixar os módulos bem separados para facilitar uma possível futura conversão para microsserviços.

## O sistema
O sistema implementado com o intuito de estudos era uma espécie de e-commerce e seus eram produtos(na visão do admin), produtos(na visão do catalogo), pagamentos e clientes(na visão do admin) foi feito utilizando TDD ou seja, durante todo o desenvolvimento criei um teste para a feature que queria implementar e só depois implementei o método ou a classe.

Nesse caso de estudos o monolito foi feito com apenas um banco de dados para todos os módulos ao invés de um banco de dados por módulos

## O que estranhei

Pra mim foi(e ainda é) muito estranho o fato de eu ter duas entidades de produto no mesmo sistema, não me entenda mal, eu entendo perfeitamente o porque dele estar ali "não é o mesmo produto" e cada modulo vê esse produto com o que é necessário para ele no contexto dele. Porem quando de fato chegou a hora de fazer isso: 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/amy85o2ht7rejk0dracp.png)

Tive que me segurar muito para não simplesmente adicionar um novo campo a entidade que comecei e seguir com a vida, e falando em curto prazo essa solução até funcionaria, porem ao longo prazo que é como penso nesse sistema, algo feito para durar, o ideal é realmente fazer dessa forma pois cada entidade dessas de produtos tem as suas próprias razões para mudar e não podemos deixar que um interfira no outro.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7azun3wi2zetnophks9u.png)

Principalmente quando foi o caso de fazer isso para os DTOs onde são idênticos, porem no futuro podem ter razões para mudar diferentes

## O que gostei
Acabei gostando bastante das facades, ainda não tive a experiencia de quebrar um monolito em microsseviços mas com elas da para ver claramente o quão desacoplado dá para deixar o sistema monolítico e já dá para imaginar que deve ser muito mais fácil separar um sistema assim do que separar um sistema que já está altamente acoplado

Aqui está o [link](https://github.com/Yansb/full-cycle-course/tree/master/monolith) para o repositório com o sistema que estou desenvolvendo
Occurrences After Bigram
Tags: leetcode, dsa, theabbie
Published: 2022-06-15 01:00:47

Given two strings `first` and `second`, consider occurrences in some text of the form `"first second third"`, where `second` comes immediately after `first`, and `third` comes immediately after `second`.

Return _an array of all the words_ `third` _for each occurrence of_ `"first second third"`.

**Example 1:**

**Input:** text = "alice is a good girl she is a good student", first = "a", second = "good"
**Output:** \["girl","student"\]

**Example 2:**

**Input:** text = "we will we will rock you", first = "we", second = "will"
**Output:** \["we","rock"\]

**Constraints:**

*   `1 <= text.length <= 1000`
*   `text` consists of lowercase English letters and spaces.
*   All the words in `text` a separated by **a single space**.
*   `1 <= first.length, second.length <= 10`
*   `first` and `second` consist of lowercase English letters.

**SOLUTION:**

    class Solution:
        def findOcurrences(self, text: str, first: str, second: str) -> List[str]:
            words = text.split()
            n = len(words)
            return [words[i] for i in range(n) if i > 1 and words[i - 1] == second and words[i - 2] == first]
Key Casting for Mac that Works in Full Screen
Published: 2022-06-15 00:52:36

So I installed and used Keycastr for a little bit.

But it won't work in full screen.

There aren't seem to be many of these key casting softwares available. 

Can someone please tell me one that works?

Cuz I stream myself coding, I figure it'd be helpful for them to see how I use Vim and Vscode shortcuts. 

Many Thanks
Vinny the Poon
Encryption raised an exception
Tags: jdk, jre, encryption, java
Published: 2022-06-15 00:43:53

script-test:
[echo] Testing encrypt.sh
[exec] Exception in thread “main” org.jasypt.exceptions.EncryptionOperationNotPossibleException: Encryption raised an exception. A possible cause is you are using strong encryption algorithms and you have not installed the Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files in this Java Virtual Machine
[exec] at org.jasypt.encryption.pbe.StandardPBEByteEncryptor.handleInvalidKeyException(StandardPBEByteEncryptor.java:1073)
[exec] at org.jasypt.encryption.pbe.StandardPBEByteEncryptor.encrypt(StandardPBEByteEncryptor.java:924)
[exec] at org.jasypt.encryption.pbe.StandardPBEStringEncryptor.encrypt(StandardPBEStringEncryptor.java:642)
[exec] at azkaban.crypto.CryptoV1_1.encrypt(CryptoV1_1.java:42)
[exec] at azkaban.crypto.Crypto.encrypt(Crypto.java:49)
[exec] at azkaban.crypto.EncryptionCLI.main(EncryptionCLI.java:58)

It was found that the error was because jdk did not have jce, so it was installed.

How to Install JCE

Go to the Oracle Java SE download page http://www.oracle.com/technetwork/java/javase/downloads/index.html
Scroll down … Under “Additional Resources” section you will find “Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy File”
Download the version that matches your installed JVM E.g. UnlimitedJCEPolicyJDK7.zip
Unzip the downloaded zip
Copy local_policy.jar and US_export_policy.jar to the $JAVA_HOME/jre/lib/security (Note: these jars will be already there so you have to overwrite them)
Then restart your application to get rid of this exception.

http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html
HTTP Requests for Beginners.
Tags: api, programming, tutorial
Published: 2022-06-15 00:43:04

## Introduction
If you are like me, HTTP requests can be confusing at first. But hopefully with this guide, things might be a little easier for you when learning requests and how to use them.

A helpful tool for learning and practicing HTTP requests in my experience would be [Requestbin.](https://requestbin.com)

Now, let's get started with the methods.

## GET
GET is used when reading or retrieving resources. When the GET request is sucessful, it will return a response with the resource you requested.

## POST
POST sends data to the server, usually to create a resource or update an existing resource.

## PUT
PUT also creates a resource or updates an existing resource similar to POST, but PUT requests can be called multiple times and will remain the same. This means that PUT requests are idempotent.

## DELETE
DELETE will remove the requested resource.

## Other HTTP request methods

Here are more resources you can use to learn HTTP methods, including the ones that I did not cover in this post.

You can read about these methods here.

[MDN - Request Methods](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods)

[Rapid API - HTTP Request Methods](https://rapidapi.com/blog/api-glossary/http-request-methods/)

And more sources all across the web can help!
How to minify CSS files via CopyWebpackPlugin for Webpack5
Tags: webpack, webdev
Published: 2022-06-15 00:38:48

## Goal

Emit minified vendor-based CSS files on build.

## Dependencies

```
"copy-webpack-plugin": "11.0.0",
"cssnano": "5.1.11",
"webpack": "5.70.0",
"webpack-cli": "4.9.2"
```

## Elaborate

I have a few unminified vendor CSS files that I simply want to minify and copy to an output directory. These files were not being transformed by terser probably due to the chain of command (steps in which the build is processed). 

All CSS files matching this regex `/src/vendors/**/*.css` are **transform**ed using `postcss` and `cssnano` in conjunction with the `CopyWebpackPlugin`.

## Code

webpage.config.js:

```js
...
plugins: [
  new CopyWebpackPlugin({
    patterns: [
      {
        from: 'src/vendors/**/*.css',
        to: './css/[name].[contenthash].min[ext]',
        transform: (content, path) => {
          return postcss([cssnano])
            .process(content, {
              from: path,
            })
            .then((result) => {
              return result.css;
            });
        },
      },
    ],
  }),
],
...
```
Employee Importance
Tags: leetcode, dsa, theabbie
Published: 2022-06-15 00:30:36

You have a data structure of employee information, including the employee's unique ID, importance value, and direct subordinates' IDs.

You are given an array of employees `employees` where:

*   `employees[i].id` is the ID of the `ith` employee.
*   `employees[i].importance` is the importance value of the `ith` employee.
*   `employees[i].subordinates` is a list of the IDs of the direct subordinates of the `ith` employee.

Given an integer `id` that represents an employee's ID, return _the **total** importance value of this employee and all their direct and indirect subordinates_.

**Example 1:**

![](https://assets.leetcode.com/uploads/2021/05/31/emp1-tree.jpg)

**Input:** employees = \[\[1,5,\[2,3\]\],\[2,3,\[\]\],\[3,3,\[\]\]\], id = 1
**Output:** 11
**Explanation:** Employee 1 has an importance value of 5 and has two direct subordinates: employee 2 and employee 3.
They both have an importance value of 3.
Thus, the total importance value of employee 1 is 5 + 3 + 3 = 11.

**Example 2:**

![](https://assets.leetcode.com/uploads/2021/05/31/emp2-tree.jpg)

**Input:** employees = \[\[1,2,\[5\]\],\[5,-3,\[\]\]\], id = 5
**Output:** -3
**Explanation:** Employee 5 has an importance value of -3 and has no direct subordinates.
Thus, the total importance value of employee 5 is -3.

**Constraints:**

*   `1 <= employees.length <= 2000`
*   `1 <= employees[i].id <= 2000`
*   All `employees[i].id` are **unique**.
*   `-100 <= employees[i].importance <= 100`
*   One employee has at most one direct leader and may have several subordinates.
*   The IDs in `employees[i].subordinates` are valid IDs.

**SOLUTION:**

    """
    # Definition for Employee.
    class Employee:
        def __init__(self, id: int, importance: int, subordinates: List[int]):
            self.id = id
            self.importance = importance
            self.subordinates = subordinates
    """
    
    class Solution:
        def DFS(self, employees, i, visited):
            visited.add(i)
            for j in employees[i][1]:
                if j not in visited:
                    self.DFS(employees, j, visited)
        
        def getImportance(self, employees: List['Employee'], i: int) -> int:
            empMap = {}
            for emp in employees:
                empMap[emp.id] = [emp.importance, emp.subordinates]
            visited = set()
            self.DFS(empMap, i, visited)
            return sum([empMap[k][0] for k in visited])
Camelcase Matching
Tags: leetcode, dsa, theabbie
Published: 2022-06-15 00:00:43

Given an array of strings `queries` and a string `pattern`, return a boolean array `answer` where `answer[i]` is `true` if `queries[i]` matches `pattern`, and `false` otherwise.

A query word `queries[i]` matches `pattern` if you can insert lowercase English letters pattern so that it equals the query. You may insert each character at any position and you may not insert any characters.

**Example 1:**

**Input:** queries = \["FooBar","FooBarTest","FootBall","FrameBuffer","ForceFeedBack"\], pattern = "FB"
**Output:** \[true,false,true,true,false\]
**Explanation:** "FooBar" can be generated like this "F" + "oo" + "B" + "ar".
"FootBall" can be generated like this "F" + "oot" + "B" + "all".
"FrameBuffer" can be generated like this "F" + "rame" + "B" + "uffer".

**Example 2:**

**Input:** queries = \["FooBar","FooBarTest","FootBall","FrameBuffer","ForceFeedBack"\], pattern = "FoBa"
**Output:** \[true,false,true,false,false\]
**Explanation:** "FooBar" can be generated like this "Fo" + "o" + "Ba" + "r".
"FootBall" can be generated like this "Fo" + "ot" + "Ba" + "ll".

**Example 3:**

**Input:** queries = \["FooBar","FooBarTest","FootBall","FrameBuffer","ForceFeedBack"\], pattern = "FoBaT"
**Output:** \[false,true,false,false,false\]
**Explanation:** "FooBarTest" can be generated like this "Fo" + "o" + "Ba" + "r" + "T" + "est".

**Constraints:**

*   `1 <= pattern.length, queries.length <= 100`
*   `1 <= queries[i].length <= 100`
*   `queries[i]` and `pattern` consist of English letters.

**SOLUTION:**

    class Solution:
        def camelMatch(self, queries: List[str], pattern: str) -> List[bool]:
            n = len(pattern)
            pattCaps = "".join([c for c in pattern if c.isupper()])
            answer = []
            for q in queries:
                m = len(q)
                qCaps = "".join([c for c in q if c.isupper()])
                if pattCaps != qCaps:
                    answer.append(False)
                    continue
                i = 0
                j = 0
                while i < n and j < m:
                    if pattern[i] == q[j]:
                        i += 1
                        j += 1
                    else:
                        j += 1
                answer.append(i == n)
            return answer