teleren/devto huggingface dataset:
My Progress on Zulip's Issue
Published: 2021-12-07 20:23:30

---
series: Contributing to Zulip
---

> In preparing for battle I have always found that plans are useless, but planning is indispensable. - Dwight D. Eisenhower

Indeed my [initial approach](https://dev.to/oliverpham/initial-thoughts-on-a-zulips-issue-4job) to the [issue](https://github.com/zulip/zulip/issues/20267) wasn't a good one, but it was not useless. Discussing it with several Zulip members & contributors helped me come up with a neater one and complete a prototype. After some refinement, I finally made a [pull request](https://github.com/zulip/zulip/pull/20494) for the feature.

{% github https://github.com/zulip/zulip/pull/20494 %}

## What happened

A few hours after my messages were sent, I got some helpful feedback to my initial thoughts. Basically, I was advised to modify a more relevant, lower-level function, [`get_person_suggestions()`](https://github.com/zulip/zulip/blob/58438c362f2eb0d5cc300543b501dd5cda457f16/static/js/search_suggestion.js#L222). That should help me avoid breaking the existing features.

My first prototype for the feature looks like this:

![A list of users with their avatars](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/18hosww6fxgm2vank21a.png)

![A list of search descriptions with a user's avatar and name](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w1c8k5amiqyw4sxf6wj3.png)
 
It's really ugly, wasn't it? I was then advised to use an existing UI component, `user_pill`, to display a user's full name and avatar as a distinct block. Another refinement was to vertically align the text. I eventually implemented both, which significantly improved the design of my initial prototype.

![A list of users with their avatars in pill-shaped containers](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p971iaftettj8ngr3jbr.png)

![A list of search descriptions with a user's avatar and name in a pill-shaped container](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9mtqgdivyzje9r07ip46.png)
  

## What I've learnt

I should have made a draft/work-in-progress pull request early in my development process and improved on it iteratively. Keeping others posted of my prototype of the feature was a good idea, but I missed out another important deliverable: my nasty code. Working with an open source community means that I can get feedback for me code more easily, so I should've taken advantage of that.

## What's next

Hopefully, the maintainers will review my code soon. In the meantime, I probably need to fix some broken automation tests.

---
Cover photo by <a href="https://unsplash.com/@afgprogrammer?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Mohammad Rahmani</a> on <a href="https://unsplash.com/s/photos/coding?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>
Hello GA - Quick GitHub Actions
Tags: actionshackathon21
Published: 2021-12-07 20:15:46

### Gulp Runner

A GitHub Action template for people who create a lot of actions.

### Submission Category: 

DIY Deployments, Wacky Wildcards


### Link to Code

{% github 2KAbhishek/GA-Hello %}


### Additional Resources / Info
A simple gulp runner created with this.
{% github 2KAbhishek/gulp-runner %}

There are other forks around too.
Advent of Code - Day 7: Puzzle 2
Tags: java, adventofcode
Published: 2021-12-07 20:15:08

## Puzzle

--- Part Two ---

The crabs don't seem interested in your proposed solution. Perhaps you misunderstand crab engineering?

As it turns out, crab submarine engines don't burn fuel at a constant rate. Instead, each change of 1 step in horizontal position costs 1 more unit of fuel than the last: the first step costs 1, the second step costs 2, the third step costs 3, and so on.

As each crab moves, moving further becomes more expensive. This changes the best horizontal position to align them all on; in the example above, this becomes 5:

Move from 16 to 5: 66 fuel
Move from 1 to 5: 10 fuel
Move from 2 to 5: 6 fuel
Move from 0 to 5: 15 fuel
Move from 4 to 5: 1 fuel
Move from 2 to 5: 6 fuel
Move from 7 to 5: 3 fuel
Move from 1 to 5: 10 fuel
Move from 2 to 5: 6 fuel
Move from 14 to 5: 45 fuel
This costs a total of 168 fuel. This is the new cheapest possible outcome; the old alignment position (2) now costs 206 fuel instead.

Determine the horizontal position that the crabs can align to using the least fuel possible so they can make you an escape route! How much fuel must they spend to align to that position?*

## My solution
```java
package main;

import java.io.File;
import java.util.*;

public class Puzzle {

  public static int calculateSteps(int startIndex, int endIndex) {
    List<Integer> differences = new ArrayList<>();
    int subtotal = 0;

    for (int k = startIndex; k < endIndex; k++) {
      subtotal++;
      differences.add(subtotal);
    }
    return differences.stream().mapToInt(Integer::intValue).sum();
  }

  public static void main(String[] args) throws Exception {
    File input = new File("/Users/files/input.txt");
    Scanner scanner = new Scanner(input);

    List<Integer> numbers = new ArrayList<>();
    List<Integer> values = new ArrayList<>();

    while (scanner.hasNext()) {
      String[] arrayOfNumbers = scanner.nextLine().split(",");
      for (String number : arrayOfNumbers) {
        numbers.add(Integer.parseInt(number));
      }
    }

    int total = 0;
    for (int i = 0; i < numbers.size(); i++) {
      total = 0;
      for (Integer number : numbers) {

        if (i > number) {

          int sum = calculateSteps(number, i);
          total += sum;

        } else if (number > i) {

          int sum = calculateSteps(i, number);
          total += sum;
        }
      }
      values.add(total);
    }

    int minValue = Collections.min(values);

    System.out.println(minValue);
  }
}

```
_*Source: https://adventofcode.com/2021/day/7_
Advent of Code 2021 - Day 2 : Puzzle 2
Tags: java, adventofcode, programming
Published: 2021-12-07 20:12:48

## Puzzle

--- Part Two ---

Based on your calculations, the planned course doesn't seem to make any sense. You find the submarine manual and discover that the process is actually slightly more complicated.

In addition to horizontal position and depth, you'll also need to track a third value, aim, which also starts at 0. The commands also mean something entirely different than you first thought:

down X increases your aim by X units.
up X decreases your aim by X units.
forward X does two things:
It increases your horizontal position by X units.
It increases your depth by your aim multiplied by X.
Again note that since you're on a submarine, down and up do the opposite of what you might expect: "down" means aiming in the positive direction.

Now, the above example does something different:

forward 5 adds 5 to your horizontal position, a total of 5. Because your aim is 0, your depth does not change.
down 5 adds 5 to your aim, resulting in a value of 5.
forward 8 adds 8 to your horizontal position, a total of 13. Because your aim is 5, your depth increases by 8*5=40.
up 3 decreases your aim by 3, resulting in a value of 2.
down 8 adds 8 to your aim, resulting in a value of 10.
forward 2 adds 2 to your horizontal position, a total of 15. Because your aim is 10, your depth increases by 2*10=20 to a total of 60.
After following these new instructions, you would have a horizontal position of 15 and a depth of 60. (Multiplying these produces 900.)

Using this new interpretation of the commands, calculate the horizontal position and depth you would have after following the planned course. What do you get if you multiply your final horizontal position by your final depth?*



## My solution

```java
package main;

import java.io.File;
import java.util.*;

public class Puzzle {
  public static void main(String[] args) throws Exception {
    File input = new File("/Users/files/input.txt");
    Scanner scanner = new Scanner(input);

    int x = 0;
    int y = 0;
    int aim = 0;

    while (scanner.hasNextLine()) {
      String inputLine = scanner.nextLine();
      int number = Integer.parseInt(inputLine.substring(inputLine.length() - 1));
      if (inputLine.contains("forward")) {
        x += number;
        y += (aim * number);
      } else if (inputLine.contains("down")) aim += number;
      else aim -= number;
    }
    System.out.println(x * y);
  }
}

```

_Source: https://adventofcode.com/2021/day/2_
iNeural : A library for creating Artificial Neural Networks
Tags: machinelearning, deeplearning, cpp, python
Published: 2021-12-07 19:48:55


<img width="50!important" src="https://raw.githubusercontent.com/fkkarakurt/iNeural/master/iNeural.png">

iNeural, A library for creating Artificial Neural Networks, for use in Machine Learning and Deep Learning algorithms. 

I have passed the first stage of this artificial neural network library, where I use the Eigen 3 library extensively. I continue to develop the project. You can check it out on my [GitHub](https://github.com/fkkarakurt/iNeural) account.

I am preparing a very instructive and explanatory documentation that will explain the details of this project. Of course, I have a lot of updates to make, but I would like to point out that I will be releasing the API in the near future. Many tests with datasets such as [CIFAR10](https://www.cs.toronto.edu/~kriz/cifar.html), [IRIS](https://archive.ics.uci.edu/ml/datasets/iris) and [MNIST](http://yann.lecun.com/exdb/mnist/) were successful.

I would be very happy if you support this project and give stars. Great things will happen :)

Project Page => https://github.com/fkkarakurt/iNeural
5 Ways To Merge Arrays in JavaScript
Tags: javascript, tutorial, beginners, programming
Published: 2021-12-07 19:45:04

### First, Using Concat Method
 
```javascript
{

    let arr1 = [1, 2, 3];
    let arr2 = [4, 5, 6];

    let merged = [].concat(arr1, arr2);
    console.log(merged);

    // Output :-
    // [1, 2, 3, 4, 5, 6]

}
```

---

### Second, Using Push Method
 
```javascript
{
    
    let arr1 = [1, 2, 3];
    let arr2 = [4, 5, 6];

    let merged = arr1.push(...arr2);
    console.log(merged);   //  6
    console.log(arr1);     //  [1, 2, 3, 4, 5, 6]

}
```

---

### Third, Using Spread Operator
 
```javascript
{

    let arr1 = [1, 2, 3];
    let arr2 = [4, 5, 6];

    let merged = [...arr1, ...arr2];
    console.log(merged);

    // Output :-
    // [1, 2, 3, 4, 5, 6]

}
```
---

### Fourth, Using For Loop
 
```javascript
{

    const merge = (first, second) => {
        for(let i=0; i<second.length; i++){
            first.push(second[i]);
        }
        return first;
    }

    let merged = merge(merge([1, 2, 3],[4, 5, 6]))
    console.log(merged);

    // Output :-
    // [1, 2, 3, 4, 5, 6]
}
```
---

### Fifth, Using reduce methods
 
```javascript
{

    let arr1 = [1,2,3];
    let arr2 = [4,5,6];

    let merged = arr2.reduce((arr,item) => {
        arr.push(item);
        return arr;
    }, arr1);
    console.log(merged);  //  6
    console.log(arr1);    //  [1,2,3,4,5,6]

}

```

---
#### Also Checkout :

[JavaScript Arrow Functions ( easy tutorial )](https://dev.to/whoroopamgupta/javascript-arrow-functions-easy-tutorial-ome)
Bespoke Juce
Tags: opensource, juce, bespokesynth, vst
Published: 2021-11-27 03:17:59

[Part 1](https://dev.to/gusmccallum/bespoke-juce-2b75)
[Part 2](https://dev.to/gusmccallum/jucey-details-2ed0)
[Part 3](https://dev.to/gusmccallum/apres-midi-2i5d)

---

For my release 0.4 I'm going to be working on [BespokeSynth](https://github.com/BespokeSynth/BespokeSynth) which is a neat program my prof showed me earlier in the semester. 

{% youtube uM3Wm952BEQ %}

I started by going through [a list](https://github.com/webprofusion/OpenAudio) I found of open source audio projects on Github, working my way through synths specifically because that's what I'm most interested in starting with. I decided to give [JUCE](https://github.com/juce-framework/JUCE) another shot as well with the confidence gained from having troubleshot and figured out so many pieces of software throughout my open source journey, and found it much more forgiving this time. I checked out a couple projects with it, which ended up being very straightforward as JUCE has a dedicated build system. You just open a `.jucer` file and it lets you configure and generate projects for your given IDE. After checking out a few I decided to take another look at Bespoke.

Bespoke differs from some other JUCE projects in that it uses [CMake](https://github.com/Kitware/CMake) to build. This wasn't much of an obstacle though, it's very easy to build with just a few lines, and despite some warnings I had an executable and a project file in a few minutes. 

I played around with Bespoke for a while and was very intrigued. It looks intimidating at first but it's very intuitive. Effects and instruments have descriptions that appear when you hover over them, so I never had to stop to read any documentation or instructions. As I was messing with it I took a break to go through issues and look for something I could work on, and found a candidate pretty soon. [This issue](https://github.com/BespokeSynth/BespokeSynth/issues/371) requests a feature to save and import `.midi` files from the drum sequencer, which I think could be doable. (For those unfamiliar, `.midi` is the format that note information is stored in to write and read music)I did some more "research" (which you can see in the video above) to check out how the sequencers work, and then started looking into how I could implement this.

My first step was to look at how JUCE handles this, and I found that there's a [class](https://github.com/juce-framework/JUCE/blob/master/modules/juce_audio_basics/midi/juce_MidiFile.h) called `MidiFile` which seems to do exactly what I need. Theoretically it should be as simple as figuring out how the drum sequencer works in the project, calling the `MidiFile` class from there to save or load MIDI, and figuring out how to add the necessary UI elements to let users access the feature.
🎄 CodeCast's Coding Advent: Day Seven 🎄
Tags: webdev, javascript, beginners, programming
Published: 2021-12-07 19:15:22


![Day Seven Image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t4de5ll5dwd5qk2w354g.png)

## DAY SEVEN

Today we're bringing you yet another coding advent calendar, this time featuring [Scrimba's](scrimba.com) #JavaScriptmas! [24 Days of learning JavaScript](https://scrimba.com/learn/javascriptmas2021/) wrapped in the blanket of festiveness, all for free! 

You can also be sure to follow us on [Instagram](https://www.instagram.com/codecastapp/), [Twitter](https://twitter.com/CodeCastApp), [Facebook](https://www.facebook.com/codecastapp), and [LinkedIn](https://www.linkedin.com/company/code-cast/) to see our daily advent releases there!
Apama Advent Calendar - 07 Dec 2021 - Apama logging
Tags: apama, iot, cumulocity, streaminganalytics
Published: 2021-12-09 14:36:47

---
title: Apama Advent Calendar - 07 Dec 2021 - Apama logging
published: true
date: 2021-12-07 19:07:59 UTC
tags: apama, iot, cumulocity, streaminganalytics
canonical_url: https://tech.forums.softwareag.com/t/apama-advent-calendar-07-dec-2021-apama-logging/253779
---

_This is Day #7_ _of a short series of brief tips, tricks, hints, and reminders of information relating to the Apama Streaming Analytics platform, both from Software AG as well as from the community._  

Read the full topic on Apama logging in the [Software AG Tech Community](https://tech.forums.softwareag.com/t/apama-advent-calendar-07-dec-2021-apama-logging/253779). Learn why is logging important for Apama? Get in good shape for both development and production deployments, after reading the full article!

_Note that some posts may be published a day or two early or late (e.g. Mon-Fri) so you may find you have bonus days with more than one post!_
Implementing Fonts in Lit
Published: 2021-12-07 18:46:53

The class was assigned the task of creating learning cards based on the example below.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pgp29i5x9uhw7cl5idv1.png)

#Google Fonts
Importing fonts allows the group to custom build the task in order to add their own personality while staying somewhat professional in presentation. Google fonts is a common choice and they have several types that you can choose from. The best part is that importing google fonts is very simple all you need is the code below

<link href="https://fonts.googeapis.com/css?family=Kaushan+Script&display=swap" rel="stylesheet">

After you have the font package implemented then you can style the text using options such as font-family, font-display, margin, padding, size, color, etc... 

Incase of an issue the swap feature allows you to set a backup font so that everything can still render. Without that you might end up looking at a blank screen without text if there is a loading issue.

https://github.com/IST402-Group-F/Project-2-Card

The link above connects to our repo if you would like to check it out!
How to resize your Facebook post design to Instagram post size in Figma
Tags: instagram, socialmedia, figmatutorial, figma
Published: 2021-12-07 18:39:02

---
title: How to resize your Facebook post design to Instagram post size in Figma
published: true
date: 2021-12-07 18:35:57 UTC
tags: instagram,socialmedia,figmatutorial,figma
canonical_url: 
---

![](https://cdn-images-1.medium.com/max/1024/0*cnWfhBLvjxmHscbB.jpg)

Today, we’ll look at how to quickly resize our Facebook post design to Instagram post size faster using a Figma plugin called Thumblisher.

### What You Will Need

You’ll need the following resources to follow along with this Figma tutorial:

**Install Thumblisher Figma Plugin**

Before getting started, make sure to install Thumblisher Figma Plugin to your Figma editor to resize your social media graphics easily.

[Figma - Thumblisher | The easiest way to resize and scale your frames for different social media platforms. Plugin Dem...](https://www.figma.com/community/plugin/1037826586645134259/Thumblisher)

**Download Exercise File**

To access the social media templates we’ll use in this tutorial, duplicate the Social Media Exercice File:

[https://www.figma.com/community/file/1045659071341514535/Social-Media-Exercice-File](https://www.figma.com/community/file/1045659071341514535/Social-Media-Exercice-File)

Find more resources on [https://www.captain-design.com/](https://www.captain-design.com/)

### Watch Video Tutorial

{% youtube cXQCtk4fE24 %}

### Before you go

Feel free to visit our website [**captain-design.com**](https://www.captain-design.com/) where we are sharing generously, ready for commercial use [**Figma and HTML templates**](https://www.captain-design.com/).

You’ll find three things to help you kickstart your next project’s design :

- [**200+ free Figma templates**](https://www.captain-design.com/templates/) **.**
- [**Free Html + Bootstrap 5 templates**](https://www.captain-design.com/templates/tag/html) **.**
- [**Amazing Figma Plugins and UI kits**](https://www.captain-design.com/uikit/) **.**

_Originally published at_ [_https://www.captain-design.com_](https://www.captain-design.com/blog/how-to-resize-your-facebook-post-design-to-instagram-post-size-in-figma/) _on December 7, 2021._
Rename osx to macos
Tags: osx, macos, ohmyzsh, zsh
Published: 2021-12-07 18:34:41


> The `osx` plugin is deprecated and has been renamed to `macos`. Please update your .zshrc to use the `macos` plugin instead.

## Confused what to change ?

- Open your terminal
- `nano ~/.zshrc` hit return
- Search for plugins

Example,

`plugins=(git colored-man-pages colorize pip python brew osx)`

- Change it to

`plugins=(git colored-man-pages colorize pip python brew macos)`

- Replace `osx` to `macos`
- `Ctrl` + `o` and `Ctrl` + `x` hit return
- Close terminal and reopen


Cover image by [forgeskiphire](https://www.forgeskiphire.co.uk/blog/how-to-properly-wipe-and-dispose-of-office-computers-and-laptops/)
True Passion
Published: 2021-12-07 18:16:20

Finally coming to a close in another chapter in my book of life I want to share that I typically think about what I want to do and how I can do it. What is there in the world that I can try to provide to the best of my ability?

#What would I create? What would it do? How would people use it?
If it had to do with technology I would create a website to share my philanthropist ideology while still providing services to the public for as little money as possible. If I could do more I would create a form of technology that is easily usable by many in order to increase my own wealth in order to correctly allocate to current and future concerns in this world. I am not sure what this might be just yet but I would make sure that portions of the sale automatically go to areas of need. In a perfect universe the products I deploy would be for everyone who can use it in their daily lives in order to make things a bit easier. I would use it to distribute messages that are important and crucial to the development of our still growing societies.

##Unlimited time and money with my life skills and passion.
If money was not a concern and I had an infinite amount of time I would spend most of my life helping all I can. Giving money and servicing communities around the globe and even larger businesses with the correct intentions. I believe that if you have the time and the money (currently the rich of our world) then you should be giving back. No one should have a ludicrous amount of money and time while others aren't even able to find a minute to kick their feet up and relax. Ideally I would love to make that kind of money in order to provide for hospitals, schools, dying communities, and even create necessary companies to provide low cost care and services for those who cannot afford it. A specific example would be that our Earth is dying because of us so I could allocate any amount of money and time to find alternate solutions that could go into effect immediately in order to remedy the damage that we have already done.

I would socialize with everyone and anyone who needed it in order to restore hope and show them that there are people that want good in the world. There are people who want to make change but might not be able to afford the time and money that it takes to make these large scale changes.

###There is still time.
I know I don't have a how yet besides I could use the existing options of websites and technological innovation but I have time to apply those to the how and make dreams reality. I encourage anyone to ponder their thoughts as well and think about how they can give rather than how they can take.
Comma operator (,)
Tags: javascript, programming, tutorial, node
Published: 2021-12-07 18:10:28

***The comma operator (,) execute both operand but return only right side value***

```
let num = 1;

num = (num++, num);

console.log(num);
// expected output: 2

x = (2, 3);

console.log(x);
//expected output: 3
```
✨ CodeCast's Coding Advent: Day Six ✨
Tags: webdev, css, beginners, design
Published: 2021-12-07 17:58:20


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nfzg625e0d5zzczqy3tl.png)

## DAY SIX

What's better than a smooth loading bar for your website? When the bar is a candy cane!

Check out this @codepen titled ["Loading Christmas" by Joe Harry](https://codepen.io/woodwoerk/pen/XXJoMa)!

{% codepen https://codepen.io/woodwoerk/pen/XXJoMa %}
⁠
You can also be sure to follow us on [Instagram](https://www.instagram.com/codecastapp/), [Twitter](https://twitter.com/CodeCastApp), [Facebook](https://www.facebook.com/codecastapp), and [LinkedIn](https://www.linkedin.com/company/code-cast/) to see our daily advent releases there!