teleren/devto huggingface dataset:
JS Coding Question #3: Is Palindrome [Common Question]
Tags: challenge, javascript, tutorial, career
Published: 2021-08-27 02:33:25

---
title: JS Coding Question #3: Is Palindrome [Common Question]
published: true
description: Front end job interview question, Reverse a string
tags: challenge, javascript, tutorial, career 
cover_image: https://images.unsplash.com/photo-1573497161223-d9c42d7b0bad?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=1950&q=80
series: Job Interview Preparation Materials
---

#### Interview Question #3:
Write a function that returns if string a palindrome❓🤔
Palindrome happens when a string forms the same word when it is reversed.

Example: 
abba => true
abcba => true
123xyz => false

> If you need practice, try to solve this on your own. I have included 2 potential solutions below. 

> Note: There are many other potential solutions to this problem.

Feel free to bookmark 🔖 even if you don't need this for now. You may need to refresh/review down the road when it is time for you to look for a new role.

Code: https://codepen.io/angelo_jin/pen/RwgPVwr

#### Solution #1: Array reverse and join and methods
- very straight forward solution using array methods.
```js 
function isPalindrome(str) {
  return str
    .split('')
    .reverse()
    .join('') === str;
}
```

#### Solution #2: Array forEach
- iterative solution that avoids array reverse() and join() methods
```js
function isPalindrome(string) {
    // find the length of a string
    const len = string.length

    // loop through half of the string
    for (let i = 0; i < len / 2; i++) {

        // check if first and last string are same
        if (string[i] !== string[len - 1 - i]) {
            return false
        }
    }
    return true
}
```


#### Solution #3: Array every
- another iterative solution and is shorter version.
```js
function isPalindrome(str) {
  return str.split('').every((char, i) => {
    return char === str[str.length - i - 1]
  })
}
```
Happy coding and good luck if you are interviewing!

If you want to support me - [Buy Me A Coffee](https://www.buymeacoffee.com/letscode77)

In case you like a video instead of bunch of code 👍😊
{% youtube Ze7fqHLUJL0 %}
Create key store and sign APK manually
Tags: apk, android
Published: 2021-08-27 02:32:26

In this article, we will learn how to create a release key store for Android app and then sign it.

Requirements:
* [JDK 8](https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html)
* [Android SDK](https://developer.android.com/studio)
* [OpenSSL for Windows Library](https://code.google.com/archive/p/openssl-for-windows/downloads)

## 1. Create private keystore

Make sure keytool command is global available (You can find in C:\Program Files (x86)\Java\jdk1.8.0_181\bin).

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hwa453ngba7m9rxq16uf.png)
```
keytool -genkeypair -v -keystore <RELEASE_KEY_PATH> -alias <RELEASE_KEY_ALIAS> -keyalg RSA -keysize 2048 -validity 10000  
```

Example:

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/462yef3yyr9wtpv3sn7w.png)

## 2. Apply zipalign

The zipalign file alignment tool makes it possible to greatly optimize Android application (APK) files.
I have Android Studio installed, so my Android SDK location is C:\Program Files (x86)\Android\android-sdk.
You have to use the latest Android SDK installed path. In my case is C:\Program Files (x86)\Android\android-sdk\build-tools\27.0.3.
The APK_UNSIGNED_PATH is a Release APK.

```
zipalign -f -v 4 <APK_UNSIGNED_PATH> <APK_PATH>
```

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iy9ruyj2ejqddglu26hl.png)

## 3. Sign APK

In the same path from step 2.

```
apksigner sign --ks <RELEASE_KEY_PATH> --ks-key-alias <RELEASE_KEY_ALIAS> <APK_SIGNED_PATH>
```

Verify signature in APK:

```
apksigner verify <APK_SIGNED_PATH>
```

If everything is correct you won't see errors in the console.

**Thanks for reading**

