teleren/devto huggingface dataset:
Unity上でGoogle.ProtobufがSystem.Memoryを参照できなかったときの対応
Published: 2020-08-20 04:13:46

# はじめに

こんばんは、じぇしかです。最近、習作としてUnityをベースにしたVRプラットフォームを作ってみたいなーと思っている今日この頃なのですが、HTTP/2ベースでオーバーヘッドの少ないgRPCをリアルタイム通信のプロトコルとして使用したいと思っています。

ということで既存の記事を参考にUnityにgRPCの開発環境を導入していたのですが、Grpc.Core ver.2.23.0以降、下記のエラーが発生してしまうようです。
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/5m5yabfvlo57aat6oa99.png)

「最近の記事はどう解決しているんだ？」と思ったのですが、使用するGrpc.Coreのバージョンを下げていたり、偶然にも回避できていたりで、この事象に対して明確に触れている情報はほとんど見つかりませんでした。いろいろ試した結果、明確ではないのですが事象の発生条件と解決策が見えてきたので、記述しておきます。

***
# 事象の発生条件

まず、事象が発生する状態を示します。環境整備の手順は他の記事を参照してもらえればよいのですが、導入作業を進めると基本的には下記のようなフォルダ構造になるかと思います。
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/zg26yrajnqw9oq3fl8yi.png)

ここでシーンを再生すると、冒頭の事象が発生します。メッセージを読むと、ざっくり「Google.ProtobufがSystem.Memoryを読み込むことができなかった」というような旨のようです。とはいうものの、依存パッケージとして指定されていることもあり、System.Memoryも同じくダウンロードして配置はしています。

ここで私はドはまりして全く進められなかったのですが、いろいろと調べていくうちに、公式フォーラムのとある記事にたどり着きました。
[Editor assembly loading issues - "unloading broken assembly", "could not load signature"](https://forum.unity.com/threads/editor-assembly-loading-issues-unloading-broken-assembly-could-not-load-signature.754508/)

Google.Protobufではないものの、同様にSystem.Memoryの参照が上手くできていないようです。同時に、全てのライブラリ (*.dll) を同じフォルダに入れたところ、エラーが解消されているとも書かれています。やや言い争い状態になっているもののUnityのバグではなく、一部のライブラリにおいて依存関係がハードコードされているようで、フォルダが異なると参照ができないようです。

ちなみにこの事象、System.Memoryがver.4.5.2以下であれば何故か発生しません。実はGoogle.Protobufが依存しているSystem.Memoryのバージョンもver.4.5.2以降ではあるのですが、Grpc.Coreがver.2.23.0-pre以降のバージョンでSystem.Memory ver.4.5.3以降に依存するようになったため、このver.4.5.3が必要になっています。その結果として、Google.ProtobufがSystem.Memory ver.4.5.3を参照できなくなり、本事象が発生するようになったようです。

***
# 解決策と対応

さて、明確ではないものの原因らしきものが見えてきたところで、エラーを解決させましょう。結論から言うと、"Google.Protobuf.dll"と"System.Memory.dll"を同じフォルダに入れてあげることで、エラーは解消しました。
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/bsru5pnheb76prggqqer.png)

上記のように、例えば "Assets/Plugins/Assemblies/lib/net4.5" というような名前のフォルダを作って纏めると管理しやすいかと思います。今回は全部同じフォルダに入れていますが、全てのライブラリが依存関係を解決できていないわけではないので、部分的な対応でも大丈夫です。

念の為、テスト用のスクリプトを作成し、今回導入したパッケージを参照できるか確認しておきましょう。エディターのオートコンプリートで表示されるようであれば、適切に参照できていると判断できます。ひとつ注意事項ですが、プロジェクトの読込みができていない状態だとオートコンプリートも出てこないので、Unity上部のメニュー[Assets] > [Open C# Project]でスクリプトを開くようにしてください。
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/5d0x1syqldcosu281qfm.png)

***
# おわりに

