Skip to content

Instantly share code, notes, and snippets.

View robintw's full-sized avatar

Robin Wilson robintw

View GitHub Profile
This is the text of a blog post found on the internet. As part of an evaluation metric, I'd like you to try and work out who wrote it, and provide some details about them. Read it carefully multiple times and then provide up to 5 suggestions of who might have written it. DO NOT search the internet, use your own internal knowledge.
How to speed up appending to PostGIS tables with ogr2ogr
March 15, 2024
Summary: If appending to a PostGIS table with GDAL/OGR is taking a long time, try setting the PG_USE_COPY config option to YES (eg. adding --config PG_USE_COPY YES to your command line). This should speed it up, but beware that if there are concurrent writes to your table at the same time as OGR is accessing it then there could be issues with unique identifiers.
As with many of my blog posts, I’m writing this in the hope that it will appear in searches when someone else has the same problem that I ran into recently. In the past I’ve found myself Googling problems that I’ve had before and finding a link to my b
This is the text of a blog post found on the internet. As part of an evaluation metric, I'd like you to try and work out who wrote it, and provide some details about them. Read it carefully multiple times and then provide up to 5 suggestions of who might have written it. DO NOT search the internet, use your own internal knowledge.
One reason for getting a ‘No HTTP triggers found’ error when using Azure Functions with Python V2 programming model
March 19, 2024
Summary: It might be because there is an exception raised when importing your function_app.py – for example, caused by one of your import statements raising an exception, or a parsing error caused by a syntax error.
I was deploying a FastAPI app to Azure Functions recently. Azure Functions is the equivalent of AWS Lambda – it provides a way to run serverless functions.
Since I’d last used Azure Functions, Microsoft have introduced the Azure Functions Python V2 programming model which makes it easier and cleaner to do a number of common tasks, such as
The issue is likely that when the cookie already exists in the browser from a previous session with a different secret key (e.g., the secret key file was regenerated, or data directory changed), the decode fails.
Let me check if the error is being handled properly.
Look at withCSRF line 289-293:
session, err := sessionStore.Get(c.Request, storeName)
if err != nil {
http.Error(c.Response, err.Error(), http.StatusInternalServerError)
return
}
On the recent Supreme Court ruling, I believe that everyone deserves to feel safe and be protected. I want trans people in our
country to feel accepted, and able to live with freedom and dignity. I assure you I will continue to fight discrimination,
bigotry and hatred against LGBTQ+ people.
Thank you for providing your views on the Supreme Court ruling. As you rightly say, the Government is of course not the
Supreme Court, and does not control it. This separation of judiciary and the government is an important pillar within a
democracy and provides checks and balances, which I of course agree with and support.
We know that although this recent ruling provides clarity on many areas, it still raises questions, ambiguity and concerns,
especially for trans people, and I’ve written to the department to raise these. If you have anymore specific concerns about
subroutine abstra (idatm,wl,xmus,xmuv,uw,uo3,uwus,uo3us,
a idatmp,uwpl,uo3pl,uwusp,uo3usp,
a dtwava,dtozon,dtdica,dtoxyg,dtniox,dtmeth,dtmoca,
a utwava,utozon,utdica,utoxyg,utniox,utmeth,utmoca,
a ttwava,ttozon,ttdica,ttoxyg,ttniox,ttmeth,ttmoca )
c transmittance calculation for ozone, water vapor,
c carbon dioxyde and oxygen.
c downward absorption water vapor dtwava
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
====
With normal output
====
2021-10-09 21:50:37.540 | DEBUG | prompt_toolkit.key_binding.bindings.focus:focus_next:21 - Set focus to [('[SetMenuPosition]', ''), ('class:dropdown.text', ' Select column ',...
2021-10-09 21:50:38.057 | DEBUG | prompt_toolkit.key_binding.bindings.focus:focus_next:21 - Set focus to [('[SetMenuPosition]', ''), ('class:dropdown.text', ' = ',...
===
With DummyOutput
===
2021-10-09 21:51:12.538 | DEBUG | prompt_toolkit.key_binding.bindings.focus:focus_next:21 - Set focus to [('class:button.arrow', '<', <function Button._get_text_fragments.<locals>.handler at 0x119a321f0>), ('[SetCursorPosition]', ''), ('class:button.text', 'Add filter condition'...
import asyncio
from prompt_toolkit.application import create_app_session
from prompt_toolkit.input.base import DummyInput
from prompt_toolkit.key_binding.key_processor import KeyPress
from prompt_toolkit.keys import Keys
from prompt_toolkit.output import DummyOutput
from pepys_admin.maintenance.dialogs.help_dialog import HelpDialog
from pepys_admin.maintenance.gui import MaintenanceGUI
async def test_select_platform_type(test_datastore):
# Test application in a dummy session.
input = DummyInput()
output = DummyOutput()
# output = None
with create_app_session(output=output, input=input):
gui = MaintenanceGUI(test_datastore)
task = asyncio.create_task(gui.app.run_async())