teleren/devto huggingface dataset:
Add a node at specific position in LinkedList
Tags: java, javascript, react, python
Published: 2020-01-01 06:38:56


A position of 0 indicates head, a position of 1 indicates one node away from the head and so on. The head pointer given may be null meaning that the initial list is empty.

As an example, if your list starts as 1->2->3 and you want to insert a node at position 2 with data =4, your new list should be 1->2->4->3 

Function Description Complete the function insertNodeAtPosition in the editor below. It must return a reference to the head node of your finished list.

insertNodeAtPosition has the following parameters:

head: a SinglyLinkedListNode pointer to the head of the list

data: an integer value to insert as data in your new node

position: an integer position to insert the new node, zero-based indexing

    /*
     * For your reference:
     *
     * SinglyLinkedListNode {
     *     int data;
     *     SinglyLinkedListNode next;
     * }
     */

 static SinglyLinkedListNode insertNodeAtPosition(SinglyLinkedListNode head, int data, int position) {
        SinglyLinkedListNode newNode = new SinglyLinkedListNode(data);
        if(head == null){
            return newNode;
        }
        else if(position == 0){
            newNode.next = head;
            return newNode;
        }
        SinglyLinkedListNode cur = head;
        for(int i=0;i<position-1;i++){
            cur = cur.next;
        }
        newNode.next = cur.next;
        cur.next = newNode;
        return head; }


Note: Please share your ideas for any programming language......
Basic Signed Integer Type in Rust
Tags: rust
Published: 2020-01-01 05:45:05

---
title: Basic Signed Integer Type in Rust
published: true
description: all about signed and unsigned integer.
tags: rust
---


![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/5fly3t383t9fx8crijyz.png)


~~~rust
println!("{}", std::i8::MIN); // -128
println!("{}", std::i8::MAX); // 127
~~~

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/3sqch851cnxx1ufw1824.png)

~~~rust
println!("{}", std::i16::MIN); // -32768
println!("{}", std::i16::MAX); // 32767
~~~

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/36zwgaukti4kpkz5sucj.png)

~~~rust
println!("{}", std::i32::MIN); // -2147483648
println!("{}", std::i32::MAX); // 2147483647
~~~

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/yd8pryodhfe2yzczyiea.png)


~~~rust
println!("{}", std::i64::MIN); // -9223372036854775808
println!("{}", std::i64::MAX); // 9223372036854775807
~~~
Is Preact SEO friendly?
Tags: help
Published: 2020-01-01 05:30:50

---
title: Is Preact SEO friendly?
published: true
description:
tags: #help
---
I've been searching for this, but I can't find a definitive answer anywhere. Some posts seens to hint that preact can be good for SEO, but does it need to use SSR for it?

How dev.to handles good SEO pages using preact? 

Considering that SSR is the answer, Does it need to have SSR in every page?
2019 in Numbers
Tags: freelance, 2019, recap
Published: 2020-01-01 05:24:55

