teleren/devto huggingface dataset:
Sort HashMap By key and By value
Tags: java
Published: 2020-03-03 18:07:32

In this article, we are going to have look at how to sort HashMap by key and to sort HashMap by value in Java. We are going to learn different approaches to sort HashMap.

Visit this link to read the full article: https://www.java8net.com/2020/02/sort-hashmap-by-key-and-by-value.html

HashMap does not sort its key-value pair and also it does not maintain any order (neither insertion nor sorted). If we want to sort HashMap then we need to provide custom logic that can sort HashMap and sort HashMap by key we can use either TreeMap or LinkedHashMap but in case of sort HashMap by value, we have the only option of LinkedHashMap as TreeMap cannot be used to sort HashMap by value.
To sort HashMap by key, we can use TreeMap class. TreeMap in java is used to store key-value pairs and sort all the pairs w.r.t. keys. We can create a TreeMap from the HashMap and TreeMap sort HashMap by key.

Steps to sort HashMap by key using TreeMap

1. Create a Comparator, which provides logic to sort HashMap by key.
2. Create a TreeMap using Comparator.
3. Add all the entries of HashMap into the TreeMap

Java Sort HashMap Example
HashMap<String, Integer> hashMap = new HashMap<>(); 
hashMap.put("Programming In Java", 450); 
hashMap.put("Introduction to Algorithms", 800); 
hashMap.put("Data Structures", 600); 
hashMap.put("Learn C++", 350); 
System.out.println("-----------Before Sorting--------------");
Set<Entry<String, Integer>> unsortedEntrySet = hashMap.entrySet();
for (Entry<String, Integer> entry : unsortedEntrySet) {     
        System.out.println(entry.getKey() + " = " + entry.getValue()); 
} 

Comparator<String> keyComparator = (s1, s2) -> s1.compareTo(s2);
TreeMap<String, Integer> treeMap = new TreeMap<>(keyComparator); treeMap.putAll(hashMap); 
System.out.println("-----------After Sorting---------------"); 
Set<Entry<String, Integer>> sortedEntrySet = treeMap.entrySet(); 
for (Entry<String, Integer> entry : sortedEntrySet) { 
        System.out.println(entry.getKey() + " = " + entry.getValue()); 
}

Visit this link to read the full article: https://www.java8net.com/2020/02/sort-hashmap-by-key-and-by-value.html

Further Learning:
https://www.java8net.com/2020/02/how-to-sort-arraylist-in-java.html
https://www.java8net.com/2020/02/treemap-in-java.html
https://www.java8net.com/2020/03/java-optional.html
https://www.java8net.com/2020/01/lambda-expression-java.html
https://www.java8net.com/2020/01/functional-interface-in-java.html
Developing for the Oculus Go with Unity on Mac
Tags: vr, oculus, unity3d, mac
Published: 2020-03-03 18:07:22

---
title: Developing for the Oculus Go with Unity on Mac
published: true
description: A first steps tutorial for developing for the Oculus Go on a Mac
tags: vr,oculus,unity,mac
---

I wanted to make a simple VR app for my Oculus Go and had to setup my environment beforehand. This tutorial tries to translate [reference tutorial][1] to Mac.

## Prerequisites

1. You own an Oculus Go
2. You own a Mac
3. Unity installed (In this case: 2019.3.3f1)
4. Homebrew installed

## Installations

### Homebrew installations

1. `brew cask install android-platform-tools`

### Plug in your Oculus Go

*Since the "allow file access" dialog did not appear once the developer account was enabled, I left it disabled until later.*

1. Plug in your Oculus Go
2. Allow file access on the Oculus Go
3. Enable developer mode via the Oculus app
4. Run `add devices` on the Mac
5. Allow access on the Oculus Go

### Setting up Unity

*When installing Unity via the Hub, make sure to also install the Android tools and Open JDK.*

1. Create a new 3D Project
2. In Edit > Preferences > External Tools make sure to use the built-in SDK and JDK.
3. Go To File > Build Settings
4. Click on Android and "Switch Platform" if necessary
5. Go To Edit > Project Settings > Player
6. Enter your Company, scroll to XR Settings and activate "Virtual Reality Support"
7. Add Oculus via the plus symbol to the right under "Virtual Reality Support"
8. Still in Edit > Project Settings > Player go to Other Settings and find Graphic APIs.
9. Remove Vulkan


### Building

1. Go to File > Build Settings
2. Click Build and Run
4. Enjoy the VR app

