teleren/devto huggingface dataset:
Dealing with Predicate Expression Filters in Aerospike REST Client (Part 1)
Tags: aerospike, rest
Published: 2020-04-23 17:36:16

![](https://images.unsplash.com/photo-1568993703320-07e80bc8e7ab?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=2550&q=80)

If you're already an Aerospike user, you’ve likely developed with one of the client libraries available on [GitHub](https://github.com/aerospike), and might be familiar with [Predicate Expression filters](https://www.aerospike.com/docs/guide/predicate.html), which became available for all transactions starting from Aerospike Server v4.8.

I want to show how you would use PredExp filters with the REST client.

So what is the PredExp filter and why do we need it? Predicate expression filters are applied to scan, query and key-value results on the server. Meaning, if an expression evaluates to false, the transaction is ignored.

The [REST client](https://github.com/aerospike/aerospike-client-rest) uses the [Java client](https://github.com/aerospike/aerospike-client-java) under the covers, where PredExp filters should be declared as an array in postfix notation. This form is hard to read and not intuitive. Having that in mind, how can we send such a construction using the REST API?

To solve this issue, I created a sort of DSL in infix notation, which uses well known logical operators and supports a special filters syntax.

A lot of theory till now, let's jump to some examples.

Here’s an example of a Java client PredExp filter:
```
PredExp.integerBin("bin2"),
PredExp.integerValue(126),
PredExp.integerGreater(),
PredExp.integerBin("bin2"),
PredExp.integerValue(140),
PredExp.integerLessEq(),
PredExp.and(2),
PredExp.integerBin("bin2"),
PredExp.integerValue(360),
PredExp.integerEqual(),
PredExp.or(2)
```
Which actually expresses the following expression:
```
(bin2 > 126 and bin2 <= 140) or bin2 == 360
```
Isn't the latter more concise and intuitive?

What is left, is to Base64 encode it, and send it as a GET parameter with the request.

Want the bin value to be a String? Just wrap it with double quotes like this. For  non-numeric values we can omit the quotes:
```
(bin2 == "126" and bin2 != "140") or bin2 == ten
```
Before I wrap up, let's talk about some PredExp use cases.

* Let's say you have a counter, but you only want to increment it if the value is under a certain number (for example 100).

* Don't alter the record if its expiration time is above or under some particular value (here you'll need to write a special filter VOID_TIME which is not covered in this post).

This was a very simple example of how to use Predicate Expression Filters in the Aerospike REST Client. In my next post, I plan to write about special filter operators and their syntax.

If you still haven't tinkered with the Aerospike REST client, you can find it here:
[https://github.com/aerospike/aerospike-client-rest](https://github.com/aerospike/aerospike-client-rest)

Take care, stay tuned and continue to Aerospike. Till next time.
React click outside hook
Tags: react, webdev, javascript
Published: 2020-04-23 17:11:09

In case your click outside logic sucks - grab & use this one:
```jsx
const useClickOutside = (ref, handleClickOutside) => {
  React.useEffect(() => {
    const handleTargetClick = e => {
      if (ref.current && !ref.current?.contains(e.target)) {
        typeof handleClickOutside === "function" && handleClickOutside(e)
      }
    }

    document.addEventListener('mousedown', handleTargetClick, true)

    return () => {
      document.removeEventListener('mousedown', handleTargetClick, true)
    }
  })
}
```
Creating an error page in Nuxt.js
Tags: nuxt, vue
Published: 2020-04-23 17:04:54

---
canonical_url: 'https://debbie.codes/blog/nuxt-error-page'
---
An error page is the page you see when you arrive at a page that can't be found. These are typically called 404 pages. To create an error page all you need to do is create an `error.vue` file in your layouts folder. Layouts? Yes, that is correct. Although the error page is a page, it must go inside the layouts folder. 

In your `error.vue` page you can keep it simple by just adding a template with some text.
```html
<template>
  <div>
    <p>OOOOPPPPPPS. No page found</p>
  </div>
</template>
```
Or you can print a message depending on the error status which you have access to by using `error.statusCode`.

```html
<template>
  <div>
    <h1 v-if="error.statusCode === 404">Page not found</h1>
    <h1 v-else>An error occurred</h1>
  </div>
</template>
```

Don't forget to add the `error prop` so you can use `error.statusCode`.

```html
<script>
export default {
  props: ['error']
}
</script>
```

You can also add a layout to your error page just like you can do with any other page.

```html
<script>
export default {
  layout: 'basic'
}
</script>
```

So as you can see it is really easy to add an error page yet it is something we normally forget todo. Error pages can also be fun so feel free to add some nice images and don't forget to link back to the home page to make it easier for your users if they end up on your error page. 
```html
<NuxtLink to="/">Home page</NuxtLink>
```

Note: Although this page is in the layouts folder you do not use the `<Nuxt />` component in this page.
Errors V/s Exceptions In Java
Published: 2020-04-23 17:03:00

Summary of Differences
Recovering from Error is not possible.
We can recover from exceptions by either using try-catch block or throwing exceptions back to caller.
All errors in java are unchecked type.
Exceptions include both checked as well as unchecked type.
Errors are mostly caused by the environment in which program is running.
Program itself is responsible for causing exceptions.
Errors occur at runtime and not known to the compiler.
All exceptions occurs at runtime but checked exceptions are known to compiler while unchecked are not.
They are defined in java.lang.Error package.
They are defined in java.lang.Exception package
Examples :
java.lang.StackOverflowError, java.lang.OutOfMemoryError
Examples :
Checked Exceptions : SQLException, IOException
Unchecked Exceptions : ArrayIndexOutOfBoundException, NullPointerException, ArithmeticException.
AWESOME CSS FRAMEWORKS (PART 1)
Tags: javascript, css, html, codenewbie
Published: 2020-04-23 16:58:49

CSS frameworks are great tools for web development .

I have compiled a list of some awesome frameworks.

This is part 1 of that, as there were a lot.

Stay tuned for PART 2.[(Available here!)](https://dev.to/totallymustafa/awesome-css-frameworks-part-2-2pdn)

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

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

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

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

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

http://topcoat.io/
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/6n2hpi1x9b3fll6bms25.png)
I published my first YouTube video 🎉
Tags: discuss, css, tutorial, webdesign
Published: 2020-04-23 16:58:14

I published my first [YouTube Video](https://www.youtube.com/watch?v=G7hAgGudKmA) 🎉 and I am so excited about it!

I always keen to learn, and share knowledge by helping others. A few years ago I start writing articles [here](https://dev.to/_elmahdim) and [there](https://medium.com/@elmahdim), before that I used to make [reusable  interactive demos](https://codepen.io/elmahdim/pens/popular) once in a while and answering questions from [forums & communities](https://codepen.io/collection/DmrOjL).

## Nearly everyone likes to "read" pictures

I enjoy writing, but I recently found myself enjoying the process of recording, editing videos and it seems to be fascinating path to move towards it.

Hundred of thousands (including me) if not millions are watching YouTube videos to be entertained, inspired, relax or to *learn* something new. There's dozens of rooms for everybody to create and provide more and more useful content, so I challenged myself and I am excited about it to create a [Elmahdi Media](https://www.youtube.com/channel/UCWaZqFpykcDUwC3q7JPDZ8g?sub_confirmation=1) channel on [YouTube](https://www.youtube.com/channel/UCWaZqFpykcDUwC3q7JPDZ8g?sub_confirmation=1) to create a variety of *quality* web developments and programming videos with the aim to help others build craft clean and user-friendly software for real world applications.


[CSS Auto Dark and Light Mode](https://www.youtube.com/watch?v=G7hAgGudKmA) is my kick off video. Feedback, comments and suggestions appreciate it 🙏. If you have any or corrections to make, please do not hesitate to drop me a note/comment.
TOP 5 Apps for Students
Tags: apps, students, programming
Published: 2020-04-23 16:42:01

Every student needs the right set of apps to make studying easier. This, together with online writing services, ensure that students have a smooth learning experience. <a href="https://killer-papers.com/">killer-papers.com</a> ensures that you submit all your assignments on time. 

Here are the top 5 apps for college students.

1. Evernote 
At the top of our list is Evernote, which is an all-in-one app for college students. It allows you to jot down notes on your smartphone and transfer them to your computer. 
This is an excellent application that helps you write down ideas to use on assignments and projects. If you’re juggling several tasks, you tend to forget easily. Evernote allows you to write everything down, so you don’t lose any information.

2. Dictionary.com Pro Learn Words 
Next is Dictionary.com that helps you discover new words. This comes in handy when you’re paraphrasing an assignment, and you don’t want to use a particular word too many times. Dictonary.com helps you find synonyms to use, so your assignment is not monotonous. This application has a word of the day feature that ensure you learn a new word each day.

3. RefMe – Reference Made Easy
Referencing is commonplace in college because you have to indicate your sources. RefMe is an award-winning application that helps you reference publications and books. 
It is the best recommendation by <a href="https://topicsbase.com/">Topicsbase.com</a> compatible with Android and iPhone smartphones, which means regardless of the device you’re using, you can access it.
What this application does it that it scans the barcodes of books and generate an accurate citation. You can also enter a publication’s URL for the same.

4. PDF Reader Pro
PDF readers allow you to read PDF documents on your mobile phone. As you know, saving files as PDF secures the information therein. Most of your professors will be sending notes and assignments in PDF form.
Instead of waiting until you have access to your laptop, download PDF Reader Pro to go through notes and assignments on your phone.

5. StudyBlue 
This is a crowdsourcing library that gives you easy access to over 300 million flashcards, study guides, and notes. This is a platform for students to share study material with each other. 

Conclusion 
The right set of applications ensures that you have a smooth and seamless learning experience in college. Make sure you find out the compatibility of an app before downloading it. Students should make use of all the resources available to them to make life easier.
Git Every Day!
Tags: git, dailydose, giteveryday, letslearntogether
Published: 2020-04-23 16:39:02

Hi Devs!

I'm starting a daily dose series for **git** (version control system).
<hr>
>A simple **_git_** command or trick or a small article for git terminology per day.

- Dose : 
 - Try out the following command to see the abbreviated log and graph for your git repository.
 - `git log --oneline --graph`


>"What are the special flags do you use with `git log` command ?"
Game Development
Published: 2020-04-23 16:12:45

---
title: Game Development
published: true
description: 
tags: 
---

1. There are tons of gaming engines(more than javascript frameworks!)- choice depends on
- what devs are comfortable with
- features offered by each platform

"It is like choosing a stack for general"

2. Mostly people now use Unity to develop games

3. Most of framework target android/ios

4. Process of game dev is not very different from web dev.
You decide on game genre, features, people to handle these devs/QA.

5. Difference is, games are very UI & performance critical. No one is going to comeback even if functionality is excellent.

6. Product manager: looks at game holistically - like a product
Game designer: UI/UX

Based on conversation with a friend who works for a renowned Game company.
Tooltips not showing in my react app
Tags: react, javascript, reactnative
Published: 2020-04-23 16:02:06

I have put tooltips in my react app but not a single one of them showing. why is this? where is the fault lies? I 'll post the code here.

TooltipSpan.js
```
import React from 'react';
import { OverlayTrigger } from 'react-bootstrap';

const TooltipSpan = (props) => {
  const { tooltip, className } = props;

  return (
    <OverlayTrigger placement="top" overlay={tooltip}>
      <span className={className} />
    </OverlayTrigger>
  );
};
export default TooltipSpan;
```
importing this to the below file. 
```
Like.js
import React, { Component } from 'react';
import { OverlayTrigger, Tooltip } from 'react-bootstrap';
import TooltipSpan from './TooltipSpan.js';

class Like extends Component {

  handleAddition = () => {
    this.props.onAddition();
  }

  handleDelete = () => {
    this.props.onDelete();
  }

  render() {
    const { isLiked, canLike, isBlocked, isReported } = this.props;
    const tooltipCannotLike = (
      <Tooltip id="cannot-like">You can not like a profile without a profile picture !</Tooltip>
    );
    const tooltipLike = (
      <Tooltip id="like">Like this profile to be able to talk to him. He also like you !</Tooltip>
    );

    if (isBlocked || isReported) {
      return <span className="fa fa-star cannot-like" />;
    }
    if (!canLike) {
      return <TooltipSpan className="fa fa-star cannot-like" tooltip={tooltipCannotLike} />;
    }
    if (isLiked) {
      return <button className="fa fa-star liked" onClick={this.handleDelete} />;
    }
    return (
      <OverlayTrigger placement="bottom" overlay={tooltipLike}>
        <span>
          <button
            className="fa fa-star-o"
            onClick={this.handleAddition}
          />
        </span>
      </OverlayTrigger>
    );
  }
}
export default Like;
```
Like.js is one file. I have a block and report js files, and not a single tooltips working in those files too. I have one question. Does the building the app fix the issues like this? I haven't yet built this app.
Custom emoji cursors with SVG
Tags: css, svg, cursor
Published: 2020-04-23 15:59:25

I was visiting some websites this morning, when I discovered [emojicursor.app](https://www.emojicursor.app/)

And I started testing things, who leaded to... this:

{% codepen https://codepen.io/lmmm/pen/LYpxzgV default-tab=result %}

Result on xubuntu/firefox:

![screenshot snippet rendered on firefox](https://up.l3m.in/files/1587650172.png)

This is a *bad* idea, since the emojis will render differently depending on your platform and browser (and will not appear at all if you're on smartphone), but it's interesting to know that you can mess up with svg *and* emojis on `cursor` property.

And you, have you discovered some strange and/or unknown useless css tricks ?
Shame vs Guilt
Tags: impact, webdev, productivity, change
Published: 2020-04-23 15:57:23

I grew up in the '80s in a predominantly white region of the country and in a house where racist jokes were commonly told by my parents. For me, this was a very normal thing. I thought nothing of it. At sixteen I had a job with an African American manager who I greatly loved and admired. He was by far the best and friendliest manager. Then one day while chatting with a coworker a racist comment slipped from my lips right in front of him. To this day I can think of that moment and instantly be transported back there. I can see the theater lobby. I can smell the popcorn. I can see my coworker's uniform. And most of all, I can still feel the intense pain and embarrassment I felt in that moment.

In that moment, if I could have summoned an avalanche on my own head I gladly would have. Even the memory of that moment is physically painful. Excruciatingly painful.

In cases like this, the intense feelings of guilt and shame can be beneficial, teaching us what kinds of behavior are bad for us, either socially, or emotionally. But due to how we as humans tend to "tell ourselves stories" they can also be extremely detrimental…instilling a fear of that situation. Or we warp the story, blaming others and causing stressed or broken relationships.

This pain we feel can, therefore, cause either positive or negative change in us.

This is the difference between shame and guilt. They both feel the same to us. But shame causes negative change, guilt causes positive change. Guilt says "I have done something wrong" and shame says "I AM wrong".

Thankfully, we have control over which of these we feel. The only difference between shame and guilt is how we react to the pain. Do we tell ourselves that we made a mistake and need to work to improve? Or do we tell ourselves things like "I'm no good" "I suck at that" "I ALWAYS say stupid things like that", "Nobody likes my work", "I'll never be able to do that well", "I always screw things up", "I just can't do things right"?

This kind of inner dialog is shame. It doesn't allow for growth and repair.

Guilt instead, is turning the previous statements into, "I'm not great at that. I need to improve", or, "I really hurt their feelings. I should work harder to avoid saying things like that"; "I need to stop doing that"; "I need to find a way to fix the damage I caused"; "I need some help to make this better"; or even, "I need to be ok with being less than I want to be"

These statements allow for growth and self-compassion. And the nice thing is that if we consciously tell ourselves these things, then we can open our minds up to embracing guilt instead of shame.

Are you regularly overwhelmed by shame? What things put you into a hole of self-despair?

Happy Coding!

Enjoy this discussion? Sign up for our newsletter [here](https://thinkster.io/?previewmodal=signup?utm_source=devto&utm_medium=blog&utm_term=shamevsguilt&utm_content=&utm_campaign=blog).

Visit Us: [thinkster.io](https://thinkster.io?utm_source=devto&utm_medium=blog&utm_term=shamevsguilt&utm_content=&utm_campaign=blog) | Facebook: @gothinkster | Twitter: @GoThinkster
Interference: Open-source distibuted database with complex event processing
Tags: opensource, java, database, distributedsystems
Published: 2020-04-23 15:56:36

What is <a href="https://github.com/interference-project/interference">interference</a>? 

A bit of history. Several years ago, as part of an internal project, we tried to create a service that meets the following minimum requirements:

- as simple as possible integration with an existing java application
- support for persistent data storage
- indices support
- support for a distributed database and distributed operations, such as the ability to insert or modify data in a database from any of the available nodes
- the easiest cluster deployment
- transaction support
- basic SQL support with complex event processing and stream SQL support

One of the outcomes of this development was an open source product branch called interference. What can this service do?

Easy integration with java application. You include the library and then simply manage all the interference functions from within the java application using session methods, JPA annotations, queries and direct access to table objects.
Interference is a distributed service. This means that this service can be used within a distributed cluster, or you can build a distributed event-driven application based solely on this service, without any additional services like coordinators and so on.

Interference is not an RDBMS in the usual sense. You do not use JDBC or anything like that to access the data. Instead, direct object-relational mapping is used that works directly with persistent storage and remote event transport mechanisms.

In the next time, I plan to publish an article with a detailed review of the service architecture and performance metrics.

Now, read the documentation for a detailed understanding. We are always happy to answer your questions.

Reference:
https://github.com/interference-project/interference
Super Cool and Super Useless Secret Chrome Feature
Tags: devtools, secret, hack
Published: 2020-04-23 15:51:30

---
title: Super Cool and Super Useless Secret Chrome Feature
published: true
description: You probably don't know about this hidden feature of Google Chrome. It's super cool and super useless.
tags: devtools, secret, hack
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/s80nto48oobepcmfdbbn.jpg
---

Debugging a website inside DevTools is crucial.

But what if you are developing DevTools? How do you debug that?!

Well with DevTools within DevTools ofcourse! DevTools are just another HTML page so you can open another DevTools!

Just open DevTools in separet window and press `Command+Option+I` for Mac and `F12` or `Control+Shift+I` for Linux/Windows. You will get another window!

![How to open DevTools in DevTools](https://dev-to-uploads.s3.amazonaws.com/i/ntu0zbe7l5ud2rr097zz.gif)

For you as a web dev it's probably useless. But can be handy for DevTools devs.

![Spiderman Meme](https://dev-to-uploads.s3.amazonaws.com/i/2aomh64l4hrgcyv4u4wb.jpg)
The thought with nerve of them
Published: 2020-04-23 15:36:15

Today people feel the need to take advantage just cause they can and then complain when you call them out especially when you give the the opportunity to do different , for some reason I can't help but not trust people automatically in the same almost though I tend to have faith in people is there a such thing as too much faith I'm not entirely sure but am truly rindi g my way to the answer whether it's right or not is a  a concern especially when it involves faith
It's Tech Skills Day!!
Tags: programming, webdev, javascript, career
Published: 2020-04-23 15:34:34

---
title: It's Tech Skills Day!!
published: true
description: We're celebrating the power of tech skills all day today, and going live to talk with some of the most influential names in tech.
tags: programming, webdev, javascript, career
---
We're celebrating the power of tech skills all day today, and going live to talk with some of the most influential names in tech.

The event has passed, but you can watch the recording of it!

##[Watch the Recording Now!](https://bit.ly/TechSkillsDay)

No sign-up required, just click and watch. 

## Schedule 
*(All times Eastern Daylight Time)*

--- 

### 11:00 AM RACHEL HIGHAM
*Managing Director of IT for BT Technology*

---

### 11:15 AM WENDY WARHAM
*Fujitsu VP Digital Transformation & Innovation*

---

### 11:30 AM ANDREW YANG
*Entrepreneur & founder of Venture4America, former U.S. presidential candidate*

---

### 12:00 PM ASIM HUSSAIN
*Green computing advocate, speaker, author & teacher*

---

### 12:30 PM DEBORAH KURATA
*Developer, consultant & Pluralsight Angular author*

---

### 1:00 PM AARON SKONNARD
*CEO of Pluralsight*

---

### 1:30 PM ERIC DAIMLER
*Former White House AI & Robotics expert, CEO of Conexus*

---

### 2:00 PM SCOTT HANSELMAN
*Programmer, teacher, speaker, podcaster, blogger & open source program manager at Microsoft*

---

### 2:30 PM CHLOE CONDON
*Senior Cloud Advocate at Microsoft*

---

### 3:00 PM TROY HUNT
*Creator of Have I Been Pwned, web security expert & Pluralsight author*

---

### 3:30 PM JOHN PAPA
*Developer Relations at Microsoft & Pluralsight author*

---

##[Watch it live now!!!](https://bit.ly/TechSkillsDay)