Hi All, I am back with a different kind of recap of last year (2019). I recently published a [lengthy recap](https://simplestweb.in/blog/a-recap-of-2019?utm_campaign=post-2019numbers) of how my year was, then I had this idea to summaries the year in a bunch of numbers. These are the stats that mean something to me and are ones I would like to compare to sometime in the future.

Call this self-obsession, math nerdy, number porn or whatever, my analytical brain sees the world in numbers and these are the number that summarizes how I have done in 2019, I think.


![2019 in Numbers](https://i.imgur.com/Rvq6QDT.png)

Some of these numbers even shocked me, so let me know which one of these surprised you the most in the comment box. It was great fun putting this together, hope my future self is able to do better 😋.

**Thank you for reading.**

> That’s all for now, this has been Adi.  
> If you are looking for a Freelance Web Developer you can [contact me](https://simplestweb.in/contact-me?utm_campaign=post-2019numbers)
2019 in review
Tags: showdev, crystal, yearinreview
Published: 2020-01-01 05:08:45

---
title: 2019 in review
published: true
description: Reflections on the year
tags: showdev, crystal, yearinreview
---
2019 is the year I started working as a professional developer. After almost two years of drudging my way through learning to program from home while working a full-time job, I began my first official SE job back in January. This left some room to be more experimental with side projects.

I shipped two production apps in Crystal, [Captionaire](www.captionaire.com) and [Wyyrds](https://wyyrds.herokuapp.com/). Crystal is an amazing language to work with because it’s extremely fast and the community is so small that you basically have to do everything without relying on dependencies. Plus, writing against a compiler makes you so much more aware of execution choices, which helps when you go back to interpreted languages.

2020 will be a year of working with practicality. What ideas have the capability for monetization? What will scale? I’ve been dabbling in Go to try to achieve speed with enough of an ecosystem to abstract upon common patterns. Technology aside, I hope to build something that truly matters, and maybe some consumers will agree with that sentiment.
Angular 8 Ng-container Example
Published: 2020-01-02 06:26:07

---
title: Angular 8 Ng-container Example
published: true
date: 2020-01-01 04:58:03 UTC
tags: 
canonical_url: https://www.itsolutionstuff.com/post/ng-container-angular-exampleexample.html
---

Lets talk about what is ngcontainer in angular and how to use ngcontainer in angular here we will learn example of angular ngcontent with ngcontainer we will see simple example of angular ngcontainerIts very simple to use with angular 6 angular 7 angular 8 and angular 8 for ngconten
JavaScript Fundamentals 101: Scope and Closures
Tags: codenewbie, javascript
Published: 2020-01-01 03:39:58


### Scopes

**Scope** refers to where variables and functions are accessible, and in what context it is being executed. Basically, a variable or function can be defined in a global or local scope. Variables have so-called function scope, and functions have the same scope as variables.

**Global Scope** is when a declared variable can be accessible by anywhere inside your code.

```javascript

var wideReceiver = "DK Metcalf!"; //This variable is available due to global scope
function playerSighting () {
console.log("Look! " + wideReceiver);
}

playerSighting(); //output: "Look! DK Metcalf!"

```

**Local Scope** is when a variable is only available inside the function in which it was declared.

```javascript

function playerSighting () {
var wideReceiver = "DK Metcalf!";
return alert(wideReceiver);
}
alert(wideReceiver); //  ReferenceError: wideReceiver is not defined

//Because its scope is local, it will throw an error
```

It is also worth noting that nested functions on the same level will also have access to one another, Robert Nyman provides a good example:

```javascript
function siblings () {
  var siblings = ["John", "Liza", "Peter"];
  function siblingCount () {
    var siblingsLength = siblings.length;
    return siblingsLength;
}
  function joinSiblingNames () {
    return "I have " + siblingCount() + " siblings:\n\n" + siblings.join("\n");
}
  return joinSiblingNames();
}
alert(siblings()); // Outputs "I have 3 siblings: John Liza Peter"
```

### Closures

 A **closure** is the combination of a function and the lexical environment within which that function was declared. In other words, a **closure** gives you access to an outer function’s scope from an inner function. In JavaScript, closures are created every time a function is created, at function creation time.


Consider this example:

```javascript

function footballPlay() {
  var quarterBack = "Russell Wilson";
    function runPlay() { //runPlay is the function inside the function aka inner function aka closure
      console.log(quarterBack + ", give it to Beast Mode."); // it's using the variable from outside the inner function
    }
    runPlay();
  }


footballPlay(); // output: Russell Wilson, give it to Beast Mode.

```

Here's another more intricate example given by Mozilla documentation:

```javascript

function makeAdder(x) {
  return function(y) {
    return x + y;
  };
}

var add5 = makeAdder(5); // a closure
var add10 = makeAdder(10); //also a closure

console.log(add5(2));  // 7
console.log(add10(2)); // 12
```

add5 and add10 are both closures. They provide different lexical environments within the same function. One adds 5 to the makeAdder function, one adds 10 to the makeAdder function.

Hope this helps you understand scopes and closures better, please let me know if you have any comments/additions!



 Resources: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Closures

 https://robertnyman.com/2008/10/09/explaining-javascript-scope-and-closures/
The Power of Mathematical Ingenuity
Tags: computervision, imageprocessing, mathematics, ai
Published: 2020-01-10 06:46:54

---
title: The Power of Mathematical Ingenuity
published: true
date: 2020-01-01 03:05:37 UTC
tags: computer-vision,image-processing,mathematics,artificial-intellige
canonical_url: 
---

[![](https://cdn-images-1.medium.com/max/960/0*hyWEGFmnEnZJtdfh.jpg)](https://medium.com/innovation-incubator/the-power-of-mathematical-ingenuity-49c7b6cfe05e?source=rss-c093ed453e2c------2)

Computer Vision for Skew Correction, Text Inversion, Rotation Classification, Homography & Object Search with Applied Math

[Continue reading on Innovation Incubator »](https://medium.com/innovation-incubator/the-power-of-mathematical-ingenuity-49c7b6cfe05e?source=rss-c093ed453e2c------2)
Dcasso - Simple Doodling Game that made TOP Blockstack apps?
Tags: blockchain, blockstack, privacy, game
Published: 2020-01-01 02:56:42

If you're familiar with Blockstack, they have monthly app mining contest where each dapp will be ranked (scored by multiple methods) and paid from $20,000 to a couple of cents per app. Pretty nice deal right?
It is true that Dcasso (https://dcasso.app/) has been ranked top 30 and earning over $5,500 every month since November 2019, by being a doodling game.
BUT, is Dcasso JUST a doodling game? Let's take a deeper look into what it is.

From the app description, I got
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/0ea4h8n11847odfzayib.JPG)
"Dcasso is a fun and judgement-free drawing platform.
• It's not about drawing the best sketch, because there are many tools out there to serve that purpose.
• Dcasso is a game where you're given a random prompt and a set time, you're tested on how fast and creative you can come up with a drawing."

So yes Dcasso IS a doodling game, but with a twist. Taking a look at hundreds of sketches on Dcasso, I actually ended up laughing at many of them. Due to the time constraint, most sketches ended up being creative, or "creative". Although Dcasso might not be privacy-focused, it does bring an entertainment value to Blockchain and Blockstack community. Dcasso seems to be one of those apps that actually bring non-crypto users to the Blockchain community because of the value Dcasso offers. I'm new to decentralization. For utility apps, I found it harder to switch from centralized apps like Google Docs to Blockstack suite app due to my habits, but I don't find it hard to try out and keep coming back to decentralized games.

After all, maybe it's worth taking a shot at https://dcasso.app/?
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/rm4832czi5zelegx2kfe.JPG)
Data Platform zones

Tags: dataplatform, zone, data, platform
Published: 2020-01-01 02:43:53

I was in search of suitable names for zones in a data platform, and this is what I have until now.

<ul>
<li>Access zone</li>
<li>Additional zone</li>
<li>Analytics zone</li>
<li>Archive data zone</li>
<li>Canonical data zone</li>
<li>Certified zone</li>
<li>Clean zone</li>
<li>Cleansing zone</li>
<li>Consumer zone</li>
<li>Consumption zone</li>
<li>Curated zone</li>
<li>Dev zone</li>
<li>Exploration zone</li>
<li>Gold zone</li>
<li>Insights zone</li>
<li>Landing zone</li>
<li>Master data zone</li>
<li>Operationalization zone</li>
<li>Persisted zone</li>
<li>Process zone</li>
<li>Production zone</li>
<li>Published zone</li>
<li>Raw zone</li>
<li>Refined zone</li>
<li>Refinery zone</li>
<li>Reporting zone</li>
<li>Sandbox zone</li>
<li>Sensitive zone</li>
<li>Silver zone</li>
<li>Staging zone</li>
<li>Standard zone</li>
<li>Structured zone</li>
<li>Temporal Zone</li>
<li>Transformed zone</li>
<li>Transient zone</li>
<li>Trusted zone</li>
<li>User Drop zone</li>
<li>Work zone</li>
</ul>


**Credits:**
Public blogs and images.
Download Files From Google Drive With curl/wget
Tags: terminal, productivity
Published: 2020-01-01 02:27:50

Sometimes we need to use curl/wget to download files from `Google Drive` from scripts. In terms of small file, we don't have any issues, but on the other hand, with a big file(especially download pre-trained model) needs to download the file manually which is very annoyed.

In this my last post in 2019, I'll show you how to avoid downloading files manually.


### Small file

https://drive.google.com/file/d/0B-0p-MTxJBSCU2lwaGNUZ3VYSG8/view?usp=sharing

This is my Processing sketch and the size of the file is 2MB.
In the link, `0B-0p-MTxJBSCU2lwaGNUZ3VYSG8` is fileId

```zsh
$ wget "https://drive.google.com/uc?export=download&id=<fileId>" -O <fileName>
```

```zsh
$ wget "https://drive.google.com/uc?export=download&id=0B-0p-MTxJBSCU2lwaGNUZ3VYSG8" -O myProcessing_sketch.mp4
```

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/0f39ef8xypwifflq65xm.png)



### Big file
In terms of a big file, the way to download is a little bit complicated since Google Drive tries to scan the file to make things secure.

In this case, we will try to download M2Det's pre-trained model.

{% github https://github.com/qijiezhao/M2Det %}


To download a big file, we will need 4 digits which are `code` in a shell script. Then we also need `fileId` and `fileName` as well.

```zsh
# https://drive.google.com/file/d/1NM1UDdZnwHwiNDxhcP-nndaWj24m-90L/view
fileId=1NM1UDdZnwHwiNDxhcP-nndaWj24m-90L
fileName=m2det512_vgg.pth
curl -sc /tmp/cookie "https://drive.google.com/uc?export=download&id=${fileId}" > /dev/null
code="$(awk '/_warning_/ {print $NF}' /tmp/cookie)"  
curl -Lb /tmp/cookie "https://drive.google.com/uc?export=download&confirm=${code}&id=${fileId}" -o ${fileName} 
```

## Happy New Year from NYC

<a href="https://www.buymeacoffee.com/koji"><img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kA3wM6t6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.buymeacoffee.com/buttons/default-red.png" alt="Buy Me A Coffee" height="41" width="174" loading="lazy"></a>
Starter Template #1 | NextJS + Tailwind CSS 
Tags: nextjs, react, css, tutorial
Published: 2020-01-01 00:35:06

This template is a starter for those looking to use [Tailwind CSS](https://tailwindcss.com/) in a [NextJS](https://nextjs.org/) project.

[CodeSandbox](https://codesandbox.io/s/github/thatgoodcompany/template-nextjs-tailwind)
[Github](https://github.com/thatgoodcompany/template-nextjs-tailwind)

## Setup Description

### NextJS

- [Next CSS plugin](https://github.com/zeit/next-plugins/tree/master/packages/next-css)
  This is used in nextjs.config.js as "withCSS".

#### Instructions

1. `npm install --save @zeit/next-css`
2. Create a nextjs.config.js in your project if you don't have it already.
3. Import the plugin to your project.
```javascript
// next.config.js
const withCSS = require('@zeit/next-css')
module.exports = withCSS({})
```

### Tailwind

Since NextJS already uses PostCSS we just need to create a postcss.config.js to load the required plugins for tailwind to work properly and efficiently. 

**To Work Properly**
- [tailwind](https://www.npmjs.com/package/tailwindcss)
  Tailwind npm package: this will load the necessary css.
- [autoprefixer](https://www.npmjs.com/package/autoprefixer)
  Autoprefixer npm package: this package will add vendor prefixes to CSS rules.

**To Load Efficiently**
- [cssnano](https://www.npmjs.com/package/cssnano)
  cssnano npm package: this package will minify the css output.
- [purgecss](https://www.npmjs.com/package/purgecss)
  purgecss npm package: this package will traverse your code and remove all unused css classes that tailwind generates. 

#### Instructions

1. `npm install --save tailwindcss autoprefixer purgecss cssnano`
2. Create a postcss.config.js in your project if you don't have it already.
3. Import the plugins to your project, the plugins for optimization should only be loaded in production.
```javascript
// postcss.config.js

//load purgecss 
const purgecss = require('@fullhuman/postcss-purgecss')({

    // Specify the paths to all of the template files in your project 
    content: [
        './pages/*.js', './pages/*.tsx',
        './components/*.js', './components/*.tsx' 
    ],

    // Include any special characters you're using in this regular expression
    // Recommended algorithm by tailwind but you're free to change it to your needs
    defaultExtractor: content => content.match(/[\w-/:]+(?<!:)/g) || []
});

// load cssnano
const cssnano = require('cssnano')({
    preset: 'default',
});



module.exports = {
    plugins: [
        //load tailwindcss
        require('tailwindcss'),
        //load autoprefixer
        require('autoprefixer'),
        //only use purgecss and cssnano on production builds
        ...process.env.NODE_ENV === 'production'
            ? [purgecss, cssnano]
            : []
    ]
};
```
Time to “Shape Up” your SCRUM processes? The new thing from Basecamp
Published: 2020-01-02 11:17:53

---
title: Time to “Shape Up” your SCRUM processes? The new thing from Basecamp
published: true
date: 2020-01-01 00:00:00 UTC
tags: 
canonical_url: https://timwise.co.uk/2019/11/26/time-to-shape-up-your-scrum-process-the-new-thing-from-basecamp/
---

Basecamp, who are famous for carving out their own path in the software worldhave documented and shared their own way of defining and building theirsoftware-as-a-serice (SaaS) product, also known as “basecamp”. You can read thewhole thing here: [https://basecamp.com/shapeup](https://basecamp.com/shapeup).

If like me you’ve mostly worked with SCRUM/Agile/Kanban style teams you shouldpay attention to the ideas they share. Unlike many people who teach and followthe wikipedia truth of SCRUM as _the_ way of building software, basecamp havenot satisfied themselves with cargo-culting “industry best practice” and haveinstead carefully honed their own particular way of getting the best out oftheir resources.

Although the “ShapeUp” process is finely tuned to suit basecamp, there are manythings in there that the average SCRUM team could take inspiration andimprovement from without throwing out everything in place at the moment. Anexample I particularly like is the way everyone can bring a pitch to thebetting table, from their own personal backlog of priorities, contrasted withthe usual approach of throwing yet another another card/story onto theteam-shared dumpster-fire of a backlog / todo-list and hoping it somehowmagically gets to the top of the list just before all your chickens come hometo roost.

* * *

# Key features of shaping up

## Shaping

- An iterative process of taking concepts from initial idea to something thatcould be built with bounded risk and expectations.
- A largely solo or pair exercise, but done in consultation with experts on thewider team.

## Pitch

- The output of shaping.
- A detailed but high-level document outlining what should and shouldn’t bebuilt, with room for discretion and design work by the designers andprogrammers.

## Bets

- There is a meeting where pitches are discussed, prioritised and scheduled forthe next cycle of work, they “take a bet” on a pitch.
- If a pitch blows its timebox, then the default is always to stop and itdoesn’t get any special priority in the next cycle. This limits the risk ofrunaway unstoppable projects.

## 6-week cycle with gaps

Basecamp operate a 6-week period of building what was decided in shaping andbetting. This can either be one 6 week bet or set of 2 week bets.

Once this is done there is a 2-week gap where people can do maintenance, techdebt paydown, plan new things etc.

* * *

If you’d like to hear a bit more about ShapeUp, have a listen to[https://pod.timwise.co.uk/5](https://pod.timwise.co.uk/5) where I go over their process in a bit moredetail with regular co-host David.

Article originally posted at <https://timwise.co.uk/2019/11/26/time-to-shape-up-your-scrum-process-the-new-thing-from-basecamp/>
Datetimepicker Disable Minutes in Bootstrap 
Published: 2020-01-03 13:14:11

---
title: Datetimepicker Disable Minutes in Bootstrap 
published: true
date: 2020-01-01 00:00:00 UTC
tags: 
canonical_url: 
---

Hi GuysIn this exampleI will learn you how to set bootstrap datetimepicker disable minutes in jquery you can simply set to datetimepicker in html codeyou will check to datetimepicker disable minutes in juqery bellow examplestrong classstepExample 1 strongpre classprettyp
Random Seeds, Lodash, and ES6 Imports
Tags: javascript, generative, lodash
Published: 2020-01-14 13:49:32

---
title: Random Seeds, Lodash, and ES6 Imports
published: true
date: 2020-01-01 00:00:00 UTC
tags: Javascript,Generative,Lodash
canonical_url: http://www.petecorey.com/blog/2020/01/01/random-seeds-lodash-and-es6-imports/
---

[David Bau’s `seedrandom` Javascript library](http://davidbau.com/archives/2010/01/30/random_seeds_coded_hints_and_quintillions.html) is an excellent tool for introducing deterministic random values into your Javascript project. After setting a fixed seed, `Math.random` will produce a stream of random values. Those same random values will be produced again, in order, the next time you run your program. This is very important when creating generative art or procedurally generated game content.

However, there’s a small problem when trying to combine `seedrandom` with a library like [Lodash](https://lodash.com/docs/4.17.15). Ideally, we’d like Lodash to respect our random seed, so methods like `shuffle` would always produce a deterministic shuffling. Unfortunately, with a setup like the one described below, this won’t be the case:

```

import _ from "lodash";
import seedrandom from "seedrandom";

seedrandom("seed", { global: true });

_.shuffle([1, 2, 3]); // Ignores our random seed.

```

The `seedrandom` library [wholesale replaces `Math.random` with a new pseudo-random number generator](https://github.com/davidbau/seedrandom/blob/f38648743a80fef0319d0d66c2cd37bec116a5a7/seedrandom.js#L94). Because we’re importing `lodash` before we initialize `seedrandom`, Lodash defines all of its functions, `shuffle` included, to use the original reference to `Math.random`. We need to initialize `seedrandom` before importing Lodash.

Unfortunately, this won’t work:

```

import seedrandom from "seedrandom";
seedrandom("seed", { global: true });

import _ from "lodash";

```

Node.js requires all import statements to be at the top of a module. We can’t initialize `seedrandom` before importing Lodash.

Thankfully, a simple solution exists. We’ll make a new module called `seed.js` that simply imports `seedrandom` and then initializes it with our seed:

```

import seedrandom from "seedrandom";

seedrandom("seed", { global: true });

```

Next we can import our local `"./seed.js"` module before importing Lodash:

```

import "./seed.js";
import _ from "lodash";

_.shuffle([1, 2, 3]); // Produces deterministic shufflings!

```

And with that small change `seedrandom`, Lodash, and ES6-style imports all play nicely together. Our `shuffle` function will now product deterministic shufflings based on the seed we pass into `seedrandom`!