teleren/devto huggingface dataset:
Tank Wars? More like C# Wars
Tags: octograd2020
Published: 2020-05-20 14:29:44

## A Battle with Windows Form Designer



## Our project:

Our project was to make a client and server Tank Wars multiplayer game in C#. For the UI we were tasked with using the Windows Form Designer in Visual Studio. Throughout the client side work we spent hours on end trying to get our objects to display on the form. Each object had its own own coordinate system and orientation that was different from the main form. I remember, in particular, we spent 5+ hours trying to get the walls to appear properly. 


## Takeaway:
Take breaks. That is the main thing we learned. By FORCING yourself to take breaks while coding you will be more productive. We spent hours without a break, getting burnt out. After this project we started taking breaks more liberally, after 30 minutes of spinning our wheels. Our development time sped up and our code quality improved tremendously. It is counterintuitive to stop working on a problem when you are in the midst of it, but it will save you significant amounts of time and frustration.


[Final Note]: TAKE BREAKS!!! Structure a rule for taking a break. Our rule was "If we have been working for 30 minutes and not making any progress, take a 5-10 minute break."
Let's cache with node-cache
Tags: javascript, node
Published: 2020-05-01 18:47:33

---
title: Let's cache with node-cache
published: true
description: Caching with node-cache
tags: js, javascript, nodejs
---

> This post was originally posted on [my blog](https://aadii104.netlify.app/lets-cache-with-node-cache/), if you like the content feel free to subscribe to [my newsletter](https://aadii104.ck.page/b0b20cbc44).

We all are aware of the fact that how a cache system can drastically increase the efficiency of any system, be it front-end or backend. As a developer, we are constantly looking for ways to make things ⚡  fast, and caching is the first thing that (should) comes to our mind.

Designing a caching system can be tricky depending upon the requirement and type. This post will majorly focus on application-level caching.

#### Intro

Application-level caching, putting it in simple words there will be an `application-level system to provide already computed results`, this can be used in both backend or front-end (in your controllers) if this sounds interesting let's do the deep dive.


```js

const NodeCache = require( "node-cache" );
// Create an instance of NodeCache.
const myCache = new NodeCache();

// This checks if data exists in cache ?
myCache.get(myKeyName,function(err,value){
  if(!err){
      // If no error occured in checking.
      if(value== undefined || value==null){
          // If the do not exist in cache system, then we will get it from the main system.
          axios.get(`https://jsonplaceholder.typicode.com/todos/${id}`)
          .then(response=>{
              // Set the obtained result for next call.
              myCache.set(todoKey,response,function(err, doc){
                  resolve(response)                        
              })
          })
      }else{
          // Got the data in cache, no need to call main system.
          resolve(value);
      }
  }else {
      reject('error occured')
  }
})
```

One major need of any caching system is to invalidate the cache, just to flush the new data. For this, we can do something like this.

```
myCache.flushAll()
```

That's it.

Some examples where you can use this caching system:-  
* You have static offers to show on any page, which are not changing too frequently.
* You have fixed data for specific route pairs.
* You have fixed ratings and reviews for specific items.

---
Thanks for reading, you have been a fantastic reader. Keep coming back 😊 
Subscribe to [my newsletter](https://aadii104.ck.page/b0b20cbc44).
Graduation Day 🎓

Tags: github, octograd2020, opensource
Published: 2020-05-20 14:27:05

## _What is it?_ 🤔

An online graduation ceremony to celebrate graduates of the class of 2020. Join us in walking the stage with your global community. We'll be hearing from special guests, giving out exclusive swag, and highlighting student stories and projects from around the world.

## _Join the celebration_ 🎉

Add yourself to the Yearbook by visiting the [graduation repository](https://github.com/education/graduation) on GitHub. Follow the instructions in the `README.md` file to submit a valid pull request. After your request is approved, you will be added to the Yearbook, get highlighted on the stream, and get some exclusive swag — all from the comfort of your home.

## _Graduation Day_ 🎓
*Don't forget to watch the Livestream!*

📆 *Monday, June 15th, 2020*
⏰ *9:00 PDT | 21:30 IST*
📍 *GitHub Education Twitch Channel*


## _Steps to enter the Global Celebration_ 👋

**Step-1:** Visit the Repo. <https://github.com/education/graduation>

**Step-2:** Fork the repository

**Step-3:** Clone the repository you just forked by doing
```git clone https://github.com/{YOUR_GITHUB_USER_NAME}/graduation.git```

