Adding a new empty row onto a Datagridview

Hello all
I have a form with two datagridviews.
Grid A is polulated with orders from DB, grib B has an empty table with the same column name as grid A.
Im currently draging orders from Grid A onto grid B.
My isue is that since grid B has only one empty row, it only alows to drag one item.
What I want to accomplish is to add an empty row in grid B In index 0 (the firsst row)
In the dragdrop event I tried to add an empty row, but this code inserts an empty row before the firtst row that was added

Private Sub DGV_Pulled_DragDrop(sender As Object, e As DragEventArgs) Handles DGV_Pulled.DragDrop Dim RowsSource As Integer = Convert.ToInt32(e.Data.GetData(Type.GetType("System.Int32"))) Dim clientPoint As Point = Me.DGV_Pulled.PointToClient(New Point(e.X, e.Y)) Dim hit As DataGridView.HitTestInfo = Me.DGV_Pulled.HitTest(clientPoint.X, clientPoint.Y) If hit.Type = DataGridViewHitTestType.Cell Then DGV_Pulled.Rows(hit.RowIndex).Cells(hit.ColumnIndex).Value = DGV_Orders.Rows(RowsSource).Cells("oe").Value DGV_Pulled.Rows(hit.RowIndex).Cells(hit.ColumnIndex + 1).Value = DGV_Orders.Rows(RowsSource).Cells("Address").Value Dim order As String = DGV_Orders.Rows(RowsSource).Cells("OE").Value End If Dim row As New DataGridViewRow With row .CreateCells(DGV_Pulled) .Cells(0).Value = DBNull.Value End With Me.DGV_Pulled.Rows.Add(row) End Sub

Gutenberg 9.5 Improves Site Editor and Adds New Options for Cover and Code Blocks

Gutenberg 9.5 went live today. The development team is continuing forward with work that we will start seeing down the road in WordPress 5.7 and beyond. The big user-facing highlights for this release were the additions of a full-height alignment option for the Cover block, font-size support in the Code block, and improved previews for block patterns.

The majority of users will not see most of the work that went into the 9.5 release. The team addressed dozens of bugs and enhancements for the full-site editing feature. To test them, users must be using a block-based WordPress theme, such as Twenty Twenty-One Blocks, Q, or Block-Based Bosco.

We are a long way from seeing a production-ready site editor, but it is nice to see the improvements with each major Gutenberg release, such as the ability to set a post’s featured image if it doesn’t exist. The new description, status, and theme admin columns for templates and template parts add useful information. And, the developer side of me is happy to see a new wp_theme taxonomy for grouping templates under the hood rather than metadata.

The development team has made progress on the Query block. It is probably the most important piece of the full-site editing puzzle, and its current state is still holding back movement on block-based themes. The block now sports a new “grid view” option. There is also a Posts List variation that sets up a default of listing blog posts and excluding sticky posts. This block variation is a step toward pushing third-party plugin developers into creating custom variations for their post types in the future, building from the example set by WordPress.

Full-Screen Cover Block

Using the full height alignment option with the Cover block in the WordPress editor.
Setting the Cover block to full height.

The Gutenberg team added a new Full Height Alignment toolbar option to the Cover block. This is an independent alignment option and does not interfere with the existing horizontal alignments.

When adding the Cover block to a post, users will see a new frame-like button in the toolbar. After clicking, it will automatically set the height setting in the block options to 100 vh, which is the full height of the browser viewport. This option is far more flexible than having users set a height with pixel units, which do not automatically adjust based on the visitor’s screen size.

By combining this new alignment with full-width alignment, users can create full-screen layouts with the Cover block.

The new toolbar control will likely land in other core blocks. The Media & Text block is another good use case. Plus, third-party plugin developers can integrate it into their blocks. As its use becomes more widespread in blocks, it will offer more robust design options for theme developers too.

Change Code Block Font Size

Adjusting the font size of the Code block in the WordPress editor.
Setting the Code block’s font size.

The Code block now has the same font-size option as other text-based blocks, such as Paragraph and List. In general, users should probably shy away from adjusting this on a per-post basis and stick to the global default set by their theme or the Global Styles options when they eventually land in WordPress.

However, there are use cases where it makes sense to change the code font-size in particular layouts. I imagine some development-related site owners will want to highlight or showcase code in some way.

With that in mind, it would be interesting to see other design options brought to Code block. Currently, it does not offer much in the way of customization, but color and background options could allow users to spruce up their code examples a bit without relying on a third-party plugin for that extra bit of pizzazz.

Java Concurrency Evolution

