Alayna  Rippin

Alayna Rippin

1597280400

What is Rubber Duck Debugging?

When I first heard about “rubber duck debugging” where programmers talk to rubber ducks, I was sure it was hazing. I knew that when a senior dev said I should talk to the bath toy sitting on their desk, they would burst out laughing at me. But no, somehow it’s a real thing. A real, weird thing.

What is it?

What you are supposed to do is get a duck, or any inanimate thing with a face, and you explain your problem to it. Seriously. You, a full grown adult, take out a toy in your place of business and start talking to it. You carefully explain your problem from the start, and then**_ you _**solve your problem.

How does that do anything?

Honestly, about 70% of the time, the duck really will help you solve your problem. That’s because it makes you reevaluate things that were “given.” Take this example:

OK Mr. duck, I’m running into a problem with the _fetchUsers_ function not getting metadata. What the function is supposed to do is take in the user’s id, and hit the database and return the user associated with it. To include meta-data, you just add a _true_ flag in the callback…which I forgot to flip to true. shhhhhhhhii-

That’s a fake story, but that’s usually how it goes. A lot of the problems with programming come from having a ten step process, and assuming the issue is the weird seventh step, when in reality, you already goofed step 2. But you never go all the way back to the issue because you assumed it was somewhere else. However, when explaining it to a duck (or fellow dev) in order to bring them up to speed you HAVE to go back to step 1, so you’ll catch it.

Duck via Slack

Real talk: I do not have a duck on my desk at work. I don’t have anything actually, because I felt like an idiot after causing my first bug in production, so I packed up my desk like the melodramatic child I am and waited for them to fire me. Spoiler alert: no one gets fired for trying their best and making mistakes. Anyway, the point is, I never had a duck in the first place. Why? Am I a filthy hypocrite? No. I just took the duck method and E V O L V E D.

See, as most new devs do, I ask my teammates a lot of questions, and mostly over slack. After a while, a curious thing happened, I would debug for like an hour, give up, and then type out the question to a teammate:

Hey Lynn, I was trying to get the docker container up, but I’m getting a bad DB error. Have you seen this before?

Then, not even 5 seconds after hitting send, I would realize what she would probably say back:

Did you run the restore script? You have to run it with the “ — backup” flag if you used prod data.

That was it, suddenly the answer seemed _so _obvious and I was embarrassed to have even asked the question. A few minutes later she would say something along those lines and I would hastily apologize for asking such an obvious question.

#web-development #programming #development #software-development #coding

What is GEEK

Buddha Community

What is Rubber Duck Debugging?
Aileen  Jacobs

Aileen Jacobs

1596739200

What Is the Best Java Debugger?

Many people might think this a simple question; I am not one of them. I feel that in the modern world of development, there are too many factors to pick a single tool for debugging any language, let alone Java.

In The Beginning

Let’s take a step back and look at where we started with debugging, and while I am not going to get into the history of debugging, we should look at some of the basic tools used for debugging Java, aside from logging and system-out.

JDP

Let’s start with a quick look at the Java debugger (Java Discovery Protocol - JDP), which is a command-line tool used for debugging Java applications. This tool ships directly from Oracle, so you can be sure it will work; however, it can be complex to use and require knowledge of where you want to debug ahead of time.

A positive aspect of this tool is the fact that you can use it on the same box where the Java Virtual Machine (JVM) is running. This set-up means you do not need to deal with the complexities of connecting any external service that might be restricted by firewalls, which is particularly useful if you are deploying your Java applications into Docker containers. (which let’s be honest, who isn’t).

And while a command-line tool is not the best option for everyday work, what other options are available?

#java #performance #ide #debugging #debug #debuggers #debugging tools #debugging javascript

Crypto Like

Crypto Like

1607998212

What is Unit Protocol Duck (DUCK) | What is DUCK token

Introduction

The Unit protocol allows users to borrow stablecoin USDP based on various tokens value. For more details, check the first version of the whitepaper.  https://github.com/unitprotocol/protocol_docs/raw/master/unit_wp.pdf.

Updated information will be provided below.

Main collateral

If a user would like to borrow stablecoin USDP, he has to deposit collateral first. In Unit Protocol, each Collateralized Debt Position(CDP) consists of 2 collateral — main collateral and COL. Each asset(main collateral) has its own restrictions on the minimum and maximum % of COL in CDP.

