Are you over 18 and want to see adult content?
More Annotations
A complete backup of https://ilearning.me
Are you over 18 and want to see adult content?
A complete backup of https://psmlighting.be
Are you over 18 and want to see adult content?
A complete backup of https://accelq.com
Are you over 18 and want to see adult content?
A complete backup of https://appletonmuseum.org
Are you over 18 and want to see adult content?
A complete backup of https://pgathrills.com
Are you over 18 and want to see adult content?
A complete backup of https://salagala.pl
Are you over 18 and want to see adult content?
A complete backup of https://dottorgadget.it
Are you over 18 and want to see adult content?
A complete backup of https://americanmeat.jp
Are you over 18 and want to see adult content?
A complete backup of https://vvvschiermonnikoog.nl
Are you over 18 and want to see adult content?
A complete backup of https://lightfurnitures.com
Are you over 18 and want to see adult content?
A complete backup of https://udf.edu.br
Are you over 18 and want to see adult content?
A complete backup of https://narew.info
Are you over 18 and want to see adult content?
Favourite Annotations
MPZ Stade – Unterstützung und Beratung von Bildungseinrichtungen für Unterricht mit digitalen Medien
Are you over 18 and want to see adult content?
SarkariUpdate.com : Sarkari Results, Update, Latest Online Form | Results 2019-20
Are you over 18 and want to see adult content?
Global eCommerce and Mail Solutions | Globegistics Inc.
Are you over 18 and want to see adult content?
Deutsche Bahn: bahn.de - Ihr Mobilitätsportal für Reisen, Bahn, Urlaub, Hotels, Städtereisen und Mietwagen
Are you over 18 and want to see adult content?
RCRWireless News: Mobile industry news insights
Are you over 18 and want to see adult content?
Персональный сайт - Главная страница
Are you over 18 and want to see adult content?
Text
the
HOW TO GET PRIVATE, CONSTANT OR STATIC VALUE OF A FIELD How to get private, constant or static value of a field with reflection. To get the value of a private field of an instance in C#: Similarly, you can quite easily retrieve the value of a const or static field for a type, simply replace BindingFlags.Instance with BindingFlags.Static and call GetValue with null: CONVERTING HEX STRING TO INT IN C# May 8, 2015. For a hex literal that’s not prefixed you can quite easily convert it using int.Parse in C#: 1. 2. 3. string hex = "142CBD"; int intValue = int.Parse (hex, System.Globalization.NumberStyles.HexNumber); But as you’ve probably noticed, most hex literals are prefixed with 0x (e.g. “0x142CBD”)which would throw a
BINARY AND JSON BENCHMARKS UPDATED It’s been a while since I last updated my binary and JSON serializer benchmarks, so here I round up the latest versions of the serializers on here.. DISCLAIMER : as always, you should benchmark against your payload and use case, the benchmark numbers I have produced here is unlikely to be representative of your use cases and neither is anybody else’s benchmark numbers. LINQ - LAMBDA EXPRESSION VS QUERY - THEBURNINGMONK.COM Production-Ready Serverless workshop is coming back in August. You can SAVE 30% if you enrol before the end of June.. Skill up your serverless game and get answers to all your questions about AWS andserverless.
AWS X-RAY AND LAMBDA : THE GOOD, THE BAD AND THE UGLY Update 03/07/2017 : whilst there was a bug in the X-Ray SDK wrt tracking the trace-id, adding annotations and metadata to the root segment is simply not supported, which the doc doesn’t explicitly state. You can work around this by creating a subsegment that covers the entire span of your function invocation to act as your custom root segment and attach any annotation and metadata BUILDING A CUSTOM IAM SYSTEM HAS MADE ME APPRECIATE AWS In the last post I discussed my preferred approach for modelling multi-tenant applications with AppSync and Cognito. This approach supports the common requirements in these applications, where there are a number of distinct roles within each tenant. This approach (and others like it) works great when the tenants are isolated. HOW TO MANAGE ROUTE53 HOSTED ZONES IN A MULTI-ACCOUNT Here’s how. Step 1. host the root domain in the master account. Step 2. host a subdomain in each environment-specific accounts for dev, test, staging, prod, etc. Step 3. for each of the subdomains in the corresponding AWS account, note the NS record that Route53 has created automatically. Step 4. back in the Master account, create a NS record HOW I BUILT A SOCIAL NETWORK IN 4 WEEKS WITH GRAPHQL AND How I built a social network in 4 weeks with GraphQL and serverless. AppSync, AWS, GraphQL, Programming, Serverless / November 17, 2020. November 17, 2020. I have been involved with a client project to help the client launch a new social network for university students to engage with each other to do sports. Amongst other things, users can: HIT THE 6MB LAMBDA PAYLOAD LIMIT? HERE'S WHAT YOU CAN DO Option 1: use API Gateway service proxy. You can remove Lambda from the equation and go straight from API Gateway to S3 using API Gateway service proxies. To learn more about API Gateway service proxies and why you should use them, please read my previous post on the topic. This approach doesn’t require any client changes. STEP FUNCTIONS : APPLY TRY-CATCH TO A BLOCK OF STATES With Step Functions, you can use Retry and Catch clauses to handle errors from Task states. There are a number of predefined system errors, and you can also handle custom errors that are thrown by your Lambda functions. You can do this by adding the same Catch clause to each of the Task states. However, this approach requires you to addthe
HOW TO GET PRIVATE, CONSTANT OR STATIC VALUE OF A FIELD How to get private, constant or static value of a field with reflection. To get the value of a private field of an instance in C#: Similarly, you can quite easily retrieve the value of a const or static field for a type, simply replace BindingFlags.Instance with BindingFlags.Static and call GetValue with null: CONVERTING HEX STRING TO INT IN C# May 8, 2015. For a hex literal that’s not prefixed you can quite easily convert it using int.Parse in C#: 1. 2. 3. string hex = "142CBD"; int intValue = int.Parse (hex, System.Globalization.NumberStyles.HexNumber); But as you’ve probably noticed, most hex literals are prefixed with 0x (e.g. “0x142CBD”)which would throw a
BINARY AND JSON BENCHMARKS UPDATED It’s been a while since I last updated my binary and JSON serializer benchmarks, so here I round up the latest versions of the serializers on here.. DISCLAIMER : as always, you should benchmark against your payload and use case, the benchmark numbers I have produced here is unlikely to be representative of your use cases and neither is anybody else’s benchmark numbers. LINQ - LAMBDA EXPRESSION VS QUERY - THEBURNINGMONK.COM Production-Ready Serverless workshop is coming back in August. You can SAVE 30% if you enrol before the end of June.. Skill up your serverless game and get answers to all your questions about AWS andserverless.
AWS X-RAY AND LAMBDA : THE GOOD, THE BAD AND THE UGLY Update 03/07/2017 : whilst there was a bug in the X-Ray SDK wrt tracking the trace-id, adding annotations and metadata to the root segment is simply not supported, which the doc doesn’t explicitly state. You can work around this by creating a subsegment that covers the entire span of your function invocation to act as your custom root segment and attach any annotation and metadata HOW TO HANDLE CLIENT ERRORS GRACEFULLY WITH APPSYNC AND With API Gateway and Lambda, you can handle client errors gracefully by returning a 4xx response. module.exports.handler = async (event) => { // run validation logic return { statusCode: 400 } } ARE LAMBDA-TO-LAMBDA CALLS REALLY SO BAD? This impacts the end-to-end latency. The 2nd Lambda invocation carries an extra cost for the invocation request. Since Lambda durations are paid in 100ms blocks, so you will pay for the amount of “roll-up” time for both caller and callee functions. You will pay for the idle wait time while the caller function waits for a response from the CHOREOGRAPHY VS ORCHESTRATION IN THE LAND OF SERVERLESS Choreography vs Orchestration in the land of serverless. Choreography and Orchestration are two modes of interaction in a microservices architecture. In orchestration, there is a controller (the ‘orchestrator’) that controls the interaction between services. It dictates the control flow of the business logic and is responsible formaking
HOW TO BREAK THE "SENIOR ENGINEER" CAREER CEILING This is the single most important difference between a senior engineer and principal engineer. As a senior engineer, you are an important individual contributor (IC). You are an important cog in the wheel that keeps the company running. Your success is judged on your personal output and your impact on the overall business. STATIC VS. NON-STATIC METHOD IN C# In C# terms, “static” means “relating to the type itself, rather than an instance of the type”. You access a static member using the type name instead of a reference or a value, e.g. Guid.NewGuid (). In addition to methods and variables, you can also declare a class to be static (since C# 2.0). A static class cannot be instantiated and THREADING - USING THE THREADPOOL VS. CREATING YOUR OWN When to create your own threads. As I’ve mentioned already, creating your own threads is bad when lots of simple tasks require a relative large overhead in context switching, and the Thread Pool is bad for long running, or blocking tasks. Which leads to the natural conclusion :-P – create your own threads for long running, or blocking tasks!RX FRAMEWORK
1. var zs = xs.Repeat (3); or as a static method: 1. var zs = Observable.Repeat (xs, 3); There are a few things you should keep in mind when you’re using the Repeat method though. 1. If you call Repeat method with no argument, it’ll repeatedly subscribe to the same observable collection indefinitely. 2.PERFORMANCE TEST
Note: don’t forget to check out the Benchmarks page to see the latest round up of binary and JSON serializers. When working with the BinaryFormatter class frequently, one of the things you notice is that it is really damn inefficient both in terms of speed as well as the payload (the size of the serialized byte array).. Google’s Protocol Buffers format is designed to be super fast and FINDING COLDSTARTS : HOW LONG DOES AWS LAMBDA KEEP YOUR Hypotheses. Hypothesis 1 : there is an upper bound to how long Lambda allows your function to stay idle before reclaiming the associated resources This should be a given. Idle functions occupy resources that can be used to help other AWS customers scale up to meet their needs (and not to mention the first customer is not paying for his idle functions!), it simply wouldn’t make any sense for THE COST OF THROWING EXCEPTIONS Another thing to consider is the impact the stack trace depth has on the cost of throwing exceptions, to simulate that I put together a second test which executes a method recursively until it reaches the desired level of recursion then throws an exception. Each test performs this recursion 1000 times, and repeated over 100 times to geta more
THEBURNINGMONK.COM
With API Gateway and Lambda, you can handle client errors gracefully by returning a 4xx response. module.exports.handler = async (event) => { // run validation logic return { statusCode: 400 } } This way, we can communicate clearly to the client that there’s a problem withits request.
BUILDING A CUSTOM IAM SYSTEM HAS MADE ME APPRECIATE AWS In the last post I discussed my preferred approach for modelling multi-tenant applications with AppSync and Cognito. This approach supports the common requirements in these applications, where there are a number of distinct roles within each tenant. This approach (and others like it) works great when the tenants are isolated. HOW TO MANAGE ROUTE53 HOSTED ZONES IN A MULTI-ACCOUNT Here’s how. Step 1. host the root domain in the master account. Step 2. host a subdomain in each environment-specific accounts for dev, test, staging, prod, etc. Step 3. for each of the subdomains in the corresponding AWS account, note the NS record that Route53 has created automatically. Step 4. back in the Master account, create a NS record THE CASE FOR AND AGAINST AMAZON COGNITO The case for and against Amazon Cognito. AWS, Programming / March 8, 2021. March 8, 2021. In light of recent news of Okta’s pending acquisition of Auth0 there’s been renewed discussion about where Amazon Cognito fits into the picture. It’s a question my HOW I BUILT A SOCIAL NETWORK IN 4 WEEKS WITH GRAPHQL AND How I built a social network in 4 weeks with GraphQL and serverless. AppSync, AWS, GraphQL, Programming, Serverless / November 17, 2020. November 17, 2020. I have been involved with a client project to help the client launch a new social network for university students to engage with each other to do sports. Amongst other things, users can: STATIC VS. NON-STATIC METHOD IN C# CONVERTING HEX STRING TO INT IN C# May 8, 2015. For a hex literal that’s not prefixed you can quite easily convert it using int.Parse in C#: 1. 2. 3. string hex = "142CBD"; int intValue = int.Parse (hex, System.Globalization.NumberStyles.HexNumber); But as you’ve probably noticed, most hex literals are prefixed with 0x (e.g. “0x142CBD”)which would throw a
PERFORMANCE TEST
As you can see, Regex.IsMatch is by far the slowest option in this test, although using RegexOptions.Compiled yielded slightly faster execution time. What was also interesting is that String.Contains turned out to be significantly faster than String.IndexOf. If you take a look at the implementation for String.Contains in a reflector youwill see:
LINQ - LAMBDA EXPRESSION VS QUERY - THEBURNINGMONK.COM Production-Ready Serverless workshop is coming back in August. You can SAVE 30% if you enrol before the end of June.. Skill up your serverless game and get answers to all your questions about AWS andserverless.
.NET TIPS - USING INTERNALSVISIBLETO ATTRIBUTE TO HELP Oh, the Pain! For a long time, unit testing non-public methods in C# has been a pain in the back side. In order to test a non-public method (most likely private methods) you have a number of choices each with an undesired effect:THEBURNINGMONK.COM
With API Gateway and Lambda, you can handle client errors gracefully by returning a 4xx response. module.exports.handler = async (event) => { // run validation logic return { statusCode: 400 } } This way, we can communicate clearly to the client that there’s a problem withits request.
BUILDING A CUSTOM IAM SYSTEM HAS MADE ME APPRECIATE AWS In the last post I discussed my preferred approach for modelling multi-tenant applications with AppSync and Cognito. This approach supports the common requirements in these applications, where there are a number of distinct roles within each tenant. This approach (and others like it) works great when the tenants are isolated. HOW TO MANAGE ROUTE53 HOSTED ZONES IN A MULTI-ACCOUNT Here’s how. Step 1. host the root domain in the master account. Step 2. host a subdomain in each environment-specific accounts for dev, test, staging, prod, etc. Step 3. for each of the subdomains in the corresponding AWS account, note the NS record that Route53 has created automatically. Step 4. back in the Master account, create a NS record THE CASE FOR AND AGAINST AMAZON COGNITO The case for and against Amazon Cognito. AWS, Programming / March 8, 2021. March 8, 2021. In light of recent news of Okta’s pending acquisition of Auth0 there’s been renewed discussion about where Amazon Cognito fits into the picture. It’s a question my HOW I BUILT A SOCIAL NETWORK IN 4 WEEKS WITH GRAPHQL AND How I built a social network in 4 weeks with GraphQL and serverless. AppSync, AWS, GraphQL, Programming, Serverless / November 17, 2020. November 17, 2020. I have been involved with a client project to help the client launch a new social network for university students to engage with each other to do sports. Amongst other things, users can: STATIC VS. NON-STATIC METHOD IN C# CONVERTING HEX STRING TO INT IN C# May 8, 2015. For a hex literal that’s not prefixed you can quite easily convert it using int.Parse in C#: 1. 2. 3. string hex = "142CBD"; int intValue = int.Parse (hex, System.Globalization.NumberStyles.HexNumber); But as you’ve probably noticed, most hex literals are prefixed with 0x (e.g. “0x142CBD”)which would throw a
PERFORMANCE TEST
As you can see, Regex.IsMatch is by far the slowest option in this test, although using RegexOptions.Compiled yielded slightly faster execution time. What was also interesting is that String.Contains turned out to be significantly faster than String.IndexOf. If you take a look at the implementation for String.Contains in a reflector youwill see:
LINQ - LAMBDA EXPRESSION VS QUERY - THEBURNINGMONK.COM Production-Ready Serverless workshop is coming back in August. You can SAVE 30% if you enrol before the end of June.. Skill up your serverless game and get answers to all your questions about AWS andserverless.
.NET TIPS - USING INTERNALSVISIBLETO ATTRIBUTE TO HELP Oh, the Pain! For a long time, unit testing non-public methods in C# has been a pain in the back side. In order to test a non-public method (most likely private methods) you have a number of choices each with an undesired effect:THEBURNINGMONK.COM
With API Gateway and Lambda, you can handle client errors gracefully by returning a 4xx response. module.exports.handler = async (event) => { // run validation logic return { statusCode: 400 } } This way, we can communicate clearly to the client that there’s a problem withits request.
HOW TO HANDLE CLIENT ERRORS GRACEFULLY WITH APPSYNC AND With API Gateway and Lambda, you can handle client errors gracefully by returning a 4xx response. module.exports.handler = async (event) => { // run validation logic return { statusCode: 400 } } HIT THE 6MB LAMBDA PAYLOAD LIMIT? HERE'S WHAT YOU CAN DO Option 1: use API Gateway service proxy. You can remove Lambda from the equation and go straight from API Gateway to S3 using API Gateway service proxies. To learn more about API Gateway service proxies and why you should use them, please read my previous post on the topic. This approach doesn’t require any client changes. HOW TO GET PRIVATE, CONSTANT OR STATIC VALUE OF A FIELD How to get private, constant or static value of a field with reflection. To get the value of a private field of an instance in C#: Similarly, you can quite easily retrieve the value of a const or static field for a type, simply replace BindingFlags.Instance with BindingFlags.Static and call GetValue with null: A SIMPLE EVENT-SOURCING EXAMPLE WITH SNAPSHOTS USING A simple event-sourcing example with snapshots using Lambda and DynamoDB. Recently, I have been helping a client implement an event-sourced system. In the process, I put together a very simple demo app to illustrate how one could build such a system using Lambda and DynamoDB. The source code is available on GitHub here. .NET TIPS - USING AS VS CASTING IN C# Prefer as to casting. In Bill Wagner’s Effective C# book, he recommends that you should use the as keyword whenever possible, because:. it’s more efficient at runtime, the as keyword (like the is keyword) does not perform any user-defined conversion. It will only succeed if the object is of the sought type (or derived from it) and never create a new object to satisfy a request. CLOUDFORMATION REF AND GETATT CHEATSHEET The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.PERFORMANCE TEST
Results. Unsurprisingly, the protobuf-net serializer wins hands-down in all three categories, as you can see from the table below it is a staggering 12x faster than BinaryFormatter when it comes to serialization, with a payload size less than 15th of its counterpart’s. One curious observation about the payload size isthat, when I used a
UNDERSTANDING ARITHMETIC OVERFLOW CHECKING IN C# Default context = unchecked. By default, arithmetic operations and conversions in C# are executed in an unchecked context. This means that for a signed integer it overflows from int.MaxValue to int.MinValue and underflows from int.MinValue to int.MaxValue, hence both statements below evaluates to true: Similarly, for an unsignedinteger it will
WCF - BE WARE OF THE FIELD ORDERING WHEN USING April 20, 2015. One of the less known aspect of the DataContractSerializer is its dependency on the order in which fields are serialized and deserialized. As this article points out, the basic rules for ordering include: If a data contract type is a part of an inheritance hierarchy, data members of its base types are always firstin the order.
THEBURNINGMONK.COM
With API Gateway and Lambda, you can handle client errors gracefully by returning a 4xx response. module.exports.handler = async (event) => { // run validation logic return { statusCode: 400 } } This way, we can communicate clearly to the client that there’s a problem withits request.
BUILDING A CUSTOM IAM SYSTEM HAS MADE ME APPRECIATE AWS In the last post I discussed my preferred approach for modelling multi-tenant applications with AppSync and Cognito. This approach supports the common requirements in these applications, where there are a number of distinct roles within each tenant. This approach (and others like it) works great when the tenants are isolated. HOW TO MANAGE ROUTE53 HOSTED ZONES IN A MULTI-ACCOUNT Here’s how. Step 1. host the root domain in the master account. Step 2. host a subdomain in each environment-specific accounts for dev, test, staging, prod, etc. Step 3. for each of the subdomains in the corresponding AWS account, note the NS record that Route53 has created automatically. Step 4. back in the Master account, create a NS record THE CASE FOR AND AGAINST AMAZON COGNITO The case for and against Amazon Cognito. AWS, Programming / March 8, 2021. March 8, 2021. In light of recent news of Okta’s pending acquisition of Auth0 there’s been renewed discussion about where Amazon Cognito fits into the picture. It’s a question my HOW I BUILT A SOCIAL NETWORK IN 4 WEEKS WITH GRAPHQL AND How I built a social network in 4 weeks with GraphQL and serverless. AppSync, AWS, GraphQL, Programming, Serverless / November 17, 2020. November 17, 2020. I have been involved with a client project to help the client launch a new social network for university students to engage with each other to do sports. Amongst other things, users can: STATIC VS. NON-STATIC METHOD IN C# CONVERTING HEX STRING TO INT IN C# May 8, 2015. For a hex literal that’s not prefixed you can quite easily convert it using int.Parse in C#: 1. 2. 3. string hex = "142CBD"; int intValue = int.Parse (hex, System.Globalization.NumberStyles.HexNumber); But as you’ve probably noticed, most hex literals are prefixed with 0x (e.g. “0x142CBD”)which would throw a
PERFORMANCE TEST
As you can see, Regex.IsMatch is by far the slowest option in this test, although using RegexOptions.Compiled yielded slightly faster execution time. What was also interesting is that String.Contains turned out to be significantly faster than String.IndexOf. If you take a look at the implementation for String.Contains in a reflector youwill see:
LINQ - LAMBDA EXPRESSION VS QUERY - THEBURNINGMONK.COM Production-Ready Serverless workshop is coming back in August. You can SAVE 30% if you enrol before the end of June.. Skill up your serverless game and get answers to all your questions about AWS andserverless.
.NET TIPS - USING INTERNALSVISIBLETO ATTRIBUTE TO HELP Oh, the Pain! For a long time, unit testing non-public methods in C# has been a pain in the back side. In order to test a non-public method (most likely private methods) you have a number of choices each with an undesired effect:THEBURNINGMONK.COM
With API Gateway and Lambda, you can handle client errors gracefully by returning a 4xx response. module.exports.handler = async (event) => { // run validation logic return { statusCode: 400 } } This way, we can communicate clearly to the client that there’s a problem withits request.
BUILDING A CUSTOM IAM SYSTEM HAS MADE ME APPRECIATE AWS In the last post I discussed my preferred approach for modelling multi-tenant applications with AppSync and Cognito. This approach supports the common requirements in these applications, where there are a number of distinct roles within each tenant. This approach (and others like it) works great when the tenants are isolated. HOW TO MANAGE ROUTE53 HOSTED ZONES IN A MULTI-ACCOUNT Here’s how. Step 1. host the root domain in the master account. Step 2. host a subdomain in each environment-specific accounts for dev, test, staging, prod, etc. Step 3. for each of the subdomains in the corresponding AWS account, note the NS record that Route53 has created automatically. Step 4. back in the Master account, create a NS record THE CASE FOR AND AGAINST AMAZON COGNITO The case for and against Amazon Cognito. AWS, Programming / March 8, 2021. March 8, 2021. In light of recent news of Okta’s pending acquisition of Auth0 there’s been renewed discussion about where Amazon Cognito fits into the picture. It’s a question my HOW I BUILT A SOCIAL NETWORK IN 4 WEEKS WITH GRAPHQL AND How I built a social network in 4 weeks with GraphQL and serverless. AppSync, AWS, GraphQL, Programming, Serverless / November 17, 2020. November 17, 2020. I have been involved with a client project to help the client launch a new social network for university students to engage with each other to do sports. Amongst other things, users can: STATIC VS. NON-STATIC METHOD IN C# CONVERTING HEX STRING TO INT IN C# May 8, 2015. For a hex literal that’s not prefixed you can quite easily convert it using int.Parse in C#: 1. 2. 3. string hex = "142CBD"; int intValue = int.Parse (hex, System.Globalization.NumberStyles.HexNumber); But as you’ve probably noticed, most hex literals are prefixed with 0x (e.g. “0x142CBD”)which would throw a
PERFORMANCE TEST
As you can see, Regex.IsMatch is by far the slowest option in this test, although using RegexOptions.Compiled yielded slightly faster execution time. What was also interesting is that String.Contains turned out to be significantly faster than String.IndexOf. If you take a look at the implementation for String.Contains in a reflector youwill see:
LINQ - LAMBDA EXPRESSION VS QUERY - THEBURNINGMONK.COM Production-Ready Serverless workshop is coming back in August. You can SAVE 30% if you enrol before the end of June.. Skill up your serverless game and get answers to all your questions about AWS andserverless.
.NET TIPS - USING INTERNALSVISIBLETO ATTRIBUTE TO HELP Oh, the Pain! For a long time, unit testing non-public methods in C# has been a pain in the back side. In order to test a non-public method (most likely private methods) you have a number of choices each with an undesired effect:THEBURNINGMONK.COM
With API Gateway and Lambda, you can handle client errors gracefully by returning a 4xx response. module.exports.handler = async (event) => { // run validation logic return { statusCode: 400 } } This way, we can communicate clearly to the client that there’s a problem withits request.
HOW TO HANDLE CLIENT ERRORS GRACEFULLY WITH APPSYNC AND With API Gateway and Lambda, you can handle client errors gracefully by returning a 4xx response. module.exports.handler = async (event) => { // run validation logic return { statusCode: 400 } } HIT THE 6MB LAMBDA PAYLOAD LIMIT? HERE'S WHAT YOU CAN DO Option 1: use API Gateway service proxy. You can remove Lambda from the equation and go straight from API Gateway to S3 using API Gateway service proxies. To learn more about API Gateway service proxies and why you should use them, please read my previous post on the topic. This approach doesn’t require any client changes. HOW TO GET PRIVATE, CONSTANT OR STATIC VALUE OF A FIELD How to get private, constant or static value of a field with reflection. To get the value of a private field of an instance in C#: Similarly, you can quite easily retrieve the value of a const or static field for a type, simply replace BindingFlags.Instance with BindingFlags.Static and call GetValue with null: A SIMPLE EVENT-SOURCING EXAMPLE WITH SNAPSHOTS USING A simple event-sourcing example with snapshots using Lambda and DynamoDB. Recently, I have been helping a client implement an event-sourced system. In the process, I put together a very simple demo app to illustrate how one could build such a system using Lambda and DynamoDB. The source code is available on GitHub here. .NET TIPS - USING AS VS CASTING IN C# Prefer as to casting. In Bill Wagner’s Effective C# book, he recommends that you should use the as keyword whenever possible, because:. it’s more efficient at runtime, the as keyword (like the is keyword) does not perform any user-defined conversion. It will only succeed if the object is of the sought type (or derived from it) and never create a new object to satisfy a request. CLOUDFORMATION REF AND GETATT CHEATSHEET The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.PERFORMANCE TEST
Results. Unsurprisingly, the protobuf-net serializer wins hands-down in all three categories, as you can see from the table below it is a staggering 12x faster than BinaryFormatter when it comes to serialization, with a payload size less than 15th of its counterpart’s. One curious observation about the payload size isthat, when I used a
UNDERSTANDING ARITHMETIC OVERFLOW CHECKING IN C# Default context = unchecked. By default, arithmetic operations and conversions in C# are executed in an unchecked context. This means that for a signed integer it overflows from int.MaxValue to int.MinValue and underflows from int.MinValue to int.MaxValue, hence both statements below evaluates to true: Similarly, for an unsignedinteger it will
WCF - BE WARE OF THE FIELD ORDERING WHEN USING April 20, 2015. One of the less known aspect of the DataContractSerializer is its dependency on the order in which fields are serialized and deserialized. As this article points out, the basic rules for ordering include: If a data contract type is a part of an inheritance hierarchy, data members of its base types are always firstin the order.
THEBURNINGMONK.COM
When you start a new Vue.js project that needs to interface with APIs running in AWS, there’s a good chance you will have these lines of code: import Amplify from ‘aws-amplify’ Amplify.configure({ Auth: { region: ‘us-east-1’, userPoolId: ‘xxx’, userPoolWebClientId: ‘xxx’, mandatorySignIn: true } }) These few lines of code let you use the aws-amplify library HOW TO MANAGE ROUTE53 HOSTED ZONES IN A MULTI-ACCOUNT Here’s how. Step 1. host the root domain in the master account. Step 2. host a subdomain in each environment-specific accounts for dev, test, staging, prod, etc. Step 3. for each of the subdomains in the corresponding AWS account, note the NS record that Route53 has created automatically. Step 4. back in the Master account, create a NS record BUILDING A CUSTOM IAM SYSTEM HAS MADE ME APPRECIATE AWS In the last post I discussed my preferred approach for modelling multi-tenant applications with AppSync and Cognito. This approach supports the common requirements in these applications, where there are a number of distinct roles within each tenant. This approach (and others like it) works great when the tenants are isolated. HOW I BUILT A SOCIAL NETWORK IN 4 WEEKS WITH GRAPHQL AND How I built a social network in 4 weeks with GraphQL and serverless. AppSync, AWS, GraphQL, Programming, Serverless / November 17, 2020. November 17, 2020. I have been involved with a client project to help the client launch a new social network for university students to engage with each other to do sports. Amongst other things, users can: THE CASE FOR AND AGAINST AMAZON COGNITO The case for and against Amazon Cognito. AWS, Programming / March 8, 2021. March 8, 2021. In light of recent news of Okta’s pending acquisition of Auth0 there’s been renewed discussion about where Amazon Cognito fits into the picture. It’s a question my CONVERTING HEX STRING TO INT IN C# May 8, 2015. For a hex literal that’s not prefixed you can quite easily convert it using int.Parse in C#: 1. 2. 3. string hex = "142CBD"; int intValue = int.Parse (hex, System.Globalization.NumberStyles.HexNumber); But as you’ve probably noticed, most hex literals are prefixed with 0x (e.g. “0x142CBD”)which would throw a
LINQ - LAMBDA EXPRESSION VS QUERY - THEBURNINGMONK.COM Production-Ready Serverless workshop is coming back in August. You can SAVE 30% if you enrol before the end of June.. Skill up your serverless game and get answers to all your questions about AWS andserverless.
.NET TIPS - USING AS VS CASTING IN C# Prefer as to casting. In Bill Wagner’s Effective C# book, he recommends that you should use the as keyword whenever possible, because:. it’s more efficient at runtime, the as keyword (like the is keyword) does not perform any user-defined conversion. It will only succeed if the object is of the sought type (or derived from it) and never create a new object to satisfy a request. STATIC VS. NON-STATIC METHOD IN C# .NET TIPS - USING INTERNALSVISIBLETO ATTRIBUTE TO HELP Oh, the Pain! For a long time, unit testing non-public methods in C# has been a pain in the back side. In order to test a non-public method (most likely private methods) you have a number of choices each with an undesired effect:THEBURNINGMONK.COM
When you start a new Vue.js project that needs to interface with APIs running in AWS, there’s a good chance you will have these lines of code: import Amplify from ‘aws-amplify’ Amplify.configure({ Auth: { region: ‘us-east-1’, userPoolId: ‘xxx’, userPoolWebClientId: ‘xxx’, mandatorySignIn: true } }) These few lines of code let you use the aws-amplify library HOW TO MANAGE ROUTE53 HOSTED ZONES IN A MULTI-ACCOUNT Here’s how. Step 1. host the root domain in the master account. Step 2. host a subdomain in each environment-specific accounts for dev, test, staging, prod, etc. Step 3. for each of the subdomains in the corresponding AWS account, note the NS record that Route53 has created automatically. Step 4. back in the Master account, create a NS record BUILDING A CUSTOM IAM SYSTEM HAS MADE ME APPRECIATE AWS In the last post I discussed my preferred approach for modelling multi-tenant applications with AppSync and Cognito. This approach supports the common requirements in these applications, where there are a number of distinct roles within each tenant. This approach (and others like it) works great when the tenants are isolated. HOW I BUILT A SOCIAL NETWORK IN 4 WEEKS WITH GRAPHQL AND How I built a social network in 4 weeks with GraphQL and serverless. AppSync, AWS, GraphQL, Programming, Serverless / November 17, 2020. November 17, 2020. I have been involved with a client project to help the client launch a new social network for university students to engage with each other to do sports. Amongst other things, users can: THE CASE FOR AND AGAINST AMAZON COGNITO The case for and against Amazon Cognito. AWS, Programming / March 8, 2021. March 8, 2021. In light of recent news of Okta’s pending acquisition of Auth0 there’s been renewed discussion about where Amazon Cognito fits into the picture. It’s a question my CONVERTING HEX STRING TO INT IN C# May 8, 2015. For a hex literal that’s not prefixed you can quite easily convert it using int.Parse in C#: 1. 2. 3. string hex = "142CBD"; int intValue = int.Parse (hex, System.Globalization.NumberStyles.HexNumber); But as you’ve probably noticed, most hex literals are prefixed with 0x (e.g. “0x142CBD”)which would throw a
LINQ - LAMBDA EXPRESSION VS QUERY - THEBURNINGMONK.COM Production-Ready Serverless workshop is coming back in August. You can SAVE 30% if you enrol before the end of June.. Skill up your serverless game and get answers to all your questions about AWS andserverless.
.NET TIPS - USING AS VS CASTING IN C# Prefer as to casting. In Bill Wagner’s Effective C# book, he recommends that you should use the as keyword whenever possible, because:. it’s more efficient at runtime, the as keyword (like the is keyword) does not perform any user-defined conversion. It will only succeed if the object is of the sought type (or derived from it) and never create a new object to satisfy a request. STATIC VS. NON-STATIC METHOD IN C# .NET TIPS - USING INTERNALSVISIBLETO ATTRIBUTE TO HELP Oh, the Pain! For a long time, unit testing non-public methods in C# has been a pain in the back side. In order to test a non-public method (most likely private methods) you have a number of choices each with an undesired effect: HOW TO HANDLE CLIENT ERRORS GRACEFULLY WITH APPSYNC AND With API Gateway and Lambda, you can handle client errors gracefully by returning a 4xx response. module.exports.handler = async (event) => { // run validation logic return { statusCode: 400 } } HIT THE 6MB LAMBDA PAYLOAD LIMIT? HERE'S WHAT YOU CAN DO Option 1: use API Gateway service proxy. You can remove Lambda from the equation and go straight from API Gateway to S3 using API Gateway service proxies. To learn more about API Gateway service proxies and why you should use them, please read my previous post on the topic. This approach doesn’t require any client changes. STEP FUNCTIONS : APPLY TRY-CATCH TO A BLOCK OF STATES With Step Functions, you can use Retry and Catch clauses to handle errors from Task states. There are a number of predefined system errors, and you can also handle custom errors that are thrown by your Lambda functions. You can do this by adding the same Catch clause to each of the Task states. However, this approach requires you to addthe
HOW TO GET PRIVATE, CONSTANT OR STATIC VALUE OF A FIELD How to get private, constant or static value of a field with reflection. To get the value of a private field of an instance in C#: Similarly, you can quite easily retrieve the value of a const or static field for a type, simply replace BindingFlags.Instance with BindingFlags.Static and call GetValue with null: AWS X-RAY AND LAMBDA : THE GOOD, THE BAD AND THE UGLY Update 03/07/2017 : whilst there was a bug in the X-Ray SDK wrt tracking the trace-id, adding annotations and metadata to the root segment is simply not supported, which the doc doesn’t explicitly state. You can work around this by creating a subsegment that covers the entire span of your function invocation to act as your custom root segment and attach any annotation and metadata UNDERSTANDING ARITHMETIC OVERFLOW CHECKING IN C# Default context = unchecked. By default, arithmetic operations and conversions in C# are executed in an unchecked context. This means that for a signed integer it overflows from int.MaxValue to int.MinValue and underflows from int.MinValue to int.MaxValue, hence both statements below evaluates to true: Similarly, for an unsignedinteger it will
THREADING - USING THE THREADPOOL VS. CREATING YOUR OWN When to create your own threads. As I’ve mentioned already, creating your own threads is bad when lots of simple tasks require a relative large overhead in context switching, and the Thread Pool is bad for long running, or blocking tasks. Which leads to the natural conclusion :-P – create your own threads for long running, or blocking tasks! CLOUDFORMATION REF AND GETATT CHEATSHEET The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this. WCF - BE WARE OF THE FIELD ORDERING WHEN USING April 20, 2015. One of the less known aspect of the DataContractSerializer is its dependency on the order in which fields are serialized and deserialized. As this article points out, the basic rules for ordering include: If a data contract type is a part of an inheritance hierarchy, data members of its base types are always firstin the order.
.NET TIPS - USING INTERNALSVISIBLETO ATTRIBUTE TO HELP Oh, the Pain! For a long time, unit testing non-public methods in C# has been a pain in the back side. In order to test a non-public method (most likely private methods) you have a number of choices each with an undesired effect: HOW TO MANAGE ROUTE53 HOSTED ZONES IN A MULTI-ACCOUNT Here’s how. Step 1. host the root domain in the master account. Step 2. host a subdomain in each environment-specific accounts for dev, test, staging, prod, etc. Step 3. for each of the subdomains in the corresponding AWS account, note the NS record that Route53 has created automatically. Step 4. back in the Master account, create a NS record HOW I BUILT A SOCIAL NETWORK IN 4 WEEKS WITH GRAPHQL AND How I built a social network in 4 weeks with GraphQL and serverless. AppSync, AWS, GraphQL, Programming, Serverless / November 17, 2020. November 17, 2020. I have been involved with a client project to help the client launch a new social network for university students to engage with each other to do sports. Amongst other things, users can: ARE LAMBDA-TO-LAMBDA CALLS REALLY SO BAD? This impacts the end-to-end latency. The 2nd Lambda invocation carries an extra cost for the invocation request. Since Lambda durations are paid in 100ms blocks, so you will pay for the amount of “roll-up” time for both caller and callee functions. You will pay for the idle wait time while the caller function waits for a response from the HIT THE 6MB LAMBDA PAYLOAD LIMIT? HERE'S WHAT YOU CAN DO Option 1: use API Gateway service proxy. You can remove Lambda from the equation and go straight from API Gateway to S3 using API Gateway service proxies. To learn more about API Gateway service proxies and why you should use them, please read my previous post on the topic. This approach doesn’t require any client changes. STEP FUNCTIONS : APPLY TRY-CATCH TO A BLOCK OF STATES With Step Functions, you can use Retry and Catch clauses to handle errors from Task states. There are a number of predefined system errors, and you can also handle custom errors that are thrown by your Lambda functions. You can do this by adding the same Catch clause to each of the Task states. However, this approach requires you to addthe
HOW TO GET PRIVATE, CONSTANT OR STATIC VALUE OF A FIELD How to get private, constant or static value of a field with reflection. To get the value of a private field of an instance in C#: Similarly, you can quite easily retrieve the value of a const or static field for a type, simply replace BindingFlags.Instance with BindingFlags.Static and call GetValue with null: BINARY AND JSON BENCHMARKS UPDATED It’s been a while since I last updated my binary and JSON serializer benchmarks, so here I round up the latest versions of the serializers on here.. DISCLAIMER : as always, you should benchmark against your payload and use case, the benchmark numbers I have produced here is unlikely to be representative of your use cases and neither is anybody else’s benchmark numbers. CONVERTING HEX STRING TO INT IN C# May 8, 2015. For a hex literal that’s not prefixed you can quite easily convert it using int.Parse in C#: 1. 2. 3. string hex = "142CBD"; int intValue = int.Parse (hex, System.Globalization.NumberStyles.HexNumber); But as you’ve probably noticed, most hex literals are prefixed with 0x (e.g. “0x142CBD”)which would throw a
AWS X-RAY AND LAMBDA : THE GOOD, THE BAD AND THE UGLY Update 03/07/2017 : whilst there was a bug in the X-Ray SDK wrt tracking the trace-id, adding annotations and metadata to the root segment is simply not supported, which the doc doesn’t explicitly state. You can work around this by creating a subsegment that covers the entire span of your function invocation to act as your custom root segment and attach any annotation and metadata LINQ - LAMBDA EXPRESSION VS QUERY - THEBURNINGMONK.COM Production-Ready Serverless workshop is coming back in August. You can SAVE 30% if you enrol before the end of June.. Skill up your serverless game and get answers to all your questions about AWS andserverless.
HOW TO MANAGE ROUTE53 HOSTED ZONES IN A MULTI-ACCOUNT Here’s how. Step 1. host the root domain in the master account. Step 2. host a subdomain in each environment-specific accounts for dev, test, staging, prod, etc. Step 3. for each of the subdomains in the corresponding AWS account, note the NS record that Route53 has created automatically. Step 4. back in the Master account, create a NS record HOW I BUILT A SOCIAL NETWORK IN 4 WEEKS WITH GRAPHQL AND How I built a social network in 4 weeks with GraphQL and serverless. AppSync, AWS, GraphQL, Programming, Serverless / November 17, 2020. November 17, 2020. I have been involved with a client project to help the client launch a new social network for university students to engage with each other to do sports. Amongst other things, users can: ARE LAMBDA-TO-LAMBDA CALLS REALLY SO BAD? This impacts the end-to-end latency. The 2nd Lambda invocation carries an extra cost for the invocation request. Since Lambda durations are paid in 100ms blocks, so you will pay for the amount of “roll-up” time for both caller and callee functions. You will pay for the idle wait time while the caller function waits for a response from the HIT THE 6MB LAMBDA PAYLOAD LIMIT? HERE'S WHAT YOU CAN DO Option 1: use API Gateway service proxy. You can remove Lambda from the equation and go straight from API Gateway to S3 using API Gateway service proxies. To learn more about API Gateway service proxies and why you should use them, please read my previous post on the topic. This approach doesn’t require any client changes. STEP FUNCTIONS : APPLY TRY-CATCH TO A BLOCK OF STATES With Step Functions, you can use Retry and Catch clauses to handle errors from Task states. There are a number of predefined system errors, and you can also handle custom errors that are thrown by your Lambda functions. You can do this by adding the same Catch clause to each of the Task states. However, this approach requires you to addthe
HOW TO GET PRIVATE, CONSTANT OR STATIC VALUE OF A FIELD How to get private, constant or static value of a field with reflection. To get the value of a private field of an instance in C#: Similarly, you can quite easily retrieve the value of a const or static field for a type, simply replace BindingFlags.Instance with BindingFlags.Static and call GetValue with null: BINARY AND JSON BENCHMARKS UPDATED It’s been a while since I last updated my binary and JSON serializer benchmarks, so here I round up the latest versions of the serializers on here.. DISCLAIMER : as always, you should benchmark against your payload and use case, the benchmark numbers I have produced here is unlikely to be representative of your use cases and neither is anybody else’s benchmark numbers. CONVERTING HEX STRING TO INT IN C# May 8, 2015. For a hex literal that’s not prefixed you can quite easily convert it using int.Parse in C#: 1. 2. 3. string hex = "142CBD"; int intValue = int.Parse (hex, System.Globalization.NumberStyles.HexNumber); But as you’ve probably noticed, most hex literals are prefixed with 0x (e.g. “0x142CBD”)which would throw a
AWS X-RAY AND LAMBDA : THE GOOD, THE BAD AND THE UGLY Update 03/07/2017 : whilst there was a bug in the X-Ray SDK wrt tracking the trace-id, adding annotations and metadata to the root segment is simply not supported, which the doc doesn’t explicitly state. You can work around this by creating a subsegment that covers the entire span of your function invocation to act as your custom root segment and attach any annotation and metadata LINQ - LAMBDA EXPRESSION VS QUERY - THEBURNINGMONK.COM Production-Ready Serverless workshop is coming back in August. You can SAVE 30% if you enrol before the end of June.. Skill up your serverless game and get answers to all your questions about AWS andserverless.
THEBURNINGMONK.COM
When you start a new Vue.js project that needs to interface with APIs running in AWS, there’s a good chance you will have these lines of code: import Amplify from ‘aws-amplify’ Amplify.configure({ Auth: { region: ‘us-east-1’, userPoolId: ‘xxx’, userPoolWebClientId: ‘xxx’, mandatorySignIn: true } }) These few lines of code let you use the aws-amplify library HIT THE 6MB LAMBDA PAYLOAD LIMIT? HERE'S WHAT YOU CAN DO Option 1: use API Gateway service proxy. You can remove Lambda from the equation and go straight from API Gateway to S3 using API Gateway service proxies. To learn more about API Gateway service proxies and why you should use them, please read my previous post on the topic. This approach doesn’t require any client changes. ARE LAMBDA-TO-LAMBDA CALLS REALLY SO BAD? This impacts the end-to-end latency. The 2nd Lambda invocation carries an extra cost for the invocation request. Since Lambda durations are paid in 100ms blocks, so you will pay for the amount of “roll-up” time for both caller and callee functions. You will pay for the idle wait time while the caller function waits for a response from the HOW TO BREAK THE "SENIOR ENGINEER" CAREER CEILING This is the single most important difference between a senior engineer and principal engineer. As a senior engineer, you are an important individual contributor (IC). You are an important cog in the wheel that keeps the company running. Your success is judged on your personal output and your impact on the overall business.PERFORMANCE TEST
Note: don’t forget to check out the Benchmarks page to see the latest round up of binary and JSON serializers. When working with the BinaryFormatter class frequently, one of the things you notice is that it is really damn inefficient both in terms of speed as well as the payload (the size of the serialized byte array).. Google’s Protocol Buffers format is designed to be super fast andRX FRAMEWORK
1. var zs = xs.Repeat (3); or as a static method: 1. var zs = Observable.Repeat (xs, 3); There are a few things you should keep in mind when you’re using the Repeat method though. 1. If you call Repeat method with no argument, it’ll repeatedly subscribe to the same observable collection indefinitely. 2. STATIC VS. NON-STATIC METHOD IN C# In C# terms, “static” means “relating to the type itself, rather than an instance of the type”. You access a static member using the type name instead of a reference or a value, e.g. Guid.NewGuid (). In addition to methods and variables, you can also declare a class to be static (since C# 2.0). A static class cannot be instantiated and FINDING COLDSTARTS : HOW LONG DOES AWS LAMBDA KEEP YOUR Hypotheses. Hypothesis 1 : there is an upper bound to how long Lambda allows your function to stay idle before reclaiming the associated resources This should be a given. Idle functions occupy resources that can be used to help other AWS customers scale up to meet their needs (and not to mention the first customer is not paying for his idle functions!), it simply wouldn’t make any sense for BE LAZY, BUT BE WARE OF INITIALIZATION EXCEPTION Be Lazy, but be ware of initialization exception. .Net 4 introduced the Lazy type which allows you to create an object that can be lazily initialized so that you can delay the creation of large objects, for instance. However, if your initialization logic has the potential to except at runtime (e.g. time out exceptions reading from some .NET TIPS - XML SERIALIZE OR DESERIALIZE DICTIONARY IN C# 16 Comments / .Net, C#, Programming, Tips / May 30, 2010. April 20, 2015. If you try to serialize/deserialize a type which uses the generic Dictionary type with the XmlSerializer then you’ll get an InvalidOperationException, for instance: Here’s my class: 1.THEBURNINGMONK.COM
AppSync, AWS, Lambda, Programming, Serverless / April 3, 2021. April 16, 2021. In the last post I discussed my preferred approach for modelling multi-tenant applications with AppSync and Cognito. This approach supports the common requirements in these applications, where there are a number of distinct roles within each tenant. HOW I BUILT A SOCIAL NETWORK IN 4 WEEKS WITH GRAPHQL ANDGRAPHQL WITH MYSQLSERVERLESS GRAPHQL SUBSCRIPTIONS How I built a social network in 4 weeks with GraphQL and serverless. AppSync, AWS, GraphQL, Programming, Serverless / November 17, 2020. November 17, 2020. I have been involved with a client project to help the client launch a new social network for university students to engage with each other to do sports. Amongst other things, users can: HOW TO MANAGE ROUTE53 HOSTED ZONES IN A MULTI-ACCOUNT Here’s how. Step 1. host the root domain in the master account. Step 2. host a subdomain in each environment-specific accounts for dev, test, staging, prod, etc. Step 3. for each of the subdomains in the corresponding AWS account, note the NS record that Route53 has created automatically. Step 4. back in the Master account, create a NS record STEP FUNCTIONS : APPLY TRY-CATCH TO A BLOCK OF STATESAMAZON STEP FUNCTIONSAWS STEP FUNCTIONS COMBINE TWO INPUTSSTEP FUNCTION PARALLEL With Step Functions, you can use Retry and Catch clauses to handle errors from Task states. There are a number of predefined system errors, and you can also handle custom errors that are thrown by your Lambda functions. You can do this by adding the same Catch clause to each of the Task states. However, this approach requires you to addthe
CONVERTING HEX STRING TO INT IN C# May 8, 2015. For a hex literal that’s not prefixed you can quite easily convert it using int.Parse in C#: 1. 2. 3. string hex = "142CBD"; int intValue = int.Parse (hex, System.Globalization.NumberStyles.HexNumber); But as you’ve probably noticed, most hex literals are prefixed with 0x (e.g. “0x142CBD”)which would throw a
JAVASCRIPT - STRING REPLACE ALL WITHOUT REGEX One peculiar thing I find in Javascript is that String.replace only replaces the first instance of the substring, unless you use a Regex . Fortunately I found a clever little pattern to do this without Regex : String.split (subString).join (replaceString). So suppose you want to remove the hyphen (-) in an AWS region name, you could write: AWS X-RAY AND LAMBDA : THE GOOD, THE BAD AND THE UGLYAWS LAMBDA AXIOSHANDHELD X RAY SCANNERX RAY FLUORESCENCE XRF ANALYZERX RAY RADIATIONLAMBDA PERFORMANCE Update 03/07/2017 : whilst there was a bug in the X-Ray SDK wrt tracking the trace-id, adding annotations and metadata to the root segment is simply not supported, which the doc doesn’t explicitly state. You can work around this by creating a subsegment that covers the entire span of your function invocation to act as your custom root segment and attach any annotation and metadata BINARY AND JSON BENCHMARKS UPDATED It’s been a while since I last updated my binary and JSON serializer benchmarks, so here I round up the latest versions of the serializers on here.. DISCLAIMER : as always, you should benchmark against your payload and use case, the benchmark numbers I have produced here is unlikely to be representative of your use cases and neither is anybody else’s benchmark numbers. HOW TO GET PRIVATE, CONSTANT OR STATIC VALUE OF A FIELDC# REFLECTION GET PRIVATE FIELDREFLECTION GET PRIVATE FIELDC# PRIVATE STATIC STRINGC# PUBLIC PRIVATE STATICC# REFLECTION PRIVATE PROPERTYC# REFLECTION SET FIELD VALUE How to get private, constant or static value of a field with reflection. To get the value of a private field of an instance in C#: Similarly, you can quite easily retrieve the value of a const or static field for a type, simply replace BindingFlags.Instance with BindingFlags.Static and call GetValue with null:PROJECT EULER
Solution. This problem is fairly easy, given that the answer we’re looking for much be very close to 3 / 7 (0.4285714286) I simply iterate through the denominators, d, and find the closest numerator, n, which will produce a value less than 3 / 7. Then filter the set so we end up with only the n, d pairs that have a GCD of 1 and pick theTHEBURNINGMONK.COM
AppSync, AWS, Lambda, Programming, Serverless / April 3, 2021. April 16, 2021. In the last post I discussed my preferred approach for modelling multi-tenant applications with AppSync and Cognito. This approach supports the common requirements in these applications, where there are a number of distinct roles within each tenant. HOW I BUILT A SOCIAL NETWORK IN 4 WEEKS WITH GRAPHQL ANDGRAPHQL WITH MYSQLSERVERLESS GRAPHQL SUBSCRIPTIONS How I built a social network in 4 weeks with GraphQL and serverless. AppSync, AWS, GraphQL, Programming, Serverless / November 17, 2020. November 17, 2020. I have been involved with a client project to help the client launch a new social network for university students to engage with each other to do sports. Amongst other things, users can: HOW TO MANAGE ROUTE53 HOSTED ZONES IN A MULTI-ACCOUNT Here’s how. Step 1. host the root domain in the master account. Step 2. host a subdomain in each environment-specific accounts for dev, test, staging, prod, etc. Step 3. for each of the subdomains in the corresponding AWS account, note the NS record that Route53 has created automatically. Step 4. back in the Master account, create a NS record STEP FUNCTIONS : APPLY TRY-CATCH TO A BLOCK OF STATESAMAZON STEP FUNCTIONSAWS STEP FUNCTIONS COMBINE TWO INPUTSSTEP FUNCTION PARALLEL With Step Functions, you can use Retry and Catch clauses to handle errors from Task states. There are a number of predefined system errors, and you can also handle custom errors that are thrown by your Lambda functions. You can do this by adding the same Catch clause to each of the Task states. However, this approach requires you to addthe
CONVERTING HEX STRING TO INT IN C# May 8, 2015. For a hex literal that’s not prefixed you can quite easily convert it using int.Parse in C#: 1. 2. 3. string hex = "142CBD"; int intValue = int.Parse (hex, System.Globalization.NumberStyles.HexNumber); But as you’ve probably noticed, most hex literals are prefixed with 0x (e.g. “0x142CBD”)which would throw a
JAVASCRIPT - STRING REPLACE ALL WITHOUT REGEX One peculiar thing I find in Javascript is that String.replace only replaces the first instance of the substring, unless you use a Regex . Fortunately I found a clever little pattern to do this without Regex : String.split (subString).join (replaceString). So suppose you want to remove the hyphen (-) in an AWS region name, you could write: AWS X-RAY AND LAMBDA : THE GOOD, THE BAD AND THE UGLYAWS LAMBDA AXIOSHANDHELD X RAY SCANNERX RAY FLUORESCENCE XRF ANALYZERX RAY RADIATIONLAMBDA PERFORMANCE Update 03/07/2017 : whilst there was a bug in the X-Ray SDK wrt tracking the trace-id, adding annotations and metadata to the root segment is simply not supported, which the doc doesn’t explicitly state. You can work around this by creating a subsegment that covers the entire span of your function invocation to act as your custom root segment and attach any annotation and metadata BINARY AND JSON BENCHMARKS UPDATED It’s been a while since I last updated my binary and JSON serializer benchmarks, so here I round up the latest versions of the serializers on here.. DISCLAIMER : as always, you should benchmark against your payload and use case, the benchmark numbers I have produced here is unlikely to be representative of your use cases and neither is anybody else’s benchmark numbers. HOW TO GET PRIVATE, CONSTANT OR STATIC VALUE OF A FIELDC# REFLECTION GET PRIVATE FIELDREFLECTION GET PRIVATE FIELDC# PRIVATE STATIC STRINGC# PUBLIC PRIVATE STATICC# REFLECTION PRIVATE PROPERTYC# REFLECTION SET FIELD VALUE How to get private, constant or static value of a field with reflection. To get the value of a private field of an instance in C#: Similarly, you can quite easily retrieve the value of a const or static field for a type, simply replace BindingFlags.Instance with BindingFlags.Static and call GetValue with null:PROJECT EULER
Solution. This problem is fairly easy, given that the answer we’re looking for much be very close to 3 / 7 (0.4285714286) I simply iterate through the denominators, d, and find the closest numerator, n, which will produce a value less than 3 / 7. Then filter the set so we end up with only the n, d pairs that have a GCD of 1 and pick the HIT THE 6MB LAMBDA PAYLOAD LIMIT? HERE'S WHAT YOU CAN DO Option 1: use API Gateway service proxy. You can remove Lambda from the equation and go straight from API Gateway to S3 using API Gateway service proxies. To learn more about API Gateway service proxies and why you should use them, please read my previous post on the topic. This approach doesn’t require any client changes. BUILDING A CUSTOM IAM SYSTEM HAS MADE ME APPRECIATE AWS In the last post I discussed my preferred approach for modelling multi-tenant applications with AppSync and Cognito. This approach supports the common requirements in these applications, where there are a number of distinct roles within each tenant. This approach (and others like it) works great when the tenants are isolated. STATIC VS. NON-STATIC METHOD IN C# In C# terms, “static” means “relating to the type itself, rather than an instance of the type”. You access a static member using the type name instead of a reference or a value, e.g. Guid.NewGuid (). In addition to methods and variables, you can also declare a class to be static (since C# 2.0). A static class cannot be instantiated and UNDERSTANDING ARITHMETIC OVERFLOW CHECKING IN C# Default context = unchecked. By default, arithmetic operations and conversions in C# are executed in an unchecked context. This means that for a signed integer it overflows from int.MaxValue to int.MinValue and underflows from int.MinValue to int.MaxValue, hence both statements below evaluates to true: Similarly, for an unsignedinteger it will
LINQ - LAMBDA EXPRESSION VS QUERY - THEBURNINGMONK.COM Production-Ready Serverless workshop is coming back in August. You can SAVE 30% if you enrol before the end of June.. Skill up your serverless game and get answers to all your questions about AWS andserverless.
CLOUDFORMATION REF AND GETATT CHEATSHEET The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this. JUST HOW EXPENSIVE IS THE FULL AWS SDK? Adding AWS SDK as the only dependency adds an average of 245ms without WebPack. This is fairly significant. Adding WebPack doesn’t improve things significantly either. Requiring only the DynamoDB client (the one-liner change discussed earlier) saves up to 176ms! In 90% of the cases, the saving was over 130ms.PERFORMANCE TEST
Note: don’t forget to check out the Benchmarks page to see the latest round up of binary and JSON serializers. When working with the BinaryFormatter class frequently, one of the things you notice is that it is really damn inefficient both in terms of speed as well as the payload (the size of the serialized byte array).. Google’s Protocol Buffers format is designed to be super fast and C# – BEWARE OF ASYNC VOID IN YOUR CODE 3 Comments / .Net, Async, C#, Programming / October 25, 2012. April 20, 2015. In general, when you see async void in your code it’s bad news, because: you can’t wait for its completion (as mentioned in this post already) any unhandled exceptions will terminate your process (ouch!) Suppose you have a timer event that fires every oncein a
.NET TIPS - USING INTERNALSVISIBLETO ATTRIBUTE TO HELP Oh, the Pain! For a long time, unit testing non-public methods in C# has been a pain in the back side. In order to test a non-public method (most likely private methods) you have a number of choices each with an undesired effect:Skip to content
THEBURNINGMONK.COM
Learn to build production-ready serverless applications on AWSMain Menu
* Blog
* Learn Serverless
* Workshops
* Consulting
* Podcast
* MoreMenu Toggle
* Public speaking
* Open source
* All my posts on Serverless * CloudFormation Ref and GetAtt cheatsheet*
HOW TO HANDLE CLIENT ERRORS GRACEFULLY WITH APPSYNC AND LAMBDAAppSync , AWS
, Lambda ,
Programming , Serverless / June 7, 2021 June 7, 2021 With API Gateway and Lambda, you can handle client errors gracefully by returning a 4xx response. module.exports.handler = async (event) => { // run validation logic return { statusCode: 400 } } This way, we can communicate clearly to the client that there’s a problem with its request. It also lets the Lambda invocation complete … How to handle client errors gracefully with AppSync and Lambda ReadMore »
__Tweet
__Share
__Share
LAMBDA LAYER: NOT A PACKAGE MANAGER, BUT A DEPLOYMENT OPTIMIZATIONAWS , Lambda
, Programming ,
Serverless / May 8, 2021 May 8,2021
It’s been two years since I last wrote about Lambda layer and when you should use it. Most of the problem I discussed in that original post still stands: It makes it harder to test your functions locally. You will still need those dependencies to execute your function code locally as part of your tests. … Lambda layer: not a package manager, but a deployment optimizationRead More »
__Tweet
__Share
__Share
HOW TO MANAGE ROUTE53 HOSTED ZONES IN A MULTI-ACCOUNT ENVIRONMENTAWS , Programming ,
Route53 / May 5, 2021 May 6, 2021 An interesting question came up in a conversation today: “How should I manage the Route53 DNS records in a multi-account environment?” Suppose you have configured an AWS Organization with different accounts for dev, staging and production environments. And you have registered the root domain for your application in the master AWS account. When working with … How to manage Route53 hosted zones in a multi-account environmentRead More »
__Tweet
__Share
__Share
BUILDING A CUSTOM IAM SYSTEM HAS MADE ME APPRECIATE AWS IAM EVEN MOREAppSync , AWS
, Lambda ,
Programming , Serverless / April 3, 2021 April 16, 2021 In the last post I discussed my preferred approach for modelling multi-tenant applications with AppSync and Cognito. This approach supports the common requirements in these applications, where there are a number of distinct roles within each tenant. This approach (and others like it) works great when the tenants are isolated. But what ifthey are …
Building a custom IAM system has made me appreciate AWS IAM even more Read More »__Tweet
__Share
__Share
HOW TO MODEL ONE-TO-MANY RELATIONSHIPS WITH APPSYNC AND DYNAMODBAppSync , AWS
, DynamoDB
, Programming
, Serverless
/ March 27, 2021 March 27, 2021 Thank you to Josh for asking this question on the AppSync Masterclass forum. His original question goes like this: Let’s say I want to add a one-to-many relationship from Profile to a new property called “Tag” (a complex object with “name” and “color” properties) so a user can define their own Tags. I wouldalso like a …
How to model one-to-many relationships with AppSync and DynamoDB ReadMore »
__Tweet
__Share
__Share
HOW TO SECURE MULTI-TENANT APPLICATIONS WITH APPSYNC AND COGNITOAppSync , AWS
, Cognito
, Serverless
/ March 26, 2021 March 26, 2021 One of the most common questions I get is “How do I build a multi-tenant application with AppSync and Cognito?”. If you google this topic on the internet you will no doubt come across many different opinions. It’s a topic that we’ll soon explore in the AppSync Masterclass but I want to take this opportunity … How to secure multi-tenant applications with AppSync and CognitoRead More »
__Tweet
__Share
__Share
THE CASE FOR AND AGAINST AMAZON COGNITO AWS , Programming / March 8, 2021 March 8, 2021 In light of recent news of Okta’s pending acquisition of Auth0 there’s been renewed discussion about where Amazon Cognito fits into the picture. It’s a question my clients often ask me, so here are my two cents. The case for Cognito Integration with other AWS services Cognito’s tight integration with other AWS services such as APIGateway, …
The case for and against Amazon Cognito Read More »__Tweet
__Share
__Share
HOW TO CONFIGURE ENVIRONMENT SPECIFIC PARAMETERS WITH VUE.JSAND AMPLIFY
Amplify , AWS
, Programming , Vue
/ March 2, 2021 March 2, 2021 When you start a new Vue.js project that needs to interface with APIs running in AWS, there’s a good chance you will have these lines of code: import Amplify from ‘aws-amplify’ Amplify.configure({ Auth: { region: ‘us-east-1’, userPoolId: ‘xxx’, userPoolWebClientId: ‘xxx’, mandatorySignIn: true } }) These few lines of code let you use the aws-amplify library … How to configure environment specific parameters with Vue.js and Amplify Read More »__Tweet
__Share
__Share
WEEKLY UPDATE 49
Me , Weekly Update / February 24, 2021 February 24, 2021 Hi, welcome to another weekly update! Real-World Serverless podcast Since the last update, we have had quite a few new episodes, covering a wide range of topics: #41: The future of JVM on Lambda with Vadym Kazulkin #42: Real-World Serverless with Ant Stanley (part 1) #43: Real-World Serverless with Ant Stanley (part 2) #44: Real-World … Weekly update 49 Read More »__Tweet
__Share
__Share
YEAR IN REVIEW, 2020 Me / December 31, 2020 December 31, 2020 As the curtain draws on a tough year, here’s my 2020 in numbers: 37 blog posts 34 conference talks started 1 book published 2 video courses 2,475 new students to my video courses produced 43 episodes of Real-World Serverless hosted 5 webinars 1236 contributions to 17 OSS projects helped 17 clients adopt serverless ran 10 … Year in review, 2020 Read More »__Tweet
__Share
__Share
POSTS NAVIGATION
1 2 … 87 Next Page → “I HELP TEAMS GO FASTER FOR LESS” Do you have great product ideas but your teams are just not movingfast enough?
Are you worried that your competitors are innovating faster than you?LET ME HELP.
SEARCH
×
search
Become a Serverless blackbelt! Production-Ready Serverless workshop is coming back in August. You can SAVE 30% if you enrol before the end of June. SKILL UP YOUR SERVERLESS GAME AND GET ANSWERS TO ALL YOUR QUESTIONS ABOUT AWS AND SERVERLESS. This workshop takes you through building a production-ready serverless web application from testing, deployment, security, right through toobservability.
With this HANDS-ON WORKSHOP, you can go from zero to having a clear idea of how to build a production-ready serverless application in just two days. There is something for everyone here as we will cover both the basics as well as advanced topics around security andobservability.
Become a serverless blackbelt!×
By continuing to use the site, you agree to the use of cookies. moreinformation Accept
The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.Close
Details
Copyright © 2024 ArchiveBay.com. All rights reserved. Terms of Use | Privacy Policy | DMCA | 2021 | Feedback | Advertising | RSS 2.0