I’m making a program for the moora method on a decision support system

I want to make a calculation where the atribut columns whose rows have benefit values are all placed on the left and all rows with cost values are placed on the right. with the actual calculation formula like this:

(0.25x0.49237)+(0.15x0.71842)+(0.15x0.44721)+(0.15x68680) (benefit row atribut column and weight) - (row atribut column cost and weight)(0.3x0.36927) = 0.290176

what I do is even a calculation like this (0.3x0.36927)+(0.25x0.49237)+(0.15x0.71842)+(0.15x0.44721)+(0.15x0.66880)= 0.51173

anyone know how? The coding I made https://pastebin.com/U8mm7fgY

Note: the number of benefits and costs in the attribute column matches those in the database, the coding will automatically look for the benefit and cost rows with the formula pattern that I have explained

URL Shortener Complete Tutorial

Introduction

A URL shortener is a service that is used to create short links from very long URLs. Usually, short links have the size of one-third or even one-fourth of the original URL, which makes them easier to type, present, or tweet. Clicking on a short link user will be automatically redirected to the original URL. 

There are many URL shortening services available online, such as tiny.cc, bitly.com, and cutt.ly. Implementing a URL shortening service is not a complex task, and it is often part of system design interviews. In this post, I will try to explain the process of implementing the service. 

Branded Social Images, a New Plugin for Generating Per-Post Open Graph Images

Generated social images seem to be all the rage now. Automattic scooped up Daniel Post’s Social Image Generator last month for eventual inclusion in Jetpack. There is a proposal to dynamically generate them for plugins and themes hosted on WordPress.org. And, there is a new player in town: Branded Social Images.

Admittedly, I have had a mild obsession lately with the concept, and I would like to see the Tavern use dynamically-generated social images at some point. Because we already use Jetpack, I will wait to see where its development team takes the feature.

Branded Social Images is a solid addition to the WordPress plugin directory for those who want a solution now. It is not as featured-filled as Social Image Generator, which is no longer available for purchase. However, it is an introduction to the concept for those trying it out for the first time. And, it may just prove well-rounded enough for many users.

The plugin was released by Internetbureau Clearsite, a web development and design agency. Branded Social Images is the team’s first extension on WordPress.org.

My favorite feature from this plugin is that it allows users to upload any TTF or OTF font file for the social image’s text. I tested it with the Oleo Script Swash Caps and Rampart One font families to see how it worked.

Well, I tested with several more than that, but I had to stop myself before going too far. I have a font addiction and am easily sucked into hours of tinkering with them. The goal was to test this plugin feature, and it worked as it was supposed to.

The plugin already packages a reasonable set of 10 font families to choose from out of the box. If nothing suits your fancy, just snag one from Google Fonts or another site of your choosing and upload the .ttf or .otf file.

Branded Social Images is straightforward to use. Its settings screen has a preview image at the top and two boxes with settings. One for the social image text. The other is for the background image and logo.

Where it fails to live up to the competition is that it does not have any pre-built templates. This is not necessarily a make-or-break feature, but it also does not have the design options to recreate many of the layouts of something like Social Image Generator.

Essentially, the layout options boil down to positioning a logo and text atop a background image via a three-by-three grid.

However, its scaled-back interface with minimal options could be seen as a feature in and of itself. Not everyone needs or desires a swath of settings when a few baseline customizations will do.

I did have some trouble understanding whether the placeholder logo could be removed. After some testing, I realized it was limited to the settings screen unless I explicitly uploaded a custom one. I would also like to see an option to use the site title instead — not every site has a logo but might still want to show their brand name.

Users can also modify the social image on a per-post basis. The plugin adds a meta box with four options on the post-editing screen for:

  • Disabling the social image.
  • Editing the text.
  • Disabling the text.
  • Adding a custom image.
Meta box from the Branded Social Images plugin, showing a preview and controls for generating a per-post social image.
Per-post social image options.

By default, the text will be the post’s document title. It should work with most SEO plugins, such as Yoast SEO. The featured image will also be swapped in for the background if a custom one is not added.

After three years of using the current WordPress post editor, it still catches me off-guard when a plugin puts a meta box at the bottom of the screen instead of the sidebar. It always looks out of place. In this case, it takes up a ton of real estate for four options, and there is no need for it. If I could wave a magic wand and change one thing about the plugin, this would be it.

The plugin also breaks the cardinal rule of not adding a top-level admin menu item for a single screen. WordPress literally allows for sub-menu items under Settings. So, maybe I need that magic wand for two things.