Every main asset has its own CDP, so with many different main assets, a user can create a few CDPs, and each of them may have different parameters.

Your Balances

This section represents ETH balance and non-zero balancers of assets in your wallet right now.

Deposit and Borrow

In this section, a user can deposit collaterals to the main asset CDP and borrow USDP.

Users can deposit an unlimited amount of main collateral and COL to CDP, but USDP borrowing ability will rely on min and max % of COL in position restrictions. The amount of USDP which can be borrowed can be found from the equation:

(mainUtilizedMax + col) ∗ minCol% = col

(main + colUtilizedMax) ∗ maxCol% = colUtilizedMax

Utilization means how much value of an asset we can use for minting USDP. Variables mainUtilizedMax and colUtilizedMax works as borders which constraint deposited value of col and main. So we can count the actual value of each asset we can utilize:

mainUtilize = min(main; mainUtilizedMax)

colUtilize = min(col; colUtilizeMax)

Total utilized collateral is a simple sum of separate collaterals:

totalUtilizeMax = mainUtilize + colUtilize

and after finding the total value which we actually use as collateral, we can count the maximum amount of USDP we can borrow depends on Initial Collaterization Ratio(ICR) — limit for initially opened position, represents proportion debt/collateral.

maxDebt = totalUtilizeMax*ICR

maxDebt is the total USDP a user can borrow based on collaterals amount and system risk parameters.

Buttons:

  • Max buttons for collaterals — set the maximum amount of collateral in your wallet.
  • Req button for COL — set minimum amount of COL you need to deposit to utilize 100% main collateral in the previous field.
  • 25\50\75\100% button — set % of maximum USDP you can borrow based on input fields.

Withdraw and repay

In this section, a person can withdraw collaterals and repay USDP for the selected main asset CDP. Withdraw function is limited with current ICR restrictions (the proportion of debt/collateral can’t be higher than this limit). The repay function is not limited, and the user can repay USDP anytime.

Buttons:

  • If you press Max for collaterals fields but the repay field will be 0, the app will set the maximum amount of collateral you can withdraw without repaying any USDP.
  • If the user presses Max for USDP repaying first, the system will allow him to withdraw all deposited collaterals with their relative Max button.

Your CDPs

This table shows all open CDPs and their essential parameters. Each CDP can be managed after the relative main collateral choice on the top of the page.

  • Asset — asset ticker and icon.
  • Asset amount — the main collateral amount in the CDP.
  • COL amount — $COL amount in the main collateral CDP.
  • Borrowed USDP — the amount of borrowed USDP for this main collateral CDP.
  • Utilization — borrowed USDP / max available USDP to borrow represented in %.
  • Health factor — a simple indication of liquidation safety for the CDP. If it goes below 1 — the position can be liquidated. The parameter can be found from the equation:

H = (TotalCollateral * LR)/(BorrowedUSDP+StabilityFee)

where

  • LR — liquidation ratio for the CDP(proportion of the main asset+COL) (debt/collateral rate below which position can be liquidated)
  • TotalCollateral — all deposited collateral for the CDP
  • BorrowedSUSDP — total debt for the CDP in USDP
  • StabilityFee — stability fee for the CDP. It capitalizes during every action, which reduces debt/collateral ration like withdrawing collateral and borrowing more USDP.
  • Liquidation fee — fee in % from the loan, which will be deducted from collateral if liquidation will occur.

Oracle price

In the section, you can see oracle prices of selected main asset and COL.

Right now, oracle represents 30 minutes window Uniswap time-weighted average price. More details here, https://uniswap.org/docs/v2/core-concepts/oracles/.

But soon it will be changed.

Parameters

