teleren/devto huggingface dataset:
Write excel from code
Tags: python
Published: 2019-07-18 12:11:36

---
title: Write excel from code
published: true
description: python 
tags: python
---
You can write Excel files with Python. Excel is a very popular file format outside of the development community. Finance and many other fields heavily use Excel. 

<img src="https://proxy.duckduckgo.com/iu/?u=https%3A%2F%2Fmedia.tenor.com%2Fimages%2Feb36c010b6c42265389749355ae2e620%2Ftenor.gif&f=1">

The module xlsxwriter lets you do that, first install that module.
Then load the module in Python.

    #!/usr/bin/python3
    #coding: utf-8
    import xlsxwriter

Create a file and a sheet to work in

    file_name = "data.xlsx"
    workbook = xlsxwriter.Workbook(file_name)
    worksheet = workbook.add_worksheet('sheet1')

Write the header to the excel sheet

    worksheet.write(0, 0, 'id')
    worksheet.write(0,1, 'name')
    worksheet.write(0,2, 'class')
    worksheet.write(0,3, 'data')

And finally write the data

    worksheet.write_row(1, 0, [1, 2, 3])
    worksheet.write_column('D2', ['a', 'b', 'c'])
     
    workbook.close()

<img src="https://proxy.duckduckgo.com/iu/?u=https%3A%2F%2Ftse2.mm.bing.net%2Fth%3Fid%3DOIP.vsJ2gM02_8oW-TGRzNOkYAHaEg%26pid%3DApi&f=1">


Put it all together to write the excel file. It gives you this code:

    #!/usr/bin/python3
    #coding: utf-8
    import xlsxwriter
     
    file_name = "data.xlsx"
    workbook = xlsxwriter.Workbook(file_name)
    worksheet = workbook.add_worksheet('sheet1')
     
    worksheet.write(0, 0, 'id')
    worksheet.write(0,1, 'name')
    worksheet.write(0,2, 'class')
    worksheet.write(0,3, 'data')
    
    worksheet.write_row(1, 0, [1, 2, 3])
    worksheet.write_column('D2', ['a', 'b', 'c'])
     
    workbook.close()

Related links:
* <a href="https://pandas.pydata.org/">The Pandas Module</a>
* <a href="https://xlsxwriter.readthedocs.io/">XLSX Writer</a>
* <a href="https://pythonbasics.org/">Learn Python</a>
* <a href="https://pythonbasics.org/exercises/">Python Exercises</a>
Things You Need To Know About Cyber Security Incident Response Team Today
Tags: cybersecurity, cyberattacks, manufacturing, financial
Published: 2019-07-18 12:03:37

That cybersecurity is the most critical component for an organization is beyond debate. This goes without saying because attacks to any organization’s computer systems can happen at simply any time, at any location, and at any time of the day. This calls for them to be completely alert on a 24X7X365 basis.

A Cyber Security Incident Response Team (CSIRT) is indispensable for any organization, private or government, to ensure that valuable data is not breached. A system that is ready for cyberattacks 24X7 should consist primarily of a mechanism for both reporting incidents and disseminating incident-related information correctly.

A valuable webinar from Compliance4All, a leading provider of professional training for all the areas of regulatory compliance, will show how to set up a foolproof and robust CSIRT that will help avert a cyberattack.

At this webinar, which is being organized on July 23 and is of sixty minutes’ duration, Michael Redmond, Consultant, Speaker and Author, will be the speaker.

Please register for this webinar by visiting https://t2m.io/mM9OLXdq

————————————————————————————————————

Most companies do set up a CSIRT, but one major issue with most of them is that the teams are not adequately trained to handle and test all aspects of the security issues. Both testing and training are necessary to create awareness among the teams, which will help them to respond to an attack or a potential one better. Both reporting incidents and disseminating incident-related information correctly is a must.

Personnel connected with cybersecurity, such as CISO, CSIO, CEO, Risk Managers and Auditors will gain enormous learning from this session, which will cover the following areas:

    How often to test
    Types of testing
    Who should be involved
    Scenario Development
    Organizational process

