teleren/devto huggingface dataset:
Learning Scala for Spark, or, what's up with that triple equals?
Tags: spark, scala
Published: 2017-12-11 22:48:34

---
title: Learning Scala for Spark, or, what's up with that triple equals?
published: true
description: 
tags: spark, scala
---

*This article originally appeared [on my blog](http://wrschneider.github.io/2017/09/24/spark-triple-equals.html)*

I began to learn Scala specifically to work with Spark.  The sheer number of language features in Scala can be overwhelming, so, I find it useful to learn Scala features one by one, in context of specific use cases.  In a sense I'm treating Scala like a DSL for writing Spark jobs.

Let's pick apart a simple fragment of Spark-Scala code: `dataFrame.filter($"age" === 21)`.

There are a few things going on here:

* The `$"age"` creates a Spark `Column` object referencing the column named `age` within in a dataframe.  The `$` operator is defined in an implicit class [`StringToColumn`](https://spark.apache.org/docs/2.1.1/api/java/index.html?org/apache/spark/sql/SQLImplicits.StringToColumn.html).  Implicit classes are a similar concept to C# extension methods or mixins in other dynamic languages.  The `$` operator is like a method added on to the `StringContext` class.

* The triple equals operator `===` is normally the Scala type-safe equals operator, analogous to the one in Javascript.  Spark overrides this with a method in `Column` to create a new `Column` object that compares the `Column` to the left with the object on the right, returning a boolean.  Because [double-equals (`==`) cannot be overridden](https://stackoverflow.com/questions/7681183/how-can-i-define-a-custom-equality-operation-that-will-be-used-by-immutable-set), Spark *must* use the triple equals. 

* The `dataFrame.filter` method takes an argument of `Column`, which defines the comparison to apply to the rows in the `DataFrame`.  Only rows that match the condition will be included in the resulting `DataFrame`.  

Note that the actual comparison is not performed when the above line of code executes!  Spark methods like `filter` and `select` -- including the `Column` objects passed in--are lazy.  You can think of a DataFrame like a query builder pattern, where each call builds up a plan for what Spark will do later when a call like `show` or `write` is called.  It's similar in concept to something like `IQueryable` in LINQ, where `foo.Where(row => row.Age == 21)` builds up a plan and an expression tree that is later translated to SQL when rows must be fetched, e.g., when `ToList()` is called.
Make your own podcasting platform!
Tags: podcast, sanity, javascript, showdev
Published: 2017-12-11 21:47:18

---
title: Make your own podcasting platform!
published: true
description: Simple steps to get started with podcasting on Sanity CMS
canonical_url: https://hackernoon.com/make-your-own-podcasting-platform-ab833cf16e1c
cover_image: https://thepracticaldev.s3.amazonaws.com/i/ofyvrcfdutqvxi2c5g4f.png
tags: podcast, sanity, javascript, showdev
---

*tl;dr: run `sanity install podcast` and follow the instructions on [www.sanitypodcastfeed.com](https://www.sanitypodcastfeed.com/)*

Sanity is a fully customizable, headless CMS that you can install and get started with within two minutes if you know some basic JavaScript. Just run `npm install -g @sanity/cli && sanity init` to get started, and [follow these instructions](https://www.sanity.io/docs/introduction/getting-started).

It’s also possible to extend and write plugins for Sanity. If you know React you can make your own custom input-fields, or custom tools within the Content Studio. You can also bootstrap content models with ready-to-go fields and content types. I know because I recently did this to make it possible to host your own podcasts (yes, that’s plural) in Sanity. Just run `sanity install podcast` and *Podcast* and *Episode* will appear as new content types in your Studio.

![The podcast editor in Content Studio](https://thepracticaldev.s3.amazonaws.com/i/ajkbw71mxaivj5ioqawr.png)

I’m not sure if it even makes sense, but this setup also allows you to connect an episode to *multiple* podcasts. Perhaps you want an exclusive feed for only paid supporters or the like? Well, now you can!

![You can tie an episode to multiple podcasts](https://thepracticaldev.s3.amazonaws.com/i/we0m3m3lbl0zy52gzuo8.png)

You’ll save your mp3-files in Sanity and have them available on a pretty fast network with CDNs. You also have pretty good control over bandwith use in the [Sanity control panel](https://manage.sanity.io/).

![This on the free tier](https://thepracticaldev.s3.amazonaws.com/i/2z0yweve1b8pqr24ulxa.png)

Sanity alone cannot really do all the work however, because it only outputs JSON. That’s generally awesome if you make a website, Alexa-skill or some other stuff, but most podcatchers and directories require a RSS-feed. So I have made that for you as well.

You can either go to [www.sanitypodcastfeed.com](https://www.sanitypodcastfeed.com/) and follow the simple instructions there to have your RSS-feed instantly available, or you can [fork, host and tweak it at your own](https://github.com/kmelve/sanity-podcast-server) if more control and customizations is required. It’s just a simple node.js-server that runs Hapi, and transforms the data from Sanity into a RSS-feed.

The plugin and the podcast feed service is still in beta. [Feel free to let me know how it works for you](https://github.com/kmelve/sanity-plugin-podcast/issues), and especially if it doesn’t!

[![Head over to www.sanitypodcastfeed.com](https://thepracticaldev.s3.amazonaws.com/i/bxrjvppl8i3tzfjx9nat.png)](https://www.sanitypodcastfeed.com)
The power of VS Code
Tags: productivity, beginners, tips
Published: 2017-12-11 21:10:54

---
title: The power of VS Code
published: true
description: Usage of a built in VS Code Markdown support
tags: #productivity #beginners #tips
cover_image: https://john-dugan.com/wp-content/uploads/2015/11/vs-code-logo.png
---

I want to start with a couple of questions...
> Are you using [VS Code](https://code.visualstudio.com/) editor? Are you writing  articles to [dev.to](https://dev.to/)? Or are you documenting your work/code with [Markdown](https://en.wikipedia.org/wiki/Markdown)? 

I assume that you will answer `yes` to all of my questions above. But...

> Do you know that VS Code has built in support for Markdown?

If your answer is `no` I'll show you a nice tip. I'll reveal a secret. I'm kidding this is not a secret. It's in official  documentation but I haven't read they earlier. If you've created some document and saved it with `*.md` extension you can trigger VS Code to show you live preview of that file. Only what you need to do is to press `Ctrl+Shift+V` and live preview will appear in new tab. In my opinion even more powerful is combination of buttons: `Ctrl+K+V` which end with side-by-side live preview. Now you can work comfortable on your next dev.to article.

![Markdown in action](https://code.visualstudio.com/assets/docs/languages/Markdown/selection-preview-scroll-sync.gif)

Has you known about those shortcuts? If not just try to play with them. I hope this tip will be helpful to you.

### Extras:

- [More about Markdown and VS Code](https://code.visualstudio.com/docs/languages/markdown)
- __*Notice*__ if combination of `Ctrl+Shift+V` and/or `Ctrl+K+V` doesn't work please check if you saved file with `*.md` extension. Without that preview won't work.

At the end I want to tell you something funny. I want to tell you how I found this nice tip. I'm planning to work more with VS Code so I've printed a VS Code shortcuts cheatsheet. It's laying on my table. Today on during my daily stand up I wanted to eat a mandarin. By the way I know that's naughty. Juice from the fruit smudged paper next to this shortcut so that's the way I found it. It was next to me all the time and I didn't see it. Fortunately accident with mandarins caused that I found it.
Think Company is hiring a Web Developer
Tags: css, html, react, hiring
Published: 2017-12-11 20:41:25

Recruiters and staffing companies NEED NOT contact us and DO NOT have permission to contact candidates on our behalf.

Think Company has been named one of the Best Places to Work by the Philadelphia Business Journal! 

If you’re an experienced web developer based in the Philadelphia area and are interested in working for an award-winning design consultancy, please read on!

Think Company is hiring experienced Web Developers who are passionate about crafting code that is as beautiful and as elegant as our designs. Our development team is comprised of technologists who understand and are able to reconcile the goals of development, design, and business. We believe in open web standards, progressive enhancement, accessibility, and making things fast. We are a team of individuals with diverse skills who love learning and sharing knowledge.


## Are you someone who...

* Crafts web standards compliant, progressively enhanced, accessible HTML, CSS, and JavaScript to accurately translate responsive and adaptive design visions into code
* Has experience with or is open to learning newer web technologies, such as web components and single page application frameworks and libraries like React
* Has experience with or is open to learning server-side programming languages and technical stacks, such as PHP, .NET, Java/JSP, and ColdFusion
* Has experience with or is open to learning various CMS platforms, such as WordPress, Drupal, Adobe Experience Manager, and Sitecore
* Has experience with or is open to learning about test-driven development and various build/CI tools
* Demonstrates great attention to detail and a service-oriented mindset
* Possesses exceptional verbal and written communication skills
* Works collaboratively with cross-functional teams, including visual and UX designers, project managers, software engineers, QA engineers, and product owners
* Wants to make a positive impact in the lives of our clients, and our clients' customers

If this sounds like you, let's talk! Please submit: a cover letter introducing yourself, your resume, and a link to your personal web site and/or at least three URLs showcasing your front-end code.

[Apply here!](http://tbi.applytojob.com/apply/RPdT1prq5T/Web-Developer?source=dev.to)

Position details:  Full-time (40 hours/week), permanent employment with Think Company. Must be open to working onsite with our clients in the Philadelphia area.
Would you use Google Fonts or a strong font stack?
Tags: webdev, beginners, css, discuss
Published: 2017-12-11 18:48:39

---
title: Would you use Google Fonts or a strong font stack?
published: true
description: Is it wise to abandon Google Fonts in favor of a selection of decent alternative fonts?
tags: #webdev #beginners #css #discuss 
---

My company's website uses Google Fonts to serve our sans-serif (Open Sans) — which is used for most of our headings. A while ago, we noticed that the bold face was loading really slowly, creating a laggy effect whenever a page was loaded. (The font would appear regular and then change to bold after a moment). We decided that the bold was too slow, so we removed the bold from our Google Fonts. We also don't include the italics or light. This means that we have very little creative freedom in designing the site.

In looking over our fonts, I realized that we could solve all of these problems by getting rid of Google Fonts altogether, instead using a strong font stack — which we currently don't have. Instead of just serving Open Sans, we could define our `font-family` as `Open Sans, Lucida, Calibri, sans-serif` (or whatever). Then we wouldn't have to worry about lag and we could use bolds and italics no problem — plus, we wouldn't force visitors to download a font.

I mentioned this to our developer, and she argued that the load time on the Google Fonts is negligible, and that using font stacks is ill-advised because it could mess with the design of the site. So, I'm left with a dilemma: should we add bold and italics to our Google Font (significantly increasing the load time, but giving us exactly the font we want) or should we abandon Google Fonts in favor of font stacks, reducing load time but giving up some control of design?
CoreFreq
Tags: pmu, c, asm, linux
Published: 2017-12-11 17:21:46

---
title: "CoreFreq"
published: true
description: Call for testing.
tags: PMU, C, ASM, Linux
---
#a CPU monitoring software
_CoreFreq_ is designed for the 64-bits Processors.
Last commit adds the Uncore frequency which runs ok with Nehalem and Broadwell processors.
I will appreciate any test return with Intel Skylake, Coffe lake, Haswell, SandyBridge and many other architectures.
(so far, few AMD support beside the basic perf counters).
_CoreFreq_ is an experimental low level project, thus **save & close your files** before giving a shot.
Disable the NMI watchdog and no VM as prerequisites. Check the instructions in FAQ.
Clone, download source code from the [GitHub](http://github.com/cyring/CoreFreq)
Your screenshots are welcomed.
Regards,
CyrIng
France
![Tour](http://blog.cyring.free.fr/images/CoreFreq_Tour_2017-12-06.gif)
Gets first index of match to condition in List
Tags: kotlin
Published: 2017-12-11 15:52:27

---
title: Gets first index of match to condition in List
published: true
description: 
tags: Kotlin
---

## Extension method

```kotlin
inline fun <T> Iterable<T>.firstIndexOrNull(predicate: (T) -> Boolean): Int? {
    return this.mapIndexed { index, item -> Pair(index, item) }
            .firstOrNull() { predicate(it.second) }
            ?.first
}
```

Just using `.mapIndexed` and `.firstOrNull` .

## Usage

```kotlin
val arr = arrayListOf("a", "b", "c")

arr.firstIndexOrNull { it == "b"} // -> 1
arr.firstIndexOrNull { it == "z"} // -> null
```
The client and the Bible
Tags: discuss
Published: 2017-12-11 15:28:50

---
title: The client and the Bible
published: true
description: Just one opinion...
tags: #discuss
---
Sometimes I hear people say that one of the reasons why they like software is because they do not have to "bother" talking to the customer.

For me, it is quite the opposite, I could compare this with the bible. Since the bible changed its concepts a lot in its translations, this is where I explain myself, and that is, that the voice of the client in the company loses the concept of what he desires as it has to move from different departments until it finally reaches the developer to achieve the objective requested by the client.

So, as far as I am concerned, same way as the person talking to the client, the developer must also "bother" to understand it, because in the end thats the way of doing HIS job. Remember that in the end, the client's vocabulary and yours may not be the same.

Do you know the time it takes to sometimes help conceptualize what the client wants, so focus on knowing what the client wants, because communication errors can lead to loss of the client.
The 7 Most Popular DEV Posts from the Past Week
Tags: top7
Published: 2017-12-11 14:50:08

---
title: The 7 Most Popular DEV Posts from the Past Week
published: true
description: A round up of the most-read and most-loved contributions from the community this past week.
tags: icymi
cover_image: https://thepracticaldev.s3.amazonaws.com/i/xsr1z6iqv0pd7p3s6ns3.png
---

#1. People believe what you tell them

Elena shares useful and actionable advice for those suffering from imposter syndrome. But really, a good reminder for all developers!

{% link https://dev.to/ice_lenor/one-useful-advice-to-fight-the-impostor-syndrome-3p8 %}

#2. A last resort: getters & setters

Why getters & setters can be harmful and dangerous and advice on when they might make sense.

{% link https://dev.to/scottshipp/avoid-getters-and-setters-whenever-possible-c8m %}

#3. Faceoff: MongoDB vs. MySQL

Jignesh compares the schema, querying language, relationships, performance/speed, and security of two dominant databases.

{% link https://dev.to/jignesh_simform/comparing-mongodb--mysql-bfa %}

#4. The Device, The Filter and The Stream

The architecture and performance benchmarks for Nexus.js, a multi-threaded server-side JavaScript run-time based on WebKit/JavaScriptCore.

{% link https://dev.to/voodooattack/introducing-nexusjs-a-multi-threaded-javascript-run-time-3g6 %}

#5. Is this JavaScript or Python?

A side by side comparison of JavaScript and Python -- multi-line strings, expression interpolations, arrow functions, and more. 

{% link https://dev.to/massa142/javascript-is-almost-pythonic-3f8 %}

#6. AMA w/ Scott Hanselman!

The community asked Scott Hanselman questions and advice around life, career, and of course, open source. 

{% link https://dev.to/shanselman/im-scott-hanselman-ask-me-anything-416 %}

#7. Flashtext > Regex (sometimes)

Vikash couldn't wait five days for regex to run so he created a tool called flashtext. 

{% link https://dev.to/vi3k6i5/regex-was-taking-5-days-to-run-so-i-built-a-tool-that-did-it-in-15-minutes-c98 %}


_That's it for our weekly wrap up! Keep an eye on dev.to this week for daily content and discussions...and if you miss anything, we'll be sure to recap it next Monday!_
WebLense
Published: 2021-11-19 17:25:58

---
title: WebLense
published: true
date: 2017-12-11 00:00:00 UTC
tags: 
canonical_url: https://www.weckmann.me/posts/weblense/
---

There is a cascade of URL-To-Image APIs out there. Most of them are pricey, overly-complicated, non-opensource and you don’t have control of the image files. WebLense takes care of this. WebLense is a self-hosted Url-To-Image API.

## How To Use WebLense

_Updated on January 30th, 2018_

Using WebLense is incredibly simple.

[!["Remix](https://cdn.glitch.com/2703baf2-b643-4da7-ab91-7ee2a2d00b5b%2Fremix-button.svg)](https://glitch.com/edit/#!/import/github/clarkhacks/WebLense)

or

[![](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/clarkhacks/WebLense)

or

```
git clone https://github.com/clarkhacks/WebLense.git
cd WebLense
npm install && npm start

```

## API

Use `Lense` endpoint for API calls.

| `GET` | Required | Function |
| --- | --- | --- |
| url | Yes | URL To Capture |
| width | No | End Width |
| height | No | End Height |
| delay | No | Delay Screenshot |
| json | No | Return Json |

## Examples

**Web**

```
https://projectid.herokuapp.com/lense?url=https://clarkhacks.com/blog&width=1920&height=720

```

**jQuery**

```
$.get('https://projectid.glitch.me/lense',
{ url: 'https://clarkhacks.com' },
function(data) {
    ...

```

## Out of Space?

Glitch Projects are allowed 128mb of space. The WebLense app takes up ~40mb with captured images taking up the rest.

**Options**

- Clear `sites` Folder
- Host WebLense somewhere else.

* * *
 

[Reply via email](mailto:arpitbatra123@gmail.com?subject=Reply:%20WebLense)
How do I render LWJGL2 on Swing?
Tags: lwjgl2, java, swing
Published: 2017-12-10 19:33:26

---
title: How do I render LWJGL2 on Swing?
published: true
description: Wondering about LWJGL2 and swing.
tags: LWJGL2, Java, Swing
---

Hi. I was just wondering how I could render stuff from LWJGL2 (quads, etc.) on a window created by Swing?

Example: Rendering GL_QUADS on a JPanel inside a JFrame.

Thanks!
ELI5: Why cast to an interface?
Tags: oop, java, explainlikeimfive, discuss
Published: 2017-12-10 16:51:12

---
title: "ELI5: Why cast to an interface?"
published: true
description: 
tags: oop, java, explainlikeimfive, discuss
---

So, I am super new to OOP and Java--specifically, just finishing up my first semester of it.

I understand interfaces are akin to contracts, and understand the uses of them; similarly, I understand casting, etc. I understand you *can* cast to an interface, but I don't get why you would want to. I've checked a number of books, a number of sites, read some arguments on the topic on SO, and have yet to actually get the point of doing so.

Specifically: if you had an interface called `Forecastable` and two classes, `Weather` and `StockMarket`, both of which implemented `Forecastable`--and thus *must* have the methods of the interface, and thus any object instantiated in them has access to those methods by definition--then what would the actual use be of casting either some `Weather` or `StockMarket` object be to `Forecastable`, if they can both already access those methods inherently?
Explain non-relational databases like I'm five
Tags: explainlikeimfive
Published: 2017-12-10 16:30:03

---
title: Explain non-relational databases like I'm five
published: true
description: Try to explain it for someone who either knows relational database and someone who doesn't really know any of it.
tags: #explainlikeimfive
---

Try to explain it for someone who already knows relational databases.
WDS5 - Inspect HTML and Other Tags
Tags: html, wds
Published: 2017-12-13 20:31:54

---
title: "WDS5 - Inspect HTML and Other Tags"
published: true
tags: HTML,WDS
canonical_url: http://thecodingexpress.blogspot.com/2017/12/wds5-inspect-html-and-other-tags.html
---

In the [last article](http://thecodingexpress.blogspot.in/2017/12/wds4-html-attributes-and-some-important.html) we learned:  

- 3 Important HTML Rules
- Nested and empty elements 
- HTML Attributes&nbsp;
Let's start today with some important points:  

### HTML Headings&nbsp;

We have already seen HTML headings represented by tags **\<h1\>** to **\<h6\>** where **\<h1\>** is most important heading while **\<h6\>** is least important heading. Now I am mentioning some important points which you should follow when using HTML headings:

- Search engines use the headings to index the structure and content of your web pages. This is important because you should always follow an order of heading tags. **\<h1\>** should be used for main heading, **\<h2\>** for less important subheadings and so on. In fact, it is commonly followed a system of using only one **\<h1\>** tag in the document to represent heading of your document and nowhere else.
- Heading tags should only be used for headings and not for making text bigger or bold. Different tags are used for this operations and we will study them in coming posts.

### HTML Horizontal Rule&nbsp;

The horizontal rule element is used for displaying horizontal line on the webpage. It is used for representing break on the webpage. It is represented by the tag **\<hr \>.&nbsp;** <script async src="//jsfiddle.net/TheCodingExpress/zxecxkeq/embed/html,result/dark/"></script>

  

### Last but not the least

You must be wondering what HTML code is there behind beautiful websites you visit. So you can easily see the HTML behind any website. Just rigtclick on any website in your browser and you will find **Inspect** or **Inspect Element** or **View source** or **View page source** option. Click on it and you will see HTML of that website easily. You can HTML behind particular element by right-clicking that particular element.&nbsp;  
  
 That's all for this article. Sorry but this article is short due to some reasons. In the next part, we will learn about some important tags used in HTML.Till then visit your favorite sites to check thir HTML. Comment on how you think this article is, what improvements should I do and for any doubts. Share with your friends and _ **keep coding** _. 

###
myFirstPost
Published: 2017-12-10 12:46:12

---
title: myFirstPost
published: true
description: Sayin hi to the dev community.
tags: 
---
Hi guys. My name is Felix and I am from Uruguay. I am a newbie in coding but have worked in tech projects for the past 20 years as PM and implementator.

I hope to acquire some coding skills which are becoming the new "english", a diferentiating skill that everyone should try to learn.

Thanks for maintaining this site abd for sharing you knowdlege. Sharing is caring.