teleren/devto huggingface dataset:
Accessing from outside the global variables declared inside a shared library. 
Tags: help
Published: 2019-09-03 01:37:34

---
title: Accessing from outside the global variables declared inside a shared library. 
published: true
tags: help
---
I have a simple c file (mylib.so)compiled as a .so on Mac. This file has two global variables, one is an integer and the other is a pointer pointing to heap. From outside the .so, i.e..from another file (myapp.c) I see that I can access the global integer variable defined inside the .so but when I try to access the pointer, its value is NULL. I have declared both as externs in myapp.c. Was wondering why the global pointer is NULL ?
An Opinionated Tech Talk Blog
Tags: opinionated, tech, blog
Published: 2019-09-03 01:10:22

# Initial Release

I released the initial version of [Tech Talk John](https://techtalkjohn.com), an opinionated tech talk blog. It is starting off with a couple of postings you may find interesting.


### Duds or Nuggets

I am a computer systems architect and electronics engineer with decades of passion  checking out what’s new or not, what’s real or not, or what’s new and improved, in the electronic and computer industries. It is something like panning for gold.

Buried within the mountains of info rubble produced daily by the  industries, lots of fools gold duds are found and every so often one finds nuggets making the effort worthwhile

The blog posts are my opinions about some of the duds and nuggets.
Primary Keys in Redshift
Tags: database
Published: 2019-09-03 00:34:16

Primary Keys in Redshift

PKs in Redshift are an unusual implementation; or at least will seem so to those familiar with traditional transactional row-oriented DBs.

But AWS Redshift is columnar, optimized for data warehousing and the high-volume data loads and fast scan workloads required when aggregating granular data.

Two other main aspects of Redshift: it is massively parallel processing (MPP), and distributed shared-nothing – meaning each node manages its own memory (in contrast with shared memory), although nodes are aware of each other and of the leader node.

The overhead of maintaining fully-functional primary keys would be burdensome for this architecture. But primary keys do indeed exist; it’s just that they don’t enforce uniqueness. They are intended for reference, as a flag to say, “Data in this/these column(s) should be unique”. Note use of the word, “should”. Here’s where it gets tricky. You can go ahead and put duplicate data into PK columns, thus violating the principle of a PK. Redshift is fine with that.

It is understood (by Redshift, if not by you) that the data you are loading has already been “cleaned”, or you have an ETL (or ELT) process that includes a de-duplication step.

So what's the utility of this implementation, in addition to reduced overhead? The PKs can be read by ERD tools like Erwin, ER/Studio and PowerDesigner and incorporated into a reverse-engineered database diagram. These entity relationship diagrams (ERDs) are a map of relationships and join columns in the database.

I first became aware of Redshifts PK implementation when SELECT COUNT(DISTINCT) didn’t return the expected number of rows; Redshift assumed all rows were unique in PK and returned the theoretical rowcount based on that assumption. I was expecting a different number. Upon reading the docs, it started to become clear.

The Docs:
https://docs.aws.amazon.com/redshift/latest/dg/t_Defining_constraints.html
Doing To-Dos
Tags: frontend, javascript, git, career
Published: 2019-09-02 23:44:10

---
title: Doing To-Dos
published: true
description: A thing I'm doing
tags: frontend,javascript,git,career
---

I needed to get some code on GitHub, because you apparently can't get a web dev job without it anymore. But I had never used Git (we still use SVN where I currently work). And I had never even tried to write code for public consumption (other than a couple of little projects on CodePen).

So, to learn Git (and have some code to put on GitHub), I decided create a "to-do" app. (I know, real original.) I also decided that, upon completing it, I would duplicate it using different libraries and frameworks I know (eg, jQuery) and/or have been learning (eg, React).

It (the Vanilla JS version) is <i>finished</i> (for now). Of course, these apps are not very complex (nor exciting), but it is something simple I can at least get started with. I even added a context menu (right-click) to give it a little pizzazz.

So here it is in all it's splendor: 
https://github.com/edlinkiii/todo-vanilla-js
https://codepen.io/edlinkiii/full/VwZzyZG

In the (very near) future this project will be converted to an implementation using web components. I will also do a version of it using jQuery (and probably Backbone) before starting on React/Redux. Converting one or more of them to TypeScript is also a possibility. (A version with Angular will be inevitable.)

At some point I will likely create my own Node/Express/MongoDB backend also.

Every time I start thinking of what to do next, I end up spiraling in ideas... And it's just a little to-do app. Simple or not, I'm hoping it will display some of what I have learned, because the bottom line is that I really need to get some code visible.

PS: I'm super nervous about publishing this and opening my code up to public ridicule. (Please be kind.)
My thoughtful twitter assistant is LIVE!
Tags: showdev, twitter
Published: 2019-09-02 23:23:06

---
title: My thoughtful twitter assistant is LIVE!
published: true
description: Cephhi is a virtual assistant specially designed to help you share your work thoughtfully, thus avoiding making your account look like a bot.
tags: showdev, twitter
cover_image: https://i.imgur.com/mNQKbCV.png
---

You may have seen this post I wrote a while ago:

{% link https://dev.to/paulasantamaria/i-m-building-a-thoughtful-twitter-assistant-5dib %}

Well, the MVP is done and we're going LIVE today! [Check it out!](https://cephhi.com)


# What's Cephhi?
Cephhi is a virtual assistant specially designed to help you share your content thoughtfully, thus avoiding making your account look like a bot

 Here's how Cephhi dashboard looks right now:
![Cephhi dashboard](https://i.imgur.com/EsNEj5M.gif)

# How can Cephhi be useful **to you**?

Are you a blogger? YouTuber? Or do you sell products online?

Add the **URLs** to your content (posts, videos, products, etc) and one or more related **captions** and, finally, include some **hashtags**. Cephhi will use the data to put together **tweets** for you every day at your desired time.

# How's Cephhi *thoughtful*?

- Cephhi **doesn't** fake interactions with your audience (like retweets, comments, follows or likes).
- The content published by Cephhi is always created **by people**. It doesn't generate captions or even hashtags automatically.
- The amount of tweets per day is limited to a maximum of 4.
- The amount of hashtags per tweet is also limited.
- Cephhi'll give you tips on how to keep an **authentic** image online.

# Features included in the MVP
- Sign up with twitter
- Add your content's links, tweet ideas and hashtags
- Select the time when your tweets will be published every day.
- Automatic tweet generation and publishing
- Dashboard displays the generated tweets and the next tweet to be published

--- 

# Interested? 
Go to [cephhi.com](https://cephhi.com) to try it out, it's free!

{% youtube 3eIXCQpVnfo %}

---

## Reported issues

- Sign up fails when the user doesn't have an email associated to their Twitter account.
    - Fixed ✔️
- Sign up fails when the browser language isn't English or Spanish.
    - Fixed ✔️
- Some typos
    - Fixed ✔️

Big thanks to:
- @lpbayliss
- @yvonnickfrin
- @_codegears_
- @gablaroche
- @iceorfiresite
- @kayis
- @gablaroche

For reporting the issues and helping us improve Cephhi 😁
Sending Structured Messages to Azure Event Hubs
Tags: azure, python, structureddata, etl
Published: 2019-09-02 23:20:41

---
title: Sending Structured Messages to Azure Event Hubs
published: true
description: Building upon sending and receiving of messages in Data Ingestion with Azure Event Hubs using Python let's explore how to make them meaningful using structured data.
tags: azure, python, structured data, etl
cover_image: https://thepracticaldev.s3.amazonaws.com/i/lp20ywlv4v2mmfc9vijo.jpeg
---

Building upon sending and receiving of messages in [Data Ingestion with Azure Event Hubs using Python](https://dev.to/dev3l/data-ingestion-with-azure-event-hubs-using-python-2dda) let's explore how to make them meaningful using [structured data](https://www.datamation.com/big-data/structured-data.html).

# With the End in Mind

Whatever we believe we know to be true, typically goes out the door as our products hit the real world. If our extraction and transformation steps are tightly coupled, then it is difficult for us to effectively reprocess the data. 

### Preserve the Original Data

Whenever possible, preserving the original data allows it to be reprocessed without having to recapture the entire data set! Resist the urge to transform your data at this point. This allows us to decouple our architecture.

### Meta-Data

Pulling out some meta-data, such as a *record identity*, is necessary, but we must make sure we have a *unique delimiter* to tokenize the message. I recently used `|~|` as one for my ingestion pipeline. In addition, a *record type* will help us implement a command design pattern for processing each individual event. Additional attributes may be added to assist with the transformation of the data, such as a *profile name* if the message is related.


# Building a Structured Message in Python

Given our meta-data attributes:
- *record identity* => `id`
- *record type* => `type`
- *profile name* => `profile`

Given our unique delimiter:
- `|~|`

This is a short Python method that asserts messages will be sent in a format that is easy for us to transform into meaningful inputs to the rest of our system.

```
def build_message(profile: str, message_type: str,
                  event_id: str, message: str,
                  *, delimiter: str = data_delimiter):
    
    structured_message = \
        f'profile:{profile}{delimiter}' \
        f'type:{message_type}{delimiter}' \
        f'id:{event_id}{delimiter}' \
        f'message:{message}'
    
    return structured_message

# => profile:dev3l|~|type:tweet|~|id:1|~|message:hello, world
```

# Conclusion

With a well-structured message, we can easily process our events in realtime OR the entire event stream when the time comes! In our next adventure, we will manually process some of our messages and store them in a persistent store, locally in Mongo DB and later in the clouds using [Azure Cosmos DB](https://azure.microsoft.com/en-us/free/cosmos-db).
Meet border-box, my best friend.
Tags: css, boxmodel, layout
Published: 2019-09-02 23:16:14

Have you been given the advice to use `box-sizing: border-box;` but not completely understand what it was doing for you?

Whether working to recreate comps down to the pixel or building my own designs, `border-box` has made my life a lot easier. But it didn't seem any easier until I understood what it was doing for me. That's why it is my best friend and I think you might want it in your life, too!

Before you dive into this, you should have an understanding of content, padding, border, and margin and the role each of those play in [the box model](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Box_Model/Introduction_to_the_CSS_box_model).

## `box-sizing: content-box;`

`content-box` is the default value for the box-sizing property for most elements. The **content** in `content-box` means that content, and only content, will use the height and width that are applied to an element. 

If we apply a width of 200px to a `div`, we won't be surprised to see it take up 200px. Now, when we add on 10px of padding and a 3px border, we will see that the box is now 226px wide: 

<img src="https://thepracticaldev.s3.amazonaws.com/i/9cpd32c2dsnqjsds1k5d.png">

If I truly only have 200px for this element, I now need to subtract the padding and border from the content, so I set the content at 174px. Any tiny change I decide to make to the padding or border from there on out, I'll also have to calculate and make a change to the content. 

## `box-sizing: border-box;`

The **border** in `border-box` means that the border and everything inside of it, padding and content, will count toward the defined height and width of the element.

If we apply a width of 200px to a `div` element, then the 10px padding and 3px border, the content, padding and border will all fit within that 200px width:

<img src="https://thepracticaldev.s3.amazonaws.com/i/1i3j45cxhy3z1lxmfhvu.png">

If I need to modify the border or padding at any time, I can count on border-box to keep the element the size I defined, saving me tome from having to do the math and adjust the content's height and width every time.

## Different Elements → Different Default Styles

While most elements default to `content-box`, not all necessarily do! This depends on the user agent stylesheet for the browser you are using. In [Chrome's latest stylesheet](https://chromium.googlesource.com/chromium/blink/+/master/Source/core/css/html.css), buttons are defaulted to `border-box` along with several types of inputs. 

## Example

To see this in action, visit [this CodePen](https://codepen.io/ameseee/pen/JjPWJdL). Commenting out lines 30 and 34 one at a time can give you a feel for what each declaration does.

## Wrap Up

`border-box` may be your new best friend, but only if you know what it is doing for you. [Try adding it](https://css-tricks.com/box-sizing/#article-header-id-3) to the next small project you whip up and see how it helps you!
TODO 9/2 - 9/8 & Review on Last Week
Tags: beginners, machinelearning
Published: 2019-09-02 22:27:38

I am feeling more and more confident about my planning skills as this thread keeps building. Once again I finished all of the 3 top priorities I set up for last week 🥳

- KeepTruckin Interview ✅
  - Pramp prep
  - Prepare questions
  - Interview on Friday
- Resume ✅
  - 1 pomo Kuzushiji
  - Finalize and send out to Lynne
- Noom daily checkin ✅

I came back from Houston mid-week. It was really fun and the people are super nice. Our HQ is also very cool. All the people there are quite nice and chill. Not sure why our center has to be so old with an ex-electrical technician as our head of digital security. 

Interview with KeepTruckin went okay. It's a platform engineer role and I told the hiring manager I don't really have relevant experience. He encouraged me to do the interview anyway and I tried my best. I definitely see my lack of knowledge in API and infrastructure design but I don't think I can do better than that. Especially given it's a 5 round back-to-back interview for 6 hours straight without any break. 

I applied for a few roles I am interested in from KeyValues and am very excited to see if I will hear back from any of them soon. I also joined a job hunting group and hope to learn and contribute in the community. My H1B RFE documents were received by USCIS too and hopefully it can get approved. 

My weight loss plan with Noom is going well too. Much better than I expected actually. I was going to cancel the plan after the free trial but I might consider keeping it now. I talked about it on Twitter but somehow the html link for the tweet doesn't work here 😿

---

I am dedicating this week to job hunting as well. And my mantra is, ba dum ba dum bam, dream big!

I tried to apply to some big companies but never heard back from them so I kinda gave up. But I don't want to tell myself that I am not capable of getting attractions from all kinds of roles so will definitely apply to a few more again this week and ask for referrals whenever I can. My 3 priorities this week are:

- apply to 2+ jobs per day
  - research big tech companies for data scientist roles
  - incomplete list: LinkedIn, Twitter, Google, Amazon, Uber
  - ask for referrals/apply
- Kuzushiji
  - 2 pomo daily
- Dingpy Article
  - revise
  - submit to publication

Another exciting thing is I am going to a live podcast session on Friday in New York! The podcast is called *[By The Book](https://www.stitcher.com/podcast/by-the-book)* and I have been [binge listening](https://www.linkedin.com/feed/update/urn:li:activity:6572950045103017985/
) since I found out about it. 

All right friends see you next week!

---

Cover photo by [Sharon McCutcheon](https://unsplash.com/@sharonmccutcheon?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) on [Unsplash](https://unsplash.com/search/photos/dream?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText)
SideProjects.net | A platform to share side projects you're working on
Tags: sideprojects, webdev, productivity
Published: 2019-09-02 22:25:05

I know a lot of people work on a lot of different side projects (myself included) on their own accord, experimenting with different technologies, concepts, ideas, etc.

So I built a platform that allows you to share early-stage projects that you’re personally working on and to seek feedback/validation from users within the community. Feel free to check it out and let me know what you think!

https://sideprojects.net

I just launched it on PH and it's currently at the #3 spot :)

* There's currently a URL encoding issue with Firefox, so I recon you use another browser when trying to access SideProjects (for now at least :))
How long have you worked at the same company?
Tags: discuss, career, tips, motivation
Published: 2019-09-02 21:59:42

---
title: How long have you worked at the same company?
published: true
cover_image: https://thepracticaldev.s3.amazonaws.com/i/8kvhanygu5qbns2owuxq.jpg
description: Can staying with a company too long hurt your career? How long is too long? Is changing always good?

tags: #discuss, #career, #tips, #motivation
---

This week I had my **6 anniversary** at Goodgamestudios.
That also means that it is already 6 years I moved more than 1000 km away from Milan (Italy) to Hamburg (Germany).

It has been an amazing journey and **I am really thankful** for this experience. It gave me the opportunity to work in a modern, young and innovative environment and to live and raise my kids in a green, tidy, bike-friendly, hip, lively city.

Even though we went through some hard times -  _3 years ago there were 2 tough waves of massive layoffs_ - I am so glad I am still here. 
I learned so much here! **I grew up more as a Software Engineer in these 6 years than in the previous 10!**  I had the opportunity to work with amazing people, make incredible and inspiring friends, and challenge myself in different areas and languages: frontend - backend - web - mobile - ActionScript - Unity3D and Javascript, Serverless. 
And **this is probably the reason why I am still here** (yeah, well besides the fact that I live exactly 7 minutes away by bike :-) ).

**In the past I always felt the need and the urge to move on**, to change the company and look for new people and new challenges.  There is nothing bad in staying in the same place for long, but 
> especially in IT I always felt that if you don't move on, you likely risk to get stuck and become outdated. 

![GGS Anniversary Goodie Bag](https://thepracticaldev.s3.amazonaws.com/i/ybs6wuaaxob2d7eamj59.jpg)

Luckily for me in these 6 years at GGS I worked on 4 different projects and teams, **so it really feels as if I worked in 4 different companies.** 


What is your experience? What are your feelings about working in the same place for a long time? Is it just that I became lazy and don't want to take new challenges? Or did I finally recognize that if I am happy where I am there is no need for constantly searching elsewhere?

----
Photo by [twinsfisch](https://unsplash.com/@twinsfisch?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) on Unsplash
Keep calm and... 
Tags: humor
Published: 2019-09-02 21:13:18

---
title: Keep calm and... 
published: true
description: Complete the sentence with your worst programming-related idea possible
tags: humor
---
![Keep calm and tell a joke](https://thepracticaldev.s3.amazonaws.com/i/waxdpjvc22618rpklpud.jpg)
Complete the sentence with your worst programming-related.

I'll start:

Keep calm
and
Deploy on Fridays

Your turn!
How to Use Angular 8|9 HttpClient API to Post FormData?
Tags: angular89, multipartformdata, angularformdata, formdata
Published: 2020-01-29 17:18:30

---
title: How to Use Angular 8|9 HttpClient API to Post FormData?
published: true
tags: Angular 8|9, (multipart/form-data, angular formdata, FormData
canonical_url: https://www.positronx.io/how-to-use-angular-8-httpclient-to-post-formdata/
---


In this **Angular FormData tutorial** , we will understand how to use Angular 8 HttpClient API to Post FormData to a web server. Forms are an essential part of any web or mobile applications, and Forms allow us to gather data from the users and send that data to the webserver.

We are going to learn about the FormData object and how to use it in an Angular application. Its a JavaScript object, which allows us to develop a set of key/value data structure representing form fields and their respective values.

In this step by step article, we will take the help of Angular 8 HttpClient API to send FormData to a web server by using the Http POST method.

#### Table of contents

1. FormData Methods
2. Angular 8 FormData Tutorial with Example
3. Set up Angular App
4. Build Form with Reactive Forms and Bootstrap 4
5. POST FormData with Angular HttpClient API
6. Conclusion

## FormData Methods

You can initialize FormData object by creating an instance from `new FormData` interface as given below.

```
const formData = new FormData()

```

### FormData Methods

Once the **FormData** instance is created then there are various methods available through FormData, which allows you to manage the data as per your requirement.

| Methods | Description |
| --- | --- |
| **FormData.append()** | It includes a new value on a pre-existing key within a FormData object. If the key already exists, then the value will be added to that key without removing the first key. |
| **FormData.delete()** | It deletes a key and value pair from the FormData object. |
| **FormData.entries()** | FormData returns an iterator which allows looping over a set of key-value pair presenting in the object. |
| **FormData.get()** | It returns the value associated with a given set of a key from the FormData object. However, if more values appended, then it will return the first value. |
| **FormData.getAll()** | Returns all the values associated with a key from the FormData object. |
| **FormData.has()** | It returns true if the key exists in FormData object. |
| **FormData.keys()** | Returns an iterator which allows looping over all the keys of the key-value data structure in this object. |
| **FormData.set()** | It is used to set the value into the FormData object with the particular key. Value is replaced if a key already exists in the FormData object. |
| **FormData.values()** | Returns an iterator which allows looping over all the values existing in this object |

[click here to read more](https://www.positronx.io/how-to-use-angular-8-httpclient-to-post-formdata/)
How did you learn to apply the Bridge Design Pattern?
Tags: designpatterns, clean, code, bridge
Published: 2019-09-02 20:39:08

---
title: How did you learn to apply the Bridge Design Pattern?
published: true
description: The Bridge design pattern, applied in the real world scenario.
tags: design-patterns,clean,code,bridge
---

Have you used bridge design pattern?

What is you best example of implementing the bridge example.

It would be great to share some real life examples that u implemented.
What are your JAMSTACK goals this week?
Tags: discuss, javascript, graphql, react
Published: 2019-09-02 18:14:13

<h2>My main Jam this week. </h2>
<ul>
<li>Gatsby, </li>
<li>Contentful, </li>
<li>Agolia and </li>
<li>Auth0</li>
</ul>
I am building a Job Portal. 
<i>Jamstack way of doing things needs a change of mindset from what REST, drupal etc does. </i>