teleren/devto huggingface dataset:
Database System Concepts 7th Edition Solutions -Chapter 2
Tags: database, databasesystemconcepts, databasesolutions, databaseexercise
Published: 2021-11-01 20:56:22

Database System Concepts is the highly recommended book for the people interested in databases. Free version of this book can be downloaded from HERE.
Practice Exercises
2.1 Consider the employee database in below Figure. What are the appropriate primary keys?

Primary key is an attribute in a table which can uniquely identify that table. In employee table the person_name, in works table person_name and in company table company_name are the primary keys.

2.2 Consider the foreign-key constraint from the dept name attribute of instructor to the department relation. Give examples of inserts and deletes to these relations that can cause a violation of the foreign-key constraint.

Insertion:
As Instructor is child table of department for attribute dept_name, then adding something in instructor table which is not in department table will cause error. For example if we add economics as dept_name in instructor table but department table don’t contain it then it is a violation of foreign key constraint.

Deletion:
As department is parent table of instructor for attribute dept_name, then deleting something in department table which is present in instructor table will cause error. For example if we delete economics as dept_name in department table but instructor table do contain it then it is a violation of foreign key constraint.

2.3 Consider the time slot relation. Given that a particular time slot can meet more than once in a week, explain why day and start time are part of the primary key of this relation, while end time is not.

To read more visit https://hecodesit.com/database-system-concepts-7th-edition-solutions-chapter-2/
[Hacktoberfest 2021] Responsive design with css
Tags: css, opensource, html, hacktoberfest
Published: 2021-11-01 20:35:22

My third contribution to the hacktoberfest 2021 was fixing the responsive design.
When I saw the word "responsive", it seemed very interested for me because I have not worked on css for a while after second semester of school.
I chose the issue that I could bring up my old memories from few years ago. 
https://github.com/mohitbalwani/Citi-site/issues/1

It is an one-page website that is created with html and css only now, and had some bug with the last section when reducing the window size. 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rrwvbye3tkm4syjsgasi.png)


The update was made with css. I first updated the division of the section as two-column design. 
Inside "row 4" division, I added two more divisions for the column designs. And added width as percentages to make those columns align horizontally. 
```css
.column {
    float:left;
}
#col1 {
    width: 55%;
}

#col2 {
    margin:0%;
    width: 45%;
}
```

After, I wanted to add some specific rules for smaller windows, by using "@media" struct.
```css

@media(max-width:700px){
    .row4 {
        height: 70vh;
    }
    .column h1{
        font-size: 2rem;
    }
    .form{
        font-size: 1.2rem;
    }
    .column button{
        width: 22vw;
        text-align: center;
    }
    .column {
        align-items: center;
    }
}

```

After the fixes, with the smaller windows, width under 700px it looked like the image below. 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6aicl9sn7av3oynmfgos.png)

Also, I added another media struct for even smaller windows such as phones. 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/27gocsdztqhrpmcz1wvn.png)
   
This issue had very little description and no Readme.md in the project, and that made me understanding the code little longer. However the owner of the project was very responsive and communicated with me well so that I could move on to solve the issues. 

You can find my pull request on this issue below.
https://github.com/mohitbalwani/Citi-site/pull/4
My First Pull Request on Hacktoberfest 2021
Tags: opensource, hacktoberfest, java, junit
Published: 2021-11-01 19:44:54

As the first participation on hacktoberfest 2021, I chose an issue from search API called meilisearch. It was built for Java developers to help with their searches with some filters, sorting, and keywords which makes the developers to integrate search function easier in their program. 

The issue was created by the modifier of the project,
https://github.com/meilisearch/meilisearch-java/issues/270
It was missing some test cases for the setting functions. 
I had no experience with Junit before, but unit testing seemed very interesting and important so I chose to contribute to the issue. 

The tasks are to create one more test case for each subsetting functions when user input null as the setting value. The function was to reset the setting to the default setting of the API. 
Junit methods that was being used in my test cases are below.

```java
assertEqual(expected,actual);
assertNotEqual(expected, actual);
assertArrayEqual(expected, actual);
```

After I push my changes and create PR, I failed the automated test because I forgot to run the script to remove the linter. 
And after I remove the linter, I was finally able to get it passed and accepted by the modifier. 
https://github.com/meilisearch/meilisearch-java/pull/271
How to install the Swift Toolchain on Linux
Tags: swift, videos, linux
Published: 2021-11-21 08:34:31