**Step-4:** cd graduation/_data

**Step-5:**  create a new folder and name it with your _GitHub username_. It should look something like this `_data/<YOUR-USERNAME>/`

```ex: _data/iamdarshshah/``` 

**Step-6:** Enter the folder you just created and add a profile picture of your choice. Accepted files are **png and jpg**, should be squared and _minimum size 544x544 pixels_.

```ex: _data/iamdarshshah/iamdarshshah.png```

**(P.S: _Be aware, this picture will be displayed on the yearbook!_)** 

**Step-7:** Create a markdown file in your folder following the convention `{YOUR_USERNAME}.md`.

```ex: _data/iamdarshshah/iamdarshshah.md```

**Step-8:** Add your details inside this markdown file. Here is the _boilerplate data_ :

```
---
name: FULLNAME-OR-NICKNAME # No longer than 18 characters
institution: INSTITUTION-NAME 🚩 # no longer than 58 characters
profile_pic: iamdarshshah.png # Name and extension of your profile picture(ex. iamdarshshah.png)
quote: YOUR-SENIOR-QUOTE # no longer than 100 characters
github_user: YOUR-GITHUB-USERNAME
---
```

**Step-9:** Follow the steps to Create a Pull Request: 

```-- git add .```

```-- git commit -m  '{COMMIT_MESSAGE}'```

```-- git push origin master```

Navigate to your Github Repo. you will have an option to create a pull request