## And now?

1. Use the Oculus Utilities from the asset store
2. Make a 360 degree image the skybox like here: [https://www.youtube.com/watch?v=LXUoQ7VnLDc]
3. Make a Raycast like here: [https://www.youtube.com/watch?v=_yf5vzZ2sYE]


## Links
[Reference Tutorial][1]

[1]: https://scriptable.com/blog/oculus-go-unity-setup-quick-start
☎️ Ways to communicate between browsers and servers and everything in between.☎️
Tags: webdev, javascript, architecture
Published: 2020-03-03 18:06:08

I have been looking at the ways things can talk to other things.

I have found a few reasonable ways, some you might know already. I should mention, this is from the perspective of a JavaScript engineer. Lastly, the intention of this post is to give a high-level overview, there may be comparisons and humor to cover my lack of knowledge on some of the listed technologies `#knowWhatYouNeed, if you know, tell us more and I will add this to the post.

### Browser to Browser
- WebRtc is a way of communicating P2P without a server being the broker, unlike websockets, WebRtc says to the host, "hi I need to talk to that browser let me connect to them directly and securely... but server, I don't need you anymore, go away". This is the underlying technology of Google hangouts and other web based meeting / chat apps. What might not be so obvious is that webrtc can send text based data it doesn't have to be video or audio which makes it a faster safer alternative to websockets.

_Links:_
The spec - https://webrtc.org/
MDN - https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API

### Browsers to Server, Server to Browsers
- Websockets are real time tcp sockets connected to the web, they do require a server throughout any communications, they send data bi-directionally, they are a noticibly slower. They do not reconnect you if a client looses connect, you have to handle that.
- cookies, a string of delimited text that can hold arbitrary information, it can be accessed on response or in browser.

### Server to Browser
- Server Sent Events, it's a realtime stream of data mounted to a URL, JavaScript EventSource will allow all clients to listen to data in the stream sent by the server. It's kind of like half a websocket because you cannot send data back. They automatically reconnect which would have been great for a PWA if it weren't for the fact that there was no internet at the time 🤦‍♂️, SSE is fast.

### Browser to Server
- Post and Put requests can send data bodies between client and server, this is not realtime, but this might not matter, pair this with SSE if you want to.

### Server to Server
- TCP it's like the internet for your local network 🔦 (http 1 and 2 are TCP based)
- UDP it's like the internet for your local network except it's got no f***s to give and will send data extremely quickly at anything and nothing ⚫

That's all we have time for folks. 😍
Missed anything? Let me know in the comments.
Nevertheless, Ifeoma Coded.
Tags: wecoded, womenintech
Published: 2020-03-03 17:59:08

# What Equality in tech means to me is ...


![The future is equal!](https://media.giphy.com/media/3lx8dhPAfFoUgXPPQa/giphy.gif)

**Equality in tech** is attending meetups without wondering if you would be the only woman in a room filled a hundred men, wondering if you would have to put up with a male speaker's sexist joke and the laughter from other men that follow after, then there is you looking around and wondering if no other person finds what the speaker said is wrong.

**Equality in tech** is a colleague or a senior not looking down on you or doubting your capabilities mainly because your gender differs from his.

**Equality in tech** is tech companies, offices and workspaces respecting the women in those spaces and making the environment feel like a safe space so that women can progress professionally.

**Equality in tech** is women being in spaces where they feel confident enough to express themselves without doubt.

**Equality in tech** is women speakers being given the same opportunity to speak as their male counterparts.

This is what **Equality in tech** means to me as a young woman who works in tech.

*Happy International Women's Day! You are Awesome! :tada:*
New Instagram Filter
Tags: news, ar, sparkar, codecademy
Published: 2020-03-03 17:54:35

Hello devs, we just added a **"Which programming language are you?" AR Effect** up on our Instagram. 🙌 

Try it out here: www.instagram.com/a/r/?effect_id=246847299664338

Let us know what you get!

{% twitter 1234486803849195520 %}
A Virtual DOM You Say?  I Feel ReactJS Coming On!

Published: 2020-03-03 17:50:10

They say necessity is the mother of invention. So what was the big issue at Facebook a decade ago?

Way back in 2010, Facebook was having a problem with “Cross Site Scripting” attacks.  This meant malicious users were putting javascript via the browser onto sites and then using that Javascript to steal information.

But there was a problem with the back-end technology called XHP that Facebook was using to address these attacks.   Dynamic web applications such as Facebook require many roundtrips to a server, and XHP did not minimize all these roundtrips to the server. Pages had to re-render over and over again which was expensive in terms of time and bandwidth. In an effort to solve that problem, a Facebook engineer by the name of Jordan Walke asked his boss for 6 months time to come up with a way to take XHP out of the backend and into the browser using Javascript.  The result was a faster application he called “FaxJS”, later to be known as ReactJS 

How does React make an application run faster?  One important way is through use of the virtual DOM.
The virtual DOM is not the same as the DOM used in vanilla Javascript and Jquery.  The virtual DOM is a lightweight copy of the regular DOM.  Think of it this way: if the regular DOM were a house, then the virtual DOM would be the house’s blueprint.

The way the virtual DOM works is this.  When you render a JSX element, each and every virtual DOM object gets updated.  But wait, doesn’t this sound like it will take a lot of time?  Not really because the time the virtual DOM takes to update is very small.

Once the virtual DOM is updated, React compares the virtual DOM with a virtual DOM snapshot taken right before the update.

By comparing the new virtual DOM with a pre-update version, React will know exactly which virtual DOM objects must be changed.  This process is called “diffing.”

Once React knows which virtual DOM objects have to be changed, it will update those objects only.  React will not touch those objects that have not changed.

This innovation of updating only the necessary parts of the DOM is what gives React a reputation for performance.

So here’s a summary of what happens when you update the DOM in React:

 The entire virtual DOM gets updated
The virtual DOM gets compared to the selfie it took right before the update.
Only the changed objects get updated on the real DOM.  If an object was not altered, React won’t touch it!
Changes on the real DOM cause the screen to change.


*By the way......

Why is React called React?  React was developed for Facebook, an app that has constantly changing data.  React is a front-end framework or the “View” in MVC architecture. This means that as the user clicks around and changes the app’s view, the view should “react” or change quickly with those user events.


Keep on coding out your dreams!
Bang gia van ep plywood 2020
Tags: vanepplywoo, vanplywood
Published: 2020-03-03 15:58:56

Ván ép plywood hay còn gọi là gỗ dán vì cấu tạo cơ bản là các tấm gỗ được lạng mỏng từ 2-3mm dán lại với nhau bằng keo phenol hoặc formal. Ván ép plywood có độ bền cao, chịu lực tốt, có thể uống cong, chịu được nước đồng thời phủ gia công bề mặt bằng veneer thậm chí là melamine để tăng thêm tính thẩm mỹ. So với các loại ván khác, plywood có giá thành cao nhưng đổi lại là chất lượng ván vượt trội.

Hiện nay trên thị trường có nhiều loại ván ép plywoood được sản xuất từ gỗ tạp, gỗ bạch dương, ván ép tàn bì, ván ép sồi, ván ép xoan mộc và ván ép óc chó. qui cách thường 1mx1m, 1,2m x1,2m, 1m x 2m và 1,2m x 2,4m, dày từ 3mm đến 25mm. Tiêu chuẩn có AA cho xuất khẩu, AB, AC và BC. Dưới đây là bảng giá loại các loại ván ép plywood tiêu chuẩn BC mà kho TalaB cung cấp.

Ngoài ván ép plywood chúng tôi còn cung cấp các loại ván nội thất khác như ván melamine, ván acrylic, ván veneer với trên 200 mẫu bề mặt khác nhau. Lợi thế của chúng tôi là gia công nhanh, hàng trơn luôn có sẵn, giao hàng kịp thời đặc biệt giá cả luôn tốt. Hãy gọi 0902 096 145 để nhận báo giá sớm nhất.
 
Nguồn: http://www.vanmdf.info/gia-van-ep-plywood
Drag & Drop Kitchen Mockup Scene with Intro Animation - vue.js , animate.css & www.mockupcloud.com
Tags: codepen, mockupcloud, animate, vue
Published: 2020-03-03 17:27:40

<p>Download the Free scene from <a href="https://www.mockupcloud.com/free/kitchen-ready-header-free-scenep" target="_blank">https://www.mockupcloud.com/free/kitchen-ready-header-free-scene</a></p>

{% codepen https://codepen.io/chris_tudor/pen/jOPLamO %}

<p>There are multiple layers, the shadow is a separate layer to blend with the background. Anything else is straightforward, having a draggable plugin that works with jQuery.</p>

<p>Adding some animation on loading and a centred text to stand out.</p>

<p>The button leads you to the download page.</p>

<p>It can be used as a nice landing page.</p>

<p>It works best on full screen</p>
When terminals were real tty’s
Tags: retrocomputing, unix
Published: 2020-03-03 17:30:21

---
title: When terminals were real tty’s
published: true
date: 2020-03-03 17:17:00 UTC
tags: retrocomputing, unix
canonical_url: https://www.geewiz.dev/2020/03/03/when-terminals-were.html
---

For my first Retro Saturday [live stream](https://www.twitch.tv/fullstacklive), I chose working with a PDP-11 minicomputer. I don’t own a PDP-11, nor can I afford to buy or run one, but I can simulate one realistically using [simh](http://simh.trailing-edge.com), the simulator for historic computer systems.

After successfully installing Unix V7, the original Unix operating system from 1979, I ran into unexpected issues with entering source code. One of the problems was the lack of a full-screen editor combined with my lack of `ed` skills. Another problem was that the Backspace key didn’t work as expected; an issue I first encountered 27 years ago trying out an early version of Linux. And then there was the strange behaviour that I had to escape the number sign at the beginning of `#include <stdio.h>` with a backslash; otherwise it would disappear.

After the stream, I found out what the problem was: V7 was simply still more geared towards being operated from teletypes (a keyboard attached to a line printer) than from terminals with CRT screens. And on an input device that prints every character you type immediately on paper, it’s impossible to do what Backspace does. (Typewriters would later have correction ribbons added that enabled you to actually erase and overwrite.) And that’s why the Unix developers assigned special meaning to the `#` and `@` signs. 

The `#` sign tells the V7 shell to ignore the previously typed character. Correcting a typo would look like this: `cat memp#o.txt`.

For larger errors, there’s the `@` sign. It tells the shell to ignore everything before it. For example: `rm mem@mv memo.txt memo.bak`.

Exploring historic operating systems has become a passion for me lately. Not only do I learn a lot about early computing technology. It also makes me appreciate so much more the achievements of pioneers like Thompson and Richie who didn’t have any of the conveniences software developers enjoy today.

2.11BSD seems to be a more user-friendly OS for the PDP-11, so that’s what I’m going to try next!
Coming back to development after a decade away
Tags: beginners, codenewbie, career, blog
Published: 2020-03-03 16:51:49

<H2>Back during the web 1.0 days I thought of myself as an <i>artisté</i></H2> I changed majors my senior year of college to focus on Interactive multimedia, websites and software development. I felt a strong pull for displaying information in a clear and concise manner and worshiped at the throne of <a href="https://youtu.be/AdSZJzb-aX8" target="_blank">Tufte</a>. I loved data and this love fostered a need for me to learn ways to display it with the gravitas it deserved. Learning various technologies were a means to an end. Databases? Markup? OOP? Scripting? Give me a few weeks and I'm on it.

![Yeah that makes sense](https://dev-to-uploads.s3.amazonaws.com/i/pcdw242eqw64gffpaip4.gif)

I held various creative jobs post graduation. I made websites, produced tv & commercials and got into corporate communications. Fast forward to the housing boom of 2006-2008. I landed my first big boy development job working for a marketing firm. They were consulting their real estate clients the traditional way but wanted to break into variable data printing. I created a website with a python backend that streamlined the process letting users pay online and was available 24/7. Business grew exponentially and so did my salary. When the bubble burst I decided to focus on IT Operations because it seemed "less volatile than programming".

![mistakes were made](https://dev-to-uploads.s3.amazonaws.com/i/2s6pllsbw0lpmd33fhrp.jpg)

As a GenXer who grew up with a strong work ethic I decided to start at the bottom, work hard and wait to be recognized for my efforts. I got so wrapped up in reaching for the brass ring I forgot about my real passions. I've bounced between a bunch of different focuses: Technical writing and documentation, training, process creation, deployment, networking and helpdesk. All in an effort to regain the spark I had creating with code. 

{% youtube ZXsQAXx_ao0 %}

If you are reading this and thinking of transitioning to development, or in my case back into development, JUST DO IT. I'm still in Ops but missed the creative nature (and salary) associated with creating tools and making the best software I can. Ever since I’ve started coding again I can feel my brain wrinkling every day. I am learning so much and want to contribute to the community at large. Yes, I do have concerns regarding entering development at this stage of my life but I encourage everyone to pursue their passions. Even if you never make a career of this at least you won’t have regrets.
Blog Vent 1
Tags: swift, swifting, swifter
Published: 2020-03-03 16:35:47

In iOS apps, a scrolling list of items is a table view and each item on the list is a cell. I recently had an assignment in which the task was to work on the part of an app that keeps track of the conversation. The part of the app that deals with table views and cells was already built, which led me to focus on the particular task at hand. I first began by familiarizing/ reviewing the files that make up the app. I updated the data source, which is best thought of as a very effective assistant, to give the correct number of messages. Once I did that, the correct number of entries were in the chat but they were all the same answer. I then inserted an if statement that uses the remainder operator to determine whether the message is a question or an answer. The problem then, was that even though the right number of messages, questions and answers were showing up and different text was seen as you move through the conversation it was still not showing the actual contents of the conversation. The next step was to add storage to the app. I created an array and code so that every time the data source is asked to add an answer or question, it creates a new message and adds it to the array.

An idea for an app has been brewing in my head for some time now. An input that the “brain” would take is the information regarding time per se, and the results it would return deal with rates. It’s a vaguely communicated thought, more to come soon. Actions over words.
Tech Office Deaths
Tags: humor, html, javascript, agile
Published: 2020-03-03 16:22:19

---
title: Tech Office Deaths
published: true
description: Humor in the dystopian HRscape
tags: humor, html, javascript, agile
---

Look, we all know that the hope of retirement is gone and we half-joke about dropping dead at work. We may say it is a work ethic to feel useful, and then we pause and realize we can’t get far enough ahead to have a rest. I wish I were joking, but…

I see the Glass half full!

Now Hiring: Death Consultant

Description: person to handle the end of life needs in our large QA department that is frequently in flux.

Requirements: Ability to cover body with dignity in our open office concept and gracefully remove those affected to designated bereavement areas as to not impact team velocity. Removal of memoriams or shrines to designated areas to allow facilities to hose off the workspace for immediate new hires.

Prior experience: 4 years proven of unwavering lack of empathy or 1 year in HR. Knowledge of non-denominational, non-gendered Twitter 128 character eulogy format. Gaining rights over all ex-personnel social media for immediate deletion. Suicide net building codes.

Pluses: Knowledge of ex-personnel storage and removal with help of designated floor wardens to end of live vendors like Amazon Corpse(tm) for employees, and WalMart for contractors and part time. Accurate time of death for payroll on hourly workers. Microsoft Excel.

Benefits: Time spent in bereavement at work is reimbursed at 50% for onsite 10% if offsite. If you die in the first two hours in the office, your partner/spouse will get half a day’s pay, anything over 3 hours it is a full day. After 90 days and 20 years, employee is eligible for employer paid Next Day Prime cremation for you and partner/spouse. Job placement for one (1) child over 12 with 3 years experience provided at no extra cost. Amazon Orphan(tm) placement services for those children (under 18 and still in the household earning under 30k) left behind.
Devart Released ODBC Driver for NexusDB 
Tags: odbc, nexusdb, database, delphi
Published: 2020-03-03 16:20:30

---
title: Devart Released ODBC Driver for NexusDB 
published: true
description: Devart announced the release of ODBC driver for NexusDB, a client/server and embedded database system for Delphi, C++ Builder, and .NET applications.
tags: ODBC, Nexusdb, Database, Delphi
---
*Devart announced the release of ODBC driver for NexusDB, a client/server and embedded database system for Delphi, C++ Builder, and .NET applications.*

Devart, a recognized vendor of connectivity solutions for various databases and cloud services, announced the release of [ODBC driver for NexusDB](https://www.devart.com/odbc/nexusdb/). The driver can be used to access data in NexusDB databases from various analytics, database management and reporting tools, IDEs and programming languages on Windows (32/64 bit).

The solution provides full support for the standard ODBC API functions and data types and can connect to the NexusDB server directly via TCP/IP. It also supports multilingual NexusDB databases: Latin, Cyrillic, or Chinese. However, due to the specifics of NexusDB, some third-party tools can connect to the DBMS only in Remote mode. See the third-party tools page in the vendor’s documentation for the complete list of such tools.

As an extra benefit comes cost-effective deployment: the driver is a standalone installation file that does not require the user to install or update any dependencies, while large organizations with hundreds of machines can use the silent install method with an OEM license.

**About Devart**
Devart is one of the leading developers of database tools and administration software, ALM solutions, data providers for various database servers, data integration and backup solutions. The company also implements Web and Mobile development projects.

For additional information about Devart, visit https://www.devart.com/