teleren/devto huggingface dataset:
Getting a Handle to a Dynamically Linked Library [Windows PE Internals]
Tags: cybersecurity, security
Published: 2021-04-19 13:24:15

# Previous Windows PE Internals Writeups
- [Creating a Windows Project in Visual Studio](https://dev.to/wireless90/creating-a-windows-project-in-visual-studio-windows-pe-internals-2p6e)

# Let's Begin
This writeup is going to be on loading our PE File's DLL at runtime.

We are going to use the function `GetModuleHandleA`.

```c
HMODULE GetModuleHandleA(
  LPCSTR lpModuleName
);
```

> Retrieves a module handle for the specified module. The module must have been loaded by the calling process.
We can either pass in an executable or a dll as the name. 

We want to load `user32.dll` from our own executable.

The important thing is that the dll must already be loaded by the executable.

By default in `Visual Studio` windows project, some dlls are already configured to be loaded. We can double check it in the `Project Properties`.

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

We can see that user32.dll is already configured to be loaded. If it is not loaded, we can either configure it to be loaded or use any functions within `user32.dll` which causes the linker to load it. 

The signature for the function would thus look like,

```cpp
HMODULE peBase = GetModuleHandleA("user32.dll");
```

After loading the module, a pointer (HMODULE) to the start of the user32.dll is returned which is stored in the variable `peBase`. 

In general, our windows program looks like,

```cpp
#include <Windows.h>

int  WinMain(
	 HINSTANCE hInstance,
	 HINSTANCE hPrevInstance,
	 LPSTR     lpCmdLine,
	 int       nCmdShow
)
{
	HMODULE peBase = GetModuleHandleA("user32.dll");
	
	if (peBase == NULL)
	{
		MessageBoxA(0, "Can't load user32.dll", "Error", MB_OK | MB_ICONERROR);
		return 1;
	}

	MessageBoxA(0, "user32.dll loaded successfully!", "Success", MB_OK | MB_ICONINFORMATION);

	return 0;
}
```


In this exercise, I learnt how to get a handle to an already loaded dynamic link library (dll).


# Next

[Validating the MZ Signature](https://dev.to/wireless90/getting-the-windows-pe-internals-kka/)
Pull Requests - proceed with caution
Tags: programming, watercooler, 5days5blogposts
Published: 2021-04-19 13:19:25

Pull requests somehow became the mainstream technique nowadays. Basically every client which comes to us (we help with legacy Rails apps) has a process based on pull requests. Very often this means they became a mandatory technique. Even worse, in some teams, you can't add any less-related refactoring change as part of a ticket-connected-PR. This, together with the focus on "always-deliver" (read: only work on ticket-connected-PR) leaves no room for the scout rule techniqe. 

I don't like that.

I don't like that at all.

Tomek Wróbel at the Arkency blog, summarized the [disadvantages of pull requests](https://blog.arkency.com/disadvantages-of-pull-requests/) very well. 

Here are some of the points from his list:

- More long living branches, more merge conflicts
- Reviews tend to be superficial
- Merging is blocked by remarks that shouldn’t be blocking

I was very happy to see that in the recent [Technology Radar](https://www.thoughtworks.com/radar/techniques) by ThoughtWorks this topic was brought up. 

In short, they put it in their "Hold" section. Their meaning of this is "Proceed with caution".

![Pull Requests - Hold](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u35nq3wxp40t5xr54j5o.jpeg)

That's my advise too - look at other options available. Even if pairing is not your thing, that are others options too. At Arkency we like the connection of [Trunk Based Development](https://trunkbaseddevelopment.com/), push to master and [foreman](https://blog.cleancoder.com/uncle-bob/2014/02/21/WhereIsTheForeman.html).

Those maintain the benefits of pull requests (people at the same page), while they shorten the feedback cycle and make the process more productive.
Why QA is so important in your development process?
Tags: discuss, healthydebate, motivation, testing
Published: 2021-04-19 13:18:52

This shouldn't be a question, and probably everyone in the software world should know the answer, but (there's always a but) not everyone does.

In this article, I will mention why I consider that a QA team is important in any software company.


## **1. "One test a day keeps the bugs away"**
Yes, as you read it, I have used the phrase of the apple, but because it is 100% applicable to what I want to say.
A test in time prevents a disaster in the future, perhaps not all software companies have a QA team because they start from the logic that, "why are we going to pay a person to verify that things work if we have developers that they can test what they do? ", and the truth is that the developers are not able to judge the masterpiece that maybe took days to make, they need an extra pair of eyes to help them see that their masterpiece is not yet ready to be exhibited, and don't get me wrong, our job is precisely to help developers to make their work perfect and also for the user to have a nice experience in mobile apps or web apps.

## **2. It is better to have a QA team and not need it than need it and not have it**
It sounds like a slogan for an insurance company, but it is a fact, having a quality team guarantees that your products or features, come out ready to use and you may not need them in some moments, but it is always better to know that a group of people is there for taking a look at the app before you decide to put anything into production.


##**3. We test because we care**
I do not know of any quality course or workshop that does not mention how important it is to think like a user, because our main objective will always be the user, and that the company does not have great losses due to errors that could be prevented in time. so yes we test because we care.

##**4. The test is the key for a better release**
Just as companies that make skincare products do many tests before saying that a product is ready to go on the market, we also do many tests before saying yes to a release, precisely because we worry about everything coming out, we do a series of tests to check that everything is ready for the release works as expected and that there are no surprises later that can cost millions.


---


Well, I think I have made my points clear, and I hope nothing escapes me because if so, that would speak very badly of me as a tester.

Remember " QA´s are friends not enemies".
![nemorefference](https://media.giphy.com/media/Le5eHA05wkYCs/giphy.gif)


 It's time to promote myself( because if I don't do it, who will?):
you can follow me on my Instagram [@mela.qa] (https://www.instagram.com/mela.qa/), for some QA content.
And if you want to help a tester to survive a pre-release night feel free to [buy me a coffee](https://www.buymeacoffee.com/melaq).
k8s cluster setup - HyScale
Tags: kubernetes, devops
Published: 2021-04-19 13:09:08

Kubernetes is the new norm to deploy your applications though there are many complex pieces to stitch. In this article, we will show you how we can use K8s cluster automation from Platform9 along with a very easy and fast way to deploy applications on K8s using HyScale. We have chosen a sample web application with 2 services to describe that here. You can also deploy complex microservices-based applications eg. RobotShop using HyScale with the same ease.
Logging input variables and response body analysis in Hasura Cloud
Tags: graphqllogging, inputvariables, responselogging
Published: 2021-04-21 16:34:12

---
title: Logging input variables and response body analysis in Hasura Cloud
published: true
date: 2021-04-19 12:53:26 UTC
tags: GraphQLLogging,InputVariables,ResponseLogging
canonical_url: https://hasura.io/blog/logging-input-variables-and-responses-in-hasura-cloud/
---

 ![Logging input variables and response body analysis in Hasura Cloud](https://hasura.io/blog/content/images/2021/04/logging_vars_blog-squashed.jpg)

Knowing what someone was asking for, and what they found, are the two critical parts of understanding what your customers want, and thus, your ability to optimize your offerings.

In Hasura cloud, you can turn on the ability (in the monitoring tab) to see what input variables a customer passed in, ie. `{topic: "Historical novels on the transatlantic pottery trade"}` and what was returned, `null`.

## GraphQL Logging

Because of it's high degree of flexibility, GraphQL logging can often be highly implementation specific. By capturing query variables, the user defined input of your queries/mutations, you have a robust toolset to understand the full picture of how your users are using your application, product, or service.

In this video, we'll show you where to find the the logging settings, how to view them, and understand why you would want to perform response body analysis.

{% youtube QdnwrppM3a0 %}

_NOTE: We will be updating the UI in Hasura Cloud to reflect the ability to 'Enable Response Body Analysis' and 'Capture Query Variables' in the near future._
Remote Schema Joins
Tags: remoteschemas, remotejoins, datafederation
Published: 2021-04-21 16:31:05

---
title: Remote Schema Joins
published: true
date: 2021-04-19 12:53:19 UTC
tags: RemoteSchemas,RemoteJoins,DataFederation
canonical_url: https://hasura.io/blog/remote-schema-joins/
---

![Remote Schema Joins](https://hasura.io/blog/content/images/2021/04/remote_schemas_blog-1-.jpg)

Remote schema joins provides the most simple approach to federated data. Provide a GraphQL endpoint, identify the connection parameters, and give the new field a name and you have two disparate data sources from different systems resolving under a single API.

## Federating your Data: Different Types of Data

Not all data serves the same purpose. User activity data ("Application Data") has a strict set of access requirements, time-to-live optimisations, and more. Editorial content, something that might live in a CMS, has an entirely different set of needs - more flexibility, infrequent writes, long-lived cache, etc. Often times the editing interfaces for these two different types of data vary wildly and so it is best to choose the optimal application for each, but not need to sacrifice developer velocity by managing data merging in a proxy layer between your back-end and your front-end.

## Federating your Data: Bring your Old Stack with You

Another common case for federating your data is when you have existing architecture in place that you can wrap with a thin GraphQL API but want to leverage newer database technologies or design patterns for your next initiative. In this case, you can still join your data across multiple sources, leveraging the existing infrastructure and embracing the new.

In this next video in our "Learn Hasura Deep Dive", we'll walk through the basics of federating your data with Hasura Remote Joins.

{% youtube TpVTCxAm8Sc %}
Python and its Frameworks
Tags: python
Published: 2021-04-19 12:34:48

Hello all,
I have received a lot of emails and messages regarding python and its Framework. So I decided to write a small blog on it.

Python is one of the famous and broadly utilized programming dialects. It is because of the explanation, it gives an assortment of systems to web advancement, game turn of events, GUI, work area application, and some more. In this part of the Python instructional exercise, you will come to think about well-known systems of Python. Due to its use cases, the demand for [Python Course](https://intellipaat.com/python-certification-training-online/) is increasing like never before.

The top three python frameworks are:
1)Qt
2)GTK
3)Tkinter

(1)Qt

Qt is one of the most popular libraries for cross-platform development. It is the main graphical library for the KDE desktop. There have several licenses available with the main ones being for commercial and open-source use. If your application is commercial i.e. closed-source then you must pay for a license to use it. If the application is open source then you can use the GPL license; however, you will be unable to commercialize your program without upgrading the license.
It contains a graphical layout utility that permits the user to drag & drop graphical widgets for quick design of the interface. On the other hand, the developer can hand code the interface layout. It also supports non GUI features containing SQL database access, network support, XML parsing. It is written in C++ but python binding is available via PyQt.

2)GTK

GTK represents the GIMP Tool Kit which is made for the advancement of GIMP picture programming. GTK+ formed into the graphical library that controls the GNOME work area. Gadgets are essential to structure squares of a GUI application. 

GTK+ is open source under the GPL permit. At the point when Qt was chosen to control the KDE work area then Trolltech had a restrictive permit for it. Since it conflicts with the free Software idea, GTK was made to allow individuals to utilize the GNOME work area and GTK applications as open-source programming. 

GTK doesn't basically have an inherent drag and drop interface anyway the wxGlade utility gives this usefulness. The first GTK was written in C though GTK+ is written in C++ utilizing OOP practices and PyGTK is the Python restricting for GTK+.

3)Tkinter

It is a Python restricting to the Tk GUI toolbox. Tk is the default GUI library for Python improvement because of its expansion in the center Python language. It is the first GUI library for the Tcl language. The Tkinter toolset is very restricted however it is not difficult to get the hang of making it construct basic GUI programs in Python. 

It has three underlying format chiefs: 

Pack calculation administrator – Manage gadgets in vertical and level boxes 

Framework math director – Put gadgets in a two-dimensional network 

Spot calculation administrator – Put gadgets on their compartments utilizing supreme situating.
Kotlin List methods – min() minBy() minWith()
Tags: kotlin, min, minby, minwith
Published: 2021-04-19 12:47:41

https://grokonez.com/kotlin/kotlin-list-methods-min-minby-minwith

Kotlin List methods – min() minBy() minWith()

In the tutorial, <a href="https://grokonez.com">JavaSampleApproach</a> will show how to use Kotlin List methods <code>min()</code>, <code>minBy()</code>, <code>minWith()</code>.

<!--more-->
<h2>I. Kotlin List methods - min() minBy() minWith()</h2>
<h3>1. min()</h3>
<code>min()</code> is used to return the smallest element of an Iterable. It will return 'null' if there are no element.
Method signature:

<pre><code class="language-java">
// 1.	
public fun Iterable<Double>.min(): Double?

// 2.
public fun Iterable<Float>.min(): Float?
</code></pre>

Practice:

<pre><code class="language-java">
val simpleList = listOf(55.4, 20.0, 99.99, 1.99, 23.0, 34.2, 88.0, 72.1, 61.2, 43.9)

// public fun Iterable<Double>.min(): Double?
val smallestElement = simpleList.min()
println(smallestElement)
// ->
/*
	1.99
*/
</code></pre>
<h3>2. minBy()</h3>
<code>minBy()</code> returns the first element having smallest value of the given function <code>selector: (T) -> R</code> or 'null' if there are no elements.
Method signature:

More at:

https://grokonez.com/kotlin/kotlin-list-methods-min-minby-minwith

Kotlin List methods – min() minBy() minWith()
Kotlin List methods – max() maxBy() maxWith() example
Tags: kotlin, maxby, maxwith
Published: 2021-04-19 12:27:24

https://grokonez.com/kotlin/kotlin-list-methods-max-maxby-maxwith

Kotlin List methods – max() maxBy() maxWith() example


In the tutorial, <a href="https://grokonez.com">JavaSampleApproach</a> will show how to use Kotlin List methods <code>max()</code>, <code>maxBy()</code>, <code>maxWith()</code>.

<!--more-->
- <a href="https://grokonez.com/reactjs-jwt-springboot-token-authentication-example">Reactjs Jwt SpringBoot Token Authentication Example</a>
- <a href="https://grokonez.com/spring-boot-angular-11-pagination-example">Spring Boot Angular 11 Pagination Example</a>
- <a href="https://grokonez.com/angular-client-side-pagination-with-nodejs-mysql">Angular Client Side Pagination with Nodejs + MySQL</a>
- <a href="https://grokonez.com/kotlin-tutorial">Kotlin Tutorial</a>

<iframe width="560" height="315" src="https://www.youtube.com/embed/VqfYbxbYp5I" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

<h2>I. Kotlin List methods - max() maxBy() maxWith()</h2>
<h3>1. max()</h3>
<code>max()</code> is used to return the largest element of an Iterable. It will return 'null' if there are no element.
Method signature:

<pre><code class="language-java">
// 1.	
public fun Iterable<Double>.max(): Double?

// 2.
public fun Iterable<Float>.max(): Float?
</code></pre>

Practice:

<pre><code class="language-java">
val simpleList = listOf(1.99, 55.4, 20.0, 99.99, 23.0, 34.2, 88.0, 72.1, 61.2, 43.9)

// public fun Iterable<Double>.max(): Double?
val largestElement = simpleList.max()
println(largestElement)
// ->
/*
	99.99
*/
</code></pre>
<h3>2. maxBy()</h3>
<code>maxBy()</code> returns the first element having largest value of the given function <code>selector: (T) -> R</code> or 'null' if there are no elements.
Method signature:

https://grokonez.com/kotlin/kotlin-list-methods-max-maxby-maxwith

Kotlin List methods – max() maxBy() maxWith() example
Word2Text cli on openbsd and linux
Tags: go, bash, linux, cloud
Published: 2021-04-19 11:33:23

I have regularly had the need to search/grep MS Word files for various things, normally ended up using a script running on Windows or more recently a docker container containing bunch of openoffice and a bunch of dependencies. I am a big fan of the Go/Golang programming language as it can generate a standalone executable and it has made it possible for geeks such as myself to create a minimal docker images with next to no dependencies. Therefore I came across the UniDoc UniOffice and UniPDF projects that can create Word and PDF documents in pure Go which means it is possible to create standalone binaries. I could very quickly create a few line CLI application that can convert the MS Word document into text and then I can use the standard unix grep and other utilities for further text processing. The tool is accessible at https://github.com/rthomascloud/word2text. I have also put it into a minimal Docker container based on Alpine which I use also.

In the coming weeks I will be creating more similar tools to convert PDF to Word, Powerpoint to Text and Excel to text to replace the hacked up openoffice stuff I have put together, stay tuned :).
Java – How to find an element in a Java List Object by Examples
Tags: java, javalist
Published: 2021-04-19 12:10:13

https://grokonez.com/java/java-how-to-find-an-element-in-a-java-list-object-by-examples

Java – How to find an element in a Java List Object by Examples

[no_toc]
In the tutorial, we will show how to find an element in a List Object with Java APIs and Google Guava library.

<!--more-->
<h2>contains()</h2>
Signature method:

<pre><code class="language-java">
boolean java.util.List.contains(Object o)
</code></pre>

-> Returns <code>true</code> if the list contains at least one element <code>e</code> such that <code>Objects.equals(o, e)</code>.

Example: 

<pre><code class="language-java">
List<Integer> integerList = Arrays.asList(1, 3, 7, 9, 11);

System.out.println(integerList.contains(3));
// true

System.out.println(integerList.contains(4));
// false
</code></pre>
<h3>Example with Custom Object</h3>
- Define a Customer class:

More at:

https://grokonez.com/java/java-how-to-find-an-element-in-a-java-list-object-by-examples

Java – How to find an element in a Java List Object by Examples
Daily Developer Jokes - Monday, Apr 19, 2021
Tags: jokes, dailydeveloperjokes
Published: 2021-04-19 12:00:18

---
title: "Daily Developer Jokes - Monday, Apr 19, 2021"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
cover_image: "https://private.xtrp.io/projects/DailyDeveloperJokes/thumbnail_generator/?date=Monday%2C%20Apr%2019%2C%202021"
published: true
tags: #jokes, #dailydeveloperjokes
---

Generated by Daily Developer Jokes, a project by [Fred Adams](https://xtrp.io/) ([@xtrp](https://dev.to/xtrp) on DEV)

___Read about Daily Developer Jokes on [this blog post](https://xtrp.io/blog/2020/01/12/daily-jokes-bot-release/), and check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/).___
### Today's Joke is...
![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e1259d077252.png)

---
*Have a joke idea for a future post? Email ___[xtrp@xtrp.io](mailto:xtrp@xtrp.io)___ with your suggestions!*

*This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit.*

<!-- 
Joke text:
___Q:___ Which programming language is the shortest?

___A:___ HTML. Because it doesn't have a neck between its `<head>` and `<body>`.
 -->
Mutation testing with PIT
Tags: java, showdev, testing, testdev
Published: 2021-04-19 11:45:04

Ever wondered what metric can be used to measure quality of Unit test. Mutation testing comes to the rescue. This video will use PIT library to enable Mutation testing in Junit tests. It explores how to read the test report generated. It also gives some of the pitfalls that one has to avoid when enabling mutation testing.
In below video, i shared step by step guide to enable Unit test quality metric using PIT. It also discusses some of the future work areas one can try.

{%youtube cDDmnVgdvt0 %}