I tried to load MouseKeyHook, and got the following error message
Severity Code Description Project File Line Suppression State
Error Could not install package 'MouseKeyHook 5.7.1'. You are trying to install this package into a project that targets '.NETFramework,Version=v3.5', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.
thoughts on the issue?
Reinstalling the Extension worked for me.
Alright, I have fixed this error after fighting many hours. Just need pushing the verifying buttong in the epic launcher, and those error all gone. So it looks like some unknown behavior caused those errors. Anyway, maybe just a reminder for the later. If you find a error bothing you and no idea to fix that, try the verify buttong in epic launcher maybe helpful.
I believe those Could not find dynamic library
messages are just warnings. You can fix them by passing (in my case) --ld-search-path=/lib/x86_64-linux-gnu
, where the search path is found by invoking find /usr/lib -name libpthread.so
or find /lib -name libpthread.so
I have posted a working Spark connect docker-compose.yaml
here.
In my case I used the extensionsToTreatAsEsm: [".ts"] in jest.config and add the node with --experimental-vm-modules to the test script:
"test:watch": "NODE_OPTIONS='--experimental-vm-modules' jest --watch",
Try that, here worked well
See docs for that: https://jestjs.io/docs/ecmascript-modules
How if I used the formula to count days between orders in a column with conditions based on store name? Is it possible to use the same formula?
monitor_baud
configuration option in section is deprecated and will be removed in the next release! Use monitor_speed
instead
I used the import of the separate type of the cva
function and it looks like this:
import type { VariantProps } from 'class-variance-authority';
Thanks to programmer for their question/answer and derek-mccallum for their answer as well. The Java interfaces for this task are not intuitive at all and their content saved me some time.
Here is a more succinct example and the code is available on GitHub here.
static java.security.PublicKey toJavaPublicKey(byte[] publicKey, int off, int len) {
byte[] reversed = ByteUtil.reverse(publicKey, off, len);
int last = reversed[0] & 0xFF;
boolean xOdd = (last & 0b1000_0000) == 0b1000_0000;
reversed[0] = (byte) (last & Byte.MAX_VALUE);
var y = new BigInteger(reversed);
var edECPoint = new EdECPoint(xOdd, y);
var publicKeySpec = new EdECPublicKeySpec(NamedParameterSpec.ED25519, edECPoint);
try {
return ED_25519_KEY_FACTORY.generatePublic(publicKeySpec);
} catch (InvalidKeySpecException e) {
throw new RuntimeException(e);
}
}
when i right click nothing happens. i dont get it..
Security flows with the direction of the relationship, from the one to the many.
The most common way to avoid code like while (GetMessage( lpMsg, hWnd, 0, 0))
is to use while (GetMessage(&msg, NULL, 0, 0))
!
The possibility of a -1 return value in the case that hWnd is an invalid parameter (such as referring to a window that has already been destroyed) means that such code can lead to fatal application errors.
GetMessage
return -1 means there is an error in the code you wrote. Please fix it. The most typical example is while (GetMessage( lpMsg, hWnd, 0, 0))
This can cause problems including, but not limited to, not being able to receive the WM_QUIT message to end the message loop. This directly causes GetMessage to return -1 after the window identified by hWnd is destroyed.
Checking whether GetMessage
returns -1, like using at()
on a vector, is unnecessary in a well-designed program.
Once you have written your code correctly, you don't have to worry about GetMessage
returning -1.
For more details, see Raymond Chen's article
When will GetMessage return -1?
From my testing, not including the apns-expiration header, is the same as including it and setting it to 0. The notification is delivered once, if the device is offline, when its sent, the device will not get the message.
I figured it out adding Microsoft.Extensions.Logging.Abstractions.dll,Microsoft.Extensions.Logging.dll and Microsoft.Extensions.Options.dll solved the problem. I don't know why, but seems iText7 use them for logging or some other purpose. I post here in case someone encounter the similar problem.
I was able to figure it out. The solution is in the description.
solved needed to add
headers" : ["Content-Type: text/plain"]
See this new tutorial, old is deprecated. The official has provided the stream debugger tool. https://www.jetbrains.com/guide/java/tips/debugging-streams/
When you there you will see three dots, now if you click it and create a deployment
you will see that you can only create deploy 100 code per day so you need to wait 10 hours for another deployment.
If you have Black and White Text, that means that your background is something else.
You might be able to use Canny Edge Detection to detect the characters, and then fill them in.
You might be able to use an adapted Global Thresholding technique, where you find two thresholds, one for White Text and the other for Black Text. When you convert your image to grayscale, and assuming your background is gray since you didn't provide an image, anything between these two thresholds would be background and can be removed. Everything else would be foreground and would be your Text.
If your text was an actual color other than White, you would have to try to isolate it before any grayscale conversion.
If anyone else is still stuck on this - the answer I think is in the comments. It's a likely a db threading issue. We removed makara and the issue hasn't happened since.
This is not an answer but I think it will be helpful to add here as I cannot add a comment. I have a similar issue and had the question for a while here with no answer: MirroredStrategy output varies depending on the visible GPUs
I think as a workaround for now, you can run nvidia-smi topo -m
and check the connections between GPUs
In my case, your example works fine when setting CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7
but fails if CUDA_VISIBLE_DEVICES=1,2,3,4,5,6,7,0
You asked for a suggestion, here are a few.
The algorithm you described is a Global Thresholding approach, which you have hardcoded a threshold instead of using a quality algorithm to generate the threshold for you, such as Otsu. I would highly advise you using Otsu instead.
Note: Alex's answer uses OpenCV. If you liked that answer, you can tell it to use Otsu instead.
See: https://docs.opencv.org/3.4/d7/d4d/tutorial_py_thresholding.html
My second suggestion is to not write it yourself, and also not to use Global Thresholding, but Local Adaptive Thresholding. OpenCV offers this too, but only elementary implementations like "Mean". Popular PHD researched algorithms include: Sauvola, Niblack, Wolf, NICK, etc. There are other Python packages for these too, like DoxaPy.
Note: Local Adaptive algorithms usually take parameters. The defaults are typically good enough, but you can optimize them for your needs.
I assume validating the invitation code before user sign up and potentially preventing it on the client side is not an option. Perhaps you need to know their email address first, correct?
If that's the case, you could go one of the following routes:
beforeCreate
cloud function.I just fixed a similar problem, WHM and Cpanel + WP all had the memory limits set to 2GB but I was still getting an out of memory error in WP (PHP), it was reading the correct limits set in the user.ini, php.ini and .htaccess but the persisted.
In WHM, Apache configuration -> Memory Limits. (RLimitMEM)
Set that limit to match your PHP limits.
I have found my solution. I forgot to add the Client Id, Tenant Id, and CLient Secret in the environment variables in the app services. Added those and now it is working properly
I found a solution by following the link below. It appears that in the portal I should disconnect the repo in Deployment Center and re-run the pipeline. Once it gives a check mark then connect it again.
https://learn.microsoft.com/en-us/answers/questions/382358/when-deploy-functionapp-to-slot-)-error-package-de
See comment above. Was getting inconsistent return values from driver.getWindowHandles() which was causing the wrong window to be switched to.
I know that this is old, but in case someone is running into this problem, I have a fix. However, it only works if you have root. In my particular case, I needed to use the camera from termux, which started at boot via termux-boot. So I put this into the startup script: sudo /system/bin/am start com.termux/.app.TermuxActivity For your app, you must bring it to foreground some way or another, even without user action. So if the boot started app sees 'the light of the screen' then it should work. I am not sure if you can do it from the app itself or not (without am start).
The consensus answer seems to be to use Sandcastle (a bit strange to me, as a third-party product; one might have expected Microsoft to provide the entire toolchain). But I will accept the consensus and try it! Thanks.
I referred to the Airflow documentation and found that setting
auth_backends = airflow.api.aith.backends.default
in airflow.cfg only enables unauthenticated POST Requests through the experimental API. The webhook was able to post to the Airflow endpoint.
curl -X POST "https://Server/api/experimental/dags/DagInQuestion/dag_runs" \
-H "Content-Type: application/json" \
-d '{
"conf": {
"json_data": "{Data}"
}
}'
https://airflow.apache.org/docs/apache-airflow/2.7.1/security/api.html#basic-authentication
https://meta.stackoverflow.com/ https://stackoverflow.com/questions/2889766/best-way-to-organize-filetype-settings-in-vim-and-vimrc?rq=3[enter link description here]1
$git $tag $ekoveevoke
I know I am late, but you can use icons from this link for angular mat icons
https://www.angularjswiki.com/angular/angular-material-icons-list-mat-icon-list/
It looks like your client-side code is using the example from Stripe's React code snippet instead of the React Native snippet, right? It looks like their React Native library is expecting snake case instead of camel case: notice the error message says "only accepts the USBankAccount payment method type" instead of "us_bank_account" like they document in the API reference.
https://docs.stripe.com/payments/ach-direct-debit/set-up-payment?platform=react-native
I had to downgrade using the command $ pip install mlxtend==0.23.1
and the error went away.
The model is too large to fit into memory - either GPU or RAM.
Here is a few things you can try to do.
If the model loads into memory without issue (whether it be RAM or onto the GPU), start with the smallest batch size of 1 and see if your model is able to perform a propagation step; forwards and backwards, i.e. updating the gradients.
If you are able to do this, then incrementally increase the batch size and repeat the above step before saturating all our available memory and causing this error message, then step down the batch size by one and used this to fit your model. This is making sure you're utilizing all your resources properly.
If its the case that whilst you're loading the model into memory you get this error message, then the model itself is too large, let alone the additional parameters generated by whatever optimizer were to perform the fitting routine.
Keyboardy is a one-handed typing app that uses a customizable Reflector key to mirror the keyboard layout.
Why Keyboardy is Ideal for You (and for me!):
Customizable Reflector Key: Assign any key (not just the spacebar) as the Reflector, allowing the keyboard to mirror itself. This gives you access to all keys—including numbers and punctuation—comfortably with one hand, eliminating the need to overreach.
Cross-Platform Compatibility: Keyboardy works on Windows, Mac, and Linux, offering consistent functionality across all platforms. You can code wherever you’re most comfortable!
Built for Coders: Fully customizable layouts ensure quick access to punctuation, symbols, navigation and other keys essential for programming.
Unlike one-handed keyboards with steep learning curves or costly hardware, Keyboardy integrates with your keyboard, language and layout and is intuitive to learn especially for a touch typist.
Not using Vite or ts but https://stackoverflow.com/a/76989526/29355805 above got me on the right track! (i cant comment or upvote yet on here)
I moved some stuff around manually and somehow it FINALLY started working. Thought i'd share incase if anyone else is on an even more similar boat.
jsconfig.json--
{
"compilerOptions": {
"paths": {
"@/*": ["./src/*"]
}
},
"include": ["**/*.js", "**/*.jsx", "tailwind.config.js"],
"exclude": ["node_modules"]
}
then add a component-- npx shadcn add
then created a lib
directory in ./src/components,
and manually dropped the utils.js file in.
then added alias: { "@": path.resolve(__dirname, "../../src/components"), }
inside webpack.config.js
const path = require("path");
const options = {
resolve: {
extensions: [".css", ".scss", ".ts", ".tsx"],
alias: {
"@": path.resolve(__dirname, "../../src/components"),
},
},
i restarted servers, loaded a button in, and it worked! 🎉 good luck to the next person!🤞
This will not work in the following cases.
For Instance:
Details Example:
www.abc.com
(10 Spam Links or Domains)
abc.com
(10 Spam Links Domains)
Note: Suppose our Current domain is abc.com
, and www.abc.com
has been redirecting to abc.com
.
In the Above Case, only the abc.com
referrer will be blocked and show a 403 error, whereas if you also block www references URLs or Domains, these links will not be blocked for referral traffic.
If someone has a solution to this, please share.
You can call Max directly on Descendants.
var result = xml1.Descendants("WbDrillPermitNo").Max(n => int.Parse(n.Value));
I have written the Doxa binarization library for this purpose:
https://github.com/brandonmpetty/Doxa/blob/master/Demo/Cpp/demoOpenCV.cpp
You can look at the algorithms for Sauvola, Niblack, Wolf, etc. I have a draft PR of AdOtsu that I am almost ready to push, for supporting Adaptive Otsu.
All written in C++ with no 3rd party dependencies, and bindings for Python and JavaScript. The above link show how to tie it into OpenCV.
For those looking for an answer, it seems the easiest option is to put the resource ID in a data attribute in your DOM.
You could also put it in an onclick event handler, or a hidden form field.
I had the same problem, and my solution was to remove the plugin that was using com.google.android.play:core, for my app the plugin I had to remove cordova-plugin-apprate with this command: cordova plugin remove cordova-plugin-apprate
custom_urls = [
path(
"/tenant-admin/<tenant_name>/", self.index_view, name="index"
), # Tenant-specific index
]
edit this line :
"<str:tenant_name>/"
Asking which you should use is an opinion-based question, which isn't permitted on StackOverflow. We don't know what you should do. Each of these patterns has their own trade-offs.
To start you on your path for that answer, I recommend searching the web for "schema-first" vs "code-only" (sometimes "code-first") blog posts. Your first example is "code-only", and your second example is "schema-first"
@cheekyprogrammer sent me on the right route.
It appears that you have to add an RLS policy for the database to work. Here is how to do that:
Authentication > Policies
.Create Policy
. Press that.INSERT
or DELETE
.And that's it. Now your project should work properly.
We think this was reported in https://github.com/grpc/grpc/issues/36888
It should be fixed in gRPC 1.65.2 and 1.66.0. Could you try to verify?
Thanks :)
I think this will help you: \t and \n in f-strings
Use \t for indentation and \n for new lines in f-strings
text = "Line one \n\tLine two \nLine three \n\tLine four \nLine five"
print(text)
Line one
Line two
Line three
Line four
Line five
So I didn't see it anywhere else here, but for some reason I had success with both uppercase Þ and lowercase þ - Thorn. Besides µ - Micro, these are the only other characters I could get to actually show up - and to come after the alphabet. I'm sure you can enter the Alt + Unicode to type them from the keyboard.
µ Micro: 00b5 Þ uppercase Thorn: 00de þ lowercase Thorn: 00fe
Same problem, easy solution. (On my rpi) Navigate to
cd /usr/share/phpmyadmin/js/vendor/jquery
and get jquery
sudo wget https://code.jquery.com/jquery-3.7.1.min.js -O
Finaly, you need to restart Apache
sudo systemctl restart apache2
You could make an array of ids like $ids_to_exclude = array('93',...)
then loop through it using a forloop
or while
loop
$ids_to_exclude = array('93',...);
foreach ($ids_to_exclude as &$id) {
function_to_call_on_each_id($id);
}
Secrets environment variables are asked during the deployment process. However, if they are set in the Develop environment, they will be reflected as is.
The same problem. No solution yet after several hours spent on this trivia.
Is my-firebase-url
identical to the Firebase project ID?
I found that auth/popup-closed-by-user
occurs when frame-src
doesn't include [project-id].firebaseapp.com
because signInWithPopup
at first redirects to [project-id].firebaseapp.com/__/auth/handler
even if the app is hosted on a different "non-default" Firebase hosting site
In my case, renaming the root folder of my project solved the issue. I removed spaces and special characters. was: base_folder/portifólio/venv/Scripts/... Now is: base_folder/portifolio/venv/Scripts/... Without any accentuation
In your playwright.configt.ts file this is how I set it up:
reporter: process.env.CI ? [
["allure-playwright",
{
detail: true,
outputFolder: "allure-results",
suiteTitle: false,
}
]
] : [
["html", { open: "never" }],
["list", { printSteps: true }]
],
Did not you forget about dot notation?
if you import like that:
import your_module_name
# suppose you have func_1 and func_2 in the module
# you need to call them using dot notation
your_module_name.func_1()
your_module_name.func_2()
?!
Also, the context of the problem is short, next time provide it little bit widely
These answers really helped me w my assignment! I’d like to contribute. For part 2 calculations, I did:
double numProductF = ((double)num1) * num2 * num3 * num4; double numAvgF = (num1+num2+num3+num4)/4.0;
The mistake I was doing was not including the (double) for the first number, as Mureinik and others said. Just this double was enough for me to finally get it. The explanations also make a lot of sense. Thank you!
can you confirm if you are using a Vertex AI Workbench instance? As per the error, I believe you are, so please refer to the public documentation below [1].
This error occurs because you can't edit the underlying VM of an instance by using the Google Cloud console or the Compute Engine API.
To edit a Vertex AI Workbench instance's underlying VM, use the projects.locations.instances.patch method in the Notebooks API or the gcloud workbench instances update command in the Google Cloud SDK
[enter link description here][1]
[1]: https://t.me/EAGLE_HACKER_2## Heading ##
NameError Traceback (most recent call last)
in <cell line: 0>() 1 from sklearn.model_selection import train_test_split ----> 2 x_train, x_test, y_train, y_test = train_test_split(x, y, test_size=0.2, random_state=100)
NameError: name 'x' is not defined
In your feature file, you are missing a colon on the Scenario keyword. Try it with Scenario: to have it invoke your step definition class.
(Don't have the reputation to comment on the previous reply, but this is in reply to it)
Yes, there is! Using only git:
git diff --name-only --diff-filter=A -z | git restore --staged -q --pathspec-file-nul --pathspec-from-file=-
This is really great, but git add -AN
also stages file deletions, and this command doesn't unstage those file deletions. We can fully reverse the git add -AN
command with this command:
cat <(git diff --name-only --diff-filter=A -z) <(git diff --staged --name-only --diff-filter=D -z) | git restore --staged -q --pathspec-file-nul --pathspec-from-file=-
We need to run two different commands and cat them, because we can only see the deleted files when using git diff --staged
.
This is my case,
First I saw the Malware warning alert and I clicked (looking back that I shouldn't) Move to Bin
and it deleted a couple of "malicious" files completely. Then I downloaded the .dmg file from docker's website.
After I installed it, it prompted me that "Docker is damaged and can’t be opened. You should move it to the Bin" and asked me to delete the entire app. I ignored and warning and left alert open, then I followed @W-B's solution and copied those two files to the folder PrivilegedHelperTools
(It didn't exist and I needed to create it manually). It still does not work for my case after a few attempts at this moment. I still can't get rid of that annoying alert.
Then I noticed the workaround steps on Docker's official github page. I executed the step 1 and 2, which verified that my cert was correct. Then the rest step is the same as @W-B's answer so I stopped right there.
Then somehow, I realized that my docker was not proper installed after the .dmg file was unzipped. Then I searched "Docker is damaged and can’t be opened" and came across this page, which points me to Docker's wiki page and executed the following the command 2-3 times, cuz I need to battle with the 2nd annoying alert that says my file is already damaged.
sudo /Volumes/Docker/Docker.app/Contents/MacOS/install
After a few attempts, the alert is gone and I can load my image properly in docker.
I still don't know exactly what steps make it work for me. But just want to write down my debugging process and share those links and hopefully that can help someone in the future.
That was not works for me, but I added implicitNullType: true
in the data source configuration and works ok.
it just requires "chown -R www-data:www-data /home/wiki/mediawiki/images" in the host
If this is being caused by the daterangePicker, you may try assigning the moment object to the window... window.moment = moment;
Will this help?
<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8">
<title>Aerocello</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<style>
body {
background-color: #AEAEAE;
margin: 0;
padding: 0;
height: 100vh;
}
.gallery {
display: flex;
flex-direction: row;
flex-wrap: wrap;
position: relative;
height: 100%;
}
.centre {
width: auto;
max-width: auto;
height: 80%;
max-height: 80%;
display: block;
margin-left: auto;
margin-right: auto;
overflow: auto;
margin: auto;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.roboto {
font-family: roboto;
}
</style>
<script>
window.onload=()=>{
if (parseFloat(document.querySelector('.centre').style.width) < 80) {
document.querySelector('.centre').style.width = '80%';
}
}
</script>
<body>
<div class="gallery" *ngFor="let image of images; let i = index;">
<img src="https://th.bing.com/th/id/OIP.0jl9haemnq0P4eYzzrfNOgHaGw?w=217&h=198&c=7&r=0&o=5&pid=1.7" alt="logo" class="centre">
</div>
<div class="idk">
<p class="roboto">hi</p>
</div>
</body>
</html>
the allow-insecure-localhost flag has been removed from Google Chrome 119 and onwards. This flag was used to allow Chrome to load insecure websites on the local machine. It was removed to improve security and privacy. This removal affects local development, as it means that Chrome will no longer automatically load insecure websites on the local machine. This can be a problem for local development servers that are not using HTTPS. As per answer here
cx_Oracle was obsoleted several years ago by python-oracledb. So the "correct" solution now is to use python -m pip install oracledb
. Also see https://medium.com/gitconnected/what-is-the-difference-between-cx-oracle-and-python-oracledb-d2887336f75a
To disable the Apple press and hold for VSCode only, run this command in a terminal:
defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool false
Then restart VSCode.
Similar question: How do I press and hold a key and have it repeat in VSCode?
For Mac,
Go to System Settings > Privacy & Security > App Management
i have the same problem 😢, i think github action do not recognize my StorageState
A bit late to the party. To answer the second part of the question
is there any other or short way to do this
There is. I am sure this explanation exists in the vasts of the SO, but I did not look for.
The code below does exactly the same thing as STUFF( SELECT .. FOR XML PATH
.
DECLARE @agg VARCHAR(MAX)
SELECT @agg = CONCAT(@agg + ',', name) FROM temp1
SELECT @agg
When @agg
is declared, its value is NULL
.
When the first row of the temp1
is fetched @agg
is still NULL
.
@agg + ','
equals to NULL + ','
which results in NULL
.
See Microsoft Documentation
However, CONCAT(NULL, Name)
produces aaa
, not NULL
!
Then aaa
is stored in @agg
.
When the second row of the Temp1
is fetched CONCAT(@agg + ',', Name)
produces aaa,bbb
. Then this value is stored in @agg
.
And so forth
So it turns out on Deployments - Overview tab it said 2 secrets were out of sync. After adding them and deploying email is working in production now.
Try eval()
(js) or <iframe>
(html) with document.querySelector('iframe').contentDocument.scripts[0].innerHTML
(js) and same with the css
and html
. If that doesn't work then I don't know.
document.querySelector('div.js-editor').addEventListener('blur',()=>{
try{
document.body.appendChild(document.createElement('div')).innerText=eval(document.querySelector('div.js-editor').innerText)
}
catch(e){
document.body.appendChild(document.createElement('div')).innerText=e
}
});
<!DOCTYPE html>
<html>
<body>
<div class="js-editor" contenteditable="true">
/*code here*/
</div>
</body>
</html>
Does that help?
Digital marketing is the use of online platforms and technologies to promote products or services. It includes strategies like search engine optimization (SEO), social media marketing, content creation, email campaigns, and paid advertising. The goal is to reach and engage target audiences through digital channels, driving brand awareness, traffic, and conversions. https://eshikhon.com/
For anyone in the future: If I am following your question correctly, I use the extension "Quokka". To use it:
CTRL + SHIFT + P (command pallet) then Search "Quokka.js: start on current file"
and this should give you an immediate result within vscode
I had to do this for a membership application for an Irish organisation which also took subscriptions from non-Irish people.
I quickly stopped being amazed by all of the characters (and other stuff) that people could copy'n'paste into fields for data entry. A good rule of thumb is to sanitise as much as possible before and/or at data entry - but, you will never be able to stop people from doing stupid things!
Also, one can have totally unexpected (for me anyway) legitimate symbols, e.g. Dutch names can have an apostrophe as a surname's first character and the first character doesn't have to be capitalised (it's even wrong - see 1st example in link - same in Irish). Some African languages use the !
(exclamation mark) as a click sound.
Now, the Irish language (and Hiberno-English) has the potential for all sorts of traps - for example the surname Ua hUigín
is valid - note lower case h
directly in front of upper case U
- which is correct! As well as that, we obviously have apostrophes all over the place - the O'
in O'Brien
being a case in point - O'
is a modern version of Ua
meaning "descendant of". We also have Mc
& Mac
meaning "son of". Plus, we have accents/diacritics - see here.
To add to all this fun and games is that fact that some people put a space between O'
and Brien
(uncommon) and others do not - the same goes for Mc
and Mac
in front of their suffixes (more common) - as well as Fitz
from our Norman friends (French "fils" = son), very common in the south west - space or no space?
So, we devised a scheme whereby we used triggers to populate a field called surname_search
- these were the days before `computed/calculated/virtual/derived/generated fields, but we can use them today - see below.
For surname_search
we:
You may think that this is overkill, but it's not - if people are allowed to put in rubbish, they will!
Your best bet is possibly to do something like the following (all of the code below is available on the fiddle here):
Your original table might look something like this:
CREATE TABLE t -- could be user or person or...
(
id SMALLINT NOT NULL PRIMARY KEY GENERATED ALWAYS AS IDENTITY,
-- title TEXT NULL,
-- fname TEXT NOT NULL
surname TEXT NOT NULL,
-- ...
-- ... other fields
-- ...
symbol TEXT NOT NULL -- Not part of original table - helps with testing, see below and fiddles
);
The first thing we could do is this.
Install the CITEXT
(case insensitive) and UNACCENT
(remove accents) extensions. These two are part of the contrib
modules - plus, both of these are "trusted":
Trusted extensions can be run by any user who has CREATE privilege on the current database. Extensions that are trusted are identified as such in the sections that follow. Generally, trusted extensions are ones that cannot provide access to outside-the-database functionality.
--
-- Can workaround this using the TRANSLATE() function, but this is messy!
--
-- see https://stackoverflow.com/q/13596638/470530
--
CREATE EXTENSION "unaccent";
and
--
-- Can workaround this using the UPPER() function, not too bad!
--
CREATE EXTENSION "citext";
If you cannot install extensions, see the workarounds for other ideas.
Caveats for UNACCENT
:
This (see snippet in fiddle):
--
-- Works for the last three variants of Æ, but not the first two!
--
SELECT
UNACCENT('Ǣ/ǣ, Ǽ/ǽ, Æ̀/æ̀, Æ̂/æ̂ and Æ̃/æ̃'), -- failing chars not found in unaccent.rules
UNACCENT('ḃ, ċ, ḋ, ḟ, ġ, ṁ, ṗ, ṡ, ṫ'); -- all found in unaccent.rules
result:
unaccent unaccent
Ǣ/ǣ, Ǽ/ǽ, AE/ae, AE/ae and AE/ae b, c, d, f, g, m, p, s, t
only partially works - it also partially fails on my laptop Windows 2019 server.
This is probably due to the dictionary - see here.
A more complete example, which is directly useful for most European languages, can be found in unaccent.rules, which is installed in $SHAREDIR/tsearch_data/ when the unaccent module is installed. This rules file translates characters with accents to the same characters without accents, and it also expands ligatures into the equivalent series of simple characters (for example,
Æ
toAE
).
The interested reader is invited to investigate further but it's beyond the scope of this answer. Personally, I'd never even seen the failing characters before tackling this answer - the ligature yes, but accented, no!
We now change the surname
's column type to CITEXT
:
ALTER TABLE t
ALTER COLUMN surname
SET DATA TYPE CITEXT;
We now ALTER
the table again so as not to allow any digits (I've yet to see a surname with digits) in the surname
field and also disallow any non-valid punctuation characters - see here and here for the use of $$
to escape quotes of whatever sort and increase legibility.
I used a regex (regular expression - see here and here) - if you don't know regexes, go here - quick start here (helpful).
--
-- First, make sure that puncuation symbols that are not valid for names
-- and digits aren't allowed at all - so, in this case we disallow certain characters. For example, hyphen, space and quotation marks are valid!
--
--
-- Note the `\` (backslash) before characters full stop (`.`), open and close square
-- bracket (`[]`), before open and close parentheses (`()`) and backslash itself (`\`)
-- but not `$`, `^` or `?` which are also regex meta-characters - this involved lots of
-- testing!
--
ALTER TABLE t
ADD CONSTRAINT no_punct_no_digit_ck
CHECK (NOT REGEXP_LIKE(surname, $$[_#=0-9@#$.\[\]?<>^/(){}~|\\]$$));
Regex explained:
starting and ending square brackets ([
, ]
) - these are "meta-characters, i.e. they have a function within a regex - they specify a "character class" - a group of characters that we wish to identify.
the characters in between the starting and ending square brackets - i.e. _#=0-9@#$.\[\]?<>^/(){}~|\\
- these are the characters that we wish to single out as not being acceptable in a surname
. Note that some of these are themselves regex meta-characters and hence have to be escaped using the backslash (\
) character.
Notice that there are no quote characters included in the character class.
On running this SQL, you may be told that you already have some names which breach the constraint - you'll have to edit these by hand!
Did a lot of testing (see here) - quite why backslash (\
) is required for some regex meta-characters and not others is a mystery to me!
But, as you'll see from the testing snippets, this allows surname
s with just one single exclamation mark as a valid surname
(same for just a single letter), so we add another criterion to our CHECK
(after dropping the original CONSTRAINT
- see fiddle).
I know of no surnames that are one character long, but there are Asian surnames (e.g. Li
, Ng
) which have two characters, so we do the following by modifying our original constraint:
--
-- Now ensure least two letters
--
ALTER TABLE t
ADD CONSTRAINT no_punct_no_digit_ck
CHECK ((NOT REGEXP_LIKE (sname, $$[_#=0-9@#$.\[\]?<>^/(){}~|\\]$$)) AND
(( REGEXP_COUNT (surname, $$[[:alpha:]]$$, 1) >= 2 )));
Regex explained:
[:alpha:]
- a character class which matches any alphabetical characters. So, if the count of alphabetical characters isn't at least 2, then the CHECK
becomes FALSE
and any INSERT
fails - see fiddle for brief test.Now, we see about our O'Brien
string - and variants.
INSERT INTO t (surname, symbol) VALUES -- see https://typographyforlawyers.com/straight-and-curly-quotes.html
-- Also, see https://stackoverflow.com/questions/12316953/insert-text-with-single-quotes-in-postgresql/12320729#12320729
-- for dollar quoted strings
($$O'Brien$$, 'Straight single quote'),
($$O"Brien$$, 'Straight double quote'),
($$O‘Brien$$, 'Opening single quote'),
($$O’Brien$$, 'Closing single quote'),
($token$O“Brien$token$, 'Opening double quote'), -- note - $token$
($$O”Brien$$, 'Closing double quote'),
($$O”Br-ie-n$$, 'Hyphens'),
($$O”Br i e n$$, 'Arbitrary different spaces'),
($$!O!Br!i!en!!$$, 'Exclamation mark possible!'),
--
-- Sample accents - impossible to test exhaustively, see above
--
($$O'Bríen$$, 'Acute accent on i' ),
($$O'Brièn$$, 'Grave accent on i' ),
($$O'Briuç$$, 'Cedilla on c' );
all INSERT
s work smoothly - we check (SELECT * FROM t;
) - see fiddle.
Now, if we want to search for anybody called any form of ... O'Brien..., a naïve first take might be something like this:
--
-- Tilde (~) is the case sensitive regex match operator - matches mixed-case
-- here because the surname field is now CITEXT!
--
SELECT *
FROM t
WHERE surname ~ '^.*BrIe.*$';
Regex explained:
^
) symbol is a marker for the beginning of the search string..
) can mean any character*
(asterisk) - means the previous thing - a dot, any character - 0 or n times - the .*
could be .{0}
, see regex cheat-sheet and fiddleBRIE
is the string literal 'BRIE' - just normal characters to search for.*
(anything)$
) sign is a marker for the end of the search stringBut! - result:
id sname symbol
2 O'Brien Straight single quote
3 O"Brien Straight double quote
4 O‘Brien Opening single quote
5 O’Brien Closing single quote
6 O“Brien Opening double quote
7 O”Brien Closing double quote
We're missing names that contain spaces - which are common enough, and names missing hyphens - again not unheard of, and also any names containing exclamation remarks - rarer, but still valid as discussed above.
We're also missing names that contain the various accents which are common enough in Irish names, not to mention in French, German and many other languages.
There is a further disadvantage to this approach in that your customer-facing agents will have to be expert in regexes - not exactly a common skill amongst non-IT savvy office staff.
So what we can do is to create a search field using PostgreSQL's GENERATED
columns as follows:
ALTER TABLE t
ADD COLUMN
surname_search CITEXT -- also CITEXT!
GENERATED ALWAYS AS
(
REGEXP_REPLACE(UNACCENT(surname), '[^[:alpha:]]', '', 'g') -- 'g' for global!
) STORED; -- has to be STORED - no VIRTUAL, i.e. calculated on the fly, columns yet!
Problem! the result of running this query:
ERROR: generation expression is not immutable
Again, this is beyond the scope of my efforts at an answer here, (but you can look here and here if you're interested), however (check the fiddle), there are functions which can circumvent this problem.
After running the function definitions, rerun the ALTER TABLE ADD COLUMN...
command from above - works this time!
Regex explained:
[]
- first set of square brackets - character class as before^
- Here, the caret character is not the start of the line, rather it is the negation operator - i.e. anything not in the character class for the outer square brackets.[:alpha:]
- anything alphabetic - so this regex replaces anything that's not alphabetic with the empty string! Since this is done only once on data-entry, it's not a big overhead! Works for all alphabets, not just Latin!So now, your app/interface/agents only have to search against a string like "%BRiEn%"
or "%bri%" - i.e. any combination of upper and lower case letters that match a substring of the user's surname
. The %
(percentage) character is one of the LIKE
operator's wildcards - it matches 0 or many characters. The other wildcard is _
(underscore) which matches one and only one character.
p.s. +1 for a question that a) made me think and b) brought back some memories!
I have used the io.scket library like this solation sugested to transfer files in my program.. I just realized that this approach only works with localhost not via remote client (local network) .after days and days of coding . Can anybody please knwo how to make this code works in local network.
Try pip install --upgrade vtk==9.4.1
.
If that don't work try pip install --upgrade vtk==9.4.0
If that also don't work try pip install --upgrade vtk==9.3.1
If even that don't work than try pip install --upgrade pyvista
.
There is a GitHub repo that extends Oaxaca to nonlinear models with or without survey weighted data. See,
https://github.com/DanAPowers/Multivariate-Regression-Decomposition
I got the solution, I found the problem was the extension (Torrent Scanner) in my browser, it refreshed the page and caused the duplication of output objects shown in the console...
This problem occurs when your data table has boolean as the real words such as “true” or “false” because that format is inappropriate for mysql. Mysql only recognizes boolean as 1 and 0 where 0 = false and 1 = true. There are two solutions for that situation. 1. You can upload your dataset in a spredsheet and replace all the values "false" and "true" with 1 and 0. 2. While uploading data into dbeaver just change the type from boolean into any other string type.
Here are a few links that helped support an understanding git-lfs and properly cloning repos with git-lfs. These all aided me to clone several repos on Github that contained binarys and provide a good context of the technology. I use git daily but had never had the need for git-lfs.
Detailed S.O. post clarifying git-lfs commands and their git equivalent.
CodeThink Article that discusses the speed issues when handling large volumes of data (amongst other important items).
Barae muraqba (surgeries based world wide abroad)
Muraqba needed (medical surgeries/equivalent), abroad.
Turns out throttle()
from lodash was the correct way to go. To solve this problem I ensured that the options for the trailing edge were set to false:
const handleClick = _.throttle(
(index: number) => {
if (active === undefined) {
setActive(index);
return;
}
setActive(undefined);
},
200,
{ trailing: false },
);
I don't know xml. I do know html and js, though. Like one that blocks users from an element's inner html.Object.defineProperty(Element.prototype,'innerHTML',{ get:function(){console.error('Object depricated.')}
Check https://stackoverflow.com/a/61252423/18516611
TL;DR remove mysql-connector-python
and run pip install mysql-connector-python
transfer_event = { "type": "event", "name": "initiateHandoff", "from": { "id": "1234", name: "me" } }
maybe don't put double quotes around the variable "name" like the example above I know this because I also used have this problem tel me if you still need help
I also have the same question!
Did you manage to solve it? some problem!
I think there's a lot of commonality between App Settings and Environment Variables. According to this GitHub Issue, wrapping the whole setting in quotes works for environment variables so might be worth a try.
I got round this by adding an OnKeyPress event to the data grid and forcing the dataset .Post
for the return or tab key, which were effectively exiting the cell anyway.
if (ord(Key) = VK_RETURN) or (ord(Key) = VK_TAB) then
ClientDataSet.Post;
You'd have to loop it:
$('.menu_item_wrap').each((index, item) => {
item.style.setProperty('border-top', '1px solid #E7E7E7', 'important');
});
After some checking, with sc query, we realized that if we started the questioned service in the remote server FROM the remote server, it appears listed when a sc query was done in the local server. So, we tried to do the remote star, but not using quotes for the name of required service and works.
I found that skipping the index can actually help in this case.
select count(*) from "default" NOT INDEXED
> CPU times: user 637 ms, sys: 2.16 s, total: 2.79 s Wall time: 11.3 s
Is still slow, but I get and improvement from 28s to 11s
It looks like there is a typo in your user.signinkey
parameter name - It seems like it should be user.signingkey
.
git config --global credential.credentialStore dpapi and after that type git push command . It works for me. along with Delete the existing git credential in Windows Credential Manager.
So far none of these answers have helped. I'm excluded from the sudo group and any edit I make to sudoers produces a syntax error.