Thank you very much for reading, I hope you found this article interesting and may be useful in the future. If you have any questions or ideas that you need to discuss, it will be a pleasure to be able to collaborate and exchange knowledge together.
Pensamientos 5: Proyecto 1
Published: 2021-08-27 02:01:20

Este es un followup directo a los problemas de la entrada pasada, hago la entrada hasta ahorita porque ya solucioné de buena manera los problemas.

Así que lo primero que realicé estos días fue implementar una alternativa a ParseTreeProperty en Python, de hecho, pregunté cómo implementarlo en Python en Stackoverflow: https://stackoverflow.com/questions/68883516/how-to-check-the-type-of-an-operation-in-a-statement. Al final terminé respondiendo mi pregunta casi solo, por lo cual estoy orgulloso de eso.

Al tener el equivalente de ParseTreeProperty, mi diccionario de tipos de nodos, evaluar una expresión fue bastante sencillo, ya que solamente se obtiene el tipo de la operación o de la variable en ese location. 

Para resolver la llamada de un método debe contener los mismos parámetros (tipos y cantidad) que la definición formal, también fue muy útil este diccionario. La solución general fue, obtener por cada nodo de argumento el tipo, almacenarlo en una lista, y luego compararlo con los parámetros del método que se estaba llamando, de esta manera, se puede obtener fácilmente si está bien llamado o no el método.
Start your career as a frontend developer with these tips!
Published: 2021-08-27 01:55:55

To begin a new job, you must acquire the necessary skills.
You can learn these abilities in a variety of methods and with a variety of resources, but the route isn't always clear with so many alternatives available, and for someone just starting out, it may be daunting.

My goal in creating this is to actually guide you through the process and figuring out the path. Are you ready to take on a new challenge?

**Who are front-end developers?**
Have you ever looked at a website and wondered how it worked? How a website's layout looks on different screen sizes or how a button behaves when clicked? Frontend Developers are responsible for all of this and more.

**What you need to know for now**
* The internet and How it works
* HTML
* CSS3
* Javascript

**The internet and How it works**
You should know what HTTP is.
Find out more about the Domain Name System (DNS)
How to obtain a domain name and web hosting
HTML, in my opinion, is the cornerstone of web design. As a result, I want you to perceive it that way as well.

**What is HTML?**
HTML stands for Hypertext Markup Language.

The core technology used to determine the structure of a webpage — HTML — is essential to building webpages. To define whether a paragraph, list, header, link, picture, multimedia player or form should be shown on a web page in HTML is essential This is really awesome, isn't it?
Here's my learning route for you.

Learn the foundations (very important)
Conventions and Best Practices
Semantic HTML Semantic HTML elements are those that explicitly express their meaning in a human- and machine-readable manner.
Elements like as header, footer, and article are all deemed semantic since they correctly define the element's purpose and the sort of information it contains.
console.log(Hello World)
Tags: javascript, beginners
Published: 2021-08-27 01:13:16

Hello World, my name is Jimmy Kane and I am a Senior at Penn State Main.  I'm majoring in Human-Centered Design and Development with a minor in Information Sciences and Technology.  I am currently enrolled in an Introduction to Web Components course which I am excited to take this semester!  Most of my coding experience overall has been backend web/server development.  I had the chance to intern with Penn State Enterprise IT in their Software Engineering department which is where most of my realworld experience is from.  In this internship I developed a webscraper with an AWS Lambda and AWS DynamoDB; a Podcast Management System API built using a AWS DynamoDB linked to an AWS S3 bucket via an AWS Lambda Function and API Gateway; and I worked on the custom Penn State Alexa Skill.

Outside of Penn State my first internship was with the Bensalem Township School District’s IT department.  I got to see the inner workings of a small IT organization that does not code.  I was able to learn about Cisco Meraki, a Mobile Device Management system(MDM), the planning and executing of large IT projects, and being able to translate IT jargon to the average person’s diction level.  I also had the opportunity to Intern with Ford Motor Company IT this past summer as a Design Thinking Intern.  I was able to see how design thinking is applied by professionals in a large company and pick up some tricks by these professions for interviews.
Firebase auth keytool Opção inválida
Published: 2021-08-27 01:02:19