Outside of a few issues, I love what the plugin team has created thus far. It is a little rough around the edges, but that is OK for a version 1.x. Software is meant to be iterated and improved upon, and Branded Social Images has the foundation for becoming even better.

How to Reduce Onboarding Costs by Using a Code Repository

Onboarding new developers into a project is a time-demanding and costly process, isn’t it? Just finding a proper specialist isn’t sufficient. We all know that every software development company has its own practices and uses its own tools. And those tools might even be in-house developed.

Therefore, it doesn't matter how skilled and experienced your new team member is, they will need to learn a lot. Sometimes, it takes pretty much time for them to learn all about the project they start working on (to start coding new features, for example), about the company’s corporate culture, and the commonly accepted practices and processes. Needless to mention the extensive documentation, and similar. 

Jetpack Launches Commercial Backup Feature as a Standalone Plugin

Jetpack is splitting out its commercial Backup feature into a standalone plugin that can be used without installing the core Jetpack plugin.

The commercial product includes automated daily or real-time backups with one-click restores, even for sites that are offline. Backups include all WordPress database, theme, and plugin files, which are stored on WordPress.com’s infrastructure with redundant copies on multiple servers. The product was built with WooCommerce in mind and can restore a site to any past state while keeping current orders and products in place.

Jetpack representative Rob Pugh said the product was split out of the core plugin because “many developers and site owners asked for the flexibility to use specific components of Jetpack as part of their own, custom-built ‘tech stack’ of plugins.”

The standalone plugin is available on WordPress.org and requires a user connection to WordPress.com. It is essentially a shell for connecting the commercial product, as the plugin doesn’t have a free tier or perform any function unless you click “Upgrade Now.”

The plugin’s description on WordPress.org is somewhat misleading, as it isn’t explicit that this is a commercial-only product. The “Get Started” section states, “Installation is free, quick, and easy. It only takes a few minutes to install Jetpack Backup.” The fact that it’s a paid product isn’t evident unless you dig into the accordion FAQ section about how to create a backup: “As soon as you purchase Jetpack Backup, it will be activated, and the first backup will be completed.”

The launch of the new standalone plugin should not affect current Jetpack customers using the backup services.

“It’s the same engine that powers the backup solution that’s part of the full Jetpack plugin and we’ve developed loaders to only load the engine once—whether you have only Jetpack, only this, or both,” Jetpack engineer Brandon Kraft said. “If you have Jetpack already, this adds some UI for you, but the same service.

“The loader tech is the same that ensures the connection code only loads once between this, Jetpack, Boost, WooCommerce Payments, etc and ensure the latest version is running. [You] don’t have to load into memory more than you need.”

Jetpack is often criticized for being “bloated” and bundling too many features. In 2019, the Jetpack team began promoting feature suggestions on the plugin search screen in an attempt to solve a discovery problem, where users are quite often not familiar with the plugin’s dozens of modules and end up installing plugins to perform functionality that Jetpack already includes. Splitting the backup feature out into its own plugin should be helpful on this front and is part of a long-term plan to make Jetpack more modular. Jetpack Backup joins Jetpack CRM and Jetpack Boost, two features already available as standalone plugins outside of the core plugin.

What if… you could use Visual Studio Code as the editor of in-browser Developer Tools?

It’s not uncommon for my front-end workflow to go something like this:

  1. Work on thing.
  2. See that thing in an automatically refreshed browser.
  3. See something wrong with that thing.
  4. Inspect and correct the thing in DevTools.
  5. Apply the correct code in my code editor.
  6. See that correct code automatically refreshed in the browser.

I know, it’s not always great. But I’d bet the lint in my pocket you do something similar, at least every now and then.

That’s why I was drawn to the title of Chris Hellman’s post: “What if… you could use Visual Studio Code as the editor of in-browser Developer Tools?”

The idea is that VS Code can be used as the editor for DevTools and we can do it today by enabling it as an experimental feature, alongside Microsoft Edge. So, no, this is not like a prime-time ready universal thing, but watch Chris as he activates the feature, connects VS Code to DevTools, gives DevTools access to write files, then inspects the page of a local URL.

Now, those changes I make in DevTools can be synced back to VS Code, and I have direct access to open and view specific files from DevTools to see my code in context. Any changes I make in DevTools get reflected back in the VS Code files, and any changes I make in VS Code are updated live in the browser. Brilliant.

I’m not sure if this will become a thing beyond Edge but that sort of cross-over work between platforms is something that really excites me.

Direct Link to ArticlePermalink


The post What if… you could use Visual Studio Code as the editor of in-browser Developer Tools? appeared first on CSS-Tricks. You can support CSS-Tricks by being an MVP Supporter.