以上、Unity上でgRPC環境を構築するときに私がドはまりした事象について、説明しました。成り行きでGrpc.Coreのバージョンを下げたり、Google.Protobufだけ差し替えてみたりと、この事象に触れている記事がほとんど見つからずとても苦労しました。同じような地雷を踏んでしまったときに、助け船として参照してもらえればと思います。
Need Suggestion
Published: 2020-08-20 03:45:05

Hello Everyone,
I am working as a software developer from past three years. But I haven't got chance to learn or work on web dev. I work on c# and SQL. I really want to learn web dev and transform my career as a full stack developer. But I am confused how to start and where to start. Can anyone guide me the path or road map which I can follow to achieve my goal.
Thanks.🙂.
A simple pre-commit hook that saves you big time!
Tags: productivity, ruby, git
Published: 2020-08-20 03:22:23

Irrespective of how thoroughly the code is tested, working in an agile startup demands you to do some last-minute changes many a time.

Most of the times, everything goes well.

Sometimes, unfortunately, you get an error after the staging/testing deployment and the server wouldn't start. It could be as simple as missing an `end`. Yes, *syntax error* is what we are talking about.

This is an embarrassment particularly when a lot of resources are working on a single branch and you get a slack alert from people saying, *Your code has a syntax error, please fix!*

To save me from these, as a practice before committing I always run a simple 

>`ruby -c 'file_path'`

that displays all the syntax errors in the file. This saves me from the embarrassment. But it is a gruelling activity especially when there are a lot of files to commit.

*This should be automated, right?*

Yes! ***Git Hooks***
If you find the terminology new, read about it [here](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks)

Let's talk about the pre-commit hook!

What's a pre-commit hook?
>The pre-commit hook is run first before you even type in a commit message. It’s used to inspect the snapshot that’s about to be committed, to see if you’ve forgotten something, to make sure tests run, or to examine whatever you need to inspect in the code. Exiting non-zero from this hook aborts the commit

Yes, this is tailor-made for our use-case. 

*I wanted to create a pre-commit hook which would pick all the staged files and run the syntax check and halt the commit if there are errors.*

It is so simple that I managed to create it in less than an hour. Never should I worry about my syntax errors anymore forever. You can see it in action here. 😎

