teleren/devto huggingface dataset:
Cumulocity IoT accelerators for Python SDK and Microservice templates
Tags: iot, python, microservices, opensource
Published: 2021-09-08 09:19:16

---
title: Cumulocity IoT accelerators for Python SDK and Microservice templates
published: true
date: 2021-01-20 20:00:00 UTC
tags: #iot, #python, #microservice, #opensource
canonical_url: https://tech.forums.softwareag.com/t/cumulocity-iot-accelerators-for-python-sdk-and-microservice-templates/238143
---

Accelerators are developed by our teams to help speed-up development time for solutions built on the Cumulocity platform. Built on best practices, re-usable assets aid in the implementation of projects, giving you quicker time to value and making it easier to build your solution.

In this set, you can find re-usable assets for:

- Python SDK
- Microservice Templates

Read more at the following links:

<h3><a href="https://github.com/SoftwareAG/cumulocity-python-api" target="_blank" rel="noopener">SoftwareAG/cumulocity-python-api</a></h3>

  <p><span>Python client for the Cumulocity REST API. Contribute to SoftwareAG/cumulocity-python-api development by creating an account on GitHub.</span></p>

<h3><a href="https://github.com/SoftwareAG/cumulocity-microservice-templates" target="_blank" rel="noopener">SoftwareAG/cumulocity-microservice-templates</a></h3>

  <p><span>Collection of templates / examples to give the developer a starting point how common features can be solved by using Cumulocity Microservice SDK for Java. - SoftwareAG/cumulocity-microservice-templ...</span></p>

<h3><a href="https://github.com/SoftwareAG/analytics-builder-blocks-contrib" target="_blank" rel="noopener">SoftwareAG/analytics-builder-blocks-contrib</a></h3>

  <p><span>Unsupported, not productized blocks for use with Apama Analytics Builder</span></p>

<h3><a href="https://github.com/SoftwareAG/cumulocity-migration-tool" target="_blank" rel="noopener">SoftwareAG/cumulocity-migration-tool</a></h3>

  <p><span>A Cumulocity webapp to migrate applications, dashboards, groups, devices, simulators, smart rules, images, and managed objects between tenants</span></p>


<h3><a href="https://github.com/SoftwareAG/cumulocity-app-builder" target="_blank" rel="noopener">SoftwareAG/cumulocity-app-builder</a></h3>

  <p><span>Application builder for Cumulocity. Simple way to combine dashboards into a full web application with no coding.</span></p>