Since the early days of Java, Threads were available to support concurrent programming. Interestingly till Java 1.1, green threads (virtual threads) were supported by the JVM, but they were dropped in favor of native OS threads, however with Project Loom on the horizon (targeted for Java 16 or later?), virtual threads are on track to become mainstream again.

The goal of this article is to go through the main milestones for the evolution of thread/concurrency handling in Java. As the topic can easily fill a library full of books, the following aspects are out of scope (basically, the goal is to take a look at the happy path of Java concurrency):

Lessons Learned from the November AWS Outage

Context, Analysis, and Impact

  • Amazon’s internet infrastructure service experienced a multi-hour outage on Wednesday, November 25th, that affected a large portion of the internet.
  • More than 50+ companies were impacted, including Roku, Adobe, Flickr, Twilio, Tribune Publishing, and Amazon’s smart security division, Ring, in its region covering the eastern U.S.
  • Business impacts, as reported by The Washington Post, included:
    • New account activation and the mobile app for streaming media service Roku became hampered.
    • Target-owned Shipt delivery service could receive and process some orders, though it stated that it was taking steps to manage capacity because of the outage.
    • Photo storage service Flickr tweeted that customers couldn’t log in or create an account because of the AWS outage.

Tweets by companies experiencing outages.

  • Root Cause Analysis by AWS: It started with Amazon Kinesis but started impacting a long list of services. You can read the RCA document by AWS, which is also summarized below:
    Flowchart of AWS impact spread.

Lessons Learned

#1: Don't Put All Your Eggs in One Basket

  • Using a single Cloud Service Provider can be counter-productive in these scenarios.
  • Think and strategize for Hybrid-Cloud or Private Cloud; or Multi-Cloud, particularly during peak season.

#2: Hope for the Best and Plan for the Worst

  • Don't just rely on a cloud provider's availability and multi-region fail-over strategy; build your own resiliency and disaster recovery approach.
  • Practice disaster recovery in production or similar systems by using innovative approaches in active-active setup across the multi-cloud or hybrid-cloud scenarios.

#3: Monitoring and Observability Are Not Static

  • Be innovative in exploring monitoring and observability patterns. For example, if AWS is reporting an outage on their status page, your monitoring system should get into action and inform the incident resolution team to start analyzing the impact.
  • Keep ready the services dependency graph; though mostly supported by tools, you should keep it dynamic and prepared to assess the impact when it happens and map it to business functionalities to report it to your business team accurately.

#4: Invest in Emerging Techniques, like Chaos Engineering

  • This failure indicates that even internet giants like AWS are still maturing in implementing practices like chaos engineering. So, start putting chaos engineering practices into the roadmap.
  • For example, if a bulkhead pattern could have been utilized in the AWS outage scenario, the outage would have been limited to Kinesis services only.

To conclude, being proactive when outages occur, having a response team equipped for unplanned outages, and improving continuously from lessons learned along the way are essential techniques to help keep the impact limited. Also, having a multi-cloud or hybrid-cloud strategy is food for thought to keep the business running.

#294: Ten Bugs

At the end of the year we’re in a bug-bashing mood. Chris and Marie are on to talk bug fixing, and dig into the behind-the-scenes on the last 10 bugs we fixed.

Time Jumps

  • 00:26 Software versioning
  • 07:06 Issues vs Features
  • 12:14 Sponsor: Netlify
  • 14:49 Dealing with issues
  • 20:47 Various bugs we’ve fixed

Sponsor: Netlify

Netlify is great for a million reasons, chief among them how easy it makes to deploy your code. Not just static files, either. Netlify helps you deploy serverless functions as well. And now, those functions can run much longer: 15 minutes. That’s enough time to do long-running tasks like web scraping, media generation and optimization, and things like data syncing.

Show Links

CodePen Links

The post #294: Ten Bugs appeared first on CodePen Blog.

Minimal Takes on Faking Container Queries

It’s sounding more and more likely that we’re actually going to get real container queries. Google is prototyping a syntax idea from David Baron and refined by Miriam Suzanne. Apparently, there has already been some prototyping done for a switch() syntax which is like container queries on values. Even now, there is stuff like the Raven technique which can do container query-esque values. This stuff will shake out over time.

If you need solutions today, most of them involve JavaScript watching what is going on (i.e. the container width) and then giving you some kind of styling hooks (e.g. classes). Here’s a quick review of the “minimal takes” landscape:

  • Philip Walton shows how to homegrow that with ResizeObserver. Watch sizing, apply classes for styling hooks.
  • Heydon Pickering has a <watched-box> web component that leverages ResizeObserver. Watch sizing, apply classes for styling hooks. (See combination with resizeasaurus.)
  • Scott Jehl made a <c-q> web component that leverages ResizeObserver. Watch sizing, apply data attributes for styling hooks.
  • Eric Portis made conditional-classes which leverages ResizeObserver and a clever (and valid) syntax involving CSS custom properties that end ups applying classes for styling hooks.

