id
int64
5
1.93M
title
stringlengths
0
128
description
stringlengths
0
25.5k
collection_id
int64
0
28.1k
published_timestamp
timestamp[s]
canonical_url
stringlengths
14
581
tag_list
stringlengths
0
120
body_markdown
stringlengths
0
716k
user_username
stringlengths
2
30
401,680
Another stupid idea - another mini tool
UI Component Playground
0
2020-07-17T09:52:49
https://dev.to/barelyhuman/another-stupid-idea-another-mini-tool-5fh3
showdev, javascript, webdev, react
--- title: Another stupid idea - another mini tool published: true description: UI Component Playground tags: #showdev, #javascript, #webdev, #react --- People who've been reading for a while already know what I build and when I build them and they also already know where this post is headed. (For them: the link is at the end people) Anyway, I have been looking for a simpler react playground for a while now. "Codesandbox?" - nah that's just too much feature set. "Setup a personal storybook?" - nope. "Dude! Just import react scripts in codepen and go with it!" - That's something I did for a while now, but then I got lazier and also upset by the fact that no one thought of building something minimal. Guess what.. I did. I went so minimal I didn't even spend time thinking for a name, I was watching a youtube video, the guys says "hen" and I was like , "Yeah, that's going to be the name!" Now, I wanted to get as excited as a teleshopping host but I don't have that much energy at the moment. ### Short Description It renders your react components in real time so you can use it for designing components or try out that new css experiment you just read about on CSS Tricks. [Hen](https://hen.reaper.im) I'm out. Updates: - Fixed the loss of focus on input state changes and smoother renders
barelyhuman
401,855
Hacky Friday Stuff #17.07.2020
Links about web development, product engineering, tools and services from all over the internet. Don...
0
2020-07-17T12:50:02
https://dev.to/sunnymagadan/hacky-friday-stuff-17-07-2020-4mkp
ruby, rails, javascript, hackyfriday
*Links about web development, product engineering, tools and services from all over the internet.* [Don’t (guess)timate your projects, forecast with confidence](https://www.reaktor.com/blog/forecasting-method/) How many projects have you worked on where a major frustration was coming up with a prediction for how long it would actually take to build a feature? You can actually get much more accurate forecasts using some fairly simple statistics over the historical data of your team. This blog post explains the basics of how you can achieve just that. [System of a test: Proper browser testing in Ruby on Rails](https://evilmartians.com/chronicles/system-of-a-test-setting-up-end-to-end-rails-testing) > Discover the collection of best practices for end-to-end browser testing of Ruby on Rails applications and adopt them in your projects. See how to ditch Java-based Selenium in favor of leaner, meaner Ferrum-Cuprite combo that uses Chrome DevTools Protocol directly through pure Ruby. And if you use Docker for development—we’ve got you covered too! [Running spot instances effectively with Amazon EKS](https://m.signalvnoise.com/running-spot-instances-effectively-with-amazon-eks/) Spot instances can be a great tool for reducing infrastructure costs while getting the computing resources you need, but they come with additional challenges that you must remain aware of. In this article, Basecamp shares its approach on how to utilize this power effectively and spend the optimal amount of resources. ### Articles, tutorials [What is React Fast Refresh?](https://medium.com/javascript-in-plain-english/what-is-react-fast-refresh-f3d1e8401333) React Fast Refresh is a replacement for React Hot Loader. Fast refresh makes your React app reloads slick and painless on code changes, providing a great developer experience. [Introducing Tailwind CSS Typography](https://blog.tailwindcss.com/tailwindcss-typography) Until now, trying to style an article, document, or blog post with Tailwind has been a tedious task that required a keen eye for typography and a lot of complex custom CSS. [Painless Rails upgrades](https://blog.arkency.com/painless-rails-upgrades/) An approach of Arkency for dealing with one of the most common problems in legacy Rails applications. How to keep the framework up to date? [Build The World’s Simplest ETL (Extract, Transform, Load) Pipeline in Ruby With Kiba](https://towardsdatascience.com/build-the-worlds-simplest-etl-extract-transform-load-pipeline-in-ruby-with-kiba-e7093a29d35) How often do you iterate through all the records in a database table, modify each, and re-save? This pattern is called ETL (extract, transform, load). You could see it in web apps, analytics platforms, and machine learning pipelines. You can always roll your own, but a number of packages exist to make writing ETL’s clean, modular and testable. This article walks through an example in Ruby using Kiba. [First Class Experimentation in Ruby with Scientist](https://buildingvts.com/first-class-experimentation-in-ruby-with-scientist-8ff1a3474ebc) A Ruby library for carefully refactoring critical paths. It enables experimentation and comparison even on a production server that could help you to choose a better solution to the problem, but without making harm to the users. [Why validation matchers are the only Shoulda matchers I use](https://www.codewithjason.com/validation-matchers-shoulda-matchers-use/) Jason Swett explains why he is using only validation matchers from a popular gem [Shoulda matchers](https://github.com/thoughtbot/shoulda-matchers#matchers) that gives some handy helpers for testing common Rails functionality. ### Gems, libraries, services [Motion](https://github.com/unabridged/motion) Motion allows you to build reactive, real-time frontend UI components in your Rails application using pure Ruby. ### Podcasts [Ruby Rogues | RR 463: Can We Fix What We Can’t See? with James Thompson](https://devchat.tv/ruby-rogues/rr-463-can-we-fix-what-we-cant-see-with-james-thompson/) In this episode of Ruby Rogues, James Thompson, a Software Architect at Mavenlink, delves into how to address errors in a service-based system and how to prioritize what errors to fix. He goes into how to recognize the errors when they are creeping in and so much more. [The Stack Overflow Podcast | EP250: How we hire developers at Stack](https://stackoverflow.blog/2020/07/07/podcast-250-how-we-hire-developers-at-stack/) Hard lessons learned from flunking your first few code screenings. ### Videos [The Rule of Least Power](https://www.youtube.com/watch?v=Ba0fnSkT37E&feature=youtu.be) Sam Selikoff explains how to get more flexibility in your programs by applying The Rule of Least Power. [Philly.rb talk on hanami-view 2.0](https://timriley.info/writing/2020/07/14/philly-rb-talk-on-hanami-view-2-0/) Tim Riley's talk about dry-view in the context of current plans for hanami-view 2.0. [Drifting Ruby | #249 Soft Delete with Discard](https://www.driftingruby.com/episodes/soft-delete-with-discard) Soft deletes for ActiveRecord done right. Photo by [Martin Shreder](https://unsplash.com/@martinshreder) on [Unsplash](https://unsplash.com/@martinshreder).
sunnymagadan
403,468
JavaScript Best Practices — Semicolons, Spacing, and Sorting
JavaScript is a very forgiving language. It’s easy to write code that runs but has mistakes in it. I...
0
2020-07-18T21:07:46
https://thewebdev.info/2020/07/18/javascript-best-practices%e2%80%8a-%e2%80%8asemicolons-spacing-and-sorting/?utm_source=rss&utm_medium=rss&utm_campaign=javascript-best-practices%25e2%2580%258a-%25e2%2580%258asemicolons-spacing-and-sorting
javascript, codenewbie, codequality, webdev
--- title: JavaScript Best Practices — Semicolons, Spacing, and Sorting published: true date: 2020-07-18 20:06:11 UTC tags: javascript,codenewbie,codequality,webdev canonical_url: https://thewebdev.info/2020/07/18/javascript-best-practices%e2%80%8a-%e2%80%8asemicolons-spacing-and-sorting/?utm_source=rss&utm_medium=rss&utm_campaign=javascript-best-practices%25e2%2580%258a-%25e2%2580%258asemicolons-spacing-and-sorting --- JavaScript is a very forgiving language. It’s easy to write code that runs but has mistakes in it. In this article, we look at spacing around semicolons, statements, and functions and sorting object keys and variables. ### Spacing Before and After Semicolons We don’t need spacing before the semicolon but we do need spacing after it since we want to keep different statements apart. For instance, the following code isn’t good since it has no spaces between the statements: ``` let a = 1;let b = 2; ``` As we can see, with a space character between the `;` and the `let` keyword, it’s very hard to read the 2 `let` variable declarations. On the other hand, if we added a space after the semicolon as follows: ``` let a = 1; let b = 2; ``` Then we can see the 2 variable declarations much more clearly. Therefore, we should always add a space character after the semicolon if we have multiple statements on the same line. Having a space character after the semicolon and before the next statement is the most common place to put the space character. ### Sorting Object Keys To make finding object keys easier, we may want to sort the keys by alphabetical order in an object. For instance, we can write the following code to do that: ``` const obj = { a: 1, b: 2 } ``` In the code above, we sorted the keys of `obj` by alphabetical order. This is more of a suggestion if we want to find object keys. However, it isn’t a big deal if the keys aren’t sorted. ### Variable Sorting Like with object keys, we can also sort variable declarations by alphabetical order so that we can find them easier. Like with sorting object keys, it’s more of a suggestion than a requirement. For instance, we can sort variable declarations as follows: ``` let a, b, c; ``` ### Space Before Blocks We probably want a space before the block so that we can clearly see the function signature and the opening of the block. For instance, we can write the following code to do that: ``` const foo = () => {}; ``` In the code above, we have a space character before and after the arrow so that we can clearly see each part of our arrow function. For traditional functions, we can see the following code: ``` const foo = function() {} ``` We have one space character between the parentheses and the opening curly brace. This also makes the code clearer than without any space. Spaces make things easier to read. Likewise, we can apply similar spacing to loops as follows: ``` for (let i = 0; i < 10; i++) { console.log(i); } ``` In the code above, we have a space between the closing parentheses and the opening curly brace. Again. This lets our eyes tell between different parts of the loop. For `try...catch` , we usually have spacing like the following: ``` try {} catch (ex) {} ``` Having a little space just makes reading the code much easier. ### Space Before Function Parenthesis We usually don’t have a space character before the opening parenthesis since we have one space character after the closing parenthesis. For instance, we usually define a JavaScript function as follows: ``` const foo = function() {}; ``` As we can see, we have no space before between the `function` keyword and the opening parenthesis and one space character after the closing parenthesis and the opening curly brace. Named functions have the same spacing. For instance, we write a named function as follows: ``` function foo() {}; ``` We have one space character after the closing parenthesis and the opening curly brace. ![](https://cdn-images-1.medium.com/max/800/0*FY4t18WQKWDDr9xa)Photo by [Guillermo Ferla](https://unsplash.com/@gferla?utm_source=medium&utm_medium=referral) on [Unsplash](https://unsplash.com?utm_source=medium&utm_medium=referral) ### Spaces Inside of Parentheses We usually don’t put spaces between the parentheses and the expressions inside. For instance, we usually don’t write something like: ``` const foo = ( 5 + 6 ) * 3; ``` The code above has an extra space before the 5 and after the 6. Instead, we usually, write expressions like that without those spaces as follows: ``` const foo = (5 + 6) * 3; ``` ### Conclusion Usually, JavaScript code’s spacing follows some generally accepted conventions. We don’t have spaces between parentheses and expressions. Between the function signature and the opening curly braces, we usually have space. After a semicolon and before the next statement, we also usually have a space character to separate the 2 statements that are both in one line. The post [JavaScript Best Practices — Semicolons, Spacing, and Sorting](https://thewebdev.info/2020/07/18/javascript-best-practices%e2%80%8a-%e2%80%8asemicolons-spacing-and-sorting/) appeared first on [The Web Dev](https://thewebdev.info).
aumayeung
402,762
Shifting left on the SDLC, .NET 5 improvements, and the Slack sequel
Hi folks, Welcome back to another edition of Performance Matters. If you're a Ruby dev, you'll be h...
0
2020-07-19T21:30:52
https://dev.to/raygun/shifting-left-on-the-sdlc-net-5-improvements-and-the-slack-sequel-2jog
performancematters, performance, monitoring, dotnet
Hi folks, Welcome back to another edition of Performance Matters. If you're a Ruby dev, you'll be happy to hear that our [Ruby APM beta is now LIVE!](https://twitter.com/raygunio/status/1283554835980185600) We're always looking for more beta testers and would love to hear your valuable feedback. This week, hear from our CEO, John-Daniel Trask, about the importance of shifting left in the SDLC, further improvements to .NET 5, and the sequel to Slack's terrible, no-good, very bad day. Enjoy! Your Curator ------------------------------ #### FEATURED ARTICLES ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/3fu91s6hoxon04ldblfz.png) <strong>APM isn't just for Ops: Shifting Left and supercharging your developers</strong> Hear directly from the CEO of Raygun, John-Daniel Trask, why the monitoring industry has been discussing shifting left on the SDLC. [What this means for you](https://raygun.com/blog/shifting-left/?utm_medium=email&utm_source=performance_matters_dev_to&utm_campaign=shifting_left) ------------------------------ <strong>.NET 5 perf improvements</strong> Releasing later this year, .NET 5 is already seeing a wealth of performance improvements. [Read about them](https://devblogs.microsoft.com/dotnet/performance-improvements-in-net-5/) ------------------------------ <strong>All hands on deck at Slack</strong> Last week we covered an article outlining a very, very bad day at Slack. Learn how they responded to it. [Learn from their mistakes](https://slack.engineering/all-hands-on-deck-91d6986c3ee) ------------------------------ #### BUG OF THE WEEK <strong>Spotify, Pinterest, Tinder, and others crash due to Facebook issue</strong> Multiple big-name applications were crashing this week due to a now resolved issue involving Facebook log-ins. [Find out what happened](https://techcrunch.com/2020/07/10/facebook-code-change-caused-outage-for-spotify-pinterest-and-waze-apps/) ------------------------------ #### COMMUNITY <strong>Simpsons against DevOps</strong> This week we're wanting to hopefully bring a smile to your face by shouting out a comedy page that pokes fun at DevOps... with daily Simpsons memes 🤔 [Have a chuckle](https://twitter.com/SimpsonsOps) ------------------------------ If you think Performance Matters is pretty great, why not [sign up](https://performancematters.dev/) to receive it in your inbox every week? 🙌 ------------------------------ ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/f3in3d0co2914exwgmkp.png) ------------------------------
raygun_staff
402,771
10 extension ยอดนิยมสำหรับผู้ ใช้ vscode ประจำปี 2019
วิธีการติดตั้ง Extension บน VSCode ให้กดปุ่ม Ctrl+Shift+X หรือกดปุ่ม Extension ในช่องค้นห...
0
2020-07-18T06:14:31
https://dev.to/manalabpsu/10-extension-5d5j
vscode, extension
###**วิธีการติดตั้ง Extension บน VSCode**### 1. ให้กดปุ่ม Ctrl+Shift+X หรือกดปุ่ม Extension 2. ในช่องค้นหาด้านบน ให้พิมพ์ชื่อ Extension ที่ต้องการ 3. คลิกที่ปุ่ม Install เมื่อทำการติดตั้งเสร็จเรียบร้อยก็ให้คลิกที่ปุ่ม Reload ###**1.VS Color Picker, Color Highlight**### ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/slaqgl11aqtm1x7ghcj4.jpg) ใช้เลือกสีในการไฮไลท์โค้ด มีสองโหมดให้เลือกจะเลือกสีเอง หรือ ไปดูดมาจากที่อื่นๆ ข้างนอกโปรแกรมก็ดูดได้ ###**2.Open In Default Browser**### ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/y0j8bfbb54etqit14oos.jpg) เป็นวิธีการทำให้ VS Code สามารถรัน HTML ผ่าน browser ได้ โดยกดปุ่ม Ctrl+Shift+X หรือกดปุ่ม Extension ให้พิมพ์คำว่า open in browser ###**3.Bootstrap 4, Font awesome 4, Font Awesome 5 Free & Pro snippets**### ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/0hj649aapmtgoy3ckwwz.gif) Bootstrap ช่วยในเรื่องการทำเว็บให้ responsive (รองรับทุกขนาดหน้าจอของผู้ใช้) แต่จริงๆ Bootstrap ยังทำให้ชีวิตเราง่ายขึ้นในหลายๆ ด้านมาก ไม่ว่าจะเป็นการดีไซน์เว็บให้สวยงามทันสมัยโดยที่เราเขียนโค้ดนิดเดียว หรือการจัด layout (แบบ) หน้าเว็บเราง่ายๆ โดยไม่ต้องเขียนโค้ด CSS เยอะ ###**4.GitHub**### ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/3eu49kqpruavwqwshac3.png) ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/lpx0zy6veghjkxsr47hm.jpg) เวลามีโปรเจกต์หลาย ๆ คนคงจะพอคุ้นหูคุ้นตากันมาบ้างกับคำว่า “Git” หรือก็คือเครื่องมือ Version control ที่มีไว้สำหรับจัดเก็บความเปลี่ยนแปลงของไฟล์ในโปรเจกต์ของเราหรือทีม ไม่ว่าเราจะเพิ่ม ลบ เปลี่ยน ระบบก็จะบันทึกไว้ ทำให้เราสามารถรู้ประวัติการเปลี่ยนแปลงและความเคลื่อนไหวต่าง ๆ ของโปรเจกต์ที่เราถืออยู่ได้ ###**5.Auto Close Tag**### ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/k87u0bcmm671fefiel7s.gif) เขียนแค่ tag เปิดก็พอ ไม่ต้องเขียน tag ปิด ลง Auto Close Tag ไว้ให้ editor ทำการปิด tag ให้เรา จะช่วยลดเวลาในการเขียนโค้ด ###**6.Auto Rename Tag**### ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/e8rvg0nstjhtq96u5zwj.gif) Auto Rename Tag เป็น Extension ที่ช่วยให้ผมสามารถแก้ไขชื่อ Tag แล้วตัวปิด Tag จะเปลี่ยนไปตามชื่อ Tag ที่แก้ไขด้วย ช่วยเพิ่มความสะดวกในการเขียนโค้ด ###**7.Live server**### ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/l8693v6rsl2kqtv70dej.gif) Live Server จะเป็นหน้าจอที่ 2 ช่วยแสดงผลลัพธ์ของโปรแกรมใน Code Editor แบบสดๆ ไม่ต้องนั่งสลับจอ หรือ Refresh ให้เสียเวลา เท่านี้การเขียนโค้ดก็จะง่าย และเร็วขึ้นอีกหลายเท่า ###**8.Quokka.js**### ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/etovsw3vjgsfoouyq88f.gif) Quokka จะช่วยในการแก้ไขจุดบกพร่อง และทดสอบโค้ด Javascript ให้โดยอัตโนมัติ พร้อมทั้งแสดงผลลัพธ์ให้ดู ทำให้ไม่ต้องเสียเวลาไปดีบั๊กภายหลัง ###**9.vscode-icons**### ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/0whpg93vwfnp8v9cvumj.gif) ‘VS Code Icons’ จะมาช่วยแยกประเภทของไฟล์ต่าง ๆ ในโปรเจคด้วย Icon ที่เป็นสัญลักษณ์ ที่ทำให้ง่ายสำหรับการค้นหาจึงช่วยประหยัดเวลา ###**10.Import Cost**### ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/3jly8xc9o4ywm2sdhyrt.gif) extension ที่จะคอยแสดงขนาดไฟล์ของ package ที่เรา import เข้ามา โดยจะแสดงให้เห็นทันทีว่า package ตัวไหนมีขนาดไฟล์เท่าไหร่
manalabpsu
402,971
Microsoft Edge introduces native dark-mode
A new option to force render webpages in dark mode has been added to Microsoft Edge. How to...
0
2020-07-18T07:46:48
https://dev.to/sakshatshinde/microsoft-ege-introduces-native-dark-mode-1pbd
news, edge, browser
A new option to force render webpages in *dark mode* has been added to Microsoft Edge. ### How to enable this feature? ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/hxqg0bg0trg9k266ecyw.png) * Type `edge://flags/#enable-force-dark` into the URL bar. * Enable *Force Dark Mode for Web Contents* * Restart > Maybe this would be the reason people will move away from chrome Hope this helped 💖
sakshatshinde
403,191
🤖E1 | Which Framework is the best😉? | 2020
In this series, I am going to be answering your coding/designing questions. I don't claim I have a lo...
0
2020-07-19T11:14:33
https://dev.to/eleftheriabatsou/e1-which-framework-is-the-best-2020-1bn1
qna, framework, motivation, coding
In this series, I am going to be answering your coding/designing questions. I don't claim I have a lot of experience or that I know everything, I am just going to give you examples that have worked for me and I hope they will work for you as well. In this video, I answer: 👣GENERAL QUESTIONS 1. How old are you? 1:11 2. Where are you from? 1:36 3. Are you an app developer? 1:49 4. Are you a UX/UI designer? 2:32 5. When did you realize you want to be in the tech field? 3:14 👣CODE and DESIGN questions 6. What's the fastest mobile development solution? 4:59 7. What are the best sources for development? 6:38 (check below for more information) 8. Any good tips for UX/UI? 9:09 (check below for more information) 9. Why should one write vanilla plain javascript? 11:38 10.Best framework? React, vueJS, AngularJS? 13:10 11. Which framework should I learn first (React, vueJS, AngularJS)? 13:51 👣COMING UP questions - Brain fog - Procrastination - Motivation ************************************ Αbout the 7th Question To learn javascript I suggest starting with freeCodeCamp - freecodecamp.org 💪Check out my [playlist](https://www.youtube.com/watch?v=nijJ0xFZt8g&list=PLxktx98zP3aAylA3it3TYyF7x6lDhc0qi) on reviewing online courses (from udemy, codecamedy etc), to find out what best suits your needs Αbout the 8th Question 💪My free [course](https://www.youtube.com/playlistlist=PLxktx98zP3aBJpKas1z2zLQjSmzE3_CT3) about ux and UI, I think you'll like it! 💪Some [tools](https://www.youtube.com/playlistlist=PLxktx98zP3aBJpKas1z2zLQjSmzE3_CT3) that can help you in picking colors, images, typography, inspiration on design, etc Αbout the 5th Question 💪This is the [video](https://youtu.be/Y7m6rZXtNn8) on how I started my coding journey ✅Season 1 of QnA can be found [here](https://www.youtube.com/playlistlist=PLxktx98zP3aDdYxC55TRQlm9k7nD60Wcb) ✅Season 2, Ep2 [here](https://youtu.be/oTEzCr-FmPc) ************************************ 🤔If you have any question and you are searching for an answer, or you if you want a code/design review please choose a way to participate: 1. leave a comment in this video. 2. or go the "community" tab on my YouTube channel and leave a comment there. 3. or go on twitter, find me on @BatsouElef, and ask me anything ************************************ 👋Hello, I' m Eleftheria, an app developer, master student, public speaker, and chocolate lover. 🍩Would you care about buying me a coffee? You can do it here: [paypal.me/eleftheriabatsou](paypal.me/eleftheriabatsou) but If you can't that's ok too! ************************************** 🙏It would be nice to subscribe to my [Youtube](https://www.youtube.com/c/EleftheriaBatsou) channel. It’s free and it helps to create more content. 🌈[Youtube](https://www.youtube.com/c/EleftheriaBatsou) | [Codepen](https://codepen.io/EleftheriaBatsou) | [GitHub](https://github.com/EleftheriaBatsou) | [Twitter](https://twitter.com/BatsouElef) | [Site](http://eleftheriabatsou.com/) | [Instagram](https://www.instagram.com/elefintech/)
eleftheriabatsou
403,224
Setting up Cypress
Cypress is a great way of testing your frontend application with end to end tests and it is so nice t...
0
2020-07-18T15:15:55
https://debbie.codes/blog/cypress-setup
cypress, nuxt, ci
[Cypress](https://www.cypress.io/) is a great way of testing your frontend application with end to end tests and it is so nice to work with. Writing the tests and making sure they get ran on each build is really important too. Let's take a look at how you setup Cypress in your Nuxt.js project, setup a github action for continuous integration so that Netlify will run the tests every time your application is building. Once you have already created your Nuxt.js project you can install Cypress as a dev dependency. ```bash yarn add cypress -D ``` You then need to open Cypress which will launch the test runner and create the cypress folder in your project with some example tests. ```bash yarn run cypress open ``` In your cypress.json file you can add custom configurations so the viewport is wider and the height depending on your screen or how you want to see your application within the cypress window. We can also set a baseUrl for our test. You will find this file at the root of your project. ```json{}[cypress.json] { "baseUrl": "http://localhost:3000", "viewportWidth": 1600, "viewportHeight": 1400 } ``` We can now remove the examples folder and create our own test inside the integration folder. This is just a basic test will make visit the home page. ```js{}[home.spec.js] describe('The Home Page', () => { it('should visit the home page', () => { cy.visit(Cypress.config().baseUrl + '/') }) }) ``` If you have eslint setup you may notice that it is giving you errors and saying that it can't find cypress. To fix this we can install the [eslint plugin for cypress](https://github.com/cypress-io/eslint-plugin-cypress) as a dev dependency. ```bash yarn add eslint-plugin-cypress -D ``` We then add this to our .eslintrc to tell it to use the cypress plugin and extend the cypress recommended configuration or alternatively you can set your own rules. We also set our env for cypress globals to true to allow certain globals provided by Cypress. ```json{}[.eslintrc] { "plugins": ["cypress"], "extends": ["plugin:cypress/recommended"], "env": { "cypress/globals": true } } ``` We can then setup our [github action](https://github.com/cypress-io/github-action) by creating a workflows folder in our .github folder. Inside the workflows folder create a main.yml file and add the following config with build as the script we want to run from our package.json for building our application and start for the script we want to use to start our application. ```yml{}[.github/workflows/main.yml] name: End-to-end tests on: [push] jobs: cypress-run: runs-on: ubuntu-16.04 steps: - name: Checkout uses: actions/checkout@v1 # Install NPM dependencies, cache them correctly # and run all Cypress tests - name: Cypress run uses: cypress-io/github-action@v2 with: browser: chrome headless: true build: npm run generate start: npm run start # quote the url to be safe against YML parsing surprises wait-on: "http://localhost:3000" ``` When running your tests in CI sometimes the server will continue to execute the next command after signalling to start your server and if the server takes time to boot then Cypress might start to visit your local server before it is ready. You can resolve this by adding this npm package, [start-server-and-test](https://github.com/bahmutov/start-server-and-test), as a dev dependency. ```bash yarn add start-server-and-test -D ``` Then in our package json we need to create some scripts so that cypress can run. We create the run script the open script and then a test script for when in production passing in the command of the package we just installed and then using the serve command with where our server will be run and then we call the run script that we created. For development it is pretty much the same except we call the dev script and the cypress open script. ```json{}[package.json] "cy:open": "cypress open", "cy:run": "cypress run", "test:e2e:run": "start-server-and-test start http://localhost:3000 cy:run", "test:e2e:dev": "start-server-and-test dev http://localhost:3000 cy:open", ``` One thing we need to do before launching our tests in production is to add the videos and screenshots to our .gitignore file. add to gitignore ```md{}[.gitignore] cypress/videos cypress/screenshots ``` We can now launch your tests to make sure it is working correctly. ```bash yarn test:e2e:run ``` Once you are happy that everything is working as it should you can push your changes which will trigger the github action. Now in your github repo you can click on the actions tab and watch your action do it's job and you can see if tests are passing. Then there is just one last step in order to get your tests working with your hosting provider. If you are using *Netlify* there is a netlify [plugin for cypress](https://github.com/cypress-io/netlify-plugin-cypress#readme) you can install. In the Netlify dashboard go to the plugins and search for cypress and click install. Add netlify-plugin-cypress NPM package as a dev dependency to your repository. ```bash yarn add -D netlify-plugin-cypress ``` Then add a netlify.toml file if you haven't already got one and add the following code which will run the commands on build as well as cache the cypress binary in a local node_modules folder so Netlify caches it and then one the site is built it runs the plugin to test the site. ```toml [build] command = "npm run generate" publish = "dist" [build.environment] # cache Cypress binary in local "node_modules" folder # so Netlify caches it CYPRESS_CACHE_FOLDER = "./node_modules/CypressBinary" # set TERM variable for terminal output TERM = "xterm" [[plugins]] # local Cypress plugin will test our site after it is built package = "netlify-plugin-cypress" ``` And thats it. You can now go to your Netlify builds and watch your tests run and your application build. Now if your tests fail your application won't build. This plugin also tells you if it failed because of the tests so it is really easy to see if it is the cause of your builds breaking. Note: If you are not using Netlify you can modify your generate script to run your tests once the application has been built. ```json{}[package.json] "generate": "nuxt generate && cypress install --force && npm run test:e2e:run", ```
debs_obrien
403,315
Jinja - Short introduction and Sample Apps
A short introduction in Jinja2 plus two open-source apps to play with
0
2020-07-18T17:51:32
https://dev.to/sm0ke/jinja2-short-introduction-and-sample-apps-nb
jinja, python, webdev, appseed
--- title: Jinja - Short introduction and Sample Apps published: true description: A short introduction in Jinja2 plus two open-source apps to play with tags: Jinja, python, webdev, appseed cover_image: https://raw.githubusercontent.com/app-generator/theme-jinja2-quick-uikit/master/media/theme-jinja2-quick-uikit-screen.png --- Hello Coders, This article is a **short introduction to Jinja**, a modern templating language used by Python programmers in frameworks like Flask, Bottle, optionally in Django (starting with 1.8 version). For those already familiar with Jinja2, and fast-runners, I'll drop some links below to some nice Jinja Templates, provided as super simple Flask starters (no database or hard dependencies): > *Thanks for reading!* - Content provided by **[App Generator](https://appseed.us/)**. --- - ✨ [Flask/Jinja Pixel UI](https://appseed.us/apps/flask-apps/flask-pixel-bootstrap-uikit) - product page - ✨ [Flask/Jinja Datta Able](https://appseed.us/admin-dashboards/flask-datta-able) - product page - ✨ [Flask/Jinja Bootstrap 5 Volt](https://appseed.us/admin-dashboards/flask-dashboard-volt) - product page - ✨ [Flask/Jinja Material Lite Wpx](https://appseed.us/admin-dashboards/flask-dashboard-material-lite) - product page --- ## ✨ [Flask/Jinja Pixel UI](https://appseed.us/apps/flask-apps/flask-pixel-bootstrap-uikit) Pixel is a free, fully responsive and modern Bootstrap 4 UI Kit that will help you build creative and professional websites. Use our components and sections, switch some Sass variables to build and arrange pages to best suit your needs. Pixel Lite comes with 6 premium example pages that we created to show you the beautiful user interfaces that can be created. --- - ✨ [Flask/Jinja Pixel UI](https://appseed.us/apps/flask-apps/flask-pixel-bootstrap-uikit) - Product page - ✨ [Flask/Jinja Pixel UI](https://flask-pixel-lite.appseed-srv1.com/) - LIVE Demo --- ![Jinja Pixel Lite - Template project provided by AppSeed.](https://raw.githubusercontent.com/app-generator/jinja-template-pixel-uikit/master/media/jinja-template-pixel-uikit-screen.png) --- ## ✨ [Flask/Jinja Datta Able](https://appseed.us/admin-dashboards/flask-datta-able) Datta Able comes with error/bug-free, well structured, well-commented code and regularly with all latest updated code. Which saves your a large amount of developing backend application time and it is fully customizable. This modern UI Kit crafted by CodedThemes features a rich UI Kit and pre-built pages: dashboard, maps and authentication pages. --- - ✨ [Flask/Jinja Datta Able](https://appseed.us/admin-dashboards/flask-datta-able) - Product page - ✨ [Flask/Jinja Datta Able](https://flask-datta-able.appseed-srv1.com/) - LIVE Demo --- ![Jinja Template - Datta Able, thumbnail image.](https://raw.githubusercontent.com/app-generator/jinja-datta-able/master/media/jinja-template-dattaable-dashboard-screen.png) --- ## ✨ [Flask/Jinja Bootstrap 5 Volt](https://appseed.us/admin-dashboards/flask-dashboard-volt) Volt Dashboard is a free and open source Bootstrap 5 Admin Dashboard featuring over 100 components, 11 example pages and 3 plugins with Vanilla JS. There are more than 100 free Bootstrap 5 components included some of them being buttons, alerts, modals, datepickers and so on. - ✨ [Jinja Volt Dashboard](https://appseed.us/admin-dashboards/flask-dashboard-volt) - product page - ✨ [Jinja Volt Dashboard](https://flask-volt-dashboard.appseed-srv1.com/) - LIVE Demo --- ![Jinja Volt Dashboard - Starter provided by AppSeed.](https://raw.githubusercontent.com/app-generator/jinja-volt-dashboard/master/media/jinja-volt-dashboard-intro.gif) --- ## ✨ [Flask/Jinja Material Lite Wpx](https://appseed.us/admin-dashboards/flask-dashboard-material-lite) WrapPixel's MaterialPro Lite is one of the best Bootstrap templates for admin dashboards and control admin panels. It combines colors that are easy on the eye, spacious cards, beautiful typography, and graphics. --- - ✨ [Jinja Material Lite](https://appseed.us/admin-dashboards/flask-dashboard-material-lite) - product page - ✨ [Jinja Material Lite](https://flask-dashboard-material-lite.appseed.us/) - LIVE Demo --- ![Jinja Material Lite - Starter provided by AppSeed.](https://raw.githubusercontent.com/app-generator/jinja-template-material-lite/master/media/jinja-template-material-lite-screen.png) --- ## [What is Jinja](https://docs.appseed.us/content/what-is/jinja) Jinja2 is a Python template engine used to generate HTML or XML returned to the user via an HTTP response. For those who have not been exposed to a templating language before, such languages essentially contain variables as well as some programming logic, which when evaluated (or rendered into HTML) are replaced with actual values. --- ## Why do we need Jinja? **Sandboxed Execution** - It provides a protected framework for automation of testing programs, whose behavior is unknown and must be investigated. **HTML Escaping** Jinja 2 has a powerful automatic HTML Escaping, which helps to prevent Cross-site Scripting (XSS Attack). There are special characters like >,<,&, etc. which carry special meanings in the templates. So, if you want to use them as regular text in your documents then, replace them with entities. Not doing so might lead to XSS-Attack. **Template Inheritance** - This feature helps us to generate new pages starting from a base template that we *inherit* a common structure. --- > How to get Jinja2 To start playing with it, just open a terminal and type: ```bash $ pip install jinja2 ``` --- ## Jinja in action > Simple runtime replace ```python >>> from jinja2 import Template >>> t = Template("Hello {{ token }}!") >>> t.render(token="Jinja2") u'Hello Jinja2!' ``` The engine will replace the inner `token` with value `Jinja2`. This is quite useful when we use this block for different `token` values. --- > Lists iteration In web development, we can have cases when a list should be displayed on the page: registered users, for instance, or a simple list of options. In Jinja, we can use a `for structure` as bellow: ```python # Define data structure my_list=[0,1,2,3,4,5] # a simple list with integers ``` In Jinja, we can iterate with ease, using a `for` block: ```html ... <ul> {% for n in my_list %} <li>{{n}}</li> {% endfor %} </ul> ... ``` --- > Template Inheritance Templates usually take advantage of inheritance, which includes a single base template that defines the basic structure of all subsequent child templates. You use the tags { extends } and { block } to implement inheritance. Let's take a look at a real sample: > Parent HTML - saved as `base.html` ```html <html> <head> <title>My Jinja {% block title %}{% endblock %} </title> </head> <body> <div class="container"> <h2>This is from the base template</h2> <br> { block content }{ endblock } <br> </div> </body> </html> ``` > The Child template - saved as child.html ```html { extends "base.html" } { block title } MySample { endblock } { block content } Cool content here { endblock } ``` When Jinja loads `child.html`, the { extends } block informs the engine to merge the `base.html` template with the content provided by `child.html` - `{ block title }` become `MySample` - `{ block content }` become `Cool content here` Here is the final HTML generated by Jinja: ```html <html> <head> <title>My Jinja MySample</title> </head> <body> <div class="container"> <h2>This is from the base template</h2> <br> Cool content here <br> </div> </body> </html> ``` This powerful feature helps us to build complex web apps with ease by using common pages and components to generated dynamic pages hydrated with real information loaded from the database or provided by users, for instance. --- > **Thanks for reading!** Let me know your thoughts in the comments. --- ## Resources & Links - More [Jinja/Flask Templates](https://appseed.us/apps/flask-apps) - index provided by AppSeed - [Jinja2](https://jinja.palletsprojects.com/en/2.11.x/) - official website
sm0ke
403,386
JEST (HOW TO MOCK)
What is Mock? According to Jest documentation:- Mock functions make it easy to test the...
0
2020-07-18T19:34:14
https://dev.to/shandilyaprasanna/jest-how-to-mock-p11
react, javascript, testing
###What is Mock? According to Jest documentation:- >Mock functions make it easy to test the links between code by erasing the actual implementation of a function, capturing calls to the function (and the parameters passed in those calls). ###Lets Mock now:- ####1.) Mock Functions ```javascript const mockFn = jest.fn(); mockFn(); expect(mockFn).toHaveBeenCalled(); ``` ####2.) Mock function to return value (mockReturnValue , mockImplementation) You can provide a value to be returned by the mock by calling the mockReturnValue() function. ```javascript const mockFn = jest.fn(); myMock.mockReturnValue("hello"); expect(mockFn()).toBe("hello"); ``` With mockReturnValue it does not matter what arguments you are passing to it, but in some cases, it may be useful to return a value from your mock, based on arguments given to it. This can be achieved by mockImplementation() function. ```javascript let store = {} jest.fn().mockImplementation((key, value) => { store[key] = value; }), ``` ####3.) Mock Fetch call You can also mock the implementation for asynchronous functions. In this case, just return a promise from the implementation. ```javascript global.fetch = jest.fn().mockImplementation(() => Promise.resolve({ status:200, statusText:"success", json: () => { return { ok: true, result:data, }; // return result which you expect from api } }) ); ``` ####4.) Mock imported file There may be a case where your component is importing some other modules or icons but you don't want to handle it. In that case, mock the whole path to return a string ```javascript jest.mock("file/pathname", () => "Module"); ``` ####5.) JEST Mock Imported Function from different file Let's combine above two points, a situation where you are making an async call in the imported file ```javascript import * as utils from "./LoginUtils"; utils.postToLogin = jest.fn().mockImplementation(() =>{ let userLogin=new Promise((resolve, reject)=>{ return resolve({status:"OK"}) }) return userLogin; } ); ``` ####6.) Mock localStorage, sessionstorage, cookie Using mockImplementation you can also mock localstorage ```javascript let store = {}; global.localStorage = { setItem: jest.fn().mockImplementation((key, value) => { JSON.stringify((store[key] = value)); }), getItem: jest.fn().mockImplementation(key => store[key]) }; ``` ####7.) Mock REFS First, create an instance of your component, then we can mock refs by ```javascript tree.instance().refs = {target:something} ``` Example:- ```javascript const instance_refs = tree.instance(); let mockFunction=jest.fn(); instance_refs.refs = {            yourRefName:{getWrappedInstance:()=>{return({changePaginationDetails:mockFunction})}}                    }; instance_refs.changeCurrentPage(); ``` ####8.) setTimeout, setInterval, clearTimeout, clearInterval Jest provides us with timer functions useFakeTimers and runAllTimers to mock timers ```javascript jest.useFakeTimers(); test('waits for timer', () => { jest.runAllTimers(); expect(something).toHaveBeenCalled(); }); ``` ####9.) How to mock react portal (Example to test modal ) Let's test the modal component created using the React portal. this modal mounts to a dom node on the root of the "body" #####Modal code:- ```javascript import React from "react"; import ReactDOM from "react-dom"; export default props => { const domNode = document.getElementById("fullPageModal"); const modal = <div className="fullPageModal">{props.children}</div>; return ReactDOM.createPortal(modal, domNode); }; ``` First, we need to add a div with #fullPageModal id to the global body #####Test- ```javascript describe("FullPageModal component", () => { let component; const Child = () => <div>Yolo</div>; // add a div with #fullPageModal id to the global body const modalRoot = global.document.createElement("div"); modalRoot.setAttribute("id", "fullPageModal"); const body = global.document.querySelector("body"); body.appendChild(modalRoot); beforeEach(() => { component = mount( <FullPageModal> <Child /> </FullPageModal> ); }); it("should render Modal, on dom node fullPageModal", () => { const domNode = global.document.getElementById("fullPageModal"); expect(component.find(".fullPageModal").exists()).to.equal(true); }); }); ``` Please share your experience also where you have mocked something, would love to read it.
shandilyaprasanna
403,410
Codebytes: How to mock upload files in the test cases
Mock file uploads with file input elements
0
2020-07-19T06:27:42
https://dev.to/prakash_chokalingam/codebytes-how-to-mock-upload-files-in-the-test-cases-1g87
mockfileupload, fillinfile, javascript, codebytes
--- title: Codebytes: How to mock upload files in the test cases published: true description: Mock file uploads with file input elements tags: mockfileupload,fillInFile, javascript,codebytes //cover_image: https://direct_url_to_image.jpg --- Mocking file uploads with file input elements is not straight forward as mocking other HTML elements while writing test cases. Why and how do we do that? ``` <input type="file" id="file-upload" onchange="doSomething" /> ``` The file input elements have [FileList](https://developer.mozilla.org/en-US/docs/Web/API/FileList) object as its value. The FileList is nothing but a collection of [File](https://developer.mozilla.org/en-US/docs/Web/API/File) objects. The FileList object is **read-only** and we **cannot construct custom FileList** since it has no implementation of its constructor. However, there is a way to construct them using the [DataTransfer](https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer) object. DataTransfer object is responsible for holding the file objects in FileList during files drag & drop. We are gonna bypass the DataTransfer event's file addition methods to construct a FileList with our mocked files. Let's create one, ``` const dt = () => new DataTransfer() || new ClipboardEvent('').clipboardData; ``` > If the browser didn't support constructing a new DataTransfer, let's get the DataTransfer object from the [ClipboardEvent](https://developer.mozilla.org/en-US/docs/Web/API/ClipboardEvent/clipboardData) (mock's file copy-paste) alternatively. let's create a blob to construct a file object. ``` let fileString = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z/C/HgAGgwJ/lK3Q6wAAAABJRU5ErkJggg=='; (or) let fileString = 'https://some-image-url.png'; let blob = await fetch(fileString).then(res => { return res.blob(); }); ``` And now file object, ``` let file = new File([blob], "sample.jpg", { type: 'image/png'}) ``` will add the file object to the DataTransfer, ``` let dt = dt(); dt.items.add(file); ``` and it's time to add the FileList to the file input element ``` let $fileElement = document.getElementById('file-upload'); $fileElement.files = dt.files; ``` 🎉 Yay! The files have been added to the file element and now let's emit the change event so that your UI can respond to the file upload. ``` let changeEvent = new Event('change'); $fileElement.dispatchEvent(changeEvent); ``` To ease this, I have created a test helper util to fill files to the file input element. ``` await fillInFIle('#file-upload') ✅ ``` Check the GitHub repo for more details on the util: {% github https://github.com/prakashchokalingam/fill-in-file no-readme %}
prakash_chokalingam
403,413
Javascript var, let and const
using var to declare variables developers had to fight in many fields…
0
2020-07-18T20:15:59
https://dev.to/smileycode/var-let-and-const-in-js-597n
javascript, learning, beginners
--- title: Javascript var, let and const published: true description: using var to declare variables developers had to fight in many fields… tags: #javaScript #learning #beginners cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uyf30vn5q6582d6uffcu.jpeg --- I hate intros but we must have one 🤷 Before 2015 javascript developers used to use `var` as the keyword to declare variables, and life was easy, but not calm 😅 With using `var` to declare variables developers had to fight in many fields… **Redeclaration** 🤦‍♀️ Believe it or not, with `var` you can use the same variable name as many times as you can without facing any errors, but you have to be ready for the unexpected results😬. imagine the following: ```js function sayHi() { var name = "Our New User" var isLoggedIn = true if (isLoggedIn) { var name = "Sarah" } console.log("Hi" + name) // Hi Sarah } ``` The first thing that comes to your mind now is, so what?!, I redefine the variable, what the problem with that?!🤨 It is not a problem at all, as long as you know that is exactly what you want to do, not just that you forget that this variable has already declared before🧐. The real problem with redeclaration comes with large apps, and once you forget that you have used the same variable name before. _DISCLAIMER_✋: this won`t be a problem in case you have solid memory that helps you remember all the variables you have declared within a specific scope. **Scope** 😵 The line above ends with the word *SCOPE*, before digging deeper, let`s first understand what scope is, think of scop as a *box* within which some functions and variables are accessible. Chances are variables declared using `var` keyword are limitless, except if they are declared within a function. This means if a variable is not inside a function it will be accessible in the whole app😨. Now try to connect this point with the one before, _redeclaration_, now developers have to remember all the variables they have declared in the global/function scope else they find themselves trapped with results they never expect. Imagine the following… ```js function sayHi() { var name = "Our New User" var isLoggedIn = true if (isLoggedIn) { var name = "Sarah" console.log("Hi" + name) // Sarah } console.log("Hi" + name) // Sarah } ``` The log inside the if block makes sense, as we are logging the variable defined within this block, but the log outside the if block is the one highlights the problem, it supposed to prints _“Our New User”_ the value of the variable declared outside the if block, but what happens here is the variable `name` declared within the if block totally replaced the one declared outside the if block and here we have to mention hoisting. **Hoisting** 😧 Hoisting is the process of lifting variables and functions declarations to the top of their scope. Variables declared with the keyword `var` hoisted to the top of the global/function scope and initialized with the value undefined. Connecting this with the previous point, ```js function sayHi() { var name = "Our New User" var isLoggedIn = true if (isLoggedIn) { var name = "Sarah" console.log("Hi" + name) // Sarah } console.log("Hi" + name) // Sarah } ``` we now can find out what is happening here, the new variable declared within the if block is hoisted to the top of the function and of course replaced the original one, which justifies why the two console logs prints the same result. Now as we went through the problems js developers spent a long time fighting with, now let`s move forward how ES2015 saved our day 😉. Regarding redeclaration, variables declared using either `let` or `const` cannot be redeclared within the same scope. Mentioning the scope, both `let` and `const` are block-scoped, _a block of code is any set of code within {}_, which means if a variable declared using either `let` or `const` within {} it won`t be accessible outside these {}, despite they are hoisted to the top of their scop, which is the {}. Now let's check out our sayHi function... ```js function sayHi() { let name = "Our New User" var isLoggedIn = true // out of our scope if (isLoggedIn) { let name = "Sarah" console.log("Hi" + name) // Sarah } console.log("Hi" + name) // Our New User } ``` Now it works as expected the new variable declared within the if block stays within the if block and it does not affect the one outside the if block But now the question is, which one to use `let` or `const` 🤔?! The answer is, whatever you want😇, just remember that variables declared with `let` can be updated while those created with `const` cannot. Hope this helps and thanks for reading. If you have any questions or topics you want me to write about I will be happy to help❤️
nagwan
403,419
Como Compartilhar o Mouse e Teclado Entre Computadores – Windows, Linux e MacOS
Você tem dois computadores e apenas um teclado e mouse? Ou apenas quer otimizar seu tempo e usar um c...
0
2020-08-03T19:27:21
https://marquesfernandes.com/como-compartilhar-o-mouse-e-teclado-entre-computadores-windows-linux-e-macos/
tech, barrier, linux, macos
--- title: Como Compartilhar o Mouse e Teclado Entre Computadores – Windows, Linux e MacOS published: true date: 2020-07-17 23:18:04 UTC tags: Tech,barrier,linux,macos canonical_url: https://marquesfernandes.com/como-compartilhar-o-mouse-e-teclado-entre-computadores-windows-linux-e-macos/ --- Você tem dois computadores e apenas um teclado e mouse? Ou apenas quer otimizar seu tempo e usar um computador antigo como segunda tela? E se eu te falar que é possível compartilhar o teclado e mouse do seu computador e controlar mais de um computador com eles, e que não importa qual sistema operacional as suas máquinas tem, sim é possível! Aqui na minha configuração do dia a dia eu sempre estou com dois computadores, o principal rodando Windows e um antigo com Ubuntu rodando, e para fazer esse setup ser o mais otimizado possível, uso um programinha que permite que eu controle os dois computadores a partir do mesmo mouse e teclado. ## O software: Barrier – KVM O Barrier é um software que imita a funcionalidade de um [chaveador KVM](https://pt.wikipedia.org/wiki/Chaveador_KVM), que permite o uso de um único teclado, mouse e até monitor para controlar vários computadores girando fisicamente um seletor no dispositivo para alternar qual máquina está sendo controlada naquele momento. O Barrier faz isso sem a necessidade de um aparelho físico, através de software e se comunicando pela rede interna, para funcionar todos computadores precisam estar conectados na mesma rede. Ele permite que você diga qual máquina está controlando, como se estivesse conectada a dois ou mais monitores, movendo o mouse para a borda da tela ou usando uma tecla para alternar o foco entre os computadores configurados. O mais interessante é que além de gratuito, o barrier é de código aberto [github.com/debauchee/barrier](https://github.com/debauchee/barrier), permitindo que você baixe e modifique seu código fonte caso haja necessidade. ## Sistemas Operacionais Suportados O Barrier suporta todos os sistemas operacionais populares, você encontrará as instruções para instalação em cada uma deles em [github.com/debauchee/barrier](https://github.com/debauchee/barrier/) e as versões para download em [github.com/debauchee/barrier/releases](https://github.com/debauchee/barrier/releases). - Windows 7, 8, 8.1, e 10 - MacOS/OS X - Linux (Ubuntu, Debian, CentOS, Fedora, OpenSuse, …) - FreeBSD - OpenBSD ## Instalando e Configurando o Computador Principal O primeiro computador que vamos configurar deverá ser aquele que queremos utilizar o mouse e teclado para controlar os demais também. Neste tutorial usarei o meu computador Windows como principal, mas você pode escolher qualquer um deles como principal e inclusive alternar depois, qual computador configurado é o principal. Baixe a última versão do `.exe` do Barrier em [github.com/debauchee/barrier/releases](https://github.com/debauchee/barrier/releases), e clique duas vezes no arquivo baixado. Provavelmente o Windows exibirá uma mensagem parecida com essa: ![Instalando o Barrier](https://marquesfernandes.com/wp-content/uploads/2020/07/barrier-1.jpg) Clique em _Mais informações_ e _Executar assim mesmo_, depois basta aceitar os termos e condições e prosseguir clicando em _próximo_ para concluir a instalação. ![Configurando o primário](https://marquesfernandes.com/wp-content/uploads/2020/07/image-33.png) Agora procure o seu atalho do Barrier em seu computador e execute o programa. Seleciona a primeira opção _“Server”_ para configurar como o computador principal. Anote o IP do seu computador dentro da sua rede, usaremos ele para configurar o computador secundário, no nosso caso é o IP ao lado do número em negrito, usaremos o _192.168.0.43_. ## Instalando e Configurando o Computador Secundário Agora vamos instalar e configurar o nosso computador secundário, que será controlado pelo mouse e teclado do nosso computador principal, no meu caso estarei usando a distribuição Ubuntu 20.04 do Linux como secundário. A instalação é bem simples e rápida, com apenas dois comandos: ``` $ sudo apt-get update$ sudo apt-get install -y barrier ``` Agora abra a aplicação e siga o processo de instalação. Quando concluido, abra o programa, selecione o modo _“Client”_ e desmarque a seleção de _“Auto config”._ No campo _IP do servidor_ adicione o número do IP copiado do passo anterior. Anote também o _Nome da tela_, usaremos ele para configurar a posição da tela em nosso computador principal. ![Barrier Configurando Secundário](https://marquesfernandes.com/wp-content/uploads/2020/07/image-35.jpg) ## Configurando a Posição da Tela Agora que temos o programa rodando nos dois computadores, precisamos configurar e autorizar no computador principal a posição do computador secundário que desejamos controlar. Abra o programa novamente e clique no botão _Configurar servidor_, certifique-se que o Barrier não está rodando, se não você não conseguirá editar as configurações. ![Barrier Adicionado Computador](https://marquesfernandes.com/wp-content/uploads/2020/07/image-36.jpg) Clique no computador para adicionar um novo computador secundário. Adicione em _Nome da tela_ o nome que anotamos no passo anterior e clique em OK. ![Barrier Configuração Secundário](https://marquesfernandes.com/wp-content/uploads/2020/07/image-38.png) Nesse caso configuramos a posição do nosso computador secundário a esquerda de nosso computador primário, isso significa que quando arrastarmos o mouse para o extremo esquerdo do computador principal, ele irá mudar o controle para o computador secundário. Vamos testar nossa configuração, clique em _Iniciar_ no computador primário e em _Aplicar_ no secundário, se tudo ocorrer conforme esperado, você já conseguirá controlar os dois computadores a partir de um único mouse e teclado. Você pode inclusive adicionar um terceiro computador, por exemplo, um computador da Apple com MacOS, para configurar basta seguir os mesmos passos e escolher a posição dele referente ao seu computador primário. ## Problemas Comuns com o Barrier 1. **Mouse no computador secundário lento:** Como essa configuração depende da rede interna, caso ela esteja sobrecarregada oscilações e lentidões podem ocorrer, não tem muito jeito, ainda mais se estiver conectado no WiFi. 2. **Computador primário parou de funcionar:** O seu computador primário pode mudar de endereço de IP, normalmente quando é reiniciado, então caso pare de funcionar, de uma olhada se o IP não mudou. Existe uma maneira de deixar o IP fixo para o seu computador na rede, mas isso ficará para um outro post. 3. **Computador não consegue conectar:** Confira se o IP está correto, caso esteja, verifique se o seu firewall/anti-virus não está bloqueando as conexões. O post [Como Compartilhar o Mouse e Teclado Entre Computadores – Windows, Linux e MacOS](https://marquesfernandes.com/como-compartilhar-o-mouse-e-teclado-entre-computadores-windows-linux-e-macos/) apareceu primeiro em [Henrique Marques Fernandes](https://marquesfernandes.com).
shadowlik
403,589
Hi, we’re ErgoSesh and we are thrilled to be at CodeLand!
ErgoSesh is a team of ergonomic specialists revolutionizing the standard ergonomic assessment.
0
2020-07-23T11:51:23
https://dev.to/ergosesh/hi-we-re-ergosesh-and-we-are-thrilled-to-be-at-codeland-3lbk
codeland
--- title: Hi, we’re ErgoSesh and we are thrilled to be at CodeLand! published: true description: ErgoSesh is a team of ergonomic specialists revolutionizing the standard ergonomic assessment. tags: codeland cover_image: https://dev-to-uploads.s3.amazonaws.com/i/gd64gb6ws9lk1xd2lxn0.png --- [ErgoSesh](http://ergosesh.com/) is a team of ergonomic specialists revolutionizing the standard ergonomic assessment. We empower you through education, giving you the tools to be more mindful about your workspace. This is especially important for people who spend a lot of timing sitting or standing at a computer. ErgoSesh is also a dealer of ergonomic furniture including seating, sit to stand tables, and accessories. ### Got questions? Let's Chat! We are excited to be at CodeLand, and to meet everyone attending! You can reach us on our [DEV Connect channel](https://dev.to/join_channel_invitation/ergosesh-4oa1?invitation_slug=invitation-link-beb7bc) today at these times: - 9:00-11:00am EDT - 1:00-2:00pm EDT - 5:00-7:00pm EDT You can also leave a comment down below if those times don't work for you :) ### A special discount for CodeLand attendees ✨ We're happy to share 10% off of an online [ErgoSesh Appointment](http://ergosesh.com/) for all CodeLand attendees - just use promo code `CODELAND2020` at checkout!
brett_ergosesh
403,686
Adding Mutations with Express GraphQL
We can create a simple GraphQL server with Express. To do this, we need the express-graphql and graph...
0
2020-07-20T23:49:09
https://thewebdev.info/2020/07/19/adding-mutations-with-express-graphql-2/?utm_source=rss&utm_medium=rss&utm_campaign=adding-mutations-with-express-graphql-2
graphql, javascript, webdev
--- title: Adding Mutations with Express GraphQL published: true date: 2020-07-19 01:27:09 UTC tags: GraphQL,javascript,webdev canonical_url: https://thewebdev.info/2020/07/19/adding-mutations-with-express-graphql-2/?utm_source=rss&utm_medium=rss&utm_campaign=adding-mutations-with-express-graphql-2 --- We can create a simple GraphQL server with Express. To do this, we need the `express-graphql` and `graphql` packages. In this article, we’ll look at how to create mutations and input types with Express and GraphQL. ### Mutations and Input Types To create mutations, we create a schema that has the `Mutation` type rather than a `Query` . Then it’s a simple as making the API endpoint part of the top-level `Mutation` type instead of a `Query` type. Both mutations and queries can be handled by root resolvers. We can then create a GraphQL server that takes both queries and mutations as follows: ``` const express = require('express'); const graphqlHTTP = require('express-graphql'); const { buildSchema } = require('graphql'); const crypto = require('crypto'); const schema = buildSchema(` input TodoInput { text: String } type Todo { id: ID! text: String } type Query { getTodo(id: ID!): Todo } type Mutation { createTodo(input: TodoInput): Todo updateTodo(id: ID!, input: TodoInput): Todo } `); class Todo { constructor(id, { text }) { this.id = id; this.text = text; } } let todos = {}; const root = { getTodo: ({ id }) => { if (!todos[id]) { throw new Error('Todo not found.'); } return new Todo(id, todos[id]); }, createTodo: ({ input }) => { const id = crypto.randomBytes(10).toString('hex'); todos[id] = input; return new Todo(id, input); }, updateTodo: ({ id, input }) => { if (!todos[id]) { throw new Error('Todo not found'); } todos[id] = input; return new Todo(id, input); }, }; const app = express(); app.use('/graphql', graphqlHTTP({ schema: schema, rootValue: root, graphiql: true, })); app.listen(3000, () => console.log('server started')); ``` In the code above, we defined our types by writing: ``` const schema = buildSchema(` input TodoInput { text: String } type Todo { id: ID! text: String } type Query { getTodo(id: ID!): Todo } type Mutation { createTodo(input: TodoInput): Todo updateTodo(id: ID!, input: TodoInput): Todo } `); ``` We created the input type `TodoInput` and the `Todo` type. Then we created the `Query` type with the `getTodo` member so that we can get our todo items. Then in our `Mutation` , we added the `createTodo` and `updateTodo` members so that we can add and update todos. Then we create our `Todo` class so that we can store the todo data: ``` class Todo { constructor(id, { text }) { this.id = id; this.text = text; } } ``` Next, we have our root resolver: ``` const root = { getTodo: ({ id }) => { if (!todos[id]) { throw new Error('Todo not found.'); } return new Todo(id, todos[id]); }, createTodo: ({ input }) => { const id = crypto.randomBytes(10).toString('hex'); todos[id] = input; return new Todo(id, input); }, updateTodo: ({ id, input }) => { if (!todos[id]) { throw new Error('Todo not found'); } todos[id] = input; return new Todo(id, input); }, }; ``` It adds the functions with the same as we specified in our schema so that we can do something when we make some queries. In this example, `getTodo` , we’ll return the todo with the given `id` .The todo that’s found will be returned. Otherwise, we throw an error. In `createTodo` , we get the `input` from the query and then add the todo entry to our `todos` object, which is our fake database to store the todos. The todo that’s saved will be returned. Then we have the `updateTodo` function to update the todo by `id` . Whatever has the given `id` will be replaced with the content of `input` . The todo that’s saved will be returned. We throw an error if a todo with the given `id` isn’t found. Then when we go to the `/graphql` page, we can type in the following to the GraphiQL window: ``` mutation { createTodo(input: {text: "eat"}) { id text } } ``` Then we get something like: ``` { "data": { "createTodo": { "id": "c141d1fda69e8d9084bd", "text": "eat" } } } ``` as the response. If we make a query for updating todo as follows: ``` mutation { updateTodo(id: "e99ce10750c93793a23d", input: {text: "eat"}) { id text } } ``` We get something like: ``` { "data": { "updateTodo": { "id": "e99ce10750c93793a23d", "text": "eat" } } } ``` back as the response. If a todo isn’t found, then we get: ``` { "errors": [ { "message": "Todo not found", "locations": [ { "line": 9, "column": 3 } ], "path": [ "updateTodo" ] } ], "data": { "updateTodo": null } } ``` as the response. We can make the `getTodo` query as follows: ``` query { getTodo(id: "e99ce10750c93793a23d"){ id text } } ``` Then we get: ``` { "data": { "getTodo": { "id": "e99ce10750c93793a23d", "text": "eat" } } } ``` as the response. ### Conclusion We can create mutations as we do with queries. To accept mutation operations in our GraphQL server, we make our types for storing our data, then we create our mutations by populating the `Mutation` type with our members. We can then use the `buildSchema` function to build the schema we just specified. Then in our root reducer, we make the functions that with the names that we specified in the type definitions. Finally, we can make queries to our server to run the mutations. The post [Adding Mutations with Express GraphQL](https://thewebdev.info/2020/07/19/adding-mutations-with-express-graphql-2/) appeared first on [The Web Dev](https://thewebdev.info).
aumayeung
404,805
Accessibility best practices, device testing and SEO
CSS and JavaScript accessibility best practices CSS and JavaScript accessibility best prac...
0
2020-07-20T10:43:51
https://dev.to/andrewbaisden/accessibility-best-practices-device-testing-and-seo-1fjc
javascript, tutorial, webdev, beginners
## CSS and JavaScript accessibility best practices [CSS and JavaScript accessibility best practices - Learn web development | MDN](https://developer.mozilla.org/en-US/docs/Learn/Accessibility/CSS_and_JavaScript) [An introduction to Web Accessibility - YouTube](https://www.youtube.com/watch?v=9I-DCEa1WhM) [Web Fundamentals | Google Developers](https://developers.google.com/web/fundamentals/) [The A11Y Project](https://a11yproject.com/) * Using rems/ems instead of px so that the font scales in a uniform way for the webpage or app. So if the user was to change the font size for their browser to something smaller or bigger. All of the font on the website would scale in proportion. So it is very good for accessibility and people who have vision problems. The same applies to everything in the box model too like margin and padding. * Using developer browser tools like google lighthouse and Accessibility Developer Tools, to audit for performance, accessibility, progressive web apps, and more * Using buttons for performing actions and anchor tags for leading somewhere * Using aria-label for buttons with icons as it allows screen readers to give an audio representation of what the button is. As people with disabilities might not be able to see the button clearly or at all * Using flex box or css grid for tab order. Because if you use floats it breaks the positioning for tab order and keyboard accessibility which works from left to right. Or right to left if you are using a language like Arabic. * Having an appropriate focused outline colour for focused html elements on a web page. The default colour is blue so if you have a blue button, you could change it to red. Or you could change it to another colour depending on the brand style of your website. ## Device and Browser Testing ### Apple Ecosystem __Macbook__ Use the built in Simulator App for simulating iOS devices Use system preferences > display to scale the display resolution up and down __Lighthouse__ [Lighthouse | Tools for Web Developers | Google Developers](https://developers.google.com/web/tools/lighthouse/) Make sure that its installed first ```bash npm install -g lighthouse # or use yarn: # yarn global add lighthouse ``` Using the Node CLI ```bash lighthouse --view https://www.google.com/ ``` Replace the website address with whatever website you want to test __Mobile Phones__ Use for testing apps running native __Web Browsers__ Use the Inspect Element Use browser developer tools (React and Vue) Use Responsive Design mode and the CSS Grid Layout Inspector in Firefox ### Windows, Android and Linux [Cross Browser Testing Tool. 1000+ Browsers, Mobile, Real IE.](https://www.browserstack.com/#) https://saucelabs.com/ [Cross Browser Testing Tool: 1500+ Real Browsers & Devices](https://crossbrowsertesting.com/) ## Bug and error tracking [LogRocket | Logging and Session Replay for JavaScript Apps](https://logrocket.com) [Sentry | Error Tracking Software — JavaScript, Python, PHP, Ruby, more](https://sentry.io/welcome/) [Error Tracking & Crash Reporting for Software Developers - Rollbar](https://rollbar.com) ## SEO Tools Google Analytics [Google Webmasters – Support, Learn, Connect & Search Console – Google](https://www.google.com/webmasters/#?modal_active=none) [web.dev | web.dev](https://web.dev/) [Bing - Webmaster Tools](https://www.bing.com/toolbox/webmaster) https://www.hotjar.com ## Useful Links [Search Engine Optimization (SEO) Starter Guide - Search Console Help](https://support.google.com/webmasters/answer/7451184?hl=en) [How to set up your website & monitor its search traffic in Google Search Console | 9to5Google](https://9to5google.com/2018/01/30/how-to-setup-and-optimze-for-google-search-console/?pushup=1) [Create your Google Sitemap Online - XML Sitemaps Generator](https://www.xml-sitemaps.com/) [Online Sitemap Generator • XML • HTML • RSS • Google](https://xmlsitemapgenerator.org/sitemap-generator.aspx) __SEO optimisation ideas__ https://en-gb.wordpress.org/plugins/all-in-one-seo-pack/ [Yoast SEO: the #1 WordPress SEO Plugin • Yoast](https://yoast.com/wordpress/plugins/seo/)
andrewbaisden
419,481
Day 20: Code Refactoring
I refactored the code in consuming API's to two functions as a way to separate concerns. One function...
0
2020-08-05T18:10:04
https://dev.to/mtee/day-20-code-refactoring-1m59
100daysofcode, javascript
I refactored the code in [consuming API's](https://dev.to/mtee/consuming-api-s-part-2-1b51) to two functions as a way to separate concerns. One function gets the habits from the database while the other displays the habits on a webpage. ```javascript let getHabits = async function () { try { const response = await axios({ url: 'http://localhost:4000/habittracker/habits', method: 'get' }) displaySavedHabits(response); } catch (err) { console.log(err) } } ``` I'll simply call the `displaySavedHabits()` function inside the `gethabits()` and pass in response as a parameter. ```javascript let displaySavedHabits = function (response) { //code to loop through response data and display on a webpage } ``` Meanwhile whats cooking is a function to delete habits from the webpage. I should have the code working in no time. _10 more days down_🥳🥳 _Day 20_
mtee
422,684
I created the Android logo using CSS and only 1 DIV. What do you think?
The following image was drawn in CSS using only 1 DIV: I created the logo when I was bored and want...
0
2020-08-09T09:09:30
https://dev.to/pandaquests/i-created-the-android-logo-using-css-and-only-1-div-what-do-you-think-5ged
discuss, codenewbie, css, codepen
The following image was drawn in CSS using only 1 DIV: ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/14216ek6p3qabyker7lq.png) I created the logo when I was bored and wanted to challenge myself drawing something with CSS but using only 1 DIV - the minimal amount of HTML element. The source code can be inspected here: https://codepen.io/thadeuszlay/pen/ByRRZK The result of it inspired me to do more of those projects - drawing something in CSS and using only 1 div. Do you have any questions? Let me know
pandaquests
424,883
Ruby on AWS Lambda: Planning & Architecting
This article is part of our Ruby on AWS Lambda blog series. A recent project had us migrating an exis...
0
2020-08-11T17:58:39
https://hint.io/blog/lambda-planning-and-architecture
ruby, aws, serverless, architecture
_This article is part of our Ruby on AWS Lambda blog series. A recent project had us migrating an existing pdf document processing system from Rails Sidekiq to AWS Lambda. The processing includes OCR, creating preview images, splicing the pdf, and more. Moving to Lambda reduced processing time by 300% in some cases; parallelization for the win!_ _This series will serve less as a step-by-step process to get OCR serverless infrastructure up and running and more of a highlight reel of our "Aha!" moments. In part one, we talked about creating an AWS Lambda Layer with Docker. In part two, we'll chat about architecting a serverless app. Check out the other posts in the series:_ - _[Layer Dependencies](/hint/ruby-on-aws-lambda-layer-dependencies-1ooe)_ - _[Package & Ship It!](/hint/ruby-on-aws-lambda-planning-architecting-3foi)_ - _[Integrating with Active Storage](/hint/ruby-on-lambda-integrating-with-activestorage-5b11)_ ## The Problem Rails devs, tell me if you've been here before: you have small units of work that should be processed concurrently, so you reach for Sidekiq. Solved! Well, usually solved. Sidekiq is an amazing tool that we use at Hint, and it solves most concurrency problems. However, a bottleneck is always a possibility. In our case, the document processor we engineered could process a PDF with one page, or 500. But since each page has to be processed and there is no page limit when uploading, it was common to process hundreds of pages. This work took much too time with Sidekiq, even with tens of workers. We wanted to see the same performance whether the PDF a user uploads has 50 pages, or 500. ## The Solution AWS Lambda was a good solution for our performance problem. It allows us to run our workers in parallel independent of the number of pages we are processing. However, Lambda doesn't give you any guidance on _how_ to design a serverless application. You are provided the basic building blocks: a function that calls other functions, and the ability to use any other AWS service. Quite open-ended! Luckily, there are some standard architecture practices that have emerged in the serverless community. We'll be focusing on the most popular strategy: fan-out, fan-in. ### "What do you mean, software architecture?" Glad you asked! Martin Fowler said it best: > When people in the software industry talk about “architecture”, they refer to a hazily defined notion of the most important aspects of the internal design of a software system. When we talk about architecture in the context of Lambda, we'll be touching on function composition, utilizing other AWS services, and how the application communicates with the real world. If you haven't, check out [Martin Fowler's thoughts on software architecture](https://martinfowler.com/architecture/). ## Fan-out, Fan-in The fan-out, fan-in architecture is simple: one function starts `n` number of functions, and when those finish, another function does something with the results. The first function is referred to as the ventilator (or vent). The vent function calls worker functions. Once the worker functions finish, the sink function is called. So, vent -> workers -> sink. For example, let's use a hypothetical 100-page pdf.. The vent function is triggered from an outside application and 100 worker functions are called. Each worker process a single page. The sink function is then invoked when all 100 are done, and we do things with the result. In theory, 1,000,000 pages should take as long as 100, since all the processing is happening in parallel. Let's go into a little bit more detail about the whole process: - User uploads PDF from Rails app - PDF is uploaded to S3 via Active Storage - Vent function is triggered with the file key as an argument - Vent function calls `n` number of worker functions, passing file key as an argument so workers can find the file on S3 - Worker function processes page, stores preview image, collects information about page and stores that in DynamoDB, and a record in DynamoDB that holds the keeps track of the pages left is decreased by one - If the worker is the final worker in the queue, the sink function is called - Sink function collects all page information from DynamoDB and sends results as JSON back to the Rails app [DynamoDB](https://aws.amazon.com/dynamodb/) is a NoSQL database offered by AWS. When using the fan-out, fan-in pattern you must keep track of progress so the sink function can be called when all workers are completed. The nature of serverless means that no state can be held, thus an external, stateful service must be used. In our case, we are using it as a glorified counter. When a worker function finishes, we decrease the records count column (`pages_left`) by one: ```ruby def decrement_pages_left(job_id) db = Aws::DynamoDB::Client.new resp = db.update_item( table_name: "documents-#{ENV['RUBY_ENV']}", key: { job_id: job_id }, update_expression: 'set pages_left = pages_left - :val', expression_attribute_values: { ':val' => 1 }, return_values: 'UPDATED_NEW' ) invoke_sink_function(job_id) if resp[:attributes]['pages_left'] == 0 end ``` Note that the sink function is then called if there are no pages left to process. Easy! For a more in-depth look into the fan-out, fan-in pattern take a look at [this fantastic blog post by Yan Cui](https://theburningmonk.com/2018/04/how-to-do-fan-out-and-fan-in-with-aws-lambda/). ## Knowing what language is better suited for a certain task We initially used Ruby for our vent, worker, and sink functions. However, we hit a bottleneck in the vent function. Invoking hundreds of concurrent network requests (which are IO bound) is not one of Ruby's strong suits. Using any kind of library that takes advantage of CPU cores doesn't gain any advantage because of Lambda's CPU limitations (more on that in the next section). So, what language does Lambda support that has asynchronous IO bound operations out of the box? JavaScript! Now, this isn't a bash on Ruby. All programming languages have their strengths and weaknesses, and a rewrite in a different language should be well researched and thought out beforehand. Luckily for us, we have lots of Ruby _and_ JS experience. Also, the vent function encapsulates very little business logic, so a rewrite would be a good fit if an initial spike proved fruitful. And it did! When processing a 186-page document, the vent function took 30 seconds in Ruby, and 2 seconds in JS. Nailed it! If you experience performance issues on Lambda, make sure to research the problem thoroughly. The cool thing about Lambda is that you can use different languages throughout the application process. If part of the process would perform much better with a different language, try it out! ## CPU/RAM limitations When assigning resources to your Lambda functions, memory is the only configurable option. Why? Well, there is no obvious answer in the UI, and even worse, it's hidden [deep in a FAQ](https://aws.amazon.com/lambda/faqs/). When you choose the amount of memory you want to allocate for a function, you are given proportional CPU power and other resources. What the docs don't tell you, however, is that if you allocate _enough_ memory, you'll be given two cores instead of one. [This Stack Overflow comment](https://stackoverflow.com/a/47582392) has more info. TL;DR: if you are using 1.8GB or more of memory, you get to use two CPU cores, instead of one. Even two cores is not a lot, and that's why asynchronous operations in programming languages that utilize multiple cores don't perform well on Lambda. When architecting a serverless application, it's better to split larger tasks into smaller subtasks, when possible. I hope you learned something new today! Architecting serverless applications come with their own unique set of challenges, but the community has great solutions that have been production-tested for quite some time.
nshoes
425,472
SSIS Integration with existing Kafka Server
We try to Integrate our existing Kafka server to our SSIS services, due we do complex transformation...
0
2020-08-12T11:24:43
https://dev.to/yosafat1997/ssis-integration-with-existing-kafka-server-3p4
help, ssis, kafka
We try to Integrate our existing Kafka server to our SSIS services, due we do complex transformation process to our Kafka messages which cannot meet our expectation for low latency when we use manual Python programming. ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/a0wosmyqxhim7axcejj1.png) The job is to trigger SSIS process when there is new messages in Kafka server. Our message is in JSON format due the Kafka source is Debezium CDC source from our PostgreSQL. SSIS will breakdown the message into several new row and insert it into representative destination tables. As there's no Kafka Connectors to SSIS, so we use scripting task. We use Confluent Client as our backbone for scripting the connectors, as it was also available with Apache Kafka, but we confused how to push the messages directly into SSIS, so we can make our Kafka server as a data source to our SSIS with this script and trigger SSIS process if there's new message come from Kafka. We still new using scripting for Kafka connection in SSIS due lack of example sources.
yosafat1997
425,745
Simplifying DevOps: Live Stream Happening Now
There's a live premiere happening now about simplifying your DevOps with Chuka Ofili, a Google Develo...
0
2020-08-12T17:43:12
https://dev.to/pollock/simplifying-devops-live-stream-happening-now-14b
devops, kubernetes, googlecloud, github
There's a live premiere happening now about simplifying your DevOps with Chuka Ofili, a Google Developer Expert + Gigster Full Stack Engineer + Cloud Architect, who is discussing how to simplify your DevOps stack with skaffold, flux, k8s, docker, github, gitops, slack, and more: https://www.youtube.com/watch?v=vdPOI09polo&feature=em-lsp
pollock
425,942
What's the best documentation you've ever come across?
Can you recall the best piece of documentation that's stuck in your mind? Did it help inspire you to...
0
2020-08-12T22:18:56
https://dev.to/developernationsurvey/what-s-the-best-documentation-you-ve-ever-come-across-3447
discuss, documentation, productivity
--- title: What's the best documentation you've ever come across? published: true description: tags: #discuss #documentation #productivity //cover_image: https://direct_url_to_image.jpg --- Can you recall the best piece of documentation that's stuck in your mind? Did it help inspire you to write better documentation yourself?
developernationsurvey
425,980
Debugging Abstractions: The Benefits of Mindfulness for Software Engineers
It's been a wild week. You and your team have been engaged in an all-out war with the codebase for the past two sprints. There's this new integration with a partner that's close to being shipped, and it promises bountiful revenue and voluminous web traffic...
0
2020-08-12T23:37:57
https://algodaily.com/blog/debugging-abstractions-the-benefits-of-mindfulness-for-software-engineers
career, productivity, codenewbie
--- title: Debugging Abstractions: The Benefits of Mindfulness for Software Engineers published: true description: It's been a wild week. You and your team have been engaged in an all-out war with the codebase for the past two sprints. There's this new integration with a partner that's close to being shipped, and it promises bountiful revenue and voluminous web traffic... tags: career,productivity,codenewbie,discuss cover_image: https://miro.medium.com/max/2560/0*UxR4_Op7AExQz-Oo.png canonical_url: https://algodaily.com/blog/debugging-abstractions-the-benefits-of-mindfulness-for-software-engineers --- _This lesson was originally published at [https://algodaily.com](https://algodaily.com/blog/debugging-abstractions-the-benefits-of-mindfulness-for-software-engineers), where I maintain a technical interview course and write think-pieces for ambitious developers._ ## Code Mode It's been a wild week. You and your team have been engaged in an all-out war with the codebase for the past two sprints. There's this new integration with a partner that's close to being shipped, and it promises bountiful revenue and voluminous web traffic. And you've been working on the part of it that'll seal the deal and let your squad deploy, come Monday morning. You find yourself on the Friday night before launch, 6pm, absolutely fried at your desk. Everyone else on your team already left to attend the company happy hour, or has gone home seeking sanity from work. For the past several hours, you've been tracking down a nasty, horrendous bug that could prevent the feature from shipping next week. But you introduced it. Caught late in the game, with the marketing team eager to deploy, there were no other options. Thankfully, you're close to patching things up. Your thoughts have been a web of abstractions all night, looking something like this: - I've looked at `SuperClass`, but the stack trace is from `ChildClass`. - Alright, so `ChildClass` imports the function from `HelperModule`... - `HelperModule` uses a bunch of functions from `CrazyLibrary`. Let's do a search. Great, `CrazyLibrary` has no documentation. - Wait, did I check out the latest `master` yet? - Oh wait, the error wasn't actually on the server. Let's look at the client. - `HugeReactComponent` is making the call. Maybe the `type` is wrong? - Oh man, it uses `DatabaseModernClientApi`... I don't know `DatabaseModernClientApi`. - Wait no, it's in `MiddlewareClientServer`... <img src="https://miro.medium.com/max/2560/0*UxR4_Op7AExQz-Oo.png" class="img-fluid" /> At 7:30pm, you're sure you've nailed it. It was a silly conditional that got in the way. Boom, problem solved. After merging a PR that switched the broken ternary statement around, off to the happy hour you go. Beaming with pride from merging the bug fix, you walk in, and notice your team chatting with folks from a sister team. You recognize some members of the sister team, but not everyone. You go and try to introduce yourself. > "Hey y'all, what's happening?!" Both your team and the sister team sheepishly smile at you. "Hey man", one of them says, "long day?" You look around, and suddenly notice that some people have startled looks on their faces. Then you realize they had been having a low-key conversation, and that you'd jumped into the conversation at quite the high decibel. > "Yeah, haha", you play it off, "Oh boy, working on the `PartnerIntegrationProject` this week was awful! Whoever wrote `SuperClass` created a complete mess. Must've taken 10 hours away from my life." Everyone in the circle stops smiling. Eric, who wrote that class, nervously chuckles. "Yeah, I guess it could be better, huh?" Oops. Bad move. You feel the energy drain out of the conversation they were having. You stay silent for the next half hour or so, and everyone keeps chatting, but it _feels_ weird. You keep noticing people's expressions and body language. There's some more forced conversation before a few folks excuse themselves. Then everyone disperses. And for the rest of the evening, you can't shake off the feeling that everyone's thinking something about you. That you did something wrong. You get a sense that the energy was off, and blame yourself. But you're not to blame! Everything was probably fine, and no one was judging you. You were just in **code mode**. ## What Happens In Your Brain When You Program? Ask any developer, and "code mode" is a real thing. We seem to be so drawn into our innermost thoughts of `classes`, `modules`, `syntax`, and `systems`-- that we lose track of how to mentally function the rest of the time. Some call it "monkey mind" or restlessness, but we all recognize it. It's the brain on hyperdrive, going 200 miles per hour when the speed limit's about 50. It's the thinking, or rather, _the overthinking_, that is almost always unnecessary. And for reasons unbeknownst, this always tends to happen when we need to deal with other people. <img src="https://i.imgur.com/95NZpPy.png" class="img-fluid" /> Now, that doesn't seem problematic, right? Being stuck in code mode is harmless. So you overthink the occasional small talk session, and can't really pay attention to long films, but is it really harmful? No, not really. But understanding why it happens helps us understand how to make the gear switch a little bit smoother, which is behind my upcoming pitch for meditation. If you're able to leave the programmatic thought patterns behind anytime you'd like, you have greater control over your life. Of course, we want to be sure of our assumptions. After all, the argument for meditation requires a somewhat well-formed paradigm of what's happening when we read and write code. It's important to take into account exactly which thought patterns we "execute" **while** in code mode. ## What's Going On Up There? There was a push in recent years to allow programming to replace the study of a foreign language. Around that time, [Norman Peitek, Janet Siegmund, and a team of researchers](https://par.nsf.gov/servlets/purl/10085745 conducted a study that observed 17 participants in an fMRI scanner) while they were comprehending short source-code snippets. Their key finding was that despite the stereotype of math and logic being the major concern in programming, the brains of the participants showed greater activation of its language centers than expected. Now, this may be confusing to you, as it seemingly contradicts _the idea of code mode_. After all, if the language centers are activated, shouldn't we, as social beings who communicate through the use of language, not be affected by these lingering cognitive thought patterns? This could be so. But if we dig deeper into the results of the sudy, we actually find that the programmer mind is activated more traditionally than the above finding would suggest: > In essence, we found five relevant activation clusters, all in the left hemisphere. The function of the left hemisphere is thought to be for control of the right side of the body, and "is the more academic and logical side of the brain". The right hemisphere is associated with creativity, visual/spatial perception, and emotional management and expression. Because this [has been disputed recently](https://now.northropgrumman.com/the-left-brain-right-brain-myth-is-it-true/), I took a look at what naysayers of the "left-brain, right-brain myth" were saying. It turns out, most of the rejection of this "myth" stems from the fact that _people are not usually left-brain or right-brain dominant_. However, the fact of the matter is, the left hemisphere is **still associated** with logical operations and analytical functions, and the right with more "emotional" or "creative" activities. > In fact, a 2013 University of Utah study on brain lateralization examined the brains of more than 1,000 people and found no evidence for people having a dominant side of the brain. _Even though each side of the brain does more work for certain functions_, such as language being localized on the left and attention on the right, this doesn’t vary by person. All of the study participants, whether they were engineers or musicians, used their entire brain equally, debunking the left-brain right-brain myth. In addition to programming being left hemisphere dominant, there's also a lot going on. The earlier study referenced found that the activated regions while coding found were: 1. Middle frontal gyrus (division of attention, silent word reading, verbal/numeric problem solving) 2. Middle temporal gyrus (categorization) 3. Inferior parietal lobule (verbal/numeric problem solving) 4. Inferior frontal gyrus (verbal/numeric) 5. Inferior frontal gyrus (silent word reading, problem solving) If this sounds like a surprisingly high amount of brain activity merely for _understanding source code_, I would agree. And if it sounds like you'd be surprised if all this happened when trying to sleep or talking to a friend, you'd probably be right. Thus, I'd argue that one should choose to believe that quite a bit is going in mentally when we program, and mostly in the left hemisphere. ## But Isn't It Fun? An interesting note to add is that this kind of intensive brain activity sounds painful in a challenging way, but is actually desirable. Many call it the "flow" state. Courtland Allen and Vincent Woo [talked about it in their interview on IndieHackers](https://www.indiehackers.com/podcast/041-vincent-woo-of-coderpad): Courtland says: > That's funny because it reminds me of the first two years after I moved to San Francisco. I started a startup and I basically just coded for sixteen hours a day, every day for two years, and the problem is that if you're in flow for that long and you don't vary your activities... you don't make new memories, everything just blurs together, so I have a two year block of time in my life where there were zero memories, and I swore that I would never do that again. To which Vincent replies: > That's kind of what I suspected happened to that sixty year old plus guy at Amazon, I think he just sat down to code one day and then he woke up, and he was sixty. I don't know, I think flow is both really seductive and also kind of boring in it's own way. A fascinating take-away of the above conversation is the conflation of two different ideas: `flow` state and `code mode`. From our good friend, [Wikipedia](<https://en.wikipedia.org/wiki/Flow_(psychology)>): > In positive psychology, a flow state, also known colloquially as being in the zone, is the mental state in which a person performing an activity is fully immersed in a feeling of energized focus, full involvement, and enjoyment in the process of the activity. Here, I argue this point, and I want to be succint: `flow` and `code mode` appear to be two sides of the same coin. That specific coin is neurotransmitter-fueled activity, causing us to hone in one problem (or consecutive problems) for an indefinite period of time. However, we generally use the term `flow` to refer to the good parts of it, and I'm using `code mode` as the detrimental aspect. I think we'd all agree that [16 hours spent on something is not good for your health](https://algodaily.com/lessons/solving-the-health-problems-of-software-engineers), mentally or physically. Especially [the art of programming](https://www.amazon.com/gp/product/0321751043/ref=as_li_qf_asin_il_tl?ie=UTF8&tag=algodaily03-20&creative=9325&linkCode=as2&creativeASIN=0321751043&linkId=6fb078bf069b7f8eb648902d5923ab87)-- your back aches, your eyes burn, and you leave the coding session feeling unsatisfied. This is what we want to avoid, and the mental fatigue this imparts on you will carry over to other parts of life. In fact, here's a follow-up passage from the above Wikipedia article on flow state: > The flow state shares many characteristics with hyperfocus. However, hyperfocus is not always described in a positive light. Some examples include spending "too much" time playing video games or watching television and getting side-tracked and pleasurably absorbed by one aspect of an assignment or task to the detriment of the overall assignment. In some cases, hyperfocus can "capture" a person, perhaps causing them to appear unfocused or to start several projects, but complete few. But you may be wondering, does this state really carry over to later activities? Can't we "easily turn off" this abstractions level sort of thinking after we're done with it? Shouldn't the code mode end, and lead to-- say, "happy hour mode"? Turns out, it's not that easy. ## The Stickiness of Code Mode [Patterns of thought stick around](https://www.amazon.com/gp/product/0735211299/ref=as_li_qf_asin_il_tl?ie=UTF8&tag=algodaily03-20&creative=9325&linkCode=as2&creativeASIN=0735211299&linkId=2912aab7823ed87e9bf1364cb6cc28bf). Ever switched schools or jobs, and found yourself en route to the old place? In [Source Code and Cross-Domain Authorship Attribution](https://fahrplan.events.ccc.de/congress/2014/Fahrplan/events/6173.html), the concept of **stylometry** is discussed. Stylometry is a marker of author identity through writing style, and can be used in source code to identify the author of a program. When I first read this paper, it blew my mind, especially this snippet: > Programmers can obfuscate their variable or function names, but not the structures they subconsciously prefer to use or their favorite increment operators. Following this intuition, we create a new feature set that reflects coding style from properties derived from abstract syntax trees. We reach 99% accuracy in attributing 36 authors each with ten files. So essentially you have a "handwriting" in crafting software. Your placement of `if` statements versus ternary statements, your naming conventions, the complexity of your calls, etc.-- they're never pulled from thin air. Rather, you cultivate and inhabit these patterns over time, which is why [we recommend studying problem-solving patterns for technical interviews](https://algodaily.com/curriculum). The patterns also appear to linger in later work. But of course, we cannot assume causation from this. How you think while programming certainly carries over to other times you write code, but we still haven't substantiated concrete evidence that it's sticky in the rest of life. Why does this pattern of thinking remain when we go to happy hour? Unfortunately, there doesn't appear to be research on this exact claim, but the mere existence of articles like [7 Tips On Turning Off Work Mode When You’re Not At Work](https://www.lifehack.org/articles/lifestyle/7-tips-turning-off-work-mode-when-youre-not-work.html) and [Your Company (Not to Mention Your Family) Needs You to Stop Taking Work Home](https://www.entrepreneur.com/article/320748) shows it's a problem that people deal with. [Software engineers are not excluded](https://www.reddit.com/r/cscareerquestions/comments/46q93f/why_am_i_sooo_tired_after_work/): > I just really started my life in the professional world. I am a very active, 24 year-old. I am used to lifting/running 3-5 times a week, maintaining a blog on the weekends, and going out 1-2 nights per week. Since I started the new job, I am coming home DESTROYED. I can't motivate myself to workout, clean my room, or anything. The job itself isn't very stressful, though I am sitting down for long periods of time. Any ideas on whats going on or how to get out of this funk would be most helpful! I won't continue to belabor the point. Clearly, your work as a software engineer has sticky, lingering effects on the rest of your life, especially with regards to patterns of thought-- and _how much_ you think. Those patterns, be they negative or positive, will lead to other thoughts of the same nature and magnitude. Learning to control this mechanism, and not letting it master us will prevent overthinking and the overuse of programmatic paradigms outside of writing code. > “The tools we use have a profound (and devious!) influence on our thinking habits, and, therefore, on our thinking abilities,” said Edsger Dijkstra, of Dijkstra's Algorithm “It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration. The use of COBOL cripples the mind; its teaching should, therefore, be regarded as a criminal offense.” The awkward social interaction presented at the beginning is merely one manifestation of this. The necessary amount of thinking and abstraction-handling to correctly fix a bug is overkill for other situations. Knowing when to, quite literally, get out of our heads, can be tricky. Luckily, there's a tool everyone knows about but probably doesn't practice. ## The Mindful Programmer What’s happening in the brain when meditating? I can't speak for other techniques, but [when you practice mindfulness](https://www.amazon.com/gp/product/1439195463/ref=as_li_qf_asin_il_tl?ie=UTF8&tag=algodaily03-20&creative=9325&linkCode=as2&creativeASIN=1439195463&linkId=e780d5ace55c1b9fb1174d5e2979f493), you're doing one of two things: 1. Simply noticing feelings and thoughts as they come, and more importantly, go away. 2. You're coming back and re-focusing on being aware of the present moment. Originally an ancient Buddhist meditation technique, in recent years mindfulness has evolved into a range of secular therapies and tools for the restless mind. And the term"restless" doesn't need to be chronic-- in fact, challenging software engineering leads to this type of mental chatter, for the mental dialogue we turn on [helps us solve hard problems](https://algodaily.com/lessons/how-to-get-better-at-coding-interviews). The purpose of meditation is to help one see the world more clearly. Programming, I would argue, is the opposite-- there are quite literally abstractions (that is, layers of models) that take us away from real life. ## How I've Benefitted From Meditation As a programmer, I noticed I used to live the beginning scenario all too often. Between work and side projects, I was constantly sucked into a screen, practicing the act of holding onto a million things in my head and ignoring everything in search of that hit of dopamine. I stayed in the mode for hours, even after logging off, overthinking every interaction and situation. I found I had a serious inability to just enjoy the present moment, and let go. Now, if I find myself in that mental position, [I meditate, even if just for a few minutes](https://www.amazon.com/gp/product/B00M9KEFY6/ref=as_li_qf_asin_il_tl?ie=UTF8&tag=algodaily03-20&creative=9325&linkCode=as2&creativeASIN=B00M9KEFY6&linkId=d55d02fff884a87d9a65be8b15918529). It's like a release valve that waves goodbye to the day's work, and moves me onto the next activity. The simple act of focusing on my breath, noticing my environment, and feeling my body appears to release the body's problem-solving tightness. It lets me move beyond the code, the internet, and the world of screens. Because when all is said and done, you might be like Vincent Woo. > I can't do it anymore, I can't program for eight hours anymore, like I tried, I just can't do it anymore. Sources: - https://www.psychologytoday.com/us/blog/brain-wise/201904/the-science-habits - https://www.huffpost.com/entry/scientists-begin-looking-_b_4829981#:~:text=A%20new%20study%20provides%20new,brain%20devoted%20to%20mathematical%20thinking. - https://pdf.sciencedirectassets.com/280203/1-s2.0-S1877050916X00130/1-s2.0-S1877050916311164/main.pdf - https://www.nccih.nih.gov/health/meditation-in-depth#:~:text=However%2C%20in%20a%20second%202013,brain%20areas%20associated%20with%20craving.
jacobjzhang
426,179
MB01 Mybatis Overview
此篇主要讲解一些Mybatis的基础 Mybatis的功能 持久层框架 避免了几乎所有的 JDBC 代码和手动设置参数以及获取结果集的过程 可以使用简单的...
0
2020-08-13T06:03:22
https://dev.to/declair/mb01-mybatis-overview-56i2
learning, mybatis
## 此篇主要讲解一些Mybatis的基础 # Mybatis的功能 - 持久层框架 - 避免了几乎所有的 JDBC 代码和手动设置参数以及获取结果集的过程 - 可以使用简单的 XML 或注解来配置和映射原生信息,将接口和 Java 的实体类映射成数据库中的记录 # 持久层 数据持久化——将程序的数据从瞬时状态(内存)转化到持久状态(存到数据库或IO文件)
declair
426,210
Coding Practice - Counting Valleys (Hacker Rank)
Counting Valleys Problem This is an easy rated problem on Hacker Rank, but I solved it on...
0
2020-08-13T20:28:37
https://www.lindakat.com/blog/cp-counting-valleys
javascript, practice
--- title: Coding Practice - Counting Valleys (Hacker Rank) published: true date: tags: javascript, practice canonical_url: https://www.lindakat.com/blog/cp-counting-valleys --- ## Counting Valleys Problem This is an easy rated problem on Hacker Rank, but I solved it on my first try so I'm fairly excited! All those years of doing [Advent of Code](https://adventofcode.com) has paid off! :) So here's the breakdown of this problem, and my solution. ### The Setup We're supplied with the number of steps someone takes on their hike, and an array that lists if each step is up or down. Their hike always starts and ends at sea level, and we're tasked with figuring out how many valleys (how many times they go down below sea level, and then come back up to sea level) they encounter during the hike. ### My solution To me, the main part is tracking what the person's sea level value is. Then, we just need to count the number of times the sea level value goes from -1 to 0! This is the only time they're coming out of a valley and back to equal. So we can basically read through the array and update the sea level value for each step, and then when it goes from -1 to 0 (which will only happen on an up step), we increase the valley count! Then return the valley count when we finish going through the hike array. ```js /* we have a few provided values: n - total number of steps s - the array of directional steps U - an up step D - a down step */ function countingValleys(n, s) { let seaLevel = 0; let valleys = 0; for (let i = 0; i < n; i++) { if (s[i] === 'U') { seaLevel++; if (seaLevel === 0) { valleys++; } } else if (s[i] === 'D') { seaLevel--; } } return valleys; } ``` Pretty amazed this worked on the first try, in all honesty! lol Let me know if anything doesn't make sense, I'd be happy to walk through this with you! Happy coding, friends!
lindakatcodes
426,298
SEO Part2: Improve User Experience & SEO
This is the final article for the SEO series, in this article, I will provide a few technics about h...
8,276
2020-08-13T10:13:50
https://dev.to/oahehc/seo-part2-improve-user-experience-seo-11cd
seo
<blockquote> This is the final article for the SEO series, in this article, I will provide a few technics about how to improve our website's UX. </blockquote> As I mentioned in the [first article](https://dev.to/oahehc/seo-part0-the-correct-mindset-1l30) of this SEO series, the ultimate goal for the search engine is to figure out which website is best for its users. Therefore, improving the UX not only increase our users' satisfaction but also improve SEO at the same time. To improve the UX of our application, I need to do our own research and try our best to understand the users. But we can also reference other's suggestions to fix some common problems which might harm our user experience. Google spent lots of effort to study what's the most important metrics for a good website. Therefore, let's check what Google has given us and how we can use those metrics and tools to improve the UX. ## Agenda * [Search Signals for Page Experience](#agenda-1) * [Core Web Vitals](#agenda-2) * [Mobile Friendly](#agenda-3) * [Safe Browsing](#agenda-4) * [HTTPS](#agenda-5) * [No Intrusive Interstitials](#agenda-6) * [Links](#agenda-7) * [More Ranking Factors](#agenda-8) ### Search Signals for Page Experience <a name="agenda-1"></a> There is so much information about how the search engine ranking the websites. To make this article more concise, I will focus on the metrics call `Search Signals for Page Experience` which is provided by Google. ![Evaluating page experience for a better web](https://i.imgur.com/0n92Alz.png) ### Core Web Vitals <a name="agenda-2"></a> We all know that performance can affect the UX, but it's not easy to measure the website's performance. This year(2020), Google provides a metric call `Core Web Vitals`, which includes three different facets: ![Core Web Vitals](https://i.imgur.com/YAdUndC.png) - LCP: How fast we provide the content to our users? - FID: How fast our users can start interacting with the website? - CLS: Would the content on the screen reflow when users are using the website? `Core Web Vitals` doesn't cover all the aspects of UX. But it gives us a very clear standard to follow. Moreover, there are tons of tools we can use. 1. [chrome extension](https://chrome.google.com/webstore/detail/web-vitals/ahfhijdlegdabablpippeagghigmibma) If we want to check a single page's metrics, we can install the chrome extension. ![core web vitals extension](https://i.imgur.com/Zomjn4Q.png) 2. Chrome DevTool - lighthouse If we want more detail, `lighthouse` can provide more information that allow us to tackle the problem. _ps. when using `lighthouse` to measure the performance, make sure you are testing the production version and using incognito window_ ![lighthouse-performance](https://i.imgur.com/GgPfr4P.png) 3. [Google search console](https://search.google.com/u/1/search-console/index) If we don't want to check our pages one by one, we can reference the Google search console to see the result for all our pages. ![google search console - web vitals](https://i.imgur.com/msDOe5V.png) If you want to know more about how to optimize `Core Web Vitals`, highly recommend watching this video - [Optimize for Core Web Vitals](https://www.youtube.com/watch?v=AQqFZ5t8uNc) ### Mobile Friendly <a name="agenda-3"></a> From 2020/09, Google will apply all mobile-first indexing on all websites, so even your majority users are using desktop or laptop, you might still have to make sure the website is easy to use on mobile devices. We can use this [tool](https://search.google.com/test/mobile-friendly) provide by Google to check the website's mobile-friendly or not. ![mobile friendly](https://i.imgur.com/ZCcnAdp.png) Again, [Google search console](https://search.google.com/u/1/search-console/index) will keep checking our websites is mobile-friendly or not. ![google search console - mobile friendly](https://i.imgur.com/4nKiZaY.png) To know more about how to optimize the user experience on mobile, check this article for more information - [Mobile-first indexing best practices](https://developers.google.com/search/mobile-sites/mobile-first-indexing) ### Safe Browsing <a name="agenda-4"></a> Obviously, security problems will cause huge damage to our users' experience. And the search engine also avoids providing malicious content to their users. Therefore, we need to fix all the security issues on our website. One thing we need to be extra careful is the content generated by the users. We need to take extra effort to manage those content and make sure there is no malware or deceptive information. If we use the 3rd-party libraries on our website, use [npm](https://docs.npmjs.com/cli/audit) or [yarn](https://classic.yarnpkg.com/en/docs/cli/audit/) audit to address the critical security issues and fix them is also very important. Google search console also warms us when they found security issues on our website, but we should try our best to avoid that happen. ![google search console - security](https://i.imgur.com/IsSNnul.png) ### HTTPS <a name="agenda-5"></a> There are lots of services that can help us host our website through `HTTPS`, so I see no reason why not implement this. We will see a lock icon on the browser is our website is service by `HTTPS` with legit certification. ![https](https://i.imgur.com/vinj0hq.png) Otherwise, it should warm us the site is not secure. ![https-not secure](https://i.imgur.com/aiDZRjd.png) And we can check the Chrome DevTool security tab for more information. ![chrome-security](https://i.imgur.com/h12APaG.png) ### No Intrusive Interstitials <a name="agenda-6"></a> `Interstitials` are web pages displayed before or after an expected content page, which might make content less accessible to the users. Ideally, we should prevent using `Interstitials` on our website. ![No Intrusive Interstitials - bad](https://i.imgur.com/Om7QAnL.png) But there are a few scenarios which are ok to use `Interstitials`. ![No Intrusive Interstitials - good](https://i.imgur.com/IiBD85v.png) ### Links <a name="agenda-7"></a> We already go through all the metrics on the `Search Signals for Page Experience`. There is one more factor I want to raise - `Links`. To measure a website is worth sharing with others, Except testing the website on our own, we can also reference how many people have recommended this website. There are two types of links. 1. inner links: the links are put on our own website. Although we can easily create more links, we should definitely create useful links for our users and prevent harm to the user experience. 2. backlink: the links display on other websites. There are a few methods that can help us increase the `backlink` number. For example, we can make our website easier to share on social media. Be aware that the quality of the `backlink` matter. If the link is from the `BAD website` (paid links or link exchanges..), it might cause a negative impact on our SEO. If you think someone intentionally put the link of your website on the `BAD website`. You can follow this article to [disavow backlinks](https://support.google.com/webmasters/answer/2648487) ### More Ranking Factors <a name="agenda-8"></a> If you think the above metrics are not enough, here is a great article points out many important factors that Google use on their ranking algorithm - [google-ranking-factors-2019](https://sparktoro.com/blog/resources/google-ranking-factors-2019/). ![google-ranking](https://i.imgur.com/ZGyrlLl.png) --- ## Conclusion Thanks for reading this article, I hope this SEO series can help you understand the SEO better and know how to start improving it. If you have any questions or a different idea, please feel free to leave a comment. ## Reference * [Evaluating page experience for a better web](https://webmasters.googleblog.com/2020/05/evaluating-page-experience.html) * [web-vitals](https://web.dev/vitals/) * [Finding more mobile-friendly search results](https://webmasters.googleblog.com/2015/02/finding-more-mobile-friendly-search.html) * [Mobile-first indexing best practices](https://developers.google.com/search/mobile-sites/mobile-first-indexing) * [More Safe Browsing Help for Webmasters](https://webmasters.googleblog.com/2016/09/more-safe-browsing-help-for-webmasters.html) * [Helping users easily access content on mobile](https://webmasters.googleblog.com/2016/08/helping-users-easily-access-content-on.html) * [google-ranking-factors-2019](https://sparktoro.com/blog/resources/google-ranking-factors-2019/) * Cover Image by <a href="https://pixabay.com/users/madartzgraphics-3575871/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=1906465">Darwin Laganzon</a> from <a href="https://pixabay.com/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=1906465">Pixabay</a>
oahehc
426,525
All you need for working with Python 3 on a Mac
To clear up any confusion about a functioning setup to start working with Python 3 on a fresh...
0
2020-08-13T14:25:30
https://medium.com/@martin.breuss/all-you-need-for-working-with-python-3-on-a-mac-c811ac094869
beginnercoding, setup, beginners, python
--- title: All you need for working with Python 3 on a Mac published: true date: 2018-09-08 18:50:16 UTC tags: beginnercoding,setup,beginnersguide,python canonical_url: https://medium.com/@martin.breuss/all-you-need-for-working-with-python-3-on-a-mac-c811ac094869 --- ![](https://cdn-images-1.medium.com/max/1024/1*FyEkUvuwlT7IGHVtmD9sjA.png) To clear up any confusion about a functioning setup to start working with Python 3 on a fresh Mac — here’s a quick (minimal) guide. ### DO #1: download and install Python 3.x.x Go to [the official website](https://www.python.org/downloads/) and download Python from there. Yes — since you’re asking —  **do get the latest version** (the one with the shiny yellow button): ![](https://cdn-images-1.medium.com/max/1024/1*X5oLo0KLz4XZ6YQc9y5psA.png) Execute the installer and step through the required steps… ![](https://cdn-images-1.medium.com/max/549/1*3Q0aCaGwIIZvZjo5lwCSDg.png)<figcaption>(it’s easier than that)</figcaption> And **if you’re on Mavericks (10.9) or above, you’re (nearly) done**. #### >> Really? Proof it! Open your Terminal and verify by typing: ``` python3 --version ``` which should respond to you with something similar to: _Python 3.7.0_ Then type: ``` git --version ``` which should either: - prompt you to install the command-line tools. If so, allow that install (it’ll bring version control to your life!). _This is, btw, the step that completes the “(nearly)” from above._ - or, if it’s already there, it will say something like: _git version 2.15.2 (Apple Git-101.1)_ Finally, you can also ask your patient terminal the following: ``` pip3 --version ``` and it will dutifully respond with a lengthy: _pip 18.0 from /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip (python 3.7)_ And with that you are all set up and ready to dive into **writing code with Python 3** , and **installing whatever package** you may fancy from Python’s rich ecosystem on [pypi.org](http://pypi.org/) using **pip3** ([create a **virtual environment**](https://medium.com/@martin.breuss/virtual-environments-for-python-cc8f18a48c6c) **first**!), and indulge in the reassuring beauty of **version control** with **git**. #### >>> What if your OS is older than 10.9? Update it. It’s free and makes your computer better. If for any reason you can’t update your OS but still want to proceed working with Python 3 and git, then [get Git from here](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git): > A macOS Git installer is maintained and available for download at the Git website, at [http://git-scm.com/download/mac](http://git-scm.com/download/mac). ![](https://cdn-images-1.medium.com/max/1024/0*DseohaM183bB7_Zh) > You made it! Good job! Now, for your enjoyment, here’s a list of steps that are often mentioned in tutorials on how to get started, but IMO they only complicate the basic setup. ### DON’T #1: install Anaconda Anaconda is a great **tool for data analysis** , however, it comes with [a lot of stuff](https://stackoverflow.com/a/42096429/5717580). Anaconda is a full-blown Python _distribution_ (= it’s its own _version_ of Python!), that comes with its own package manager, tons of data science packages pre-installed, and oh — did I mention it also includes _R_?! ### DON’T #2: install homebrew Every second tutorial tells you to install homebrew first, and then use it to get python on your mac. Don’t do it. There’s no need. I personally don’t like cellars very much, and even though I tried to homebrew a couple of years ago (I only drank it for the experience, not the taste ;) that alone can’t win me over for the easily forgettable and potentially already long-forgotten leftovers that homebrew’s _Cellar_ structure induces on my machine. ### DON’T #3: install pip You **don’t have to force-install pip** if you download Python 3 from the official download page. It comes along voluntarily. the [official pip site](https://pip.pypa.io/en/latest/installing/) speaks: > pip is already installed if you are using Python 2 >=2.7.9 or Python 3 >=3.4 downloaded from [python.org](https://www.python.org/) ![](https://cdn-images-1.medium.com/max/1024/1*IauQ9ox4OojpggX1sHwGjA.png) #### +/- useful tutorials - [https://docs.python.org/3/using/mac.html](https://docs.python.org/3/using/mac.html) - [https://itsevans.com/install-pip-osx/](https://itsevans.com/install-pip-osx/) - [https://www.digitalocean.com/community/tutorials/how-to-install-python-3-and-set-up-a-local-programming-environment-on-macos](https://www.digitalocean.com/community/tutorials/how-to-install-python-3-and-set-up-a-local-programming-environment-on-macos) - [https://docs.python-guide.org/starting/install3/osx/](https://docs.python-guide.org/starting/install3/osx/) - [https://www.stuartellis.name/articles/mac-setup/](https://www.stuartellis.name/articles/mac-setup/) - [https://realpython.com/python-first-steps/](https://realpython.com/python-first-steps/) #### Other Resources - [https://pip.pypa.io/en/latest/installing/](https://pip.pypa.io/en/latest/installing/)
datamatin
427,305
How to Use “DEC2HEX Function” in MS Excel 365? – [With Examples]
DEC2HEX Function in Excel: In this article, you will learn how to use DEC2HEX Function in...
0
2020-08-14T11:25:44
https://geekexcel.com/how-to-use-dec2hex-function-in-ms-excel-365-with-examples/
dec2hexfunctioninexc, excelfunctions
--- title: How to Use “DEC2HEX Function” in MS Excel 365? – [With Examples] published: true date: 2020-08-14 06:19:08 UTC tags: DEC2HEXFunctioninExc,ExcelFunctions canonical_url: https://geekexcel.com/how-to-use-dec2hex-function-in-ms-excel-365-with-examples/ --- ## DEC2HEX Function in Excel: In this article, you will learn how to use **DEC2HEX Function in Excel 365** using its basic syntax, explanation, and examples. Let’s see them below!! Get official version of **MS Excel** from the following link: [https://www.microsoft.com/en-in/microsoft-365/excel](https://www.microsoft.com/en-in/microsoft-365/excel) ## Jump To: - [**DEC2HEX – Function Explanation**](#1) - [**Syntax**](#2) - [**Examples**](#3) - [**Verdict**](#4) ## DEC2HEX – Function Explanation: - **DEC2HEX** **Function** is mainly used to **convert the decimal numbers into hexadecimal numbers**. - This function is just opposite to **HEX2DEC Function**. ## Syntax: **=DEC2HEX(number, [places])** ### Argument Description: **Number** – The decimal integer that you want to convert to hexadecimal value. **Places** – It is optional. It is used for padding the output value with leading zeros. If you don’t mention the places, it returns the exact value of the input. ### **Note:** - If either a number or places are non-numeric, it returns **#VALUE!** Error. - If you give a negative number to places, it will show **#NUM!** Error value. - If the input number is less than -549,755,813,888 or greater than 549,755,813,887, it returns **#NUM!** Error. ## Examples: Let’s see some examples to make it clear. ### Example 1: - Refer to the below image. - You can see the input value ( **negative number** ) in the cell **A6 ** and its places value is **2.** - It will return a hexadecimal value in the active cell **C6**. ![DEC2HEX Conversion](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2020/08/1-20.png)<figcaption id="caption-attachment-11619">DEC2HEX Conversion</figcaption> ### Example 2: - If you give a negative number to places, it will show **#NUM!** Error value. - If the input number is less than -549,755,813,888 or greater than 549,755,813,887, it returns **#NUM!** Error. ![Example 2](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2020/08/2-18.png)<figcaption id="caption-attachment-11620">Example 2</figcaption> ### Example 3: - If either a number or places are non-numeric, it returns **#VALUE!** Error. ![Example 3](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2020/08/3-16.png)<figcaption id="caption-attachment-11621">Example 3</figcaption> ## Verdict: In the above article, you can understand the **DEC2HEX Function in Excel 365** with its syntax, explanation, and examples. Leave your **feedback** in the comment section. Thanks for visiting **[Geek Excel.](https://geekexcel.com/)** Keep Learning!! ### Similar Functions: - [**DEC2BIN Function**](https://geekexcel.com/how-to-use-dec2bin-function-in-excel-365-with-examples/) - [**DEC2OCT Function**](https://geekexcel.com/how-to-use-dec2oct-function-in-excel-365-with-examples/) ### Read Also: - [How to Use BIN2DEC Function in Excel 365? (With Examples)](https://geekexcel.com/how-to-use-bin2dec-function-in-excel-365-with-examples/) - [How to Use PHONETIC Function in Microsoft Excel 365?](https://geekexcel.com/how-to-use-phonetic-function-in-microsoft-excel-365/)
excelgeek
427,323
Dependency Injection in Java is easy - Part 3 - Spring Context
This is a series of posts simplifying and exemplifying Dependency Injection in Java.
16,711
2020-08-14T07:36:55
https://dev.to/tomerfi/dependency-injection-in-java-is-easy-part-3-leveraging-with-spring-context-gcc
java, programming, tutorial, code
--- title: Dependency Injection in Java is easy - Part 3 - Spring Context published: true description: This is a series of posts simplifying and exemplifying Dependency Injection in Java. tags: ["java", "programming", "tutorial", "code"] cover_image: https://source.unsplash.com/AaEQmoufHLk series: Dependency Injection in Java is easy --- ## Part 3 - Spring Context This post is part of a multiple-part tutorial. As the heading suggests, this part will focus on Dependency Injection using [Spring Context](https://docs.spring.io/spring-framework/docs/current/spring-framework-reference/core.html). > Note, Spring is so much more than a DI Framework, but this tutorial revolves around *Spring Framework IoC Container*, also known as *Spring Context*.</br> > *Spring Boot* or any other Spring component is outside the scope of this tutorial. You can check out the code for this tutorial part in [Github][0]. ### Background It's advised to start with [Part 1 - A Design Pattern][1], which this part requires. You can skip [Part 2 - Google Guice][2]. If you have read [Part 2][2], you can skip to the [incorporating spring section](#incorporating-spring-context). ### Dependency Injection Frameworks DI Frameworks concept is pretty straightforward; the framework creates and manages our dependencies for us. On one end, we provide the framework instructions for creating our dependencies; on the other, we ask the framework for instances of the dependencies. Comparing multiple frameworks, we'll notice different features, component names, default behaviors, and probably different implementations under the hood. But the gist will be the same: a container that holds our dependencies. Let's explore some similarities between various frameworks: - [Spring's Autowired](https://docs.spring.io/spring/docs/current/spring-framework-reference/core.html#beans-autowired-annotation) and [Guice's Inject](https://github.com/google/guice/wiki/GettingStarted#inject-constructor), both mark a dependency for injection. - [Spring's Bean](https://docs.spring.io/spring/docs/current/spring-framework-reference/core.html#beans-java-bean-annotation) and [Guice's Provides](https://github.com/google/guice/wiki/ProvidesMethods), both incorporate logic for creating a dependency. Not a believer yet :grey_question: Alright, let's throw `C#` in the mix :grey_exclamation: - [Spring's Configuration](https://docs.spring.io/spring/docs/current/spring-framework-reference/core.html#beans-annotation-config), [Guice's Modules](https://github.com/google/guice/wiki/GettingStarted#guice-modules), and [Autofac's Modules](https://autofaccn.readthedocs.io/en/latest/configuration/modules.html), can be used to configure dependencies. - [Guice's Binding](https://github.com/google/guice/wiki/Bindings) and [Autofac's Registration](https://autofaccn.readthedocs.io/en/latest/register/registration.html) are used to configure dependencies with the framework's DSL. We can go on. But the point is made.</br> :sunglasses: Under the hood, DI Frameworks builds factories providing dependencies based on multiple criteria, such as type and name. At the base level, there are three typical scopes for dependencies living in a DI Framework container: - *Eager Singleton*: **one instance** of the dependency will be created **immediately upon the framework's instantiation**; the same instance will be provided for every request. - *Lazy Singleton*: **one instance** of the dependency will be created **only when requested**. Upon its instantiation, the same instance will be provided for every request. - *Non-Singleton*: **A new instance** of the dependency will be provided for every request. There are more scopes, but these are the three most commonly used. Some frameworks offer different scopes than others. Such as *per session*, *per request*, *per dependency*, etc. ### Example App Heads up: The example app next is based on [Part 1 - A Design Pattern][1]; you can skip to the [incorporating spring section](#incorporating-spring-context). ### Mail Collector App Let's build an app pulling emails from both *Gmail* and *Microsoft* leveraging the *Dependency Injection* pattern with *Spring Context*. #### Contracts An *Enum* called `MailSource` for categorizing the email source: ```java public enum MailSource { GMAIL, MICROSOFT; } ``` An abstract class `Mail` for contracting mail objects. ```java public abstract class Mail { public abstract String from(); public abstract String subject(); public abstract MailSource source(); @Override public String toString() { return String.format("Got mail by %s, from %s, with the subject %s", source(), from(), subject()); } } ``` An interface for contracting services responsible for pulling Mail from suppliers, the `MailService`. ```java public interface MailService { List<Mail> getMail(); } ``` And last, an interface for contracting an engine responsible for collecting Mail from multiple services, the `MailEngine`. ```java public interface MailEngine { List<Mail> getAllMail(); } ``` #### Implementations ##### Mail The concrete `Mail` implementations were designed with a *builder pattern* for convenience and immutability.</br> The *Gmail* `Mail` implementation, `GmailImpl`: ```java public final class GmailImpl extends Mail { private final String setFrom; private final String setSubject; private GmailImpl(final String from, final String subject) { setFrom = from; setSubject = subject; } @Override public String from() { return setFrom; } @Override public String subject() { return setSubject; } @Override public MailSource source() { return MailSource.GMAIL; } public static GmailImpl.Builder builder() { return new GmailImpl.Builder(); } public static final class Builder { private String prepFrom; private String prepSubject; public Builder from(final String setFrom) { prepFrom = setFrom; return this; } public Builder subject(final String setSubject) { prepSubject = setSubject; return this; } public GmailImpl build() { requireNonNull(emptyToNull(prepFrom), "from cannot be empty or null"); requireNonNull(emptyToNull(prepSubject), "subject cannot be empty or null"); return new GmailImpl(prepFrom, prepSubject); } } } ``` The *Micsorosft* `Mail` implementation, `MicrosoftImpl`: ```java public final class MicrosoftImpl extends Mail { private final String setFrom; private final String setSubject; private MicrosoftImpl(final String from, final String subject) { setFrom = from; setSubject = subject; } @Override public String from() { return setFrom; } @Override public String subject() { return setSubject; } @Override public MailSource source() { return MailSource.MICROSOFT; } public static MicrosoftImpl.Builder builder() { return new MicrosoftImpl.Builder(); } public static final class Builder { private String prepFrom; private String prepSubject; public Builder from(final String setFrom) { prepFrom = setFrom; return this; } public Builder subject(final String setSubject) { prepSubject = setSubject; return this; } public MicrosoftImpl build() { requireNonNull(emptyToNull(prepFrom), "from cannot be empty or null"); requireNonNull(emptyToNull(prepSubject), "subject cannot be empty or null"); return new MicrosoftImpl(prepFrom, prepSubject); } } } ``` ##### Mail Services The *Gmail* `MailService` implementation: ```java public final class GmailService implements MailService { @Override public List<Mail> getMail() { //This is where the actual Gmail API access goes. //We'll fake a couple of emails instead. var firstFakeMail = GmailImpl.builder() .from("a.cool.friend@gmail.com") .subject("wanna get together and write some code?") .build(); var secondFakeMail = GmailImpl.builder() .from("an.annoying.salesman@some.company.com") .subject("wanna buy some stuff?") .build(); return List.of(firstFakeMail, secondFakeMail); } } ``` The *Microsoft* `MailService` implementation: ```java public final class MicrosoftService implements MailService { @Override public List<Mail> getMail() { //This is where the actual Microsoft API access goes. //We'll fake a couple of emails instead. var firstFakeMail = MicrosoftImpl.builder() .from("my.boss@work.info") .subject("stop writing tutorials and get back to work!") .build(); var secondFakeMail = MicrosoftImpl.builder() .from("next.door.neighbor@kibutz.org") .subject("do you have philips screwdriver?") .build(); return List.of(firstFakeMail, secondFakeMail); } } ``` ##### Mail Engine ```java public final class RobustMailEngine implements MailEngine { private final Set<MailService> mailServices; public RobustMailEngine(final Set<MailService> setMailSerices) { mailServices = setMailSerices; } @Override public List<Mail> getAllMail() { return mailServices.stream().map(MailService::getMail).flatMap(List::stream).collect(toList()); } } ``` #### The Main App This is the app itself, the `MailCollectorApp`: ```java public final class MailCollectorApp { private MailEngine engine; public MailCollectorApp(final MailEngine setEngine) { engine = setEngine; } public String getMail() { var ret = "No mail found."; if (!engine.getAllMail().isEmpty()) { ret = Joiner.on(System.lineSeparator()).join(engine.getAllMail()); } return ret; } public static void main(final String... args) { var gmailService = new GmailService(); var microsoftService = new MicrosoftService(); var engine = new RobustMailEngine(Set.of(gmailService, microsoftService)); var app = new MailCollectorApp(engine); System.out.println(app.getMail()); } } ``` Executing the *main method* will print: ```text Got Mail by GMAIL, from a.cool.friend@gmail.com, with the subject wanna get together and write some code? Got Mail by GMAIL, from an.annoying.salesman@some.company.com, with the subject wanna buy some stuff? Got Mail by MICROSOFT, from my.boss@work.info, with the subject stop writing tutorials and get back to work! Got Mail by MICROSOFT, from next.door.neighbor@kibutz.org, with the subject do you have a star screwdriver? ``` This application uses the *dependency injection design pattern*. The dependencies are currently controlled by the `main` method, so it should be easy to incorporate [Spring Context](https://docs.spring.io/spring-framework/docs/current/spring-framework-reference/core.html). ### Incorporating Spring Context #### Include maven dependency First, let's add this to our *pom.xml* in the *dependencies* section:</br> Note that this version was the latest when this tutorial was written. ```xml <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>5.2.8.RELEASE</version> </dependency> ``` #### Mark Autowired We need to tell *Spring* about the dependencies we want to be injected. But it's only mandatory for *property* and *method* based injections; in our example, we're using *constructor* based injection, so there's no need to annotate with *@Autowierd*. But for this tutorial's sake, we'll use the *@Autowierd* to demonstrate what dependencies we want to be injected. Let's do this for the concrete engine class: ```java public final class RobustMailEngine implements MailEngine { private final Set<MailService> mailServices; @Autowired public RobustMailEngine(final Set<MailService> setMailSerices) { mailServices = setMailSerices; } @Override public List<Mail> getAllMail() { return mailServices.stream().map(MailService::getMail).flatMap(List::stream).collect(toList()); } } ``` And for the app class: ```java public final class MailCollectorApp { private MailEngine engine; @Autowired public MailCollectorApp(final MailEngine setEngine) { engine = setEngine; } public String getMail() { var ret = "No mail found."; if (!engine.getAllMail().isEmpty()) { ret = Joiner.on(System.lineSeparator()).join(engine.getAllMail()); } return ret; } //... } ``` Now, we need to instruct *Spring* on instantiating those dependencies, called *beans* in *spring*'s world. #### Create Beans Let's create a *Spring Configuration Class* for creating beans; multiple approaches exist to achieve that. For instance, using [Spring's Annotation Based Configuration](https://docs.spring.io/spring-framework/docs/current/spring-framework-reference/core.html#beans-annotation-config): ```java @Configuration public class DIConfiguration { @Bean @Scope(BeanDefinition.SCOPE_PROTOTYPE) public Set<MailService> getServices() { return Set.of(new GmailService(), new MicrosoftService()); } @Lazy @Bean public MailEngine getEngine(final Set<MailService> services) { return new RobustMailEngine(services); } } ``` Another approach to creating *beans* in *Spring* is marking classes as *@Component*, which is how to tell *Spring* we want this class as a bean. For instance, let's mark our *app* class as a *Component* so we can later ask *Spring* to instantiate it: ```java @Lazy @Component public final class MailCollectorApp { // ... } ``` This will, of course, be a *Lazy Singleton*. Another approach to configuring *Spring* is using [Spring's XML Based Configuration](https://docs.spring.io/spring/docs/4.2.x/spring-framework-reference/html/xsd-configuration.html): ```xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> <bean id="gmailService" class="info.tomfi.tutorials.mailapp.core.service.GmailService" scope="prototype"/> <bean id="microsoftService" class="info.tomfi.tutorials.mailapp.core.service.MicrosoftService" scope="prototype"/> <bean id="getEngine" class="info.tomfi.tutorials.mailapp.engine.RobustMailEngine" lazy-init="true"> <constructor-arg> <set> <ref bean="gmailService"/> <ref bean="microsoftService"/> </set> </constructor-arg> </bean> <bean id="getMailApp" class="info.tomfi.tutorials.mailapp.MailCollectorApp" lazy-init="true"> <constructor-arg> <ref bean="getEngine"/> </constructor-arg> </bean> </beans> ``` Both options will produce the same dependencies. *Spring*'s default [scope](https://docs.spring.io/spring-framework/docs/current/spring-framework-reference/core.html#beans-factory-scopes) is *Singleton*. This means that the *RobustMailEngine*, combined with the *Lazy* annotation, will be a *Lazy Singleton*, meaning our app will have only one instance of *RobustMailEngine*. On the other end, the *Set* of *GmailService* and *MicrosoftService* will be created as new instances for every object that needs them, as we explicitly configured them as *Prototype*, which is *Non-Singleton*. Note, *RobustMailEngine* is a dependency; it will be injected to whoever requests it, but as we configured earlier, it also needs dependencies for itself (the *Set* of *MailService*).</br> > *Spring* will catch that and inject the set of mail services while instantiating the engine. #### Update the app to use Spring Getting back to our app. Let's update it to work with *Spring*: ```java @Lazy @Component public final class MailCollectorApp { private MailEngine engine; public MailCollectorApp(final MailEngine setEngine) { engine = setEngine; } public String getMail() { var ret = "No mail found."; if (!engine.getAllMail().isEmpty()) { ret = Joiner.on(System.lineSeparator()).join(engine.getAllMail()); } return ret; } public static void main(final String... args) { // try (var container = new ClassPathXmlApplicationContext("spring-beans.xml")) { try (var container = new AnnotationConfigApplicationContext(MailCollectorApp.class, DIConfiguration.class)) { var app = container.getBean(MailCollectorApp.class); System.out.println(app.getMail()); } } } ``` Let's analyze what's going on here... Running the *main* method will create a *Spring* container, the context for all dependencies. As we create it with an instance of both *MailCollectorApp* and *DIConfiguration* classes, the container will have the following dependencies, beans, configured in it: - A *Set* of two *MailService* objects (*GmailService* and *Microsoft Service*). - A *Singleton* instance of *MailEngine* (*RobustMailEngine*). - A *Singleton* instance of *MailCollectorApp*. As configured, both *MailCollectorApp* and *MainEngine* are *Lazy Singletons*, plus, we configured the *Set* of *MailService* as *Prototype*. That means that there's nothing instantiated in *Spring*'s context at this point. The next step, asking the container for an instance of *MailCollectorApp*, will accomplish the following: - *Spring* will pick up the constructor in *MailCollectorApp*, as it's the only constructor. - *Spring* will look in its context for a type *MailEngine* dependency. - It will find the *RobustMailEngine* configured, which is a *Lazy Singleton*. - While trying to instantiate it, it will pick up its constructor and look for a suitable dependency with the type *Set* of *MailService*. - It will find the *Set* of *GoogleService* and *MicrosoftService*, which are *Prototypes*. After preparing the groundwork, *Spring* will: - Create the set after instantiating both *GmailService* and *MicrosoftService*. - Instantiate the *RobustMailEngine* injecting the *Set*. - Instantiate the *MailCollectorApp* injecting the *RobustMailEngine*. We then get our instance *MailCollectorApp* with everything we need, from which we invoke getMail to get all our Mail. That's it, *Spring Context* in a nutshell.</br> :satisfied: Now, Let's test our code. ### Unit Tests I will start by saying that when it comes to unit tests, if possible, I always prefer **not** to use DI Frameworks. Unit tests are about testing small parts, units, of our application. We can avoid the overhead of creating the DI Context. We'll be better off simply instantiating the subject under test manually. On the other end, if we're writing integration, acceptance tests, or any different situation when we might need to test our application end-to-end, well, in that case, a suitable DI Framework could be our best friend. Let's move on to unit tests **with** a DI Framework for demonstration purposes only. Please note that *Spring* creates its instances and doesn't allow outside interference. Nonetheless, we needed to inject mocks instead of the real mail services, maintaining the ability to access them and assert their behavior. We create a separate configuration class for testing *Spring Context*, having it instantiate the mocks for us: ```java @Configuration public class DITestConfiguration { private MailService gmailServiceMock; private MailService microsoftServiceMock; private MailService thirdServiceMock; public DITestConfiguration() { gmailServiceMock = mock(MailService.class); microsoftServiceMock = mock(MailService.class); thirdServiceMock = mock(MailService.class); } @Lazy @Bean public MailEngine getEngine(final Set<MailService> services) { return new RobustMailEngine(Set.of(gmailServiceMock, microsoftServiceMock, thirdServiceMock)); } public MailService getGmailServiceMock() { return gmailServiceMock; } public MailService getMicrosoftServiceMock() { return microsoftServiceMock; } public MailService getThirdServiceMock() { return thirdServiceMock; } } ``` We then use this specific testing configuration for creating our context: ```java public final class MailCollectorAppTest { private MailService gmailServiceMock; private MailService microsoftServiceMock; private MailService thirdServiceMock; private MailCollectorApp sut; private ConfigurableApplicationContext context; private Faker faker; @BeforeEach public void initialize() { faker = new Faker(); context = new AnnotationConfigApplicationContext(MailCollectorApp.class, DITestConfiguration.class); var confWorkAround = context.getBean(DITestConfiguration.class); gmailServiceMock = confWorkAround.getGmailServiceMock(); microsoftServiceMock = confWorkAround.getMicrosoftServiceMock(); thirdServiceMock = confWorkAround.getThirdServiceMock(); sut = context.getBean(MailCollectorApp.class); } @AfterEach public void cleanup() { context.close(); } @Test @DisplayName( "make the services mocks return no mail and validate the return string as 'No mail found'") public void getMail_noMailExists_returnsNoMailFound() { willReturn(emptyList()).given(gmailServiceMock).getMail(); willReturn(emptyList()).given(microsoftServiceMock).getMail(); willReturn(emptyList()).given(thirdServiceMock).getMail(); then(sut.getMail()).isEqualTo("No mail found."); } @Test @DisplayName( "make the services return legitimate mail and validate the return string as expected") public void getMail_foundMail_returnsExpectedString() { var mail1 = GmailImpl.builder() .from(faker.internet().emailAddress()) .subject(faker.lorem().sentence()) .build(); var mail2 = MicrosoftImpl.builder() .from(faker.internet().emailAddress()) .subject(faker.lorem().sentence()) .build(); var mail3 = MicrosoftImpl.builder() .from(faker.internet().emailAddress()) .subject(faker.lorem().sentence()) .build(); willReturn(List.of(mail1)).given(gmailServiceMock).getMail(); willReturn(List.of(mail2, mail3)).given(microsoftServiceMock).getMail(); willReturn(emptyList()).given(thirdServiceMock).getMail(); then(sut.getMail().split(System.lineSeparator())) .containsOnly(mail1.toString(), mail2.toString(), mail3.toString()); } } ``` It's important to emphasize this is **poor practice**; We were better off testing without *Spring*, but this tutorial aims to show how to do so for rare cases where there's no better way. In the code above, we created the container with a *DITestConfiguration* instance instead of a *DIConfiguration* instance, exposing three *getters* to help work around the mock injection issue. We also added a third mail service, demonstrating how easy it is. :grin: The *RobustMailEngine* was not mocked because there was no real reason to do so, but it could have been easily replaced with a mock or a spy. The test class behaved exactly like the main app, except for the services being mocks instead of real objects. [0]: https://github.com/TomerFi/dependency-injection-java-part3-tutorial [1]: https://dev.to/tomerfi/dependency-injection-in-java-is-easy-part-1-a-mear-design-pattern-2l8 [2]: https://dev.to/tomerfi/dependency-injection-in-java-is-easy-part-2-leveraging-with-google-guice-6i4
tomerfi
427,460
Argument time does not exist on multi argument console command
Hello can you help me with this problem?...
0
2020-08-14T11:06:35
https://dev.to/pcmagas/argument-time-does-not-exist-on-multi-argument-console-command-3od8
php, laravel
Hello can you help me with this problem? {% stackoverflow 63411555 %} I try tro make a console with 2 arguments: 1. `time` a single argument one 2. `store_ids` containing multiple values But as you can see I have trouble callimg my command with the required params.
pcmagas
427,542
How to Create a Context Menu in Flutter?
Context Menu's most widely used UI Component in Mobile Development and with Flutter we can build it m...
0
2020-08-14T13:19:46
https://dev.to/irangareddy/how-to-create-a-context-menu-in-flutter-50jg
flutter, mobileappdevelopment, android, ios
Context Menu's most widely used UI Component in Mobile Development and with Flutter we can build it much more easily but, let's look at what is Contextual Menu is? (Contextual/Context referred as same)⁣ ### **What is a Contextual Menu?**⁣ A contextual menu is a type of menu that appears on demand and contains a small set of relevant actions related to a control, an area of the interface, a piece of data in the application, or a view of the application.⁣ ⁣ ### **Let's Build a Context Menu** ![](https://github.com/irangareddy/Flutter-UI-Components-Library/blob/master/Gifs/ContextMenu.gif?raw=true) This is actually what we going to make by the end of this article. Load up your energy and let's get started. ### **Create a List** ```dart const List<String> choices = <String>[ "Item 1", "Item 2", "Item 3", ]; ``` The `choices` are a list of String that represents the items in the Context Menu. ### **Create a Stateful Widget** ```dart class MainScreen extends StatefulWidget { @override _MainScreenState createState() => _MainScreenState(); } class _MainScreenState extends State<MainScreen> { @override Widget build(BuildContext context) { return Container( Text("Just Created a Stateful Widget") ); } } ``` `MainScreen` is a Stateful widget that manages the state of the context menu selection. ### **Add these Variables to _MainScreenState** ```dart final GlobalKey<ScaffoldState> _scaffoldkey = new GlobalKey<ScaffoldState>(); String _selectedChoices; ``` - `_scaffoldKey` is a GlobalKey that provides access to ScaffoldState and this helps identify the state uniquely. - `_selectedChoices` is a String to store the current choice. *`Note: underscore before a variable refers as a private variable in dart`* ### **Adding Context Menu to the MainScreen** ```dart @override Widget build(BuildContext context) { return Scaffold( key: _scaffoldkey, appBar: AppBar( title: Text('Context Menu'), elevation: 0, centerTitle: false, backgroundColor: kPrimaryColor, actions: <Widget>[ PopupMenuButton( onSelected: _select, padding: EdgeInsets.zero, // initialValue: choices[_selection], itemBuilder: (BuildContext context) { return choices.map((String choice) { return PopupMenuItem<String>( value: choice, child: Text(choice), );} ).toList(); }, ) ], ), body: BodyWidget(selection: _selectedChoices), ); } ``` We need to manage three things while adding the Context Menu 1. Assign the `_scaffoldkey` to the `key` property in the Scaffold. 2. Actions in AppBar 3. Body Content in MainScreen ### **Actions in AppBar** `PopupMenuButton` has `itemBuilder` property we use `choices.map` to load each item into `PopupMenuItem` and display the content with `child` property. `value` is the property which will be returned to on selection of the item `PopupMenuButton` has `onSelection` property which gets the choice of the selection from `value` and passes the value to `_select` function. - _select ```dart void _select(String choice) { setState(() { _selectedChoices = choice; }); showSnackBar(choice); } ``` `_select` is a function that will be called from `onSelected` property of the `PopupMenuButton` which stores the choice of the user to a `_selectedChoices` and call's the `snowSnackBar` - showSnackBar ```dart void showSnackBar(String selection) { final snackBarContent = SnackBar( content: Text('Selected: $selection',style: kBodyTextStyle,), action: SnackBarAction( label: 'Undo', textColor: kSecondaryColor, onPressed: () { // Some code to undo the change. }, ), ); _scaffoldkey.currentState.showSnackBar(snackBarContent); } ``` `showSnackBar` is a function that accepts the current `selection` of the context menu an displays the SnackBar over a Scafolld using `_scaffoldkey.currentState.showSnackBar(snackBarContent)` and we can also add more functionality to the SnackBar with `onPressed` property. ### **Body Content in MainScreen** ```dart class BodyWidget extends StatelessWidget { const BodyWidget({ Key key, @required String selection, }) : _selection = selection, super(key: key); final String _selection; @override Widget build(BuildContext context) { return Column( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ _selection != null ? Center(child: Text("Selected: $_selection",style: kBodyTextStyle,),) : Center(child: Text("Welcome to Flutter UI Components Library",style: kBodyTextStyle,),), ], ); } } ``` `BodyWidget` is a StatelessWidget class which accepts the `_selection` of the context menu and displays the current selection of the context menu if `_selection` is null then displays the sample text. ### **Conclusion** Adding Context Menu to the Application gives more flexibility to the user for smaller actions. With simple PopupMenuButton you easily add a Context Menu in a few lines of code. The functions help you add much more functionality to show a SnackBar and changing a state in the body. [GitHub Link](https://github.com/irangareddy/Flutter-UI-Components-Library/blob/master/lib/material/contextMenu.dart) If you like to improve your App Development Skills, even more in Flutter and SwiftUI. Feel free to dm me on [Instagram](https://www.instagram.com/irangareddy/) or tweet to me on [Twitter](https://twitter.com/irangareddy) if you have any additional tips or feedback. Thanks for reading!
irangareddy
427,923
MacBook Pro 16in i7, vs Mac Mini... what software should and should you not have on a MB vs desktop?
Is there software that is better to use on a desktop that, is tough or shouldn’t use on a laptop?
0
2020-08-14T21:21:52
https://dev.to/yobretyo/macbook-pro-16in-i7-vs-mac-mini-what-software-should-and-should-you-not-have-on-a-mb-vs-desktop-102j
react, vue, web, design
Is there software that is better to use on a desktop that, is tough or shouldn’t use on a laptop?
yobretyo
427,968
Custom Select Styles with Pure CSS
This is episode #20 in a series examining modern CSS solutions to problems I've been solving over th...
5,817
2020-08-15T03:12:40
https://moderncss.dev/custom-select-styles-with-pure-css/
tutorial, css, webdev
> _This is episode #20 in a series examining modern CSS solutions to problems I've been solving over the last 13+ years of being a frontend developer. Visit [ModernCSS.dev](https://moderncss.dev) to view the whole series and additional resources_. <!-- [Accessibility, Custom Properties, Forms, Grid, Pseudo Elements, Selectors] --> Modern CSS gives us a range of properties to achieve custom select styles that have a near-identical initial appearance for single, multiple, and disabled `select` elements across the top browsers. A few properties and techniques our solution will use: - `clip-path` to create the custom dropdown arrow - CSS grid layout to align the native select and arrow - custom CSS variables for flexible styling - `em` units for relative sizing --- > **Now available**: my egghead video course [Accessible Cross-Browser CSS Form Styling](https://5t3ph.dev/a11y-forms). You'll learn to take the techniques described in this tutorial to the next level by creating a themable form design system to extend across your projects. ## Common Issues with Native Selects As with all form field types, `<select>` varies across browsers in its initial appearance. From left to right, here is the initial appearance for `<select>` in Firefox, Chrome, and Safari: ![initial native select appearance with no custom styling](https://dev-to-uploads.s3.amazonaws.com/i/s8g71cd7l6rywzrx3js8.png) The differences include box size, font-size, line-height, and most standout is the difference in how the dropdown indicator is styled. Our goal is to create the same initial appearance across these browsers, inclusive of multiple selects, and disabled states. > Note: The dropdown list is still not stylable, so once the `<select>` is opened, it will still pick up the individual browser's styles for the `option` list. This is ok - we can deal with that to retain the free accessibility of a native select! ## Base HTML We'll focus on a single `<select>` to begin. ```html <label for="standard-select">Standard Select</label> <div class="select"> <select id="standard-select"> <option value="Option 1">Option 1</option> <option value="Option 2">Option 2</option> <option value="Option 3">Option 3</option> <option value="Option 4">Option 4</option> <option value="Option 5">Option 5</option> <option value="Option length">Option that has too long of a value to fit</option> </select> </div> ``` The label is not part of our styling exercise, but its included as a general requirement, notably with the `for` attribute having the value of the `id` on the `<select>`. To accomplish our custom styles, we've wrapped the native select in an extra div with class of `select` for simplicity in this tutorial. ## Reset and Remove Inherited Styles As is included in all my tutorials as a modern best practice, we add the following reset first: ```scss *, *::before, *::after { box-sizing: border-box; } ``` Following that, we can begin the rule for the native `select` and apply the following to rest its appearance: ```scss select { // A reset of styles, including removing the default dropdown arrow appearance: none; // Additional resets for further consistency background-color: transparent; border: none; padding: 0 1em 0 0; margin: 0; width: 100%; font-family: inherit; font-size: inherit; cursor: inherit; line-height: inherit; } ``` While most of those are likely familiar, the oddball out is `appearance`. This is an infrequently used property and you'll note that it is not quite where we'd like it for [support](https://caniuse.com/#search=appearance), but what it's primarily providing for us in this instance is the removal of the native browser dropdown arrow. > Note: The CodePen is set up to use [autoprefixer](https://autoprefixer.github.io/) which will add required pre-fixed versions of the `appearance` property. You may need to specifically set this up for your project, or manually add them. My [HTML / Sass Jumpstart](https://5t3ph.github.io/html-sass-jumpstart/) includes autoprefixer as part of the production build. The good news is, we can add one more rule to gain removal of the arrow for lower IE versions if you need it: ```scss select::-ms-expand { display: none; } ``` _This tip found in the excellent article from Filament Group that shows [an alternate method to create select styles](https://www.filamentgroup.com/lab/select-css.html)_. The last part is to remove the default `outline`. Don't worry - we'll add a replacement later on for the `:focus` state! ```scss select { // ...existing styles outline: none; ``` And here's a gif of our progress. You can see there is now zero visual indication that this is a `select` prior to clicking on it: ![demo of interacting with the reset select](https://dev-to-uploads.s3.amazonaws.com/i/d8i63lg16q68v8eyt5ef.gif) ## Custom Select Box Styles First, let's set up some CSS variables. This will allow our select to be flexibly re-colored such as to represent an error state. ```scss :root { --select-border: #777; --select-focus: blue; --select-arrow: var(--select-border); } ``` > **Accessibility note**: As a user interface element, the select border must have a 3:1 contrast or greater against the surrounding surface color. Now it's time to create the custom select styles which we will apply to the our wrapping `div.select`: ```scss .select { width: 100%; min-width: 15ch; max-width: 30ch; border: 1px solid var(--select-border); border-radius: 0.25em; padding: 0.25em 0.5em; font-size: 1.25rem; cursor: pointer; line-height: 1.1; background-color: #fff; background-image: linear-gradient(to top, #f9f9f9, #fff 33%); } ``` First, we set up some width constraints. The `min-width` and `max-width` values are mostly for this demo, and you may choose to drop or alter it for your use case. Then we apply some box model properties, including `border`, `border-radius`, and `padding`. Note the use of the `em` unit which will keep these properties proportional to the set `font-size`. In the reset styles, we set several properties to `inherit`, so here we define those, including `font-size`, `cursor`, and `line-height`. Finally, we supply it background properties, including a gradient for the slightest bit of dimension. If you remove the background properties, the select will be transparent and pick up the page background. This may be desirable, however, be aware and test the effects on contrast. And here's our progress: ![updated select now has a visually apparent box appearance](https://dev-to-uploads.s3.amazonaws.com/i/prn99ajlym5ehflhqia9.png) ### Custom Select Dropdown Arrow For our dropdown arrow, we are going to use one of the most exciting modern CSS properties: `clip-path`. Clip paths let us make all kind of shapes by "clipping" the otherwise square and rectangle shapes we receive as defaults from most elements. I had fun using `clip-path` on [my recent portfolio site redesign](https://thinkdobecreate.com). Prior to `clip-path` having better support, alternative methods included: - `background-image` - typically a png, slightly more modern would be an SVG - an inline SVG as an additional element - the [border trick](https://css-tricks.com/the-shapes-of-css/#triangle-down-shape) to create a triangle SVG may feel like the optimal solution, however when used as a `background-image` it loses the ability to act like an icon in the sense of not being able to alter its properties such as fill color without redefining it entirely. This means we cannot use our CSS custom variable. Placing an SVG inline solves the `fill` color issue, however it means including one more element every time a `<select>` is defined. With `clip-path`, we get a crisp, scalable arrow "graphic" that _feels like_ an SVG but with the benefits of being able to use our custom variable and being contained in the style vs. the HTML markup. To create the arrow, we will define it as an `::after` pseudo-element. ```scss .select::after { content: ""; width: 0.8em; height: 0.5em; background-color: var(--select-arrow); clip-path: polygon(100% 0%, 0 0%, 50% 100%); } ``` The `clip-path` syntax is a little strange, and since it's not really the focus of this article, I recommend the following resources: - Colby Fayock explans the syntax with an example in [this egghead video](https://egghead.io/lessons/css-add-a-cutout-notch-to-an-html-element-with-a-css-polygon-clip-path) - [Clippy](https://bennettfeely.com/clippy/) is an online tool that allows you to select a shape and adjust the points while dynamically generating the `clip-path` CSS If you're following along, you may have noticed the arrow is not appearing despite defining `width` and `height`. When inspected, its found that the `::after` is not actually being allowed it's width. We will resolve this by updating our `.select` to use CSS grid layout. ```scss .select { // ...existing styles display: grid; } ``` This lets the arrow appear by essentially extending it a display value akin to "block". ![clip-path arrow now appears below the native select](https://dev-to-uploads.s3.amazonaws.com/i/ztphtxex4qzjywvowoiv.png) At this stage we can verify that we have indeed created a triangle. To fix the alignment, we'll use my favorite CSS grid hack (old hat to you if you've read a few articles around here!). Old CSS solution: `position: absolute` New CSS solution: A single `grid-template-areas` to contain them all First we'll define our area, then define that the `select` and the `::after` both use it. The name is scoped to the element its created for, and we'll keep it easy by calling it "select": ```scss .select { // ...existing styles grid-template-areas: "select"; } select, .select:after { grid-area: select; } ``` Which gives us an overlap of the arrow above the native select due to stacking context via source order: ![preview of the updated arrow position above the native select](https://dev-to-uploads.s3.amazonaws.com/i/esdzj5jsvmddxefyy9jn.png) We can now use grid properties to finalize the alignment of each element: ```scss .select { // ...existing styles align-items: center; } .select:after { // ...existing styles justify-self: end; } ``` Ta-da! ![finished initial styles for the custom select](https://dev-to-uploads.s3.amazonaws.com/i/na2vayzyanyrfx2gui9c.png) ### `:focus` State Oh yeah - remember how we removed the `outline`? We need to resolve the missing `:focus` state from dropping that. There is an upcoming property we could use called `:focus-within` but it's still best to include a polyfill for it at this time. For this tutorial, we'll use an alternate method that achieves the same result, just a bit heftier. Unfortunately, this means we need to add one more element into the DOM. After the native select element, as the last child within `.select`, add: ```html <span class="focus"></span> ``` Why after? Because since this is a pure CSS solution, placing it after the native select means we can alter it when the `select` is focused by use of the adjacent sibling selector - `+`. This allows us to create the following rule: ```scss select:focus + .focus { position: absolute; top: -1px; left: -1px; right: -1px; bottom: -1px; border: 2px solid var(--select-focus); border-radius: inherit; } ``` You may be wondering why we're back to `position: absolute` after just learning the previous `grid-area` hack. The reason is to avoid recalculating adjustments based on padding. If you try it on your own, you'll see that even setting `width` and `height` to 100% still makes it sit within the padding. The job `position: absolute` does best is matching the size of an element. We're pulling it an extra pixel in each direction to make sure it overlaps the border property. But, we need to make one more addition to `.select` to ensure that it's relative to our select by - well, `position: relative`. ```scss .select { // ...existing styles position: relative; ``` And here's our custom select all together as seen in Chrome: ![gif demo of focusing and selecting an option in the custom select](https://dev-to-uploads.s3.amazonaws.com/i/cykucssuq6909qwrgnk1.gif) ## Multiple Select Selects come in a second flavor, which allows a user to select more than one option. From the HTML perspective, this simply means add the `multiple` attribute, but we'll also add a class to help create style adjustments called `select--multiple`: ```html <label for="multi-select">Multiple Select</label> <div class="select select--multiple"> <select id="multi-select" multiple> <option value="Option 1">Option 1</option> <option value="Option 2">Option 2</option> <option value="Option 3">Option 3</option> <option value="Option 4">Option 4</option> <option value="Option 5">Option 5</option> <option value="Option length">Option that has too long of a value to fit</option> </select> <span class="focus"></span> </div> ``` And looking at it, we can see it's inherited most of our styles favorably, except we don't need the arrow in this view. ![multiple select with inherited styles as previously defined](https://dev-to-uploads.s3.amazonaws.com/i/gs313hkhignewqzgd661.png) This is a quick fix to adjust our selector that defines the arrow. We use `:not()` to exclude our newly defined class: ```scss .select:not(.select--multiple)::after ``` We have a couple of minor adjustments to make for the multiple select, the first is removing padding that was previously added to make room for the arrow: ```scss select[multiple] { padding-right: 0; } ``` By default, options with a long value will overflow visible area and be clipped, but I found that the main browsers allow the wrapping to be overridden if you desire: ```scss select[multiple] option { white-space: normal; } ``` Optionally, we can set a `height` on the select to bring a bit more reliable cross-browser behavior. Through testing this, I learned that Chrome and Firefox will show a partial option, but Safari will completely hide an option that is not able to be fully in view. The height must be set directly on the native select. Given our other styles, the value `6rem` will be able to show 3 options: ```scss select[multiple] { // ...existing styles height: 6rem; } ``` At this point, due to current browser support, we have made as much adjustments as we are able. > The `:selected` state of the `options` is fairly customizable in Chrome, somewhat in Firefox, and not at all in Safari. See the [CodePen demo](#demo) for a section that can be uncommented to preview this. ## `:disabled` Styles While I would advocate for simply not showing disabled controls, we should prepare the styles for that state just to cover our bases. To emphasis the disabled state, we want to apply a greyed background. But since we've set background styles on `.select` and there isn't a `:parent` selector, we need to create one last class to handle for this state: ```scss .select--disabled { cursor: not-allowed; background-color: #eee; background-image: linear-gradient(to top, #ddd, #eee 33%); } ``` Here we've updated the cursor as an extra hint that the field cannot be interacted with, and updated the background values we previously set to be white to now be more grey for the disabled state. This results in the following appearances: ![previous of the disabled state styles for both single and multiple select](https://dev-to-uploads.s3.amazonaws.com/i/iwmnikta0b915i1a0d11.png) ## Demo You can test it for yourself, but here's a preview of the full solution across (from left) the Firefox, Chrome, and Safari: ![final styled selects across the browsers mentioned](https://dev-to-uploads.s3.amazonaws.com/i/ct4v1q5jbxznf02zjiy9.png) {% codepen https://codepen.io/5t3ph/pen/MWyyYNz %}
5t3ph
427,975
Take Initiative.
Please Take initiative ..start something that makes you better, Start something that's can make you,...
0
2020-08-14T23:06:43
https://dev.to/toqeer__abbas/take-initiative-217l
100daysofcode, motivation
Please Take initiative ..start something that makes you better, Start something that's can make you, your life, leave bad habits. What are you thinking right now? Awake and Start Work... ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/5hxvgf2bwtjbeao4x07p.jpeg) #100DaysOfCode
toqeer__abbas
428,112
Github Actions & Telegram Notification
My submission to the GitHub Actions x DEV Hackathon!
0
2020-08-15T06:03:12
https://dev.to/yogiwisesa/github-actions-telegram-notification-5f7
actionshackathon, github, opensource
--- title: Github Actions & Telegram Notification published: true description: My submission to the GitHub Actions x DEV Hackathon! tags: actionshackathon, github, opensource --- [Instructions]: # (To submit to the GitHub Actions x DEV Hackathon, please fill out all sections.) This project is a telegram bot and build with node js and use telegraf as a chatbot framework. ### My Workflow [Note]: # (Make sure to include the name of your GitHub Action and share where it's being used!) Since I need to deploy the project to the VPS and using ssh, I use github actions to automate the process. The actions that I use are: {% github appleboy/ssh-action no-readme %} I use this action to connect to my VPS using SSH then run the deployment command. {% github appleboy/telegram-action no-readme %} After the deployment is complete, this action will notify me via telegram, I prefer to use telegram than the other messaging service. And the repo where I use this workflow is here {% github yogiwisesa/telegram-ambil-ig no-readme %} The workflow ``` name: Deploy Ambil IG on: push: branches: [ master ] jobs: deploy: runs-on: ubuntu-latest steps: - name: Deploy Ambil IG uses: appleboy/ssh-action@v0.1.2 with: host: ${{secrets.SSH_HOST}} username: ${{ secrets.SSH_USERNAME }} password: ${{ secrets.SSH_PASSWORD }} script: | cd ~/repos/folder-name git pull npm install pm2 restart app-name - name: send custom message with args uses: appleboy/telegram-action@master with: to: ${{ secrets.TELEGRAM_TO }} token: ${{ secrets.TELEGRAM_TOKEN }} args: 👨🏻‍💻 User ${{github.actor}} in ${{ github.repository }} repository. Make ${{ github.event_name }}. Job ${{github.job}}. ``` Don't forget to add the secrets to your repository. ### Submission Category: DIY Deployments [Note]: # (Maintainer Must-Haves, DIY Deployments, Interesting IoT, Phone Friendly, or Wacky Wildcards) ### Yaml File or Link to Code [Note]: # (Our markdown editor supports pretty embeds. Try this syntax: `{% github link_to_your_repo %}` to share a GitHub repository) [YAML example](https://github.com/yogiwisesa/telegram-ambil-ig/blob/master/.github/workflows/deploy-ssh.yml) ### Additional Resources / Info {% github appleboy/ssh-action no-readme %} {% github appleboy/telegram-action no-readme %} [Note:] # (Be sure to link to any open source projects that are using your workflow!) [Note]: # (Be sure to include the DEV usernames of your collaborators, if any. ) [Reminder]: # (Submissions are due on September 12th (11:59 PM PDT) and winners will be announced on September 23!)
yogiwisesa
428,191
How to extend Ruby with C++
To extend Ruby with C++ is not that hard as you might think. Within a small project I created a bareb...
0
2020-08-16T08:58:06
https://dev.to/_adrian_e_/extend-ruby-with-c-14mh
ruby, rubygems, cpp, howto
--- title: How to extend Ruby with C++ published: true description: tags: ruby, rubygems, cpp, howto cover_image: https://dev-to-uploads.s3.amazonaws.com/i/zhlk13c5c7l81jdj20id.png --- To extend Ruby with C++ is not that hard as you might think. Within a [small project](https://github.com/addisaden/rbextample) I created a barebone structure to getting started. Here you will find answers for: * What libs do I need? * How can I compile? * And how can I interact with my C++-Class? Let's start the adventure 🤠 # The code First we need something to work with. Well a featureless [Car class](https://github.com/addisaden/rbextample/blob/master/Car.hpp) work for that. The goal is to create and control the car. Well it's really featureless, because you can only give gas or stop it. But hey the car talks when it's born. # The libs The default is [mkmf](https://ruby-doc.org/stdlib-2.7.1/libdoc/mkmf/rdoc/MakeMakefile.html) (epsecially when you use the C-Api). For C++ there is the great gem [rice](https://rubygems.org/gems/rice) which is a great tool to bind a c++ class to ruby. [car_wrapper.cpp](https://github.com/addisaden/rbextample/blob/master/car_wrapper.cpp) ``` // includes goes here extern "C" void Init_car_wrapper() { Data_Type<Car> rb_cCar = define_class<Car>("Car") .define_constructor(Constructor<Car>()) .define_method("gas", &Car::gas) .define_method("stop", &Car::stop); } ``` So you wrap the class and every method into rice methods. To dig deeper you can read the [documentation](https://jasonroelofs.com/rice/) 🙂 # compiling This is really beautiful. Just create a [extconf.rb](https://github.com/addisaden/rbextample/blob/master/extconf.rb) file with the following content: ``` require "mkmf-rice" create_makefile "car_wrapper" ``` Run `ruby extconf.rb` and you get a `Makefile`. Finally run `make` and you get your Ruby-Extension as `car_wrapper.so`. # playground And here you can play with it: ``` [1] pry(main)> require "./car_wrapper" => true [2] pry(main)> mycar = Car.new A new Car is born => #<Car:0x00005557f9db5bb8> [3] pry(main)> mycar.gas(50) => 50 [4] pry(main)> mycar.stop() => 20 [5] pry(main)> mycar.stop() => -10 [6] pry(main)> mycar.stop() => -40 [7] pry(main)> exit Good bye my car... ``` 🥳 have fun 🎉 # Photo credits car: Thanks to `MovienerdDeluxe` - [source](https://de.wikipedia.org/wiki/Datei:K.I.T.T._Nachbau_aus_Deutschland.jpg) ruby-logo: Thanks to `Yukihiro Matsumoto, Ruby Visual Identity Team` - [source](https://www.ruby-lang.org/en/about/logo/)
_adrian_e_
428,468
GSoC'20 with NumFOCUS
Original post - https://www.codingpaths.com/gsoc/gsoc-2020-with-numfocus/ GSoC'20 with NumF...
0
2020-08-15T15:05:03
https://dev.to/sayam753/gsoc-20-with-numfocus-8hd
opensource, github, bayesian
Original post - https://www.codingpaths.com/gsoc/gsoc-2020-with-numfocus/ # GSoC'20 with NumFOCUS I am super excited to say that I have been selected as a Google Summer of Code student by NumFOCUS for PyMC4. I would like to thank my mentors [Thomas Wiecki](https://github.com/twiecki) and [Maxim Kochurov](https://github.com/ferrine) and the entire NumFOCUS community for giving this opportunity. My project is about adding `Variational Inference Interface` to [PyMC4](https://github.com/pymc-devs/pymc4). Variational Inference scales better over larger datasets as compared to the traditional MCMC algorithms. First, I had plans to implement OPVI[^OPVI_paper] framework as done in PyMC3 this summer. But as corrected by my mentor [Maxim Kochurov](https://github.com/ferrine), it would have taken extra time and more debugging because of the difficulty to deal with `symbolic graph manipulations` in [Tensorflow](https://www.tensorflow.org/). Now, the whole plan is to implement two Variational Inference Algorithms - Mean Field ADVI[^ADVI_paper] and Full Rank ADVI[^ADVI_paper] in PyMC4. Mean Field ADVI posits a Spherical Gaussian family and Full Rank ADVI posits a Multivariate Gaussian family to minimize [KL divergence](https://en.wikipedia.org/wiki/Kullback%E2%80%93Leibler_divergence). All in all, I look forward to a great summer. Thank you for reading. :smile: Sayam [^OPVI_paper]: [Operator Variational Inference](https://arxiv.org/abs/1610.09033) Rajesh Ranganath, Jaan Altosaar, Dustin Tran, David M. Blei (2016) [^ADVI_paper]: [Automatic Differentiation Variational Inference](https://arxiv.org/abs/1603.00788) Alp Kucukelbir, Dustin Tran, Rajesh Ranganath, Andrew Gelman, David M. Blei (2016).
sayam753
428,492
Spring boot : Rest project with lomback and logback
A simple spring boot REST example with lomback and logback configuration for logging Pom.xml file &...
0
2020-08-15T15:50:35
https://dev.to/sanjaybsm/spring-boot-rest-project-with-lomback-and-logback-44fc
A simple spring boot REST example with lomback and logback configuration for logging Pom.xml file ```xml <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.3.3.RELEASE</version> <relativePath/> <!-- lookup parent from repository --> </parent> <groupId>com.sanjay.springrest</groupId> <artifactId>spring-rest</artifactId> <version>0.0.1-SNAPSHOT</version> <name>spring-rest</name> <description>Demo project for Spring Boot rest services</description> <properties> <java.version>11</java.version> </properties> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <version>2.3.3.RELEASE</version> </dependency> <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <optional>true</optional> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> <exclusions> <exclusion> <groupId>org.junit.vintage</groupId> <artifactId>junit-vintage-engine</artifactId> </exclusion> </exclusions> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build> </project> ``` Rest Controller class ```java package com.sanjay.springrest.springrest.rest; import com.sanjay.springrest.springrest.model.Users; import com.sanjay.springrest.springrest.service.LoginService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; @Slf4j @RestController @RequestMapping("/users") public class LoginController { @Autowired LoginService loginService; @GetMapping("/all") public ResponseEntity getAllUsers() { log.debug("Inside GetAll users"); return new ResponseEntity(loginService.getAllUsers(), HttpStatus.OK); } @PostMapping() public ResponseEntity addUsers(@RequestBody Users user) { log.debug("Inside add all users"); loginService.addUser(user.getEmail(), user.getPassword()); return new ResponseEntity(HttpStatus.CREATED); } @GetMapping() public ResponseEntity getUser(@RequestParam String email) { log.debug("Inside Get user {}", email); return new ResponseEntity(loginService.getUser(email), HttpStatus.OK); } @DeleteMapping public ResponseEntity deleteUser(@RequestParam("emailId") String email) { log.debug("Delete user {}", email); loginService.deleteUser(email); return new ResponseEntity(HttpStatus.OK); } } ``` Service class ```java package com.sanjay.springrest.springrest.service; import org.springframework.stereotype.Service; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @Service public class LoginService { HashMap<String, String> users = new HashMap<>(); public void addUser(String email, String password) { users.put(email, password); } public void deleteUser(String email) { users.remove(email); } public List<String> getAllUsers() { return new ArrayList<>(users.keySet()); } public String getUser(String email) { return users.get(email); } } ``` Model class with lombock ```java package com.sanjay.springrest.springrest.model; import lombok.Data; import lombok.Getter; import lombok.Setter; @Data public class Users { String email; String password; } ``` logback-spring.xml configuration file ```xml <?xml version="1.0" encoding="UTF-8"?> <configuration> <property name="LOGS" value="./logs" /> <appender name="Console" class="ch.qos.logback.core.ConsoleAppender"> <layout class="ch.qos.logback.classic.PatternLayout"> <Pattern> %black(%d{ISO8601}) %highlight(%-5level) [%blue(%t)] %yellow(%C{1.}): %msg%n%throwable </Pattern> </layout> </appender> <appender name="RollingFile" class="ch.qos.logback.core.rolling.RollingFileAppender"> <file>${LOGS}/spring-boot-logger.log</file> <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> <Pattern>%d %p %C{1.} [%t] %m%n</Pattern> </encoder> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <!-- rollover daily and when the file reaches 10 MegaBytes --> <fileNamePattern>${LOGS}/archived/spring-boot-logger-%d{yyyy-MM-dd}.%i.log </fileNamePattern> <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> <maxFileSize>10MB</maxFileSize> </timeBasedFileNamingAndTriggeringPolicy> </rollingPolicy> </appender> <!-- LOG everything at INFO level --> <root level="info"> <appender-ref ref="RollingFile" /> <appender-ref ref="Console" /> </root> <!-- LOG "com.sanjay*" at TRACE level --> <logger name="com.sanjay" level="trace" additivity="false"> <appender-ref ref="RollingFile" /> <appender-ref ref="Console" /> </logger> </configuration> ``` Project structure ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/nh8b5nvdx9dyndissexx.png) Github link for complete project https://github.com/sanjaybsm/spring-rest
sanjaybsm
428,636
UWP
I've had a lot of experience developing WPF (Windows Presentation Foundation) applications, but this...
0
2020-08-15T22:14:28
https://dev.to/brandonmweaver/uwp-30lo
csharp, dotnet
I've had a lot of experience developing WPF (Windows Presentation Foundation) applications, but this week I decided to learn more about UWP (Universal Windows Platform). I was able to find a free, RESTful API which hosts COVID-19 data at covid19-api.org, and decided to build a statistical application based on the data provided. While I can't confirm the accuracy of the data, the API is extremely easy to use, and it was a perfect foundation to build an application substantial enough for me to dive deeper into UWP. WPF is one of my favorite subsystems for building Windows applications. There's plenty of well-written documentation, and a large community of professionals who consistently provide free resources to learn everything there is to know about the platform. UWP, however, is one of the worst when it comes to documentation, and there's a severe lack of resources available. I'm not entirely surprised by this, as the platform is intended to provide a means of developing applications, which are capable of running on all of Microsoft's operating systems. In other words, there's a specific reason to develop for the UWP platform, which isn't commonly sought after. One of the first issues I encountered, was the inability to bind the properties of an element (in my case, a canvas) to a relative view-model. Two-way binding is available to use in UWP, however, the option to bind one way to source does not exist. What I was attempting to achieve involved graphing lines on a canvas to represent the growth of cases, deaths, and recoveries over the past thirty days. The problem is, I wanted the data representation to scale proportionately to the height and width of the canvas. This would involve tracking the height and width of the canvas from an object within the view-model. Without the option to bind the height and width one way to source, I would either have to represent the data context and canvas of the view in code behind, and respond to an event every time the size of the canvas changed in order to scale the data, or scrap the idea of a dynamic graph all together. There are both free, and paid, third-party options for implementing charts and graphs into a UWP application, although, I was adamant to develop a solution myself. In my attempt to develop a solution, I was introduced to my second issue. While I have leveraged data grids in WPF applications to represent observable collections, I now needed to learn how to display a collection using a custom control. After reading through tons of poor documentation and dozens of hopeless Stack Overflow posts, I realized that I needed an items control to resolve the issue. An items control in WPF and UWP behaves similarly to a container in React.js, where you use a collection of objects as a context for the instantiability of UI elements. Being new to this control, I struggled to override the default styling, and my data was being cascaded down, as if each rendered line existed within a stack panel. In retrospect, I believe using a grid as the items control's template may have resolved this, but I clearly need to practice employing these structures more to gain an understanding of how they operate. In the end, I was able to get the graph working, although, it was a fixed size, looked somewhat hideous, and I resorted to using thirty line elements to render the data in lieu of the items control, so I opted to represent the data through percentages. I'm glad I decided to take on this challenge, as I learned many new techniques that I will be able to apply to my WPF applications and developed a much greater understanding of the UWP platform. I plan to continue on improving this application, and learn much more along the way. For anyone interested in learning how to develop .NET applications, I would strongly suggest avoiding the UWP platform until you are familiar with WPF.
brandonmweaver
428,657
SQL: comandos básicos
Nesse artigo veremos os comandos básicos da linguagem SQL mais utilizados no dia a dia de uma cientis...
0
2020-09-16T11:04:00
https://dev.to/luizabizoni/sql-comandos-basicos-2bc3
sql, database, datascience
Nesse artigo veremos os comandos básicos da linguagem SQL mais utilizados no dia a dia de uma cientista de dados e como utilizá-los. Se você quer entender como funciona um banco de dados relacional, te convido a ler [este outro artigo](https://dev.to/luizabizoni/banco-de-dados-relacional-introducao-24an), no qual expliquei sobre a terminologia utilizada, o conceito ACID, os grupos de comandos da linguagem SQL, as restrições de integridade e as três formas normais. <center><img src="https://dev-to-uploads.s3.amazonaws.com/i/vxyfuugyh3iuqcpnvj2j.png" alt ="Principais comandos SQL"></center> ## SELECT A instrução "SELECT" é utilizada para fazer consultas no banco de dados. Seu resultado é uma cópia do banco de dados com as especificações indicadas. Não há alteração dos dados no banco. A maior parte dos comandos SQL são instruções "SELECT" e normalmente é a primeira palavra da instrução SQL. Ao executar a instrução, o SGBD irá procurar a tabela ou tabelas especificadas, selecionar as colunas escolhidas e as linhas que satisfazem os critérios especificados, classificando ou agrupando estas na ordem indicada. A sintaxe mais básica da instrução "SELECT" é escrita da seguinte forma: ``` SELECT colunas FROM tabela ``` Caso você queira selecionar todas as colunas da tabela indicada, basta utilizar "*" no lugar de "colunas", deste jeito: ``` SELECT * FROM tabela ``` ### Exemplos Imagine que temos uma tabela chamada "Funcionários" que possuí diversas informações sobre os funcionários de uma empresa. Precisamos do nome e sobrenome de todos os funcionários da empresa em ordem alfabética. Para isso selecionaremos todas as linhas das colunas "Nome" e "Sobrenome" da tabela "Funcionários" e utilizaremos a cláusula "ORDER BY" para ordenar a consulta. A sintaxe será: <center><img src="https://dev-to-uploads.s3.amazonaws.com/i/r3he8pk4vyzjgr2ih3p8.png" alt ="Select e Order By"></center> A empresa decide que o reajuste salarial para o próximo ano será de 5% para todos os funcionários e precisamos atualizar a consulta acima incluindo o salário atual e o salário com reajuste para todos os funcionários. Para isso selecionaremos todas as linhas das colunas "Nome" e "Sobrenome" da tabela "Funcionários", como fizemos anteriormente, e também as da coluna "Salário", que renomearemos como "Salário Atual". Para calcular o valor do salário com reajuste multiplicaremos os valores da coluna "Salário" por 1.05 e este campo será renomeado como "Salário Reajustado". A sintaxe, portanto, passará a ser: <center><img src="https://dev-to-uploads.s3.amazonaws.com/i/yvkxhj6p77102hl6hb65.png" alt ="Select e cálculo"></center> Por último, iremos fazer uma nova consulta na qual retorne os nomes dos cargos do departamento de tecnologia da empresa que tenham sido atribuídos a pelo menos 10 funcionários e a quantidade de funcionários com estes cargos. Neste caso, selecionaremos a coluna "Cargo" e faremos a contagem de funcionários com aquele cargo utilizando a função "count" com o parâmetro "Cargo". Utilizamos a cláusula "where" para filtrar apenas os funcionários do departamento de tecnologia e "having" para filtrar apenas os cargos que tenham sido atribuídos a pelo menos 10 funcionários e agrupamos pelo nome do cargo utilizando a cláusula "group by" assim: <center><img src="https://dev-to-uploads.s3.amazonaws.com/i/dwqsysmcaclpwegap4tv.png" alt ="Select, count, where, group by e having"></center> ## INSERT A instrução "INSERT" é o comando para inclusão no banco de dados. Ele é utilizado para adicionar um ou vários registros a uma tabela. A sintaxe mais básica da instrução "INSERT" é escrita da seguinte forma: ``` INSERT INTO tabela (coluna1, coluna2, coluna3) VALUES (valor1, valor2, valor3) --OU INSERT INTO tabela VALUES (valor1, valor2, valor3) ``` ### Exemplos Vamos inserir na tabela "Funcionários" a Maria Sousa, que terá o código identificador "741" e seu salário é R$2500,00. Na primeira sintaxe informamos o nome das colunas que receberão os valores e os valores que serão inseridos na tabela. É importante lembrar que os valores devem estar na mesma ordem das suas respectivas colunas. Na segunda forma não declaramos as colunas. Atente-se para este caso, pois é necessário informar valores para todas as colunas da tabela para que o comando funcione. A sintaxe será: <center><img src="https://dev-to-uploads.s3.amazonaws.com/i/abtykkdqsbo9tjpa7uku.png" alt ="Insert"></center> ## UPDATE A instrução "UPDATE" é o comando utilizado para atualização de registros no banco de dados. A sintaxe mais básica da instrução "UPDATE" é escrita da seguinte forma: ``` UPDATE tabela SET coluna = "novo_valor" WHERE condição ``` ### Exemplos Vamos atualizar na tabela "Funcionários" o sobrenome da Maria para "Souza" e seu salário para R$3500,00. Informamos o nome da tabela que receberá as alterações, as colunas e seus respectivos valores a serem alterados na tabela e a cláusula que impõe a condição de execução do comando é que o "IDFuncionario" seja igual a "741", que é o código identificador da Maria. A sintaxe será: <center><img src="https://dev-to-uploads.s3.amazonaws.com/i/vqahno4ayvxvx5e6xmnw.png" alt ="Update"></center> ## DELETE A instrução "DELETE" é o comando utilizado para apagar registros no banco de dados. A sintaxe mais básica da instrução "DELETE" é escrita da seguinte forma: ``` DELETE FROM tabela WHERE condição ``` ### Exemplo Vamos excluir da tabela "Funcionários" aquele que possuí o código identificador igual a "3084". Para isso informamos que a tabela de onde desejamos deletar o registro é a "Funcionários" e a cláusula que impõe a condição de execução do comando é que o "IDFuncionario" seja igual a "3084". A sintaxe será: <center><img src="https://dev-to-uploads.s3.amazonaws.com/i/bz9x03jfyuia04fs9vxd.png" alt ="Delete"></center> _______________ **REFERÊNCIA**: ELMASRI, Ramez e NAVATHE, Shamkant B. **Sistemas de Banco de Dados**. Pearson Addison Wesley. 6a Edição, 2011. *Este post é um resumo do que aprendi na Unidade 1 da disciplina "Banco de Dados Relacionais e não Relacionais". Esta é ministrada pelo Prof. Henrique Batista da Silva no curso de especialização em Ciência de Dados e Big Data da PUC Minas Virtual.*
luizabizoni
428,701
How to secure your private keys.
Security is key Security in your application should be a large priority for a developer. A...
0
2020-08-15T21:14:48
https://dev.to/terrythreatt/how-to-secure-your-private-keys-45mp
privacy, beginners, ruby, tutorial
# Security is key Security in your application should be a large priority for a developer. Anyone having access to your sensitive information can wreck havoc in your application and possibly your personal information. Even if it is a pet project to learn, It is always good practice to ensure you secure your keys. I will walk through a simple application to demonstrate how to secure your private keys to prevent anyone to publically access your secure information. ## Let's get started: #### Let's create a Rails application. ``` $ rails new blog ``` *This command requires Ruby on Rails to be installed.* [Click here for installation](https://guides.rubyonrails.org/v5.0/getting_started.html) #### Let's navigate to our new app and generate some models, controllers, and views. ``` $ cd blog $ rails generate scaffold post title:string body:text $ rails generate scaffold comment post_id:integer body:text $ rake db:migrate ``` #### Let's add a few gems. ``` // file: blog/Gemfile // Add these into the file ... gem 'dotenv-rails', groups: [:development, :test] gem 'omniauth-google-oauth2' ... ``` dotenv - Popular gem that allows you to hide your private keys. omniauth - Gem that allows you to create authentication in your app. [Click here to get API keys](https://code.google.com/apis/console/) #### Execute gem installation ``` $ bundle $ rails server ``` #### Configure omniauth ``` // Create this file => blog/config/initializers/omniauth.rb // Add this snippet Rails.application.config.middleware.use OmniAuth::Builder do provider :google_oauth2, '123456789', 'Your_Client_Secret' end ``` Notice `provider :google_oauth2, '123456789', 'Your_Client_Secret'`. This is where you can put your secret keys but they wouldn't be very secret here. #### Configure omniauth ``` // Create this file => blog/.env // Add your secret credentials GOOGLE_CLIENT_ID = '123456789' GOOGLE_CLIENT_SECRET = 'Your_Client_Secret' ``` #### Update omniauth ``` // replace you secret keys provider :google_oauth2, ENV[GOOGLE_CLIENT_ID], ENV[GOOGLE_CLIENT_SECRET] ``` Prepending ENV will give you access to the environment key we created for your secret credentials in the .env file. #### Hide your secret file ``` // Locate your gitignore file => blog/.gitignore // Add this snippet # This hides your file from being uploaded to your repository .env ``` Now you are able to rest assured your secret API keys are indeed secret and your application still has access when needed. I hope this helps keep your next project secure. If you enjoyed this article please feel free to follow me. Terry Threatt
terrythreatt
428,711
Recap/ Summary week #33
Every beginning of weekend, I will share a recap of the week and at the same time a summary of my...
0
2020-08-17T11:36:52
http://www.frankysnotes.com/2020/08/recap-summary-week-33.html
devjournal, azure, opensource, showdev
--- title: Recap/ Summary week #33 published: true date: 2020-08-16 13:46:00 UTC tags: devjournal,azure,opensource,showdev canonical_url: http://www.frankysnotes.com/2020/08/recap-summary-week-33.html --- Every beginning of weekend, I will share a recap of the week and at the same time a summary of my streams. Those videos are at least two hour longs, so I thought a short summary to know if topic interest you could be useful. Watch only the summary or relax and enjoy the longer version that up to you! {% youtube ED2f8KIDWDk %} - Coding Python: Deploy Django and Postgres Apps to Azure with VS Code - [c5m.ca/aaa-ep25](http://c5m.ca/aaa-ep25) - Stream 119 - How easy can we make the deployment of TinyBlazorAdmin - [c5m.ca/stream-ep119](http://c5m.ca/stream-ep119) - Stream120 - Celebrating 500 followers and working on the Chatbot - [c5m.ca/stream-ep120](http://c5m.ca/stream-ep120)
fboucheros
428,712
Best YouTube/Twitch channels for web design/development?
Hi everyone! Do you watch or host any YouTube/Twitch channels about web design or development? I'd lo...
0
2020-08-15T21:39:29
https://dev.to/adamgreenough/best-youtube-twitch-channels-for-web-design-development-3816
discuss, webdev, design, watercooler
Hi everyone! Do you watch or host any YouTube/Twitch channels about web design or development? I'd love to discover new ones and compile a quality list. Look forward to hearing your recommendations. :)
adamgreenough
433,132
Adding the Fidel Android SDK to Your Kotlin Android Application
Fidel's real-time transaction monitoring allows you to monitor your customers' purchasing patterns....
0
2020-08-20T12:50:43
https://blog.fidel.uk/adding-the-fidel-android-sdk-to-your-kotlin-android-application/
--- title: Adding the Fidel Android SDK to Your Kotlin Android Application published: true description: tags: canonical_url: https://blog.fidel.uk/adding-the-fidel-android-sdk-to-your-kotlin-android-application/ --- Fidel's real-time transaction monitoring allows you to monitor your customers' purchasing patterns. The first step, is of course, for customers to opt-in their credit cards for tracking at your locations. Dealing with card numbers opens up a requirement of "PCI Compliance." This is the [Payment Card Industry Security Standard](https://en.wikipedia.org/wiki/Payment_Card_Industry_Data_Security_Standard) and requires regular security checks to ensure your systems are adequately protected. If your systems are not PCI compliant, or you'd rather not worry about handling card numbers for real-time transactions, you can use [Fidel's PCI compliant SDKs](https://fidel.uk/docs/mobile-sdks) to link the cards. Thus absolving you of any security requirements for the process. Our documentation walks through the steps to add our SDK to a Java-based Android app, so in this post, we'll use Kotlin to accomplish the same. ### Kotlin Android App To add the SDK to an application, we'll build a basic "Hello World" Android app. In Android Studio, start a new project: <img src="https://blog.fidel.uk/content/images/2020/08/Start_new_project.png" width="600"> Create an empty Activity from the templates: <img src="https://blog.fidel.uk/content/images/2020/08/project_template.png" width="600" alt="Screenshot of Android Studio Activity creation"> Finally, name your application, choose Kotlin as your language, and use API 19 or higher (or use legacy support libraries to support older versions of Android). <img src="https://blog.fidel.uk/content/images/2020/08/project_config.png" width="600" alt="Screenshot of Android Studio Project configuration"> Android Studio will chug for a bit but will create the working "Hello World" application for you. ### Running the 'Hello World' app on your phone. If you are new to Android development, you'll need to [setup ADB debugging](https://developer.android.com/training/basics/firstapp/running-app) on your phone, and connect your phone to your computer. You can then click the "run" button in Android Studio to start the Hello World app: <img src="https://blog.fidel.uk/content/images/2020/08/run_app.png" width="600" alt="start app"> The app will soon start up on your phone: <img src="https://blog.fidel.uk/content/images/2020/08/hw.jpg" width="300" alt="screenshot of app running on phone"> ### Adding in the Fidel SDK Adding the Fidel SDK is easy: while the instructions in the documentation are for Java - Android Studio converts the code into Kotlin for you. Let's walk through all of the steps we need to walk through to add the Fidel Card linking SDK to our sample app. Following the documentation, we need to: 1. Add `maven { url 'https://jitpack.io' }` to our repositories section of our `build.grade` file. 2. Add `implementation 'com.github.FidelLimited:android-sdk:1.3.1'` to the App build.gradle dependencies. 3. Since you've updated your dependencies - sync your project. <img src="https://blog.fidel.uk/content/images/2020/08/project_Sync.png" width="600" alt="Sync Project"> 4. Now we can begin adding in our code to the MainActivity (and update the apiKey with your **public** key and the appropriate `programId`). You can find all this information in your [Fidel Dashboard](https://dashboard.fidel.uk/account?utm_source=blog&utm_medium=aksdk&utm_campaign=dr). ```java Fidel.apiKey = "pk_test_6e94da6f-145a-47db-b56b-f1314e74aa2e" Fidel.programId = "f8d6890e-145d-46ea-b66f-afacfd954580" ``` 5. Now we add the Company name, privacy policy and deletion instructions. I also added the country parameter in this step: ```java Fidel.companyName = "Star Wars Quotes" // default: "Company Name". Fidel.privacyURL = "https://media.giphy.com/media/4560Nv2656Gv0Lvp9F/giphy.gif" // Maximum 60 characters, default: "going to your account settings." Fidel.deleteInstructions = "https://media.giphy.com/media/DrDePYcSohIFG/giphy.gif" Fidel.country = Fidel.Country.UNITED_KINGDOM; ``` 6. Paste in the result card response: ```java override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { super.onActivityResult(requestCode, resultCode, data) if (requestCode == Fidel.FIDEL_LINK_CARD_REQUEST_CODE) { if (data != null && data.hasExtra(Fidel.FIDEL_LINK_CARD_RESULT_CARD)) { val card = data.getParcelableExtra<Parcelable>(Fidel.FIDEL_LINK_CARD_RESULT_CARD) as LinkResult? Log.d("d", "CARD ID = " + card!!.id) } } } ``` 7. Finally, make sure to present the Fidel activity: ```java Fidel.present(this@MainActivity) ``` That is all there is to it - your app is now ready to run! <img src="https://blog.fidel.uk/content/images/2020/08/app.jpg" width="300" alt="Screenshot of Fidel SDK running on an Android"> ## Card Linking on Android There are 2 techniques to link your card with the Android SDK: 1. The traditional way of entering the long card number/expiration date/CCV. Note also that if you have cards stored in Google Pay - your phone will attempt to autofill this for you. This is convenient for your customers, but real cards will fail in the Fidel test environment: <img src="https://blog.fidel.uk/content/images/2020/08/app2.jpg" width="300" alt="Screenshot of Fidel SDK running on an Android with Google Pay autofill"> Entering a test number will sync with the Fidel backend: <img src="https://blog.fidel.uk/content/images/2020/08/app3.jpg" width="300" alt="Manually entering a card number"> <img src="https://blog.fidel.uk/content/images/2020/08/card_sync.png" width="600" alt="immediately synced in Fidel"> 2. The Android SDK also has an optical card reader. By giving the application permission to use the camera: <img src="https://blog.fidel.uk/content/images/2020/08/fidel_OCR.jpg" width="300" alt="card scanning with the camera"> The library in use does not appear to work for test cards found in a Google image search, but it does work with real cards. ### Conclusion With just a few lines of code, you can add the Fidel Android SDK to your application to allow your customers fast and easy sign up into your card linking service. Because the card numbers never touch your system, and the Fidel SDK is entirely PCI compliant, there are no security risks to you or your customers. Let us know how you are using the Android SDK in your app over in the [community forum](https://community.fidel.uk).
dougsillars
428,906
Which font is used in attached vscode image?
A post by Hemant Nigam
0
2020-08-16T06:26:56
https://dev.to/hemantnigam/which-font-is-used-in-attached-vscode-image-4mef
vscode, font, theme
hemantnigam
428,974
Exciting new features to Google Chrome/Web in 2020 | Inside Story
Chrome is the favorite browser among all categories, but what it makes for developers too is the feat...
0
2020-08-16T09:09:45
https://dev.to/amanintech/exciting-new-features-to-google-chrome-web-in-2020-inside-story-1d4h
googlechrome, webdev
Chrome is the favorite browser among all categories, but what it makes for developers too is the features it provides to the developer community. With the statement of bringing always fresh and exciting tools for the developers let’s see what can we expect from chrome in 2020. *They got announced at the [Indian web community lead summit](https://medium.com/@amaintech/indian-web-community-leaders-summit-2019-highlights-cff6130da401) and Google for Mobile conference last week so chances are you won’t find this information anywhere else.* > Chromestatus.com ![](https://cdn-images-1.medium.com/max/2004/1*bgcEdWyU_esD6VeCcZxCkg.png) > Before jumping into the actual features, this information is not too Top Secret. You can visit [chromestatus.com](https://chromestatus.com/feature) to find out the upcoming, in-development and deprecated features. ## New Features ![Kenji Baheux ( Product Manager Google) announcing upcoming features](https://cdn-images-1.medium.com/max/2000/1*vWVLSg6xS7hGg0KAqmUrGQ.png)*Kenji Baheux ( Product Manager Google) announcing upcoming features* ### Portals ![](https://cdn-images-1.medium.com/max/2000/0*X-O9TYo9gsEJ5LVC.png) The goal of portals is to improve navigations, by providing faster and smoother transitions on the web, while maintaining the user’s privacy. This will be an alternate to iframes which can be implemented with similar kinds of tags. <portal id="myPortal" src="https://www.example.com/"></portal> ### Periodic Background Sync Periodic Background Sync provides more background processing power to web apps, by allowing them to schedule a task to be run in the background periodically. The task will usually also require network connectivity and will be used by apps to update state or content. With this, any PWA can run background jobs such as download media/files offline at a specific day time ### Content Indexing The content index allows websites to register offline enabled content in the browser. This allows the browser to improve the offline experience and allow content browsing when the user is offline. This data could also be used to improve on-device search and to augment browsing history. ### Web Bundles ![](https://cdn-images-1.medium.com/max/2000/0*hgN9_2WVSHnd-UnM.png) A [Web Bundle](https://web.dev/web-bundles/) is a file format for encapsulating one or more HTTP resources in a single file. It can include one or more HTML files, JavaScript files, images, or stylesheets. This means you can carry your web project like an executable file and carry it wherever you want. ### Lighthouse Bot ![](https://cdn-images-1.medium.com/max/3408/0*MhAsbN7VkUh0TpE0.png) [Lighthouse](https://developers.google.com/web/tools/lighthouse) is a great tool for auditing site Performance, Accessibility and improving PWA capabilities. With the same capabilities [Lighthouse bot](https://github.com/GoogleChromeLabs/lighthousebot), a CI utility is available to the public that helps in automatically performing audits on every PR. ### Llama Pack [Llama Pack ](https://github.com/GoogleChromeLabs/llama-pack)🦙 is a Command Line Interface (CLI) that helps developers to create a Project for an Android application that launches an existing Progressive Web App (PWA) using a [Trusted Web Activity (TWA)](https://developers.google.com/web/updates/2019/02/using-twa). ## New Chrome API ![](https://cdn-images-1.medium.com/max/2000/1*1RHfAMUrYFF-k4wZre1i5Q.png) ### SMS Reciever API SMS Reciever API solves a major bottleneck in providing seamless web experience when browsing Web Apps. It will allow web apps to get SMS content such as pin authentication which generally took users to another screen something that can force a person to jump between apps remember the pin and comes back and enters. This is already implemented in IOS safari and will be coming to chrome too. ### File System API File Handling provides a way for web applications to declare the ability to handle files with given MIME types and extensions. The web application will receive an event when the user intends to open a file with that web application. It adds more bells too such as multiple file upload, directory upload, file upload progress and drags a drop to area upload like features. ### Contact Picker API This API will allow web apps with secure access to pick contacts from the user‘s phone books. It can be implemented in various uses cases like booking air tickets for someone or filling out forms. It again reduces a lot of hassle of switching between apps and copying contacts and going back to the web app ### Biometric Authentication API Technically, *Support for CTAP2 FIDO devices via the Web Authentication API *will provide advanced security capabilities such as biometric authentication and resident keys (keys stored on the device). ## Deprecating/ ChangingFeatures ![](https://cdn-images-1.medium.com/max/2000/1*t1hcN2K108y_YDLUGz52hw.gif) ### Chrome Apps & Extensions Chrome had a bad reputation for being RAM hungry and consuming a lot of computing power. That was true because, with every tab, every app/extension is consuming its own processor thread resulting in multiplies compute consumption. Google has already removed the app section from the chrome web store and soon will start deprecating them. Similar action to the extensions could be taken. ### Cookies Google is coming up with ever new cookie policy that could change the way we use and store cookies a lot. There is no clear information available on what it will actually do and how it will impact the user, But for sure Google is becoming more concerned with users’ privacy and this could be a major change to its policy. ## Conclusion With the passion of always staying at the top, it looks like Google is doing a pretty amazing job. But it is always dependent on the wide acceptability of the features across other browsers and by developers. Let’s See who wants to go the extra mile to make web even better.
amanintech
429,006
Angular Schematics from 0 to publishing your own library (I)
This is a series of posts, that, if you follow through, will help you acquire the necessary knowledge...
8,345
2020-08-16T18:43:07
https://dev.to/anfibiacreativa/angular-schematics-from-0-to-publishing-your-own-library-i-1b3b
angular, schematics, javascript, node
This is a series of posts, that, if you follow through, will help you acquire the necessary knowledge to write your first schematics and even publish them to npm with ng-add support! Let's start! ## What are schematics, you ask? Schematics are code generators based on descriptive code. Basically, you write some descriptions of what you need and artifacts are generated. Those artifacts could be more code, templates, etc ## What problems can I solve with schematics? With Schematics you will be able to automate a lot of tasks across your projects or organization, allowing you to establish patterns and enforce best practices. You will become more productive and reduce manual tasks, especially those around setup. You won't need to write or read so much documentation! Additionally, if you write a library, you will automate steps to have it working, which makes it more attractive to other developers, that do not need to perform them every time they install it. In short, Schematics help with * structure standardization * enforcing patterns * enforcing best practices * enforcing naming conventions * reuse implementations * automate tasks ## Main advantages of Schematics So schematics as code and other artifacts generators help us setup and configure a new project (or parts of it) in a standardized and automated way, with the following advantages * they're extensible and atomic * they're safe and synchronous * they're implemented in debug mode by default ### Extensible and atomic Schematics are organized in collections and can be combined or chained, but apply transformations in an atomic way ### Safe and synchronous By being atomic, and because of their synchronous nature, Schematics are safe. They're executed one after another, which means errors are easily traceable. ### Default debug mode When executed from the Schematics CLI, they're dry-run, which means that bt default, none of the transformations is really applied to the file system. ## Important vocabulary It is difficult to learn Schematics without being familiar with its API and vocabulary first. Let's start with the vocabulary you will see in repeated over and over when we start the practical lessons. ### Source, or ./files The Tree or source is the VIRTUAL tree composed by a base (files that actually do exist, and are identical to our file system's content) and the staging area (where all transformations are applied), plus some metadata necessary to work with all. For example, when we want our schematic to create new files in our system, we create a `/files` folder at the root of our schematic, with contents identical to what we want to be replicated. We will call this folder `files` simply because by default, the ts compiler will ignore this folder and never transpile it. If we want to call it something else, we need to configure the tsconfig.json file, to know that and exclude that folder. ### Rule{} The Rule object defines a function that takes a tree as an argument and returns a new tree after all the transformations have been applied. We can also use Observables, and return the Observable of a Tree. ### index.ts It's a Rule factory that acts as an entry point for our schematic. You find this file at the root of the schematic. It will always return a Rule. It runs always in a context, that provides the metadata and utilities (ie: logging), necessary. ### SchematicContext This object represents the context in which the schematic runs, as explained before. ### Action Action is the most atomic transformation you can apply to a tree. ### collection.json A set of definitions for one or several schematics, where we find the declarations and values for the description, the path to the factory (or entry point for each schematic), the path to its validation schema (when it has one), and its aliases (when it has them) #### Aliases Aliases are as expected, an alternative string you can all the schematic with, to invoke its execution. Each schematic may have one or several aliases. "aliases": ["alias"] ### schema.json It's the validation schema for the schematic and its descriptor properties. It's optional, but recommended! ### Options Configuration options you can pass to the schematic, for example --name ### Prompts Prompts allow the schematic to interact with the user via the CLI. They're part of the schema.json ## The virtual tree The virtual tree is an abstraction of the file system of the project we want to transform, consisting of the base (the existing files), a staging area where the actions to applied (transformations) are applied, and the metadata derived of the context. ### Important! It is very important to understand that the transformations applied do not really modify the base directly! They're applied to the files in the staging area. To understand this concept, you can think of git, and how every diff, every modification you do of a file, is not really effective unless you commit it to the index. And it does not really affect the upstream unless you push it and merge it! In schematics, it works like this: ![Tansformations applied in the staging area, schematics](https://res.cloudinary.com/anfibiacreativa/image/upload/v1597346727/taller-schematics/Edit__De_0_a_crear_tu_publicar_tu_propia_libreri%CC%81a__con_Angular_Schematics_akcjef.jpg "Transformations applied in the staging area, schematics") ## Actions All transformations applied to a tree are essentially atomic actions. These actions have four main types: CreateFileAction, DeleteFileAction, OverwriteFileAction, RenameFileAction You can find the actual implementation for each action type, exploring [Implementación action.js](node_modules/@angular-devkit/schematics/src/tree/action.js) Until here, a bit of theory. We will dive a bit deeper in the API, in the next post! EDIT: The rest of this series are being published in indepth.dev Please go here to continue reading! -> https://indepth.dev/angular-schematics-from-0-to-publishing-your-own-library-i/
anfibiacreativa
429,490
The Specialist, the Generalist and the realist
Talking about the differences between specialists and generalists
0
2020-08-16T21:20:24
https://dev.to/harrisgeo88/the-specialist-the-generalist-and-the-realist-4hp0
career, growth, development, softwareengineer
--- title: The Specialist, the Generalist and the realist published: true description: Talking about the differences between specialists and generalists tags: - "career" - "growth" - "development" - "softwareengineer" //cover_image: https://www.quickicons.xyz/images/hipster-dog.jpg --- *Originally posted on my blog [harrisgeo.me](https://www.harrisgeo.me/blogs/the-specialist-the-generalist-and-the-realist)* How often do I hear people asking "specialist or generalist? which one is better" like it's some kind of decision we can make overnight? While it is important to have a plan, it is far more important to choose the one that is right for you. How do you find what's right for you? It totally depends on what you like. I will go through a breakdown of each one of them. ## The specialist This is where you go “all in” into a certain niche that you really enjoy. That can be UI, databases, automation, even language specific and pretty much everything. The main characteristic of specialists is that they can go really deep into their field which makes them to be considered as experts. ### Advantages Being a specialist comes with quite a few advantages. If your aim is to be a **freelancer** or a **contractor**, then this is the direction you need to follow. That also comes with **better money** as companies usually pay more for specialised roles. I have seen many specialists on social media being the **gurus** of the topic they are talking about. That is because they have earned the trust of their followers and their opinions are really **taken seriously**. ### Disadvantages Specialists usually have an "expiry date". **(whoa I didn't mean to offend anyone! please let me explain myself first!)**. If for example someone is an expert on React and in a few years from now React disappears, then it is going to be tough for this person to move on. I have seen that a lot with developers coming from older programming languages. Companies prefer generalists as they say "they can do the work a specialist does". Even though companies that operate like that are a red flag whether you are a generalist or a specialist, sadly there are a lot of them out there. I have seen specialists using latest tech at a very early stage because it looks very cool according to this guy on Twitter. I know that library x looked very promising when it was in version 0.1 when we installed it 2 years ago but that was also the time of the last commit. ## The generalist If you like technology and you care about seeing the picture then probably that direction is for you. Generalists are the developers who have a wide range of knowledge and have an opinion on many fields. They can create an API which reads data from a Database, make the UI that reads from it and renders them and finally put them into a Docker container and ship them to production. For that reason it is more common to find them in permanent positions such as team leads, principal engineers, heads of engineering etc ### Advantages Generalists deal with **several technologies** here and there which makes it common for them to know how to work with a few **different languages**. That makes it easy for them to find **new jobs** or even jump to different fields and not worry about the moment React is no longer cool. At the same time having a wide variety of stuff to deal with makes the job a lot **less boring** as the languages / tech can be totally different from one job to another. Generalists are usually the ones that connect all the different pieces of software together in order to make entire applications work. That makes them really important members of a team as they basically are the experts of how the system work as a whole. ### Disadvantages The first one I can talk about is that because of the lack of specialisation, money is not as good as the ones of specialists. Like mentioned earlier, companies pay more for specialised knowledge. That can be a downer for many people who chose to go to that direction. Becoming a generalist is quite demotivating to start with as there's tons of stuff to study. Shipping systems requires knowledge on many different fields and topics which means that continuous learning is an absolute requirement for that role (I personally think of that as a positive point but can be quite complex for beginners). In many cases generalists can appear not to have big depth of knowledge which can be a dealbreaker in interviews. They are sometimes characterised as "jack of all trades, master of none" which does not sound like the best way to describe yourself. ## Summary Again being either of these 2 is neither a bad nor a good thing. It is totally dependent on the path you want to follow. I have worked with some really successful people that have switched over from one to the other. A really interesting term I have heard is "jack of all trades, master of few". Thankfully in the majority of the companies with structured engineering teams both of them exist. Even better, they really like each other. So many times I have heard one saying "thankfully we have x who is a generalist / specialist and deals with the stuff I do not want to deal with" 😂
harrisgeo88
429,927
How does web design help improve your business?
Here I clarified Web Designing is useful to your organization. I've got a good deal of expertise. I...
0
2020-08-17T08:16:56
https://dev.to/propelguru/how-does-web-design-help-improve-your-business-3l63
webdev
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/4glnri4s817pq3y8p1gt.jpg) Here I clarified Web Designing is useful to your organization. I've got a good deal of expertise. I've written a thorough review of this article. In the event that you would like a thorough explanation check it out. **1. Boost your visibility in consumers of tablet computers and devices that are cellular.** The utilization of the proliferation of devices and tablet computers and the internet are the driving forces of the development. Usually, users have been redirected to a particular website for their device (eg mobile version of the internet ), however a [responsive design](https://www.propelguru.com/website-development/) today makes it possible for the site to be looked at on many devices. It's anticipated that the earnings of pills exceed 100 MM. For this reason, the layout is currently more significant for those that wish to maximize their content, this season. **2. Boost conversion ratio and sales** Another of the advantages of responsive layout is that the improvement that happens in the consumer's experience because it isn't essential to divert it into a cellular version and the way regular style sheets (CSS) are used between different apparatus, a more graphic layout and the picture is perceived coherent and unified. Because the consumer is knowledgeable about the navigation of the internet in various devices this balancing has a positive influence. **3. Analysis and reports that are merged** Possessing a website that is responsive means that you need to keep tabs on your customers' conversion funnels, avenues, and redirects between your sites. Web analytics tools like Google Analytics are optimized to handle site reports and devices with the layout. **4. Boost your visibility** Design enables you to handle your site with hypertext links. This allows us to concentrate on dissemination and keep a search engine optimization strategy that is consolidated. Search engine optimization campaigns can be costly and time-intensive, but using a strategy for all apparatus of your efforts is concentrated using a layout. Content is essential for SEO, the top quality content created enhances the positioning of your page in search engines. Together with the layout, the necessity is averted and there are chances. Additionally, Google cites that mobile-optimized and reactive websites are currently getting a position in search results. **5. Price savings and time at the development** Among the benefits of choosing a layout is that it requires significantly less time than if you make a version. Needing to test a number of sites increases the costs of maintenance, support, and growth. Since the designs optimized and are reused it's possible to use conventional testing methods. **6. Cost and time savings in site management** A website's managing simplifies the actions of management and material management. Additionally, one interface for management can be optimized for the templates or the managing of their information. **7. Boost the surfing experience** Reactive design permits you to deliver excellent articles into your own community via different apparatus, HTML5's offline browsing capabilities permit the site to be readily available" on the move". The number of mobiles and tablets that HTML5 permits are increasing. Each time more articles are absorbed, newsletters... from HTML5 hybrid applications with no online connection.
propelguru
663,869
How to Choose the Right PHP Development Company?
PHP is universally recognized because of its high performance but all those features are brought into...
0
2021-04-13T06:25:42
https://dev.to/christophers993/how-to-choose-the-right-php-development-company-22dk
PHP is universally recognized because of its high performance but all those features are brought into an application only with the help of a well-versed PHP development company. PHP itself is a treasure trove and the company you are hiring can extract good things out of it for your website. [Finding a good PHP Development company](https://www.sparxitsolutions.com/php-development.shtml) is not as easy as you think it to be. After all, it is about your idea, your project. Your idea is your intangible property and you just can't take the risk by sharing it with someone who is not responsible or trustworthy. PHP has been in existence for a long time, so there are innumerable companies available to serve you. What is more important is to find a compatible company. To navigate the way to it I am writing down a list of points following which you will be able to find out the best of the best PHP development companies. Points to look for in a PHP development company before hiring- Experience and good market reputation Experience and reputation are those assets of a company that can only be earned from sheer hard work and consistent good work. If you are hiring a well-experienced team of PHP developers, you can obtain a prompt solution for creating astonishing PHP development projects. Also, ask them questions beyond their success stories. Consult about tools and frameworks You should check the tools they are currently using. With this, you will be able to know how polished they are to use them for your project. You can ask about your specification and know the appropriate tool. Know whether they are well acquainted with tools like XAMPP, PhpED, etc. Ask them which tool they use for debugging, testing, and security. Customer services Robust customer service is mandatory for a good and hasslefree partnership. Some companies are available round the clock to resolve your queries. They give you frequent updates regarding the development process. Choose partners who are zealous to let you know the nitty-gritty of daily progress and also strive to resolve your doubts. Pricing As an entrepreneur, quality is your vulnerable point, but you can't pay an enormous amount for that. A good company is one that delivers good work in an optimum budget. Out of your chosen companies discuss the cost and then analyze judiciously. Know their technical prowess I am writing this point explicitly because it is imperative to know their technical abilities. You will be able to deduce whether they will be able to grasp your idea and make a tailor-made website for you not. Which tool in PHP is their strength or they are comfortable with all the latest as well as older versions. I'm very certain that you will get the desired development company after following the above-written points. Note that you may find many companies just by searching on google but availing of PHP development services from a good company is something that matters. In Fact, that's the only thing that matters for the success of your project.
christophers993
448,603
How to be an effective mentor?
We get a good sleep if we are satisfied with the work that we have done throughout a day. As a softwa...
0
2020-09-06T17:38:24
https://dev.to/maulik/how-to-be-an-effective-mentor-2876
mentor, mentee, leadership, webdev
We get a good sleep if we are satisfied with the work that we have done throughout a day. As a software developer, coding and attending meetings becomes our daily job. At the initial level, it's appealing but in the long run, you lose something, and that something is the satisfaction. So I found a technique to tackle that which is **Mentoring**. > They say "knowledge increases by sharing" and I say, they are right. Who does not want to do this noble work by sharing his/her knowledge which gives the most important thing to you => Satisfaction! For the above-mentioned reasons, I chose to be a mentor and took up the responsibility. So here I am, writing a blog to share the key points on how to become a very effective mentor. **Know your mentee/s** * This common point is very important for both a mentee and a mentor, it makes both confident to open up and ask or suggest certain things. If you are interested in how you can make a good relation with your coworker then you should read my [previous blog](https://dev.to/maulik/how-to-get-along-with-coworkers-30h1). **Take interest** * It's always good if one gets a mentor who is interested in mentoring him/her. Take a little interest and the respect you will get by your mentee will automatically boost your interest. **Be accountable** * Be available at the scheduled time, check assignments of your mentee, and give the feedback and suggestion and listen to your mentee carefully. **Constructive criticism** * Give them the actual feedback but deliver it in a way that it does not break his/her confidence but boost their thinking power. **Give freedom** * Don't tell your mentee everything, let him/her make a decision, and then you can have a discussion over it, let him/her make mistakes. Let him/her stand again. **Let your mentee go beyond limits** * As a mentor, your task is not just to make your mentee project ready but also to make him/her realize that there is no boundary of learning and he/she can and should go the extra mile. > A mentor can make a significant difference in one's career and being one can also be a valuable experience. Feel free to share your suggestions in the comment
maulik
453,869
Any tips for entry level developers trying to land a full time position in 2020?
It's been well over 4 months into the job search process. I've changed my strategy from filling out a...
0
2020-09-12T00:36:47
https://dev.to/irisjitomo/any-tips-for-entry-level-developers-trying-to-land-a-full-time-position-in-2020-3a03
react, javascript, webdev
It's been well over 4 months into the job search process. I've changed my strategy from filling out applications solely, reaching out to people on linkedIn, reaching out to employees with the title of Recruiter, Talent, Manager. No luck as of yet, hoping to get some insight on some strategies that some of you have done.
irisjitomo
465,793
Learn at Local Hack Day: Learn!
Major League Hacking is excited to invite hackers from around the world to participate in Local Hack...
0
2020-09-25T15:46:04
https://dev.to/emilyakers/learn-at-local-hack-day-learn-32bf
majorleaguehacking, mlh, localhackday
Major League Hacking is excited to invite hackers from around the world to participate in Local Hack Day: Learn, a day-long conference full of keynotes and workshops with a week of workshops leading up to it. Earn limited-edition hacker swag by forming a Guild with your friends! Sign up now! localhackday.mlh.io/learn
emilyakers
467,198
Slack Clone with React | Semantic UI | GraphQL | PostgresSQL (PART 7)
In part 6 of this series, we set up the apollo client along with the folder structure. However, since...
0
2020-09-27T17:31:02
https://dev.to/ajeasmith/slack-clone-with-react-semantic-ui-graphql-postgressql-part-7-5439
react, webdev, tutorial, postgres
In part 6 of this series, we set up the apollo client along with the folder structure. However, since I have changed my folder structure and routes a little bit, so let's correct those before diving into Register and Login UI with Semantic UI. ## Refactor Folder Structure ![Screen Shot 2020-09-27 at 12.36.35 PM.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1601224615006/VZ4YfinFf.png) as you can see, I renamed `Home.js` to `Slack.js`. It is where our slack app will be (just as hello world text inside). - Private folder will have our private routes (will create later) - styled folder will have our styled-components (will create later) **Inside our `App.js` file now looks like this. ** ``` import React from "react"; import { BrowserRouter as Router, Switch, Route } from "react-router-dom"; import Login from "./components/auth/Login"; import Register from "./components/auth/Register"; import Slack from "./Slack"; function App() { return ( <div className="App"> <Router> <Switch> <Route exact path="/" component={Slack} /> <Route path="/login" component={Login} /> <Route path="/register" component={Register} /> </Switch> </Router> </div> ); } export default App; ``` It is what it will look like for now until we get further in the series. ## Register Page with Semantic UI Inside our `Register.js` file ``` import React from "react"; import { Form, Header, Button } from "semantic-ui-react"; import { Link } from "react-router-dom"; import { Message } from "semantic-ui-react"; import "./auth.css"; const Register = () => { return ( <div className="wrapper"> <Header as="h2" textAlign="center"> Join Slack{" "} <span> <i className="fab fa-slack" style={{ color: "#723975" }}></i> </span> </Header> <Form className="auth_form" size="large" > <Form.Group widths="equal"> <Form.Input name="username" label="Username" type="text" placeholder="Username" /> {/* END OF USERNAME FIELD */} <Form.Input name="email" label="Email" type="email" placeholder="Email" /> {/* END OF EMIAL FIELD */} <Form.Input type="password" name="password" label="Password" placeholder="Password" /> {/* END OF PASSWORD FIELD */} </Form.Group> <Button type="submit" formNoValidate style={{ width: "100%", backgroundColor: "#5B2C5D", color: "white", marginBottom: "0.5em" }} > Submit </Button> <p style={{ textAlign: "center", fontSize: "0.8em" }}> <Link style={{ textDecoration: "none" }} to="/login"> Already have an account? Log In </Link> </p> </Form> </div> ); }; export default Register; ``` I added a link to toggle between the `Login` form and `Register`. **Things to note: ** - I go the icon from font awesome, so if you want the same, make sure to grab that CDN. - Be sure to create the `auth.css` file inside the `auth` folder. ``` .wrapper { margin: 4em auto; width: 100%; } .wrapper .auth_form { margin-top: 3em; margin: 3em 2em; } ``` Your design should look like this. ![Register page UI](https://cdn.hashnode.com/res/hashnode/image/upload/v1601225791431/mdc_b6P5x.png) ## Login Page inside our login.js file. ``` import React from "react"; import { Form, Header, Button, Input } from "semantic-ui-react"; import "./auth.css"; const Login = () => { return ( <div className="wrapper"> <Header as="h2" textAlign="center"> Log into Slack{" "} <span> <i className="fab fa-slack" style={{ color: "#723975" }}></i> </span> </Header> <Form className="auth_form" size="large" > <Form.Group widths="equal"> <Form.Input name="email" label="Email" type="email" placeholder="Email" /> {/* END OF EMIAL FIELD */} <Form.Input type="password" name="password" label="Password" placeholder="Password" /> </Form.Group> <Button type="submit" formNoValidate style={{ width: "100%", backgroundColor: "#5B2C5D", color: "white", marginBottom: "0.5em" }} > Submit </Button> <p style={{ textAlign: "center", fontSize: "0.8em" }}> <Link style={{ textDecoration: "none" }} to="/register"> Don't have an account? Create one here </Link> </p> </Form> </div> ); }; export default Login; ``` Finished UI ![Screen Shot 2020-09-27 at 1.11.46 PM.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1601226731345/IbKGk62O7.png) That is all for this one, in the next ones we will start form validations on both, as there are just static at the moment. As always, let me know if you need any help. Enjoy.
ajeasmith
474,994
When you think your functional code is stack safe
Recursion is a functional primitive and thus we try to avoid it, because ultimately it is only a nast...
0
2020-10-04T14:29:24
https://dev.to/iquardt/when-you-think-your-functional-code-is-stack-safe-3edf
javascript, node, functional, learning
--- title: When you think your functional code is stack safe published: true description: tags: #javascript #nodejs #functional #learning //cover_image: https://direct_url_to_image.jpg --- Recursion is a functional primitive and thus we try to avoid it, because ultimately it is only a nasty imperative loop in disguise. In FP we usually use folds and only resort to recursion if folding is not expressive enough. In Javascript we additionally need to take care of stack-safety. It is therefore a smart strategy to implement folds with specific trampolines suitable for each type: ```javascript // Foldable const arrFold = f => init => xs => { let acc = init; for (let i = 0; i < xs.length; i++) // trampoline acc = f(acc) (xs[i], i); return acc; }; // identity const id = x => x; // function composition const comp = f => g => x => f(g(x)); const compn = arrFold(comp) (id); // variadic // MAIN const inc = x => x + 1; compn([inc, inc, inc, inc, inc]) (0); // 5 ``` [run code](https://repl.it/@ftor/WoefulAmpleRatio) You may think yourself safe with `arrFold` being implemented as a stack-safe trampoline. However, you are not: ```javascript // MAIN const inc = x => x + 1; const xs = Array(1e5).fill(inc); const foo = compn(xs); // still okay foo(0); // stack overflow ``` [run code](https://repl.it/@scriptum/VelvetyAntiqueDeclaration#index.js) Composing means to combine two functions to a description of a new function, which is only evaluated if the required argument is provided. So iteratively composing builds up a huge description of descriptions waiting to be run. What can we do about it? We need a way to break the composition apart. We've already used trampolines. It seems to be the proper tool: ```javascript // trampoline for deferred function call trees const postRec = f => (...args) => { let step = f(...args); while (step.tag !== "Base") step = f(...step.args); return init => { let {f, x} = step.x(init); while (step = f(x)) { if (step && step.tag === "Call") { step = step.f(step.x); if (step && step.tag === "Call") { ({f, x} = step); continue; } else break; } else break; } return step; } }; const Base = x => ({tag: "Base", x}); const Call = f => x => ({tag: "Call", f, x}); const Step = (...args) => ({tag: "Step", args}); // function composition const comp = f => g => x => f(g(x)); const compn = xs => // variadic postRec((i, acc) => i === xs.length ? Base(acc) : Step(i + 1, Call(comp(acc) (xs[i])))) (0, Call(id)); // MAIN const inc = x => x + 1; const xs = Array(1e5).fill(inc); compn(xs) (0); // 100000 ``` [run code](https://repl.it/@scriptum/FittingIdolizedIntegers#index.js) `postRec` isn't a beauty. It reveals all its ugly operational semantics. Javascript was never about beauty but to get things done, I guess. Anayway, in FP we often have to deal with descriptions of computations that create huge deferred function call trees. Having a specialized trampoline at our disposal allows us to get serious about FP in JS. If you want to learn more about FP in JS take a look at my course on Github.
iquardt
467,265
How To Easily Set Up A MEVN Stack Server
MEVN stack is a tech stack where you use MongoDB as your DB, Express.JS/ Node.JS as backend, and Vue....
0
2020-09-27T18:50:15
https://dev.to/mohitsehgl/how-to-easily-set-up-a-mevn-stack-server-16e3
nginx, mongodb, node, ubuntu
MEVN stack is a tech stack where you use MongoDB as your DB, Express.JS/ Node.JS as backend, and Vue.JS frontend. Once you are done with the app development. You need to deploy it. Here is the easy guide to doing that. # Which OS? When you talk about server setup of some stack, the first thing that comes to your mind is Server OS. Which server OS do you want? In the case of MEVN Stack, Linux is most preferable due to various reasons. # Which Linux distro? There are some great options here but I personally prefer Ubuntu. It is because Ubuntu is easy to set up and has great community support. Most of the tools and libraries needed for MEVN Stack are easily available. # 1. SSH to the Server SSH is the protocol used to access the server in a secure manner. You can SSH using SSH Key or using a password. SSH Key is preferred for better security. Here is the simple command in order to get SSH access to the server. ``` $ ssh -i "MyServer.pem" ubuntu@server-ip ``` # 2. Install MongoDB ## a) Run this command ``` $ wget -qO - https://www.mongodb.org/static/pgp/server-4.2.asc | sudo apt-key add - ``` This will copy MongoDB’s public GPG Key. The version in the above command will change according to the latest version. Refer to official MongoDB docs for more on this. ## b) Create a sources list file for MongoDB ``` $ echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.2.list ``` This is the official URL of MongoDB Community Edition and related packages. ## c) Reload the local package database using the following command ``` $ sudo apt-get update ``` ## d) Install MongoDB using the following command ``` $ sudo apt-get install -y mongodb-org ``` This will install the latest version of Community Edition of MongoDB ## e) Start MongoDB using the following command ``` $ sudo systemctl start mongod ``` This will initiate MongoDB service. After this process, you need to set up user authentication on MongoDB. I will discuss this in a separate post. # 3. Install NodeJS There are many ways to install NodeJS on a typical Linux Distro. But as promised in the title I will give you the easiest way. Run the command below ``` $ sudo apt install nodejs ``` Done!! Sweet. You can check the version of NodeJS using the following command. ``` $ node -v v13.10.1 ``` This is the latest stable version of Node.JS on Ubuntu as of this writing. # 4. Install npm If you are familiar with Node.JS, then definitely you cannot do without npm. NPM is the world’s largest software repository for publishing open-source packages. It acts as a package manager when you work with the “real-world” Node.JS app. Run this command ``` $ sudo apt install npm ``` Just like Node.JS, you can check the latest version of npm on your machine. ``` $ npm -v 6.14.4 ``` # 5. Install PM2 PM2 is an advanced and most preferred process manager for Node.JS Apps. Note for beginners: As you know you can run Node script using node script.js to run any Node Script. But as soon as you close the terminal window. Your node script will come to a halt. PM2 enables you to keep your script running even when you disconnect from your terminal. Although very naive, this is the most basic function of PM2. As the home page of PM2 mentions. It needs a very simple command ``` $ npm install pm2 -g ``` If you want to run your Node App. Go to the base directory of your app in terminal using cd. Suppose if your script file is index.js. Then run this command ``` $ pm2 start index.js ``` This will run your Node Project in the background. You can also run multiple Node Scripts on the same server. You can list all the currently running PM2 processes by this simple command ``` $ pm2 list ``` ![List all PM2 Processes](/blogimages/pm2-list.png) # 6. Install NGINX NGINX is open-source software that can be used as a web server, reverse proxy, load balancer, or all of these. Installing NGINX is very simple using ubuntu’s package manager. ``` $ sudo apt install nginx ``` You need to allow it on your firewall. Assuming that you are using `ufw`. Here is the command to do that ``` $ sudo ufw allow 'Nginx HTTP' ``` Next, you need to start the Nginx, using the following command ``` $ sudo systemctl start nginx ``` Here’s an additional step that you need to do in order to start Nginx on each boot. (Because you want your web-server to be up and running all the time) ``` $ sudo systemctl enable nginx ``` Now NGINX is running but it is not configured to your web-app yet. Important: Make sure your DNS server points the appropriate Domain to this server. Let’s say your Node script is running at port 3000. Open the default config file for NGINX. ``` $ sudo nano /etc/nginx/sites-available/default ``` Scroll down using the arrow key to the server block of the file. Server block would of the form of ``` server { //some lines of config } ``` Now you need to replace it with the following ``` server { listen 80; server_name www.mydomain.com; location / { proxy_pass http://localhost:3000; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; } } ``` Make sure you don’t override/ remove any other line of the file. Also, make sure you replace www.mydomain.com with your domain name. Save the file and exit. You can verify that your NGINX changes are fine using the following command. ``` sudo nginx -t ``` Tip: This command tests your current NGINX config for any errors. Make sure you do it every time you make any changes to your NGINX config. If you made changes correctly then it will give you success like this. ``` sudo nginx -t ``` _**Tip**_ : _This command tests your current NGINX config for any errors. Make sure you do it every time you make any changes to your NGINX config._ If you made changes correctly then it will give you success like this. [NGINX Conf Test Successful](/blogimages/nginx-conf-success.png) Now you are ready to deploy config changes to NGINX. Just restart or reload NGINX. ``` $ sudo service nginx reload ``` That’s it your server configuration is done. # Conclusion This is the easiest way to set up your MEVN Stack server for development. If you are facing any issues then contact me on our email appsyoda@gmail.com or comment below. _Originally posted on https://appsyoda.com/blog/set-up-mevn-stack-server_
mohitsehgl
467,942
Here's Actually Why Deno Flopped
Brought to you by engine.so - a tool to instantly create a public self-service knowledge base for yo...
0
2020-09-28T13:54:15
https://dev.to/spencerpauly/here-s-actually-why-deno-flopped-3k1a
javascript, node, deno, typescript
> Brought to you by [engine.so](https://engine.so) - a tool to instantly create a public self-service knowledge base for your customers with Notion. Deno is a Javascript / TypeScript runtime looking to take the place of Node.js as the status quo. It boasts a wide slew of features and has a lot of hype around the project with almost 68,000 stars on Github: ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/i8vv1fjooy4020yqm54z.png) With so many great features, the question to ask is: Why didn't Deno take off when it released it's official version 1.0? This article looks to dive into that question… --- # So, what's Deno? Deno is a secure JavaScript and TypeScript runtime created by Ryan Dahl (who's also the original creator of Node.js). It was created to fix some of the oversights made when first designing Node.js back in 2009. In my opinion this motivation makes a lot of sense because I'm sure every programmer would love to get a chance to rewrite their 10 year old code. In this case, Deno boasts quite a few features over Node.js: * Deno is secure by default. Access to the file system, network, or environment has to be opt-in * Deno was built for TypeScript out of the box External files are explicitly referenced by a URL. No package.json. * Import statements include file extensions (.ts,.tsx,.js,.json) * Built-in dependency inspector and file formatter utilities And more… And with these features in its arsenal combined with an enormous amount of developer hype, Deno had its official 1.0 release in May 2020. And then… Crickets. --- # Why Didn't Deno Take Off? Deno looked like it had all the ingredients for success. It had a massive following, a solid batch of features, an experienced creator, and more, but it didn't really have the growth everyone expected. Why is that? I think it's best to look at it from a business perspective. See, most of us forget that building open source software is really no different than building software for users. The standard economic principles of supply and demand still play a large role. When someone is creating a new open source project, they're typically going to be competing with something that already exists. With that in mind, you have to consider not only how good your new project is, but also what it looks like compared to what's already available. In Deno's case, what was already available was Node.js, and while Node.js might have its flaws, it's still very capable of doing its job. Now, if Deno came out with a blowaway feature that Node.js would never be able to replicate, that might change the game. But it didn't. Deno only really sported "minor features" from a users perspective. It had a cleaner codebase, used up-to-date best-practices, and had better security, but those things are really only "features" to a user, not a product in themselves. You could make an email client exactly like Gmail except it has better security and a 50% speed improvement, but users still wouldn't switch to it because even the tiny amount of time it takes to create a new bookmark wouldn't be worth it. So that's strike 1 against Deno: It has quite a few nice-to-have features, but there's nothing standout that inspires users to switch away from Node.js. The other major strike against Deno is that it doesn't support NPM packages. If Deno were able to support NPM packages, that would change the game for them. Deno supporting NPM packages would make them much less of a "separate email client", and more like a better wrapper around the current client. Supporting NPM packages would greatly reduce the barrier to entry. It would act as a good stepping stone for users to migrate their projects and libraries towards Deno. Think of it as similar to TypeScript's "strict-mode". For users with a huge codebase of JavaScript, jumping directly into TypeScript would cripple your productivity for weeks while you sort through all the error messages. Because TypeScript has the ability to disable strict mode, it can act as a stepping stone for users to slowly migrate over to pure TypeScript. This gives them a much lower barrier to entry, and in turn has helped TypeScript rip away market share from JavaScript in recent years. --- # What's the Takeaway? I think this an interesting case-study that exemplifies a larger methodology in business. The takeaway is that if you're going to release a new product into the market, you have to make sure it's something where the upside is so great that it overcomes the resistance from people switching from the status quo. In Deno's case they had the initial allure, but when it came down to it Deno was really only offering a collection of small "fixes" at the price of losing the whole NPM ecosystem that Node.js had cultivated and this tipped the scales for them. --- # Where does Deno go from here? Well they have a decision to make. They can either work on adding backwards compatibility to Node.js libraries, or they can increase their offering to make the compulsion to switch just that much more enticing. I personally think backwards compatibility is the way to go, and I think if that was added it would drastically alter the future of the project. --- Either way, best of luck to the deno team and I hope the best technology wins in the end. I hope you enjoyed the article, thanks.
spencerpauly
468,419
Simplifying the user journey for consumers of Web-monetized content
Journey into Web Monetization Web Monetization is a new Web Services (API) that allows use...
0
2020-10-01T13:45:53
https://dev.to/uu/simplifying-the-user-journey-for-consumers-of-web-monetized-content-mbj
webmonetization, ux, blockchain, webdev
## Journey into Web Monetization Web Monetization is a new Web Services (API) that allows users to stream a small amounts of micropayments to the website they are looking at via their browser or other web user agent. [webmonetization.org](https://webmonetization.org/) has all the technical details of the technology for those who are curious. However, this article aims to simplify the concept of __*Ad-free content supported by the user via realtime micropayment*__. Hence, this is suitable for technical people and UX designers, PMs, and other stakeholders looking to understand alternative revenue sources and how the consumer journey can evolve to provide the best consumer experience. For context, I am a Software Engineer in the Blockchain and FinTech space. But, I have an [Interactive Systems Design](https://programs.usask.ca/arts-and-science/interactive-systems-design/index.php) (CS + Psychology + Arts) background, and I spent four years learning and working on how to combine CS with Psychology and Arts to provide the best user experience. So, bringing that experience to Web Monetization is exciting for me! ## The Web Monetization space today From the lens of a consumer, they go through a few phases in their consumer journey. I highlight some of them below: ### Discovery How do content consumers find out about Web Monetization? For most people hearing about Web monetization, their first contact point is the [webmonetization.org](http://webmonetization.org/). Although the website explains the concept and API in plain language, potential consumers who are not in tech or even those outside the Blockchain/Crypto might not understand what this technology is all about. Do the content and explanation instill trust? Or doubt? <img src="https://dev-to-uploads.s3.amazonaws.com/i/zcx1ds9gctv2tea7s8lz.png" style="width: 100%; border: 5px solid red !important;" /> __'Web-Monetized'__ is not a consumer-facing language because it does not speak to the benefits of Web monetization; neither does it provide consumers with an easy way to remember/share the technology. Could we simplify the terms or adopt a more consumer-friendly name to describe Web monetization? What does Web monetization mean for users? And how could that be applied to the name we adopt for the API? ### Evaluation After discovery, do users understand what web monetization is? For those who visit the landing page, what is their Web Monetization opinion from a consumer perspective? How does the explanation of web monetization make users feel? Do users who are passionate about supporting creators get inspired and find creators to support? Do users who dislike ads get convinced to discover more content? Because most of the available content is relatively functional and developer-focused, beginner consumers feel like the technology is not ready to start enjoying. With Coil's content focused on partnerships and platforms, consumers are directed to these platforms, but for some, the value proposition is still not clear. ![Screen Shot 2020-10-01 at 9.15.04 AM](https://dev-to-uploads.s3.amazonaws.com/i/bl2rnrv4n8q637iuksic.png) Could [webmonetization.org](http://webmonetization.org/) be improved to include a focus on consumers and focus on Creators? Could there be other sources for highlighting and showcasing Web monetized, AKA user-supported, or ad-free content? ### Decision After a user learns about Web Monetization and gets convinced about the potential of relying on Web Monetization for content consumption, how easy it is to make that decision and leap to get on board? [Coil](https://coil.com/) has done a fantastic job of getting consumers to subscribe. The process is seamless. ### Opt-in After subscription, getting started with enjoying Web monetized content is still a little bit complicated. You either need a Browser extension for Desktop or the Puma Browser for Web. Currently, users have to hunt for the browser extension to download it, and after installing the extension, they still need to know where it is in the browser to log in and activate it. ### Retention After set up, do consumers find enough ad-free web-monetized content? How do we help them filter out and quickly discover web-monetized content? Consumers will continue to pay a subscription fee if the content they find out is useful and matches their expectations. We retain consumers when we give them options. And let their _options_ give them more options. ## Better Web Monetization for content consumers To make web monetization accessible and easy to break into, consumers' user journey needs to be concise and easy to follow. At every stage in the process, descriptions and concepts should be explained in terms that content consumers understand. For example, web-monetized content could be worded as _user-supported_ content or _ad-free_ content for a content consumer. The table below highlights some areas of the content consumer journey and recommendations for improvement: | Phase | Status | Recommendation | | --------------- |:-------------:| -----:| | Discovery | ⚠️ | For consumers, rebrand Web Monetization around consumer benefits (i.e., Reader-supported content, Ad-free content?)| | Evaluation | ⚠️ | Create customer-centric, content-driven landing page and newsletter of web-monetized content| | Decision | ✅ |Coil handles this well. Affiliate program for providers in the system?| | Opt-in | ✅ |Improve documentations around Puma browser and the Web Extention because for someone new to extensions, it is hard to install and setup | | Retention | - |Create browsing tools that highlight Web monetized content in realtime from search results | _Table: Recommendations for improving the user journey for consumers of Web monetized content_ ## What you can do In summary, Ads Suck, privacy is at a tipping point. Passion economy/creators rules. Web Monetization is the future because it gives people optionality and allows them to support creators, so creators still get paid. Conde Nast in it's Vogue Magazines are web-monetized, Wired, Pitchfork, The New Yorker, and many others are Web-monetized. So what stopping you? This article is a call to action for Developers, Designers, Product Managers, and others interested in the space to continue to build and especially build more with the content consumer in mind. I am happy to chat about the work I did with [Paul Sieka](https://paulsieka.com/) to understand the space better and build better onboarding and retention for both Consumers and Creators (A creator-focused article coming soon!) [READ ON](https://dev.to/uu)!
uu
469,008
Most Useful Gems for Ruby on Rails API
Are you new to Rails? Or maybe just looking for any cool gem to use in your new API? Here is a list o...
0
2020-09-29T15:29:57
https://www.rootstrap.com/blog/gems-you-want-to-have-in-your-rails-api/
rails, ruby, webdev
Are you new to Rails? Or maybe just looking for any cool gem to use in your new API? Here is a list of gems we have on our Rails API Base that we consider a must-have in every Rails API project. ## The best authentication gem If you are building a Rails API, then you will probably need token-based authentication and that is when [Devise Token Auth](https://github.com/lynndylanhurley/devise_token_auth) comes in. This gem is built on top of Devise, one of the most popular authentication gems for Rails which you may have already worked with. If that's the case, then you'll get familiar with Devise Token Auth very easily. With very little setup, this gem provides registration, sign in, sign out and reset password flows out of the box, as well as very useful helper functions. Also, it handles email confirmation if enabled and supports the use of multiple user models, giving you the possibility to manage the authentication of different types of users at the same time using groups. In comparison to other alternatives available, one of the best perks that comes with Devise Token Auth is the very little effort you have to invest to get things up and running. On top of that, you can also customize the different flows mentioned if you want to offer a different experience, and while this may be a little more challenging, it's not rocket science! ## Handling authorization I guess authorizing every request on an API can be achieved in the controller, but that is not scalable at all and may ease the introduction of vulnerabilities in an application. Here at Rootstrap, we find [Pundit](https://github.com/varvet/pundit) to be the perfect ally against those issues. Not only will you have one place in the codebase for the authorization logic, making the system more robust, but also it will help to clean up the controllers, improving the readability. ## How to paginate your index actions When pagination comes into the discussion, I would definitely recommend [Pagy](https://github.com/ddnexus/pagy). Although it was recently added to our Rails API Base, we have been using it in several projects of the company over the last year or so, and the results have been pretty good! It has proven to be a light gem, which is very fast, customizable and easy to use. ## The best admin for Rails Most APIs typically need some level of resource administration and for that I would definitely recommend [Active Admin](https://github.com/activeadmin/activeadmin). Despite the fact it can have a steep learning curve, specially at the beginning, due to it's [DSL](https://martinfowler.com/dsl.html), once you get used to it you can have admin pages with CRUD actions for any resource in no time. Something very important to mention is that Active Admin has a large community and good documentation compared to other administration gems, such as Rails Admin or Administrate. Also, another strong feature is that you can configure the index filters according to your needs and they can be customized to use more that one attribute since they support [Ransack](https://github.com/activerecord-hackery/ransack). If you need a custom page, you can have Active Admin render your own partial and you will probably need to make changes in the controller actions. This is not an easy task, but none of the other gems offer anything better. For some people, one of the downsides could be the design, since Active Admin does not come with a powerful CSS framework out of the box. Luckily, there are many [complementary gems](https://github.com/activeadmin/activeadmin/wiki/Themes) that provide a better looking theme. ## Background processing gems On the background processing front, I would definitely recommend starting with [Delayed Job](https://github.com/collectiveidea/delayed_job). This is because it easily integrates with Rails, has minimal dependencies, resulting in a fast setup, and it offers a very stable and reliable processing. If your application scales, you will need a framework which delivers performance and in that case I would recommend switching to [Sidekiq](https://github.com/mperham/sidekiq). Changing the framework should be an easy task thanks to Active Job and you will get awesome benefits from this. Sidekiq is known for its very fast speed, scalability and multithreading potential. By running in memory with Redis, fetching and saving data is much faster than completely relying on the database like Delayed Job, and what's more, you can have a dashboard to monitor the status of the processes. ## Communicating with 3rd party services Even though you can usually find some good gem that will help you call a third party service, sometimes you need to do that on your own. [HTTParty](https://github.com/jnunemaker/httparty) or [Faraday](https://github.com/lostisland/faraday) are great HTTP clients you can use to make external HTTP requests. They may not be on our base repo, but everytime we need to do that in a project they are our go-to options. ## Dealing with file uploads Active Storage is what we use to handle file uploads, but we noticed that it didn't support base64 attachments. That's why the Rootstrap team developed [ActiveStorageBase64](https://github.com/rootstrap/active-storage-base64), which offers an easy way to support uploading base64 encoded files. So, if you have this need, don't hesitate to check out that awesome gem of ours! ## The best gems for testing Although it may take some time to get used to the DSL, here at Rootstrap we choose [RSpec](https://github.com/rspec/rspec-rails) for testing. The main reason for this is that it encourages human readable tests, which ends up helping a lot in the development process. When writing tests you always need to set up database records to create the context, and for this we like to use factories with [Factory Bot](https://github.com/thoughtbot/factory_bot). This gem offers great flexibility, allowing the developer to easily create different scenarios, but also improves the readability as you can easily understand what is going on in the test. Another gem that we find very useful for factories is [Faker](https://github.com/faker-ruby/faker), as it provides an easy way to generate fake data. Last but not least, if your API relies on third party services you will need stubbing on the external HTTP requests and for this I recommend using [Webmock](https://github.com/bblimke/webmock). If you ask me, I found this gem much simpler and flexible than VCR, for example. ## Keeping the code quality Finally, every developer wants a good quality codebase and in that sense linters are essential. Here's a list of gems that I strongly recommend: * [RuboCop](https://github.com/rubocop-hq/rubocop-rails) * [Rails Best Practices](https://github.com/flyerhzm/rails_best_practices) * [Reek](https://github.com/troessner/reek) for code smells * [Bullet](https://github.com/flyerhzm/bullet) for query optimization * [i18n-tasks](https://github.com/glebm/i18n-tasks) for translations linting If you are having doubts while setting up your new API you can always check out [Rootstrap's Rails API Base repository](https://github.com/rootstrap/rails_api_base). I think it's a great starting point and you can always customize it to your needs.
jdrosales17
469,727
Base API: Honest Feedback Requested
Hi there 👋 I am building Base API a collection of basic APIs that a web app usually needs (image upl...
0
2020-09-30T04:26:44
https://dev.to/gdotdesign/base-api-honest-feedback-requested-42bi
feedback, api, discuss
Hi there 👋 I am building [Base API](http://www.base-api.io/) a collection of basic APIs that a web app usually needs (image upload, email sending, authentication, etc...). The thing is that I'm in a standstill (I haven't done anything with the product in the last half year) and don't know how to proceed with it. I really want to make this a good service which helps developers build products quicker and safer. Since you are (probably) a developer and you face the issues which this service tries to solve is the reason I am reaching out and **would like your honest feedback** about the product. It would be really helpful for me if you could answer any of the questions below: - looking at the site it is understandable what the service does? - what are the features that you would like to see in an service like this? - what do you think about the pricing? - what are the things you like / don't like about it? - from the available information would you try it out? - if it were open source would you use it? If you have any other feedback that is welcome as well or if you have any questions I'm happy to answer them 🙂.
gdotdesign
471,013
Learning How to Code
When you work for a tech company in an official capacity, it feels like everyone around you is speaki...
0
2020-10-01T06:20:48
https://www.loginradius.com/engineering/blog/learning-how-to-code/
learning, coding, learningresources
--- title: Learning How to Code published: true date: 2015-12-29 00:00:00 UTC tags: Learning,Coding,Learningresources canonical_url: https://www.loginradius.com/engineering/blog/learning-how-to-code/ --- When you work for a tech company in an official capacity, it feels like everyone around you is speaking another language. Which they are, most of their work exists in coding language. To feel more relevant, I signed up on codecademy.com and started working on their beginner courses… [Read On](https://www.loginradius.com/engineering/blog/learning-how-to-code/)
mohammed786
471,020
How does a Beginner feel when they are just getting started.
When you enter the arena , you see a whole lot of of troops already fighting for their life and you t...
0
2020-10-01T06:25:57
https://dev.to/hardiky/how-does-a-beginner-feel-when-they-are-just-getting-started-137l
beginners, opensource, developers, youtube
When you enter the arena , you see a whole lot of of troops already fighting for their life and you think you just are getting started as a troop and you want to be a king someday. When you someone shows how something works , a Beginner goes through multiple emotions at consecutively for example , from astonished to excited , to confused , to nervousness to self doubt. Just want to clear out all my fellow beginners , battle is not with others its with you and either you win or defeat this battle only you are gonna be get affected by it. So be selfish and learn what you want to and not what others are asking you to . #thursdaytalks.
hardiky
471,042
tsParticles loves Hacktoberfest
tsParticles is always looking for contributors and if you are searching for some project to...
0
2020-10-01T07:10:00
https://dev.to/tsparticles/tsparticles-hacktoberfest-4chn
hacktoberfest, news, showdev, contributorswanted
tsParticles is always looking for contributors and if you are searching for some project to contribute for the Hacktoberfest 2020 I'll be glad to help you participate. tsParticles is a web project, written in TypeScript. It uses mostly `canvas` animations but there's also a visual editor and many components for the most used front end framework like: - React - VueJS (2.x and 3.x) - Angular - Svelte - Inferno - Preact - jQuery There are also some presets or custom shapes ready to be used by users that can also be added if you have some cool ideas. There are some cool open issues (mostly new features) to work on, and we can discuss them in [Slack](https://join.slack.com/t/tsparticles/shared_invite/enQtOTcxNTQxNjQ4NzkxLWE2MTZhZWExMWRmOWI5MTMxNjczOGE1Yjk0MjViYjdkYTUzODM3OTc5MGQ5MjFlODc4MzE0N2Q1OWQxZDc1YzI). {% github matteobruni/tsparticles %} Happy Coding to everyone, Happy Hacktoberfest 2020!
matteobruni
471,083
Redesigning a Landing Page
Hello and welcome. This post references a previous blog I wrote, so to catch up, you can read it here...
9,044
2020-10-01T08:49:45
https://dev.to/gbenga/redesigning-a-landing-page-3d69
ux, react, design, frontend
Hello and welcome. This post references a previous blog I wrote, so to catch up, you can read it here: {% link https://dev.to/gbenga/my-first-ux-case-study-3hg9 %} ## Recap In my previous post, I looked at the homepage at [sayplants.com](http://sayplants.com), and discussed the most immediately noticeable issues. To recap quickly these were: - Too many Calls-to-action - there were many links that pointed to the same page, some that were labelled inconsistently, meaning users may be overwhelmed with choice or confused by the lack of direction - Unclear signposting - Both in the copy and the positioning of certain elements on the page, there was assumed familiarity with the product offering. This would likely lead to issues for users who were visiting for the first time - No discernible hierarchy - from the website alone, it was hard to clearly define what the main function of SayPlants was. There were numerous services, but none was clearly the only main focus. This left a lot of opportunity for users to misinterpret, and spread this along ### Onwards In this post, I will be detailing some of my suggested changes to address some of the issues I have raised in my previous post, and some that I have noticed since then. I'll break this into a few sections so it's easier to read, and we'll cover the 3 screens that are visible on the homepage, and then a (simple) mockup that takes into consideration all of my suggestions. ## Section 1 One of my concerns was that there was a good amount of assumed knowledge from the way that the copy was originally written. For example, referring to "rewards" without context of what a reward would be in this context. Additionally, from the landing page, if I had to guess what service was being offered, I would say a restaurant directory, and I wouldn't have even known that I could scroll down and found out about the dining club. ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/mp8ws9elu2bwuobdx1m6.jpeg) My suggestion for section 1 covers 2 main areas: ### **Who are you and why am I here?** Users shouldn't have to think too hard about whether your service is for them, and especially not on what the service is that you are offering. To this end, I would like to include a (very short) explanation of (at least) the main purpose of SayPlants for a user. ### **So what are you offering me?** Users should also not be made to do too much work to understand what it is they can do with your service (unless mystery is part of your brand). So, I want to have some simple examples of the deals that are available. Additionally, given that the restaurant index is somewhat self-sufficient in the context of the service that SayPlants offers, then some users may only come to the site for this use (at first). Therefore, I wanted to give easy access for those who are unlikely to want to extra work once landing on the page, to then get to what they need. ## Section 2 In the previous section 2 there were 6 clickable links, only one of which was actually unique to this section. The rest were also in the Nav Bar or in other areas of the page. So naturally, a big focus was making this area simple, and not presenting too many diverging routes. ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/735l0xezhj151z9utc68.jpeg) ## Establishing a hierarchy In the planning for this section, I wanted to keep in mind that scrolling down the homepage of a website is still a chance to see what is offered. So it was important not to just remove everything, but instead to consider what, from the founders' perspective, were the "secondary" offerings, and highlight them here. This arrangement can indicate to users that aside from what they say in section 1, there are 2 supplementary areas to explore, although they are not part of the main offering. ## Reviews Subsequently, the review section I was mostly happy with. Put simply, I just cared more about what the reviewers said than who they were. As I mentioned in my previous post, word-of-mouth is critical to the success of any business, so it is essential we see what was said. ## Section 3 In the final section of the page, there were another cluster of call-to-actions, but my issue with it was that they were very easily overlooked. I generally understand the convention of putting links and contact information as footers on a page, however, after understanding the consumer decision journey for SayPlants I'm proposing a change. ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/w6wg14mnxaqbwmhvpt7c.jpeg) The idea being that if we were to order the levels of commitment customers can engage in from lowest to highest commitment, it would look as follows: 1. Visit the website once 2. Visit repeatedly 3. Follow on social media 4. Subscribe to newsletter 5. Become a paying member Now, with this in mind, it is critical to try and create some kind of attachement to the brand for any user, especially someone who has shown some level of intent by making it to the bottom of the page. So, this is a chance to make the most of the moment. Much like the "MaKe sUrE yOu HiT tHaT sUbScRiBe BuTtOn, LiKe AnD ComMent" that you hear at the end of every YouTube video, in the internet age of minimal attention spans, you must take advantage of a captive audience. ## Final product...ish ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/vm142whwbdsvx8hwlvli.png) Now this is by no means a finalized product, but here is a slightly more hi-fi version of my sketches, made in Figma. I would still like to add some things, like making it clearer that the user can scroll, but I would love to hear your thoughts on my ideas, and my mock up so far. I hope documenting this process is useful for someone, and points you in the right direction of what you should keep in mind when designing your own landing pages. Thanks for reading! --- ### Music of the Moment Since it's Nigerian Independence Day let me bless you: [Damages](https://open.spotify.com/track/3Xfwu3xtPqmJ4nM4jpBm8O?si=ojnx0AscRXGoR2GAoqE_Nw) comes from the latest album by Tems, [For Broken Eyes](https://open.spotify.com/album/2sU8ByeYc5BOBFNDr58CGV?si=MNyUhwv2QCqpGslQBPgoVg). A bop An all time classic that needs no introduction: [Igwe - Midnight Crew](https://open.spotify.com/track/6Of9mBX5A3C0DqH7ysqqFb?si=NanVgKphTceuWKR-CwPTfQ) Bonus Track: [Styl-Plus - Olufunmi](https://open.spotify.com/track/5oBMwr31HDA5zW0LKC5RVD?si=F1LynLUrSwKB0oTp4OAOKw), this will be play at my wedding, no arguments
gbenga
471,172
JetBrains Code With Me - Collaborative Coding in IntelliJ
Has anyone else completely missed JetBrain's early access announcement for the Code With Me plugin th...
0
2020-10-01T10:45:00
https://dev.to/danielw/jetbrains-code-with-me-collaborative-coding-in-intellij-4n08
todayilearned, productivity, technology
Has anyone else completely missed [JetBrain's early access announcement](https://blog.jetbrains.com/blog/2020/09/28/code-with-me-eap/) for the [Code With Me](https://plugins.jetbrains.com/plugin/14896-code-with-me) plugin that happened 3 days ago!? It is finally happening, collaborative coding in IntelliJ! And it's not even restricted to IntelliJ Ultimate (for now). All you need is an IntelliJ 2020.2.x build and an internet connection. Just install the plugin and share a collaboration link. The other side then has to quickly install a dedicated IntelliJ Client and you're good to go. From what I've seen during a quick test run it looks pretty stable and promising. And I'm not sure if I'm interpreting the connection UI correctly...but it seemed that the connection was peer-to-peer, with JetBrain's servers only used for lobby management. That would be a huge plus if true!
danielw
471,276
How to get started webdevelopment freelancing career?And which are the language I must need to know?
A post by afnan432
0
2020-10-01T13:17:42
https://dev.to/afnan432/how-to-get-started-webdevelopment-freelancing-career-and-which-are-the-language-i-must-need-to-know-2lho
afnan432
472,238
Community Hangout and Update - 2020-10-03
Join us this Sunday 6th September at 10:00 EST (14:00 UTC) for a community hangout and update....
0
2020-10-02T13:36:10
https://dev.to/phalcon/community-hangout-and-update-2020-10-03-3ihb
phalcon, phalcon4, phalcon5, hangout
--- title: Community Hangout and Update - 2020-10-03 published: true date: 2020-10-02 13:19:17 UTC tags: phalcon,phalcon4,phalcon5,hangout canonical_url: --- Join us this Sunday 6th September at 10:00 EST (14:00 UTC) for a community hangout and update. <!--more--> ### New Blood - [Jérémy](https://github.com/jenovateurs) - [Balázs](https://github.com/zsilbi) ### v4 - 4.1.x update ### v5 - phalcon/phalcon - Additional repos - Incubator - Devtools - Migrations [https://youtu.be/FMNklV2a4hQ](https://youtu.be/FMNklV2a4hQ) Looking forward to seeing everyone there! * * * Chat - Q&A - [Discord Chat](https://phalcon.io/discord) - [Forum](https://phalcon.link/forum) Support - [OpenCollective - Support Us](https://phalcon.io/fund) - [Store - Merchandise](https://phalcon.io/store) Social Media - [Telegram](https://phalcon.io/telegram) - [Gab](https://phalcon.io/gab) - [MeWe](https://phalcon.io/mewe) - [Parler](https://phalcon.io/parler) - [Reddit](https://phalcon.io/reddit) - [Facebook](https://phalcon.io/fb) - [Twitter](https://phalcon.io/t) Videos - [BitChute](https://phalcon.io/bitchute) - [Brighteon](https://phalcon.io/brighteon) - [LBRY](https://phalcon.io/lbry) - [YouTube](https://phalcon.io/youtube) <3 Phalcon Team
niden
472,716
What are your first-choice when it comes to picking convolutional neural network architectures and why?
A post by Periklis Gkolias
0
2020-10-02T20:38:56
https://dev.to/perigk/what-are-your-first-choice-when-it-comes-to-picking-convolutional-neural-network-architectures-and-why-2di1
machinelearning, help
perigk
472,739
Verifying Assembly Redirects Before Runtime
We wrote a tool to help catch broken binding redirects when doing dependency updates.
0
2020-10-06T21:41:55
https://dev.to/dustinsoftware/verifying-assembly-redirects-before-runtime-1p4g
dotnet, nuget, assemblybindingredirect
--- title: Verifying Assembly Redirects Before Runtime published: true description: We wrote a tool to help catch broken binding redirects when doing dependency updates. tags: dotnet, nuget, assemblybindingredirect --- This week's "yak shaving" project was updating a library dependency in across several large .NET solutions in a monorepo. It took about as long as we expected, but not _for_ the reasons we expected - this is a tale about assembly binding redirects. The library (Npgsql) was bumped two major versions, from 2.x to 4.x. The primary advantage of the update in our case was added .NET Core support, allowing us to incrementally port services in this monorepo over to .NET Core. Our dependency structure looks like this: ``` - Npgsql - SharedBusinessLogic - Web UI layer - Some async services that generate reports - An unrelated UI project that doesn't use Npgsql directly ``` There were a few database queries that broke but overall the update seemed to go fine, tests were passing locally and on CI. However, after merging and deploying the branch to one of our test environments, one of our projects started throwing errors on certain routes: ![yellow screen of death](https://dev-to-uploads.s3.amazonaws.com/i/b9ifyghgiuparzryukad.png) What happened? An updated graph of dependencies after the update: ``` - System.Runtime.CompilerServices.Unsafe - System.Numerics.Vectors - System.Memory - System.Threading.Tasks.Extensions - Npgsql - SharedBusinessLogic - Web UI layer - Some async services that generate reports - An unrelated UI project that doesn't use Npgsql directly ``` The Npgsql dependency now targets netstandard, which means we can reference it via .NET Core and .NET Framework (legacy) without compatibility hacks. However, to accomplish this, some of the dependencies that were previously referenced in the installed .NET runtime are now referenced via NuGet packages. By convention, most of these are prefixed `System.` in the dependency list. ![nuget dependency list](https://dev-to-uploads.s3.amazonaws.com/i/qyhdh6pya0ihoxm951zh.png) However, some of our other app dependencies _already_ had references to these `System.` assemblies, but for different versions. Confused? Let's talk a bit about how this works. In .NET Core projects assembly binding redirects are not necessary, but many of our projects still run on .NET 4.8, also referred to as .NET Framework, or netfx. At runtime, the .NET Framework tries to resolve a specific version of any dependencies requested. If the exact version is not present in the bin folder, an assembly binding redirect is required to "force" the runtime to resolve to a specific version, or an exception will be thrown. These binding redirects are specified in a config file and checked at runtime. For further reading, I recommend Nick Craver's excellent post on binding redirects [here](https://nickcraver.com/blog/2020/02/11/binding-redirects/). To complicate matters further, not all assemblies are loaded and checked at application startup. We found that only _some_ of our server-side routes caused the Npgsql assembly to load, so building and running just the home route was not enough. OK, so we'll update these bindings now that we know that the code crashes. But how can we know about this problem before running every possible route on our web app? Our first attempt was to use the `msbuild /warnaserror` flag. With this switch, warnings will be printed for NuGet level restore problems (downgrade warnings), and binding redirects that are mismatched or missing entirely. More information [here](https://docs.microsoft.com/en-us/visualstudio/msbuild/msbuild-command-line-reference?view=vs-2019). ``` C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2084,5): warning MSB3247: Found conflicts between different versions of the same dependent assembly. In Visual Studio, double-click this warning (or select it and press Enter) to fix the conflicts; otherwise, add the following binding redirects to the "runtime" node in the application configuration file: <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"><dependentAssembly><assemblyIdentity name="System.Memory" culture="neutral" publicKeyToken="cc7b13ffcd2ddd51" /><bindingRedirect oldVersion="0.0.0.0-4.0.1.1" newVersion="4.0.1.1" /></dependentAssembly></assemblyBinding> ``` In our case, we could not use `/warnaserror` yet because we wanted to progressively roll out this validation, and additionally: - Alert on binding redirects that are targeting an old version of the library - Warn on outdated redirects for assemblies not present in the bin folder (deleted dependencies) - Run the tool on an entire git repository locally to quickly sanity check repos with multiple solution files - Generate missing bindings without copy-pasting text from msbuild's output ![screenshot of assembly checking tool](https://dev-to-uploads.s3.amazonaws.com/i/qx1pq5teexne98m2yqmw.png) We ended up putting together a Powershell script to handle this. It has no dependencies and has been tested on Powershell 5. [Check it out here if you're interested](https://github.com/dustinsoftware/check-binding-redirects/blob/main/check-binding-redirects.ps1) The basic idea is this: - Find any web.config or app.config files within a folder, recursively - For each resolved config, open the bin folder and load every DLL, building a map of versions and publicKeyTokens - Check to make sure the lists match - If they don't, fail the build - ??? - Profit With increased confidence in our build tooling, we can be more proactive about moving shared projects to netstandard, and ultimately ship more projects using .NET Core. Happy shipping!
dustinsoftware
473,398
Kor UI themes #1: Twitch, Github, Spotify
In this post we will showcase the three Kor UI themes inspired in well-known websites or web apps. We...
0
2020-10-03T12:30:23
https://dev.to/eduferfer/kor-ui-themes-1-twitch-github-spotify-2i8e
ux, design, webdev, css
In this post we will showcase the three **[Kor UI](https://kor-ui.com/)** themes inspired in well-known websites or web apps. We have chosen **Twitch**, **GitHub** and **Spotify** as references because of their harmonious base colors, rich use of accent colors and typography. We will cover mainly two aspects of theming: customizing **global variables** (such as shadows, fonts and colors) and local **component styles** (such as border radius or tabs size). --- ## Theme 1: Twitch The user interface of Twitch is easily recognisable mainly for its moderate use of purple as an accent color and mostly grayscale base colors with a blue tint. A few component styles had to be set to match those used currently in the app. [Link to Stackblitz project](https://stackblitz.com/edit/kor-ui-theme-twitch) ![](https://dev-to-uploads.s3.amazonaws.com/i/vvh61vt7yby7qxiap6i1.png) Key elements of the theme: - **Base colors** were set to blue-ish dark gray tint - **Accent color** was set to a bright purple - **Shadows** were removed (except for app and nav bars) - **Fonts** were set to the default sans-serif - **Tab items** were set to have accent font color when active or hovered and paddings got removed - **Inputs** got their bottom border removed and border radius increased ```css html, *[theme="dark"] { --accent-1: 169, 112, 255; --accent-1b: 179, 122, 255; --accent-1c: 159, 102, 255; --base-0: 24, 24, 27; --base-1: 14, 14, 16; --base-2: 31, 31, 35; --base-3: 44, 44, 46; /* outlines */ --shadow-1: none; } html, body { /* fonts */ --body-1: normal 14px/24px sans-serif; --body-2: normal 12px/16px sans-serif; --header-1: bold 16px/24px sans-serif; --header-2: bold 14px/24px sans-serif; } /* component styles */ kor-button { --accent-1: 145, 71, 255; --accent-1b: 155, 81, 255; --accent-1c: 135, 61, 245; } kor-nav-bar, kor-app-bar { --shadow-1: 0 1px 2px rgba(0,0,0,.4); } kor-tab-item { padding: unset; min-width: unset; margin: 0 8px; } kor-tab-item:hover, kor-tab-item[active] { --text-1: rgb(var(--accent-1)); } kor-input { border: none; border-radius: 4px; } ``` --- ## Theme 2: Github In the last year, GitHub got a refresh in its UI and the new theme relies heavily on rounded corners and outlined shapes. Accent colors vary from case to case and another unique detail is the fact that the app bar has a mostly dark theme while the rest of the UI is based on a light color scheme. [Link to Stackblitz project](https://stackblitz.com/edit/kor-ui-theme-github) ![](https://dev-to-uploads.s3.amazonaws.com/i/si1g3w3scynvcw78v0ke.png) Key elements of the theme: - **Base color** of side panels was set to white and page base colors to a lighter shade of gray - **Accent color** was set to a dark shade of green - **Shadows** were replaced with thin outlines - **Fonts** were set to the default sans-serif - **App bar** theme was set to dark and base color changed to a dark shade of blue - **Tab items** had their active state indicator switched to orange ```css html, *[theme="light"] { --accent-1: 46, 164, 79; --accent-1b: 56, 174, 89; --accent-1c: 36, 154, 69; --base-1: 246, 248, 250; --base-2: 255, 255, 255; /* outlines */ --shadow-1: 1px 1px 0px rgba(0, 0, 0, .1), -1px -1px 0px rgba(0, 0, 0, .1); } *[theme="dark"] { /* access bar */ --base-0: 36, 41, 46; } html, body { /* fonts */ --body-1: normal 14px/24px sans-serif; --body-2: normal 12px/16px sans-serif; --header-1: bold 16px/24px sans-serif; --header-2: bold 14px/24px sans-serif; } /* component styles */ kor-tab-item { --accent-1: 249, 130, 108; } ``` --- ## Theme 3: Spotify Spotify’s UI are mostly recognised by the pill-shaped buttons and monochromatic color scheme except for the use of green as the main accent color. The brand typography is also quite unique and recognisable through its circular capitals and wide characters. [Link to Stackblitz project](https://stackblitz.com/edit/kor-ui-theme-spotify) ![](https://dev-to-uploads.s3.amazonaws.com/i/nsbwx29dyh9x10gr2945.png) Key elements of the theme: - **Base colors** were slightly adjusted - **Accent color** was set to a dark shade of green - **Shadows** were removed - **Fonts** were set to ‘Raleway’ (closest open source match to - Spotify’s own ‘Circular’ font) - **Buttons** had their min-width and border-radius increased, while fonts got capitalised --- ## Conclusion In this post we have covered the basics of how themes can be created using **[Kor UI](https://kor-ui.com/)** and we have chosen three popular websites or web apps as examples to showcase how it can be done. These themes are public and can be used or modified by anybody. If you would like to know more about creating or modifying themes, we recommend checking the following post:
eduferfer
476,886
What Tech I Use in 2020 As Developer
Software, Hardware and other stuff I use during my work Photo by Dhaval Parmar on Unsplash...
0
2020-10-05T14:53:08
https://dev.to/devbyrayray/what-tech-i-use-in-2020-as-developer-np7
development, programming, apple, javascript
## Software, Hardware and other stuff I use during my work Photo by [Dhaval Parmar](https://unsplash.com/@dhaval?utm_source=medium&utm_medium=referral) on [Unsplash](https://unsplash.com?utm_source=medium&utm_medium=referral) So now and then I get a question what I use for software and hardware as a developer. Well here you have my list of all the things I used in 2020. _This list also includes affiliate links, this is how you can support me 🤗_ ## Software * [Visual Studio Code](https://code.visualstudio.com) * [iTerm](https://www.iterm2.com) * Safari & Chrome * [Slack](https://slack.com/intl/en-nl/), [Discord](https://discord.com), [Teams](https://teams.microsoft.com), [Whatsapp](https://web.whatsapp.com), [iMessage](https://support.apple.com/nl-nl/HT207006) * [oh-my-zsh](https://github.com/ohmyzsh/ohmyzsh) * [Gitlab](https://gitlab.com) * [Github](https://github.com) * [Spectacle](https://www.spectacleapp.com) (Free Window manager for Mac) * [Bear app](https://bear.app) * [Github Desktop](https://desktop.github.com) * [Dashlane](https://www.dashlane.com/cs/V1MPfQv_GRCY) (great multi platform password manager) * [Pixelmator Pro](https://www.pixelmator.com/pro/) * [Gravit Designer](https://www.designer.io/en/) * [Terminus](https://termius.com) (great tool for SSH) * [Netlify](https://www.netlify.com) ## Tooling * [FaunaDB](https://dashboard.fauna.com/accounts/register?utm_source=Dev.to&utm_medium=referral&utm_campaign=DevByRayRay_WhatTechIUsed2020) (The data API for your client‑serverless applications) * [Formly](https://formly.dev) (Build Forms in Angular with JSON) * [Luxon.js](https://moment.github.io/luxon/) (JavaScript Date Library) * [Prettier](https://prettier.io/) (An opinionated code formatter) * [StandardJS](https://standardjs.com/) (JavaScript style guide, linter, and formatter) * [Faker](https://www.npmjs.com/package/faker) (generate massive amounts of fake data in the browser and node.js) * [LibPhonenumber-js](https://www.npmjs.com/package/libphonenumber-js) (A simpler and smaller rewrite of Google Android's libphonenumber library in javascript) ## Courses By WesBos I'm totally not the guy who is heavily promoting developer courses, but the courses from my hero Wes Bos are simply the best! I've followed a couple myself 😉 * [Beginner JavaScript](https://BeginnerJavaScript.com/friend/MRFRONTEND) * [Master Gatsby](https://mastergatsby.com/friend/MRFRONTEND) * [Advanced React & GraphQL](https://AdvancedReact.com/friend/MRFRONTEND) * [React For Beginners](https://ReactForBeginners.com/friend/MRFRONTEND) * [ES6](https://ES6.io/friend/MRFRONTEND) * [Learn NodeJS](https://LearnNode.com/friend/MRFRONTEND) * [CSS Grid](https://CSSGrid.io/friend/MRFRONTEND) (_Free 🔥_) * [Learn Redux](https://LearnRedux.com/friend/MRFRONTEND) * [JavaScript 30](https://JavaScript30.com/friend/MRFRONTEND) (_Free 🔥_) * [Flexbox](https://Flexbox.io/friend/MRFRONTEND) ## Streaming * Music: Apple Music, Apple Podcasts, Mixcloud, Soundcloud * Video: Youtube, Netflix, Apple TV+, Amazon Prime * Developer Podcast: [SyntaxFM](https://syntax.fm) by Wes Bos ## Hardware - 27 inch Philips: [Amazon](https://amzn.to/3lSrd69) - 24 inch iiyama (not for sale anymore 😅) - Monitor stands with 2 arms: [Amazon](https://amzn.to/3k4RKwA) - Macbook Pro 2018: [Amazon](https://amzn.to/3iY47Jq) - Apple Wireless Keyboard: [Amazon](https://amzn.to/37cE7Ys) - Apple Keyboard (wired): [Amazon](https://amzn.to/3lQ13kr) - Logitech MX Master 2 (Cobal blue and Graphite): [Amazon](https://amzn.to/31elAay) - Rode NT USB Mic: [Amazon](https://amzn.to/31ftm3T) - USB-C dongle: [Amazon](https://amzn.to/2SYPqev) - Ikea White Desk (height adjustable): [Ikea](https://www.ikea.com/nl/en/p/skarsta-desk-sit-stand-white-s59324818/) - Chair (unbranded) - Sony Wireless Headphone ANC (WH-XB900N): [Amazon](https://amzn.to/3k44NOB) - Apple AirPods Pro: [Amazon](https://amzn.to/37di9Vu) I hope that you found something new to use in your toolbox! I do my best to update this post as much as possible through 2020. If you are missing something in this list, please request it in the comments so I can add it 👍
devbyrayray
483,263
22 tips for coaching remote teams
Becky Hammon the first-ever female head coach in the NBA’s Summer League for the Spurs and the first...
0
2021-02-04T14:17:24
https://medium.zenika.com/22-tips-for-coaching-remote-teams-1e04232f9607
remoteworking, coaching, wfh, teamwork
--- title: 22 tips for coaching remote teams published: true date: 2020-05-09 13:16:58 UTC tags: remoteworking,coaching,wfh,teamwork canonical_url: https://medium.zenika.com/22-tips-for-coaching-remote-teams-1e04232f9607 --- ![](https://cdn-images-1.medium.com/max/1024/1*xLYYKrOHa1uwyGfUpLn5ww.jpeg)<figcaption>Becky Hammon the first-ever female head coach in the NBA’s Summer League for the Spurs and the first female NBA head coach to win a Summer League title.</figcaption> > By coaching I mean guiding a group of individuals from _“what are we here for again?”_ to _“now that we stated the right problem and that we actually share the same purpose, let’s act on it”_ with simple tools and process. For the past 4 weeks I have been remotely coaching 5 teams of 4 to 6 people and I must say it has been the most draining time of my pro life. I feel like one hour of remote meeting is probably equivalent to a 4-hour non-stop IRL workshop. After the first 2 sessions I realized I was totally worn out, really late on the schedule I had planned, quite unhappy about what came out of our group and simply clueless about how to deal with remote. So, after each session I decided to make a quick retro with myself to come up with improved remote coaching guidelines. Here they are after a few retros, feel free to complete and challenge them. Let’s jump in! ### Why remote work is hard A word beforehand about remote. Going full remote is a harder way to work in groups (for now) and there are many reasons to it: we’re not all used to it yet, we have not found the optimal organization yet, some of our tools need improved UX, etc. But the real reasons are mostly physiological ones that could be summed up by “we are simply not meant for that”. On video calls our eyes get sore quickly (a lot of people experience eye fatigue nowadays) and our brain doesn’t like at all the impression of being constantly watched by everyone. Also, while working remotely we are deprived of the perception of body language (especially if people don’t activate their camera during meetings). And body language is key to our comprehension of the other human being in front of us. Without body language, we become clueless and we spend more energy trying to communicate efficiently. [These articles](https://www.bbc.com/worklife/article/20200421-why-zoom-video-chats-are-so-exhausting) about [the Zoom fatigue](https://www.forbes.com/sites/tracybrower/2020/03/30/why-working-from-home-is-so-exhausting-and-how-to-reinvigorate/#5bb6b2b755ab) are [really interesting](https://www.nationalgeographic.com/science/2020/04/coronavirus-zoom-fatigue-is-taxing-the-brain-here-is-why-that-happens/) to read. ### So more than ever, you need to prepare upfront. When working with groups (2 people is a group) I usually set up a pretty detailed agenda and a bunch of facilitation tools. With time and experience you’ll get to know your basics and will be able to improvise and adapt, but still, I like to have my timetable and check list ready — but also, this (let’s jump in): #### 1. Don’t plan more than 90 minutes for a remote session. Ninety minutes is already too much. If you need more time, reconsider your goals, split them and schedule more slots. I now plan 50 minutes of work. This gives people a 10-minute break in case they have to go on with another meeting. #### 2. Keep the team under 5–6 people. This one is close to IRL limitations. If you want everyone to be active and committed, four is a good number. #### 3. Email upfront the agenda and purpose of the session. Two or three days upfront, email the agenda of the session mentioning the working phases, deliverable, tools, and all things the group needs to prepare beforehand. Remind them what you expect to achieve together. Could be as simple as: > Our aim for this session is to share the same vision of what we’re here for and to agree on the approach and tools we’ll use to get to the action plan. Please gather in the shared drive (link to it) all the material you think is relevant. I’ll go through this material before we meet. #### 4. Don’t use Doodle (or equivalent) to schedule. Having everyone playing around with time-slots, waiting for everyone to fill in and finding the right match is pure nightmare. Don’t spend your time on this, it is more valuable on other tasks (as you’ll see below). Either impose a time slot (as long as it is planed way ahead, people can find room in their agenda) or make a list of available slots in your schedule and ask people to subscribe to them. Tools such as [Calendly](https://calendly.com/) can help (which I use for one-to-one meetings). #### 5. Triple check that everyone knows when, where and how to meet. Every organization has different remote tools (Google Meet, Microsoft Teams, Zoom, etc.) Once the time-slot is set, make sure you send an invite to participants with the right connection link, check their replies. Remind the when-where-how to meet from one session to the other. It is indeed frustrating to start a remote meeting late because of this, and even more frustrating to be late just because you don’t know where and when to meet. In the chapter of “how” to work together, don’t stress people with fancy new tools unless you are absolutely sure they already use them. I made that mistake twice pushing [Miro](https://miro.com) (a nonetheless super great tool) to the group, too soon and with no prep upfront. Don’t do that :) When one person has trouble using it, all the group feels rightly stressed out. #### 6. Share more ahead. Don’t rely solely on the time you have together. Attention spans are way shorter when you work remotely so you will have to share more materials in between sessions and you’ll probably have to give ‘homework’ to the team to make real progress. Yet, don’t overwhelm the team with too much resources to read upfront. Prefer short videos: people can “listen to” videos while cooking for instance, but cannot read while cooking. And yes, unfortunately, we all multi-task more. When asking the group to prepare or deliver something for the upcoming session, ease the work by giving them simple guided templates. Pre-fill your template with sample answers, to set the tone and level of precision you expect. Make sure you are available for questions. ### During the coaching session #### 7. Have a quick mood check. <iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F3ohfFsSZML7BeZUsXS%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F3ohfFsSZML7BeZUsXS%2Fsource.mp4&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2F3ohfFsSZML7BeZUsXS%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="244" frameborder="0" scrolling="no"><a href="https://medium.com/media/7a170ec9f64b80da4384bba9d47e634a/href">https://medium.com/media/7a170ec9f64b80da4384bba9d47e634a/href</a></iframe> Although there are plenty of them, you don’t have to use fancy tools / cards / games / icebreakers to do this. A 2-minute chat with everyone can tell you a lot about the team mood and the individual moods. At least ask for the level of energy, in the chat for instance... (0 being _“I’m totally worn out”_ to 5 _“I feel really great”_). Animated gifs work great for that as well. #### 8. Create rituals / habits. Mood check is one. Having your session on the same day (every Tuesday afternoon) is another. Playing a song while waiting for everyone to check in is another one of my favorite, it’s fun and fuels the first conversations. When working remotely, rituals are even more important to reduce mental load. The less you have to think about the how, the more you can focus on the what. #### 9. Make sure the workshop guidelines and the process are crystal clear. The process is how you designed the workshop (the steps participants will go through). The guidelines are the instructions to follow the path and the rules we are going to live by. **Make sure the process is crystal clear:** explain upfront how you designed the session and why. Give / display the timing (once), so that everyone moves along more or less the same pace. Make “pitstops” : short breaks to make sure people can ask questions if they need to. Or have a glass of water. Announce loud and clear when you are moving to the next step of the process. “Ok we just finished step 1 (remind step 1), time to move on to step 2 (describe step 2)”. Yes it takes time to do that every time but in the end you’ll gain commitment, clarity and focus. It’s important that people know when to close a mental door. **Make sure the guidelines are crystal clear:** when working remotely, people are less concentrated and more tired. They have kids running around, a lame Internet connection, a delivery guy at the door, etc. Repeat the guidelines in various ways, and if possible, ask someone in the group to restate them. <iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2Fl1IY22MxwNKlDfwpq%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2Fl1IY22MxwNKlDfwpq%2Fsource.mp4&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2Fl1IY22MxwNKlDfwpq%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="244" frameborder="0" scrolling="no"><a href="https://medium.com/media/a3d5c55245ac1e42c13d9a6c09f4804f/href">https://medium.com/media/a3d5c55245ac1e42c13d9a6c09f4804f/href</a></iframe> Generally speaking, **have an unequivocal, harsh and straight-to-the point language** : explain who will be doing what. _“We are going to work in 3 phases of 20 minutes”_… _“I’ll be taking notes and keeping time”_… _“We’ll gather our ideas in ten minutes”_… _“Andrea proposed herself to pitch the deck, let’s now listen to her”_… _“Who can pass on the slides to Sophie who’s not here today?”._ Simple, clear (and a bit directive) language. #### 10. Forget about true spontaneity. If you planned on spontaneity to achieve a task (a creative brainstorming for instance), you’d better move on to something else. With remote you’ll lack everything that usually drives real spontaneity : direct interactions, body language and timing. In a virtual meeting, people are behind a screen and that split-second when you mind goes through all sorts of questions such as _Can I interrupt to jump in? Do people hear me? Is there anyone else who want to talk right now? Is my mike open? Did someone already ask the same question in the chat?_ is enough to put all spontaneity down. Of course you can drive some sort of impulse with dedicated tools (mainly imagery) but know that it’s “not the same” :) #### 11. Use the 2 microphones rule. Allow only 2 microphones on at the same time. If a third person wants to speaks one of the two firsts needs to switch off. It’s a little messy the first time you try it but in the end it is as efficient as a talking-stick. And it saves bandwidth. #### 12. Always show the way. <iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2Fl1IYbqiZUIi1Qp9cs%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2Fl1IYbqiZUIi1Qp9cs%2Fsource.mp4&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2Fl1IYbqiZUIi1Qp9cs%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="244" frameborder="0" scrolling="no"><a href="https://medium.com/media/3193f97f2c1e7540776a42b197d5da2d/href">https://medium.com/media/3193f97f2c1e7540776a42b197d5da2d/href</a></iframe> If you ask people to do something, do it first, show the way. Especially if you want to use icebreakers. Icebreakers are often intimidating and for the first person to go, it’s not easy to figure out where to put the cursor between fun and seriousness. So go first, set the tone and name the next person to go. People will jump right after you more easily. That’s the same for other types of exercises: if you ask people to present something shortly, go present something shortly so that they see what level of details you expect. Same rule for chat use. #### 13. Have some stand-up sessions. Depending on the time of the day, you can propose to have a stand-up meeting. When working remotely we tend to sit way more than usual and our brain gets lazy when seated. Having a stand-up session feels weird at first but you’ll notice the difference. #### 14. Note \*everything\* down. (Or record if you can) Live coaching is hard, remote coaching is exhausting and there is a good chance you won’t remember everything that happened / was said. Taking thorough notes will tremendously improve your context switching and thus your coaching focus. #### 15. Make progress observable, not measurable. I’m not a big fan of measurable goals, KPIs or even OKR. They are narrowing our perception of a complex reality to simplistic indicators and prevent us from paying attention to details or interesting side tracks. <iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F3o6UB844gEgKmcwuRO%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F3o6UB844gEgKmcwuRO%2Fsource.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2F3o6UB844gEgKmcwuRO%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="326" frameborder="0" scrolling="no"><a href="https://medium.com/media/6921b2d843ab1e83b02411750d8d4cda/href">https://medium.com/media/6921b2d843ab1e83b02411750d8d4cda/href</a></iframe> Everything that can be measured is not necessarily important. And most important things cannot be measured easily. And let’s face it, we are very bad at dealing with data, correlation, causality, biases, etc. Plus, living by one or two KPI makes you miss the whole context. [Don’t fall under the Law of Instrument with data](https://medium.com/thethursdaythought/when-all-you-have-is-a-hammer-everything-looks-like-a-nail-the-einstellung-effect-on-67ee8449f740) and KPIs, reality is more complex than a bunch of indicators. Plus, to figure out your way in complex environments, you’d need way too many data you don’t have anyway. **So lead the team towards observable actions.** Not measurable actions. Ask them \*what\* they want to observe as a result of their actions. Important things in life such as happiness, joy, commitment, expertise, even rebellion, are easily observable but not measurable. Observables are proof. KPIs usually stay as intentions. #### 16. Show twice as much appreciation. Remember that as living creatures, we usually evaluate interactions mainly through our [non verbal attitude](https://www.verywellmind.com/types-of-nonverbal-communication-2795397). Working remotely, we are deprived of this superpower and we can’t show appreciation through this body language (eye contact, smile, etc.). <iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F3ohfFKfbr01z7PIfeM%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F3ohfFKfbr01z7PIfeM%2Fsource.mp4&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2F3ohfFKfbr01z7PIfeM%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="244" frameborder="0" scrolling="no"><a href="https://medium.com/media/ff407e65c28279636b653b8bfcd565b1/href">https://medium.com/media/ff407e65c28279636b653b8bfcd565b1/href</a></iframe> Remote group work is hard, so show a lot of unequivocal appreciation for the group’s work. For instance _“I’m very happy we met our target today, it was not easy and we did great.”_ or _“Thank you all, I learned a lot today and had much pleasure listening to your ideas and guiding you through the process.”_ Take time to thank everyone, even if it’s just one sentence. _“I really appreciate the time we spent here, thank you for your energy / humor / focus / time.”_ Of course, mean it. #### 17. Invite for real feedback and questions. Preferably asynchronously. Don’t wait for the last 5 minutes to get feedback: as you will probably be late on your schedule (at least the first 3 sessions), people will be tired and not in the mood to give you proper feedback, even more so if they feel in a hurry. Here are ideas on what you can do : - ask feedback by email - or with a simple form - or with [a ROTI](https://roti.express/) - or at the beginning of the following session “what’s your feedback / feeling about what we did last time?” - or open an 24/7 idea box (include the link in every agenda invitation) #### 18. Have conversations, not slides. Draw. Talk. Sing. Use photos. Gifs. Nothing. Whatever. But not slides. #### 19. Make a wrap up. It’s as simple as > This is what we were here to do. This is what we did / produce. This has been clarified. This still needs work. Here are the next steps. #### **20. Finish 5 minutes early.** During lock-down most of my days were packed with 5 or 6 virtual meetings. I double appreciated the ones that finished 5 mns early. Do as well for your sessions. ### After the session #### **21. Surprise and gift** While sending the minutes of the session (usually by email) — or the next invite — include something surprising or fun or useful in your email as a PS. I do this almost all the time and it’s another way to bond with people (through humor often) and to show genuine care. Of course, pick something that is relevant to their situation. People will remember more easily the session with what you sent (I get this kind of message afterwards: “I’ve worked on the topic auto-organization… you know, when you sent the Trello link / TED video / fun template you sent”) #### **22. Be available for one-to-ones.** ![](https://cdn-images-1.medium.com/max/1024/1*E8vF54RU_1-zPm6KKhxuGw.jpeg) Even if you were asked to coach a team, make sure everyone feels secure to reach out to you for one-to-one conversations. You want to enforce psychological safety in your team and that’s one way to do it. You’ll get a lot from these. ### Now your turn :) As you can see there is a lot to think about to help a team work remotely. And surprisingly, it doesn’t require much fancy tools to do great work. The best thing you can give is your plain attention and dedication, sharp focus, and authentic care. And, bonus! All this applies to IRL workshops as well :) I hope these tips can help you get started. It’s a fabulous experience, so diverse and incredibly fulfilling. One that makes you feel useful and human. * * *
karinesabatier
485,002
Introduction to Assembly
Hello! Lets have a look at the Assembly language. Assembly is one level above binary, which runs on...
0
2020-10-12T17:01:04
https://dev.to/anja/introduction-to-assembly-3ig0
assembler
Hello! Lets have a look at the Assembly language. Assembly is one level above binary, which runs on your hardware. The Assembler converts Assembly into binary. In the following 'Hello World' code we are working with the registers of a Raspberry Pi, which are contained in the CPU and can hold up to 32 bits. This is the code: ``` .global _start _start: MOV R7, #4 //System call to output to screen MOV R0, #1 //Set monitor as output stream MOV R2, #12 //String Length LDR R1, =message //Load register with address of string SWI 0 //Software interrupt end: MOV R7, #1 SWI 0 //This combined with line above:Software interrupt, //saying to return to the terminal .data //Signify that what follows is data message: .ascii "Hello World\n" ``` MOV R7, #4 means, that we put a 4 into the register 7 and it tells the System to output something on the screen. LDR means "load" and inside R7 there will be saved the starting adress of the String "message". SWI is the so called software interrupt function. A software interrupt sends a signal to the Operating System. When it receives this interrupt signal it will check the values which are in the registers R0 and R7 and act accordingly, printing Hello World to the screen. After this it continues with the following lines in the code and returns to the terminal. Did you work with Assembly yet and what did you program? Have a nice day. :) Sources: https://www.youtube.com/watch?v=ViNnfoE56V8&feature=youtu.be
anja
485,382
The One and Only Software Design Principle
If we build our entire paradigm on a single rule, we can keep it simple and make excellent models. Be...
9,471
2020-10-13T02:29:33
https://codeburst.io/the-one-and-only-software-design-principle-5328420712af
beginners, tutorial, design, oop
If we build our entire paradigm on a single rule, we can keep it simple and make excellent models. Being minimalist and being axiomatic means we can derive a set of rules from a single definition. If we build our entire paradigm over one single rule we can [Keep It Simple, Stupid](https://en.wikipedia.org/wiki/KISS_principle) and make excellent models and thus excellent software. One of the most underrated quality attributes on software is the kind of being predictable. [We are taught at the university and books that software should be fast, reliable, robust, secure, etc](https://books.google.com/books?id=mdiIu8Kk1WMC&pg=PA74&lpg=PA74&dq=clements+quality+attributes&source=bl&ots=UeR_V8ecOU&sig=ACfU3U25yW6Cbz9-Takxo2LNKrcc_yAPoA&hl=es-419&sa=X&redir_esc=y#v=onepage&q=clements%20quality%20attributes&f=false). but being predictable is almost nowhere on the top five design priorities. We are going to make an exercise on object-oriented software design by stating just one principle: > Each domain object must be represented by a single object in our computable model and vice versa. ![Model](https://dev-to-uploads.s3.amazonaws.com/i/z17telh3wte1qn79iyi0.png) The relationship between objects of the model and entities of real world is 1: 1 We can see the justification of this model in this article: {% link https://dev.to/mcsee/what-is-wrong-with-software-5pa %} We will then try to derive design rules and heuristics from that axiom, of course without contradicting it. # The Problem We will see that most of the language implementations used in the industry ignore this rule and this causes enormous problems. Invoking difficulties that arose in the construction of software 3 or 4 decades ago and that they almost no longer exist or are present in a few domains We keep on making monkey decisions beating each other without knowing[ the reason for such behavior.](https://www.youtube.com/watch?v=pgJ8-IaBSeY) ![Monkey](https://dev-to-uploads.s3.amazonaws.com/i/vuz6j3wstk1ktrxby1wu.jpg) Monkey and banana experiment ## Models to the rescue When building models of any kind we want to be able to simulate the conditions that occur in the observed real world so that we can follow each element of interest in our simulation and stimulate it to observe the changes in the same way that they happen in the real world. Meteorologists make mathematical models to predict and anticipate the behavior of climate and most scientific disciplines are based on these simulations. With the rise of machine learning, we build black-box models to predict behaviors in real life. ## The importance of bijection In the domain of software and under the paradigm of objects we will always have one and only one object representing a real-world entity. Let's try to prove by the absurd what would happen if we did not comply with the principles of being a bijection. ### Common cases in the industry that violate bijection Case 1) We have an object in our computable model to represent more than one real-world entity. For example, many programming languages ​​model algebraic measures using only scalar magnitude. Then we can represent 10 meters and 10 inches (two completely different entities in the real world) by a single object (the number 10) and we could add them together obtaining that in our model the number 10 (representing 10 meters) the number 10 (representing 10 inches) is equal to the number 20 (representing who knows what). ![broken bijection](https://dev-to-uploads.s3.amazonaws.com/i/0ruf6swynjudhinbribk.png) Bijection is broken This generates problems not always captured on time. Because it is a semantic fault, the error usually occurs long after the failure as in the famous case of the [Mars Climate Orbiter](https://www.latimes.com/archives/la-xpm-1999-oct-01-mn-17288-story.html) ![Mars Probe](https://dev-to-uploads.s3.amazonaws.com/i/1ri38jiqk82v1zcuwgju.jpg) The probe exploded by mixing different units of measurement Case 2) Our computable model represents the same real world entity with two objects. Suppose we have in our observable real world an athlete John Smith who competes in one discipline but who is also a judge in another athletic discipline. A single person in real world should be a single object in our computable model. We need to model just the minimum behavior to fulfill our partial simulation. If we have two different objects (a competitor and a judge) that represent Jane Doe, we will sooner or later have inconsistencies by wanting to assign some responsibility to one of the two and not see it reflected in the other. ![Jane Doe](https://dev-to-uploads.s3.amazonaws.com/i/xm1dpep64j4m7vr05092.png) Jane Doe Is represented on our model by two different entities Case 3) A bitcoin wallet can be represented as an anemic object (with some properties regarding address, balance etc) or by a functional one (with responsibility such as receiving transactions, writing to a blockchain etc) but it's clear for someone who is not in software business they are related to the same concept. So the bijection must be held. To solve these types of problems we must stop seeing entities as *data structures with attributes*, think of them as objects and understand that they are the same object fulfilling different roles depending on the context in which they are interacting. Case 4) In most modern object programming languages, a date can be constructed by creating it from its day, month and year.\ We all learned that a November 31th, 2020 can be created and that most of the languages ​​will gently return a valid object (probably December 1st, 2020). But this disguised as a benefit is nothing but error hiding, generating a coupling dependency to the design decision made by the programming language and hiding a sure error in the data load. {% medium https://codeburst.io/coupling-the-one-and-only-software-design-problem-869e293a9f04 %} The error will raise when running a nightly batch processing these dates far from the root cause violating the [Fail Fast](https://en.wikipedia.org/wiki/Fail-fast) principle. {% medium https://codeburst.io/fail-fast-3f3f036032b0 %} # Conclusions In this article, we define the only axiomatic design rule that we will respect no matter what by justifying the problems that come with not respecting it and laying the foundations for future definitions derived from it. * * * * * Part of the objective of this series of articles is to generate debate and discussion spaces on the problem of software design. We look forward to the comments on this article. # Acknowledgements Part of the ideas in this article were developed together with Hernan Wilkinson and all the members of Software Engineering Staff on [*Universidad de Buenos Aires.*](https://www.isw2.com.ar/) This article is published at the same time in Spanish [here](https://medium.com/@mcsee/el-%C3%BAnico-principio-de-dise%C3%B1o-de-software-importante-36c3c4f64c1b).
mcsee
485,620
#1 Kèo Nào - Tổng hợp tin tức, lịch thi đấu, tỷ lệ kèo bóng đá
KÈO NÀO ✅ Tổng hợp tin tức bóng đá ✅ Lịch thi đấu bóng đá ✅ Kết quả bóng đá ✅ Bảng xếp hạng bóng đá ✅...
0
2020-10-13T08:40:41
https://dev.to/keonaocrop/1-keo-nao-t-ng-h-p-tin-t-c-l-ch-thi-d-u-t-l-keo-bong-da-4ced
KÈO NÀO ✅ Tổng hợp tin tức bóng đá ✅ Lịch thi đấu bóng đá ✅ Kết quả bóng đá ✅ Bảng xếp hạng bóng đá ✅ Trực tiếp bóng đá ✅ VIP 24/7 #keonao #keo_nao #bong_da_keo_nao #soi_keo https://keonao.com/soi-keo/ https://keonao.com/nha-cai/ https://keonao.com/game-bai/ https://keonao.com/ban-ca-doi-thuong/ https://keonao.com/keo-nha-cai/ https://keonao.com/ty-le-keo/ https://keonao.com/lich-thi-dau-bong-da-hom-nay https://keonao.com/ket-qua-bong-da-hom-nay https://keonao.com/bang-xep-hang-bong-da https://keonao.com/truc-tiep-bong-da/ https://keonao.com/soi-keo-asian-cup/ https://keonao.com/soi-keo-bundesliga/ https://keonao.com/soi-keo-cup-c2/ https://keonao.com/soi-keo-euro/ https://keonao.com/soi-keo-la-liga/ https://keonao.com/soi-keo-ligue-1/ https://keonao.com/soi-keo-ngoai-hang-anh/ https://keonao.com/soi-keo-serie-a/ https://keonao.com/soi-keo-world-cup/ https://keonao.com/soi-keo-dtqg/
keonaocrop
486,462
Python ile 5 Dakikada Nesneye Yönelik Programlama
Sınıflar sadece python'da değil diğer programlama dillerinde de işimizi oldukça kolaylaştıran yapılar...
9,229
2020-10-14T16:03:21
https://dev.to/w3eydi/python-ile-5-dakikada-nesneye-yonelimli-programlama-1pbf
python, oop, datascience
Sınıflar sadece `python`'da değil diğer programlama dillerinde de işimizi oldukça kolaylaştıran yapılardır. Python'da oluşturduğumuz her int, str, list gibi yapılar aslında sınıf olarak oluşturulmaktadır. Temel olarak sınıflar birden fazla özelliği, metodu kendi içerisinde barındıran şablonlardır diyebiliriz. - **Sınıf(class) oluşturma** ```python class BenimSinif(): ozellik1 = "" programlamaDili = "Python" ``` - **Sınıftan örnek(instance) oluşturma** ```python ornekOlustur = BenimSinif() # örnek oluşturulan sinifin özelliğine ornekOlustur.ozellik1 # şeklinde ulaşabiliriz. ``` - **Sınıflarda kurucu(constructor) fonksiyon oluşturma** **`__init__`** ile başlayan ifade aslında oluşturduğumuz örneklere(instance) göre özellikler tanımlamamız için gereklidir. İçerisinde `self.` ile sadece örneklere özgü özellikler tanımlayabiliyoruz. ```python class BenimSinifim(): sinifOzelligi = [] # genel özellik def __init__(self): self.isim = "" self.bolum = "" # sinifimizin özelliğine erişme ornekSinif = BenimSinifim() ornekSinif.isim = "Eydi" # şeklinde atama yapılabilir. # genel özelliğe erişmek için BenimSinifim.sinifOzelligi.append("Eydi") # şeklinde atama yapılabilir. BenimSinifim.sinifOzelligi # Not: Bu şekilde atama yapıldığında oluşturulan örneklerden(instance) # atama yapılmamış(varsayılan) olanlarda değiştirilebilir. ``` - **Farklı bir metod oluşturarak atama yapma** Sınıflarda çoğu zaman enkapsülasyon yapmamız gerekiyor. Genel özelliklerin dışında, her oluşturulan örneğin(instance) metod ile kendine ait özelliklerini değiştiririz. >**Not:** **`_isim`** şeklinde yazılan değişkeni **`isim`** şeklinde de yazabilirdim. Aslında tanımlanan metoda ait yerel değişken oluyor. Çok fazla kafa karışıklığına yol açmamak için bu şekilde kullandım. ```python class BenimSinifim(): def __init__(self): self.isim = "" def isimYazdir(self, _isim): self.isim = _isim # oluşturduğumuz sınıftan örnek(instance) oluşturarak ornekSinif = BenimSinifim() ornekSinif.isimYazdir("Eydi") ornekSinif.isim # denilerek ekran da kendi isminizi yazdırabilirsiniz. ``` - **Kurucu(constructor) fonksiyon ile atama yapma** En başında örneği(instance) oluştururken tanımlama yapabiliriz. ```python class Calisanlar(): # miras alınmıyorsa parantez kullanmayabiliriz. def __init__(self, isim, soyIsim): self.isim = isim self.soyIsim = soyIsim # şimdi instance(örnek) oluşturalım. eydi = Calisanlar("eydi", "gözeneli") eydi.isim # Çıktı da 'eydi' yazacaktır. eydi.soyIsim # Sizde kendi isminizi deneyebilirsiniz. ``` - **Kalıtım(Inheritance), Miras alma(Inherit)** Şöyle düşünelim: Ortak özelliklere sahip bir topluluğumuz var. Örneğin; bir üniversite de akademisyen ve öğrencilerden oluşan bir topluluk. Ortak özellikleri ve kendilerine ait özellikleri bulunacaktır. Böyle bir durumda her birini tek tek tanımlamak yerine ortak özellikler bir kere tanımlanır. Geriye kalan özellikler kendi içlerinde tanımlanır. Nedir bu ortak özellikler? İsim, yaş, vb. özelliklerden bahsedebiliriz. Kod örneğiyle açıklayalım. ```python class Kisiler(): def __init__(self, isim, soyIsim): self.isim = isim self.soyIsim = soyIsim class Akademisyen(Kisiler): # kalıtım alıyoruz def __init__(self, isim, soyIsim,bolum): super().__init__(isim, soyIsim) # üst sınıftaki kurucu metoddan # önceki tanımlamalarımızı çekiyoruz self.bolum = bolum # bu sınıfa özgü özellik class Ogrenci(Kisiler): def __init__(self, isim, soyIsim, sinif): super().__init__(isim, soyIsim) # super() Ogrenci sınıfı içinde # kullanılıyor self.sinif = sinif eydi = Akademisyen("eydi", "gözeneli", "mekatronik") eydi.bolum eydi.isim esma = Ogrenci("esma", "gözeneli", "4. sinif") esma.isim esma.sinif ``` >**Not:** **`super().__init__(...)`** **metodu** ile üst sınıfımızdaki kurucu(constructor) fonksiyonumuzdaki eşitlikleri tekrar **üstüne yazmamıza(override)** gerek kalmadan sınıfımıza dahil ediyoruz.
w3eydi
487,128
Por que eu fujo enquanto ele luta?
Quem nunca refletiu sobre essa pergunta ao ouvir a clássica frase quanto o tópico é ansiedade, de qu...
0
2020-10-14T20:09:18
https://dev.to/thiagopederzolli/por-que-eu-fujo-enquanto-ele-luta-3c6k
<p> Quem nunca refletiu sobre essa pergunta ao ouvir a clássica frase quanto o tópico é ansiedade, de que é ela a responsável por ativar nossos mecanismos psíquicos frente à situações amedrontadoras. </p> <p> Ao nos depararmos com uma situação de perigo, que nos gere a sensação desconfortável de medo e incapacidade, várias vezes nos deparamos com essas duas escolhas: posso enfrentar o que se encontra no meu caminho ou retroceder, fugir e escolher outro caminho. </p> <p> Nem sempre nossas escolhas acabam estando de acordo com nossas vontades e mais na frente da vida isso costuma cobrar um preço através de cobranças de terceiros ou internas sobre o porquê ter agido daquele jeito. </p> <p> Muito se fala sobre a importância de não se comparar, de que você deve se preocupar em ser melhor que você. Mas, ao meu ver, isso inibe uma outra parte importante para percepção da resposta que procuramos. É importante não se comparar com o outro em termos de evolução pessoal e do outro, mas é bom olhar as diferenças em relação ao outro para entender contexto. </p> <p> O título é uma pergunta sem resposta pronta, se você chegou aqui procurando a solução dos problemas, esse artigo não lhe ajudará. </p> <p> Para a psicanálise, é a existência do Outro que baliza nosso desenvolvimento. É o olhar dos pais e a validação de nossas atitudes que nos individualiza. Portanto, é involuntária e enraizada na nossa estruturação a ação de comparar-se aos outros. O filho quando pequeno compara-se ao pai, ao irmão mais velho. </p> <p> A sociedade é cunhada na arte da comparação, nos forçam a comparar nossos corpos com padrões de beleza, nos vendem estereótipos de histórias de sucesso para que comparemos a nossa com elas. </p> <p> É algo muito difícil lutar contra essas ações comparativas, elas vem de um inconsciente coletivo muito forte e é por isso que muita gente justifica com “Eu sei que não deveria fazer, mas não consigo evitar”. </p> <p> E por que abordo este ponto? Porque acredito que acrescentar uma variável a essa comparação pode ajudar muito a diminuir o sofrimento que as comparações podem causar: <strong>Questionamento!</strong> </p> <p> <em>Por que estas te comparando com aquela pessoa? Por que estas te comparando agora? Qual a relevância desta comparação na tua vida? O que é que ambos estão fazendo representam para ti? </em> </p> <p> Tentar evitar comparações pode ser mais desgastante que lidar com as comparações em si. O fundamental é explorar os contextos, entender o processo todo, refletir sobre as histórias. Não é só sobre entender que histórias diferentes resultarão em ações diferentes, mas buscar entender um pouco do porquê disso ocorrer. </p> <p> Na era digital da informação, literalmente, na ponta dos dedos, nossa capacidade de reflexão começa a se tornar algo obsoleto e inibe a capacidade de abstração. O título não tem resposta, porque ele deveria ser um mantra. Deve ser algo a ser questionado, devemos entender o contexto em que o outro conseguiu algo que não conseguimos, devemos entender o contexto em que ele se desenvolveu, para conseguirmos também observar o contexto em que nos desenvolvemos. </p> <p> Entender o Outro e separar-se mentalmente dele é o principal ponto para conseguir uma compreensão melhor de si. É através desse processo reflexivo que conseguimos tomar mais consciência da nossa história, dando um contexto maior a momentos da nossa vida e através dessa nova compreensão ressignificar certas vivências para mudar nossos padrões de funcionamento, seja para que possamos lutar quando havíamos fugido ou para fugir em lutas que sabemos que não nos levarão a nada. </p> <p> Sempre lembrando que a forma mais segura de trilhar esse caminho de questionamentos é acompanhado de um profissional de psicologia capacitado para estar ao teu lado pelo processo todo. </p> <p> Lembrem-se: <strong> tudo que nos mobiliza fala mais da gente que dos outros.</strong> Então se me comparo com alguém é porque algo daquele outro toca <em>em algo meu</em>. É essa a reflexão que busco instigar com esse texto. </p>
thiagopederzolli
487,413
Announcing the 2020 State of CSS Survey
The annual CSS survey is back, this time in multiple languages
0
2020-10-20T04:24:18
https://dev.to/sachagreif/announcing-the-2020-state-of-css-survey-22n2
--- title: Announcing the 2020 State of CSS Survey published: true description: The annual CSS survey is back, this time in multiple languages tags: cover_image: https://stateofcss.com/images/stateofcss_socialmedia.png --- Back in 2016 we launched the very first edition of the [State of JavaScript](http://stateofjs.com/?source=devto) survey, and last year we decided to give it a little sister in the form of the [State of CSS](http://stateofcss.com/?source=devto) survey. It's taken us a while (is it October already?!) but we're happy to announce that the 2020 edition of the State of CSS survey [is now live](http://stateofcss.com/?source=devto), with the results hopefully following a few weeks from now. It's no secret that the web ecosystem never stays still, so the goal of the survey is to identify the latest trends in order to help you decide what to learn and use next! And speaking of not staying still, we've got our own share of innovations this year. ## Take the Survey in Your Language! Our biggest change is that we've localized the survey in as many languages as we could, thanks to a team of absolutely awesome volunteers. ![Taking the survey in Russian](https://dev-to-uploads.s3.amazonaws.com/i/twrl706yaf4ny7qt12sx.png) We knew that an English-only survey would always bias our results towards English-speaking countries, which meant writing off huge sections of the web development community. So we've always wanted to translate our surveys, and after [building our own survey platform from scratch](https://github.com/StateOfJS/StateOfJS-Vulcan/) we're finally able to do it! We've also adopted a new way of serving the translations via our [GraphQL API](http://api.stateofjs.com/) that will hopefully make it much easier to reuse translations from one survey to the next without having to start over each time. ## New CSS Features The survey itself has also changed. The past year has seen its fair share of new CSS innovations, and we wanted the survey to reflect that. Some of the new features we're asking about include: - [Subgrid](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Grid_Layout/Subgrid) - [Logical Properties](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Logical_Properties) - [backdrop-filter](https://developer.mozilla.org/en-US/docs/Web/CSS/backdrop-filter) (which we use in the survey itself by the way) - [line-clamp](https://developer.mozilla.org/en-US/docs/Web/CSS/-webkit-line-clamp) - [perspective](https://developer.mozilla.org/en-US/docs/Web/CSS/perspective) - [prefers-reduced-motion](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion) …and many more! ## Find out Your CSS Score If you're not feeling familiar with these few fresh-faced features, feel no fear: at the end of the survey, we'll show you a scorecard of sorts, along with a couple links where you can learn more about anything you missed. ![Get your CSS Knowledge Score!](https://dev-to-uploads.s3.amazonaws.com/i/heigdkpfqwf8viufd2up.png) ## Take (and Share!) the Survey The more inputs we have, the more insights we'll be able to extract from out data. So that's why we're asking anybody who builds websites and uses CSS to [take the survey](https://stateofcss.com/?source=devto). It takes about 15 minutes, and after you create an account you can come back anytime to finish it. The survey will be open until November 5th, so stay tuned for the results soon after that!
sachagreif
487,418
HacktoberFest Experience
I learned contributing to different projects in open source other than helping the community I worke...
0
2020-10-15T05:17:14
https://dev.to/rishittripathitherocking/hacktoberfest-experience-2p15
hacktoberfest
I learned contributing to different projects in open source other than helping the community I worked on repo which is good for programming and data structures and helps different people in getting the algorithms related to data structures or common problems here we wrote problems related to competitive programming as well. {% user rishittripathitherocking %}
rishittripathitherocking
487,605
Yup Schema Commonly Used Examples
Here are two commonly used schema validations using Yup: Phone number validation with Regex How to...
0
2020-10-15T09:21:20
https://dev.to/calvinpak/yup-schema-commonly-used-examples-2o45
javascript, schema, yup, regex
Here are two commonly used schema validations using Yup: 1. Phone number validation with Regex 2. How to compare two fields in Yup ```Javascript import * as yup from "yup"; const phoneRegex = /^\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/; const schema = yup.object().shape({ phone: yup.string().matches(phoneRegex, "Invalid phone."), password: yup.string().required("Password is required"), confirmPassword: yup .string() .oneOf([yup.ref("password")], "Mismatched passwords") .required("Please confirm your password") }); export default schema; ```
calvinpak
488,037
On Code Narrative
Editor's Foreword: This is a post from one of the developers on the Xyla Team. While not especially p...
0
2020-10-15T16:41:03
https://hello.xyla.io/blog/article/488037/on-code-narrative-3056
style, naming, python
_**Editor's Foreword**__: This is a post from one of the developers on the Xyla Team. While not especially pertinent to mobile marketing, it is an excellent showcase of our culture and the passion of our team members, so we have elected to include it. The article also benefits from being eloquent in excess and truly delightful to read — so much so that it warrants it's own foreword. Anyways, enough from me. Enjoy!_ – [Jacob Bone](https://dev.to/jabone1) Clarity in type and member names can constitute the difference between protracted and boring periods of familiarization when one team member needs to understand another's logic, and short but sweet explorations. Too oft have I chosen what appears to be the cleanest and simplest name, such as `Collector`, only to soon realize that it might signify myriad different referents depending upon the specialization and mood of the reader. ## Code as Metaphor While almost all metaphors, if extended indefinitely, break under their own weight and crush the will of the reader, they yield a few advantages when used decisively and at the core of the architecture: - Reduced collision of terminology and identifiers, through an unambiguous diction that is an alternative to already overloaded generic terms. - Better retention of code familiarity due to color and character imbuing often dry and repetitious syntax. - Improved developer morale from hilarity, or, preferably good-natured humor (rather than written beatings). ## The Thing Itself To give an example, I recently helped to create a web scraping framework to collect data from services that, while technically available to clients, was conspicuously omitted from APIs and otherwise made so laborious to access as to constitute an injurious burden on the resources of my employer. We called the project `Raspador`, as we are fond of Spanish project names. While good for projects, a translation of a term is a code that may be opaque to someone unfamiliar with the chosen language. By contrast metaphor, if not obscure, imparts unique character using familiar words. For `Raspador` we selected aerial combat terminology including `Pilot`, `Ordnance`, and `Maneuver` (whose only drawback is my fingers' preference of `ue` over `eu`). We could have chosen `Configuration`, `Data`, and `Stage` as generic analogies to these terms, but the latter have so many layers of previous and varied usage that the reader must first excavate their root meaning from beneath a heap of memories, then re-interpret that abstraction within the context of a scraper. As my gentle reader already may know, a `Pilot` is present throughout a mission and is the person, i.e. user profile, involved; `Ordnance` is loaded, carried, and deployed, constituting the data specific to the scrape at; and a `Maneuver` is one flight action targeted to a specific purpose, e.g., clicking a link element to access report data. ## One Thing in Moderation Code, as sustenance, technically requires no garnish or seasoning; and yet without it each line and each day may blend grayly into the next, fading the vision of the product. While code infused with narrative can become onerous, or simply insufferable—we did not for instance name local variables `a10` or even `warthog` (airplane models or nicknames)—it is a benefit to developers and product alike to render an implementation in terms flavorful, tasteful, and specific to keep the logic and process both on track and alive. ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/23fk76n8w13ncfowdg4e.jpg)
lfmyr
489,261
How do I write a 150 page doc in Markdown using github as version control then output to a designed .pdf when I want to release?
How do I write a 150 page book in Markdown using github as version control then output to a designed...
0
2020-10-16T18:50:18
https://dev.to/rowemore/how-do-i-write-a-150-page-doc-in-markdown-using-github-as-version-control-then-output-to-a-designed-pdf-when-i-want-to-release-5g38
documentation
How do I write a 150 page book in Markdown using github as version control then output to a designed .pdf whenever I want to release? I'm looking for a toolchain and workflow for version control and Continuous Integration / Continuous Deployment for a book of prose. some tools I've looked at: - gitbook - docusaurus - sphinx - pandoc I want to output to .mobi .epub and .pdf … and have the document be pretty and designed, with cover, in context illustrations, and tables. Can anyone point me in the right direction? Thank you. :)
rowemore
489,273
Improving Life For Part Time Workers
Background Recently I was asked by my manager how they could improve the working life of...
0
2021-08-16T06:45:26
https://dev.to/crr0004/improving-life-for-part-time-workers-4ngj
productivity
# Background Recently I was asked by my manager how they could improve the working life of part time software engineers. Working as part time software engineer myself, it makes sense to draw from my lived experience. To give you context about myself, I normally work on a range of development tasks. Professionally I have mostly worked on web-based systems, from front-end with React to back end with Node-JS and Java (Springboot/Spring, custom AWS lambda and enterprise level work with Oracle message passing). My personal work includes, but not limited to, C++ projects dealing with more low level tasks such a parallel programming with OpenCL, Android applications, windows native terminal multiplexer and machine learning prototypes. I don't outline this because I want to brag, for from it. I outline my experience because I hope it gives context to my point of view and how I have experienced the software development industry. In the following sections I use the term "do" as an instructional guideline and not as a hard rule, at the end of the day this is my opinion and you are free to do what you think is best. What I am about to say even goes against some [Agile Principles](https://agilemanifesto.org/principles.html). This is especially true for principle 6, >The most efficient and effective method of conveying information to and within a development team is face-to-face conversation. Again, form your own opinion and never take anything anyone says as universal truth. # My Do And Do Nots 1<a name="point-1"></a>. Do prefer written communication - Don't assume any vocalised message is remembered and understood 2<a name="point-2"></a>. Do give agency to people - Don't micro-manage people and their work 3<a name="point-3"></a>. Do use tools for writing - Don't require every update to be vocal # Explanations ## [Do prefer written communication](#point-1) Too often in meetings things are said or instructions given where I mishear things, or I am tired, or just in general not paying 100% attention when I should be. Using written communication helps ensure that the message is articulated, can be referred back to and everyone can read the message when they need to. An example I recently experienced was I changed teams at the end of a piece of work I completed. I didn't get a chance to run people through it. Taking my own advice, I had written instructions so no knowledge was lost. A prudent example during 2020 Covid-19 lock-downs was being on Zoom calls for meetings. Then to just have your internet disconnect. Writing your explanations and actions would mitigate any missed information. Another example is joining a new job or team. Sitting through hours of meetings explaining things is not a great way to pass on knowledge. Instead try to write down as much of it as possible. That way you create a source of truth. Then everyone can read it in their own time and pace. There are many examples of where using written communication is superior to verbal communication. I am biased to written communication though. It is not perfect for all situations and we still need to verbally communicate when the time comes; just be ready to challenge your assumptions. ## [Do give agency to people](#point-2) The worst thing I can imagine when working with a manager or a direct report is being micromanaged. People need agency to do work how they want and in their own time. If you need boundaries, use your tools to establish boundaries and expectations. For instance a lot of work has time restrictions, so communicate that through your tools. I say tools because that ensures there is a good understanding from both parties through a source of truth. I've professionally used Jira in the past for communicating technical requirements. Having all the information on the card was extremely helpful when the time was taken to write it down. This goes doubly for part time workers. When they are working they know there is a source of truth and they can read it when they are actually working and not worry about missing information because it was in a meeting when they weren't working. ## [Do use tools for writing](#point-3) Re-empathising the case for [written communication](#point-1). Project and day-to-day updates are the most common form of meetings I have experienced. Nearly all of them could be written. Using tools to provide written updates means you don't have to set-up meetings just to communicate updates. For example, write updates in the Jira cards, in the git pull request, in email, in instant messengers, etc. # Post Note I wrote this post several months when I transitioned from part-time to full-time employment and I never published this. I didn't publish this for several reasons, none of which are really relevant; mostly to do with my emotional state. After spending time working full-time, I think the points I raised here could be greatly beneficial to full-time work as well. Especially now flexible working is much more common as we continue to fight this pandemic.
crr0004
490,340
HACKTOBER'2020
What I Learned From Hacktoberfest It was an amazing experience. I went through the contrib...
0
2020-10-17T13:40:35
https://dev.to/vanshita2123/hacktober-2020-3f3e
hacktoberfest
## What I Learned From Hacktoberfest It was an amazing experience. I went through the contributions made by others, learned a lot, created PR's after analysing their code.
vanshita2123
490,398
If there is an input, there should be a form
This post was originally published on https://tomekdev.com/posts/input-and-form. Go there to read a b...
0
2020-10-17T15:53:58
https://tomekdev.com/posts/input-and-form
ux, a11y
--- title: If there is an input, there should be a form published: true tags: UX, Accessibility canonical_url: https://tomekdev.com/posts/input-and-form cover_image: https://dev-to-uploads.s3.amazonaws.com/i/pr7dl6fr9sjc1a98lizv.png --- _This post was originally published on https://tomekdev.com/posts/input-and-form. Go there to read a bit more interactive and style richer version_ ✌️ ---- I often see in Single Page apps a situation where someone uses just an `<input>` field. Sometimes in the accompaniment of `<label>` if you happen to work with a pro 🌟. It feels that when we gained control of inputs with two-way binding and we started handling `onclick` events on buttons with our fancy frameworks, we forgot the old way of doing things. ## The old way, and the right way The headline of this section may suggest that the old way and the right way are two different things. Where in fact, it's the opposite. If you come back with your memory before the frameworks (or ajax) era you see that people were using a `<form>` element when dealing with inputs and buttons. In the past we were extensively using `<form method="">` to process the input. **I encourage you to still use a form element**. It comes with benefits. ## Common mistake I use the keyboard to navigate and interact with pages. That speeds up everything. So for me one of the biggest pitfalls of using `<input>` without a `<form>` is that the input is not auto-submittable, so to say. When you hit `ENTER` in the field that is inside the form then the form is submitted. That's very convenient for solo-input interfaces like a modal below: ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/yi4bd1qj4ecnp2eqq327.png) You don't have to touch your mouse or touchpad and click `Save` button 🎉. That would be a waste of time! ## Solution It's a common mistake to bind your action to a `<button>` where in fact all you have to do is wrap your`<input>` with a `<form>` and assign `submit` event to a form: ```html <form id="my-form"> <input name="example" type="text" /> <button type="submit">Submit</button> </form> ``` ```javascript const form = document.getElementById('my-form'); form.addEventListener('submit', function handleSubmit(event) { alert('Submit clicked'); event.preventDefault(); }); ``` Don't forget to prevent default behavior from firing and run your custom behavior. It could be running validation and actually sending the data. One more thing that you should consider is always specifying button's type. It's `submit` by default in most browsers but Internet Explorer is different in this case and has `button` as a default type.
tomekdev_
491,468
Set up Firebase Realtime Database for JavaScript app
I started working on a Vanilla JavaScript bug tracking app with the guidance of this sweet tutorial b...
0
2020-10-19T02:56:49
https://dev.to/maasak/set-up-firebase-realtime-database-for-javascript-app-4k0l
javascript, webdev, database, codenewbie
I started working on a Vanilla JavaScript bug tracking app with the guidance of [this sweet tutorial by CodingTheSmartWay.com](https://codingthesmartway.com/pure-javascript-building-a-real-world-application-from-scratch/). Simple and easy to follow, this was a great starting point for me. What you get is a web app with a form to input a bug/issue description, its priority level (low, medium or high), and assign it to someone to handle. Upon submission of the form, the bug ticket will append to the DOM below the form (I incorporated the use of Bootstrap Card to make the issues easier to differentiate from one another) showing the description, ID number, priority level, name of the person it has been assigned to, as well as the issue status (which will initially always be set to "Open"). In addition, each new issue ticket also comes with two buttons - one for "Close" to update the issue status as "Closed", and another one for "Delete" to get rid of that ticket entirely. The tutorial I went through uses pure JavaScript, and it utilized the [`localStorage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage) to store data. This worked great, but I quickly noticed something that bugged me whenever clicking the "Close" or "Delete" button.... *The page would reload every time!* So if I'm looking at a long list of issue tickets and I just want to mark one "Closed", instead of simply seeing the status portion of that ticket update from "Open" to "Close", the page would reload and have me start back at the very top of the page with the updated list of issue tickets (same problem when clicking the "Delete" button). After doing some research on this issue, what I learned is that all `localStorage` calls are **synchronous**, so that explained my issue with the page reloads. At this point, I decided I wanted to use a different way to store data so that I could handle that end separately from any immediate changes I want made to the DOM, and that is how I stumbled upon [Firebase](https://firebase.google.com/). ##What is Firebase? Firebase is a Google platform for creating web and mobile applications. It comes with a variety of products, including one for storing data in the cloud called Firebase Realtime Database, where you can store and sync data in real time. I had never worked with anything cloud-related, so I figured I'd start learning here! ##Getting started with Firebase It was pretty simple getting set up by following along the [documentation](https://firebase.google.com/docs/web/setup). A Google account is needed in order to get started. Let's first navigate to https://console.firebase.google.com and click on "Create a project". We will then be prompted to name the project and accept the Firebase terms before moving on. The next part asks whether we want to enable Google Analytics (I chose not to as I didn't see any usage for my app), and then we can create your new project. We should now be redirected to the project page that looks something like this: ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/jc4el471ljlsq5c4i6ro.jpg) There are now various developing tools we have access to. For our purposes, we'll focus on the database setup for our web application. Click on the circular "</>" button to the left of the iOs and Android buttons so that we can register our new app. We should now see something like this: ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/x55fk134yevkviudccf9.jpg) In order to be able to use Firebase development tools in our app, we will need to copy-paste the above scripts into the `index.html` file, inside and at the bottom of the `<body>` tag. ##Implement Realtime Database There is a list of various developer tools on the left side of the main screen. Realtime Database can be found under "Develop". We should now see a button "Create Database" that can be clicked to do so. Before moving forward, we need to decide if we're going to work in "locked mode", which will keep the database private, or "test mode", which will make the database public. Since this is a small app, I went forward in "test mode". After clicking "Enable", we should see a screen with a big empty box. This is where our data will end up being stored. In order to test out whether data entered in our HTML page will actually update the database, we'll need a form. Here is the one I'm using: *index.html* ```html <h3>Report New Bug:</h3> <form id="issueInputForm"> <div class="form-group"> <label for="issueDescInput">Description</label> <input type="text" class="form-control" id="issueDescInput" placeholder="Describe the issue"> </div> <div class="form-group"> <label for="priorityLevelInput">Priority Level</label> <select id="priorityLevelInput" class="form-control"> <option value="Low">Low</option> <option value="Medium">Medium</option> <option value="High">High</option> </select> </div> <div class="form-group"> <label for="issueAssignedToInput">Assigned To</label> <input type="text" class="form-control" id="issueAssignedTo" placeholder="Person responsible"> </div> <button type="submit" class="btn btn-primary">Submit</button> </form> ``` This is the function I'm using to enter a new issue to track: *main.js* ```javascript document.getElementById("issueInputForm").addEventListener("submit", saveIssue); function saveIssue(e) { e.preventDefault(); const desc = document.getElementById("issueDescInput").value; const id = chance.guid(); const status = "Open"; const priority = document.getElementById("priorityLevelInput").value; const assignedTo = document.getElementById("issueAssignedTo").value; firebase.database().ref('issues/' + id).set({ desc: desc, id: id, status: status, priority: priority, assignedTo: assignedTo }); } ``` The key here is the call to the Firebase database function at the bottom, where we are setting the input values to save the data. This will overwrite any data at this location, as well as all child locations. If we now go back to the HTML page and try submitting a new issue, we will see that our we no longer have an empty box in Firebase, as the database has been updated: ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/znubuhiefn6u02vyhot8.jpg) That's it for now! The next step will be to retrieve the data and append it to the DOM, so I'll be writing about that next. Happy Coding! :)
maasak
491,607
Team Members of Kelcas
Know about the expert team members of Kelcas, Oil company. The team includes the experienced and skil...
0
2020-10-19T07:34:24
https://dev.to/wilhelmlilliehook/team-members-of-kelcas-13ee
kelcas, wilhelmlilliehook, oil
Know about the expert team members of Kelcas, Oil company. The team includes the experienced and skilled professionals. Read More: https://wilhelmlilliehook.wordpress.com/2020/10/19/about-wilhelm-lilliehooks-team/
wilhelmlilliehook
493,698
YouTube Video | Create PDF Viewer with ES6 JavaScript
In this video we are going to create a PDF viewer using modern ES6 JavaScript. Please do like it...
9,035
2020-10-21T11:14:36
https://thewebdev.tech/pdf-viewer-js
javascript, webdev, showdev, youtube
In this video we are going to create a PDF viewer using modern ES6 JavaScript. {% youtube QBI3XsBfvm8 %} Please do like it and [Subscribe](https://www.youtube.com/channel/UCRf7mazcufqZxd2pR3oQJuQ?sub_confirmation=1) to my channel for more videos.
nabendu82
493,969
Refactoring: Code Comments for API Reusability
Image of a multiple choice English test, I loved english but didn't like learning what all the parts...
9,201
2020-10-21T17:01:51
https://dev.to/jwp/code-comments-for-api-reusability-11j0
typescript, javascript
<sub> Image of a multiple choice English test, I loved english but didn't like learning what all the parts were called, so my scores were in need of help. My instructors would often comment on my tests. </sub> If we are following [PolyMorphic Compositional](https://dev.to/jwp/polymorphic-composition-494k) techniques we are creating many functions in our solution. So many in fact; due to following the [Single Responsibility Principle](https://www.google.com/search?q=single+responsibility+principle), we simply have too much stuff to remember regarding what each function really does. **The API** We should treat each function as an API, this means that it must be discoverable, both by name and by what it does. Assume an Address component that must allow for changing a State from a Select HTML Element like this: ><sub> Note : We name all our functions with the prefix func. Its great for intellisense and for knowing where the code lives.</sub> ```typescript onStateChange(state: NgModel) { if (state.viewModel) { // a reusable function in our API funcAddressResetProperties(this.address); ``` We can see that the function names go a long way in telling us what each does, but there's more. ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/rebrss9a59sr4t5y0cpu.png) Ahh, we didn't know that the ID wasn't reset. But now we do. The time to learn this was a simple hover action, we didn't have to dig into the code. **How did we get the comments above?** ```typescript /**Resets all but the ID property, // this is a design whereby new address // information overwrites old. */ export function funcAddressResetProperties(address: Address) { ... } ``` When we have hundreds of functions this is the best way to go. It also contributes to the eventual on-line API documentation to be published later. People that are new to any API rely heavily on online documentation to get started. JWP2020 Code Comments as an API
jwp
494,300
Instalando pfSense no ESXi
O pfSense é um firewall / roteador de código aberto baseado no FreeBSD. No entanto, você pode fazer m...
0
2020-10-22T01:21:16
https://dev.to/_idtecnologia/instalando-pfsense-no-esxi-3l3d
pfsense
--- title: Instalando pfSense no ESXi published: true date: 2020-01-11 16:05:51 UTC tags: pfSense,pfsense canonical_url: --- O pfSense é um firewall / roteador de código aberto baseado no FreeBSD. No entanto, você pode fazer muito mais do que isso e assumir o papel de DNS, VPN, DHCP e muito mais. No nosso cenário, o pfSense será usado como um firewall de borda com IPSec VPN, e também será usado como um firewall / roteador / DHCP. Esse tutorial se concentrará na instalação do pfSense em uma máquina dedicada para ESXi, com vários IPs, com um dedicado ao pfSense, pois existem alguns detalhes para instalar o pfSense com um IP dedicado. ## **Pré-requisito:** – ESXi instalado e configurado no servidor dedicado. – Acesso ao ESXi para configurar a rede em máquinas virtuais – Um IP dedicado para a VM pfSense. Nesse caso, estamos usando um IP de failover da operadora, que permite vários IPs para o mesmo host. – Um segundo IP dedicado para permitir o acesso SSH a uma VM que estará na LAN do pfSense VM, para permitir o acesso ao servidor da web (pode não ser necessário, mas é o que usaremos neste guia). ## **Configurações de rede** A primeira etapa será configurado a rede no ESXi para se conectar no VM pfSense. ![vm-switch-esxi](https://blog.idtecnologia.com.br/wp-content/uploads/2020/01/vm-switch-esxi.png) Primeiro, criamos dois vSwitches. Um vSwitch é um comutador virtual no ESXi, que nos permitirá separar as duas redes que criaremos. O primeiro, aqui chamado vSwitch0, será a rede WAN do host pfSense. Ele está conectado à NIC física do host ESXi. A segunda, chamada LAN aqui, será a nossa rede LAN, que não está conectada a nenhuma NIC física no host, uma vez que a VM pfSense atuará como roteador, toda a conexão externa deve passar pelo pfSense. Depois que os vSwitches são criados, precisamos criar um grupo de portas em cada vSwitch, para conectar as máquinas virtuais. ![](https://blog.idtecnologia.com.br/wp-content/uploads/2020/01/vm-switch-esxi2.png) ![placa-rede-vmware-esxi](https://blog.idtecnologia.com.br/wp-content/uploads/2020/01/topologia-switch-vmware.jpeg) Como podemos ver, temos um grupo de portas chamado VM Network, que será o acesso à WAN do pfSense, conectado a uma NIC física. ![topologia-switch-vmware2](https://blog.idtecnologia.com.br/wp-content/uploads/2020/01/topologia-switch-vmware2.png) Também temos um grupo de portas chamado LAN, que possui todas as nossas máquinas virtuais e não está conectado a nenhuma NIC física. ## **Instalação do pfSense** Você deve primeiro criar a VM no ESXi. ![nova-virtual-machine](https://blog.idtecnologia.com.br/wp-content/uploads/2020/01/nova-virtual-machine.png) ![nova-virtual-machine2](https://blog.idtecnologia.com.br/wp-content/uploads/2020/01/nova-virtual-machine2.png) Você deve selecionar o FreeBSD como a versão do Sistema operacional convidado. ![nova-virtual-machine3](https://blog.idtecnologia.com.br/wp-content/uploads/2020/01/nova-virtual-machine3.png) Em seguida, ao personalizar a configuração da VM, você deve configurar os dois adaptadores de rede, um para conectar-se à LAN e outro para conectar-se à rede WAN. Ao configurar a interface WAN, você deve configurar o endereço MAC manualmente, fornecido com o IP dedicado. Depois que tudo estiver configurado, você poderá instalar o pfSense na VM, com as configurações padrão durante a instalação. ![instalando-pfsense](https://blog.idtecnologia.com.br/wp-content/uploads/2020/01/instalando-pfsense.png) Selecionar instalação ![instalando-pfsense-idioma](https://blog.idtecnologia.com.br/wp-content/uploads/2020/01/instalando-pfsense2.png) Selecione o layout do seu teclado ![instalando-pfsense3](https://blog.idtecnologia.com.br/wp-content/uploads/2020/01/instalando-pfsense3.png) Selecione “Auto (UFS)” para a estrutura de partição ou selecione manual se desejar personalizar suas partições. ![instalando-pfsense4](https://blog.idtecnologia.com.br/wp-content/uploads/2020/01/instalando-pfsense4.png) Agora você pode reiniciar no seu sistema ## **configuração pfSense** Uma vez iniciado no seu sistema, você deverá ver esta tela: ![menu-pfsense](https://blog.idtecnologia.com.br/wp-content/uploads/2020/01/menu-pfsense.png) Você pode ver que o pfSense detectou automaticamente as interfaces e configurou a LAN, mas não a WAN. Não podemos configurar a interface WAN a partir do console, pois ela não permite que uma sub-rede de / 32 seja criada a partir do console. O que queremos fazer é acessar o shell (opção 8) e configurar manualmente as rotas para acessar a Internet. Em seguida, selecione o shell e insira os comandos: > _rota padrão_ Isso removerá a rota padrão configurada pelo pfSense. > _route add -net 42.42.42.1/32 -face em0_ Você deve substituir 42.42.42.1/32 pelo IP do host ESXi dedicado, substituindo o último byte por _1._ Isso adicionará uma rota padrão à interface em0 (sua interface WAN). > _rota adicionar padrão 42.42.42.1_ Isso adicionará a rota criada anteriormente como a rota padrão para o seu sistema pfSense. ## **Acesse o WebConfigurator** Feito isso, você deve acessar o webConfigurator, que pode ser acessado apenas na LAN pfSense. Para fazer isso, iniciamos uma VM do Ubuntu, que também possui duas placas de rede, uma conectada à LAN e outra conectada à mesma rede WAN que a VM pfSense. O objetivo aqui é ter acesso externo à máquina virtual Ubuntu, para poder fazer um redirecionamento de porta SSH para nossa máquina, para obter acesso ao webConfigurator. O servidor DHCP já está em execução, para que possamos configurar a interface para DHCP e fornecer um IP e configurar as rotas. ![ip-show-pfsense](https://blog.idtecnologia.com.br/wp-content/uploads/2020/01/ip-show-pfsense.png) Agora precisamos acessar externamente, portanto, configuramos o IP dedicado na interface WAN na VM do Ubuntu e configuramos as rotas da mesma maneira que a VM do pfSense. Depois de fazer isso, agora temos acesso à Internet na VM do Ubuntu: ![ping-pfsense](https://blog.idtecnologia.com.br/wp-content/uploads/2020/01/ping-pfsense.png) Como temos acesso externo e configuramos o IP público, agora podemos fazer o SSH na máquina e redirecionar a porta 443 no servidor pfSense para o nosso PC, para que possamos acessar o webConfigurator. Para fazer isso, redirecionamos a porta usando um comando SSH: _ssh -vNL 8080: 192.168.1.1: 443 usuário@servidor_ E agora, se visitarmos 127.0.0.1:8080, poderemos ver esta tela ![pfsense-2.5](https://blog.idtecnologia.com.br/wp-content/uploads/2020/01/login-pfsense.png) Agora podemos fazer login com as credenciais padrão: _admin_ / _pfsense_ ## **Configurando o pfSense** Na primeira vez em que você se conectar ao webConfigurator, terá acesso ao assistente de configuração. ![wizard-pfsense](https://blog.idtecnologia.com.br/wp-content/uploads/2020/01/wizard-pfsense.png) Clique em Next ![wizard-pfsense2](https://blog.idtecnologia.com.br/wp-content/uploads/2020/01/wizard-pfsense2.png) Clique em Next ![wizard-pfsense3](https://blog.idtecnologia.com.br/wp-content/uploads/2020/01/wizard-pfsense3.png) Digite o nome do host da VM pfSense, o domínio, se necessário, e um servidor DNS (aqui estamos usando o Google DNS) e Clique em avançar ![wizard-pfsense4](https://blog.idtecnologia.com.br/wp-content/uploads/2020/01/wizard-pfsense4.png) Deixe o valor padrão no nome do host do servidor de horário. Selecione o fuso horário e Clique em avançar ![wizard-pfsense5](https://blog.idtecnologia.com.br/wp-content/uploads/2020/01/wizard-pfsense5.png) Esta página permitirá que você configure a interface WAN. Selecionar estática ![wizard-pfsense6](https://blog.idtecnologia.com.br/wp-content/uploads/2020/01/wizard-pfsense6.png) Você pode deixar as Configurações gerais em branco ![wizard-pfsense7](https://blog.idtecnologia.com.br/wp-content/uploads/2020/01/wizard-pfsense7.jpg) Para o endereço IP, digite o IP dedicado que foi fornecido, com uma máscara de sub-rede de / 32. O gateway deve ser o endereço IP do seu host ESXi, substituindo o último byte por 1 Deixe o restante em branco e clique em Avançar ![wizard-pfsense8](https://blog.idtecnologia.com.br/wp-content/uploads/2020/01/wizard-pfsense8.png) Você pode deixar esses valores como padrões, pois poderá alterá-los mais tarde ![wizard-pfsense9](https://blog.idtecnologia.com.br/wp-content/uploads/2020/01/wizard-pfsense9.png) Digite uma senha para a web ![wizard-pfsense10](https://blog.idtecnologia.com.br/wp-content/uploads/2020/01/wizard-pfsense10.png) Clique em Recarregar ![wizard-pfsense11](https://blog.idtecnologia.com.br/wp-content/uploads/2020/01/wizard-pfsense11.png) Agora que a configuração inicial está concluída, precisaremos configurar algumas regras NAT, para que a LAN possa acessar a Internet e tornar as regras de roteamento permanentes. Nota: após configurar a interface da WAN, o pfSense pode excluir a rota que você configurou manualmente então nesse caso, você precisa inseri-la novamente. ## **Tornar as regras de roteamento persistentes** Como nossas regras de roteamento são adicionadas manualmente e não fica gravada depois que reinicializa, precisamos executar esses comandos na inicialização. Felizmente, existe um pacote no pfSense que nos permitirá fazer isso. Para instalar este pacote, vá para _Sistema -> Gerenciador de Pacotes -> Pacotes disponíveis_ Procure por ” _shellcmd_ ” e instale-o ![packager-pfsense](https://blog.idtecnologia.com.br/wp-content/uploads/2020/01/packager-pfsense.png) Depois de instalado, vá para _Serviços -> Shellcmd_ e adicione os dois comandos de roteamento ![route-add-pfsense](https://blog.idtecnologia.com.br/wp-content/uploads/2020/01/route-add-pfsense.jpeg) Seu acesso à Internet agora funcionará após uma reinicialização. ## **Configuração NAT** Para a LAN acessar a Internet, precisamos configurar o NAT. ![nat-pfsense](https://blog.idtecnologia.com.br/wp-content/uploads/2020/01/nat-pfsense.png) Vá para _Firewall -> NAT -> Saída_ Clique em _Geração manual de regras NAT de saída_ e salve ![](https://blog.idtecnologia.com.br/wp-content/uploads/2020/01/apply-pfsense.png) Você precisa aplicar as alterações Agora vamos criar nossa própria regra NAT. ![nat-pfsense2](https://blog.idtecnologia.com.br/wp-content/uploads/2020/01/nat-pfsense2.png) Clique no botão Adicionar mais à esquerda ![](https://blog.idtecnologia.com.br/wp-content/uploads/2020/01/rules-pfsense.png) Selecione os seguintes parâmetros _– Interface_ : WAN _– Protocolo_ : qualquer _– Fonte_ : qualquer _– Destino_ : qualquer Clique em Salvar Aplique as alterações. A VM do pfSense agora está configurada como um roteador para a LAN com um IP dedicado. O post [Instalando pfSense no ESXi](https://blog.idtecnologia.com.br/instalando-pfsense-no-esxi/) apareceu primeiro em [ID Tecnologia - Soluções em Segurança da Informação](https://blog.idtecnologia.com.br).
_idtecnologia
496,262
FREE JamStack / Static Site Hosting with Keybase.io
Keybase offers secure messaging and file sharing. Included in the file sharing offering is 250GB of s...
0
2020-10-26T18:10:33
https://joel.net/free-jamstack-static-site-hosting-with-keybaseio
webdev, hosting, jamstack
--- title: FREE JamStack / Static Site Hosting with Keybase.io published: true description: tags: webdev, hosting, jamstack cover_image: https://joelnet.keybase.pub/keybase-hosting-1000x420.png canonical_url: https://joel.net/free-jamstack-static-site-hosting-with-keybaseio --- [Keybase](https://keybase.io) offers secure messaging and file sharing. Included in the file sharing offering is **250GB of storage which can also be used to host public JamStack / Static Websites**. {% youtube GzhhG5ItwY8 %} ## Install Keybase **Keybase Sites** are accessed through their software so you'll have to head over to [Keybase.io](https://keybase.io) and follow the directions for your operating system to install. After installing the [Keybase](https://keybase.io) client, navigate to the **Files** tab. You should see a screen similar to this. ![keybase.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1603410494221/EPird1Mn4.png) Follow the directions to **Enable Keybase** for the file system for your operating system. This will give you native file system access to your [Keybase](https://keybase.io) secure file share. Once the **Keybase File System** has been installed you should be able to access your files at `/keybase` for Mac/Linux and `K:\` on Windows. If everything is setup correctly, under `/keybase` you should see three directories. ```text /keybase /private /public /team ``` ## The Keybase Subdomain All [Keybase](https://keybase.io) accounts are given a subdomain with the format `<username>.keybase.pub`. For example, my username is `joelnet`, so my subdomain is [joelnet.keybase.pub](https://joelnet.keybase.pub). This is where my static files will live. ## Copying Files to Keybase Files can be added to the **Keybase Subdomain** by copying them into `/keybase/public/joelnet` (`K:\public\joelnet` on Windows). All files copied here are **PUBLIC** and everyone has **read** access to them. I have prepared a Gatsby site that I am going to copy to `/keybase/public/joelnet` (`K:\public\joelnet` on Windows). ![copy-files-to-keybase.gif](https://cdn.hashnode.com/res/hashnode/image/upload/v1603412507383/ugCFyuqtG.gif) Your website has been deployed! Open up a browser and visit your new site. My site is now up and visible on [joelnet.keybase.pub](https://joelnet.keybase.pub) 🔥 ## Custom Domain Names [Keybase](https://keybase.io) also supports custom domain names, but the process is a little different. The site needs to be deployed under `/keybase/private/<username>,kbpbot/<site>` (`K:\private\<username>,kbpbot/<site>` on Windows). `<site>` can be any name. This gives you the flexibility to host multiple sites on [Keybase](https://keybase.io). The next step is setting up the DNS. Create a `CNAME` to point to `kbp.keybaseapi.com`. Next create a `TXT` record. If your site is at `my-site.example.com`, then prefix the record with `_keybase_pages.`. This is what my DNS records look like: ![dns.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1603413846461/qpclb_3J8.png) After copying your files, your website should be accessible on your custom domain! ## End More information about [Keybase Sites](https://book.keybase.io/sites) can be found [here](https://book.keybase.io/sites). - Join my 📰 [Newsletter](https://joel.net/newsletter) - Subscribe to my 📺 YouTube, [JoelCodes](https://www.youtube.com/c/JoelCodes?sub_confirmation=1) - Say hi to me on Twitter [@joelnet](https://twitter.com/joelnet) Cheers 🍻 Photo by [Killian Eon](https://www.pexels.com/@killian-eon-1185568) from [Pexels](https://www.pexels.com/photo/blue-metal-tool-2635595)
joelnet
497,086
81: Resources, Not Roadmap
I decided to choose one resource for each chapter that I want to gain knowledge. My work-fit is focus...
0
2020-10-25T08:32:39
https://dev.to/blanchloe/81-resources-not-roadmap-1dbh
I decided to choose one resource for each chapter that I want to gain knowledge. My work-fit is focusing on one mission each task, by creating a new idea, apply to the process, then give a result. For example, making a website is required to create an inner process. Why? to have the algorithm thinking, not getting distracted by my imagination, and make it real! I prefer to gain the depth of one part, which is front-end engineering. * It is a true visual art * I like the point that front engineering is visible while coding, feel safe to view the process right away. * The harmony, and A huge Potential. JS is eating the world. --------------------------- ###**Mathematics** * Khan Academy (Theory) * Brilliant (Practice) ###**Algorithm problems solving** * CoderByte (Problem Sovling) * Eloquent Javascript (TextBook) ###**Project** * JavaScript 30 * Frontend Masters --------------------------- Lastly, I'd like to find the code review website or regular mentorship to check my growth, was afraid of getting influenced overly, so I tried self-taught programming, at the end of the lesson, the healthy review is necessary to code forever haha, anyone recommends me the fun and casual code reviewer? to be direct, I prefer to have a comment, not teaching, because of protecting my creativity. That's all for me. Happy Holloween, Happy Coding.
blanchloe
497,500
A new TypeScript Postgres query builder
It’s been almost 3 years since I started working on this query builder idea of mine. Today is finally...
0
2020-10-25T21:40:54
https://nullbyt.es/a-new-typescript-postgres-query-builder/
typescript, postgres, node, sql
It’s been [almost 3 years](https://github.com/Ff00ff/mammoth/commit/dbb4e6672ff2c97f6583819f761c5a41a6438e1e) since I started working on this query builder idea of mine. Today is finally the day Mammoth hits 1.0. Mammoth is a no-batteries-included type-safe Postgres query builder for TypeScript. Hooray! ```ts db.with( `regionalSales`, () => db .select(db.orderLog.region, sum(db.orderLog.amount).as(`totalSales`)) .from(db.orderLog) .groupBy(db.orderLog.region), `topRegions`, ({ regionalSales }) => db .select(regionalSales.region) .from(regionalSales) .where( regionalSales.totalSales.gt( db.select(sum(regionalSales.totalSales).divide(10)).from(regionalSales), ), ), ({ topRegions }) => db .select( db.orderLog.region, db.orderLog.product, sum(db.orderLog.quantity).as(`productUnits`), sum(db.orderLog.amount).as(`productSales`), ) .from(db.orderLog) .where(db.orderLog.region.in(db.select(topRegions.region).from(topRegions))) .groupBy(db.orderLog.region, db.orderLog.product), ); ``` The no-batteries-included part is a wink to Knex.js and hints at Mammoth’s opposing ideas. Knex.js supports many SQL dialects and bundles the approriate database drivers (as peer dependencies, yes). Mammoth, however, only supports one SQL dialect, Postgres, and bundles no database driver. Creating a cross-database query builder like Knex.js is an amazing challenge, one that Knex.js set out to take on, but not me. To me, creating a cross-database query builder basically means constructing a new SQL dialect. For all the differences in the existing dialects you have to construct a new generic concept. But I like SQL. It's ubiquoutus and versatile. Especially Postgres. And this new language wouldn't be. In Knex.js the INSERT INTO .. ON CONFLICT is nowhere to be found. This SQL clause is missing even though it's been released [more than 4 years ago](https://www.postgresql.org/docs/9.5/index.html). The problem? The contributors had to introduce a new concept and try to avoid anything database-specific. I think this is an example how hard it is to create this new cross-database language. Weighing the pros and cons without being database-specific. This challenge becomes clear in this [pull request](https://github.com/knex/knex/pull/2197) discussing insert into on conflict. An often touted benefit of a cross-database solution is to be able to easily switch between different databases. Not at runtime but if you later decide to migrate from one database to another. But a cross-database approach isn't the only option. Instead, I think, a multi-database solution is a good strategy when you're operating in a type-safe world. Where the former focusses on speaking to different databases using a single API, the latter offers a database-specific API, but type-safe, thus, multi. Meaning, you would still be able to switch between databases, and you would see breaking changes at compile time. Fix the errors and you can be confident you support the new database. > Of course this ignores the whole topic of needing to actually migrate data from one database to another. This is why, in my opinion, you never really just switch from one database to another. Mammoth is sticking as close to SQL as possible. This comes with a set of challenges when building Mammoth, but it should make it easier to adopt Mammoth in a project or onboard new developers. I want a minimal abstraction, not a new generic SQL language, an ORM or something even more massive like Prisma. If you want to speak to your database, but it requires re-learning a lot you already know how to do in SQL, something is wrong. And all this re-learning is often not transferable to different languages or environment, which makes part of this learning wasteful. As an alternative, there are amazing tools available which generate types by reading your queries and reading the remote database schema. While these do solve the type-safety challenges and stick to SQL, I feel requiring a watch on file changes so types can get re-generated isn't ideal. Instead, with an advanced enough type-safe query builder you can have the same features without this build step. Mammoth aims to fix exactly that. Here are some examples that I think work great. All the result types are automatically inferred. **Left join — `name` automatically becomes optional** ```ts const rows = await db .select(db.foo.id, db.bar.name) .from(db.foo) .leftJoin(db.bar) .on(db.bar.fooId.eq(db.foo.id)); ``` **Simple select with count(*)** ```ts const [{count}] = await db.select(count()).from(db.foo); ``` **Insert into .. on conflict** ```ts const affectedCount = await db .insertInto(db.foo) .values({ name: `Test`, }) .onConflict(`id`) .doUpdateSet({ name: `Test 2`, }); ``` **Just an update returning the affected count** ```ts const affectedCount = await db.update(db.foo).set({ name: `Test`, value: 123 }); ``` **Select with where in expression** ```ts const rows = await db .select(db.foo.id) .from(db.foo) .where(db.foo.id.in(db.select(db.bar.fooId).from(db.bar))); ``` Mammoth 1.0 is production-ready. I've been using it in a project for some time already. It's not feature-complete though but should support most use cases and give you automatic type safety in a lot of places. It also offers excellent autocomplete and Mammoth tries hard not to pullute the public API. The first version of the [Mammoth query builder documentation](https://mammoth.tools) is also up. I created a couple of [issues labeled with good first issue](https://github.com/Ff00ff/mammoth/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22). These issues are great for someone new to the codebase to pick up—and they really add value. I'm available to help you get started. Just claim the issue and let me know if you have any questions. If you always wanted to work on some open source, now is your time! Last but no least, I started working on mammoth-cli to automatically generate migrations based on your table definitions. This is the next big piece to get right to make sure your database schema actually matches your table definitions. Also, this should make the developer experience of using Mammoth even better. The first beta version is available now.
martijndeh
497,598
Poll "When Stating Windows Support, What do YOU Expect?"
I ran a poll recently trying to get an idea of what people expect when I would tweet or write something like, "this thing, X, is supported on Windows". Because Windows these days means more than a few things. There are these subsystems, Windows Subsystem for Linux, or WSL that are also considered, more or less, to be "Windows".
0
2020-10-26T00:59:43
https://dev.to/adron/poll-when-stating-windows-support-what-do-you-expect-4bgb
windows, discuss
--- title: Poll "When Stating Windows Support, What do YOU Expect?" published: true description: I ran a poll recently trying to get an idea of what people expect when I would tweet or write something like, "this thing, X, is supported on Windows". Because Windows these days means more than a few things. There are these subsystems, Windows Subsystem for Linux, or WSL that are also considered, more or less, to be "Windows". tags: windows, discuss, cover_image: https://dev-to-uploads.s3.amazonaws.com/i/wdngr069cexxjcnsbpqy.png --- I ran a poll recently trying to get an idea of what people expect when I would tweet or write something like, "this thing, X, is supported on Windows". Because Windows these days means more than a few things. There are these subsystems, Windows Subsystem for Linux, or WSL that are also considered, more or less, to be "Windows". WSLs of whatever version, they're really Linux operating under or in some pretense with Windows. It's kind of confusing really, because also there is WSL1 and WSL2, which are in their core entirely different beasts. They handle all sorts of things in different ways. Whatever the case, I've concluded and will continue to do work that will support the OS specifically. [![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/wdngr069cexxjcnsbpqy.png)](https://twitter.com/Adron/status/1320151961677643776) Do you do development on Windows? What are your expectations? Even amidst this small poll I did, I'm always curious if you're thoughts on the matter differ, or if the general coder's thoughts on the matter are changing. Do comment here or tweet at me, we'll discuss!
adron
497,627
Sinatra Sports App CRUD MVC
I used corneal to generate the file structure for my first Sinatra app. This structure helped me prep...
0
2020-10-26T02:07:43
https://dev.to/glennanj1/sinatra-sports-app-crud-mvc-2jmb
I used corneal to generate the file structure for my first Sinatra app. This structure helped me prepare for the long route ahead. I started making sure my active record gem was set to version 5.2. It runs better with sqlite. I then went ahead and created a simple user table and bets table and migrated them using rake. I then made sure my models were in place (user and bet) and inheriting from active records base. My models also have relationships to each other. For example my bet class belongs to users and my users have many bets. I seeded fake data and made sure that my associations were working correctly using my custom rake console. Rake console has helped me a lot especially when I need to look up methods on my created objects. I then began to meticulously use my HTTP verbs I learned, and routed out my controllers and corresponding embedded ruby views. These views present the user with an interface. Running shotgun allows you to visit localhost:9393 where the development site lives. This app allows you to keep track of sports wagers placed on games. I'm proud of how far I've come. This simple app has a lot of potential and plan to continue working on it in the next framework Rails.
glennanj1
575,396
Setting up MSDeploy for CI/CD deployments to IIS
Just a few months ago I was 100% sure I’ll never hear about Windows Server ever again, but not everyo...
0
2021-01-18T21:18:44
https://dennistretyakov.com/setting-up-msdeploy-for-ci-cd-deployments-to-iis
dotnet
Just a few months ago I was 100% sure I’ll never hear about Windows Server ever again, but not everyone is on Kubernetes or even dotnet core yet, so if you are as lucky as me, and have to setup deployment to the IIS server in 3rd decade of 21st century, here are the detailed instructions how to do it. First Let me first clarify something. There is a product name called Web Deploy which provides 2 main components: - Command-line tool MSDeploy.exe what we use, to make a deployment to an IIS server. - A service that must be installed on a server running IIS, where we want to make deployments to. ## Just a few tips in advance - You will need a user account with Admin privileges to perform deployment - You will need to [install IIS Management Service](#install-iis-management-service) - You will need to [install Microsoft Web Deploy to the server](#install-microsoft-web-deploy) - You will need **NO restarts**, quite a surprise for Windows 😁 ## Install IIS Management Service 1. Run (Win + R) -> appwiz.cpl 2. Click "Turn Windows features on or off" 3. On "Add Roles and Features Wizard" proceed to "Server Roles" (on non-server versions of windows you'll be taken to the same screen immediately) 4. Select "Management service" 5. Proceed to confirmation and press install (appears instead of Next button) [Step by step screenshots](https://dennistretyakov.com/setting-up-msdeploy-for-ci-cd-deployments-to-iis#install-iis-management-service) ## Install Microsoft Web Deploy This is a tool that should be installed on both the server (the machine running IIS) and the client (the machine making a deployment). Getting it is is a bit tricky though. There are two actual versions of web deploy. - The latest version Microsoft offers to download via Download Center is Web Deploy 3.6 *(which one is obsolete)* - Visual Studio 2017+ comes with Web Deploy 4 As it doesn't make sense to install Visual Studio on production servers, as I found on the [MS Developer Community forum](https://developercommunity.visualstudio.com/content/problem/230372/web-deploy-40-msi-location.html) you can download a stand-alone .msi for Web Deploy 4 from https://download.visualstudio.microsoft.com/download/pr/e1828da1-907a-46fe-a3cf-f3b9ea1c485c/035860f3c0d2bab0458e634685648385/webdeploy_amd64_en-us.msi if the link is broken, there is a backup copy on my OneDrive https://1drv.ms/u/s!Au6taQChFyJmge1TOscBDl0V2FMsJQ c > The versions are not compatible. In other words, you cannot use Web Deploy 4 to deploy to the server with Web Deploy 3.6 Yet another important detail is that the "Typical" installation of MS Deploy doesn't include the server components. Therefore installing MS Deploy choose either Complete install either Custom and ensure all the components will be installed. [Step by step screenshots](https://dennistretyakov.com/setting-up-msdeploy-for-ci-cd-deployments-to-iis#install-microsoft-web-deploy) ## Things to verify #### Windows services should be up and running 1. Open Services Manager. Run (Win + R) services.msc 2. Locate "Web Deployment Agent Service" and ensure it's started. (this is MSDeploy) 3. Locate "Web Management Service" and ensure it's started. [Step by step screenshots](https://dennistretyakov.com/setting-up-msdeploy-for-ci-cd-deployments-to-iis#windows-services-should-be-up-and-running) #### Management service should be present in IIS configuration. You might also want to adjust some settings 1. Open IIS Manager. Run (Win + R) inetmgr 2. Locate "Management Service" in the Management section of the Server Features view If you want to change the settings you'll need to stop the service using the stop button on the right panel. The interface might seem a bit confusing, but feel free to do so, it stops only the management service itself, not the IIS. [Step by step screenshots](https://dennistretyakov.com/setting-up-msdeploy-for-ci-cd-deployments-to-iis#management-service-should-be-present-in-iis-configuration) #### The port should be open As you could see on Management Service screen in IIS settings, by default it listens to port 8172. The installer also opens the port in Firewall settings for all IP addresses. 1. Open Windows Defender Firewall with Advanced Security. Run (Win + R) wf.msc 2. Locate "Web Management Service (HTTP Traffic-In)" rule [Step by step screenshots](https://dennistretyakov.com/setting-up-msdeploy-for-ci-cd-deployments-to-iis#the-port-should-be-open) ## Pack and deploy legacy asp.net app to IIS That deploy part is way easier or at least doesn't require clicks. #### To make a package with msbuild ```powershell $proejctPath = '.\MyProject.csproj' msbuild $projectPath ` /p:OutDir=.\dist\ ` /p:Configuration=Release ` /p:GenerateSerializationAssemblies=False ` /p:DeployOnBuild=true ` /p:WebPublishMethod=Package ` /p:PackageAsSingleFile=true ` /p:IncludeSetAclProviderOnDestination=False ` /p:AutoParameterizationWebConfigConnectionStrings=false ``` #### To deploy using msdeploy ```powershell $package = '.\dist\_PublishedWebsites\MyProject_Package\MyProject.zip' $username = '' $password = '' $serverIpOrHostname = '127.0.0.1' $msDeployPort = '8172' $endpoint = "https://${serverIpOrHostname}:${msDeployPort}/MSDeploy.axd" $iisWebsiteName = 'My Website' # with -whatIf flag provided, msdeploy just shows what's gonna happen without # remove the line with -whatIf flag to make real deployment msdeploy -source:package=$package ` -whatIf ` -verb:sync ` -allowUntrusted ` -dest:auto,ComputerName=`"$endpoint`",UserName=`"$username`",Password=`"$password`",IncludeAcls=False,AuthType=Basic ` -setParam:name=`"IIS Web Application Name`",value=`"$iisWebsiteName`" ` -disableLink:AppPoolExtension ` -disableLink:ContentExtension ` -disableLink:CertificateExtension ``` #### where is msdeploy.exe Typically it's: *C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe* and yet, no matter how rediculous it is, the Web Deploy 4 is going to be in the same directory :) #### where is msbuild.exe With visual studio installed it should be in *C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe* Obviously the version number and edition might differ. However you don't have to have to install Visual Studio, to have MSBuild on a build agent. You can download and install [Build Tools for Visual Studio 2019](https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=BuildTools&rel=16). --- https://dennistretyakov.com/setting-up-msdeploy-for-ci-cd-deployments-to-iis#install-iis-management-service
tretyakovd
497,925
Prevent Spelling Mistakes in Your WPF Applications
Syncfusion WPF SpellChecker control helps you detect spelling mistakes in your application and fix th...
0
2020-11-02T10:27:10
https://www.syncfusion.com/blogs/post/prevent-spelling-mistakes-in-your-wpf-applications.aspx
csharp, dotnet, productivity
--- title: Prevent Spelling Mistakes in Your WPF Applications published: true date: 2020-10-26 10:30:18 UTC tags: csharp, dotnet, productivity canonical_url: https://www.syncfusion.com/blogs/post/prevent-spelling-mistakes-in-your-wpf-applications.aspx cover_image: https://www.syncfusion.com/blogs/wp-content/uploads/2020/10/Prevent-Spelling-Mistakes-in-Your-WPF-Applications-672x372.png --- Syncfusion [WPF SpellChecker](https://www.syncfusion.com/wpf-ui-controls/spellchecker) control helps you detect spelling mistakes in your application and fix them. It has a built-in dictionary for English. However, you can also check the spelling of text in other languages by integrating dictionary files in standard formats such as [Hunspell](https://en.wikipedia.org/wiki/Hunspell), [Ispell](https://en.wikipedia.org/wiki/Ispell), and [OpenOffice](https://extensions.openoffice.org/en/search?f%5B0%5D=field_project_tags%3A157). You can also add custom words that are not available in the dictionary file by using the custom dictionary. You can even add multiple dictionaries specific to different cultures, and switch between them at runtime. SpellChecker also provides intuitive ways to fix spelling mistakes by listing suggestions in a context menu and dialog box, similar to Microsoft Office applications. Let’s proceed with using the Syncfusion WPF SpellChecker to check the spelling of text in a text editor control. ## Configuring SpellChecker in a text editor control Follow these steps to configure SpellChecker in a text editor control: ### Step 1: Create the project Create a new [WPF project](https://docs.microsoft.com/en-us/dotnet/desktop/wpf/getting-started/walkthrough-my-first-wpf-desktop-application?view=netframeworkdesktop-4.8#create-the-application-project) in Visual Studio. ### Step 2: Add the control manually using code To add the Spell Checker manually in C#, follow these steps: 1. Install the [Syncfusion.SfSpellChecker.WPF](https://www.nuget.org/packages/Syncfusion.SfSpellChecker.WPF/) NuGet package in your project. 2. Include the namespace **Syncfusion.Windows.Controls** by using the following code. ```csharp using Syncfusion.Windows.Controls; ``` 3. Create an instance of the SpellChecker control by using the following code. ```csharp SfSpellChecker SpellChecker = new SfSpellChecker(); ``` Let’s design a view with TextBox and Button controls. Here, we are going to perform a spell checking in the TextBox control when a button is clicked. ### Step 3: [Configure the SfSpellChecker to the text editor](https://help.syncfusion.com/wpf/spellchecker/getting-started#adding-wpf-sfspellchecker-to-an-application) 1. Create a class implementing the [IEditorProperties](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.IEditorProperties.html) interface which acts as a bridge between the editor and the SpellChecker control. Refer to the following code. Here, I am naming the class **TextSpellEditor**. ```csharp //Creating TextSpell Editor public class TextSpellEditor : IEditorProperties { /// <summary> /// Initializes the TextBox control. /// </summary> private TextBox textbox; /// <summary> /// Gets or sets the control whose text is to be spell checked. /// </summary> public Control ControlToSpellCheck { get { return textbox; } set { textbox = value as TextBox; } } /// <summary> /// Initializes the new instance of the TextSpellEditor class. /// </summary> /// <param name="control"></param> public TextSpellEditor(Control control) { ControlToSpellCheck = control; } /// <summary> /// Gets or sets the current misspelled word. /// </summary> public string SelectedText { get { return textbox.SelectedText; } set { textbox.SelectedText = value; } } /// <summary> /// Gets or sets the text to be spell checked by the SfSpellChecker. /// </summary> public string Text { get { return textbox.Text; } set { textbox.Text = value; } } /// <summary> /// Selects the word specified by the index. /// </summary> /// <param name="selectionStart">Zero-based index of the word in the text.</param> /// <param name="selectionLength">length of the word to be selected.</param> public void Select(int selectionStart, int selectionLength) { textbox.Select(selectionStart, selectionLength); } public bool HasMoreTextToCheck() { return false; } public void Focus() { textbox.Focus(); } public void UpdateTextField() { throw new NotImplementedException(); } } ``` 2. Create and add the instance of TextBox (the editor control to be spell checked) and Button to the window as shown in the following code example. ```html <Grid VerticalAlignment="Center"> <StackPanel> <TextBox Text="Natusre is an importsant and integral part of mankind. It is one of the greattest blessings for human lifve. Howeverq, nowadays humans fail to recognize it as one. Nature has been an inspiration for numerous poets, writeqrs, artists and more of yesteryears." Name="textbox" TextWrapping="Wrap" VerticalContentAlignment="Top"/> <Button HorizontalAlignment="Center" Content="Spell Check" Click="SpellCheck_ButtonClick"/> </StackPanel> </Grid> ``` Now, we have integrated the WPF SpellChecker into the text editor control. It should look like the following screenshot. ![Text Editor Control with WPF SpellChecker](https://www.syncfusion.com/blogs/wp-content/uploads/2020/10/Text-Editor-Control-with-WPF-SpellChecker.png)<figcaption>Text Editor Control with WPF SpellChecker</figcaption> ## Perform spell check As state previously, you can perform spell checking and suggest appropriate spellings by using a context menu or a dialog box. The following sections describe how to implement these features. ### Spell check through context menu Create an instance of the TextSpellEditor class by passing the TextBox instance as a parameter to its constructor. Then, add the instance of TextSpellEditor to the SpellChecker by using the [PerformSpellCheckUsingContextMenu](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.SfSpellChecker.html#Syncfusion_Windows_Controls_SfSpellChecker_PerformSpellCheckUsingContextMenu_Syncfusion_Windows_Controls_IEditorProperties_) method. ```csharp TextSpellEditor SpellEditor = new TextSpellEditor(txtbx); //Enable context menu for SpellChecker SpellChecker.PerformSpellCheckUsingContextMenu(SpellEditor); ``` ![Spell Checking via Context Menu](https://www.syncfusion.com/blogs/wp-content/uploads/2020/10/Spell-Checking-via-Context-Menu.png)<figcaption>Spell Checking via Context Menu</figcaption> ### Spell check through dialog box Alternatively, you can perform the spell check using a dialog box by calling the [PerformSpellCheckUsingDialog](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.SfSpellChecker.html#Syncfusion_Windows_Controls_SfSpellChecker_PerformSpellCheckUsingDialog_Syncfusion_Windows_Controls_IEditorProperties_) method. ```csharp private void SpellCheck_ButtonClick(object sender, EventArgs e) { SpellChecker.PerformSpellCheckUsingDialog(new TextSpellEditor(txtbx)); } ``` Executing the project will result in output like the following screenhsot. ![Spell Checking via Dialog Box](https://www.syncfusion.com/blogs/wp-content/uploads/2020/10/Spell-Checking-via-Dialog-Box.png)<figcaption>Spell Checking via Dialog Box</figcaption> ## Load your own dictionaries for any language You can also add your own dictionary to the [SfSpellChecker.Dictionaries](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.SfSpellChecker.html#Syncfusion_Windows_Controls_SfSpellChecker_Dictionaries) collection. The SpellChecker control supports the following standard dictionary file formats: - Hunspell - Ispell - OpenOffice ### SpellCheck using a Hunspell dictionary You can check for spelling mistakes using the Hunspell dictionary format. This format contains the following files: - Affix file with grammar rules: \*.aff - Basic words file: \*.dic file. **Note:** You can get different languages for Hunspell dictionaries in this [GitHub](https://github.com/wooorm/dictionaries/tree/main/dictionaries) location. Follow these steps to spell check using a Hunspell dictionary. Adding a [Hunspell dictionary](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.HunspellDictionary.html) requires adding \*.aff and \*.dic culture files as a Resource to the application. Here, we are going to add the Hunspell dictionary for the French culture. Refer to the following screenshot. ![French Culture Files](https://www.syncfusion.com/blogs/wp-content/uploads/2020/10/French-Culture-Files.png)<figcaption>French Culture Files</figcaption> 1. Create an instance of the HunspellDictionary and add the basic word and grammar file path to the [HunspellDictionary.DictionaryUri ](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.HunspellDictionary.html#Syncfusion_Windows_Controls_HunspellDictionary_DictionaryUri)and [HunspellDictionary.GrammarUri](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.HunspellDictionary.html#Syncfusion_Windows_Controls_HunspellDictionary_GrammarUri) properties. Add the culture to the [HunspellDictionary.Culture](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.HunspellDictionary.html) property. 2. Add the HunspellDictionary to the [SfSpellChecker.Dictionaries](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.SfSpellChecker.html#Syncfusion_Windows_Controls_SfSpellChecker_Dictionaries) collection. 3. Then, set the required culture to the [SfSpellChecker.Culture](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.SfSpellChecker.html#Syncfusion_Windows_Controls_SfSpellChecker_Culture) property. Refer to the following code. ```csharp //Creating a culture instance CultureInfo culture = new CultureInfo("fr-FR"); SfSpellChecker SpellChecker = new SfSpellChecker(); // Adding Hunspell dictionaries in Dictionaries collection SpellChecker.Dictionaries = new DictionaryCollection(); //Add French culture Hunspell dictionary SpellChecker.Dictionaries.Add( new HunspellDictionary() { Culture = culture, GrammarUri = new Uri("/HunSpellCheck;component//French/fr-FR.aff", UriKind.Relative), DictionaryUri = new Uri("/HunSpellCheck;component//French/fr-FR.dic", UriKind.Relative) }); //Setting a French culture for SpellChecker SpellChecker.Culture = culture; ``` In a similar way, you can also add and set the culture for Ispell and OpenOffice dictionaries. Refer to this [documentation](https://help.syncfusion.com/wpf/spellchecker/custom-dictionary-support#spellcheck-using-ispell-dictionary) for more information. You can get different languages for the Ispell and OpenOffice dictionaries from the following locations: - [Ispell dictionaries](https://www.cs.hmc.edu/~geoff/ispell-dictionaries.html) - [OpenOffice dictionaries](https://github.com/wooorm/dictionaries/tree/main/dictionaries) ## Switching language (culture) at runtime The SpellChecker control allows you to add multiple dictionaries for unique cultures into the SfSpellChecker.Dictionaries collection. You can set one of the cultures at runtime by changing the SfSpellChecker.Culture property. Based on the value of SfSpellChecker.Culture, the respective dictionary will be used for spell checking the text. Refer to the following code example. ```csharp //Creating a culture instance CultureInfo culture = new CultureInfo("fr-FR"); SfSpellChecker SpellChecker = new SfSpellChecker(); // Adding Hunspell dictionaries in Dictionaries collection SpellChecker.Dictionaries = new DictionaryCollection(); //Add French culture Hunspell dictionary SpellChecker.Dictionaries.Add( new HunspellDictionary() { Culture = culture, GrammarUri = new Uri("/HunSpellCheck;component//French/fr-FR.aff", UriKind.Relative), DictionaryUri = new Uri("/HunSpellCheck;component//French/fr-FR.dic", UriKind.Relative) }); //Add Spanish culture Hunspell dictionary SpellChecker.Dictionaries.Add( new HunspellDictionary() { Culture = new CultureInfo("es-ES"), GrammarUri = new Uri("/HunSpellCheck;component//Spanish/es-ES.aff", UriKind.Relative), DictionaryUri = new Uri("/HunSpellCheck;component//Spanish/es-ES.dic", UriKind.Relative) }); //Add US culture Hunspell dictionary SpellChecker.Dictionaries.Add( new HunspellDictionary() { Culture = new CultureInfo("en-US"), GrammarUri = new Uri("/HunSpellCheck;component//US/en-US.aff", UriKind.Relative), DictionaryUri = new Uri("/HunSpellCheck;component//US/en-US.dic", UriKind.Relative) }); //Setting a French culture for SpellChecker SpellChecker.Culture = culture; ``` Here, SfSpellChecker.Culture is set to fr-FR. So, the dictionary for the fr-FR culture will be used as the spell check dictionary. Refer to the following screenshot. ![Spell Check with French Dictionary](https://www.syncfusion.com/blogs/wp-content/uploads/2020/10/Spell-Check-with-French-Dictionary.png)<figcaption>Spell Check with French Dictionary</figcaption> ## Add words to dictionary You can add custom words that are not available in an existing dictionary. Add the words to the SfSpellChecker.Dictionaries collection using the [CustomDictionary](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.CustomDictionary.html) class. This custom dictionary does not have a grammar file; it accepts only the dictionary files that contain a list of words. You can also add words to this custom dictionary by clicking on the Add to Dictionary button available in the SpellChecker dialog box or context menu. You can also add multiple CustomDictionary classes for each culture using the SfSpellChecker.Dictionaries collection. For example, if you load the SfSpellChecker with the en-US culture, then you can add custom words only to the en-US culture CustomDictionary. The following steps explain how to do so: 1. Create a custom dictionary text file, set the **Build Action** as **None** , and set **Copy to Output Directory** to **Copy if newer** as shown in the following screenshot. ![Adding Custom Dictionary File](https://www.syncfusion.com/blogs/wp-content/uploads/2020/10/Adding-Custom-Dictionary-File.png)<figcaption>Adding Custom Dictionary File</figcaption> 2. Create a CutomDictionary instance, add the custom word file path to the [CustomDictionary.DictionaryUri](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.CustomDictionary.html#Syncfusion_Windows_Controls_CustomDictionary_DictionaryUri) property, and add the culture to the [CustomDictionary.Culture](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.CustomDictionary.html) property. 3. Add the CutomDictionary into the SfSpellChecker.Dictionaries collection. Refer to the following code example. ```csharp //Creating a culture instance CultureInfo culture = new CultureInfo("en-US"); SfSpellChecker SpellChecker = new SfSpellChecker(); // Get the location of the dictionary file Uri CustomDict_uri= new Uri(Directory.GetCurrentDirectory()+ @"\English\Custom_en-US.txt", UriKind.Absolute); // Creating instance for the Dictionaries collection SpellChecker.Dictionaries = new DictionaryCollection(); //Add custom dictionary for US culture SpellChecker.Dictionaries.Add( new CustomDictionary() { Culture = culture, DictionaryUri = CustomDict_uri }); ``` ![Adding Words to Custom Dictionary](https://www.syncfusion.com/blogs/wp-content/uploads/2020/10/Adding-Words-to-Custom-Dictionary.png)<figcaption>Adding Words to Custom Dictionary</figcaption> ## Conclusion I hope you now have a clear idea about what is needed to add the [WPF SpellChecker](https://www.syncfusion.com/wpf-ui-controls/spellchecker) control to a text editor control. With its features, you can dynamically perform spelling checks for text of any language and culture and add custom words to its dictionary too. Try the control in your application and tell us your impressions in the comment section below. The Syncfusion [WPF UI controls](https://www.syncfusion.com/wpf-ui-controls) package includes over 95 essential WPF controls like [DataGrid](https://www.syncfusion.com/wpf-ui-controls/datagrid), [Charts](https://www.syncfusion.com/wpf-ui-controls/charts), [Diagram](https://www.syncfusion.com/wpf-ui-controls/diagram), [PDF Viewer](https://www.syncfusion.com/wpf-ui-controls/pdf-viewer), and more for building powerful line-of-business Windows applications faster. Use them to boost your productivity! For current Syncfusion customers, the newest version is available for download from the [License and Downloads](https://www.syncfusion.com/account/downloads) page. If you are not yet a Syncfusion customer, you can try our 30-day [free trial](https://www.syncfusion.com/downloads) to check out the available features. You can also try our samples at this [GitHub](https://github.com/SyncfusionExamples/WPF-SpellChecker-examples) location. You can always contact us through our [support forums](https://www.syncfusion.com/forums), [Direct-Trac](https://www.syncfusion.com/support/directtrac/incidents), or [feedback portal](https://www.syncfusion.com/feedback/wpf). We are always happy to assist you!
sureshmohan
498,177
Top Custom Software Development Companies in New York
Theodo https://www.theodo.com/ Pattern Match https://pattern-match.com/ Zco https://www.zco.com/ D...
0
2020-10-26T15:30:25
https://www.foretheta.com/blog/top-custom-software-development-companies-in-new-york-2ja7/
softwaredevelopment, topcompanies, newyork
Theodo https://www.theodo.com/ Pattern Match https://pattern-match.com/ Zco https://www.zco.com/ Damco Solutions https://www.damcogroup.com/ Weil & Jones https://www.weiljones.com/ Ciklum https://www.ciklum.com/ Dom & Tom https://domandtom.com/ HubSpire https://www.hubspire.com/ Saffron Tech https://www.saffrontech.net/ Onit Digital, Inc. http://www.onitdigital.com/ Fingent https://www.fingent.com/ iTechArt Group https://www.itechart.com/ Konstant Infosolutions https://www.konstantinfo.com/ Stride https://www.stridenyc.com/ Mobikasa https://www.mobikasa.com/ Saritasa https://www.saritasa.com/ TechNeed https://www.techneedsolutions.com/ Valtech https://www.valtech.com/ WASKO Software https://wasko.software/ KeenEthics https://keenethics.com/ Perpetual https://www.perpetualny.com/ Gramercy Tech https://www.gramercytech.com/ Codibly https://codibly.com/ Koombea https://www.koombea.com/ Def Method https://www.defmethod.com/ Tivix https://www.tivix.com/ JetRockets https://jetrockets.pro/ NexGen Systems Inc. https://www.nexgensm.com/ DOOR3 https://www.door3.com/ Bitbean.com https://www.bitbean.com/ DataArt https://www.dataart.com/ SourcePad https://www.saritasa.com/ Icreon https://www.icreon.com/en Leadingdots Solutions Pvt Ltd https://www.leadingdots.com/ Incipient Corp. https://incipientcorp.com/ Lightmatter https://www.lightmatter.com/ Bit by Bit Computer Consultants https://www.bitxbit.com/ People10 Technologies Inc. https://people10.com/ Messapps https://messapps.com/ HTD Health https://htdhealth.com/ Do you want your company on the list of *Top Custom Software Development Companies in New York*? Let us know at blog@foretheta.com.
nadagul
498,322
A Survival Guide for Your Team's Newest Developer
After a long-winded search for employment, including copious rejections, maybe you’ve finally landed...
0
2020-10-26T18:07:35
https://dev.to/olioapps/a-survival-guide-for-your-team-s-newest-developer-4cnp
onboarding, jobs, junior, developer
After a long-winded search for employment, including copious rejections, maybe you’ve finally landed a sustainable position at a well-grounded company, or maybe you’re still on the hunt. The job market ebbs and flows, but as long as you stay dedicated with your spirits up, you’ll likely be making this transition as well. I started my journey into tech a year ago, and I’ve now been working as a developer at my newest company, Olio Apps, for about 3 months. After a pretty great interview, I felt confident that I would be offered the position. Soon after, I had a start date to look forward to! As anyone would be, I was excited, but I couldn’t help but be nervous as well. I felt like this was a bigger opportunity than my previous positions at small start-ups. Throughout these last few months, I’ve learned some things I wish I'd known beforehand, but there have also been things I wish I hadn’t focused on as much. Pulling from my quick onboarding process and other experiences I've had joining teams, I’ve written this guide as a roadmap for new developers, aimed at showing them what to focus on in order to be a successful hire. This "survival guide" should help new developers onboard more effectively, connect with their team in a meaningful way, and focus on the things that matter while joining a new company or team. <div style="padding-bottom: 10px; padding-top: 10px; padding-right: 50px; padding-left: 50px;"> ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/zla4j0kwf7r5zp1vw8ok.png) </div> ## First Day So it’s your first day of work! You’ll likely be getting access to the company’s software and email (if not later, depending on the company). You’ll probably be introduced to team members or managers that you’ll be working closely with, then go over your first tasks. Make sure you know what to work on, who to report to, and which tools you’ll need to be an active part of the team. JIRA, Confluence, Slack, and the company Gmail were some of what I was granted access to on my first day. I expected there to be delay on some of these things, since there always seems to be… But I was lucky to have a small and lightweight team that got things done quickly, compared to a larger company that might move more slowly on getting approval for a new hire. The first day probably won’t be full of excitement, but you’ll likely learn some basic details about the company and your place in it. First day checklist: * I know my direct supervisor and who else to turn to for help. * I have access to whatever I need to perform my job (at least for the next day). * I understand my process for starting, working on, and completing a task (often, this could simply be moving a JIRA ticket from the to-do section to done). * I am as prepared as I can be to start the next day of work. <div style="padding-bottom: 10px; padding-top: 10px; padding-right: 50px; padding-left: 50px;"> ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/3z8ycg689jj152cqw5ju.jpg) </div> ## First Week Your first week will be a great opportunity to reach out and connect with a few of your teammates. If there are any extracurricular activities, like happy hours or company meetups, make sure to go! If there’s a teammate around your level who’s been there a little longer than you, reach out and ask what they would recommend you focus on to succeed (after all, they’ve most recently been in your position with this team). Your first week is also a great time to get a feel for what level of communication your manager is expecting. Make sure to give updates on the tasks you’re completing, and if they’re still reaching out about your tasks, it may be a sign that you should be communicating a bit more frequently. Whatever progress is made at this point, typically you’re still catching on to company-specific conventions and processes. Try to forgive yourself for any little mistakes that are bound to happen. During your first week, it’s okay to make mistakes, as long as you’re learning from them. Also remember that, as a new part of the team, your work speed is important but not the most important variable of your job performance. I had conversations with my supervisor about how accuracy, independence, and then speed were important, and typically in that order. So don’t sacrifice one higher priority item for another, and always be aware of where you are putting your energy. First week checklist: * I’ve tuned or optimized my dev environment for my position. Reach out to coworkers for tips on this one! * I’ve gathered company resources (such as handbooks, PR guides, etc.) in case I have questions. * I know who I can pair with on any problems I’m facing (you’d be surprised what experienced developers can teach you within the span of 15 minutes). * I’ve reached out to coworkers for advice they wish they had when they first started here (and why not add some of them on LinkedIn?). * I am periodically checking other employee’s work (i.e. pull requests) to see what coding patterns they use and what could be considered good or bad code. <div style="padding-bottom: 10px; padding-top: 10px; padding-right: 50px; padding-left: 50px;"> ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/j7ikv90lwpam0segtknr.png) </div> ## First Month Around the close of my first month, I started to feel like a strong part of the team, but don’t be discouraged if it takes a little longer. At this point, you’ll probably be fully onboarded and set up for success. And really, the best thing about the first month is that it’s when you start to see growth. You’ve learned company processes, and now dividends are paying off for having a growth mindset and learning from setbacks. Even though you seem to be establishing yourself within the team, don’t forget to focus on basics such as testing the functionality of your work and communicating effectively with your teammates. During my first month, I started to focus more on speed of development rather than accuracy and ultimately paid for it with pull request rejections. I then had to dig through non-working code to fix the issues, which can be a difficult process, especially compared to creating something correctly the first time. First month checklist: * I’m starting to feel confident that I’m a valuable part of the team. * I’m asking for feedback on work when I’m not getting a clear understanding of what’s going on with my code. * I’ve started picking up smaller tickets of my own accord (as long as they’re within your scope of work). * I’m starting to feel comfortable in areas of the codebase where I previously may have felt confused or lost on what was going on. * I’m still welcoming code reviews and working on not repeating mistakes that have been commented on previously. (Your managers will notice this!) <div style="padding-bottom: 10px; padding-top: 10px; padding-right: 50px; padding-left: 50px;"> ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/3k4gcws3uid8b2pbe316.png) </div> ## Onward and Upward By now, you will certainly know if you’re excelling or still need to make minor adjustments. Take the time to revel in the fact that you’re doing exactly what you want to do and getting compensated to do it! It’s a long road to get where you are, and it shouldn’t be taken lightly. Continuing to grow and develop your skill set will be important moving forward, but if you’re providing value by this point, you’re on a good path. Remember to focus on the things you can control and that no hire is perfect. If you follow some of the core principles of this guide, you’ll have plenty of resources to work with on your journey, and your journey certainly doesn’t end here. Everyone on a team was the new hire at some point, and as time goes on, you’ll probably laugh at the nervous thoughts you had leading up to your first few days. Just know that no one here wants you to fail, and your coworkers want to enjoy working with you. Keep improving, don’t listen to thoughts that make you feel like you don’t belong, and you will certainly be just fine.
jirwincline
498,942
Cool CSS clock without Javascript
Today I want to show you how can you create a pure CSS clock without any Javascript. First, What Is...
0
2020-10-27T10:48:27
https://dev.to/stokry/cool-css-clock-without-javascript-pkj
css, showdev, webdev, html
Today I want to show you how can you create a pure CSS clock without any Javascript. First, What Is CSS Animation? CSS animation is a proposed module for Cascading Style Sheets that allows designers and developers to add animations by editing the CSS code of their websites. Let's jump to the code: ```html <div class="clock"> <div class="twelve"></div> <div class="three"></div> <div class="six"></div> <div class="nine"></div> <div class="center"></div> <div class="hour"></div> <div class="minute"></div> <div class="second"></div> </div> ``` And little bit of CSS: ```css body { background-color: #0a192f; } .clock { position: relative; height: 200px; width: 200px; background: white; box-sizing: border-box; border-radius: 100%; border: 20px solid #ffde64; position: absolute; top: 0; left: 0; right: 0; bottom: 0; margin: auto; } .clock .twelve { position: absolute; width: 6px; height: 8px; background: #262626; left: 0; right: 0; margin: 0 auto; } .clock .three { position: absolute; width: 8px; height: 3px; background: #262626; top: 0; bottom: 0; right: 0; margin: auto 0; } .clock .six { position: absolute; width: 6px; height: 8px; background: #262626; left: 0; right: 0; bottom: 0; margin: 0 auto; } .clock .nine { position: absolute; width: 8px; height: 3px; background: #262626; top: 0; bottom: 0; left: 0; margin: auto 0; } .clock .center { height: 6px; width: 6px; position: absolute; left: 0; right: 0; top: 0; bottom: 0; margin: auto; background: #262626; border-radius: 100%; } .clock .hour { width: 3px; height: 100%; position: absolute; left: 0; right: 0; margin: 0 auto; animation: time 60s infinite linear; } .clock .hour:before { position: absolute; content: ""; background: #262626; height: 60px; width: 3px; top: 30px; } .clock .minute { width: 1px; height: 100%; position: absolute; left: 0; right: 0; margin: 0 auto; animation: time 30s infinite linear; } .clock .minute:before { position: absolute; content: ""; background: #262626; height: 40px; width: 1px; top: 50px; } .clock .second { width: 2px; height: 100%; position: absolute; left: 0; right: 0; margin: 0 auto; animation: time 15s infinite linear; } .clock .second:before { position: absolute; content: ""; background: #fd1111; height: 45px; width: 2px; top: 45px; } @keyframes time { to { transform: rotate(360deg); } } ``` This is our result: ![enter image description here](https://i.ibb.co/r3CfnK7/clock.gif) Thank you all.
stokry