## Introdução

Fala clan, tudo bem?

Quero mostrar rapidinho como resolvi um problema daquele comando inválido para criar as chaves SHA do Projeto do Firebase. 

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

Quando eu estava rodando esse comando 

> keytool -list -v \
-alias androiddebugkey -keystore %USERPROFILE%\.android\debug.keystore

Apresentava este erro dizendo que a opção keytool era inválida.

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

Isso acontece porque eu não tinha a variavel de ambiente, então você tem que criar essa variavel que é basicamente o caminho de onde está o keytool. 

## Como resolver

E ele fica dento da pasta Java, que geralmente é esse caminho: 

>  C:\Program Files\Java\jdk1.8.0_291\bin

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

Copie esse caminho, vá em **Editar as variváveis de ambiente do sistema**, clique em Variáveis de ambiente > path (2 cliques) > novo > cole o caminho > ok.

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

Agora você tem que substituir essa variável **%USERPROFILE%** pelo seu caminho de usuário. Então vai ser basicamente esse:


> keytool -list -v -alias androiddebugkey -keystore C:\Users\jorge\.android\debug.keystore


Espero que tenha ajudado, valeu!

## Referências

https://developers.google.com/android/guides/client-auth
https://www.youtube.com/watch?v=bi_mMQfo90s
https://www.youtube.com/watch?v=1k-gITZA9CI&t=352s
Using the VueJS Composition API to Create Hooks for Supabase Database and Storage
Tags: vue, postgres, supabase, javascript
Published: 2021-08-27 00:56:10



{% youtube pDOD0sjVF9E %}


