teleren/devto huggingface dataset:
Demystifying the int type in Go
Tags: memory, integer, size
Published: 2021-05-03 08:38:19

---
title: Demystifying the int type in Go
published: true
description: Understanding how Go allocates memory for different int size
tags: memory,integer,size
cover_image: https://i.imgur.com/gVHRJSd.png
---

An integer can be defined as a whole number, in computer science an integer can be represented by different sizes, based on the number of bits used to represent them.

1. 16Bits or 2Bytes Also called a short in many other langauges
2. 32Bits or 4Bytes also called an int in many other langauges
3. 64Bits or 8 Bytes also called a long in many other languages
And the list goes on, some other languages have the concept of 128 bits

The Go programming language is very interesting especially with its various integer types. The Go programming languages as of today currently supports the following:

1. int
2. int8
3. int16
4. int32
5. int64

> Can you guess what are the sizes of the types ?

Well, lets see for ourself

```Go
func printAll(){
	fmt.Printf(" int %d,\n int8 %d, \n int16 %d,\n int32 %d, \n int64 %d",
		unsafe.Sizeof(int(0)),
		unsafe.Sizeof(int8(0)),
		unsafe.Sizeof(int16(0)),
		unsafe.Sizeof(int32(0)),
		unsafe.Sizeof(int64(0)))
}
```