---
title: How to install the Swift Toolchain on Linux
published: true
date: 2021-11-01 20:22:36 UTC
tags: Swift,Videos,linux,swift
canonical_url: https://peterwitham.com/swift/how-to-install-the-swift-toolchain-on-linux/
---

{% youtube AQxskCHzPfM %}

In this video, I show you all the steps needed to set up the Swift Tool chain on Linux. In the video I use Ubuntu 20.04 however, the steps are the same regardless of distribution.

By the end of the video, you’ll be ready to write some Swift. I use the REPL to demonstrate this, please note that you can write and execute Swift files as well.
[Hacktoberfest 2021] Fixes UI of the application
Tags: css, html, opensource, hacktoberfest
Published: 2021-11-01 20:19:53

My second contribution was for a website called "GDSC JGEC Website". 
The issue was with some UI of the webpage, which had some bug, and also design that was not enough.
https://github.com/gdscjgec/gdscjgec.github.io/issues/38#issuecomment-953101856

![Original Page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o2t338tnb2um84fj90bt.png)
The original page looked like this. There was a bug with the banner "Upcoming Events" which was not showing properly. 
I updated the margin-top from 2% to 5% to show off the whole banner properly. 

For the design of the website, I wanted to make it looks like matching with the website theme. 
So I re-used the background image from another page of the application. Also the color, light green did not quite suit with the website theme. I looked at other pages to find some colors that goes with the main theme of the webpage, and re-used those colors to the event card. 
Also, font and the box designs was modified to match with other pages. 
After the fixes, it looks like below.
https://github.com/gdscjgec/gdscjgec.github.io/pull/40
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tcuwkdcv2hbeqzlprhz9.png)
Python Arrays
Tags: python, array, tutorial
Published: 2021-11-01 13:47:14

There is a problem with lists, its violets are the basic property of an array which is a homogeneous collection of elements.

Though there is no in-built support for arrays in python, we can use a module name array to create an array data structure.