Sample application using [Composition API](https://v3.vuejs.org/api/composition-api.html) to create "hooks" to interact with the [supabase api](https://supabase.io/). 

This is a work in progress, but wanted to show the approach I used which might inspire some one to go all the way... This isn't using typescript which I think would be a great next step.

## Overview
The main objective here is to get isolated the functionality into specific composition functions and take advantage of the reactivity of vue to expose refs for the `data`, `error`, and `loading`.

if you look at one of hooks below
```javascript
import { ref } from "vue";
import useClient from "./sb-hooks";

/**
 * 
 * @param {*} table - table to execute query against
 * @param {*} columns - columns to return
 * @param {*} auto - if true, run query at startup
 * @returns 
 */
export default function (table, columns = "*", auto = true) {
  const error = ref(null);
  const data = ref([]);
  const loading = ref(false);

  // get supabase client
  const client = useClient();

  /**
   * this is the function that does the actual query
   */
  const doQuery = async () => {
    loading.value = true;
    console.log(table, columns);
    let { data: qData, error: qError } = await client
      .from(table)
      .select(columns);
    loading.value = false;
    data.value = qData;
    error.value = qError;
  };

  // if auto flag is set, run a startup
  if (auto) {
    doQuery();
  }

  return {
    // reactive variables...
    error,
    data,
    loading,
    // function to call to execute query
    doQuery,
  };
}

```
here is how you might use it in your component
```javascript

import useQuery from "../hooks/sb-hooks-select";
import { defineComponent } from "vue";

export default defineComponent({
  name: "HomePage",
  setup() {

    const { 
      loading, 
      error, 
      data, 
      doQuery 
    } = useQuery("products", "*", true);

    return {
      loading,
      error,
      data,
    };
  },
});
```
and you template would look like this, utilizing the reactive properties from the hook.
```vue
<div v-if="loading">LOADING...</div>
<div v-else-if="error" class="error-panel">{{ error }}</div>
<div v-else-if="data">
  <template v-for="item in data" :key="item.id">
    <router-link :to="`/detail/${item.id}`">
      <item-component :item="item" />
    </router-link>
  </template>
</div>
```

### More
- Tons more content on my Youtube Channel [here](https://www.youtube.com/channel/UCMCcqbJpyL3LAv3PJeYz2bg)
- Udemy Courses [here](https://www.udemy.com/user/aaronsaunders/)
- GumRoad Content [here](https://fiwic.gumroad.com/)
HRF Asylum Update
Published: 2021-08-27 00:31:48

It has been a pleasure working on the HRF Asylum web app. I learned so much getting the upload function to work. How to set up my amazon s3 bucket and to use Multer-s3 to upload multiple files at once. I learned so much about ant design and how to display initial form data, how to do form validation, and how to stylize the components. I learned how Ploty components interact with the ds backend to display the graphs. I wish to have more time with this app, there's still a lot more thing that needs to be done. The review case form still needs to have the correct put request. The user notification tab still needs to get hooked up to the backend. The Plotly graph still needs some styling done. I hope the next group that works on this app will be able to understand the code I wrote for my upload pdf function. It was nice receiving feedback from my peer because that feedback helps me become a better listener. I work hard to get my work done and have no patience for those who waste my time with feedback that doesn't have a good backing or are unprepared for my questioning, sometimes it can be a little difficult for me to differentiate what feedback is important and what I should ignore but I will work on that. Working on this project help me learned a lot about how the ds team interacts with the backend and how the backend interacts with the front end. I didn't know how to use nodemailer, Multer-s3, or ant design before working on this project. Spending the last 4 weeks working on this app help me become a better coder and communicator. 

https://youtu.be/zxbbQCE2RL8
Some Scattered Thoughts
Published: 2021-07-15 04:34:47

I don't have a solid lead for a post today so I'm taking this head-on and writing thoughts as they come.

###Cow List
First, I finished the Cow List sprint. That was a big win. It was slow-going but deliberately so. I learned a ton, and feel ready to do it again. It's a feeling that puts me at ease in advance of the technical assessment.

###The Technical Assessment
On the TA - I've really got no worry. A few reasons:
- There's just no way that I'm gonna make it to near-halfway and not be permitted to continue. That's just inconceivable to me. Beyond the realm of possibility. If I had to study more, I'd do it. If I had to do anything differently, I'd do it. I'm doing what the program is asking of me.
- In the meta-game, HR wants us to proceed to the next stage. They can't collect the other half of tuition if we don't! They're going to protect their revenue, and that means putting us in a position to learn and do well. And certainly to pass their tests.
- I'm good at this.

###Entrepreneurship
I've continued to think about [this](https://dev.to/zbretz/entrepreneurship-37e1) and have had some conversations with my peers in the program. I'm gonna keep researching, learning, talking, and working on it.

I put it this way in conversation a few days ago:
There is a universe out there in which a HR project blew up and became a major start-up / company / whatever. What did they do - what circumstances were present - when that happened. Can I recreate those steps or circumstances? That's the challenge.

###This Blog
I don't want to write just to write. A post like this is a little demotivating. Why am I writing it? That was a rhetorical question when it came out, but it has an easy answer. I committed myself to doing it. This is a daily blog. This is today's post.

But I'd rather have something more to say than this. So I'll think again about changing this blog's scope and posting schedule. If I slow down, I'll have more time to gestate worthy ideas and posts.

I'd like to create an attractive 'home page' to this blog. And then have some serial/persisting content like a live 'tech debt' list, a tips/tricks section for little snippets that aren't full-length posts, the 'how I'm feeling' data visualizer.

___

Alright, well another post is in the books.
Sitting in class
Tags: andfeelingsmall
Published: 2021-08-27 00:14:09

Look I get it seems strange to be typing during class no judgement either way.

But I had this thought I had to get out.

I am constantly amazed by the continuous bend in the learning curve there is in this field.

I am constantly having to change my thinking and how I am thinking in ways that never seem organic but because they are in FACT created by people, to date, then it is actually organic.

But now as AI grows in this space, will there ever be organic-to-AI code? What would that look like?

Definitely a question to follow-up on.

Cheers.
Just make a new table
Published: 2021-08-27 00:11:30

I am working on a project that requires me to link up multiple tables in my database together so it would be more efficient for the front end to grab that information. While linking up my table I encounter a problem. My app originally was designed so that there can be only one judge per case, however, I need each case to have multiple judges. At first, I ponder as to what is the best way of solving this issue. At first, I tried turning all the judges names into a string but then realized that it will be very difficult for the front end to find the id of each judge. Next, I tried making a new copy of the case for each one of the judges but then I then realize that will be very difficult to sort and it may return duplicate data. Finally, I remembered a solution my old instructor taught me, "just make another table". I made a new table linking all of the judges to the case and called it judges_to_case. Now, whenever I join the two tables together I can link them both with my new Judges_to_case table.
How to add text or title to the browser tab using HTML?
Tags: html
Published: 2021-08-27 00:00:00

---
  title: How to add text or title to the browser tab using HTML?
  published: true
  tags: HTML5
  date: Fri Aug 27 2021 05:30:00 GMT+0530 (India Standard Time)
  canonical_url: https://melvingeorge.me/blog/add-text-title-to-browser-tab-using-html
  cover_image: https://melvingeorge.me/_next/static/images/main-0e955b2ece92bed9a39f5308165bfef9.jpg
  ---
  [Originally posted here!](https://melvingeorge.me/blog/add-text-title-to-browser-tab-using-html)
  
To add a text or title to the browser tab using HTML, we can use the `title` HTML element tag inside the `head` HTML element tag.

For example, consider we want to add a text called `Home` to the browser tab when the user visits the home page of your website.

So for that, we can use the `title` HTML element tag and put the text inside the opening and closing block of the `title` HTML tag.

It can be done like this,

```html
<!-- Add text or title to the browser tab using the 'title' HTML element tag -->
<!DOCTYPE html>
<html>
  <head>
    <!-- 'title' tag with content of 'Home' -->
    <title>Home</title>
  </head>

  <body>
    Hello World!
  </body>
</html>
```

Now the browser tab text will be changed to the text `Home`.

See the above code live in [JSBin](https://jsbin.com/tusupuvome/2/edit?html,output).

That's all 😃!

### Feel free to share if you found this useful 😃.

---
I ❤️ coding
Tags: dopamine, hobbies
Published: 2021-08-28 18:34:05

---
title: I ❤️ coding
published: true
date: 2021-08-27 00:00:00 UTC
tags: dopamine,hobbies
canonical_url: https://jhall.io/archive/2021/08/27/i-%EF%B8%8F-coding/
---

It happened again.

I got pulled into a conversation about whether or not it’s appropriate to code after work hours.

“I get paid to code. I’d rather spend my limited free time doing something I enjoy.”

“If I want to learn something new, I’ll get a job that pays me to learn it.”

“Coding is work.”

I get it.

If that’s how you feel, you probably shouldn’t be coding in your free time (except perhaps on an exceptional basis of [résumé building](https://jhall.io/archive/2021/06/02/skip-the-take-home-assessment/)).

But not everyone sees coding that way.

I really enjoy coding. For me, it is a pass time.

Given the choice between playing on my PlayStation or adding a feature to a hobby project, or fixing a bug in an open-source project, I often choose one of the latter. Not because I’m obligated. Not because it improves my résumé.

Simply because I enjoy it.

I can get a dopamine hit from completing a level in a video game, or from fixing a bug. Sometimes I choose the former. I often choose the latter.

In fact, it’s this very love of coding that led me into the industry in the first place. And I guess I’ve been fortunate enough not to have had the love of coding killed by my jobs (although there have been times this has been true).

Should you code in your spare time? It’s up to you. I do, because it’s fun. If it’s not fun for you, you probably shouldn’t. And you shouldn’t feel bad about it.

* * *
_If you enjoyed this message, [subscribe](https://jhall.io/daily) to <u>The Daily Commit</u> to get future messages to your inbox._