There is now Aside, an unofficial Google library for adding type support, linting and unit testing to Apps Script using TypeScript, ESLint, Prettier, and Jest.
Note that as far as I can tell, to run tests in Jest on functions which remotely execute Google Apps APIs (even things like SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Home").getRange("A1").getValue()
), you would need to:
clasp run <test_function>
(see this documentation on clasp run
and this SO post on calling command line functions from node) and then write assertions against the output.git remote update --p
or git remote update --prune
Is a solution.
I migrated from a bare native project and removing this line solved it for me:
NativeModules.DevSettings.setIsDebuggingRemotely(true)
It must not play nicely with Expo
There are literally 36 executables installed by this god forsaken installer I have no idea how to use any of them, and can't find any information. Damn you all.
FastCGI running concurrent processes without terminating them, so the performance will be optimized. But it has some config to avoid memory leak. If for some requests your program works fine and not facing 500 error all the times, i suggest you check the pm configuration of fastcgi:
Note
This is what help me fix my own
const CustomToolbar = ({date, onNavigate}: ToolbarProps) => {
const goToBack = () => {
onNavigate('PREV'); }
const goToNext = () => {
onNavigate('NEXT');
};
return (
<div className='rbc-toolbar'>
<PrimaryButton onClick={goToBack} style={{marginRight: "5px"}} text='Previous'/>
<DefaultButton onClick={goToNext} style={{marginRight: "5px"}} text='Next' />
<DatePicker />
</div>
)
}
another variant (using GNU Awk 5.0.1) Handles standard ascii and dos formatted records
cat pablo.awk
{ gsub("\r",""); k[$1" "$2] = k[$1" "$2] + 1 }
END{
for (ki in k)
if ( k[ki] > 1 )
print ki
}
# running that produces
awk -f pablo.awk input
u 8574
You can do that now with @view-transition. See the example which is also linked to from the before mentioned page: https://mdn.github.io/dom-examples/view-transitions/mpa/
What you've done already works, if you dont have a i tag, the query will be empty and not have the class, if it exists it will check the class.
But any ways, if you want to check the tag, or any other query selector, the jquery method is .is( "i" )
Ah, I just realized that there is a typo. It should be cachedResponse.json(), instead of cacheResponse.json(). Silly me.
Please close this question.
Following @BenjaminW's advice I simply moved the Sphinx docs to a subfolder of the MyST docs. I managed this with github actions (doing edits upon the one generated by myst).
The key was to remove the artifact uploads from the initial workflow then replace it with some linux commands for moving everything to the _site
directory and uploading the _site
directory as an artifact. Namely
- name: Copy builds to site-directory
run: |
mv _build/html _site
mv docs/_build/html _site/docs
mkdir _site/nb
mv nb/public _site/nb/public
- name: Upload Site Artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./_site
Here's the complete file:
# This file was created by editing the file created by `myst init --gh-pages`
name: MyST and Sphinx GitHub Pages Deploy
on:
push:
branches: [main]
env:
# `BASE_URL` determines the website is served from, including CSS & JS assets
# You may need to change this to `BASE_URL: ''`
BASE_URL: /${{ github.event.repository.name }}
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: 'pages'
cancel-in-progress: false
jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v3
- uses: actions/setup-node@v4
with:
node-version: 18.x
- name: Install MyST Markdown
run: npm install -g mystmd
- name: Build MyST HTML Assets
run: myst build --html
- name: Install Sphinx and Dependencies
run: |
pip install sphinx sphinx-autodoc2 furo myst_parser
- name: Sphinx Build HTML
run: |
(cd docs && make html)
- name: Copy builds to site-directory
run: |
mv _build/html _site
mv docs/_build/html _site/docs
mkdir _site/nb
mv nb/public _site/nb/public
- name: Upload Site Artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./_site
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
From my experience, it does not make much sense to check the Mock of an object. That way you are checking if the framework actually works instead of any functionality (as Andrew S). In short, sure you can use it but it is just redundant code (I never use it). Also, I took a look at the website that you referenced and I think the AssertNotNull is used as a poor example there.
I realized I should set the number of batch dimensions to 1. This now works:
import tensorflow as tf
V=tf.random.uniform((2,3,4),minval=0,maxval=2,dtype=tf.int32)
print(V[0,:])
W=tf.random.uniform((2,5), minval=0, maxval=4, dtype=tf.int32)
print('W=',W)
Z=tf.gather(params=W, indices=V, axis=1, batch_dims=1)
print(Z.shape)
The shape is (2,3,4), as desired. Simple in the end, but a pain to figure out!
As suggested by Murta previously, BigQuery's TRANSLATE function is very handy and allows you to do exactly what you need to. https://cloud.google.com/bigquery/docs/reference/standard-sql/string_functions#translate
SELECT TRANSLATE('brasília', 'í', 'i') AS translated
RANDOM() will generate random floats and multiply it with dates across last 3 years
UPDATE events
SET created_at = created_at - INTERVAL '3 years' * RANDOM();
This installation conflict could be due to development-version (installed during development/debugging) are signed differently from the Play Store version.
To resolve it:
This will eliminate any signature mismatches.
This should do the work
*::after,
*::before {
outline: 1px solid red;
}
I believe that this is equivalent to what you are looking for:
git checkout better_branch # This is the branch whose commits you want to keep
git merge --strategy=ours master # keep the content of this branch, but record a merge
git checkout master # You want to **lose** all changes on this branch
git merge better_branch # fast-forward master up to the merge
Look at this other post, you will need to download them via ftp. https://wordpress.stackexchange.com/questions/87395/import-media-to-online-wordpress-from-local-development
OR, look for an export plugin that adds the media attachements into a zip file.
remove the limits = c(0, 360)
since 0 and 360 will overlap:
library(ggplot2)
wake_loss_per_sector <- data.frame(
sector = 1:12,
wake_loss = c(16.48843, 17.59385, 19.19244, 27.17434, 26.13185, 10.95055,
11.09595, 14.24783, 15.59619, 19.09893, 22.63984, 15.84240),
angle = c(30, 60, 90, 120, 150, 180, 210, 240, 270, 300, 330, 0)
)
# Plot
ggplot(wake_loss_per_sector, aes(x = angle, y = wake_loss)) +
geom_col(width = 30, fill = "skyblue", color = "black") +
coord_polar(start = -pi / 12) +
scale_x_continuous(
breaks = seq(0, 330, by = 30)
) +
theme_minimal() +
labs(x = "Angle (degrees)", y = "Wake Loss", title = "Polar Plot of Wake Loss by Sector")
You should override:
isDense: true
and
suffixIconConstraints: const BoxConstraints(minHeight: YOUR_DESIRED_MINIMUM_HEIGHT)
The problem was in the setData function of my PandasModel. I was using values instead of iloc.
self.data_frame.iloc[index.row(), index.column()] = value
in my case, i have some dependencies missing running npm install metro metro-config metro-core --save-dev works for me
In my project folder that contains 89 files. I created a new file called unused.py In that file I put the following:
# Why can't I find a tool that detects this file is not used ?
#
print("Nothing")
Vulture did not find this file.
For me, simply recompiling kaldi and vosk like in the Dockerfile of Vladimir link did the trick, don’t use the gpu fork branch but the main vosk.
For everyone who's comes from Google search result and I couldn't find the answer anymore here it's
If you want to still build it as root, then disable sanity check in the file :
meta/conf/sanity.conf
comment this line like this:-
#INHERIT \+= "sanity"
In the end, it looks like calling load() on book works when you specify the chapter in it, as follows: const content = await book.load(item.href);
Hope that helps someone.
Old answer, old mistake. I2C has several speed modes: Standard-mode (100kbps), Fast-mode (400kbps), Fast-mode Plus (1Mbps), High-speed mode (3.4Mbps) and Ultra-Fast mode (5Mbps).
UM10204 I2C-bus specification and user manual Rev. 6 - 4 April 2014, section 3.2 (page 23-64) Explains about Ultra-Fast mode, ok? 2014!
So, telling someone to give up a project, being unfamiliar with a subjec or having no or limited knowledge of a topic, that's stupid!
Today, basically all cellphones comunicates in I2C with all modules, even the camera!
I'm using the Supabase connection pooler and was able to resolve this issue by increasing the Pool Size
(Settings > Database > Connection Pooling Configuration). Default value for my project was 15, and stopped having this issue after increasing to 48.
From this answer, for doing this from application.properties
, you can add the following entry:
logging.pattern.console= %-5level %logger - %msg%n
This will remove the timestamp from your logs.
Make sure you're using a compatible version of TypeScript.
Angular: 18.1.x || 18.2.x
TypeScript: >=5.4.0 <5.6.0
Source: https://angular.dev/reference/versions#actively-supported-versions
Have you used correct resource type in your ARM template?
If some dependency failed because it requires a different version, try:
rpm -i --nodeps somepackage.rpm
convert image fom YUV to nv21 in Android and to bgra8888 in IOS.
Per the error this isn't possible. You can only accept and return single objects per row, your object can be arrays/seqs but you cannot use dataframes at all in UDFs, the spark session does not exist on executors. It may run locally but will fail when run on a non local relation.
Try right-clicking on the .csproj. Choose Properties. Then uncheck 'Transform project properties into assembly attributes during build.' Also uncheck 'Enable implicit global usings to be declared by the project SDK.'
Finally I found an answer. It is simple, but not mentioned anywhere...
Just open xcode project file in any editor and instead
shellScript = "cd \"$SRCROOT/..\"\n./gradlew :composeApp:embedAndSignAppleFrameworkForXcode\n";
put
shellScript = "";
You can do the same via xcode UI, but it is much quicker to do it this way.
This script is a leftover existing there due to direct integration (that is in all samples by default): https://kotlinlang.org/docs/multiplatform-direct-integration.html
After I searched lots of questions in stackoverflow I get the solution. I changed these parts of code:
ElevatedButton.styleFrom(
backgroundColor: result ==
AppLocalizations.of(context)
?.truth_answer &&
selectedOption == option
? Colors.red
: result ==
AppLocalizations.of(context)
?.wrong_answer &&
selectedOption == option
? Colors.blue
: result ==
AppLocalizations.of(context)
?.wrong_answer &&
currentQuestion["answer"]
as String ==
option
? Colors.red
: Colors.blue),
with these code:
ButtonStyle(
backgroundColor: WidgetStateProperty.resolveWith<Color>((states) {
if (result == AppLocalizations.of(context)?.truth_answer && selectedOption == option) {
return Colors.green;
} else if (result == AppLocalizations.of(context)?.wrong_answer && selectedOption == option) {
return Colors.blue;
} else if (result == AppLocalizations.of(context)?.wrong_answer && currentQuestion["answer"] as String == option) {
return Colors.green;
} else {
return Colors.blue.shade200;
}
}),
),
Like this? I assume, hopefully, that he meant 12 points. I added a step from 0 to 360 by 30. However it just draws the same 3 triangles from different points.
from graphics import *
from math import *
def ar(a):
return a*3.141592654/180
def main():
x0 = 100
y0 = 100
stepangle = 120
radius = 50
win = GraphWin()
for startangle in range(0,360,30):
p1 = Point(x0 + radius * cos(ar(startangle)), y0 + radius * sin(ar(startangle)))
for i in range(stepangle+startangle,360+stepangle+startangle,stepangle):
p2 = Point(x0 + radius * cos(ar(i)), y0 + radius * sin(ar(i)))
Line(p1,p2).draw(win)
p1 = p2
input("<ENTER> to quit...")
win.close()
main()
I've written a package to handle this: repeat-todo. It supports weekdays, weekends, and custom combinations of days:
* TODO Water the flowers
SCHEDULED: <... ++1d>
:PROPERTIES:
:REPEAT: weekdays
:END
* TODO Go for a walk
SCHEDULED: <... ++1d>
:PROPERTIES:
:REPEAT: weekend
:END:
* TODO Get the mail
SCHEDULED: <... ++1d>
:PROPERTIES:
:REPEAT: M W F
:END:
The key methods are:
(defun repeat-todo--parse-property (prop-value)
"Return repeating days for PROP-VALUE as list of day numbers (sun=0, mon=1, etc)."
(let ((case-fold-search nil))
(cond
((string-match "weekday\\(s\\)?" prop-value)
'(1 2 3 4 5))
((string-match "weekend\\(s\\)?" prop-value)
'(6 0))
(t
(let ((repeat-days '())
(prop-values (string-split " " prop-value 'omit-nulls)))
(dolist (value prop-values)
;; su, sun, sunday
((when (string-match "^su\\(n\\(day\\)?\\)?")
(push 0 repeat-days)))
;; m, mon, monday
((string-match "^m\\(on\\(day\\)?\\)?") (push 1 repeat-days))
;; t, tue, tues, tuesday
((when (string-match "^t\\(ue\\(s\\(day\\)?\\)?")
(push 2 repeat-days)))
;; w, wed, wednesday
((when (string-match "^w\\(ed\\(nesday\\)?\\)?")
(push 3 repeat-days)))
;; r, thu, thur, thurs, thursday
((when (or (string= "r")
(string= "R")
(string-match "thu\\(r\\(s\\(day\\)?\\)?\\)?"))
(push 4 repeat-days)))
;; f, fri, friday
((when (string-match "^f\\(ri\\(day\\)?\\)?")
(push 5 repeat-days)))
;; sa, sat, saturday
((when (string-match "^sa\\(t\\(urday\\)?\\)?")
(push 6 repeat-days))))
(reverse repeat-days))))))
(defun repeat-todo--next-scheduled-time (current-scheduled-time weekdays)
"Return the next valid, by WEEKDAYS, time after CURRENT-SCHEDULED-TIME.
WEEKDAYS: See `repeat-todo--weekdays'."
(when weekdays
(let ((new-scheduled-time
(time-add current-scheduled-time (days-to-time 1))))
(while (not
(member
(string-to-number
(format-time-string "%u" new-scheduled-time))
weekdays))
(setq new-scheduled-time
(time-add new-scheduled-time (days-to-time 1))))
new-scheduled-time)))
(defun repeat-todo--reschedule (point-or-marker)
"Reschedule heading at POINT-OR-MARKER to the next appropriate weekday."
(when (and repeat-todo-mode
(org-entry-is-done-p)
(repeat-todo--p point-or-marker))
(org-schedule
nil
(string-replace
" 00:00" ""
(format-time-string
"%F %H:%M"
;; Schedule to the day before the next schedule time because
;; it'll get moved forward one day past when we schedule it
(time-subtract
(repeat-todo--next-scheduled-time
(org-get-scheduled-time point-or-marker)
(repeat-todo--parse-property
(or (org-entry-get point-or-marker repeat-todo--property) "")))
(days-to-time 1)))))))
To piggy back off of @palash-toshniwal:
I was not able to get the attachment to not show in the inbox but to avoid the "download" and "add to drive" options in gmail when hovering the image while reading the email, I simply wrapped the <img />
tag with a <a href="yourURL">
tag.
<a href="yourURL">
<img src="cid:logo2" />
</a>`
Yes, we encountered the same issue on our platform under high load with cache tags being created and flushed in queues.
We’ve turned off the cache on the high load query (after making sure it was indexed correctly).
Interesting to note, the latest Laravel docs say not to use cache tags with redis. We’re going to move our cache to Memcached.
Add c## before user name like
create user c##username identified by password;
If you want it to always automatically reveal the currently opened file in the Project sidebar, you can go to the Project panel, click the ... menu then Behavior -> Always Select Opened File
min-height: max-content;
combined with overflow: hidden;
solved the problem for me
For future people looking for answer. My solution was to remove the response header Content-Disposition
which had been set to attachment; filename=...
.
Together with Content-Type
as application/pdf
, the file is now showing in the new tab.
I am new too, trying to learn this stuff as well. Right now I am learning about javascript, in fact we only did codes in javascript to do this kind of stuff.
You can do it in CSS, but it is not recommended. You should try watching some basic javascript codes to get wanted result.
Make the class that you want to target with javascript, in your CSS and you will get a clean CSS with a nice button function.
I'd really upvote your question, but I can't since i do not have the reputation for it yet, but from my personal experience, this website is not welcoming new people trying to learn. You'll meet a bunch of old farts here, trying their best to say anything to sound smart, but not answer your question. Expamle - How to ask your question, fix your punctuation and shit... So, better go on reddit or youtube if you want your answers.
P.S. Respect for the guys who actually are trying to help you, as I've seen here in the replies.
were you able to figure out how to get global decorators on an HTML Storybook project? I am having issues and was wondering if you were successful. Thank in advance for your feedback.
npm init playwright@latest
This helped me too.
I had been experiencing this issue myself on and off for a while until I toggled off the 'Run Debugger in Server Mode' option for the PyCharm debugger in settings.
I just ran into this myself, and I don't know if this information is still relevant for you, but I'm still posting in case someone else finds it useful.
I tried to execute a script that implements Cyberark, called it from within the containing folder as such:
cd /containingFolder
bash script.sh
and got that same error... But when invoking it as such:
bash /containingFolder/script.sh
The script ran with no errors.
This is due to Cyberark's "autorized path" policy. I went into the dashboard and realized that /containingFolder/ was an authorized path for my Cyberark installation, meaning other scripts outside this path, are NOT authorized to invoke Cyberark implementations. And this is why it must be called with an absolute path every time.
You need to add the NuGet packages that provide these models. They aren't included by default in netstandard2.0
like they were in Framework4.X
You'll need access value first
{% assign metafield_value = app.metafields.namespace.key.value %}
Then, get json value as needed
{{ metafield_value.car.color }}
Or access directly if you don't wanna use variables
{{ app.metafields.namespace.key.value.car.color }}
You need to have runat="Server"
in your control:
<select name="par_num" id="par_num" title="par_num" runat="Server" style="width:100%;">
React tracks hooks in a specific order during each render of a component using a linked list of hooks tied to the component.
Conditional rendering of components does not interfere with state because each component's state is tracked independently via its node.
When a component is unmounted, React removes the component (and its associated state) entirely from its memory, and remounting creates a new component instance with fresh state.
In my case I imported the Response Body annotation from wrong source. I imported from swagger instead of Spring Framework and it created all the problem. I re-imported from Spring Framework and it worked.
I have a problem with tax information, I am not in company, I am using it for learning purposes, so I have no tax information to give, but I can not proceed without it
To take this one step further and be able to unfollow a mass list of work items: (I also taught chatgpt to do this, so hopefully it learns for others).
On the Boards menu - select work items. Then from the drop down in the upper left, select 'follow'. Using the filter, filter to the list of work items that you want to unfollow. Then select the upper left radio button to mass select all records, then click on the 'Open filtered view in queries. Using shift, select all records. Click the 3 dots button on one of the work items, select 'Unfollow'
You can also use Pasify , its a password/secret management app , specially designed and developed for developers and tech professionals.
Is it possible to program specific URL within websites into another URL? For example a specific twitch channel into another channel. If so, is that possible in caso of raids when the URL is filled automatically?
As for the field C to be not updating, you might want to explicitly reference the field\_c
in the field\_a
that is still UNNEST, you can try to update below:
from
"@var\_b" AS field\_b,
field\_c AS field\_c
to
"@var\_b" AS field\_b,
a.field\_c AS field\_c
curti desta vez é inedito os fatos corrigidos
after trying more than one solutions (all does not work). i just restart my router device and it is work.
A late reply to this thread but I'm facing the same issue. To set something with SNMP, I need to put in an OctetString with BITS Syntax. This are the possibilities:
BITS {interface1(0),
interface2(1),
interface3(2),
interface4(3),
interface5(4),
interface6(5),
interface7(6),
interface8(7)
}
And combinations are possible. I don't know how to set only interface5 or interface2, interface3 and interface5 together or how to set all of them together.
Can someone help me, please?
Thank you
The TextInput tag is self-closing. If you add a closing tag beneath it, this can cause issues with the placeholder and other functionalities. Try removing the closing tag from your code.
I have a workaround for Obsidian and potentially other apps, since I have the same issue: if you're using the Flatpak version, you can disable Wayland (Wayland Windowing System, Inherit Wayland Socket) in Flatseal, which gets pen support working for the most part.
The only issue with the above is that some drag and drop stuff no longer works, and if the display scale isn't set to 100% the pen cursor is kinda off in things like Excalidraw (but still draws correctly)
If you install some of the other applications as flatpaks too, doing the same to those might work as well.
Do you try to check cache if it has been cache then make all fields assign to the cache and then make them readonly after assign i don't try it but in logic I think it will be right
Use (and star) this cross-browser library: https://github.com/xitanggg/node-selection
Yes, the code provided disposes of resources correctly by utilizing the using statement for SqlConnection, SqlCommand, and SqlDataAdapter objects. The using statement ensures that these objects are disposed of properly even if an exception occurs.
The DataSet is returned without needing explicit disposal as it will be garbage collected once it goes out of scope.
Since you are trying to parse config, you might also consider using pydantic-settings module instead of just pydantic. However, if all of your configuration is coming from YAML, this doesn't make a lot of sense.
Have you found any solution yet?
Sorry for bad writing style, its my first time to use stack overflow.
No. This is not how it works. Route table only routes (directs) traffic according to rules. A routing table is analogous to a distribution map in package delivery. Whenever a node needs to send data to another node on a network, it must first know where to send it. That's what a route table does. In order to control the ingress (TO) and egress (FROM) traffic you set up security groups and NACLs. That's the layer you need to focus on.
I would still to double check: this comment is trying to explain that "Route table is not used for traffic control". However, can we say that:
Setting: There is a VPC, Alice, we are using (local), and another VPC, Bob, we try to connect to.
Statement1: If Bob is not in the route table attached to Alice regardless of other resources/services such as security group etc, then Alice cannot direct traffic, or in plain words cannot send message, to Bob.
Statement2: Even if Bob is not in the route table attached to Alice, but correctly configuring other resources/services, Alice is still possible to receive message from Bob.
Are the statements right or wrong? If it is wrong, why is it? Or if the statement itself is wrong depicted, what is it?
myFinalCode:
Public Function func_1() As Double
'MS Access module
Dim xlapp As New Excel.Application
Dim wkb As Excel.Workbook
Dim wks As Excel.Worksheet
Dim arg1 As Double
Set xlapp = CreateObject("Excel.Application")
xlapp.Visible = True
Set wkb = xlapp.Workbooks.Open("C:\Book1.xlsm")
arg1 = 100
xlapp.Run "func_2", arg1
'Thank you all very much!
End Function
I have created 2 simple Python scripts that:
No need to install pandoc
or any other package.
https://gist.github.com/fabiog1901/d6a41c4416eefe49c372f11cab2b2084
VBA is not supported by the New Outlook.
This was fixed by stylelint/stylelint#5835 in version 14.3.0.
Short answer: Yes, it is possible to prevent screenshots of PDFs by using advanced DRM tools like VeryPDF DRM Protector https://drm.verypdf.com/online/ . This software blocks all known screen capture methods, including disabling the "Print Screen" key and preventing tools like SnagIt and the Windows Snipping Tool. It also adds dynamic watermarks with user-specific details to discourage unauthorized sharing and uses military-grade encryption to restrict access. These features make it ideal for protecting sensitive content, such as eBooks, from piracy while maintaining a seamless user experience.
One way is to normalize the data. You can read about it here: https://redux.js.org/tutorials/essentials/part-6-performance-normalization#normalizing-data
Another way is to use shallowEqual
. https://react-redux.js.org/api/hooks#equality-comparisons-and-updates
// (1)
import { shallowEqual } from 'react-redux';
import { MyEvent, getEventsByUser } from './state/events.slice';
import { useAppSelector } from './state/hooks';
export function EventsRow({ user }: { user: string }) {
console.warn('Events Row rendered for user: ' + user);
const events: MyEvent[] = useAppSelector(
(state) => getEventsByUser(state, user),
// (2)
shallowEqual
);
return (
<div id={`user-${user}`}>
{events.map((x) => (
<div>{x.title}</div>
))}
</div>
);
}
Finding it's a data issue and that while Glue is defining the column as a timestamp and Athena can query it the structure of the data won't allow Redshift to read it. If the data is converted as a 'date' in Glue it comes through to Redshift without issue.
As it turns out, I was doing this kind of wrong. I should have been using a hooks.server.ts
file first of all. Hyntabyte explains it well in this YouTube video: https://www.youtube.com/watch?v=K1Tya6ovVOI
Essentially, we should be doing the auth check in the hooks.server.ts
file, then passing whether or not it is authenticated using Locals. That way, you can access it through locals in each +page.server.ts
file to determine if the user is authenticated or not.
Another issue I was running into later was that I needed to forward to cookies to SvelteKit. I keep trying to set it using event.cookies
, but it should have been event.request.headers.get
like this:
import type { Handle } from '@sveltejs/kit';
import { API_URL } from '$lib/config';
export const handle: Handle = async ({ event, resolve }) => {
const cookies = event.request.headers.get('cookie') || '';
const response = await fetch(`${API_URL}/api/auth/status`, { # my endpoint for checking auth status
credentials: 'include',
headers: {
'X-Requested-With': 'XMLHttpRequest',
Cookie: cookies
}
});
const data = await response.json();
event.locals.isAuthenticated = data.isAuthenticated;
event.locals.user = data.user;
return resolve(event);
};
Finally, I also had issues with CORS. I needed to run my Django server using python manage.py runserver localhost:8000
to prevent it from defaulting to 127.0.0.1:8000
. I also needed to have these in my settings.py
file:
CSRF_COOKIE_SECURE = True
SESSION_COOKIE_SECURE = True
CSRF_COOKIE_SAMESITE = 'None'
SESSION_COOKIE_SAMESITE = 'None'
I was practicing the first examples of input, and them I skipped to the if, else and for loops.
The whole example contains two files.
First file is sayhi.py:
name = input('What is your name?\n')
print('Hi, %s.' % name)
print('Welcome to Python.')
quest01 = input('Do you like it? Y/N\n')
if(quest01 == 'Y'):
print(f"Yeah, {name}!\nI like it too!")
else:
print(f"Oh, {name}.\nToo bad you don't like it!")
The second file is dragonloot.py:
import random
import sayhi
from rich import print
# Inventory and loot
stuff = {
"rope": 3,
"torch": 5,
"gold coins": 47,
"dagger": 2,
"arrow": 13,
"dragon tail": 0,
"legendary weapons": 3,
"girls": 0,
"wolf fangs": 33
}
dragonLoot = ['gold coins', 'dragon tail', 'dagger', 'ruby', 'silver ore', 'girls']
# Function to display the inventory with styles
def displayInventory(inventory):
# Title
print("[bold yellow]\nYour inventory, right now:[/bold yellow]\n")
# Header
print("[bold cyan]{:^18} {:>5}[/bold cyan]".format("Item", "Count"))
print("[blue]" + "-" * 24 + "[/blue]")
# Inventory items
total_items = 0
for item, count in inventory.items():
if item == "gold coins": # Style for gold coins
style = "bold yellow"
elif item == "ruby": # Style for ruby gems
style = "bold red"
elif item == "silver ore": # Style for silver ore
style = "bold blue"
elif count > 10: # Style based on item count
style = "green"
elif count == 0:
style = "orange"
else:
style = "white"
# Print the item and count with the style
print(f"[{style}]{item:<20} {count:>3}[/]")
total_items += count
# Footer
print("[blue]" + "-" * 24 + "[/blue]")
print(f"[bold magenta]Total number of items: {total_items}[/bold magenta]")
# Function to add random loot to the inventory
def add_item_to_inventory(inventory, item, min_qty, max_qty):
if item not in inventory:
inventory[item] = random.randint(min_qty, max_qty)
else:
inventory[item] += random.randint(min_qty, max_qty)
# Function to handle adding all loot
def addToInventory(inventory, addedItems, dragon_status):
for item in addedItems:
if item == 'dragon tail' and not dragon_status:
add_item_to_inventory(inventory, item, 1, 1)
elif item == "dragon tail" and dragon_status:
add_item_to_inventory(inventory, item, 0, 0)
elif item == 'gold coins':
add_item_to_inventory(inventory, item, 17, 100)
elif item == 'girls':
add_item_to_inventory(inventory, item, 0, 5)
else:
add_item_to_inventory(inventory, item, 1, 9)
# Function to get the dragon's survival status
def get_dragon_status():
alive = random.randint(0, 1)
if alive:
print("[bold green]\nCongratulations! You've looted the dragon without killing it![/bold green]")
else:
print("[bold red]\nYou've looted the dragon, but you managed to kill it. Shame on you![/bold red]")
return alive
# Function to handle special items like "girls"
def handle_special_items(inventory, item, alive_dragon):
if inventory.get(item, 0) == 1 and alive_dragon:
return "[bold cyan]\nCongratulations! You have a girlfriend![/bold cyan]"
elif inventory.get(item, 0) == 1 and not alive_dragon:
return ("[bold cyan]\nCongratulations! You have a girlfriend ...[/bold cyan]\n"
+ "[bold red]but, she hates you for killing her mom... [italic](yes! the dragon!)[/italic][/bold red]")
elif inventory.get(item, 0) > 1:
if alive_dragon:
return (
f"[bold yellow]\nYou have {inventory[item]} girls?!!\n"
+ "Sorry! But you'll have to manage it! You can keep only one.\n\n"
+ "Suggestion: [italic]dragon snacks...[/italic]\n\n"
+ "What a great way to thank the dragon for your loot![/bold yellow]"
)
elif sayhi.quest01 == "Y":
return (
f"[bold red]\nYou have {inventory[item]} girls! "
+ "Sorry! But you’ll have to manage this mess — you can only keep one!\n\n"
+ "Suggestion: \n[italic]Oh, for crying out loud…[/italic]\n"
+ "You actually killed the dragon, didn’t you?! Unbelievable!\n"
+ "Well, now you’ve got some serious damage control to do.\n"
+ "Find another dragon (yes, a [bold underline]new[/bold underline] one), try not to kill it this time, and\n"
+ "offer girls as a peace offering… Err, I mean, a snack.\n\n"
+ "Go redeem yourself, you [italic]terrible, terrible[/italic] dragon slayer![/bold red]"
)
else:
return (
f"[bold red]\nYou have {inventory[item]} girls! "
+ "Sorry! But you’ll have to manage this mess — you can only keep one!\n\n"
+ "Suggestion: \n[italic]Oh, for crying out loud…[/italic]\n"
+ "You actually killed the dragon, didn’t you?! Unbelievable!\n"
+ "Well, now you’ve got some serious damage control to do.\n"
+ "Find another dragon (yes, a [bold underline]new[/bold underline] one), try not to kill it this time, and\n"
+ "offer girls as a peace offering… Err, I mean, a snack.\n\n"
+ "Go redeem yourself, you [italic]terrible, terrible[/italic] dragon slayer [italic](and programmer)[/italic] - yes, I've noticed you don't like Python...[/bold red]"
)
if sayhi.quest01 == "Y":
return "[bold red]\nSorry! The girl didn't make it alive.[/bold red]"
else:
return "[bold red]\nSorry! The girl didn't make it alive.\n\n[italic]And it's probably because you don't like Python![/italic] SHAME ON YOU![/bold red]"
# Main Execution
alive_dragon = get_dragon_status()
addToInventory(stuff, dragonLoot, alive_dragon)
displayInventory(stuff)
print(handle_special_items(stuff, "girls", alive_dragon))
Output example 1:
What is your name?
Daniel
Hi, Daniel.
Welcome to Python.
Do you like it? Y/N
N
Oh, Daniel.
Too bad you don't like it!
Congratulations! You've looted the dragon without killing it!
Your inventory, right now:
Item Count
------------------------
rope 3
torch 5
gold coins 67
dagger 8
arrow 13
dragon tail 0
legendary weapons 3
girls 4
wolf fangs 33
ruby 3
silver ore 1
------------------------
Total number of items: 140
You have 4 girls?!!
Sorry! But you'll have to manage it! You can keep only one.
Suggestion: dragon snacks...
What a great way to thank the dragon for your loot!
Output example 2:
What is your name?
Daniel
Hi, Daniel.
Welcome to Python.
Do you like it? Y/N
N
Oh, Daniel.
Too bad you don't like it!
You've looted the dragon, but you managed to kill it. Shame on you!
Your inventory, right now:
Item Count
------------------------
rope 3
torch 5
gold coins 142
dagger 7
arrow 13
dragon tail 1
legendary weapons 3
girls 0
wolf fangs 33
ruby 8
silver ore 6
------------------------
Total number of items: 221
Sorry! The girl didn't make it alive.
And it's probably because you don't like Python! SHAME ON YOU!
Output example 3:
What is your name?
Daniel
Hi, Daniel.
Welcome to Python.
Do you like it? Y/N
N
Oh, Daniel.
Too bad you don't like it!
You've looted the dragon, but you managed to kill it. Shame on you!
Your inventory, right now:
Item Count
------------------------
rope 3
torch 5
gold coins 107
dagger 5
arrow 13
dragon tail 1
legendary weapons 3
girls 4
wolf fangs 33
ruby 3
silver ore 6
------------------------
Total number of items: 183
You have 4 girls! Sorry! But you’ll have to manage this mess — you can only keep one!
Suggestion:
Oh, for crying out loud…
You actually killed the dragon, didn’t you?! Unbelievable!
Well, now you’ve got some serious damage control to do.
Find another dragon (yes, a new one), try not to kill it this time, and
offer girls as a peace offering… Err, I mean, a snack.
Go redeem yourself, you terrible, terrible dragon slayer (and programmer) - yes, I've noticed you
don't like Python...
# Train a Linear Regression model
lm_model <- lm(medv ~ ., data = Boston, subset = train)
lm_pred <- predict(lm_model, X_test)
# Evaluate performance
mse_lm <- mean((y_test - lm_pred)^2)
print(paste("MSE for Linear Regression:", round(mse_lm, 2)))
You can try installing it in R instead of RStudio and then use RStudio to run this package!
Solved. My GCP user, the one logged in Firebase CLI with firebase login
, was missing the setIamPolicy. Adding the policy to it and redeploying solved.
you don’t like the performance?
This is one time work or your goal is to insert 50M records every time? Inserting 50m records without committing, is not the best idea you can do with Redo.. Also on which table you have PK? Table1 or Table2? What is the point of having PK on varchar data type column? This kind of a solution might have performance issues, because indexing and lookup operations on varchar columns are generally slower than on numeric columns because string comparison + validation overhead and in long term it will cost you more storage…
So I would recommend to commit after every 10K - 50K records are inserted… Maybe this will help.
You may try with ks_2samp, like the following .. stat, p = stats.ks_2samp(a, b, alternative='two-sided')
Hey @ChrisHaas thanks for the recommendation, what I was able to do is pass it as an array from the second addTag call since the Zendesk function allows arrays or strings so I just changed the shouldReceive call to expect an array and I was able to target that specific call.
In my tests with ldap3 I:
Added the user account without those attributes.
Setted password with:
conn.extend.microsoft.modify_password(user=dn, new_password=pwd, old_password=None)
Setted only userAccountControl
:
conn.modify(user_dn, changes = { "userAccountControl": (MODIFY_REPLACE, [512])})
When I setted pwdLastSet
to zero, as @ElPalomo mention, I can't authenticate user/password.
i did a little reasearch, and no, i would have to implement the logic myslef (thanks @John Gordon) so i will go and suffer now :)
I can confirm that this is an issue with Vercel and Next.js 15.1.0.
Downgrading to Next.js 15.0.4 worked for me.
If the only reason you are subclassing TGroupBox is to create a new style for it and in particular to not show the frame, then why not just set the ShowFrame property to false instead?
If you have other functionality in your subclassed GroupBox or if I have misunderstood your question, then I would tag Delphi as well because you will engage a much larger base of users for something that is more VCL specific than C++ specific.
(I wish I could have just left a comment but because the way SO works is that I have to generate enough points to do that and one way is by submitting answers. It seems odd to me that it is more difficult to comment than to provide an answer.)
Making a composer update
woks for me, Laravel 11
Looks like you both have the same issue. A quick search links to an issue in the official flutter repository, which highlights the root cause, (latest JDK that comes with android studio), this then linked to the migration instructions of how to update your project to be compatiable. The steps are here: https://github.com/fluttercommunity/plus_plugins/issues/3303
It figured it out. I just had to initialize m_socket at the top like this:
int m_socket;
Just in case anyone else is as unobservant as I am: I got this error when I put a line of code inside a new class but not inside any methods (there were no methods yet and I wasn't paying attention).
Due to security reasons on most browsers, pages are not allowed to redirect or have links to about: system pages. Some, like about:quit, about:hang, or about:restart (all found at, in chrome's case, chrome://chrome-urls/) do unwanted things to the system.
If redirects and links were allowed, people could exploit clickjacking to restart people's computers, hang them, and more. However, it seems that about:pages themselves are allowed to redirect to other pages, like on the about:chrome-urls page.
You can type in the debug console:
po FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first
And it will give you the path.
ESCAPE_UNENCLOSED_FIELD=NONE
Solved the problem
I was able to expose the Enum as string configuring the method JsonOptions on extension method AddControllers in Program.cs like the follow code:
builder.Services.AddControllers().AddJsonOptions(options =>
{
options.JsonSerializerOptions.Converters.Add(new JsonStringEnumConverter());
} );
For what this is worth, I had the correct keys (managed programmatically), but Minio didn’t like secret keys with symbols in them. Once I changed the password to alphanumeric (Minio lets you do this through the WebUI), it instantly worked.