There is also Tommy Hodgins’ EQCSS, which does container queries (and other stuff) by looking through your CSS for the invented syntax that does these fancy things. I wouldn’t really call it minimalist, and it slightly creeps me out to ship invalid CSS syntax, but it does look robust.


The post Minimal Takes on Faking Container Queries appeared first on CSS-Tricks.

You can support CSS-Tricks by being an MVP Supporter.

Amplify, Amplified

First, quickly: AWS Amplify has a new Admin UI. Amplify always had a CLI that helps you build projects by setting up stuff like auth, storage, and APIs. That’s super useful, but now, you can do those things with the new Admin UI. And more, like model your data (!!), right from a local UI. That’s great for people like… me (I like my GUIs).

Now, slower.

Let’s start with the idea of Jamstack. Static Hosting + Services, right? Amplify is that: static hosting is part of the offering. You connect an Amplify project with a Git repo (you don’t have to, you could upload a zip, but let’s be real here). When you push to the designated branch on that repo (probably main or master), it deploys. That’s part of the magic of development today that we all know and love expect.

Static hosting might be all you need. Done.

But a lot of sites need more. Maybe your site is client-side rendered (for some of it), so the JavaScript hits an API for data and then renders. What data? What API? AWS has these things for you. For us front-enders, that’s probably AWS AppSync, which is like real-time GraphQL (cool). How do you set that up? Well, you can do it in the CLI, but it’s now way easier with the Amplify Admin UI.

Say you’re building a blog structure. Blogs have Posts, Posts have Comments. And so:

I’ll tell ya, coming from a WordPress upbringing and identifying mostly as a front-end developer, this feels doable to me. It’s not far from using Advanced Custom Fields in WordPress to model some data for a Custom Post Type. No wonder the line is so gray between front-end and back-end development.

Now that the Amplify Admin UI has this data modeled out, I can yank it down into my project and the whole schema is mocked out.

I’m bullish on GraphQL, but I can tell ya, all the setup of it is generally over my head. I’m generally very happy just being a consumer of a GraphQL API that is already set up, or doing minor tweaks. This, though, feels doable for me. The visual builder and the freebie scaffolding of the schema… yes please.

At this point then you have this project you can test and deploy. Once it’s deployed, there is a real data store in the cloud ready for data. How do you use it? It’s CRUD time! Create, Replicate, Update, and Delete, the core tenants of all good websites, right? Well, It’s Just JavaScript™. Here’s how you create a new blog, then a post in that blog:

import { DataStore } from '@aws-amplify/datastore';
import { Blog } from './models';

const newBlog = await DataStore.save(
 new Blog({
   "name": "Name of Blog"
 })
);

await DataStore.save(
 new Post({
   "title": "Blog Post Title",
   "blogID": newBlog.id
 })
);

That all works because the database exists and our app knows all about the data model. But what is DataStore in AWS Amplify? That’s yet another thing that AWS Amplify helps with. They have libraries to make all this easier. You don’t have to manually write fetch calls and do error handling and all that… Amplify libraries make life easier with all sorts of helpers (like you see above).

With all that setup, this slide I saw in their developer preview I got a peak at should make sense

AWS Amplify: Getting it Done

Back to the Jamstack thing… now we’ve got Static Hosting going and we can deploy our website to it. By the way, that can be anything. A vanilla HTML/CSS/JavaScript thing. A React, Vue, or Angular app. Native apps too. Amplify doesn’t care, it just helps with the deployment and services.

Here’s a look at the Admin UI, where you can see the navigation with all the services you can set up, deployment activity, the ability to model (and edit) data, etc.:

What else is in there? With auth for one. If you’re storing data and managing it with API’s, it’s highly likely you’ll be dealing with authentication as well. Amplify has you covered. Need some to run some code server-side? You’ve got your functions right in there of course. Lambdas (serverless functions) are AWS bread and butter. Analytics? You bet.

Another thing you’ll surely be interested in is the different development stories. Like what is local development like? Well, it’s super good. Guess what?! Those screenshots above of the Admin UI… those aren’t some online dashboard in the AWS console, those are locally hosted on your own site. All this data modeling and storage and editing and such happens locally. Then you can push to live to any environment. Production, of course, but also whatever sort of staging environments you need.

When you need production data pulled down locally, you just… do that (with a command given to you right in the Admin UI).