The result is 
![Result](https://i.ibb.co/jwnGKCh/Screenshot-2021-05-03-at-03-13-49.png)

Wow, coming from a C# background where an int is always 4 byte, seeing 8bytes for an int is mind boggling.

Digging into the Go int documentation, here is what it says

>int is a signed integer type that is at least 32 bits in size

so what then does _atleast_ mean ? Turns out that the size of the *int* type varies based on the CPU type, if it is a 32 bit CPU, then you have 4 bytes, if it is 64 bits then you expect 8 bytes.

This was quite interesting, especially coming from a C# background where an int is always 4bytes.

Go engineers, therefore should be careful when using the int type. If you intend to store a 64bit value, it is better you use an int64 type to avoid any weird outcome.

Also in high performance scenario where memory is a concern, always use the correct type.
Finding the original mp4 video of a GIPHY Capture
Published: 2021-05-03 08:18:12

What if you're using GIPHY's fun [Capture](https://giphy.com/apps/giphycapture) tool on macOS, spend some time creating recordings, only to realize that GIFs are not the best format for your recordings?[^1] Or, you just want to archive/share/reuse a higher-quality version of your recording?

The tool does not offer a solution to export the original recordings, but it _does_ store them somewhere! And that somewhere is here: 
```
/Users/YOUR_USERNAME/Library/Containers/com.fasthatchapps.gifgrabberosx/Data/Documents`
```

![video-location](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bah4xtgqv0n0h3kslx82.png)

You can enter this directory by hitting `Shift+Cmd+G` in Finder, copy-pasting the above path, replacing `YOUR_USERNAME` with your username into the above path, and clicking "Go".

Hope this helps someone on the internet (hi! 👋).

## How did I find this?

All thanks to the nifty tool [AppCleaner](https://freemacsoft.net/appcleaner/). It's intended to erase programs from your Mac entirely, but it seems to work just as well as a forensic tool.

![appcleaner](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2vx3inygmo8ytv92q3tx.png)

[^1]: GIFs are enormously inefficient and bulky compared to MPEG/web format videos. Too bad we're stuck with them for our daily dose of internet madness.
My top 3 Useful Hacks for Working from Home
Tags: discuss, homeoffice
Published: 2021-05-03 07:58:34

Many people have been working from home since the pandemic started. The world lockdown had inflicted different changes in the daily life of everyone.

In order to work effectively, you will need to change some of your habits and daily routines. 

Here are 3 useful hacks, which will make your work from home pleasant!

## ☀ Create a Morning Routine

It can help you to boost-start your day and will give you time for yourself or for your family before work. 

It is important to know when your working day will start. Your morning routine could include anything from drinking a glass of coffee, doing yoga, or having a nice breakfast. 

The morning routine is a fundamental key for a successful start of the day. 

## 💺 Comfortable chair

Every remote employee should have a dedicated workspace. Not everyone can afford an entire room, but I believe that having a corner of a room is good enough as well. 

It is important to associate a place in your house or a flat where you only do work, this would help your productivity a lot. 

The chair is a crucial part of your workspace. It will help you feel good during the whole working day and save you from terrible back pain.

## ⌚ Schedule Breaks

Yes, an efficient working day includes breaks. Give yourself time for relaxing and standing away from your desk. 

You can drink a glass of water, make 5 minutes stretch, or water the flowers.

You can use an app, that helps you to lock yourself out of your computer, or set a regular timer to remind you when the break starts. 

This will keep your mind fresh and you will be able to do more productive work.

## Conclusion

There are a lot of advantages to working from home. It saves us time in the traffic jam, it gives us an opportunity to wear cozy clothes, saves us money and etc. 

That is why it is important to find a way to make your workday at home more enjoyable with these hacks!

What are your top 3 hacks? 🤔
Developer's Resume Template - made with Tailwind, Vite and Ionicons
Tags: beginners, resume, tailwindcss, vite
Published: 2021-05-03 07:43:28

---
canonical_url: https://chrisko.io/posts/dev-resume-template-made-with-tailwind-vite-and-ionicons
---

This is a template for you if you want to put your resume online to share it easily with future employers or clients!

I've made the resume template with

- [TailwindCSS](https://tailwindcss.com) - A utility-first CSS framework
- [Vite](https://vitejs.dev) - Next Generation of Frontend Tooling
- [Ionicons](https://ionicons.com) - Open source icons. Lovingly hand-crafted.

## Resources to start

Instructions on how to get the template working for your can be found along with the **[Code on GitHub](https://github.com/christiankozalla/dev-resume-template)**

> **[Live Resume Example](https://christiankozalla.github.io/dev-resume-template/)**

## Story behind

I've redesigned my resume from the ground up, lately. I was tired of keeping a Word / PDF document always up-to-date. In addition, I enjoyed the simplicity of updating websites just by pushing new code to a repository! Plus, a website offers a lot more freedom to style and design according to your likes.

I thought of several advantages of building my resume as a website instead of a PDF:

- Responsive - A website looks great on all screen sizes
- Every design is possible - CSS offers an abundant variety
- Easily share the link with friends, employers or clients

> Another nice side-effect: I was waiting for an opportunity to try some tools and libraries like Tailwind and Vite. So my need for a new resume was a perfect match in this case! :smile:

## Feedback

If you'd like try out the [template](https://github.com/christiankozalla/dev-resume-template) or if you have any feedback about the idea whatsoever, I'll be glad to receive your feedback :pray:

Hope you like the template and it can help you on your developer career! :seedling:

Thanks for your attention! :heart:
Convert pdf to docx for free
Tags: gooledrive, googledoc, utility
Published: 2021-05-03 07:37:02



###Requirement : 

You need to have a gmail id :-) which I suppose everyone would have. If not then you can create one for free.

###Process:

1) Upload your pdf doc to google drive.
![Google Drive](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5embdmlb4c6a2uwjaeso.png)
2) Right click on the file and Select Open with Google Docs
![Google Drive](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7x8zfqb8lzix5h9327if.png)
3) This should open you pdf file in Google Docs.
4) In Google Docs, go to File menu > Download > Microsoft Word (.docx) 

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x9seif8v7832nq7xrxju.png)

That's it, Keep sharing... keep learning
NodeJs/Express MongoDB One-to-Many related documents
Tags: node, express, mongodb, onetomany
Published: 2021-05-03 07:36:47

https://grokonez.com/node-js/nodejs-express-mongodb-one-to-many-related-models

NodeJs/Express MongoDB One-to-Many related documents

In the tutorial, we will show you how to develop One-to-Many related document with NodeJs/Express, MongoDB using Mongoose.

Related post:
- <a href="https://grokonez.com/node-js/crud-restapis-with-nodejs-express-mongodb">Crud RestAPIs with NodeJS/Express, MongoDB using Mongoose</a>
- <a href="https://grokonez.com/node-js/mongoose-many-to-many-related-models-with-nodejs-express-mongodb">Mongoose Many-to-Many related models with NodeJS/Express, MongoDB</a>

<!--more-->
<h2>Goal</h2>
<h3>Prerequisites</h3>
<a href="https://grokonez.com/node-js/crud-restapis-with-nodejs-express-mongodb">Crud RestAPIs with NodeJS/Express, MongoDB using Mongoose</a>
In the above tutorial, we show how to build CRUD RestAPIs with NodeJS/Express and MongoDB using Mongoose:

<pre><code class="language-javascript">
/nodejs-restapi-mongodb
	/app
		/config
			mongodb.config.js
		/controllers
			customer.controller.js
		/models
			customer.model.js
		/routes
			customer.routes.js
	/node_modules
	package.json
	server.js
</code></pre>

<h3>Objective</h3>
In the tutorial, we show how to develop One-to-Many related documents with NodeJS/Express, MongoDB. Project structure:

More at:

https://grokonez.com/node-js/nodejs-express-mongodb-one-to-many-related-models

NodeJs/Express MongoDB One-to-Many related documents
Reactor – Simple Ways to create Flux/Mono
Tags: reactor, flux, mono
Published: 2021-05-03 06:57:09

https://grokonez.com/reactive-programming/reactor/reactor-create-flux-and-mono-simple-ways-to-create-publishers-reactive-programming

Reactor – Simple Ways to create Flux/Mono

Reactive Streams is an API and pattern that provides a standard for asynchronous stream processing with non-blocking back pressure. It is also being introduced in <a href="https://grokonez.com/java/java-9-flow-api-reactive-streams" target="_blank">Java 9 Flow API</a> with four simple interfaces: <code>Publisher</code>, <code>Subscriber</code>, <code>Subscription </code>and <code>Processor</code>.

But Reactive Streams API is just low level to make practical use in reactive applications. So Reactor Core provides two main implementations of Publisher: <strong>Flux</strong> and <strong>Mono</strong>. In this tutorial, we're gonna know what they are and simple ways to create them.

<!--more-->
<h2>I. Overview</h2>
For more details about Reactive Streams and Publish-Subscribe Pattern, please visit:
<a href="https://grokonez.com/java/java-9-flow-api-reactive-streams">Java 9 Flow API – Reactive Streams</a>

<h3>1. Flux & Mono</h3>
A <strong>Flux&#60;T&#62;</strong> is a standard <strong>Publisher&#60;T&#62;</strong> representing a reactive sequence of <strong>0..N</strong> items, optionally terminated by either a success signal or an error.

While <strong>Mono&#60;T&#62;</strong> is a specialized <strong>Publisher&#60;T&#62;</strong> that emits at most <strong>single-valued-or-empty</strong> result.
<h3>2. Simple ways to create Publishers with Flux and Mono</h3>
<h4>2.1 Mono</h4>
- <strong>Empty</strong> Mono:
<pre><code class="language-java">Mono&lt;String&gt; noData = Mono.empty();
</code></pre>
- Mono with value:
<pre><code class="language-java">Mono&lt;String&gt; data = Mono.just(&quot;JSA&quot;);
</code></pre>
- Mono that emits an <strong>Exception</strong>:
<pre><code class="language-java">
Mono.error(new CustomException());
</code></pre>
<h4>2.2 Flux</h4>
- <strong>Empty</strong> Flux:
<pre><code class="language-java">Flux&lt;String&gt; noData = Flux.empty();</code></pre>
- Flux with items:
<pre><code class="language-java">Flux&lt;String&gt; data = Flux.just(&quot;Java&quot;, &quot;Sample&quot;, &quot;Approach&quot;, &quot;.com&quot;);</code></pre>
- Flux from <strong>Collections</strong>:

https://grokonez.com/reactive-programming/reactor/reactor-create-flux-and-mono-simple-ways-to-create-publishers-reactive-programming

Reactor – Simple Ways to create Flux/Mono
Use SQL like Spring Data JPA
Tags: sql, orm, springboot, java
Published: 2021-05-03 07:29:39

https://github.com/babyblue94520/hi-sql
Similar to Spring Data JPA, based on native SQL syntax, the result is converted into the expected object type, simplifying the process.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sh2faio7c6fv2rlaqu1x.png)
MongooseJs Virtual Properties with NodeJs, MongoDB
Tags: mongoosejs, mongodb, node, virtual
Published: 2021-05-03 07:28:21

https://grokonez.com/node-js/mongoosejs-virtual-properties-with-nodejs-mongodb

MongooseJs Virtual Properties with NodeJs, MongoDB


In the tutorial, we show how to use MongooseJs Virtual Properties with NodeJs, MongoDB.

Related Posts:
- <a href="https://grokonez.com/node-js/crud-restapis-with-nodejs-express-mongodb">Crud RestAPIs with NodeJS/Express, MongoDB using Mongoose</a>
- <a href="https://grokonez.com/node-js/nodejs-express-mongodb-one-to-many-related-models">NodeJs/Express MongoDB One-to-Many related documents</a>
- <a href="https://grokonez.com/node-js/mongoose-many-to-many-related-models-with-nodejs-express-mongodb">Mongoose Many-to-Many related models with NodeJS/Express, MongoDB</a>

<!--more-->
<h2>Mongoose Virtual Property</h2>
We define a customerSchema as below:

<pre><code class="language-javascript">
// define a customer-schema
var customerSchema = mongoose.Schema({
  firstname: String,
  lastname: String
});

// create a model
var Customer = mongoose.model('Customer', customerSchema);

// create a document 
var peter = new Customer({
  firstname: 'Peter',
  lastname: 'Thomas'
});
</code></pre>

How to get a customer's fullname? 
-> With traditional way, we can do as below:

<pre><code class="language-javascript">
console.log(peter.firstname + ' ' + peter.lastname); 
// -> Peter Thomas
</code></pre>

<strong>Problems</strong>? 
-> The above way is too cumbersome. We can use a new approach with Mongoose Virtual property.

Mongoose Virtual Properties are document properties that we can get and set but Not persisted to MongoDB.
- To combining fields, we use <strong>getters</strong>
- To de-composing a single value into multiple values for storage, we use <strong>setters</strong>

<pre><code class="language-javascript">
customerSchema.virtual('fullname').
  get(function() { return this.firstname + ' ' + this.lastname; }).
  set(function(value) {
    this.firstname = value.substr(0, value.indexOf(' '));
    this.lastname = value.substr(value.indexOf(' ') + 1);
});
</code></pre>

Now, see the executing of below code:

More at:

https://grokonez.com/node-js/mongoosejs-virtual-properties-with-nodejs-mongodb

MongooseJs Virtual Properties with NodeJs, MongoDB
Implementing Multer Storage Engine in TypeScript
Tags: typescript, node, express, multer
Published: 2021-05-03 07:28:00

Multer is pretty popular ExpressJS middleware, primarily used to handle file uploads from client to server. However, a lot of [other options](https://bytearcher.com/articles/formidable-vs-busboy-vs-multer-vs-multiparty/) are available too depending on what fits your use case.

[Multer](https://github.com/expressjs/multer) plays along really well with ExpressJS and have out-of-the-box support for storing file in-disk and in-memory, on the server side. Interestingly, Multer can also be used for file streaming applications where you don't need to store the incoming file on server side and directly redirect the incoming file stream to some cloud storage service instead (say, AWS S3). When you need to support the uploads of bulky/large files (say, tens or hundreds of MBs or anything beyond that), streaming can come across as the most practical solution.

The file streaming logic can vary depending on your cloud storage service provide but in this post I'll simply present the storage engine implementation logic in generalized way which you can expand upon based on your use cases. This logic is already presented by the maintainers of Multer [here](https://github.com/expressjs/multer/blob/master/StorageEngine.md) but it uses object prototypes and vanilla JS. For those of us who have gotten the taste of syntactic sugar by using JS classes might find it hard to comprehend that logic right away. Moreover, owing to the popularity of TypeScript, a TS implementation of that storage engine logic may also be handy for the web dev community.

So, here's TS Classes based approach for implementing Multer's Storage Engine:

{% gist https://gist.github.com/maneetgoyal/c724e8e44ad3c04a6609eba740802e5a %}
Mongoose Many-to-Many related models with NodeJS/Express, MongoDB
Tags: mongoose, mongodb, node, express
Published: 2021-05-03 07:22:48

https://grokonez.com/node-js/mongoose-many-to-many-related-models-with-nodejs-express-mongodb

Mongoose Many-to-Many related models with NodeJS/Express, MongoDB

In the tutorial, we will show you how to develop Mongoose Many-to-Many related documents with NodeJs/Express, MongoDB.

Related post:
– <a href="https://grokonez.com/node-js/crud-restapis-with-nodejs-express-mongodb">Crud RestAPIs with NodeJS/Express, MongoDB using Mongoose</a>
- <a href="https://grokonez.com/node-js/nodejs-express-mongodb-one-to-many-related-models">NodeJs/Express MongoDB One-to-Many related documents</a>

<!--more-->
<h2>Goal</h2>
<h3>Prerequisites</h3>
<a href="https://grokonez.com/node-js/crud-restapis-with-nodejs-express-mongodb">Crud RestAPIs with NodeJS/Express, MongoDB using Mongoose</a>
In the above tutorial, we show how to build CRUD RestAPIs with NodeJS/Express and MongoDB using Mongoose:

<pre><code class="language-java">
/nodejs-restapi-mongodb
	/app
		/config
			mongodb.config.js
		/controllers
			customer.controller.js
		/models
			customer.model.js
		/routes
			customer.routes.js
	/node_modules
	package.json
	server.js
</code></pre>
<h3>Objective</h3>
In the tutorial, we show how to develop Mongoose Many-to-Many related documents with NodeJS/Express, MongoDB. Project structure:

More at:

https://grokonez.com/node-js/mongoose-many-to-many-related-models-with-nodejs-express-mongodb

Mongoose Many-to-Many related models with NodeJS/Express, MongoDB
Unable to display a video stream and images in UI
Tags: python, help
Published: 2021-05-03 07:13:03

Im new to Tkinter, I just tried one UI using the below information but I cant proceed further. 

Im using Tkinter to develop UI using python. I want to show a video live stream using RTSP in a one Column and want to display images in another column

Case-1:
Im converting the images into base64 and storing in redis then im reading the base64 code from redis by decoding it and want to show in label box.

But Im not able to show in UI 

Can some one help me to solve this issue
SpringData Reactive Cassandra Repositories | SpringBoot
Tags: springboot, springdata, reactive, cassandra
Published: 2021-05-03 07:12:59

https://grokonez.com/spring-framework/spring-data/springdata-reactive-cassandra-repositories-springboot

SpringData Reactive Cassandra Repositories | SpringBoot


<a href="https://grokonez.com/category/reactive-programming">Reactive programming</a> is about non-blocking applications. With the previous <a href="https://grokonez.com/spring-framework/spring-webflux/springboot-webflux-annotation-based-programming-model">post</a>, we had learned how to use <strong>SpringBoot WebFlux</strong>. In the tutorial, <a href="https://grokonez.com">JavaSampleApproach</a> will explore more about <strong>SpringData Reactive Cassandra Repositories</strong> with a set of high-level abstraction CRUD methods.

Related posts:
– <a href="https://grokonez.com/spring-framework/spring-webflux/springboot-webflux-annotation-based-programming-model">SpringBoot WebFlux Annotation-based RestAPIs</a>
- <a href="https://grokonez.com/spring-framework/spring-boot/springboot-webflux-functional-restapis">SpringBoot WebFlux Functional RestAPIs</a>
- <a href="https://grokonez.com/spring-framework/spring-data/start-spring-data-cassandra-springboot">How to start Spring Data Cassandra with SpringBoot</a>
- <a href="https://grokonez.com/spring-framework/spring-boot/angular-spring-webflux-spring-data-reactive-cassandra-example-full-reactive-angular-http-client-spring-boot-restapi-server">Angular + Spring WebFlux + Spring Data Reactive Cassandra example | Full-Reactive Angular Http Client – Spring Boot RestApi Server</a>

<!--more-->
<h2>I. Technologies</h2>
– Java: 1.8
– Maven: 3.3.9
– Spring Tool Suite: Version 3.9.0.RELEASE
– Spring Boot: 2.0.0.M4
– Spring Boot Starter Webflux
– Spring Boot Starter Data Cassandra Reactive
- Cassandra version: 3.9.0
<h2>II. SpringData Reactive Cassandra</h2>
Cassandra Reactive SpringData provides repositories with a set of high-level abstraction CRUD methods or templates for working. In the tutorial, we focus on Reactive Cassandra repositories implementation.

For working with ReactiveCassandra, we need dependency:

<pre><code class="language-html">&lt;dependency&gt;
	&lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
	&lt;artifactId&gt;spring-boot-starter-data-cassandra-reactive&lt;/artifactId&gt;
&lt;/dependency&gt;</code></pre>

<strong>How to work?</strong>

We use <code>AbstractReactiveCassandraConfiguration</code> to configure Reactive Cassandra database:

More at:

https://grokonez.com/spring-framework/spring-data/springdata-reactive-cassandra-repositories-springboot

SpringData Reactive Cassandra Repositories | SpringBoot
Day 50 of 100 Days of SwiftUI
Tags: swift, 100daysofcode
Published: 2021-05-03 06:40:21

I just completed day 50 of 100 days of SwiftUI. Today I built a cupcake ordering app.
Here's a link to the [github repo](https://github.com/sanmiAde/CupcakeCorner)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9zifsy23e5axr9tgw5x0.png)![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qc8izqvk37lgy2qzdb29.png)![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fu74lbmt4rvtiv9uo125.png)