Programming Curation Compilation #9

in #programming6 months ago
Authored by @incublus

ContentThumbnail(11).png

OCD support is expanding!

This is our newest curation effort that aims to curate posts that are shared under programming and development niche. These post highlighted are the best and most helpful content that our curators submit for the curation.

We also encourage you to visit these blogs and engage those in the community. Engagement is what makes the community thrive, so we hope that you are taking a time to visit each other post.

Author: @timix648
Curator: @incublus

image

Designing a Grid Layout Using H.T.M.L, And C.S.S. [Pt.2]

Hello everyone, in my last grid practice,I shared the stages, and steps I took to resolve a not too complex grid, being a newbie to grid. Well, I'm still on making grids, and just 2 days ago, I came across this very cool looking but complex grid online.

I must say this grid design scared me, because by mere looking at it, I could tell it was way complex than the previous one, but then I didn't let the design intimidate me but instead, I went in with full flesh for it, and I'm going to share with you my codes, for review, corrections, and probably for anyone who would like to implement the grid design into their work to save time. Let's get started!!!


Author: @timix648
Curator: @incublus

image

Designing A Business Card Using H.T.M.L and C.S.S.

Click here to view the original design. Though this design isn't as complex as the grid in my last post, it made me much better in the area of using display: flex;Like always, I will love to hear your opinion, and suggestions, based on my code, so as to help me create more effective and efficient web designs and pages in the near future. Now let's begin!!!

Author: @pibara
Curator: @incublus

A nice Python trick: Function argument erasuse.

In this blog post I want to just share a little Python trick that I'm about to go and use in my aiohivebot project.I was strugling with the problem of context in the user defined aiohivebot methods.Let's say we have the following user defined method in our bot:

Author: @cocaaladioxine
Curator: @incublus

image

Setting Up Nextcloud on a Raspberry Pi 4

I've been using a basic server built around a Raspberry Pi 3 with 1GB of RAM for some time now. I introduced it in my previous post titled So many projects, so little time....Recently, with the announcement of the Raspberry Pi 5, I had the opportunity to purchase a Raspberry Pi 4 with 8GB of RAM at the official price through Digi-Key. My Raspberry Pi 3's limited RAM had become a constraint, especially as it only allowed me to run my Hive auto-voter (which I also presented in the same post). With a multitude of projects in mind, I required a device with more RAM. However, given that my need for pure computing power is relatively low, the Raspberry Pi 5 seemed like overkill.

Author: @pibara
Curator:@hivetrending

image

AioHiveBot: MILESTONE: aiohivebot is available on pypi now

Basically you can use the aiohivebot lib to stream different blockchain events from the HIVE blockchain to user defined methods and you can use all of the querying API calls defined with JSON-RPC in order to fetch specific info from the chain, but you can't do any transactions yet with the 0.1.5 version of aiohivebot. You can do some things with this functionality for sure, but many usecases that require the bot or backend to create transactions won't open up untill I add support for that in the near future.

Author: @albro
Curator: @incublus

image

Control Structures and Errors By albro

Control structures are structures that control the execution logic of your program. The simplest of these structures is the if statement! One of the problems that occurs in writing clean code is the excessive use of these control structures (especially nested). Pay attention to the following code:

Codes that have loops and different conditions and are written in this way are at the lowest level in terms of readability because it will take a lot of time to read and understand them. The above codes are called arrow code because their general appearance is similar to the tips of arrows:


Author: @pibara
Curator: @incublus

image

On using aiohivebot in conjunction with an async python web framework like aiohttp or starlette

Asynchonous code in Python is pretty powerfull. While Python, despite of some threading support, is fundamentally a single threaded language (CPU-intensive code tends to get slower if you add more threads), by making use of the language its async features, you can do much of the stuff that many languages throw threads at in a way more natural and quite efficient way. Instead of threads you have multiple tasks, and whenever a task is waiting for IO or doing an asynchonous sleep, other tasks will get awakened because of IO operations completing.My aiohivebot library, that I'm currently actively developing does exactly this for HIVE. It starts a collection of tasks, each communicating with its own HIVE public API server (work on adding Hive-Engine nodes as well is on its way), and that's cool, but connecting different asynchonous python libraries can sometimes be a bit of a hastle.Sometimes different async libs can be a bit of a chalange to fit together, and this can be especialy true when one of the async libs is an asynchonous web framework. The problem with web frameworks is that they often insist on being in the lead, and playing nice with other long runing tasks isn't always a standard feat.

Author: @albro
Curator: @incublus

image

Inverting Conditional Logic By albro

In the previous post, we cleaned up our code to a great extent, but there is still room for optimization. If you look at the processPayment and processRefund methods, you will notice the presence of repeated if conditions, which is a sign of code duplication:

We hope you were able to take away something different, fresh, and new from these posts. We also strive to highlight the best and helpful programming and development content on Hive. We look forward to highlighting even more of you.

OCD Has a Hive Witness ... @OCD-Witness!

You can vote for @ocd-witness, with Peakd or on Hive Witnesses.


@ocdb supports community curation!

Join our Discord channel for more information.

Sort:  

Thanks for the mention and the upvote.
I'm sure all of us put a lot of ourselves in order to write those articles and it's really great to have your support!

I'm sure about that as well. Keep it up!

PIZZA!
The Hive.Pizza team manually curated this post.

You can now send $PIZZA tips in Discord via tip.cc!

Thank you so much!

Thank you very much for your support 🙏🙏

You'r welcome man, keep up the good work!

Yeah I sure will...thanks😁😁