You can join the Amplify team to find out more – they’ll be demoing on Twitch with Q&A this week:

Thursday,  Dec. 3rd at 10-11am PST/ 7pm GMT
Friday,  Dec. 4th at 1-3pm PST / 9pm GMT
www.twitch.tv/aws

I’m thinking this new Admin UI world is going to open up AWS Amplify to a lot more people. Having a UI to manage your site just feels better. For someone like me, it gives me a more complete understanding of what is going on with the backend and services, and more control over things. And yet, give me total freedom on the front end to do what I want to do, and also handle so many of the things I don’t (deployment, SSL, etc.) 👏


The post Amplify, Amplified appeared first on CSS-Tricks.

You can support CSS-Tricks by being an MVP Supporter.

Application Modernization and Rabbits

If this article is too long for you, you can also watch the 1:40 min video at the bottom of the page.

Earlier this year I got my children two rabbits. I never wanted to have pets, but this year I thought it was a good distraction and I knew my kids would enjoy it.

Setup Static Code Analysis for Python

Static code analysis is the technique of approximating the runtime behavior of a program. In other words, it is the process of predicting the output of a program without actually executing it. That’s what DeepSource does, statically analyzing your project and reporting to you the potential code quality issues which can be solved within no time.

This is what we will be doing here in this blog. We will try to integrate DeepSource over a forked repo, specifically on a Python project, and run analysis over it. We will further fix some of the issues with the auto-fix tool and let transformers fix some of the styling issues for our project.

Pascal – delete spaces from input text

So I just started learning Pascal and have problems understanding how deleting specific characters works

program Project1;
var
  a:string;
  b:char;
  c:integer;


begin
  readln(a);
  b:=(chr(32));

  for c:=1 to length(a) do
  begin
    if a[c]=b then delete;
  end;
   readln;
end.                          

The idea is that I input random text and get back the same text but without all spaces. Sounds simple but I just started learning pascal, so not really. Help would be appreciated :)
Probably more than one thing is wrong with this sh*t code.

Get Access Token From Keycloak Using Postman

This post will help you to automate getting an access token from Keycloak and added into request param before each API request hits the server. Keycloak is an open-source software product to allow single sign-on with Identity and Access Management aimed at modern applications and services. Read here to know more about Keycloak.

To Get Access Token Using Postman (For Testing)

Create New Collection in Postman

  • Click the new collection button in postman
  • Select the variable tab and add the below variables
    • client_id: <Copy the client id from your realm setting in KC>
    • client_secret: <Make sure you copy the right secrets for the client>
    • scope: type ‘openid’
    • token_endpoint: <http://KEYCLOAK-SERVER_URL/auth/realms/REPLACE_WITH_YOUR_REALM_NAME/protocol/openid-connect/token>
    • access_token: <Leave it blank, this will be populated by pre-request script>article image
  • Go to the authorization tab
    • Select Type = Bearer Token
    • Token = {{access_token}}
  • Now go to the pre-request scripts tab and paste the following code 
JavaScript
 




xxxxxxxxxx
1
33


1
var client_id      = pm.collectionVariables.get("client_id");
2
var client_secret = pm.collectionVariables.get("client_secret");
3
var token_endpoint = pm.collectionVariables.get("token_endpoint");
4
var scope          = pm.collectionVariables.get("scope");
5

          
6
var details = {
7
   "grant_type" : "client_credentials",
8
   "scope" : scope
9
}
10

          
11
var formBody = [];
12
for (var property in details) {
13
 var encodedKey = encodeURIComponent(property);
14
 var encodedValue = encodeURIComponent(details[property]);
15
 formBody.push(encodedKey + "=" + encodedValue);
16
}
17
formBody = formBody.join("&");
18

          
19
pm.sendRequest({
20
   url: token_endpoint,
21
   method: 'POST',
22
   header: {
23
       'Content-Type': 'application/x-www-form-urlencoded',
24
       'Authorization' :'Basic ' + btoa(client_id+":"+client_secret)
25
         },
26
     body: formBody
27
},  function(err, response) {
28
 const jsonResponse = response.json();
29
 console.log(jsonResponse);
30
 pm.collectionVariables.set("access_token", jsonResponse.access_token);
31
 console.log(pm.collectionVariables.get("access_token"));
32

          
33
}); 



Hi everyone, I’m Alan21.

Hi, not sure if Im in the right place, but is it possible to have google searchs I never made show up in my history, could i have been hacked, malware or have parts of someone elses search history. There is some explicit things that I definitely didnt search. These searchs were in a data request from google, just a small amount were not me. How is this possible? Any help would be great thanks