About the speaker: 
Michael is the Chapter President for Association of Contingency Planners Eastern Great Lake Chapter and an active member of ISSA. She has consulted in the area of Cyber Security for clients in the arenas of Healthcare, Insurance, Financial and Manufacturing. She has been selected to speak on Cyber Security Incident Response and SIEM at various conferences.
Image Collage Widget
Tags: imagecollage, fultter, widget
Published: 2019-07-18 11:53:05

A flutter package for creating photo collages in your applications.

![center_big_fr](https://raw.githubusercontent.com/Mindinventory/image-collage-widget/master/media/center_big_fr.png)
![left_big_rf](https://raw.githubusercontent.com/Mindinventory/image-collage-widget/master/media/left_big_rf.png)
![v_split_rf](https://raw.githubusercontent.com/Mindinventory/image-collage-widget/master/media/v_split_rf.png)

Key Features

1. Create 11 different type of collages.
2. Start with or without images from gallery preloaded (Only for Android).
3. Allow user to add or remove photo into collage.
4. User can update images from gallery/camera.
5. Don't worry about permissions, we handled it.

Want to know Usage? And how we made it? Just head to Here: *[Widget to create collages](https://github.com/Mindinventory/image-collage-widget)*
Hyperstack Web Framework
Tags: webdev, ruby, webpack, react
Published: 2019-07-18 11:42:42

Think JavaScript is your only option for the front-end? 
Think again.
![Hyperstack](https://avatars2.githubusercontent.com/u/34562730?s=400&v=4)
 
[Hyperstack](https://www.hyperstack.org) is a Ruby DSL, compiled by Opal, bundled by Webpack, powered by React.
![React Hyperstack Ruby OSL Webpack](https://hyperstack.org/images/logos-gray.png)

Hyperstack Features
![Hyperstack](https://i.imgur.com/vlkw2c9.png)

Check out [Hyperstack](https://github.com/hyperstack-org/hyperstack/tree/edge/docs)
Python Pandas, data processing
Tags: python, pandas, data
Published: 2019-07-18 11:23:46

---
title: Python Pandas, data processing
published: true
description: python, pandas
tags: python, pandas, data
cover_image: https://proxy.duckduckgo.com/iu/?u=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FaUhEBE0T8XNHa%2Fgiphy.gif&f=1
---
The <a href="https://pandas.pydata.org/">pandas module</a> lets you parse data. For instance, you can have excel data that you want to read.

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

You can load an excel file with the method read_excel(filename), where filename may include a path. It can read both xls and xlsx.

That data is stored in a data frame. The data frame is a data structure in pandas, which you can edit or <a href="https://pythonbasics.org/seaborn_pandas/">plot</a>.

    #!/usr/bin/python3
    # coding: utf-8
    import  pandas  as pd

    df = pd.read_excel('example.xls')
    data1 = df.head(7)
    data2 = df.values
    print("A \n{0}".format(data1))
    print("B \n{0}".format(data2))

What we are doing here is very simple. I'll describe the steps.

<img src="https://proxy.duckduckgo.com/iu/?u=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FdPbpVcfgGldBu%2Fgiphy.gif&f=1">

Load the excel data. This file has to be in the same directory, else a path must be specified.

    df = pd.read_excel('example.xls')

Store data from the data frame into variables

    data1 = df.head(7)
    data2 = df.values

Output those variables. Because it's not a single value we format it.

    print("A \n{0}".format(data1))
    print("B \n{0}".format(data2))


Run it in a terminal (or IDE if you prefer)

    python3 example.py  

Outputs the data from the excel:

    A 
           id    name  class       date  stature
    0  201901   Aaron      1 2019-01-01        1
    1  201902  Arthur      1 2019-01-02        1
    2  201903   Angus      1 2019-01-03        1
    3  201904  Albert      2 2019-01-04        2
    4  201905  Adrian      2 2019-01-05        2
    5  201906    Adam      3 2019-01-06        1
    6  201907  Andres      3 2019-01-07        1
    B 
    [[201901 'Aaron' 1 Timestamp('2019-01-01 00:00:00') 1]
     [201902 'Arthur' 1 Timestamp('2019-01-02 00:00:00') 1]
     [201903 'Angus' 1 Timestamp('2019-01-03 00:00:00') 1]
     [201904 'Albert' 2 Timestamp('2019-01-04 00:00:00') 2]
     [201905 'Adrian' 2 Timestamp('2019-01-05 00:00:00') 2]
     [201906 'Adam' 3 Timestamp('2019-01-06 00:00:00') 1]
     [201907 'Andres' 3 Timestamp('2019-01-07 00:00:00') 1]
     [201908 'Alex' 3 Timestamp('2019-01-08 00:00:00') 1]]

Related links:
* <a href="https://pandas.pydata.org/">The Pandas Module</a>
* <a href="https://pythonbasics.org/">Learn Python</a>
* <a href="https://pythonbasics.org/exercises/">Python Exercises</a>
Overview
Tags: rust, rav1e, av1
Published: 2019-07-18 04:44:04

---
title: Overview
published: true
description: Overview of Rate-Distortion Optimization in rav1e
tags: rust, rav1e, AV1
series: An Insight into RDO in rav1e
---
{% github xiph/rav1e %}
If you want to know what rav1e is, this is a good place to start.
{% link luzero/using-rav1e-from-your-own-code-2ie0 %}

## What is?
* Rate: Rate of bitstream output of the encoder.
* Distortion: Deviation from the original image.
* RD cost: Rate distortion cost is the trade-off cost between bitrate and quality loss. (We want to optimize this trade-off)
* Lambda: Lagrangian multiplier used to optimize the RD cost.
* tx: [Transform](https://en.wikipedia.org/wiki/Transform_theory)
* CDEF: [Constrained Directional Enhancement Filter](https://people.xiph.org/~xiphmont/demo/av1/demo2.shtml)
* LRF: Loop Restoration Filter

## Why Rate-Distortion Optimization?
rav1e makes use of these RDO techniques to reach the saddle point in the trade-off between compression and quality.

***

# Mechanism
A full exhaustive search for best RD-cost among all the tools and combinations is infeasible since the cost grows exponentially with every dimension that a tool adds to the search.
Many tools are pruned based on the speed settings and some tools like motion search are approximate by default.
But at the slowest speed setting, there is a search among nearly all available tools in rav1e.

***

## How to calculate RD cost?
During the encoding process, we measure RD cost using distortion.
```
cost = distortion + lambda * rate
```
During the post-processing filter stage, we measure RD cost using error.
```
cost = error + lambda * rate
```

***

## What are we optimizing for lowest RD-cost?

`rdo_mode_decision`: 
* Inter modes
* Inter Compound modes
* Tx type
* Tx size
* Intra modes

`luma_chroma_mode_rdo`:
* Chroma mode RDO for predicted luma

`rdo_partition_decision`:
* Partition decision

`rdo_loop_decision`:
* CDEF + LRF combination

***
## Overview of a tile encode 
### Description
Each tile is encoded independent of the other tiles. We can observe RD Optimization abundantly in the encoding process. Even the post-processing filters are chosen with RD costs taken into consideration.
### Steps
```
1. Build coarse motion vectors of the tile for INTER blocks only.
2. For each superblock in tile:
    1. Motion estimation: Using either Diamond search or Full search on subsampled blocks.
    2. encode_partition_bottomup / encode_partition_topdown. 
    3. rdo_loop_decision.
3. CDEF and LRF.
```
![Illustration](https://thepracticaldev.s3.amazonaws.com/i/8txjqdsm4e2pdufq3hqh.png)
<figcaption>An overview of how a tile is encoded in rav1e</figcaption>
***
### Coming up next...
* RDO for modes
* RDO during partitioning

***
OculusQuest / OculusGo / Androidのリモート接続をスクリプトで自動化する
Tags: android, oculusgo, oculusquest
Published: 2019-07-18 10:25:00

---
title: OculusQuest / OculusGo / Androidのリモート接続をスクリプトで自動化する
published: true
tags: Android, OculusGo, OculusQuest
date: 20190718T10:25Z
canonical_url: https://qiita.com/shiena/items/7c51d7059b76264e56d7
---
# はじめに

Androidは `adb tcpip [port]` と`adb connect [ipaddr:port]` でリモート接続できます。
ですが何度も実行するのは面倒なのでスクリプトで自動化しました。

# 使い方

https://gist.github.com/shiena/e0bfbd465fefae424e42b909f24e5434

1. ここからOSに合わせたファイルを以下のように保存します。
    * Windowsは`adb-connect.bat`を改行コードCRLFで保存
    * macOSとLinuxは`adb-connect.command`を改行コードLFで保存して`chmod +x adb-connect.command`で実行権限を付ける
1. 変数 `ADB` をadbコマンドのフルパスに書き換えます。

あとはそのまま実行するだけです。2台以上のAndroidがUSB接続されているとそれぞれリモート接続するか選択できます。

![image.png](https://dev-to-uploads.s3.amazonaws.com/i/6mdaw6p165ov1vewwwm6.png)

# 所感

Windowsのバッチファイルでも意外と文字列処理できるもんですね。
Top 3 GraphQL code generators
Tags: graphql, webdev, javascript, typescript
Published: 2019-07-18 09:38:08

---
title: Top 3 GraphQL code generators
published: true
description: Development velocity is the main reason why companies are adopting GraphQL and code generators make GraphQL event faster. 
tags: graphql,webdev,javascript,typescript
cover_image: https://thepracticaldev.s3.amazonaws.com/i/cj6w6azx6p6r911m6cfl.png
---

There has been a lot of buzz in the web development world around GraphQL lately and for good reason!

[GraphQL](https://graphql.org/) is a new query language for APIs and a server-side runtime for executing queries by using a **type system** you define for the data, so basically a syntax that describes how to ask for data and load it from a server to a client. 

## Why all the buzz?

The answer is simple:
> It's all about **the development speed**.

The main reason why companies started using GraphQL is that it promises to speed up your API development, what's more, it manages to deliver! 

In of the [surveys](https://medium.com/novvum/introducing-the-graphql-survey-series-insight-from-successful-graphql-adopters-3a83ff0a7e39?) directed to CTOs and lead developers of a variety of teams ranging from 1 to 100+ engineers (among which we can find tech giants like Uber or Paypal) about their perception of GraphQL implementation in their teams almost all companies felt GraphQL delivered on their expectations.

Let me introduce you three useful GrapphQL code generators to speed your development:


### 1. GraphQL Zeus

> *[Zeus](https://github.com/graphql-editor/graphql-zeus), son of Kronos, father of [Apollo](https://www.apollographql.com/).*

A simple tool working in [Node.js](https://nodejs.org/en/) & browser to generate an auto-complete client library for Javascript or Typescript. The unique thing about GraphQL Zeus is that it creates its own specification along with type-safe completion of request & responses.

[![graphql-zeus in action](https://thepracticaldev.s3.amazonaws.com/i/llmzhwdu11j4qu6esw4d.gif)](https://github.com/graphql-editor/graphql-zeus)

Repo:
{% github graphql-editor/graphql-zeus %}


### 2. Prisma GraphQLGen

The tool from Prisma team provides a type-safe environment which helps maintain confidence about your code. As creators mention the motivation behind it was to
> *"(...) leverage the strongly typed GraphQL schema with the goal of making your backend type-safe while reducing the need to write boilerplate through code generation".*

The `graphqlgen` generates & scaffolds type-safe resolvers based on your GraphQL Schema in TypeScript & Flow.

Repo:
{% github prisma/graphqlgen %}

 

### 3. GraphQL Code Generator

[GraphQL Code Generator](https://graphql-code-generator.com/) is a tool that generates code out of your GraphQL schema, supporting custom plugins & templates, so regardless of the language that you're using (*i.e. TypeScript, React, Angular*) GraphQL Code Generator will be a huge help.

Repo:
{% github dotansimha/graphql-code-generator %}


###### Cover image powered by [unDraw](https://undraw.co/)
How to convert JDeveloper created BPEL process to WSO2 BPEL Process
Tags: bpel, wso2, jdeveloper, oracle
Published: 2019-07-18 09:33:24

---
title: How to convert JDeveloper created BPEL process to WSO2 BPEL Process
published: true
description: I have an old set of BPEL processes which were created using JDeveloper. I want to import it to WSO2 integration studio and make a WSO2-server-deployable archive. How can I do this?
tags: BPEL, WSO2, JDeveloper, Oracle
---
How to implement URL Routing in Vanilla JavaScript
Tags: javascript, productivity
Published: 2019-07-18 08:46:13

In this post, I'll show you how to implement dynamic URL routing in vanilla JavaScript without using any heavy frameworks like angular, vue, react, ember, etc. in less than 30 lines of code!

The important attributes you need to know are `window.location` and more specifically to our purpose, `window.location.hash`. This built-in property basically tells us what page URL or route we are presently in (ex: `index.html#something`). This property is blank if there is no hash URL and you are on the main URL (ex: `index.html` or `index.html#`). In that case, you may assume a default hash such as `_index` to maintain consistency:

```javascript
function displayHash() {
  var theHash = window.location.hash;
  if (theHash.length == 0) { theHash = "_index"; }
  var elems = document.querySelectorAll("#caption");
  elems[0].innerText = "Current Hash: " + theHash;
  return true;
}
```

This simple function displays the current hash in a heading element named `#caption`. If you want this to fire each time the hash changes (user navigated to a different page in your app), you can do that using the `hashchange` window event:

```javascript
window.addEventListener("hashchange", function() {
  console.log("hashchange event");
  displayHash();
});
```
	
And finally, in order to display the heading initially when the user first loads the URL in their browser, you can call `displayHash()` in the `DOMContentLoaded` event call too:

```javascript
window.addEventListener("DOMContentLoaded", function(ev) {
  console.log("DOMContentLoaded event");
  displayHash();
});
```

That's all folks! URL Routing is so easy to implement without using any heavy and bloated frameworks at all. The demo for this example can be found at [prahladyeri.github.io/learn-js/url-routing](https://prahladyeri.github.io/learn-js/url-routing). You can see that as you click the individual hyper-links, the heading label changes to display the current hash.

The complete source code for this can be found at my github repo, [prahladyeri/learnjs](https://github.com/prahladyeri/learn-js/blob/master/url-routing/index.html) (its less than 30 lines ;-).

I came across this solution through this [StackOverflow post by Tulio Faria](https://stackoverflow.com/a/41426078/849365) which uses jquery but I adapted it for vanilla JavaScript.
What Is Customer Relationship Management?
Tags: crm, crmsoftware
Published: 2019-07-18 08:42:25

Customer relationship management (CRM) is a term that refers to practices, strategies, and technologies that companies use to manage and analyze customer interactions and data throughout the customer lifecycle, with the goal of improving customer service relationships and assisting in customer retention and driving sales growth.

Customer Relationship Management

 (CRM) is an umbrella term for all the structures your company uses to guide interactions and relationships with customers.

It includes not only guidelines for how direct interactions take place, but also systems for organizing and tracking all the relevant information — meetings, proposals, sales conversions, and more.

A CRM system pulls together lots of data to show your business how well (or poorly) the relationships with customers are being handled, and how that’s affecting business.

So in simplest terms, think of your crm software india as a unique system for managing client relationships.

Why CRM is necessary

Many businesses don’t have an organized system for managing their relationships with customers. And that’s a big problem. Executives are used to managing their employees. But often, they leave it up to salespeople to manage their relationships with customers however they want — whether those customers are individuals (in B2C) or other businesses (in B2B). This means that multiple people at the same company may have wildly different ways of operating. This lack of direction often leads to failure. It’s a big reason that nearly half of salespeople miss their annual quotas.

Adopting a CRM solution changes that.



And why I say that variablesoft CRM jaipur can be the best solution?

first  our crm software is free  to use.

Simplicity and clarity make it easy to learn and deploy.

Customizable elements allows you to change it until it is ideal for your company profile.

Source :- https://bit.ly/2u8egw4
React tldr; Redux Now Has Hooks
Published: 2019-07-18 08:36:21

- useSelector: Pass in a function that takes the state as an argument and returns a value. Used to get a single value from state. Can act as a replacement for mapStateToProps.
- useDispatch: returns a reference to the dispatch object. It can act as a replacement for mapDispatchToProps.
- useStore: returns an instance of the store. Generally not recommended.

Source: https://glennstovall.com/react-hooks-before-and-after/?utm_source=reactdigest&utm_medium=web&utm_campaign=featured
Imaginary Language Features
Tags: languages, discuss, fun, watercooler
Published: 2019-07-18 08:18:49

This really interesting proposal for an `any` case in a `switch` statement (with subtle differences from `default`) by Meghan...

{% link nektro/language-proposal-the-any-switch-case-5a5h %}

...got me thinking: what imaginary language features would be cool to program with? In response to Meghan's proposal I thought of a `template case`:

{% devcomment d5o7 %}

What are some neat ideas you've had for language features?
Weekly Coding Challenge - Week #19 - Testimonials
Tags: challenge, html, css
Published: 2019-07-18 06:24:27

---
title: Weekly Coding Challenge - Week #19 - Testimonials
published: true
description: Week #19 of the Weekly Coding Challenge program - Testimonials
tags: challenge, html, css
canonical_url: https://www.florin-pop.com/blog/2019/07/testimonial-card/
cover_image: https://www.florin-pop.com/static/c9d20ce22a6d2d2d13f6b7567abf2a0e/ff993/testimonial-card.png
series: Weekly Coding Challenge
---

Theme of the week: **Testimonials**

### Description

If you are looking to find new clients it's important to gather reviews / testimonials from old clients you've worked for to show them to your new clients. When you gather a few, you can easily put them on your website in a testimonials section.

## Useful Resources

Check out my submission for this challenge: [Testimonial Card](https://www.florin-pop.com/blog/2019/07/testimonial-card/).

See all the submissions in this [Codepen Collection](https://codepen.io/collection/DorGVE/).

Are you interested in joining the challenge? :smiley: Read [The Complete Guide](https://www.florin-pop.com/blog/2019/03/weekly-coding-challenge/) to find out how. Don't forget to share your creation! :wink:

Happy Coding! :innocent:
Fixing the major error while installing Office
Tags: officecomsetup, officesetup
Published: 2019-07-18 06:12:16

If you are confused about the errors and messages popping up on your display while installing Office, you might have some problem with things required to setup Office.

Even sometimes we have noticed that customers are logging into the wrong website, sometimes the product key is not correct and sometimes the error is due to weak internet connection.
Errors can even occur if the Office, you are trying to install on the devices, The device is not support or the Operating system of that device is not compatible with the Office. Though there is always a Fix to these problems but we need to look for the problem carefully. Some errors like Network Error or some system error can only be fixed by a professional or someone who can run a deep scan or knows the error.
We can also help you fix the errors, there is no need to install any additional software expect the Microsoft’s own softwares like visual studio and visual basics or the addons by Microsoft to Fix the error.
<a href="http://norton-com-setups.com/">www.norton.com/setup</a>||<a href="https://brotherprinters-support.com/">brother printer customer service</a>||<a href="http://aol-mail-signin.com/">AOL Mail Login</a>