teleren/devto huggingface dataset:
Handling Excel File with Ruby on Rails
Tags: rails, excel, rubyxl, ruby
Published: 2017-12-18 05:32:41

---
title: Handling Excel File with Ruby on Rails
published: true
description: I describe how to use rubyXL.
tags: Rails, Excel, rubyXL, Ruby, RubyonRails
---

Hello, everyone!

## Circumstance Of Excel With Ruby on Rails

When you guys handle Excel File, there are two operations.

1. Read Excel File
2. Write Excel FIle

Today, there are several gems to handle Excel File in Ruby on Rails ,e.g roo, axlsx, rubyXL. But, it does not always mean all of them are useful.
That is some of the above gems is not equipped with all operations.

For example, 'axlsx' gem can't read Excel file and 'roo' gem can't write. Therefore, I was looking for the gems that have all operations and usefulness. And then I discoverd 'rubyXL' gem which is so useful and easier to use than other gems. In the following, I will introduce the standard method to use rubyXL.

##What Is Implemented With rubyXL

On condintion that you have format file, I implement the following.

1. Read Excel File
2. Write Excel File
3. Export Excel File

##Preparing To Implement

### Install rubyXL

add the following code into Gemfile.

```ruby:Gemfile
gem 'rubyXL'
```

and then you should do 'bundle install'

```ruby:terminal
bundle install
```

##How To Implement With rubyXL
###Read Excel File

```ruby
workbook = RubyXL::Parser.parse('ExcelFilePath')
```

You should replace 'ExcelFilePath' with the path in which you want read file.

###Acquire WorkSheet

```ruby
worksheet = workbook['WorkSheetName']
```

As the following, you can specify worksheet by index.

```ruby
worksheet = workbook[０]
worksheet = workbook.first
```

###Acquire CellValue

```ruby
cell_value = worksheet[y][x].value
```

You should be careful with the location of 'x' and 'y'.

###Add Cell
```ruby
worksheet.add_cell(y, x ,value)
```
Similarly, You should be careful with the location of 'x' and 'y'.

```ruby
cell_value = worksheet.add_cell(y, x ,value)
```

As the above, you can also acquire the value of added cell.

###Write Excel File

```ruby
workbook.write('ExcelFilePath')
```

you should replace 'ExcelFilePath' with the path in which you want put written file.

###Export Excel File
```ruby
send_data(
      workbook.stream.read,　
      :disposition => 'attachment',
      :type => 'application/excel',
      :filename => "FileName.xlsx"
    )
```

If you want binary data, you can get the data in the following.

```ruby
workbook.stream.read
```

##For Copy & Paste 

```ruby
#Read Excel File
workbook = RubyXL::Parser.parse('ExcelFilePath')

#Acquire WorkSheet
worksheet = workbook['SheetName']

#Acquire Cell Value
cell_value = worksheet[y][x].value

#Write Excel File
workbook.write('ExcelFilePath')

#Export File
send_data(
      workbook.stream.read,　
      :disposition => 'attachment',
      :type => 'application/excel',
      :filename => "FileName.xlsx"
    )
```

##Thank You For Reading
In this time, I show implemention of rubyXL on condintion that there is format file. If you want to change width of cell and color of text and anything, you should read Document of rubyXL.

Thank you for much.
Have a good ruby life!
Explain Acceptance Testing to me like I'm five
Tags: explainlikeimfive
Published: 2017-12-18 00:45:19

---
title: Explain Acceptance Testing to me like I'm five
published: true
description: I know about the three types of software testing, but I've just recently heard the term Acceptance Testing, and I don't have a clue what it means.
tags: explainlikeimfive
---
Hello fellow dev.to-ians! I know of three types of software testing. Unit, integration and end-to-end. But I've just recently heard about Acceptance testing. Anyone willing to explain to me what it is?
Hi, I'm Israel
Tags: introductions
Published: 2017-12-17 22:56:55

---
title: Hi, I'm Israel
published: true
description: Hello world. I am here
tags: introductions
---

Hi! My name is Israel.

I love all the things related to technology (specially, software development). For this reason, spend my free time working on open source projects, attending to conferences or researching about new technologies.

Also, I can defined myself as a Linux, Python, Docker and GitHub user.

You can find me in a lot of social networks like GitHub as `iblancasa`.