![Python Arrays](https://miro.medium.com/max/1400/1*__NdMC8nBK1aqbAvGBPYaA.png)

Image credits to [analyticsvidhya](https://www.analyticsvidhya.com/)

Syntax to create an array in Python using array Module:

#### import array
```
variable_name = array.array('Type code',[item1 , item2, item3,])
```
Example:

#### import array
```
arr = array.array('d', [1,2,3,4])
```

[Arrays in Python](https://www.techgeekbuzz.com/python-arrays/) Type codes:

The Unicode decide the data type of all the elements and all the element data type should match the type code.

Syntax:
```
array.array(‘Type code or UniCode’ , [list of items] )
```

![Syntax](https://miro.medium.com/max/513/1*HWeNciF9hsJ2__VlqTyxJw.png)

With the array module, we can only create an array of numeric elements.

In general, we use python lists as arrays, but theoretically, arrays cannot store different data types at once.

#### Python List
```
python_list = [1,2,3,4,5,"This is a List"]
print(python_list)
```
#### Array Module in Python

#### import array
```
python_array = array.array('i' , [1,2,4,5,6,7,])
print(python_array)
```

## Conclusion:

We do not use a python array module to build arrays because we cannot perform a mathematical or arithmetic operation on array elements.
Thinking in Pandas - Book Review
Tags: python, datascience, books
Published: 2021-11-01 19:58:06

## The Book:  
[Thinking in Pandas](https://link.springer.com/book/10.1007/978-1-4842-5839-2) By Hannah Stepanek
## Short Summary:
"Thinking in Pandas" is a book written on how to optimize your Pandas code. It starts with an introduction to the Pandas library, the basics of loading/merging, and how Pandas works under the hood. The middle chapters detail the typical things you would use Pandas for and how to optimize those operations. It ends with ways that you can use tools outside of the library for speed and the library's future.
## What I liked:
I like the detail that Hannah went into because it helped me understand the library as a whole. It wasn't a cookbook-style book, but more like a course on Pandas and why one thing is better. I also enjoyed the diverse set of optimizations.

## What I disliked:

Although the overall book is excellent, there were two things that I wish I could change. First are the code examples. Aesthetically they were tough on the eyes. They could have done a little more work on making it look nice. Second, Hannah doesn't dive into distributed solutions for large datasets. I like to think that most people will use Spark for their distributed solutions, but those interested in using only Pandas can use a library like Dask. 
## Review round-up:

This book is necessary for any Data Engineer or a Pandas user interested in developing better habits. The book has some shortcomings, but they aren't enough to warrant skipping this book. I used some of the suggestions immediately, and I'm grateful for all the work Hannah put into it.
## Rating:
8/10 Python Snakes
Glimmer DSL for SWT Supports Linux DEB/RPM Packaging
Tags: ruby, desktop, gui, dsl
Published: 2021-11-01 19:53:26

[Glimmer DSL for SWT](https://github.com/AndyObtiva/glimmer-dsl-swt) v4.21.2.0 just added support for Linux DEB/RPM native executable packaging (while still supporting the older GEM packaging alternative), rendering Linux a 1st class packaging citizen just like Mac, which has support for APP/DMG/PKG native executables/installers, and Windows, which has support for MSI/EXE native executables/installers. [Native Executable Packaging](https://github.com/AndyObtiva/glimmer-dsl-swt/blob/master/docs/reference/GLIMMER_PACKAGING_AND_DISTRIBUTION.md) is one of the features that separate [Glimmer DSL for SWT](https://github.com/AndyObtiva/glimmer-dsl-swt) from the pack (do not know any other Ruby desktop GUI up-to-date library with reliable fully-contained native executable packaging)

Here is the full list of changes:

- Support Linux packaging of deb/rpm native executables (not just gems) through standard `glimmer package` call (e.g. `glimmer package[deb]` or `glimmer package[rpm]`)
- Update Glimmer::SWT::ImageProxy implementation of image loading from JAR to use JRuby.runtime.jruby_class_loader.get_resource_as_stream(file_path).to_io.to_input_stream
- Remove scaffolding/packaging building/using of a generated Java Resource class
- Force installing gem 'psych', '3.3.2' in scaffolded app as a temporary workaround to psych issues with the latest jruby (jruby-9.3.1.0)

To learn more about packaging with [Glimmer DSL for SWT](https://github.com/AndyObtiva/glimmer-dsl-swt), check out the [Glimmer Packaging and Distribution reference document](https://github.com/AndyObtiva/glimmer-dsl-swt/blob/master/docs/reference/GLIMMER_PACKAGING_AND_DISTRIBUTION.md).

Here is a screenshot of the generated RPM installer (on Red Hat Enterprise Linux) upon running:

```
glimmer package[rpm]
```

![rpm](https://raw.githubusercontent.com/AndyObtiva/glimmer-dsl-swt/master/images/glimmer-packaging-linux-rpm.png)

Here is a screenshot of the generated DEB installer (on Linux Mint Cinnamon) upon running:

```
glimmer package[deb]
```

![deb](https://raw.githubusercontent.com/AndyObtiva/glimmer-dsl-swt/master/images/glimmer-packaging-linux-deb.png)

If you are curious about previous Mac and Windows support too, here are screenshots of the generated Mac DMG installer upon running:

```
glimmer "package[dmg]"
```

![dmg license](https://raw.githubusercontent.com/AndyObtiva/glimmer-dsl-swt/master/images/glimmer-packaging-mac-dmg-license-screen.png)

![dmg](https://raw.githubusercontent.com/AndyObtiva/glimmer-dsl-swt/master/images/glimmer-packaging-mac-dmg.png)

And, here is a screenshot of the generated Windows MSI installer upon running:

```
glimmer "package[msi]"
```

![msi](https://raw.githubusercontent.com/AndyObtiva/glimmer-dsl-swt/master/images/glimmer-packaging-windows-msi.png)

Happy [Glimmering](https://github.com/AndyObtiva/glimmer-dsl-swt)!
My Hacktoberfest 2021 Journey
Tags: hacktoberfest, opensource, programming, webdev
Published: 2021-11-01 19:51:40


So this was basically my first bunch of open-source contributions, and I have to say, it was the best decision to use this event to learn more about contributions.

### Progress
![Hacktoberfest Dashboard](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yawqlmkg2pj2107umw3s.png)
So far, the majority of my PRs are still undergoing the 14-day maintenance review check, so I still have my fingers crossed. Currently, it's 1 down, 6 more to go.

### Contributions

The most basic contribution I made that I would love to highlight was adding some developer resources to Fueler's repository.
{% github https://github.com/Fueler-io/Web-Development-Resources/issues/1 %}
It opened the way to making more complex PRs in other repositories. It also proved that it's possible for people who are not developers to have non-technical but valuable contributions.
In a nutshell, this was how easy it was:
{% github https://github.com/Fueler-io/Web-Development-Resources/pull/53 %}
Besides that, I found myself contributing to projects involving UI improvements and bug fixes related to frontend development.

### Reflections

Overall, the event was great. I'm thankful to all the numerous blogs and video content creators for not leaving me to fly on my own, because I'd have crashed. It's definitely something I would love to try out next year. The goal for next year's event is to make more quality PRs and also help newbies who are new to open source contributions (if I can) to get a grasp of all what it's about. 


That's all for now, Adiós!
HacktoberFest Review
Tags: hacktoberfest
Published: 2021-11-01 19:46:35

HacktoberFest 2021 is in the Repos. So how did it go?

## Success! 
This is my second time completing the HacktoberFest challenge. Over the past month I've submitted a total of five pull requests to open source projects. As of this writing four have been accepted one is pending. The last one was just submitted on the final day of the event.

Of the accepted Pull requests, three have matured and one will mature tomorrow. Then it will be official.

## What Did I Do?


### 1 of 4 towards goal

I started HacktoberFest with Virtual Coffee's Kickoff event. [Bekah](https://dev.to/bekahhw) and [Dan Ott](https://dev.to/danieltott) hosted a Zoom event where new members could add themselves to our Virtual Coffee site. Dan led us through the process of forking a repo and, working on the issue, and then submitting a pull request.


This year the Virtual Coffee group added member profiles. New and existing could add their social media links to the members page. I added mine and had my first PR.

### 2 of 4 towards goal

My next pull request was helping Dominic's new project. He's building a python project using Turtle Graphics canvas. I've seen some art made with canvas. Dominic wanted the Mac instruction for opening the project. I described how to cd into the project and open it. This sounds like a cool project, I hope he keeps building it. 

### 3 of 4 towards goal

Next, I wrote some Documentation for Virtual Coffee. They wanted an expanded Pull Request Template. I fleshed out the instructions and commented out the help text, so that once the PR was submitted the standard text would not appear on screen.
 
I learned more about how GitHub's pull request process works how to write more informative pull requests. To document the process I made test PRs to my private repo. I couldn't find the option to make a draft pull request to a project. So I searched for answers. 

GitHub's blog said draft PRs are not available on private repos. So, I made a test PR to on of my public repos. And saw the Draft PR option. I submitted the pull request. Digital Ocean alerted me that my project wasn't participating in HacktoberFest. 

Which it wasn't. I don't have an open source project. It good that they tell people that projects aren't participation so that Maintainers don't get spammed by people looking for junk PRs. I'm glad they made it so maintainers must Opt-in Hacktoberfest for PRs to count.


### 4 of 4 towards goal
My Fourth PR was for ThisDot Labs. They have a repo that list tech podcasts and wanted a Table of Content (TOC) for the list. I used markdown to build the TOC. I learned how to make a table in markdown and later used skill that to make a table in some notes I have for a personal project.


### 5 of 4 extra.

Last day of the month I did one more for ThisDot Labs. I added a newsletter link to their list of newsletters.

## Conclusion

I enjoyed working on open-source projects and loved the support I got throughout the process. I appreciate that HacktoberFest is pushing Open Source.

Did you participate in HacktoberFest? 

What did you help build?
Find Many and return specific columns laravel
Tags: php, laravel, beginners, programming
Published: 2021-11-01 19:42:12

Eloquent method find() may accept multiple parameters, and then it returns a Collection of all records found with specificied columns, not all columns of model:-

```php
$user = User::find(1, ['first_name', 'email']`;
$users = User::find([1,2,3], ['first_name', 'email']);
```
I hope someone can benefit from it.
Building a REST CRUD app with Golang Revel
Tags: go, revel, programming, postgres
Published: 2021-11-01 19:32:22

---
title: Building a REST CRUD app with Golang Revel
published: true
description: Building a REST CRUD app with Golang Revel
tags: golang,revel,programming,postgres
canonical_url: https://citizix.com/building-a-rest-crud-app-with-golang-revel/
//cover_image: https://direct_url_to_image.jpg
---

In this tutorial we create will be a simple posts CRUD app that will connect to the Postgres Database. 


Checkout the full guide here https://citizix.com/building-a-rest-crud-app-with-golang-revel/
Updates from the 86th meeting of TC39
Tags: javascript
Published: 2021-11-01 19:31:32

There were several items on the agenda, this post focuses on feature proposals and their progress form the meeting that was held between October 25th-28th, 2021.

__Stage 4:__

* [Intl.Segmenter](https://github.com/tc39/proposal-intl-segmenter): Unicode segmentation in JavaScript [slides](https://docs.google.com/presentation/d/1C3Ju836l5kM-7rskrBjSEVWtKlgjeB2QevUe9E5KLzU/edit?usp=sharing).

* [Error Cause](https://github.com/tc39/proposal-error-cause) : `.cause` property on all Error types [slides](https://docs.google.com/presentation/d/1bwS6QRmF5o6bDSn4OQPTv4GpiQ5o0nzcvqiED9Sii44/edit?usp=sharing).

__Stage 3:__

* [Intl.DurationFormat](https://github.com/tc39/proposal-intl-duration-format): `Intl.DurationFormat` duration formatting [slides](https://ryzokuken.dev/slides/2021-10-df).

__Stage 2:__

* [Destructure Private Fields](https://github.com/jridgewell/proposal-destructuring-private): Integrate private fields and destructuring [slides](https://docs.google.com/presentation/d/1DyQtp2Zm7Wp8VgQ1NraHtX1b4yaPPVXy4Rfy8Bqp6XU/edit#slide=id.gf8bf874a91_0_68).

* [array-grouping](https://github.com/tc39/proposal-array-grouping): make grouping of items in an array easier [slides](https://docs.google.com/presentation/d/1fP2D8hAnUJBLI4gr7YxfYS_I8vTSuugbhN2K_0YmJow/edit#slide=id.gc6f73a04f_0_0).

__Stage 1:__

* [String.cooked](https://github.com/tc39-transfer/proposal-string-cooked): `String.raw` but which concatenates the “cooked” (escaped string value) strings rather than the raw strings [slides](https://docs.google.com/presentation/d/1Au8FP1xTuXb52d6kG1fxX5Cxl3J-02h3FAaq8tMEtn8/edit?usp=sharing).

* [bind-this](https://github.com/js-choi/proposal-bind-this): A resurrected proposal for a bind-this operator [slides](https://docs.google.com/presentation/d/1gVvYE1TwXN0C5R88meeFv2wNSROH9vWSwFmGbcaHsdM/edit?usp=sharing).

* [RegExp Extended Mode and Comments](https://github.com/rbuckton/proposal-regexp-x-mode): Extended Mode and Comments for RegExp [slides](https://1drv.ms/p/s!AjgWTO11Fk-Tkfl_R_GWK0hIILFQDg?e=FjB377).

* [RegExp \R Escape](https://github.com/rbuckton/proposal-regexp-r-escape): Matches any line ending character sequence [slides](https://1drv.ms/p/s!AjgWTO11Fk-TkfoQmhSpEYYM0spVqg?e=zsP6g4).

* [RegExp Buffer Boundaries](): `\A`, `\z`, `\Z` allows to match the start or end of the entire input regardless of whether the m (multiline) flag has been set [slides](https://onedrive.live.com/view.aspx?resid=934F1675ED4C1638!294162&ithint=file%2cpptx&authkey=!AJx2BQqKOJmJ3Uw).

* [Evaluator Attributes](https://github.com/tc39-transfer/proposal-evaluator-attributes): Enables the module import syntax to provide extra attributes along with a given import as evaluator attributes with the primary use case in mind of permitting these module type imports for Wasm [slides](https://docs.google.com/presentation/d/1YCaUQ72q6TaPLkODr1rSfkr2M8EfGpuK8MHNGaqP9fU/edit#slide=id.gea347d7499_0_49).

<hr/>

<center>[@gnumanth](https://twitter.com/gnumanth)</center>
Building a REST CRUD app with Golang Revel
Tags: go, revel, programming, postgres
Published: 2021-11-01 19:28:36

---
title: Building a REST CRUD app with Golang Revel
published: true
description: Building a REST CRUD app with Golang Revel
tags: golang,revel,programming,postgres
canonical_link: https://citizix.com/building-a-rest-crud-app-with-golang-revel/
//cover_image: https://direct_url_to_image.jpg
---

In this guide we are are going to check a simple implementation Revel Framework REST API. In this tutorial we create will be a simple posts CRUD app that will connect to the Postgres Database. Feel free to checkout the repo where the full code is hosted here.


Checkout the full guide here https://citizix.com/building-a-rest-crud-app-with-golang-revel/