Asset related parameters

  • Minimum % of COL, % — minimum % of COL in CDP utilized collateral (which will be used to count borrowing USDP limit).
  • Maximum % of COL, %- maximum % of COL in CDP utilized collateral (which will be used to count borrowing USDP limit).
  • Liquidation ratio(LR) — liquidation ratio for the CDP(proportion of the main asset+COL) (debt/collateral rate below which position can be liquidated)
  • Initial collateral ratio(ICR)-initial proportion debt/collateral available to open a CDP. LR>ICR to create some safety reserve to avoid fast liquidation.
  • StabilityFee, % — stability fee for the CDP. It capitalizes during every action, which reduces debt/collateral ration like withdrawing collateral and borrowing more USDP.
  • Liquidation fee, % — fee in % from the loan, which will be deducted from collateral if liquidation will occur.
  • USDP limit, USDP — the maximum amount of USDP which can be borrowed for the main collateral CDPs in total.
  • Devaluation period, blocks — the amount of block necessary for the full devaluation of the liquidated collateral. Represents the speed of value decreasing per block.

Liquidation

If for current CDP proportion debt/collateral overcome Liquidation ratio(LR), the position can be triggered for liquidation. The collateral will be sold for USDP. If Liquidator (any user) doesn’t want to buy out instantly, it triggers the auction with the linear per block price decreasing.

After realization, collateral for USDP, USDP, which is equal to debt, will be burned. Liquidation fees will be deducted, and the remaining part will be returned to the liquidated CDP owner’s address.

Would you like to earn many tokens and cryptocurrencies right now! ☞ CLICK HERE

Looking for more information…

☞ Website
☞ Explorer
☞ Source Code
☞ Social Channel
Message Board
☞ Coinmarketcap

Create an Account and Trade Cryptocurrency NOW

Binance
Bittrex
Poloniex

Thank for visiting and reading this article! I’m highly appreciate your actions! Please share if you liked it!

#bitcoin #crypto #blockchain #unit protocol duck #duck

Samanta  Moore

Samanta Moore

1623788040

What Remote Debugging Means For Java Applications

Remote debugging is becoming a best practice for cloud application development due to gaps with logging and breakpoints, so how does this work for Java apps?

Following the lingering promise of managed infrastructure, reduced operational cost, and resiliency, cloud computing has seen phenomenal trends in adoption since the past decade. As software development marches towards the cloud, we soon realize that this shift warrants the need to rethink our debugging strategies. This is because as software systems are now leveraging these advancements in cloud computing and distributed systems we see gaps emerging in debugging that cannot be satisfied by the traditional methods of logging and breakpoints.

For example, a major issue while using breakpoints is that the codebase needs to be run in debug mode. Therefore, we are not actually replicating the actual state of our systems taking into consideration multi-threading, distributed services, and dependencies on remote services in a cloud-native environment along with multi-service architecture. Similarly, logs offer no respite, as they may be cumbersome and even costly to execute and store.

Therefore, considering the new era of technology and software, we see a movement to redefine debugging practices to better suit this new world. This is where we see the birth of remote debugging. A debugging technique that aims to provide the solution for cloud development and all its pitfalls when it comes to traditional debugging in the cloud or basic remote landscape. It allows debugging a system when the system itself is not in the local environment of the developer by setting up a connection between the developer’s local environment and the service to be debugged that sits on a remote server.

Therefore, this article aims to expand on why remote debugging is needed, the disadvantages that may arise, and how we can go about remote debugging Java applications.

#java #testing #cloud computing #monitoring #jvm #debugging #observability #debugger #java libraries #remote debugging

Debug: The Debug Component Provides tools To Ease Debugging PHP Code

Debug Component

The Debug component provides tools to ease debugging PHP code.

Getting Started

$ composer require symfony/debug
use Symfony\Component\Debug\Debug;

Debug::enable();

Resources


CAUTION: this component is deprecated since Symfony 4.4. Instead, use the ErrorHandler component.


Download Details:

Author: Symfony
Source Code: https://github.com/symfony/debug 
License: MIT license

#php #debug 

HI Python

HI Python

1623768240

Debugging Python Code Visually

Using Birdseye for debugging Python code

Are you one of those programmers who use the print() command for debugging your python code or functions? If the answer is yes then you are not alone, most of the python programmers who use Jupyter notebook debug their code like this. There is nothing wrong with it but it is not a convenient way of how we should debug our code.

Birdseye is an open-source python library that is used to debug python code. It records values of expressions in a particular function while it is running and you can visualize these values once the function is executed and debug it if there is an issue.

In this article, we will see how Birdseye is used for python code debugging.

Let’s get started…

#debugging #python #machine-learning #data-science #data-visualization #debugging python code visually