teleren/devto huggingface dataset:
Basic C++ Project Template with CMake
Tags: cpp, beginners
Published: 2019-10-23 05:37:02

It has been awhile since I last coded in C++. The last compiler I used was Borland Turbo C++. Ever since then, I shifted away from C++ to other interpreted languages like Perl and Python, and also bits of Javascript for web based works.

I am ramping up on C++ again as I am creating executable which performance is what I am craving for. I was looking at the tools for C++, and am pretty amazed with all the new (and open source!) technologies available today.

After hunting for a week or two (yes, I am a indecisive programmer, with a bit of procrastination as well), I settled down with [clang](https://clang.llvm.org) as my compiler, [CMake](https://cmake.org) as the build files generator, and [ninja](https://ninja-build.org) as the build system. Also, not to forget about unit testing, I used [Google Test](https://github.com/google/googletest).

The criteria of tool selection is largely based on cross OS compatibility. For e.g., I choose clang over MSVC or gcc mostly due to clang can easily be used in either Windows or Linux. Same as CMake. Using CMake, I don't need to worried about which build tool to be selected later. I opt for ninja as in Windows, that's the most sensible option for me since I am not using Visual Studio.

While setting up a C++ project of mine, I noticed that there will be a fixed structure of directory I could reuse, hence, I created this repository in Github, served as the basic template for my future project. It is known as [hongping/cpp_template](https://github.com/hongping/cpp_template) in Github.

The template comes with Google Test version 1.10.0 source code in the `external` directory, and the CMake files will build a basic test in `tests` directory which is to test the aliveness of the project. Once done build and execute `tests\runUnitTests`, you should be able to see the following
```
Running main() from ../external/googletest-release-1.10.0/googletest/src/gtest_main.cc
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from DOA
[ RUN      ] DOA.gtestAlive
[       OK ] DOA.gtestAlive (0 ms)
[----------] 1 test from DOA (0 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test suite ran. (4 ms total)
[  PASSED  ] 1 test.
```

Feel free to clone [hongping/cpp_template](https://github.com/hongping/cpp_template) and use this for your future project!
Stream 10/22/2019 - Upgrading Rails 6 is ...
Tags: devjournal, todayilearned, blog
Published: 2019-10-23 05:18:52

### Check Out the Stream @ [https://twitch.tv/talk2megooseman](https://twitch.tv/talk2megooseman)

Today's stream theme was to upgrade all the things. Started by looking at updating Sidekiq but decided to do that off-stream since it's scary to do for me (lol). Then switch to the main task at hand, upgrade to Rails 6. 

I identified some gems that I can remove but there is a couples gems that looks like that will give me trouble. Check the notes for more details!

# Today Objective

- [ ]  What to call today's log
- [x]  Review last streams TODOs
- [x]  Continue figuring safest route to updates Sidekiq to v6
    - [x]  Going to punt this work to later date
- [x]  Look into to upgrading to Rails 6

# Notes

- Came across the following warning in Visual Studio Code `Visual Studio Code is unable to watch for file changes in this large workspace`
    - Recommended solution for this was linked in the warning: [https://code.visualstudio.com/docs/setup/linux#_visual-studio-code-is-unable-to-watch-for-file-changes-in-this-large-workspace-error-enospc](https://code.visualstudio.com/docs/setup/linux#_visual-studio-code-is-unable-to-watch-for-file-changes-in-this-large-workspace-error-enospc)
- Sidekiq upgrade to v6 is going to be a little more involved then I like for doing on stream since its an update to how sidekiq gets launched. I will feel more comfortable doing this off stream in case I break something
- Upgrading to Rails 6
    - Offical guide on Rails site [https://edgeguides.rubyonrails.org/upgrading_ruby_on_rails.html](https://edgeguides.rubyonrails.org/upgrading_ruby_on_rails.html)
    - Going through removed a couple gems that weren't compatible and were of low value:
        - `guard-rspec`
        - `guard-rubocop`
        - `rails-controller-testing`
        - `isolator`
    - Gems that were version bumped so far:
        - `rspec-rails`
    - `haml-rails` gem might be an issue, moved to use just `haml` gem but getting the following error
        - NameError: undefined method `content_tag` for class ActionView::Helpers::InstanceTag
    - Identified the `talk_like_a_pirate` is not compatible with the `active_support` 6 so going to have to fork it and do a pull request to make it compatible
        - Forked the repo and created a pull request to update dependencies with tests [https://github.com/stevehodges/talk_like_a_pirate/pull/6](https://github.com/stevehodges/talk_like_a_pirate/pull/6)

# Shoutouts and Thanks

- SudoKid
    - Thanks for the RAID!!!
- mbcrump
    - Thanks for the 350 + 35 bits (cause the terminator promo)!!!!

# Future action items

- [ ]  Continue upgrading to Rails 6. There were some gems that still need to work through to ensure everything still works
- [ ]  Keep on eye on this pull request: [https://github.com/stevehodges/talk_like_a_pirate/pull/6](https://github.com/stevehodges/talk_like_a_pirate/pull/6)
Adding Multiple Language PDF with Product in PDF catalog/ manual / brochure for Opencart
Tags: opencartpdfcatalogextension, pdfcatalogforopencart, opencartproductcatalog, opencartproductmanual
Published: 2019-10-23 05:04:27

Product PDF catalog extension for Opencart allows you to associate multiple pdf files for each product on the Product Description page while giving a custom name to each of the uploaded pdf files. It can be used for many purposes like attaching a user manual or catalog for products. It can be also used to add pdf in multiple languages. I mean to say if your website has multiple languages then you can add different pdf with a different language. Opencart PDF catalog extension is comfortable with mostly Opencart supported themes. It can be very useful to attract customers to buy your product. With the help of product pdf, customers easy to understand about the product. By using a PDF catalog/manual/brochure for Opencart extension you can very easy to upload and manage product pdf with multi-language. Opencart product catalog extension supported all 2x and 3x versions.

How to add Multiple Language PDF

First of all, you can install the Product PDF extension with the help of the opencart product manual user guide. PDF extension user guide is to provide very simple steps to install the Product PDF extension. After successfully installed, refresh modification and clear cache.
Thereafter go to the Catalog menu and click on the product s option. After click you will reach on the products list page, here you can select the product and click on the edit button to edit the existing product or click on the add button to add a new product.

After that, you will reach on the product form page here fill all required detail for a new product or edit require detail for an existing product and for upload product PDF go to PDF tab and click on it here you can add multiple pdf with all exist language. For add, first of all, you can select PDF using the browse button after that gives PDF name and shorting order. Thereafter click on the save button. After clicking on save button product PDF save successfully.

For view uploaded PFD go to website front side and open product detail page PDF show according to website language. All PDF show with a name. in the product detail. For Download and view PDF click on PDF icon.


Get This Extension At: https://www.purpletreesoftware.com/opencart-pdf-catalog-manual-brochure-download-for-products.html
Stateful Serverless with Durable Functions
Tags: serverless, azurefunctions, techtalks, azure
Published: 2019-10-23 22:46:56

---
title: Stateful Serverless with Durable Functions
published: true
date: 2019-10-23 05:00:50 UTC
tags: serverless,azure-functions,techtalks,azure
canonical_url: https://www.aaron-powell.com/posts/2019-10-23-stateless-serverless-with-durable-functions/
---

In August I was lucky enough to be invited to speak at [Serverless Days Melbourne](https://www.serverlessdays.me/) on the topic of Durable Functions and handling state across functions.

If you want to check out the talk, the video is online.

{% youtube pqrrVIWCk6w %}

[Durable Functions docs](https://docs.microsoft.com/en-gb/azure/azure-functions/durable/durable-functions-preview?WT.mc_id=devto-blog-aapowell)
Outsourcing Your Web/App Services to Vietnam with Peconi Technology
Tags: freelancers, software, outsource, fullstack
Published: 2019-10-23 04:43:41

We are Peconi Technology - a software solutions company operated since 2015 in Vietnam, with an office in Singapore.

We are seasoned technologists with more than 10 years working in the tech industry and we have expertise in the most popular technologies (React Native, React.js, PHP, Vue.js, Node.js, Angular, Java, Solidity).

We focused mainly on developing products for startups and entrepreneurs with more than 10 published on production and some under the deployment process over the last 2 years. We still have the flexibility in hiring contract developers ranging from a few weeks to months and they can start within very short delays. Please find our portfolio and technologies via https://peconi.tech

Our resources can join your projects with a very short delay after finish the recruitment process, feel free to contact me here or via my email (louis.vo@peconi.tech) if you have any questions.
Simple Input Mask
Tags: javascript, input, form, data
Published: 2019-10-23 04:32:44

---
title: Simple Input Mask
published: true
description: An input mask, for credit cards, phone numbers, etc
tags: javascript, input, form, data
cover_image: https://thepracticaldev.s3.amazonaws.com/i/uxyis3mqdlb1p58dlnkh.PNG
---
An input mask will format an input value to better represent the data.

- credit card: `4455-4455-1234-1234`
- SSN: `123-12-1234`
- phone number (NA): `123-123-1234`

First, extract the pattern by finding the indexes of the spaces.
```js
function getPattern(pattern) {
    dashIdxs = [];

    pattern.split("").forEach((char, idx) => {
        if (char !== "-") {
            return;
        }

        dashIdxs.push(idx);
    });

    return dashIdxs;
}
```
Two additional functions as handlers for `oninput` and `keydown` events. `value` is the our masked value.
```js
function onkeydown({ key }) {
    if (key === "Backspace" && dashIdxs.includes(value.length - 1)) {
        value = value.slice(0, -1);
    }
}

function oninput({ currentTarget }) {
    value = currentTarget.value;

    if (dashIdxs.includes(value.length)) {
        value += "-";
    }
}
```
A working example built with [Mithril.js](https://mithril.js.org/).
{% codepen https://codepen.io/kevinkace/pen/ZEzrLNP default-tab=result %}
This is a pretty trivial implementation, and not production ready. It would at least need to support copy/paste.

---

cover image: @theonlynoonan - https://unsplash.com/photos/QM_LE41VJJ4
Chatbot development using deep learning and seq2seq
Tags: tutorial, chatbot, machinelearning
Published: 2019-10-23 03:59:13

Hi Everyone,

Hope you're doing well and having a great day/night.
So, recently I built my first application using Deep Learning & NLP and it was for a project for my subject of AI in college. I further wrote an article on it In medium explaining the process. Basically, I want to always share what I learn or do. So, I wanted feedbacks as in is the post good is there anything I can do to improve it? Link is provided below. Thank you so much in advance if you take out time to read and review it!

“Chatbot Development using Deep Learning & NLP implementing Seq2Seq Model” by Aditya Kumar https://link.medium.com/vHOW3gCH00
Learning to build an app with RESTful API
Tags: productivity
Published: 2019-10-23 02:53:31

I'm using Quire (a project management software) and since they rolled out their [APIs](https://quire.io/blog/p/Create-Your-Quire-App-with-Quire-API.html), I'm learning on how to build an app with the API. 

That's my goal for these last 3 months before we get to 2020 - build a complete app with RESTful API! I've encountered a lot troubles but hopefully I'll finish my very first app by December!
Display the ASCII table in JavaScript
Tags: javascript, ascii
Published: 2019-10-23 01:34:50

Even in the current Unicode environment, ASCII still plays a huge role in understanding computer coding systems.

With only a few lines of JavaScript code, you can display yourself all the printable ASCII characters:

```
for(var code = 32; code < 127; code++)
{
    var chr = String.fromCharCode(code);

    var line = chr + "\t" + code + "\t" + code.toString(16).toUpperCase();
    console.log(line);
}
```

Just copy the above code in an online playground and see the result.

Note: If you are using the playground from [codeguppy.com](https://codeguppy.com) replace `console.log` with `println`
Help me to learn
Tags: javascript, react, testing, graphql
Published: 2019-10-23 01:04:57

Hi, I'm Gabriel and I started to work as a frontend developer about 10 months ago. I'm working mainly with React and I learned a lot of stuff since the beginning of this journey. I work in a software house located in Pelotas, Brazil. I've been using and learning Javascript, React, Redux, CSS-IN-JS and some beginner-friendly backend stuff. I feel comfortable with those, even knowing that I have a lot to learn and that is the purpose of this post.

I agree with the statement that we should learn more in public, show to other people the process and get helped by people who already have been in that situation. Having said that, I want to start a series of posts of my learning in public thing. Those are the points that I want to focus on: 

 - Testing (I never did that and I see how important it is).
 - Typescript (If we can reduce problems with types, why we shouldn't?).
 - Graphql (As a main frontend developer, I have suffered a lot with under fetch and over fetch data in the applications I worked).
 - React Native (I'm already working with some small apps, but never started a project from scratch).
 - Relay Modern (This one I can't see all the advantages yet, but I got really impressed by this: https://developers.facebook.com/videos/2019/building-the-new-facebookcom-with-react-graphql-and-relay/).


How should I start and what should I build? Thanks if you read until this point and be my mentor! For the beginners as I am, let's go build something nice together! 

https://twitter.com/docoutosantoss
https://github.com/gabrieldocouto
Browser Sync Permissions Issue
Tags: npm, node, browsersync
Published: 2019-10-23 00:42:52

When Downloading Node.js

How frustrating. Downloading and implementing programs these days take as much time as it does to write a complex code block. When downloading Node.js to install Browser Sync, a live reload application, I ran into a permissions issue. If you’re having trouble installing Browser Sync read on.

1. Download Node.js
on Browser Sync’s homepage, they have a “Get Started” button on the first third of the page, which will lead you to the download page for your operating system.

2. Install Browser Sync
The node package manager (npm) installs Browser Sync. Render the terminal and paste the following command.

npm install -g browser-sync

So Browser sync didn’t install?

If you have an EACCESS message, you may not be able to install the package because you’re not an authorized user. How-To Geek has a step-by step-guide on how to enable the root user.

When installing as the root user, you should be succesfull, however, I was not when I switched over to my regular user account. I still had the following permissions issue when running the browser sync command.

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/browser-sync

To fix this, change the global install directory using the npm config command below.

mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
export PATH=~/.npm-global/bin:$PATH
That Should do it 🙂

3. Start Browser Sync
Run a command to see where you are in the terminal, like “whoami” (displays username of the current user) or “cd” (changes the directory you are in) to adjust the following to lead to a directory in which you have an “index.html” file.

browser-sync start --server --files "css/*.css"

I hope this helps! More information can be found on Github here: http://npm.github.io/installation-setup-docs/installing/a-note-on-permissions.html
Massive with Björn Lindberg
Tags: massiveentertainmen, gaming, thedivision2
Published: 2019-11-07 19:56:28

---
title: Massive with Björn Lindberg
published: true
date: 2019-10-23 00:00:00 UTC
tags: Massive Entertainmen,Gaming,The Division 2
canonical_url: https://www.gcppodcast.com/post/episode-200-massive-with-bjorn-lindberg/
---

We’re sad to say goodbye to [Mark Mandel](https://twitter.com/Neurotic) this week but excited to bring you an interview he and guest host [Robert Martin](https://twitter.com/cloudrobx) did with Björn Lindberg of [Massive Entertainment](https://www.massive.se/). The gaming studio is located in Sweden and owned by Ubisoft. Their most recent game, [The Division 2](https://tomclancy-thedivision.ubisoft.com/game/en-us/home), is a “looter shooter” game that was released in March. It can be played solo or users can be matched up to play with or against others.

To keep the game running smoothly, Massive employs a micro-service architecture to divide and conquer the trials of creating and running such a large, intense game. The Division 2 was launched with Google Cloud, a process Björn says was a bit easier than launching on physical hardware. Autoscaling in the cloud has created a simpler, more trustworthy gaming process as well, and by connecting to data centers in multiple regions, they’re able to decrease latency.

##### Björn Lindberg

Björn Lindberg is working as On-Line technical director at Massive Entertainment a Ubisoft owned and operated game studio in Malmö Sweden. He does design and implementation of on-line backend systems for large AAA on-line games such as The Division series of games and World in Conflict.

##### Interview

- Massive Entertainment [site](https://www.massive.se/)
- The Division 2 [site](https://tomclancy-thedivision.ubisoft.com/game/en-us/home)
- Ubisoft [site](https://www.ubisoft.com)
- Terraform [site](https://www.terraform.io)
- Grafana [site](https://grafana.com)
- Compute Engine [site](https://cloud.google.com/compute/)

##### Thank You Mark!

Thank you Mark for everything you’ve done to make this podcast a success! We’ll miss you!

 ![](http://feeds.feedburner.com/~r/GcpPodcast/~4/iXvoXSFrObQ)
Newton Method and recursion ?
Tags: recursion, newtonmethod, python
Published: 2019-10-23 00:05:03

So I am working on a small python program to run a Newton method recursion!

hers is my code

def newton(a,b):
   return newton(a-((a**2 - b )/2*a))


but when I call it

print(newton( 5,27))

I always get this error

"PS C:\Users\Dell\Desktop\pythonstuff\MathPython> python newton.py
Traceback (most recent call last):
  File "newton.py", line 23, in <module>
    print(newton( 5,27))
  File "newton.py", line 11, in newton
    return newton(a-((a**2 - b )/2*a))
TypeError: newton() missing 1 required positional argument: 'b'"
Day 17 : If You Ask Me
Tags: hiphop, code, coding, lifelongdev
Published: 2019-10-22 23:41:38

_liner notes_:
- Professional : Got to have a chat with a coworker. I'm working with some really smart people if you ask me. I'm going to be learning as much as I can from everyone. Also sat in on a session explaining our healthcare options and plans. After that, I went over my Use Case write up again and refactored my code to use all async/await with try/catch. The code got a lot shorter and more readable in my opinion.

- Personal : So.... the reviews started coming out for the GoPro Max... and I get paid this week....hmmmm. haha But yeah, all the footage I'm seeing is getting the wheels turning in my mind about the possibilities. Going to go over some tracks for this week's radio show and look over some coding side projects.

![Night shot of Norway](https://thepracticaldev.s3.amazonaws.com/i/qtphqxgjjwev7r28jn2n.jpg)

Tomorrow I want to split out some of the elements in my Application into their own components. Thinking I'm going to need to use React's useContext. We'll see. After work, I want to go through some more tracks for the radio show.

Have a great day!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube A9Awp7USivU %}
Android errors
Tags: android, java, git, slackheros
Published: 2019-10-22 23:12:56

Please don't be like me:

```    // a constructor which initializes items, prices, and descriptions
    public ItemAdapter(Context, c, String[] i, String[] p, String[] d ) {
        items = i;
        prices = p;
        descriptions = d;
        // initialize LayoutInflater
        mInflater = (LayoutInflater) c.getSystemService(Context.LAYOUT_INFLATER_SERVICE);```

This error took days to get figured out because I couldn't call getSystemServices() on the context. Thankfully there is an Android slack where I was able to get help and continue on with my project. Here is the error free code:

```    // a constructor which initializes items, prices, and descriptions
    public ItemAdapter(Context c, String[] i, String[] p, String[] d ) {
        items = i;
        prices = p;
        descriptions = d;
        // initialize LayoutInflater
        mInflater = (LayoutInflater) c.getSystemService(Context.LAYOUT_INFLATER_SERVICE);```

Forget about forgetting semicolons, all it takes is a comma in Java or an apostrophe in xml to throw everything off. It's always the little things, the nuances. This project is still in development so check it out in a day or so to get the complete [source code](https://github.com/wesley-ruede/Android/tree/master/ListApp/app/src).

What is most funny about this project is that I made the most amatuer mistake. Forgetting to push when the project is still working and then breaking it can be detrimental and a big time waster. Today's big lesson is to always remember to push you code. Always. You don't want to be sad.

Also, if it weren't for Android Studio I would never have caught this error and just kept coding away. A big shout out to [Damien Diehl the Android Developer @ Twitch on Slack](https://app.slack.com/client/T04PLNDMP/C04PLNE0P/user_profile/U0546QERR) and Android Studio for keeping me moving. I was seconds from scrapping this project and he came to the rescue like a hero. I really like android development even over web development or data science. This might just be my neeche.
Graphics advice for a dev?
Tags: design, explainlikeimfive, discuss
Published: 2019-10-22 23:02:46

I want to learn how to edit PSD/AI (Photoshop/Adobe Illustrator) files, but have no background in design. I am a software engineer who can break stuff and abuse Google presentation for graphics, but I cannot make basic memes without either css or using those spammy MemeGenerators 😆 

What were your favorite resources, blog posts, videos to learn basic design? For smaller tasks, like changing text (keeping same font) or changing color in a certain layer, would GIMP be enough?