Categories
Development

Add event header transaction variable to a logger

Q. I want to add event header transaction variable to a logger ,which wif ll be carried across the package. Us there a way to call the variable from function. import logging basicConfig(format=’%(asctime)s,%(msecs)d %. (levelname)-8s [%(VARIABLE)s][%(filename)s:%(lineno)d] %(message)s’, datefmt=’%Y-%m-%d:%H:%M:%S’, level=logging.DEBUG) def lambda_handler(event,context): Transaction I’d =event[headers].get(‘TransactionID’, ”) Thanks.

Categories
Development

Updating state with Hook causes infinite loop within function

I’d like to understand better why updating the state within a function that I call directly below is causing the function to run in a infinite loop. I understand that I should be using “useEffect” if I want to update the state immediately after it mounts, but I want to know the mechanics behind why […]

Categories
Development

How To Count Number Of Continuous Blank Cells In Excel and ad to a date

I am trying to recalculate start and end dates. I have a date in cell A1.(Start Date) Cells C1 thru I1 (represent calendar days for a week) have values or blanks. I need to calculate a new start date in J1 based on the number of consecutive blank cells starting at C1. Then I have […]

Categories
Development

Why can’t you unbox directly to a type which you can explicity cast to?

Ran into this as part of some EF/DB code today and ashamed to say I’d never encountered it before. In .NET you can explicitly cast between types. e.g. int x = 5; long y = (long)x; And you can box to object and unbox back to that original type int x = 5; object y […]

Categories
Development

Adobe apps error on certain commands, keyboard not responsive

I have a problem with adobe apps, it’s surfacing in Photoshop and Illustrator at least, the others I haven’t tried. At some point of using the app there would be an error sound, something like a clockwork or rattle winding up, shortly after that that same sound winding down, and after that my onboard keyboard […]

Categories
Development

How to add a response header in ApolloServer?

I am using graphql ApolloServer and using following for Apolloserver server.applyMiddleware({ app, path: ‘/graphql’ }); And I need to pass the error returned from the resolvers in the response header. I read through the docs but looks like we cannot add another middleware after the above-mentioned middleware. I also tried adding a formatResponse while initializing […]

Categories
Development

how do i send Images over socket without closing the socket?

I’ve mananged to send small(less than about 22mb) images but when sending bigger images i get errors such as shown below. I want to be able to reuse the socket and therefore not closing it. As you maybe can see im trying to send a picture from client to server where it will be displayed […]

Categories
Development Google

Is google ads targeting device android version is the same as the min SDK version?

I recently used google ads to promote my app, it works fine, but I’m wondering if the impression is only showing on the Android 8+ system, which is the minimal version of my app’s SDK.

Categories
Development HTTP

Basic authourization using fetch or http.get methods

I have an endpoint and credentials and I don’t want these credentials to be encoded. I want a response from the endpoint when I hit it. I got a JSON response(which had only 1 object with 4 keys and corresponding values) when I hit this endpoint using postman. How do I code this thing in […]

Categories
Development

Keras GaussianNoise layer no effect?

I wanted to add some Gaussian noise to my Images in my CNN with the keras’s functional API, but while testing some different stddev values, I noticed that the Gaussian Layer does nothing to the input data. I used the following code for testing: import tensorflow as tf import numpy as np import cv2 stddev […]