I am from Granada, Spain.

I work in a company called [Real Time Innovations](https://www.rti.com/) which HQ is in Sunnyvale (USA). Also, I am the lead organizer at [Google Developer Group Granada](http://gdggranada.com/).

Looking forward to learn a lot!!

Nice to meet you!
Security Sprint: Week 5: Network capture probe
Tags: raspberrypi, security, network
Published: 2017-12-17 21:38:00

---
title: "Security Sprint: Week 5: Network capture probe "
published: true
description: Building a network capture probe with a RPI 
tags: raspberrypi, security, network
---

Recently something amazing was added in my university's library: You can ask not only for for books but also for electronic programming bundles such as raspberry or arduino kits. I decided to take a raspberry pi kit in order to make an experiment: A **network capture probe**.

![](https://thepracticaldev.s3.amazonaws.com/i/go7r450eu0ysx2uy09mr.jpg)

A network capture probe is a tool for network system monitoring that allows you to capture traffic in real-time. I learned about this technique not long ago when I met a guy who was wearing one of those in his bag everywhere using his raspberry pi, neat, eh?. Now I want to try the same...

I downloaded the latest version of [raspbian](https://downloads.raspberrypi.org/raspbian_latest) , burnt a 8GB MicroSD, installed [Etcher](https://etcher.io/), installed the raspbian ISO in the card using Etcher, and connecting the RPI to a screen using hdmi. I also attached a keyboard and a mouse. I had a RPI screen too, so I also did some magic to adjust to it later, as well as the wifi pin, but important things first. I must say I tried to download bro tool first, but I didn't have enough space to compile it in my 8GB card... _ups_.

Once I installed **Raspbian** I opened the terminal and installed tcpdump using `apt-get install tcpdump`, take care of the `sudo`, too. Why? I wrote an easy script to capture stuff using tcpdump. Here it is:

```
#!/bin/bash

eval namedir=$1
eval net=$2
count=0
number=5

mkdir $namedir
cd $namedir

while [ $count -lt 1000 ]
do

    tcpdump -A -w $count_.pcap -c $number -i $2
    echo "just captured $number packets" 

done

```
![](https://thepracticaldev.s3.amazonaws.com/i/r7ad5rfjzgafiv3c3zmg.jpg)

It's a simple example, with many details to polish. In this case, the first parameter is the name of the directory, second is the name of the wifi card. An option is `any` for any card. Anyway these are examples of the input:

```
# ./script.sh trial wlan0
# ./script.sh trial eth1
# ./script.sh trial any

```

An output inside the directory we created would be `0_.pcap 1_.pcap 2_.pcap` and so it goes. Each pcap will contain the ASCII (`-A`) information of five (`number=5`) packets. To read them, there's the `-r` tcpdump command. Another idea to make it prettier would be using `-D` command, which show the list of available interfaces, save it in a file and use the file in a `for` loop to save information. But I haven't tried it yet. Anyway is a fun toy to play with an a nice tool to practise Network System Monitoring in random networks. Be careful tho ;)
My introduction
Tags: introduction
Published: 2017-12-17 21:26:37

---
title: My introduction
published: true
description: 
tags: #introduction
---


I started coding when I was 18 years old

I live near Paris.

I work for [Mirakl](https://www.mirakl.fr) in France.

I mostly program in these languages: Java, JavaScript, Kotlin, Go

Sharing is my philosophy

I am currently learning more about Reactive System, Rx, functionnal programming, concurrency over parallelism, Vert.X

You can find me on GitHub as [endouakulu](https://github.com/endouakulu)

Nice to meet you.
Nice article!
Tags: jenkins, blueocean
Published: 2019-10-08 17:43:14

---
title: Nice article!
published: true
date: 2017-12-17 21:02:42 UTC
tags: jenkins,blue-ocean
canonical_url: 
---

Nice article!

I think that the worst part of Jenkins pipelines is the visualization… It would be amazing to visualize a graph with the dependencies and the progress of the job. Specially when you are using nested tasks and parallel jobs.

Blue Ocean is not good enough for this.

What do you think?
Getting started with Azure Table Storage
Tags: softwaredevelopment, azure, database, development
Published: 2020-01-25 20:59:08

---
title: Getting started with Azure Table Storage
published: true
date: 2017-12-17 19:58:06 UTC
tags: Software Development,Azure,database,development
canonical_url: https://www.funkysi1701.com/2017/12/17/azure-table-storage/
---

Azure Table storage is cheap way to store data, however it has some drawbacks that you should be aware of.

Azure Table storage is a simple way to store NoSQL data with key/attribute pairs. I am very familiar with storing data in SQL databases and would still choose SQL over Table storage, however Table storage is significantly cheaper so could be worth investigating depending on your project.

[Troy Hunt](https://www.troyhunt.com/working-with-154-million-records-on/) makes use of Table storage for his Have I been pwned? website so there are projects out there that make use of it to great affect.

To work with Table storage you need to use a nuget package **WindowsAzure.Storage**

**Install-Package WindowsAzure.Storage**

To load data from a Table in Azure Table storage I use the following code

<style>.gist table { margin-bottom: 0; }</style>

You need to create a class (called Entity in the example above) derived from TableEntity which defines the Partitionkey and Rowkey, plus and other columns you want to store in table storage. The row key and partition key uniquely identify the data in the table, think of this as the primary key of the table if you are used to SQL. This class must also contain a parameterless constructor.

This is the only way to retrieve data, using the partitionkey and rowkey. If you want to retrieve a specific piece of data you would need to retrieve all rows and then search them for what you need. For me this is not a big problem as I only have 150 rows but if you have millions of rows you may need to think carefully how to use this.

To save data I use a very similar piece of code

<style>.gist table { margin-bottom: 0; }</style>

I create a Entity object and then pass this as a parameter into the InsertOrReplace method.

To delete data it is also very similar, you create an entity object and pass this as a parameter to the Delete method.

When debugging my table storage code I found the [Azure Storage Explorer](https://azure.microsoft.com/en-gb/features/storage-explorer/) very useful for seeing what data actually existed in the table and what might be throwing an error, usually something wrong with my Entity.

I mentioned earlier that Table Storage was cheaper than SQL Azure. Well for my simple playing about with things I have found my monthly charge of £10+ has been reduced to £1+ If I were to build anything that is more than just me learning about how it works I would probably continue to use SQL but for the cost of learning new tech it is well worth giving table storage a try.

The post [Getting started with Azure Table Storage](https://www.funkysi1701.com/2017/12/17/azure-table-storage/) appeared first on [Funky Si's Tech Talk](https://www.funkysi1701.com).
Tests TLDR Versions
Tags: tests, tldr, beginners
Published: 2017-12-17 17:39:27

---
title: Tests TLDR Versions
published: true
description: TLDR versions of Smoke tests, performance tests, and their primary children types. 
tags: [Tests, TLDR, Beginners]
---

**Smoke Tests:** These test cases are executed to check if the critical functionalities of the program are working fine.

They can be further broken down into 3 types:-
1. **Unit/Component Testing:** Checks if individual components or functions work the way as expected.
2. **Integration Testing:** Checks if the components work with each other as expected.
3. **End-to-End Testing:** A complete application test to check if the application works as expected.

____

**Performance Tests:** A performance test is any test that measures performance, stability, _scalability_ and/or _throughput_ of an application.

They can be further broken down into 5 types:-
1. **Load Testing:** Tests if the application can handle expected normal and peak load.
2. **Soak/Reliability Testing:** A soak test is a long-running load test used to determine application performance and stability over time.
3. **Stress Testing:** Checks behavior of applications above peak load conditions.
4. **Capacity Testing:** Capacity Test determines the number of users app can handle before either performance or stability becomes unacceptable.
5. **Spike Testing**: Verify system stability during bursts of concurrent users or system activity.

____
#### Authors note:
There are many different kinds of tests that I haven't included related to design, security and some I am not even aware of. I have included only the ones I think are related to development in TLDR format.
This was my first post, please leave your feedback. Also, let me know if I have made any mistakes.

#### Keywords
**Throughput:** The amount of material or items passing through a system or process.
**Scalability:** The capacity to be changed in size or scale.
Code to go: helping you find updated snippets for common use cases
Tags: javascript, beginners, snippets, modern
Published: 2017-12-17 16:21:47

---
title: "Code to go: helping you find updated snippets for common use cases"
published: true
description: Code to go aims to help developers learning JavaScript find up date, accurate and ready to use snippets of JavaScript code for common use cases.
tags: javascript, beginners, snippets, modern
---


[Code to go](https://codetogo.io) is a website that aims to help developers learning JavaScript find up to date, accurate and ready to use snippets of JavaScript for common use cases.

                                                                                                                                                          
![homepage screenshot](https://thepracticaldev.s3.amazonaws.com/i/64tpcgduu6kbm7lfa81t.png)

The motivation behind Code to go is that if you're teaching somebody JavaScript in 2017, they will most likely search on google some simple questions, such as:

**How to split a string into array of characters in JavaScript**

However, this search result will yield a [Stackoverflow question](https://stackoverflow.com/questions/6484670/how-do-i-split-a-string-into-an-array-of-characters) that was asked 7 years ago, marked as duplicate and that has an accepted answer that recommends using `split('')`.

While it may not be a big deal to use `split('')` here, the learner will immediately lose their confidence of finding the correct answer here, as the comments clearly state that they should not be using `split('')`.


I realized that there's a gap that stackoverflow isn't able to fill, which is providing short snippets of code that are ready to be used, especially by beginners.

And this is exactly what Code to go does.

![how to split a string into array of characters in JavaScript](https://thepracticaldev.s3.amazonaws.com/i/5iqy335h2jw4jhvnwp4h.png)


Answers presented on Code to go are most of the times self-sufficient. They can be understood easily and they represent generic scenarios which allows the developers to adapt those snippets to their own scenarios.


![search](https://thepracticaldev.s3.amazonaws.com/i/tdtze01sxzwti04wy4ij.png)

At the time of writing, Code to go has 50 use cases that you can browser or search for.

We are planning on adding more, however our top priority is to maintain quality rather than quantity.

You can also suggest a Use case if you couldn't find it on the website. You can simply click on the Contribute button or head over to the [github repository](https://github.com/jadjoubran/codetogo.io/issues) and create a new issue.

It's also important to mention that Code to go does not aim to replace documentation. Whenever possible, our answers link back to the official Mozilla Developer Network documentation like in this example below.
This allows the answers to be easily absorbed by beginners while also letting them dive deeper into the documentation.

![example with MDN](https://thepracticaldev.s3.amazonaws.com/i/su4b9g1b6ndqibw2kr4r.png)

I hope you this makes learning javascript even more enjoyable!
Laravel php tag not working
Tags: laravel, php, help
Published: 2017-12-17 14:17:22

---
title: Laravel php tag not working
published: true
description: php tags in laravel   
tags: laravel, php, help
---

Hi devs! I'm currently learning Laravel and I find that php tag `<?php` is not working, but the `<?=` tag works perfectly. I searched for some explanations but could not find any. I always prefer the first tag than the latter.
What are good Resources to learn about core IT Topics?
Tags: discuss, learning
Published: 2017-12-17 14:04:19

---
title: What are good Resources to learn about core IT Topics?
published: true
description: 
tags: discuss, learning
---

Recently, I've talked to some engineer friends, and some core IT topics came up. Topics like virtualization, specific protocols like [HSTS][1] or how browsers work.

During this conversation, I realized that I don't know enough about these topics, and now I want to learn. 

The thing is, getting an overview of these areas is enough for me. 10 hours of knowledge on a specific topic is too much, and I won't remember the details anyway. 

Finding such resources proves difficult, because I cannot even properly put them together in a category. 

So, there are 2 questions. Do you know what I mean? And if so, how would you categorize it? And do you know about any resources for that?

Podcasts would be ideal, so I can listen to it on my commute, but anything is welcome.

[1]:https://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security

---

Follow me on [Twitter](https://twitter.com/Domysee) for more of my thoughts, articles, projects and work.
WDS12 - HTML Lists
Tags: html, wds
Published: 2017-12-18 18:08:52

---
title: "WDS12 - HTML Lists"
published: true
tags: HTML,WDS
canonical_url: http://thecodingexpress.blogspot.com/2017/12/wds12-html-lists.html
---

In the&nbsp; last article we learned about:  

- Simple HTML Tables
- colspan to expand cell more than one column
- rowspan to expand cell more than one row
Now in this article let's study how to create lists in HTML.  
In HTML we can create two types of list:  

1. Unordered List
2. Ordered List&nbsp;
Let's see each one of them in detail.  
Unordered HTML List  
An unordered list in HTML starts with \<ul\> and ends with \</ul\> tag. Each list item starts with \<li\> tag and ends with \</li\> tag. The list items will be marked with bullets by default but we can customise it with type attribute in starting \<ul\> tag.  
The type attribute can have any one of following values:  

- type="disc" : Item marker is bullet. This is also the default.
- type="circle" : Item marker is empty circles.
- type="square" : Item marker is square.
- type="none" : Items will not be marked.

{% gist https://gist.github.com/Omkar-Ajnadkar/d71936e1b1e80365d534c454007637f2 %}
   
Ordered HTML List  
An ordered list in HTML starts with \<ol\> and ends with \</ol\> tag. Each list item starts with \<li\> tag and ends with \</li\> tag. The list items will be marked with integers by default but we can customise it with type attribute in starting \<ul\> tag.  
The type attribute can have any one of following values:  

- type="1" : Items will be be numbered with numbers starting from 1. This is default.
- type="A" : Items will be be numbered with uppercase letters.
- type="a" : Items will be be numbered with lowercse letters.
- type="I" : Items will be be numbered with uppercse roman numbers.&nbsp;
- type="i" : Items will be marked with lowercase roman numbers.

{% gist https://gist.github.com/Omkar-Ajnadkar/03717661ee29ef75d294ec612b8bc788 %}
  
Description Lists in HTML  
We can also create description list in HTML. Description list contains term followed by its description. The \<dl\> tag defines the description list. Inside of it, \<dt\> tag is used to define term of list and \<dd\> tag used for description of that term.  

{% gist https://gist.github.com/Omkar-Ajnadkar/f642676cf938de16eeff21481ecca7e9 %}
   
Nested HTML Lists  
Like any other HTML elements we can nest one HTML list inside other list. 

{% gist https://gist.github.com/Omkar-Ajnadkar/006c029c0bf3cb027e22dab537e51af8 %} 
   
  
 That's all for today. In the next part, we will learn about some more HTML tags important for good structure of document. Comment on how you think this article is, what improvements should I do and for any doubts. Share with your friends and _ **keep coding** _.
Career: Frontend vs Backend 
Tags: backend, frontend, career
Published: 2017-12-17 11:30:44

---
title: "Career: Frontend vs Backend "
published: true
description: what to choose between backend and frontend development
tags: backend, frontend, career
---

I am coming from a web development background with a mix of frontend (not an advanced one, mostly writing markup+css+custom js) and backend development (lamp stack, CMS[Drupal, Wordpress, Joomla]). Now i am doing Java EE development, working with web services (SOAP, REST) and some other stuff like DevOps.

I receive, as most developers, a lot of job offers, interviews, etc...but they differ as sometimes they see my profile and offer me a frontend position and other times they ask me to come as a backend dev (i assume by seeing my current position).

I just don't get my head around this issue of deciding between the two sides: i have some personal inclination towards the frontend but i am finding interesting backend too and cannot choose between the two.

What is your view on this issue? Seeing the market, the future of the current technologies and by your personal experience how would you manage to decide on this issue?

How have you decided your career, your job? Did the job chose you or made a rational decision about it?
functions.js
Tags: javascript, npm, showdev, opensource
Published: 2017-12-17 08:27:11

---
title: functions.js
published: true
description: A hub of various numerous functions
tags: javascript, npm, showdev, opensource
cover_image: https://thepracticaldev.s3.amazonaws.com/i/x1ga7v3tftkv30f5llgc.png
---

> **functions.js** is a hub of various functions or methods which act differently according to their functionality.

The project was originally named as <a href="https://www.npmjs.com/package/okay-string">**okay-string**</a> which had only string validation methods. To go further with the learning process, i thought of renaming it to <strong><em>functions.js</em></strong> & create, practice more functions and make a contribution to the open source community. 

<img src="https://thepracticaldev.s3.amazonaws.com/i/dwndmi7521fz56x395mo.png">

The project is work in progress i.e more and more functions are needed to implemented in order to excel in JavaScript programming. The project is open for **contributions** via pull requests. 

The project is open-sourced on <a href="https://github.com/theIYD/functions.js">**Github**</a> and available on <a href="https://www.npmjs.com/package/functions.js">**npm**</a> for download.

I hope you love this project & this small quick read. 

**happy coding ! ❤️**