**Step-10:** Fill the [form](https://airtable.com/shrmuHxu38ZariKJi) and submit your Pull Request.


**Thanks to [GitHub Education](https://education.github.com/), [Dev Community](https://dev.to/t/octograd2020), and the team for organizing the event and for making our graduation memorable. Be part of this global graduation celebration.**❤️

>_(P.S Don't forget to share this with your friends graduating this year and with your tech community.)_🤩

##### You can find the event Schedule [here](https://education.github.com/graduation/schedule).🚀
The Importance of the Meta Theme Color (HTML Tricks #1)
Tags: html, ux, webdev, css
Published: 2020-05-20 14:24:25


You have probably noticed that on some popular website when visited on mobile, the menu bar in Chrome magically changes its colour to match the primary colour of the page.

![The Guardian’s Website](https://miro.medium.com/max/1400/1*sB6AGTW2FeQhpNewsD3XrA.jpeg)*The Guardian’s Website*

There is no magic in that. This can easily be achieved by using only one line of code inserted directly into the `<head>` tag of your page. This will suggest to the browser to use this colour rather than the default one.

```html
<meta name="theme-color" content="#ffffff">
```

Other popular websites using this:

* [https://edition.cnn.com/](https://edition.cnn.com/)
* [https://www.cnet.com/](https://www.cnet.com/)
* [https://github.com/](https://github.com/)

This one line can go a long way in helping your clients notice you and your website. It simply looks more professional and you appear to have spent more time on your design. Support for this feature has been introduced in version 39 of Chrome for Android on Lollipop.
NumPy Where Tutorial (With Examples)
Tags: python, tutorial
Published: 2020-05-20 14:23:11

---
title: NumPy Where Tutorial (With Examples)
published: true
description: 
tags: #python #tutorial 
---
1 A very simple usage of NumPy where
2 How does NumPy where work?
3 2D matrices
4 Multidimensional array
5 Using the result as an index
6 Parameters ‘x’ and ‘y’
7 Apply on Pandas DataFrames
8 Multiple conditions
9 Nested where (where within where)
10 Finding rows of zeros
11 Finding the last occurrence of a true condition
12 Using on DateTime data
13 Conclusion

https://likegeeks.com/numpy-where-tutorial/
Project '20
Tags: octograd2020
Published: 2020-05-20 14:19:54

## My Final Year Project
My final year project is a character extraction system. The system is used to extract text from images and extract them character by character. 

The aim is to build the system such that the following are possible:
1. Line Removal
2. Noise Removal
3. Skew Correction
4. Character Extraction

## Link to Code
Currently, the code is still under work. Will update it as soon as the project is completed.

[Note]: # (Our markdown editor supports pretty embeds. If you're sharing a GitHub repo, try this syntax: `{% github link_to_your_repo %}`)

## How I built it:
The thought process was not easy. After referring various IEEE Papers, I decided to use Projection Profile method to extract characters.This method requires documents to be pure text, so removal of all other data was necessary. 

Image enhancement was hard. The image had to be binarized for proper extraction. Much work has gone into this. Later on, the Gatos implementation was chosen for enhancement. 

Line removal was possible after considering both the Hough lines method and the morphological kernel method. 

The rest will be updated in a later edit.

## Additional Thoughts / Feelings / Stories
During the Covid-19 Lockdown in India, I decided to learn Dart/Flutter. So far, it is going well and I am able to make a login page. Sure, it is not hard. But, the satisfaction does motivate me to learn more.  

[Final Note]: # (CONGRATULATIONS!!! You are amazing!)
Virtual Yoga Instructor during this lockdown
Tags: machinelearning, motivation, datascience, yoga
Published: 2020-05-20 14:17:10

# MOTIVATION
The human body being the most complex biochemical factory, learning how to engineer it helps enter a sense of modalities at will. everything is online now and people can't go outside due to corona. So this solution is more apt for the current problem each and everyone is facing. This project’s main objective is to motivate society to practice yoga by providing a comfortable environment by building a virtual yoga instructor. 

The project uses pose estimation, smart assistance has been built to guide and instruct users throughout their practice period to attain the correct posture. This helps users experience a hassle-free environment and enhances rendition. This can also be used to reduce stress, anxiety, and tension through a series of guided meditative poses.

# INTRODUCTION
The influx of technological advancements provides a chance for Scientists and researchers to explore new ideas for solving day to day problems of the world. Physical fitness plays a very important role in shaping the mind and body to lead a positive way of life. Through the art of yoga, one can achieve inner peace. People in their busy lives find it difficult to visit different yoga studios and places to get the right platform. The existing yoga practices involve either high-cost machinery or complex software. In order to provide a more optimized experience, yoga is given more significance rather than involving unneeded other fitness exercises.

Link to [code](https://github.com/neha-duggirala/virtual-Yoga-Instructor)
Check out the [web application](https://neha-duggirala.github.io/virtual-Yoga-Instructor/) too
Creating my developer portfolio site.
Tags: octograd2020
Published: 2020-05-20 14:12:09

I love writing code right. I have been obsessed with the idea of using software to solve practical problems. Software development is a never-ending puzzle that I am passionately engaged in solving. I believe in the power of programming to transform and improve lives worldwide.

With this goal in mind, I set myself to build my portfolio to propel me towards this call. This was before the end of my Bootcamp program.

## Demo Link
`{%https://briantical.netlify.app/%}`
 

#### Link to Code 🚧
`{%https://github.com/briantical/portfolio%}` 
This is still a private repository as I am still on my β (beta) version. Check it out later...(will be making it public)

### How I built it (what's the stack? did I run into issues or discover something new along the way?).
I bootstrapped the project using `create-react-app` with typescript. I had earlier made a commitment to use Typescript in all my Javascript projects going forward, and this was going to be my first attempt at it.

Just a couple of tutorials into Typescript and I was about to give it a shot on a project and more so one that will define how I am to be viewed.

So what you are looking at is the result of all that 🤓🤓🤓.

### Additional Thoughts / Feelings / Stories
I am super excited that I got this off my bucket list. Still iterating through the numerous versions until I have a superb site.

Kindly check out the https://briantical.netlify.app/. I really need feedback on any areas of improvement.
Guitar Hero MMMMDCCLX
Tags: octograd2020
Published: 2020-05-20 14:11:52

#### A Cornell ECE 4760 Final Project (F18)

#####Brian Dempsey (bjd86), Katarina Martucci (kmm398), Liam Patterson (lgp36)

As a group of three class of '20 students, we created a new take on a classic. Making use of freely available MIDI tracks, our game synthesizes track audio using direct digital synthesis onboard the PIC32 MCU. Additionally, a custom UI is displayed, showing falling notes and a virtual fret board on a 2.2” onboard TFT over SPI. A custom, laser-cut guitar controller features toggle switches for strumming and push buttons as frets.

## Demo Link
View the full report [here.](http://people.ece.cornell.edu/land/courses/ece4760/FinalProjects/f2018/bjd86_kmm398_lgp36/bjd86_kmm398_lgp36/bjd86_kmm398_lgp36/bjd86_kmm398_lgp36/bjd86_kmm398_lgp36.html)
View our project demo video [here.](https://www.youtube.com/watch?time_continue=1&v=FefuKS446qY&feature=emb_logo)
Web Architecture vs Web Design Principles
Tags: webdev, design, architecture
Published: 2020-05-20 14:11:04

Web Architecture and Design Principles are two terms hard to miss in job listings and for a good reason. Here's why.
### Web Architecture
This defines the interactions between applications, databases, and middleware systems on the web. It allows for easy interaction of components within an application. 

The most common aspects of web architecture are:-
* Client-Side(Front-end) - contains code that responds to user input e.g. clicks and swipes.
* Server-Side(Back-end) - contains code that responds user HTTP requests.

#### Types of Web Architecture
* **Legacy HTML Applications** -  These applications consist of a server focused on web page construction logic. Business logic interacts with a client by sending out a complete HTML page. To see an update, the user needs to fully reload the page.
* **SPA**(*Single Page Application*) - these applications load the app on the user's device and provide updated content without reloading the page.
* **Microservices** - in this architecture an application is viewed as a collection small lightweight services that provide single functionality. This architecture enables the development of maintainable, testable, loosely coupled services that are tailored to your business requirements. 

###Web Design Principles
These are general rules for the design of web-based media. They provide us with guidelines for layout and interaction design.

* **Visual Hierarchy** - Your web page is made up of many visual elements, do they have the same level of importance? No, they do not. More important elements of your page should show more prominence hence attracting user attention.
* **Divine Proportions** - Believe it or not, divine proportions such as the golden ratio are believed to be aesthetically pleasing. The golden ratio(1.618) can be applied to columns design and typography among many other things.
* **Hick's Law** - Hick's Law states that every additional choice increases the time required to make a decision. The more option a user has on your website the more difficult for him to use or use at all.
* **Fitt's Law** - Fitt's law stipulates that the time required to move to a target area (e.g. click a button) is a function of the distance to the target. The bigger an object the closer it is the easier it is to use.
* **Rule of Thirds** - A picture is a thousand words hence it is always a good idea to use images in your design. The best images follow the rule of thirds.
* **Gestalt Design Laws** - The principle states that the human eyes see an object in their entirety before perceiving their individual parts. Laws of proximity, continuation, and common region greatly affect how the users perceive and interact with our website.
Final Year Game Software Engineering Project
Tags: unity3d, voicerecognition
Published: 2020-05-20 14:00:22

<h1>
A Voice Controlled Game Designer
</h1>
<p>
My aim for this project was to be able to describe an idea for a game and the tool would process your input and spit out a fully playable game. That was wishful thinking.
</p> 
</br>
<p>
After a couple weeks of wrangling <a href ="http://Wit.ai">Wit.ai</a> I decided that it was way more feasible to just ask the user questions with defined answers using a basic chat-bot system. This culminated in a prototype where you could define a game-mode by answering around 10 questions. Things like "Will the game be First Person, Third Person or Top Down?","Will the player have a gun?" and "will there be enemies in your game?". This worked well enough to continue on to the world designer.
</p>
</br>
<p>
The world designer was very jankey at the start, after a week or 2 of work it started to resemble something like a usable tool where you can give coordinates and define what room, hallway or object you want to be placed there. It also had the ability to let you move around the objects once they were placed, so that you would change the overall flow of a level relatively quickly.
</p>
</br>
<p>
The final part of the project was online game sharing using AWS API Gateway,Lambda and DynamoDB I created a system that allowed a user to submit a game as JSON and let another user download that JSON and play the game on another PC. It was just a simple REST API but learning AWS will prove incredibly useful in future.
</p>
</br>
<p>
The project is sadly unfinished as of writing this as my Uni changed the requirements of the project when COVID-19 came knocking. This meant that I had to write a Dissertation rather than hand in a project meaning I've had to put it on hold for the time being. :-(
</p>
Arctic Monkeys Lyrics Generator Using GPT-2
Tags: octograd2020
Published: 2020-05-20 14:00:16


I had to give a talk about a project I did a year ago when I was in the third year, preparing for my internship and had to follow this pre-interview calender. I was a newbie in Natural Language Processing(NLP) before that and well, at least knew fair bit at the end of the calendar. There was a task that I thought was extremely daunting back then, "write a blog on any topic that you liked learning?"

It was daunting because it was entirely up to me, and autonomy isn't as much fun when you truly have it. I ended up mushing two things I liked, Arctic Monkeys and  Text Generation. It takes in an artist name, collects all the lyrics, feeds it to a language model which is good at prediction next word in a sequence and creates lyrics in the style of your artist. I used lyricsgenius to scrape the lyrics. nlpaug to increase the dataset by augmenting it. GPT-2 as the language model which was trained using the gpt2-simple package. 

You can see the talk here, and if you want to look at the slides/notebooks, you can see them here

Some of the generated lyrics are :

![](https://camo.githubusercontent.com/889af3583180eb2529f948fc6794012029a220df/68747470733a2f2f692e696d6775722e636f6d2f32397757497a742e706e67)
## Want to try it for yourself?

- Get your data by changing the API Key and Artist Name in this [notebook](https://github.com/meghanabhange/Arctic-Monkeys-Lyrics-Generator/blob/master/01.Getting%20the%20lyrics.ipynb).

- Train your model by changing the name of the text file to reflect your filename [here](https://github.com/meghanabhange/Arctic-Monkeys-Lyrics-Generator/blob/master/02.Training%20GPT2-Simple%20for%20AM.ipynb)

- Test your model [here](https://github.com/meghanabhange/Arctic-Monkeys-Lyrics-Generator/blob/master/03.Generator.ipynb)
My own Pokedex!
Tags: octograd2020, machinelearning
Published: 2020-05-20 13:58:20

## How and Why I built it ?

I liked Pokemon since my childhood and I grew up watching them on TV, collecting cards and playing games. By the end of my graduation I got fond of getting into Machine Learning a bit. So I decided to train my own CNN on the Pokemon images and built my own Model to predict them correctly. In short, my own Pokedex in a python script :)

So, I studied about CNNs, Computer Vision, tensorflow and along with that, I got to learn Bing Image Search API to download a lot of images for my dataset. I trained it for 5 Pokemon classes, Yes the popular ones: Pikachu, Bulbasaur, Squirtle, Charmandar and Mewtwo! Though The model is quite generic and can be used to train on all Pokemons provided enough dataset.

And here we go! my own Pokedex to detect the Pokemon from an image.

> https://github.com/shashijangra22/Pokedex
How To Change case of all keys in an array ?
Tags: php
Published: 2020-05-20 13:57:22

How to modify the case of an array’s keys In PHP, there is a specific buildin function. Function name :

```php
array_change_key_case()
```

This function have two parameters.

**Array** – [the array whose keys will be changed case by case],
**Case Type** – [In this case there will be 2 wells. Ex: CASE_UPPER and CASE_LOWER]

However, **CASE_LOWER** is set the case type by default.


## Example

```php
<?php
    $input_array = array("name" => 'Istiaq Nirab', "Age" => "18+");
    print_r(array_change_key_case($input_array, CASE_UPPER));
?>
```

## Result

```php
Array (
 [NAME] => Istiaq Nirab
 [AGE] => 18+
)
```

Thanks 😊
GlueCodes - new JavaScript Framework
Tags: javascript, webdev
Published: 2020-05-20 13:56:47

Hey guys, recently we released GlueCodes Framework. We’re making huge effort to document and explain rationales behind the design choices. We believe in the community and we want to stay with you at the same page. 

A little spoiler alert - If you hate naming data, good news! - in our framework you access data by the name of an action that wrote it. Check this out!

The Beta can be found on our GitHub - https://github.com/gluecodes/gluecodes-framework
My first step to Android Dev
Tags: devgrad2020, octograd2020, opensource
Published: 2020-05-20 13:51:37

# Lockdown Learning
Due to COVID-19 pandemic and quarantine, I had a lot of spare time on my hands. So I decided to try my hand at Android development.

## How I built it 
I used Flutter to code since it's a native programming language. I studied hands-on implementations on Youtube. A User Dashboard was created along with the Chat message page.

## Link to Code

{% github https://github.com/Lord-Fifth/Flutter-Chat-UI %}