[Read full topic](https://tech.forums.softwareag.com/t/cumulocity-iot-accelerators-for-python-sdk-and-microservice-templates/238143)
ARPP !
Tags: cpp, arduino, github, iot
Published: 2021-01-20 19:54:27

# Hey !

<hr>

> ARPP : **A**rduino **R**FID **P**IR **P**roject

I'm **Amir** and started a new **Arduino** Project . **ARPP** means : **A**rduino **R**FID **P**IR **P**roject .
In this project we use **RFID** and **PIR** sensor for **Arduino** to make a strong security system for small places .
You use **RFID** to activate or deactivate system . If system is active , **PIR** send data from environment to **Arduino** and if data is True , alarm will play so loud ! but if system is deactivated **PIR** won't do anything .

<hr>

All in all , It is a good simple project . You can see the code in <a href="https://github.com/BlackIQ/ARPP"><b>Github</b></a> .

<hr>

### You can use it so easy

```
cd ~
git clone https://github.com/BlackIQ/ARPP
cd ARPP
```
Then deploy in on your Arduino .

<hr>

I'll make a video to say what you need and how does the code works .

**TNX** for reading .

**Amir** .
How do I get a post by slug in a Next.js app using GraphQL?
Tags: help
Published: 2021-01-20 19:54:21

# The setup

I have a KeystoneJS headless CMS providing my API and I have a Next.js app for the client. In index.js I have successfully managed to return a list of posts, but I want to get the post from the API using its slug using a URL like `/lingo/[slug].js`.

I am using Apollo Client to talk to the API.

# What I've tried

I have an `apolloClient.js` file in `_utils` with the following code:
```
import { ApolloClient, InMemoryCache } from "@apollo/client";

export default new ApolloClient({
  uri: "http://localhost:3000/admin/api",
  cache: new InMemoryCache(),
});
```
In `_services/lingo.service.js` I have 2 queries. The first works to return the list of posts, but the second returns `Error: Response not successful: Received status code 400` and I can't figure out why?

The `lingo.service.js` code is:
```
import { gql } from "@apollo/client";
import apolloClient from "../_utils/apolloClient";

export async function getAll() {
  return apolloClient
    .query({
      query: gql`
        query {
          allTerms {
            id
            term
            slug
          }
        }
      `,
    })
    .then((result) => result.data.allTerms);
}

export async function getBySlug(slug) {
  return apolloClient
    .query({
      query: gql`
        query {
          Term(where: { slug: $slug }) {
            term
            lead
          }
        }
      `,
    })
    .then((result) => {
      console.log(result.data);
      return result.data.Term;
    });
}
```
And finally, in `lingo/[slug].js` I have:
```
import Head from "next/head";
import { ApolloClient, InMemoryCache, gql } from "@apollo/client";
import { getAll, getBySlug } from "../../_services/lingo.service";

export default function Term({ term }) {
  return (
    <div>
      <Head>
        <title>Launchpad</title>
        <link rel="icon" href="/favicon.ico" />
      </Head>
      <main>
        <h1>{term.term}</h1>
      </main>
      <footer>
        <p>{term.lead}</p>
      </footer>
    </div>
  );
}

export async function getStaticPaths() {
  const lingo = await getAll();

  const paths = lingo.map((term) => ({
    params: { id: term.slug },
  }));

  return { paths, fallback: false };
}

export async function getStaticProps({ params }) {
  const term = await getBySlug(params.id);

  return { props: { term } };
}
```
Where am I going wrong?
Day 4: Area under the ROC
Tags: machinelearning, python, datascience, 100daysofcode
Published: 2021-01-20 19:42:53

I actually did this yesterday, but I forgot to post.
![House saying oops](https://thumbs.gfycat.com/CrispFirstAurochs.webp)
Anyway, building on day 3's work on ROC today was all about how to quantify how good a model is. That's where the area under the curve (or AUC) comes in. This will then give you a value. The bigger the value is the better your model.

# The code
Once you've got your model (any model), split it into your train and test, then have it making predictions. Then you need to import the AUC and you can run it.
`from sklearn.metrics import roc_auc_score
roc_auc_score(y_test, y_pred_prob)`

![Super easy thing to do](https://thumbs.gfycat.com/FreeCrispAmericanratsnake.webp)
New platform, who dis?
Tags: firstpost, javascript
Published: 2021-01-20 19:39:55

I've decided it's time for me to start writing again, and I've been really impressed by the dev.to platform for some time now. A certain platform that starts with M and rhymes with tedium has become far too interested in profit and as a result is making life kinda miserable for content creators and consumers.

So, a little introduction to me: I'm a front-end web developer currently working for [TCN, Inc.](https://tcn.com) until 2/1/21 when I will be joining [Chatbooks](https://chatbooks.com) as their new front-end web lead. I'm very excited to be joining Chatbooks and helping them expand their e-commerce presence on the web!

I love all things front-end development (except AngularJS) but I especially enjoy working with ReactJS, playing with various CSS libraries (Tailwind, Bulma, etc.) and trying to improve both the user experience and the developer experience.

On occasion, I get down in the weeds with tooling for developers (like making the perfect shell interface or building cool build tools), but generally, I just like making fun UIs. My first real contentful post will likely be an updated version of "What I Use" as far as terminals, shells, etc.

For now though, #firstpost is done and I look forward to challenging myself to write weekly.
Trying to Be a Good Friend to Myself as a Junior Developer
Tags: devjournal, career, webdev, codenewbie
Published: 2021-01-20 19:27:40

_This post was originally published on January 20, 2021 on [my blog] (https://alexlsalt.github.io/blog)._

Friends, I'm in my third week at my new job as a junior software engineer and it still feels great! But I'm having one internal issue, not altogether unexpectedly.

You see, I'm conscious of my brain trying to tell me that I'm not making progress as quickly as it thinks I should. It's so strange and I'm aware of thoughts throughout the day that make me feel like I'm underperforming and don't understand everything that I should.

But the minute I start to realize that, and especially when I ask myself "Would I treat a friend like this?" I start to come back to reality a little bit.

Like, of course freaking not! I'd never pat a friend on the shoulder and be like, "You know, you really should be comfortable with the entire codecase of a new organization, and have successfully learned a new programming language (Ruby) and architecture (Rails) in a matter of two and a half weeks. There, there."

That would be insane! And now as I'm writing this all out, I'm kind of laughing at myself and getting back to reality.

I had a great chat with a teammate yesterday who definitely also helped pull me back down to the ground and reminded me not to be too hard on myself.

Why do we do this to ourselves? I wish the default thinking could always be positive and erring on the side of reassurance, but that's just how it is.

In other news, I received my new work laptop yesterday! Excited to get my local set-up up and running (round twooo!) again. I'll probabl spend a good amount of time on that today, and then I'm also in the midst of doing an interesting (everything is interesting right now!) refactor with another teammate.

The thing to remember is that even if we're not feeling like we're making progress on a daily basis, that daily work will be compounded over time. When I take a moment to actually recognize the progress I'm making every single day (instead of irrationally putting myself down), I'm already leaps and bounds ahead of where I was when I started.


-------

P.S. I send weekly newsletters about the self-taught coding journey and my own coding adventures (and misadventures!)  [Sign up here! >>](https://ladies-code-collective.ck.page/e53b5fca44)
Saving Creative Work for the Weekends
Tags: devjournal, career, sideprojects, webde
Published: 2021-01-20 19:26:13

_This post was originally published on January 18, 2021 on [my blog] (https://alexlsalt.github.io/blog)._

It's Monday and I'm ready for another great week!

I spent the weekend resting and relaxing, overall. We went for a lovely walk out in the countryside on Saturday, which I always love to do. I also worked a little bit on some creative projects I have going on at the moment.

Actually, it's been really interesting because I've been having to push working on said creative projects over the weekends because I've been trying to conserve as much mental energy as I can for my job.

When I give myself that weekend-constraint, I feel this awesome sense of anticipation and excitement for digging in to the projects instead of feeling otherwise overwhelmed if I were to be pushing myself to do everything every single day.

Also, we had our weekly sync with our cohort of this round of The Collab Lab (an *amazing* organization with teams mentoring early-career developers - [check it out!](https://the-collab-lab.codes/)).

Seriously, every single time I get off a call with my team, I feel so motivated and inspired by the work our devs are doing and the overall dynamic.

It's an amazing way to round out the weekend in preparation for a week of great work.

Here's to a productive week full of inspired work!

-------

P.S. I send weekly newsletters about the self-taught coding journey and my own coding adventures (and misadventures!)  [Sign up here! >>](https://ladies-code-collective.ck.page/e53b5fca44)
Clearing your Unix Terminal and other commands using Go scripts
Tags: todayilearned, go, shell, cmd
Published: 2021-01-20 19:12:12

---
title: Clearing your Unix Terminal and other commands using Go scripts
published: true
description: 
tags: todayilearned, go, shell, cmd
//cover_image: https://direct_url_to_image.jpg
---
When you want to run shell commands, like for example clearing the terminal, from a Go program or script this is how you can do:

```go
cmdName := "clear"
cmd := exec.Command(cmdName)
cmd.Stdout = os.Stdout
cmd.Run()
```

It's important to add the `cmd.Stdout = os.Stdout` line (you can replace `os.Stdout` with any `io.Writer` variable) if you want the output of the command to appear somewhere. This is not necessary however if the command does not output anything.

Launching commands in the terminal is always a useful tool, and very welcome in a Go script. To see it in action, I prepared a fun example of a checkerboard that randomly increases a cell value and prints the equivalent number in _Japanese_ (from 0 to 3).

```go
package main

import (
	"fmt"
	"math/rand"
	"os"
	"os/exec"
	"strings"
	"time"
)

func main() {
	h, l := 8, 8
	board := make([]uint8, h * l)
	for i := 0; i < 120; i++ {
		clear()
		cellFlip(rand.Intn(len(board)), board)
		fmt.Println(plotted(l, board))
		time.Sleep(400 * time.Millisecond)
	}
}

func clear() {
	cmd := exec.Command("clear")
	cmd.Stdout = os.Stdout
	cmd.Run()
}

func cellFlip(i int, b []uint8) {
	if b[i] >= 3 {
		return
	}
	b[i]++
}

func plotted(l int, b []uint8) string {
	var s strings.Builder
	s.Grow(len(b) + l)
	for i, cell := range b {
		s.WriteRune(toRune(cell))
		if i%l != l-1 {
			continue
		}
		s.WriteRune('\n')
	}
	return s.String()
}

func toRune(cell uint8) rune {
	var c rune
	switch cell {
	case 0:
		c = 0x53E3
	case 1:
		c = 0x4E00
	case 2:
		c = 0x4E8C
	case 3:
		c = 0x4E09
	default:
		c = 'x'
	}
	return c
}
```

0x53E3, 0x4E00, 0x4E8C and 0x4E09 are the codes for 口 (ro which is coming from ゼロ/zero), 一 (ichi) , 二 (ni) and 三 (san) that are the first three numbers in Japanese whose codes are referenced from the Unicode and that can be consulted [here](https://www.unicode.org/charts/).

Please also refer to the  `os/exec' [package](https://golang.org/pkg/os/exec/) to know more about how to launch commands.
The Need to log
Tags: graph, myfirstcode
Published: 2021-01-20 18:44:33

## And so it begins

Once I became **serious** about coding, I **never expected** to be blogging about it and yet here we are... Tbh I have **no clue** what to think of it for now. However it does feel good, like some sort of driving force, a commitment, not only to learn to code but also to show my **coding journey**. Anyway I'll try my best to keep up with post and discuss the things that I learn. If not for nothing else it will be a nice documentation of my evolution as a developer. 

Starting off I'll give a brief overview about my coding experiences so far. I only recently realised that I first started coding once I was on high-school about 20 years ago. it was coding alright but not with the purest of intentions... My first coding experience was coding little cheatsheets in to my old TI-82 Graphing Calculator. Not only was this a task that took longer than to actually study for my test it also turned out to be useless as we weren't allowed to use our own calculator.

My next encounter with coding came many years later when I got the question to make a website for one of my friends. it was a very simple website more like an online business card with out much actual code other than a button that revealed an email address.

Now we have come to my most recent coding episode, the one where I decided to actually systematically learn to code, the episode I find myself in today. It started about 6 weeks ago or so when I was in lockdown (original I know...). I've been low key learning to code for the past year using sites like freecodecamp.com and watching YouTube tutorials. But now I felt I really wanted to go for it and I bought myself a subscription on Scrimba.

I'm currently enrolled in the front end career-path and I'm about half way. I love the way it teaches with an interactive way of typing code. It is nice to have a solid base and a solid path to follow because otherwise it can be overwhelming to know where ant what to learn. I'll be keeping you updated on what I learn and my progress.

Thanks for reading and till next post,

Bart
The Worst Server-Side Rendering Pipeline
Tags: jokes, ssr
Published: 2021-01-20 18:36:06

> This post is originally published on yoursunny.com blog https://yoursunny.com/t/2021/worst-ssr/

My server side rendering pipeline:
I use nginx to invoke PHP to invoke Node.js to invoke Puppeteer to invoke Chromium.
Client side receives a screenshot of the webpage.
They can never steal my super secret HTML and JavaScript code again.

## How to have hyperlinks?

If the whole webpage is a screenshot picture, how to have hyperlinks you ask?

```html
<A HREF=browse.php>
  <IMG SRC=page.bmp WIDTH=640 HEIGHT=480 ISMAP>
</A>
```

The [`ISMAP` attribute](https://www.tutorialspoint.com/html/using_html_ismap.htm) creates a server-side image map.
You click anywhere and the server receives coordinates, like this:

```http
GET /browse.php?10,27 HTTP/1.1
Host: ssr.example.com
```

## Want a mobile site?

Sure.

I can use Selenium to control an Android emulator.
The screencast is streamed as MJPEG straight to your device!
Bandwidth consumption isn't a problem.
This is what 5G is for.

## I'm concerned with accessibility

We are fully ADA compliant.

There's a 800 phone number on the page in text format.
Blind personnel can call this number to speak to a live operator, who would read the page to them.
This is a friendlier service than Text-To-Speech systems.

User can interact with the page by spoken or keypad commands.
That's web browsing without a computer screen.

## Why are you trying to keep the HTML and JavaScript "super secret"?

I'm too ashamed to let others find out that the page is made with Microsoft FrontPage Express and Flash and ASP and jQuery, so it has to be kept secret.

---

## What others are saying

[@\_cluxter\_ on Twitter](https://twitter.com/_cluxter_/status/1316366844530438146):
You do realize that it's just a matter of time before someone really consider this as something cool and next gen and implements it?

[@ropsue on Twitter](https://twitter.com/ropsue/status/1317429281786646529):
oh, perfect! And as an additional benefit we can go BACK to pixel perfect cross browser requirements

[@dadaistoven on Twitter](https://twitter.com/dadaistoven/status/1316439474516242432):
This is sheer genius

[@\_skris on Twitter](https://twitter.com/_skris/status/1316468471396352000):
I was there. I was there when it all began.
\*before someone creates this framework/engine for real\*

[@anirbanroy2002 on Twitter](https://twitter.com/anirbanroy2002/status/1316519662256091136):
Then search engines like Google will have to depend on Optical Character Recognition to index and rank pages!

[Peyton McGinnis](https://dev.to/sergix/comment/19egk) (@sergix):
This is probably the most over-engineered backend stack I've ever heard of.

[Ilya Buligin](https://dev.to/ilyabuligin/comment/187dd) (@ilyabuligin):
Can you show me this site? It's sound amazing :D

[Madza](https://dev.to/madza/comment/19fpe) (@Madza):
Hahah, made my day 🤣🤣👍
Designers Suffer From Bounded Rationality
Tags: boundedrationality, uidesigners
Published: 2021-01-20 18:29:52

When your new designs start looking similar to ones that you’ve seen or made earlier, your design process is suffering from Bounded Rationality. You need to make an effort to change it.

While designing a new product, a designer is likely to apply functions, features, layouts etc. similar to the products that they have already designed or seen. To avoid this, you should first take time to design the known concepts quickly. You should then use the creative process to start again from scratch and design with a fresh mind. When you understand the users deeply and let the design flow based on the user understanding & process, you’ll no longer be bound by the already known concepts or bounded rationality.

Example:

While designing a new social media application, most designers would draw concepts from existing social media apps. This will not be a completely creative design, unless designers start thinking fresh.

This content was originally published on: https://www.userfacet.com/designers-suffer-bounded-rationality
Javascript : types of functions
Tags: javascript
Published: 2021-01-20 18:28:09

**Function statements**

// Allows hoisting
```
function test(){
   console.log("function statements");
};
test();
```

**Function expressions**

// Doesnot allow hoisting

```
var a = function (){
   console.log(function expression);
};
a();
```

**Named function expressions**
```
var a = function test(){
   console.log("named function expressions");
};
a();
```

**Function declaration**
```
function test() {
   console.log("function declaration");
};
test();
```

**Anonymous function**
```
var x = (){
};
x();
```

**First class function**

// Ability to pass as argument and return functions as value
```
var x = function test(abc){
  console.log(abc);
  return function a(){
  };
};
x(function () {};);
```

**Arrow functions**
```
var x = () => console.log("Arrow functions");
```

**Generator functions**
```
function* square(a){
   for(let x=a;; x*=a){ 
      yield x;
      }
};

for(let z of square(2)){
    console.log(z);
}
```

**new Function**

// Allows to convert string to function useful to handle server return codes.
```
var a = new Function ('a','b', 'return a+b');
console.log( sum(3,6));
```
Userfacet Named Amongst India’s Top UX Companies!
Tags: topuxcompanies, userfacet
Published: 2021-01-20 18:19:37

Here at Userfacet, we’ve excelled at offering innovative and memorable User Experience (UX) and Software Development for over a decade.

We pride ourselves on our ability to solve complex business and user experience challenges across domains in the enterprise and consumer world. Through our skilled UI/UX design team and our novel usability strategies, we can help any business reach new heights quickly. With UI/UX design becoming more important than ever in our digital world, all businesses should be looking to receive a Userfacet approved upgrade.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/77pgandu7xti5n2yxoc4.png)

Today, we’re very excited to announce that we’ve been named one of the top companies on Clutch, a leading B2B ratings and reviews platform that helps companies the best firm for their next business challenge. Through their unique methodology of verified client feedback, Clutch has named us among the [best UI UX Design firms](https://www.userfacet.com/) in the world. We are extremely thankful to the clients who have taken the time to review our work and abilities as a partner on Clutch. To be eligible for a Clutch Leader Award, companies must demonstrate an unusually high ability to deliver through positive reviews and high ratings. Thanks to our clients, we currently have a perfect 5-star rating on Clutch!

“We are excited to have been chosen as one of the top User Experience (UX) companies in India” — Tanuj Shah CEO & Partner at Userfacet.

Check out one of our views from a previous client down below:

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

Our clients love us so much because we understand not only the user experience design but also how it integrates with complex technologies behind the scenes. So if you are looking to find a great way to improve your business, feel free to contact us as soon as possible! We’ve won our Clutch award for a reason, and we’d love to prove it to you.

Originally published at: https://www.userfacet.com/userfacet-India-top-ux-companies