teleren/devto huggingface dataset:
How to work with InterSystems IRIS from DataGrip
Published: 2022-01-24 19:52:30

[DataGrip](https://www.jetbrains.com/datagrip/) is a multi-engine database environment targeting the specific needs of professional SQL developers, DataGrip makes working with databases an enjoyable and productive experience.

To work with InterSystems IRIS from DataGrip you'll need to add InterSystems JDBC driver first (once per DataGrip) and after that add all your InterSystems IRIS connections.

**Part 1: Add InterSystems IRIS JDBC Driver**

1\. Go To File → DataSources

2\. Go to + → Driver

![](https://community.intersystems.com/sites/default/files/inline/images/images/image(1270).png)

3\. Set Driver properties:

-   Name: InterSystems IRIS
-   Class: `com.intersystems.jdbc.IRISDriver`
-   Add JDBC Driver file: path to `/<IRIS>/dev/java/lib/JDK18/intersystems-jdbc-3.2.0.jar` (version can change, also if you don't have InterSystems IRIS installed, you can download the drivers [here](https://github.com/intersystems-community/iris-driver-distribution))
-   Add URL Template: Basic `jdbc:IRIS://{host}[:{port}]/{database}` (you can add additional parameters as described [here](https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls?KEY=BJAVA_CONNECTING))

![](https://community.intersystems.com/sites/default/files/inline/images/images/image(1271).png)

4\. Click `OK` to save the driver definition.

**Part 2: Add InterSystems IRIS Instance**

1\. In the same DataSources window go to +→InterSystems IRIS

![](https://community.intersystems.com/sites/default/files/inline/images/images/image(1272).png)

2\. Specify connection settings depending on your instance and click `Test Connection`. You'll see an error or connection successful.

![](https://community.intersystems.com/sites/default/files/inline/images/images/image(1273).png)

It it's a new local installation the defaults likely are:

-   Host: localhost
-   Port: 1972
-   User: _SYSTEM
-   Password: SYS
-   Database: USER

3\. Click `OK` to save.

That's it! Now you can query and explore InterSystems IRIS through Datagrip.
The great mental models - Book notes (Engineering view)
Tags: java, beginners, mindset, pragmatic
Published: 2022-01-24 19:52:00

[The great mental models](https://www.amazon.com/Great-Mental-Models-Thinking-Concepts-ebook/dp/B07P79P8ST)
# The Great Mental Models: General Thinking Concepts

"The old saying goes, 'To the man with a hammer, everything looks like a nail.' But anyone who has done any kind of project knows a hammer often isn't enough." 

This book aims to give you the ability to change perspective by applying knowledge from different disciplines.

We need to remove our egos be aware of the limits of our perspective, and be close to the result of our decisions.

## Maps are not the territory - All models are wrong, but some are useful

Maps like many parts of the software are just abstractions of the real world with some limitations, but at the same time it allows us to navigate easily regarding the purpose of the abstraction

## Circle of competence
- We need to learn at least the basics of the realm we are operating in
- talk to experts: follow them on Twitter, Open-Source Software
- Falsifiability: use TDD to validate your assumptions

## First principles
**Socratic Questioning**
- Origin of the ideas
- Challenging assumptions
- Looking for evidence
**Use the 5 Whys**: To debug a software or organization problem

## Thought experiment
- Ask a question
- Conduct background research
- Construct hypothesis
- Test with **THOUGHT** experiments
- Analyze outcomes and draw conclusions
- Compare hypothesis and adjust accordingly

Sometimes the cost of replicating or changing something is just too high. we can replicate some engineering scenarios in our minds and let the magic happens 

## Second-Order thinking
- Realize the long-term interests 
- Identify the effects of the effects

What are the consequences of bad quality software? 
What happens if we add more testers? 
We are hiring 100 new engineers... but the onboarding process is poor

## Probabilist thinking
- Bayesian thinking: using a base rate of information (taking outside information)
- Fat-tailed curves: different from bell curves and normal distribution, something to be aware of
- Causation vs Correlation

In estimation: Do we have a previous model of how long it will take? Can we provide a worst, media, and best scenario?


## Inversion 
- Approach the situation from the opposite end of the natural starting point
- Set your assumptions
- Identify what are you trying to avoid 

What if we need to be flexible with a customer request?
Training to increase retention?
 
## Occam's razor 
- simpler solutions are more likely to be correct than complex ones. "When you hear hoofbeats, think horses, not zebras"

Don't over-engineer. Senior developers tend to create simpler solutions

- Passes the tests
- Reveals intention
- No duplication
- Fewest elements

## Hanlon's razor 
- Don't attribute to malice that which is explained by stupidity. It's less likely for two things to be true than one (less)
Making a Card API Project | Day 17
Tags: javascript, beginners, webdev, react
Published: 2022-01-24 19:37:16

This a An Exercise Problem From the Colt Steele React Course 

**Problem Statement ->**
Build an app that displays a deck of cards, one card at a time. When the page loads, send a request to https://deckofcardsapi.com/api/deck/new/shuffle to create a new deck. Store the Deck ID it gives you, so you can make further requests to retreive each card image. Add a button to your app that allows a user to draw a new card.

When a user clicks the button, send another request to the API, this time to https://deckofcardsapi.com/api/deck/${deck_id}/draw/. (make sure to use your actual deck ID). Use the data included in the response to display a new card image, and make sure to include an informative alt attribute.

Every time the user clicks, the app should display a new card until the deck is empty. Make sure to tell the user there are no cards left!

Here’s how this might look (with styling added):

![Cards Project](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ahft0kzlgzxdrzgu7fgj.gif)

This app Consists of 3 Component App,Deck,Cards
Deck Component is Stateful and stores all the State and pass it to the Cards using the Props.

**Solution 👇**
https://github.com/Developer-io-web/Card-api-Project

Happy Coding 🙂
Mysql Dockerfile --> Docker container. 🐧🐳
Tags: docker, mysql, linux, dockerfile
Published: 2022-01-24 18:58:00

**Spinup Mysql Docker Container✨**

Spinning a MySQL DB on docker is easier than installing and configuring it on a raw server and can spin up the MYSQL container within a few mins.

We can avoid MySQL secure installations, cnf configurations, and other setups that needed to be composed before starting the DB.

We can classify this into 3 stages,

**1) Dockerfile creation**

**2) Docker image creation** 

**3) Docker container creation**



**1)** Create the docker file

A Dockerfile is a text document that contains all the commands a user could call on the command line to assemble an image.
First, create a docker file.

`# vim Dockerfile`

Refer to the Dockerfile below to spinup MySQL 8.0

```
FROM mysql:8.0.23    
MAINTAINER vk@gmail.com
COPY my.cnf /etc/mysql/my.cnf  
ENV MYSQL_ROOT_PASSWORD mypassword 
ENV MYSQL_USER bob  
ENV MYSQL_DATABASE DATA123 
ENV MYSQL_PASSWORD new_password 
RUN mkdir /var/lib/mysql-files
RUN touch /var/log/mysqld.log
RUN chown mysql:mysql /var/log/mysqld.log
EXPOSE 3306
```

Explanation:

**FROM mysql:8.0.23**  --> Choosing base image as mysql.
**MAINTAINER vk@gmail.com** --> Author field.
**COPY my.cnf /etc/mysql/my.cnf** --> Need to setup the cnf file as for your configuration and copy the .cnf file to the directory where Dockerfile is located.
**ENV MYSQL_ROOT_PASSWORD mypassword** --> 'mypassword' will be the password for root user
**ENV MYSQL_USER bob** --> Create a additional mysql user named 'bob' if needed
**ENV MYSQL_DATABASE DATA123** --> Creating database 'DATA123' 
**ENV MYSQL_PASSWORD new_password** --> Password for mysql users.
**RUN mkdir /var/lib/mysql-files** --> Create mysql lib file directory.
**RUN touch /var/log/mysqld.log** --> Creating mysql log file to write the mysql logs.
**RUN chown mysql:mysql /var/log/mysqld.log** --> Ownership change for that file.
**EXPOSE 3306**  --> Assigning container port.



**2)** Docker image creation

Move to the directory where the  Dockerfile is located, then run the below command to create the docker image.

`# docker build -t image_name .`


**3)** Finally create docker container.

`# docker images` // to view the image id

` # docker run -d -p host_port:container_port --name {container-name} {image id}`

eg : # docker run -d -p 3306:3306 --name mydatabase 037da8935fa

check the status of the container,
`# docker ps -a`

Cheers!🥂✨
C vs C++ vs C#
Tags: beginners, programming, computerscience
Published: 2022-01-24 18:52:22

Have you encountered these programming languages and wondered why they have such similar names ? Well this article is a small introduction to explain what these 3 languages are all about.

## C
Invented in 1972 by Dennis Ritchie and published in 1978
C is a procedural language with the lowest level of abstraction, which means that it is as efficient as assembly code. It allows developers to access and manage memory directly. C compiles programs into machine code and can be used on any platform.
It is still the most widely used programming language of all time.

## C++
Created by Bjarne Stroustrup 1985

C++ was developed to be an extension of C, to enhance its capabilities and add object-oriented programming capabilities. It is therefore considered an intermediate level programming language.

Like C, C++ compiles to machine code, you can use it on any platform and you have to manage the memory manually. But unlike C, C++ is strongly typed.

Performance is comparable to C.

## C# 
Created by a team at Microsoft led by Anders Hejlsberg in 2002
C#  (pronounced C sharp) was also created as an extension of C, in the .NET Framework. It has a high-level of abstraction and object-oriented programming abilities.

You can also use C# on any platform, but it is rarely used outside of Windows.

Unlike C and C++, you don't have to manage memory manually, C# uses a technology called Garbage collection to manage this. And C# compiles in byte-code, rather than machine code.

## Conclusion

While learning C is a good thing because you will know the very basis of programming, it will be pretty difficult to master it. C++ and C# are much more modern and accessible.

They are still very popular, C and C++ seem to be slightly more appreciated than C#. You won't make a mistake choosing one over the other.

---

Photo by Charles Deluvio on Unsplash
CodeWars Kata: Moving Zeros To The End
Tags: python, codewars
Published: 2022-01-24 18:51:05

As a junior developer applying for jobs, I have found myself needing to brush up on my data structures and algorithms knowledge. I decided to try out some challenges on CodeWars, which I feel is beginner-friendly compared to other sites. 

On CodeWars, the challenges(Katas) are categorized depending on the difficulty, with 8kyu being the easiest and 1Kyu being the hardest. 
In this challenge;

**_Instructions_**
Write an algorithm that takes an array and moves all of the zeros to the end, preserving the order of the other elements.

```python
move_zeros([1, 0, 1, 2, 0, 1, 3]) # returns [1, 1, 2, 1, 3, 0, 0]
```
_**Approach**_
Find all zeros in the list and move them to the end. 
One way to implement this would be to initialize a new list, loop through the original list to find zeros, and append them to the new list. Use the `extend()` method to add the zeros to the end of the list.

```python
def move_zeros(lst):
    newarr =[]
    zeroarr=[]
    for i in lst:
        if i != 0 or type(i)== bool :
            newarr.append(i)
        else:
            zeroarr.append(i)
                    
    newarr.extend(zeroarr)
    return(newarr)
```
**Use Lambda**
Although the solution above gets the job done, there's a more pythonic way to do it using the lambda function. Read more about the lambda function [here](https://docs.python.org/3/reference/expressions.html#lambda).

Syntax: `lambda argument(s): expression `

```python
def move_zeros(lst):
    return sorted(lst, key=lambda x: x==0 and type(x) is not bool)
```
sorted() has a key parameter to specify a function to be called on each element.
The lambda function is an anonymous function that, when used with sorted, returns the list with the zeros at the end.
[This post](https://stackoverflow.com/questions/8966538/syntax-behind-sortedkey-lambda) can clarify how sorted and the lambda function work under the hood.
Looking for contributor,mentor, devs to develop an open source CRM from scratch in django
Tags: crm, django, ux, design
Published: 2022-01-24 18:47:58

Hi devs,
I recently joined here and I came over by watching the video interview of @liyasthomas where he had explained the importance of open source. Willing to develop an open source product which helps and resolve their needs, that fits in all vertical and domains without any commercial upgrades and frequent updates. since I am learning coding I need your expertise to get started  by suggesting a domain name which brings birth. Request your support and help on this. Please suggest. 

@liyasthomas thanks for being an inspirer to encourage young engineers like me.

## Need your suggestions on domain names.
Links For Basics Of Machine Learning
Tags: python, machinelearning, beginners, programming
Published: 2022-01-24 18:47:00

## Basic Concepts:-

1. **Free 1 Hour Course for Understand the basics of machine 
learning** by **Google**
Link :- 
https://learndigital.withgoogle.com/digitalgarage/course/machine-learning-basics

2. [Basic Statistics Concepts for Machine Learning Newbies! with practicals using Python](https://www.analyticsvidhya.com/blog/2021/07/basic-statistics-concepts-for-machine-learning-newbies/)

3. [Data Structures Related to Machine Learning](https://dzone.com/articles/data-structures-related-to-machine-learning-algori)

4. [Commonly used Machine Learning Algorithms (with Python and R Codes)](https://www.analyticsvidhya.com/blog/2017/09/common-machine-learning-algorithms/)

5. [Statistics in ML.](https://medium.com/pythoneers/statistics-in-ml-3d70b09d72b7)

** **

## Interview Questions:-

1. [40 Interview Questions On Statistics For Data Scientists.](https://analyticsindiamag.com/40-interview-questions-on-statistics-for-data-scientists/)

2. [25 Probability and Statistics Questions to Ace your Data Science Interviews.](https://www.analyticsvidhya.com/blog/2021/04/25-probability-and-statistics-questions-to-ace-your-data-science-interviews/)

3. [Top Statistics Interview Questions.](https://www.mygreatlearning.com/blog/statistics-interview-questions/)

4. [10 Statistical Concepts You Should Know For Data Science Interviews.](https://www.kdnuggets.com/2021/02/10-statistical-concepts-data-science-interviews.html)

5. [Machine Learning Interview Questions.](https://www.interviewbit.com/machine-learning-interview-questions/)

** **


Thank You For Reading.

_ _

_Above All Resources are free to read and Learn. I am not promoting any comercials._
OWASP AND ITS 10 VULNERABILITIES
Published: 2022-01-24 18:44:29

The full form of OWASP is the Open Web Application Security Project. It is a non-profit group that helps a variety of organizations to develop, purchase, and maintain software applications that can be trusted. The educate developers, designers, architects, and business owners all are sought by OWASP to identify the risk associate with the most common web [application security](https://comparecheapssl.com/cheap-code-signing-certificate-providers/) vulnerabilities. OWASP is known as a forum as it supports both open source and commercial security products in which information technology professionals can network and build expertise. The materials which are needed by the organizations are available for the free and open software license.
 
TOP 10 VULNERABILITIES OF OWASP
OWASP is the open call for data and best for industries and companies to perform secure code reviews, penetration testing, etc., and can send their data anonymously. For producing a frequency of each risk and each vulnerability, the data will be collated and assigned based on the score on its exploitability, prevalence, detectability, and technical impact.
1.	Injection 
2.	Broken Authentication
3.	Sensitive data exposure
4.	XML External Entities (XXE)
5.	Broken access control
6.	Security misconfigurations
7.	Cross-Site Scripting
8.	Insecure Deserialization
9.	Using components with known Vulnerabilities
10.	Insufficient Logging and Monitoring
[Original Article](https://comparecheapssl.com/owasp-and-its-10-vulnerabilities/)
Starting an app with react native! (just to save)
Published: 2022-01-24 18:31:56






Today, I'll talk to you, about one the other way to starting a react native project, with all requirements...
let's start!

0. Installing 

[Node- LTS](https://nodejs.org/en/)

1.2 Create an account on: 

```
https://expo.dev/

```
after, download the app in the apple store(apple) or play store(android).

2.
terminal(cmd):
```
cd..
```
for c:/
and paste:

```
npm install --global expo-cli
```
2.

```
expo init HelloWorld
```
3.

```
cd HelloWorld

```
4.

```
expo start
```
now, you login into your app, and scan the QRCODE.
that appears.
5. Go at the Helloworld folder click with the right button(🐀) and open with vscode.
in the new terminal, write:
```
expo login
```
 digite your credentials...
6.

```
expo start
```
now...
go to the square at the bottom of your app, and click in your application...: recently in development.
****remeber that your device have to connect with usb in your computer****
good study!
Equal Partitions
Tags: 100daysofcode, java, algorithms, programming
Published: 2022-01-24 18:31:06

# Description

Given a list of positive integers `nums`, return whether you can partition `nums` into two groups where the sum of the elements in both groups is equal.

**Constraints:** 

- `n ≤ 250`
- `1 ≤ nums[i] ≤ 100`

## Example 1

### Input

```
nums = [1, 2, 5, 4]
```

### Output

```
true
```

### **Explanation**

```
We can have these partitions: [1, 5] and [2, 4].
```

---

# Intuition

1. make sure the sum of array is even
2. Backtracking

# Implementation

```java
import java.util.*;

class Solution {
    public boolean solve(int[] nums) {
        int sum = 0;
        for (int num : nums) {
            sum += num;
        }
        if (sum % 2 == 1) {
            return false;
        } else {
            return canSplit(0, sum / 2 - nums[0], nums);
        }
    }

    private boolean canSplit(int index, int target, int[] nums) {
        if (target == 0) {
            return true;
        } else if (target < 0) {
            return false;
        }
        for (int i = index + 1; i < nums.length; i++) {
            if (canSplit(i, target - nums[i], nums)) {
                return true;
            }
        }
        return false;
    }
}
```

## Time Complexity

- Time: O(nlogn)
- Space:O(logn)
My Web Developement and Designing internship experience under Oasis Infobyte Community
Tags: webdeveloper, internship, oasisinfobyte, experience
Published: 2022-01-24 18:29:45

Hello everyone,
Hope you all are doing extremely well!
I am glad to share that I have successfully completed my one month virtual web development internship at Oasis Infobyte Community under their  Internship Program OIB-SIP.
I am thankful to Oasis Infobyte Community for giving me this wonderful opportunity to learn and enhance my skills. It was a great learning experience full of ups and downs, but everything at the end just paid off! Oasis Infobyte Community has provided amazing resources which helped me a lot to get all my web development concepts clear. This community is very helpful and helped me a lot in my web development journey.
I assure you Oasis Infobyte Community will help you to grow and enhance in your career by upskilling you! I highly recommend you to please check out their website once and the link for the same is as follows:-

https://oasisinfobyte.in/


#webdevelopment #oasisinfobyte  #internship #experience #intern #thankyou #webdeveloper
Ruby Reduce
Tags: ruby, enumerables, beginners
Published: 2022-01-24 18:28:31

<figcaption>Photo by <a href="https://unsplash.com/@shambam?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Sam 🐷</a> on <a href="https://unsplash.com/s/photos/funnel?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a></figcaption>
<br>
If you have bounced back and forth between Ruby and JavaScript like I have, you may have found yourself doing some mathematical operations in Ruby and thinking to yourself, "Wouldn't it be nice if Ruby had a reduce method?". If you followed a similar Ruby learning path to me, you might have learned about the `inject` method, but not put two and two together (ha!). 

In Ruby, `inject` and `reduce` are aliases for each other. They both behave the same way, and there is no performance benefit to one over the other. They both combine all elements to a single output. `reduce` is a Ruby enumerable, which means that for each element in your argument, something is done. In the case of `reduce`, you can specify an operation, a block, or pass in a symbol to tell the reduce method how you want your values, um, reduced.

For example:
```ruby
def reduce_sum(array)
  array.reduce(0) { |sum, num| sum + num }
end
```

In this method, we are passing in an array of numbers to add up to a total. We pass in 0 as the initial argument to reduce, so it knows where to start counting. Then, inside the block, we tell the `reduce` method what we want it to do. For this method, we want the reduce method to keep a running total, called `sum`, and then add each number in the array to it. So if we pass in the array `[1, 2, 3, 4, 5]`, our operation will look something like this as reduce iterates over the array:

sum = 0
sum = 0 + 1
sum = 1 + 2 
sum = 3 + 4
sum = 7 + 5

A shorthand way of writing the same method would be:
```ruby
def reduce_sum(array)
  array.reduce(:+)
end
```
If you do not tell `reduce` what the initial value is, the first element of the array is used as the initial value. Here, we're passing in a symbol instead of a block which tells `reduce` to add up all the elements in the array. 

You use reduce to do all sorts of mathematical operations on larger amounts of numbers where a final answer is the desired output. Here's an example with multiplication:

```ruby
def reduce_mult(nums)
  nums.reduce(1, :*)
end
```
Here, we have to tell the `reduce` method to start at 1, since 0 * anything is 0, and the method will output 0 every time, no matter what you pass in. 

I hope this helps the next time you find yourself needing to do math with more than two numbers in Ruby!

<a href="https://ruby-doc.org/core-2.4.0/Enumerable.html#method-i-reduce" target="_blank">Ruby Docs on Reduce</a>