IBM App Connect Enterprise: Record and Replay [video]

In this video, we demonstrate a capability in IBM App Connect Enterprise called record and replay, which enables you to keep an audit record of messages that pass through message flows deployed to integration servers.

You may need to record messages to keep a history of messages for development and test purposes, or to help in problem determination.

How Open Source Can Help You Scrape LinkedIn in a Postgres Database

“Data” is changing the face of our world. It might be part of a study helping to cure a disease, boost a company’s revenue, make a building more efficient, or drive ads that you keep seeing. To take advantage of data, the first step is to gather it and that’s where web scraping comes in.

This recipe teaches you how to easily build an automatic data scraping pipeline using open source technologies. In particular, you will be able to scrape user profiles on LinkedIn and move these profiles into a relational database such as PostgreSQL. You can then use this data to drive geo-specific marketing campaigns or raise awareness for a new product feature based on job titles.

Sift Enhances Its Fraud Detection and Mitigation API

Sift, an internet security and fraud prevention company, has announced updates to the company’s API that are intended to simplify integration with its platform while also improving functionality. These Improvements utilize machine learning for advanced fraud detection. 

Hands-On Presto Tutorial: Presto 105

Introduction

This is the 5th tutorial in our Getting Started with Presto series. To recap, here are the first 4 tutorials:

Presto is an open source distributed parallel query SQL engine that runs on a cluster of nodes. In this tutorial, we will show you how to run Presto with AWS Glue as a catalog on a laptop.

IBM App Connect Enterprise [video]

In this video, we demonstrate a new capability in IBM App Connect Enterprise to create a subflow user-defined node using the toolkit. After creating the subflow user-defined node, we will use it in another installation of App Connect Enterprise in a message flow and deploy and test the flow.

You can learn more about installing a subflow user-defined node and subsequent authoring, testing, and packaging tasks in the IBM Documentation topics.

The Coding SysAdmin

In announcing the now-complete $1.2 billion megamerger between McAfee and FireEye last week, CEO Bryan Palma slipped in the comment that the way forward with security and modern system management is automation, saying,

"There's just no way that people can keep up, and we're seeing that. We've got nation-states now involved in making attacks, and that's very concerning because they obviously have very strong capabilities."

Building a Metadata Driven UI

Description

Metadata-driven UI is especially useful in project teams with a high back-end or DBA competence rather than UI.

In general, it provides an element alignment by invocation of a single endpoint which provides all data required like cardinality, language, font size, and the font itself.

Vue.js and Symfony: Roles Authentication

One of my latest private projects was Frontend built fully with Vue.js. I wanted to support a group of users and roles, where certain account types would be restricted from entering given pages or seeing some of the components. 

While Symfony restrictions are provided out-of-box, Vue.js doesn't have such a built-in mechanism, so I decided to combine a bit of knowledge from Vue.js tutorials and Symfony mechanism.

Oracle Partition Pruning

Oracle database optimizer analyzes your SQL statement, if there is a partitioned table and "appropriate" where condition, it decides which partitions will be ignored and which partitions will be accessed and read. This is called partition pruning. It is an essential performance feature for data warehouses.

As you can guess, when you prune some of the partitions, the data you need to read from disks is reduced considerably, which leads to shorter processing times.

Smart Dependency Injection With Spring: Assignability (Part 2 of 3)

Preface

The Spring Framework  is a very powerful framework and provides first class support for dependency injection (DI). This article is the second one in my series dedicated to dependency injection  with Spring Framework. My series is split into these three articles:

In This Article, You Will Learn:

  • How to inject beans by a common interface
  • How to inject beans by ancestor (usually abstract) class
  • How to inject beans by annotation

Overview

In my previous article, I reviewed the DI basics: different configuration types, injection variants, injection rules, or injected types. Most of it is well known and that article serves just as a summary.

Data Fabric: What Is It and Why Do You Need It?

Insight-driven businesses have the edge over others; they grow at an average of more than 30% annually. Noting this pattern, modern enterprises are trying to become data-driven organizations and get more business value out of their data. But the rise of the cloud, the emergence of the Internet of Things (IoT), and other factors mean that data is not limited to on-premises environments. In addition, there are voluminous amounts of data, many data types, and multiple storage locations. As a consequence, managing data is getting more difficult than ever.

One of the ways organizations are addressing these data management challenges is by implementing a data fabric. Using a data fabric is a viable strategy to help companies overcome the barriers that previously made it hard to access data and process it in a distributed data environment. It empowers organizations to manage mounting amounts of data with more efficiency. Data fabric is one of the more recent additions to the lexicon of data analytics.