![Pre-commit halting the commit](https://github.com/rahulramfort/blog/blob/master/misc/1_pre_commit_hook_ruby_syntax/pre_commit_hook_fail.png?raw=true)

Ah, embarrassment prevented! Here the pre-commit halts the commit because it found syntax issues in the staged files.

When all the files are good to go syntactically, you wouldn't even notice the hook. 
![Pre-commit success](https://raw.githubusercontent.com/rahulramfort/blog/master/misc/1_pre_commit_hook_ruby_syntax/pre_commit_hook_pass.png)
(Using terminal to show the success case, as Sourcetree closes the popup quickly) 

That's all I needed and I wonder why didn't I do it before.

If you are in love with the hook already, start writing one straight away. If you need any inspiration to write one, have a look at my hook [here](https://gist.github.com/rahulramfort/381ee3309e7688d7ed98b6c23ccc2f16). You can customise the hook however you want.

Further, I am planning to do more with this pre-commit hook
* Implement the same for go, YAML files
* Run rubocop/lint tools to check for specific offences
#30DaysOfCJS: Reclaiming the Web with peer-to-peer protocols
Tags: community, p2p, browser, dweb
Published: 2020-08-20 03:20:14

---
title: #30DaysOfCJS: Reclaiming the Web with peer-to-peer protocols
published: true
description: #30DaysOfCJS Day 18, Reclaiming the Web with peer-to-peer protocols
tags: community, p2p, browser, dweb
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/m0n3zm6u3l9rbg68ccuw.png
series: 30DaysOfCJS
---

*This is a follow up post for Day 18 of* **#30DaysOfCJS**, *learn more about* **#30DaysOfCJS** *here* {% link jimcalliu/30daysofcjs-1jd3 %}

**Reclaiming the Web with peer-to-peer protocols // Tara Vancil // CascadiaJS 2018**

If you'd like to watch the talk, here is the Youtube link.
{% youtube 2Q9TlvqE9_Y%}

Further readings:
- [Talk slides](https://taravancil.com/slides/cascadia-js-2018.pdf)
- [Take a tour of Beaker](https://beakerbrowser.com/docs/tour/)
Started with programming few months back...
Tags: react, javascript, npm, html
Published: 2020-08-20 03:17:34

Learning to program was like a far fetched dream that I always tried to achieve. But not knowing where to start always brought be to a temporary hault. I usually read things from here and there and then try to replicate it on my own or sometimes inspect certain sites while struggling to find any meaning in the sea of colorful lines. Even being able to understand a single link would get me excited as if I could now hack the pentagon to release all their shenanigans, lol. It was rewarding anyway. 

I have struggled to understand coding for few years now. Taking time out to find out what's important for me to start with, where do I find comprehensive material and all these small struggle pays off at the end. Things start to make sense and eventually developes our understanding of the language. 
I realized lately that I am a slow learner and I can understand something only after involving myself to a task that requires that knowledge. This self knowledge gave me a push that I have been looking for a long time now. For people struggling to learn something, you need to find the way you learn the best. Know how you learn first and your learning part will turn much easier and smoother. 

I started with learning Reactjs few months back and this is the first clone app that I completed following a tutorial. This is also my first ever blog. I am writing off the top of my head so I might have made several mistakes but I am hoping to contribute regularly from now on. 

Cheers to app 🚀🚀🚀🚀🚀
Looping Through JavaScript Objects
Published: 2020-08-20 02:59:31

Before understanding how looping works, let us talk about JavaScript Objects. Remember, when we declare a variable using let, const, or var keywords? We set the identifier or variable name equals to a value. JavaScript variable can contain only one value, for example:


```
let fruit = "apple";
```
Where the fruit is the identifier or name of the variable and apple is the value. Let’s say, we bought some fresh fruits from the farmer’s market. How can we save all the fruits and fruit count into one variable? Yes, you guessed it right! We can use objects because they can contain many values. Specifically, key-value pairs contained inside curly braces. Key being the property and value is whatever we set it equals to. It could be a string, number, array, object or function definition. Before we begin looping, let refresh our memory on how to gain access to the key-value pairs of an object.

***Accessing an object’s key-value pairs***
```
let fruit = {
            name: ["apple", "orange", "grape"],
            fruitCount: 30
            }
console.log(fruit.name) // [ 'apple', 'orange', 'grape' ]
console.log(fruit["name"]) // [ 'apple', 'orange', 'grape' ]
console.log(Object.values(fruit)) // [ [ 'apple', 'orange', 'grape' ], 30 ]
```
Here, we are using bracket notation, (.) dot notation and Object.values method (object) for accessing the object’s value.

***for…in loop***
```
let fruitCount = { 
   apple : 2, 
   orange: 3, 
   grape: 6 
}
```
In the above example, we have names of the fruits as our key and count of each fruit as the value. So what if we want to count the total number of fruits?

```
let totalCount = 0
for(let key in fruitCount){
      totalCount += fruitCount[key]
  }
console.log(totalCount); // 11
```
Here we are iterating through each object property using a for..in loop. By using this method, we have now access to the values using the bracket notation on the object itself.
We usually use for..in loop to iterate over the properties of an object. Check if a value exists for a key, display the key-value pairs using console.log. This is actually a great debugging tool. A key thing to remember is, for..in is not recommended to use with arrays because the index order is important.

***for…loop***

There is another way of doing this, using Object.keys method that takes in an object as an argument and returns an array of keys.

```
let fruitCount = { apple : 2,
                   orange: 3,
                   grape: 6 
}
let fruitArray = Object.keys(fruitCount)
  let totalCount = 0
 for (let i = 0; i < fruitArray.length; i++) {
     let fruitName = fruitArray[i];
     totalCount += fruitCount[fruitName]
}
console.log(totalCount); // 11
```
In this example, we are getting back an array of keys, which we have saved it to a variable named fruitArray. Using a for…loop, we iterate through each fruitName (keys) in the array. Since we know that we can key into an object to get the value using bracket notation, we use this trick to get the fruit count and add it to the total count.
Happy Coding!
TextHero: New library for handling text data. 
Tags: machinelearning, nlp, text
Published: 2020-08-20 02:55:19

[Texthero](https://pypi.org/project/texthero) is a python toolkit to work with text-based dataset quickly and effortlessly. Texthero is very simple to learn and designed to be used on top of Pandas. Texthero has the same expressiveness and power of Pandas and is extensively documented. Texthero is modern and conceived for programmers of the 2020 decade with little knowledge if any in linguistic.
Tutorial link: https://analyticsindiamag.com/texthero-guide-a-python-toolkit-for-text-processing/?utm_source=rss&utm_medium=rss&utm_campaign=texthero-guide-a-python-toolkit-for-text-processing
PerfAction - Run JMeter Performance Tests
Tags: actionshackathon, testing, docker, github
Published: 2020-08-20 02:43:30

### My Workflow

PerfAction helps to automate performance testing using [Apache JMeter](https://jmeter.apache.org/) and its [plugins](https://jmeter-plugins.org/).

### Submission Category: 

Wacky Wildcards


### Yaml File or Link to Code

{% github https://github.com/QAInsights/PerfAction %}


### Additional Resources / Info

None
Rick Astley is back!
Tags: actionshackathon, github, opensource, showdev
Published: 2020-08-20 02:36:55

### My Workflow
A GitHub Action to Rick-Roll innocent people.

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

### Submission Category: 
Wacky Wildcards


### Yaml File or Link to Code

{% github TejasvOnly/random-rickroll%}


### Additional Resources / Info

https://github.com/TejasvOnly/rickrolldemo
How to Schedule Backup of MySQL DB and Store it in S3 using Cron Job
Tags: mysql, tutorial, aws, codenewbie
Published: 2020-08-20 02:27:01

{% youtube 6Ccoa9jNI7c %}

In this video, Learn How to schedule your MySQL backup in EC2 instance and store it in S3 bucket using Cron job 


------------------------------SOCIAL------------------------------
Github: https://github.com/codingx01
Twitter: https://twitter.com/TechParida
Linkedin: https://www.linkedin.com/company/codingx/
Facebook: https://www.facebook.com/codingx
Instagram: https://www.instagram.com/coding.x/

Leave any questions in the comments section and don't forget to subscribe to be notified of new content! :)
Build a PWA using Workbox
Tags: pwa, offline, news, javascript
Published: 2020-08-20 02:10:13

In this article, we will cover how to build a simple news app as Progress Web App (PWA), configure services worker for caching strategies, and offline support using Workbox. The app will simply display a list of random news headlines using NewsAPI and will cache the content so that it can be used without the network.

In case you are new to PWA and would like to learn what is PWA and why we need it, I suggest taking a quick look at this article where the author explains in detail the features and benefits of implementing PWA. In a nutshell, PWAs uses service workers to offer users extra functionalities such as working offline, push notifications, and device hardware access.

[Read more](https://medium.com/the-web-tub/build-a-pwa-using-workbox-2eda1ef51d88)
Getting Started with Deno
Tags: node, deno, javascript
Published: 2020-08-20 02:05:58

TLDR: Deno could replace Node in the next Decades. So come back a decade from now. Otherwise, let’s be the first!

# What is Deno?
Deno is a JavaScript (and TypeScript) runtime with secure defaults. Like Node.js, it is also built on V8.

# Why Deno?
- Deno is secure by default. Unlike Node, you have to specify system access such as a file, network, environment access, etc.
- It supports TypeScript out of the box. Thus you don’t need to install the TypeScript compiler separately.
- And a lot more. Last but not least, it is created by the same man, Ryan Dahl, who created Node.js a decade ago. So if he decided to create a new one, it would mean …… well, you figured it out yourself. If you have 30mn to spare, watch his presentation about 10 things he regrets about Node.js.

[Read more](https://medium.com/javascript-in-plain-english/getting-started-with-deno-70cfe3f8a3a0)
Thank You, PhoneGap!
Tags: phonegap, cordova, javascript, adobe
Published: 2020-08-20 02:00:52

# PhoneGap and Cordova

The Adobe PhoneGap has recently announced that they will sunset their tools and services (PhoneGap and PhoneGap Build) on October 1, 2020. PhoneGap will not be actively maintained but will remain free and open sourced whereas the PhoneGap Build service will no longer be available. 

Adobe donated the PhoneGap codebase to the Apache Software Foundation for incubation in late 2011. The project was originally named Apache Callback and later renamed to Apache Cordova. 

Since the donation of Cordova from Adobe to Apache, the OSS community has formed with lots of participation and contribution from great individuals and companies. The Apache Cordova project has become the de facto standard for HTML5 hybrid application development and plays an important role to bridge between web development and native APIs for major platforms such as iOS and Android.

# What is Monaca?

Monaca is a development environment for smartphone and tablet applications provided by Asial Corporation. Monaca makes HTML5 hybrid mobile app development with PhoneGap/Cordova simple and easy. Monaca is the most open hybrid app development platform available and ready to be immediately plugged into your existing workflow and development environment. 

# Keep Your Awesome App and Join Us

To all PhoneGap users, you can continue to develop your application with the technology you love. In response to the end service of PhoneGap Build, we have compiled a step-by-step migration guideline to ensure a smooth transition from PhoneGap to Monaca. We will be providing a free 2-month coupon code THANKPHONEGAP for new users, to help you get started.


[Read more](https://medium.com/the-web-tub/thank-you-phonegap-b3f4102aa6bb)
How does your blog look I'm an rss reader? 🤷
Published: 2020-08-20 01:59:40

---
title: How does your blog look I'm an rss reader? 🤷
published: true
description: Post some photos of your blog in an rss reader.
tags: 
//cover_image: https://direct_url_to_image.jpg
---

Post some photos of your blog in an rss reader.


Inspired by this thread.

{% post waylonwalker/how-does-your-blog-look-in-plain-text-3534 %}
Tipos de parâmetros em requisições em http
Published: 2020-08-20 01:20:42


Existem 3 tipos de parâmetros 

- Query params

São os parâmetros de consulta *(query parms)* aparecem da seguinte forma: dominio.com/?cidade=salvador.

Esse parâmetros pode ser acessados por:

```jsx	
 app.get('/', (req, res) => {
  const cidade = req.query.cidade
  return res.json(cidade)
})
// Retorna: "salvador"
```

- Route params

Os parâmetros de rota *(routes params)* aparecem da seguinte forma: dominio.com/usuario/22

Esse parâmetros pode ser acessados por:

```jsx
 app.get('/usuario/:id', (req, res) => {
  const id = req.parms.id
  return res.json(id)
})
// Retorna: "salvador"
```

- Request body

Diferente dos parâmetros anteriores, o body mão fica visível na url, os dados são transmitidos através do método POST.

Esse parâmetros pode ser acessados por:

```jsx
const users = ['Usiario0', 'Usuario1', 'Usuario2'] 
app.get('/usuario/', (req, res) => {
  const id = req.body;
  return res.json(users[id])
})
// Retorna: "salvador"
```
How to know enough to protect my digital rights?
Tags: humanity, discuss, monopoly
Published: 2020-08-20 01:12:21

I struggled to find educational posts / videos on economics that focus on being a good citizen (i.e. not for the riches). (Actually, [I did find only one](https://www.youtube.com/watch?v=yNhu0MG_2MA).)

- I live for my ideals, not really for the riches.
- I also would want to focus on freedom of choice. That is, how much can I use apps outside Play Store, App Store, or even alternative OS's. What about freedom to assemble hardwares?
- Knowledge and technology don't come for free. I do very well understand that Research & Development teams in private companies do work hard.
- Freedom of money and power isn't really always bad, but I don't have enough knowledge to **protect or negotiate** good things for everyone... That's why I need more knowledge.
What is Closure in JavaScript?
Tags: javascript, webdev, codenewbie
Published: 2020-08-20 00:47:20

I recently purchased and read the book [You Don't Know JS Yet](https://www.amazon.com/You-Dont-Know-JS-Yet-ebook/dp/B084BNMN7T/ref=sr_1_2_sspa?dchild=1&keywords=you+don%27t+know+js+yet&qid=1597812272&sr=8-2-spons&psc=1&spLa=ZW5jcnlwdGVkUXVhbGlmaWVyPUEyVFlYMUJaOTQ2TzY3JmVuY3J5cHRlZElkPUEwMzA3MDI4Qlo2TDdCVlMwM0xBJmVuY3J5cHRlZEFkSWQ9QTA0ODk5NDgzVVFFSE1LSjlSQ0U5JndpZGdldE5hbWU9c3BfYXRmJmFjdGlvbj1jbGlja1JlZGlyZWN0JmRvTm90TG9nQ2xpY2s9dHJ1ZQ==) by Kyle Simpson, which I found to be a great read. Even though I've worked as a JS developer for years, there were so many new things I learned by reading it (I am not endorsed by anyone affiliated with this book - I'm just recommending it because I genuinely liked it).

One of those things was "closure" - a term I had heard a couple of times but never understood what it actually meant. I think it's hard to beat Kyle Simpson's definition:

> Closure is when a function remembers and continues to access variables from outside its scope, even when the function is executed in a different scope.

So, what does that look like?

## Some Examples of Closure

You've probably already used closure before and just didn't realize it. Take the following example:

```js
function doAsyncTask(successMsg) {
  someAsyncTask().then(() => {
    console.log(`I remembered your variable! ${successMsg}`);
  });
}

getSuperImporantInfo('Hooray!');

// Some time later...
// I remembered your variable! Hooray!
```

When `someAsyncTask` finishes executing, it prints out the `successMsg` variable passed to `doAsyncTask`. `someAsyncTask` could take several seconds or even several minutes to execute, but the callback function passed to `then` "remembers" the `successMsg` variable. We say the the callback function is "closed" over `successMsg`.

I've done things like this all the time, I just didn't know I was using closure!

Now let's say you want to create a counter function. Every time you call the function, it will return the next number after the last number it returned. You can use closure to "remember" the last number returned.

```js
function createCounter() {
  let count = 0;
  return () => count++;
}

const inc = createCounter();

inc();
// 0
inc();
// 1
inc();
// 2
```

`createCounter` returns an anonymous function which has access to the `count` variable. The function returned by `createCounter` is "closed" over `count`. We can even create multiple increment functions, all of which will have their own copy of `count`.

```js
const inc1 = createCounter();
const inc2 = createCounter();

inc1();
// 0
inc2();
// 0
inc1();
// 1
inc1();
// 2
inc2();
// 1
```

These may be simple examples, but I've certainly needed to write counter functions like this before. Before I knew about closure, I would create variables visible to my entire module and increment those in my counter function. Now I know there's a better way that doesn't require me polluting my modules' scopes.

That's all there is to it! What other examples can you think of where you could use closure to your advantage?
Dev Tools+ APK
Published: 2020-08-20 00:37:12

Dev Tools+ is a small app that's completely open source.

It can

* Open URLS to help test your apps

* [ROOT] List the WakeLocks in use on your device (if you remove them all, then your device might sleep better)

* Calculate Modulus 11 (Don't know why you'd want it, but it does it if you do)

* Show icons of installed application's bounding boxes (useful for seeing which ones intrude as I am a bit obsessive with that!)

* Host Server - you can hook up to a local server on your computer via USB for testing apps without putting anything live! (Tethering, but limited in the other direction!)

That's it! (If you want more features, you are welcome to fork it on GitHub!)

Open source libraries used:

* Android Support Lib

* Android Async by koush

* Netty

* Webbit

(Forgot to add them in-app, sorry guys!)
Produced this Profile Page UI Using Sketchware
Published: 2020-08-20 00:36:06

 A few of days ago my computer wasn't turning .  And due to this covid thing that I was not able to fix that.
1 thing I've heard from utilizing Sketchware is thatwe could add custom java code directly into our endeavors.This is truly magnificent.
Thus, playing with this program for a few day I thought to make a profile site UI for a few of my endeavors.And as we could even export the source code out of Sketchware, I could easily move my code into the android studio everywhere.Additionally, I uploaded it on github in the event that you would like to use this in your endeavors.