Only you need to add `default=None` argument to your model field that was rendered as a RadioSelect.
I also will be very happy if you give me a strict explanation of why func violates LSP. The substitution of A parameter with whatever you want will not alter the correctness of the program, right?
The fact that function func does not violate LSP makes me very happy now. I hope that it is really true.
I have sliver and did not try to use it with sliver yet because in the page I want to use it , I do not use it yet so for who want to make footer in the bottom without staying fix (will stay in the bottom of the page until the user scroll to the bottom of the page)
body: Center(
child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Container(
color: Colors.white,
// decoration: const BoxDecoration(
// image: DecorationImage(
// image: AssetImage('assets/images/backcv2.jpg'),
// fit: BoxFit.fill)),
// color: Colors.white,
height: 1100,
width: 1111,
child: ListView(
scrollDirection: Axis.vertical,
children: [
//after all the widget in the body
SizedBoxFooter(),
],
),
),
),
),
),
Widget SizedBoxFooter() {
return SizedBox
(
height: 29,
width: double.infinity,
child: Container(
// margin: EdgeInsets.only(bottom: 5),
padding: const EdgeInsets.only(bottom: 1.0, right: 7, left: 9),
color: Colors.white,
height: 37,
child: InkWell(
onTap: () {
showModalBottomSheet(
isScrollControlled: true,
context: context,
builder: (bctx) {
return FractionallySizedBox(
heightFactor: 0.47,
// widthFactor: 1,
child: //a column in a container , a listview - what you want
);
},
);
},
child: Center(
child: Text(
strinfotxt,
style: TextStyle(fontSize: 15.9),
),
)),
)
);
}```
As another answer put it, scraping should be technically feasible.
However, scraping your own Play Console web UI violates Google's terms of service and can result in having your account suspended. I decided to refrain from doing it, and suggest others do too - not worth the risk.
Instead, I used a polling mechanism that, when paired with email parsing, it's able to get the accurate status of your Android app. I've open sourced it if you wanna check how it's done or host it yourself: https://github.com/rogerluan/app-store-connect-notifier
So, the answer: my example does not violate LSP! This is exactly what I expected here.
So, what is wrong with the polymorphism in my example? There is no polymorphism at all right? So my example does not relate to LSP at all, and so it can't violate it, right?
Yes.
I believe you do not understand my question well enough. Ok, probably my understanding of LSP is not quite correct. Assume LSP means polymorphism. So, what is wrong with the polymorphism in my example? There is no polymorphism at all right? So my example does not relate to LSP at all, and so it can't violate it, right?
Its unclear what you expect to get here if you refuse to accept basic facts.
"using an object without knowing its actual exact type" - it is your imagination, it is not LPS. You mix different things. LSP says nothing about this. LSP is not polymorphism.
thanks for your reply.
There are different problems, like there are definer clauses or there are HTML tags in the SQL dump, etc. So there are different syntax errors that all lead to "You have an error in your SQl syntax..."
I have fixed a couple of them with a python script that goes through the SQL and searches for regex and replaces/deletes stuff. But this obviously is not a good solution and has never fixed all the issues.
But maybe there is some library that does that with a script or so? I mean I cant be the first person to encounter this issue.
If you want to create your own file format, then you will have to decide how you want the file to be structured. Do you want the file to consist of binary data or text? If you want it to consist of text, then how should this text be structured? Do you want it to use XML or JSON? Or maybe a simpler structure, such as CSV? Or maybe a much simpler structure, like having one single word per line?
Is strange using signals with *ngIf directive, use control flow syntax @if; Also for clarity in your template you can use @let personIsOffline = isAliceOffline().
Take considerations, the computed will be executed once.
altering the correctness of the program - means the program becomes incorrect, but not potentially incorrect, or the possibility of dereferencing nullptr by another programmer will increase
To solve this try reinstalling the vs code again and make sure you don't have any important projects if you do please back them up or push them to your repo
I had this problem and apparently there are two ways to solve it.
Use google-generativeai instead of google-genai
Try removing google-generativeai and also google-genai and this time only install google-genai
Why should I have print()? Why should I dereference b? A and B are completely different classes, they do not have a common interface at all, and do not have a common base class. LSP says nothing about polymorphism, it is about subobjects. LSP: Objects of a superclass should be replaceable with objects of its subclasses without altering the correctness of the program.
For those looking for a deeper answer, what the security checks are protecting are the standard objects of the ValueStack. The ValueStack is a list of named objects of just about everything, including the invoked Action and aspects of servlet context, so your JSP code and submitted forms can read and set them as properties. When asked to read or set data, the ValueStack finds the first property or object matching.
When the author's form is submitted, Struts 2 sets the 'application.appName' property. If the security didn't discard it, the Action instance would match as it has the 'application' property, then the 'appName' property of said 'application' property would be set (though that would fail because the 'application' property is null).
Alas, 'application' is a named object in the ValueStack, which is all the application scope properties. In a Jakarta EE server, these are the ServletContext attributes. If the Action doesn't have an 'application' property and security doesn't happen, Struts 2 matches the application object and sets the 'appName' attribute. Setting an application scope property.
For form submission, the property names to be set come from the form field names, which the user can hack, whether your receiving Action expects them or not. Without the security checks, random users can hack various objects, including session-based data. Got the customer's account in session? If the user can guess the attribute and property names, he can change the account no. Hence, form field names starting with 'applicaton, 'session', 'request' and the like are silently thrown away.
Where did you see virtual void print() = 0; ? See updated post. What kind of "undefined behavior" can happen here? nullptr can happen and it will be handled correctly, right?
Liskov substitution principle dictates that:
an object (such as a class) may be replaced by a sub-object (such as a class that extends the first class) without breaking the program.
In what sense do you think it might be violated here ?
Does the code below violates Liskov Substitution Principle (LSP)?
No.
The code is not an example of Liskov Substitution Principle (LSP), so it does not violate Liskov Substitution Principle.
q.v. this answer regarding LSP: https://stackoverflow.com/a/584732/4641116
Join Us in the Dragon Gi Movement - where quality meets passion, and tradition meeta innovation. https://dragongi.com/
Solution was to add a handle scope:
void MyEmitFunc(const std::string & someStringFromQueue) {
v8::Isolate* isolate = v8::Isolate::GetCurrent();
v8::HandleScope scope(isolate);
v8::Locker locker(isolate);
v8::Isolate::Scope isolateScope(isolate);
v8::Local<v8::String> s = v8::String::NewFromUtf8(isolate, someStringFromQueue.c_str()).ToLocalChecked();
...
}
Pelota Libre TV: Ver Futbol Libre online en vivo y directo. Disfruta de partidos de la Copa Libertadores, Sudamericana y del fútbol argentino como River Plate y Boca Juniors. Canales como TyC Sports, ESPN, Fox Sports y TNT transmiten eventos internacionales gratis.
There’s an important difference between App signing key certificate and Upload key certificate in Play Console:
Upload key certificate: used by you to sign and upload your releases. Google uses it only to verify the source of the AAB.
App signing key certificate: the key Google uses to re-sign your app for distribution. This is what actually runs on users’ devices.
If you use Play App Signing, you must register the App signing key SHA-1 in Google Cloud Console (OAuth 2.0 Android client) for Google Sign-In or One Tap to work.
If you’re not using Play App Signing and manually create your signing key, then your own key’s SHA-1 is what you register instead.
Steps to fix error 10:
Copy App signing key SHA-1 from Play Console → App Integrity
Paste it in Google Cloud → Credentials → OAuth client (Android)
Save and wait a few minutes
No code change or re-upload is needed(if you already created, otherwise please create a new one), the app will now authenticate correctly.
enter image description here npm i -g eas-cli
eas login # (अगर खाता नहीं है तो बना लो)
eas build -p android --profile preview
Have you tried to force the optimizers hand? https://mariadb.com/docs/server/ha-and-performance/optimization-and-tuning/query-optimizations/force-index
When you are using SessionAuthentication, you are using Django's authentication which usually requires CSRF to be checked. Django REST Framework enforces this, only for SessionAuthentication, so you must pass the CSRF token in the X-CSRFToken header.
If your WordPress site feels slow or is getting penalized by Google for Core Web Vitals, try the free plugin LCP Optimizer Universal PRO.
It automatically improves LCP, CLS, and FID without touching your code.
👉 https://emanuelcelano.github.io/lcp-optimizer-universal-pro/
Use getElementsByTagNameNS(). Once you subscript the element you need, you can access its content with .textContent.
var d = "http://schemas.microsoft.com/ado/2007/08/dataservices";
var items = xmlStr.getElementsByTagName(d, "Attachment");
var attachment = items[0].textContent;
You can’t reliably “save & restore” an entire site purely with client-side JavaScript — browsers won’t let JS fetch arbitrary archived assets and rewrite every link for a full site restore. A practical approach is to pull the archived HTML and assets from the Wayback Machine (or use an automated tool like www.waybackdownloader.com) and then serve the downloaded files (fix relative links, update absolute URLs, restore assets, and test). If you want to prototype with JS, fetch archived HTML via the Wayback API, rewrite asset URLs to point to your downloaded copies (or to archive URLs), and then inject the page — but for complete restoration, an automated downloader + a short post-processing step is far more reliable.
Now you can access conversation history via API
@sirtao - re all the extra backticks in my select-object - it was just a typo really. I’ve been writing some scripts that use commands with lots of parameters and they do need backticks at line breaks and my left hand was just on a roll with the ` key :-).
set PYTHONNOUSERSITE variable in Windows environment settings. It can in the "user variables for somebody" or in the "System variables". The value could be 1 or 2 as the picture shows.
I have the same issue, I have fixed it by replacing the old npm viewPager deprecated package with the new react-native-pager-view package.
Deprecated Package: https://npmjs.com/package/@react-native-community/viewpager
New Package: https://www.npmjs.com/package/react-native-pager-view
I have the same issue, I have fixed it by replacing the old npm viewPager deprecated package with the new react-native-pager-view package.
Deprecated Package: https://npmjs.com/package/@react-native-community/viewpager
New Package: https://www.npmjs.com/package/react-native-pager-view
You might want to look into how Flutter’s EditableText and TextSpan work internally that’s where the core logic for building custom text editors starts. Using JSON for storing rich text is a good idea (like Quill and Zefyr do), but building it from scratch means you’ll need to manage text selection, styling spans, and keyboard input manually. I’d suggest starting small maybe first render styled text with Text.rich, then move on to handling user input.
I have the same issue, I have fixed it by replacing the old npm viewPager deprecated package with the new react-native-pager-view package.
Deprecated Package: https://npmjs.com/package/@react-native-community/viewpager
New Package: https://www.npmjs.com/package/react-native-pager-view.
@Raymond I updated my reply above. I might add that this whole new format of "open ended questions" on SO (with replies instead of comments and answers) is quite problematic IMHO.
sometime your android termial path and your project opne in android may be different chekc it firt when you got error
Press the triangle in the cell for "Column Lables" and uncheck the 'Card" box. Now your chart will only display the data for 'Left'.
chatGPT have been based on some libraries like chrome and phyton
second one bot supports another libraries and based on bytes in case to merge.
It's in cloud and chat gpt doen't support its main function.
byte code:
000
001
010
011
100
101
110
111
{...artefact}
000
001
010
011
100
101
110
111
One way to solve this type of problem is with the texture used by the terrain, first select it and then change the Alpha Source value from "Input Texture Alpha" to "From Gray Scale". This option solved my problem.
@wohlstad I did not see any "regular" or "normal" option. Please be more accurate.
export class HelloComponent {
@Input() name: string;
html1 =
'<html><head><style> .html1_h2 {color:red;}</style></head><body><h2 class="html1_h2">Inner HTML1 in red</h2></body></html>';
html2 =
'<html><head><style> .html2_h2 {color:blue;}</style></head><body><h2 class="html2_h2">Inner HTML2 in blue</h2></body></html>';
}
Yes, those options are what I meant by flags, I am avoiding them. I will not use cmake for each project either. Thank you!
Well I guess you have to read the documentation for the commandline options of your compiler/linker and provide the libraries there. Or use CMake to build your project (command lines get messy pretty quickly). E.g. have a look at [Use CMake with the DPC Compiler](https://www.intel.com/content/www/us/en/docs/dpcpp-cpp-compiler/developer-guide-reference/2023-0/use-cmake-with-the-compiler.html%5C)
Yes, `set print elements unlimited` is the correct command to display the full string in GDB without truncation.
However, if you want this setting to persist across all your GDB sessions (make it "stick"), you need to add it to your GDB configuration file.
**Steps to make it permanent:**
1. Create or edit the `.gdbinit` file in your home directory:
nano ~/.gdbinit
2. Add these lines:
set print elements unlimited
set print repeats unlimited
3. Save and exit
Now every time you start GDB, these settings will be automatically applied.
**Additional useful tips:**
- `set print elements 0` is equivalent to unlimited
- To verify current setting: `show print elements`
- For project-specific settings, create a `.gdbinit` file in your project directory
**Security Note:** By default, GDB may not load local `.gdbinit` files for security reasons. To enable it, add this to your `~/.gdbinit`:
set auto-load safe-path /
Or for specific directories:
add-auto-load-safe-path /path/to/your/project
undefined
I was able to import it by sticking it in a <script> tag. For example:
<head>
<script src="papaparse.min.js"></script>
<script>
console.log(Papa)
</script>
</head>
You can run npm-related commands using yarn npm .... In this case, running yarn npm audit would do the trick.
Thank you all for your help. I'm relatively new to Swift, and so didn't understand that the order of modifiers mattered.
As suggested, I rotated before positioning and it now works as intended. It looks like I need some study on the topic of modifers.
Yes, it's not uncommon for version conflicts to arise when working with older repositories, especially when new upgrades are released. In this case, it's possible that the repository you're trying to use was built with a specific version of a library or framework that is no longer compatible with the latest versions.
For a quickfix enter :syntax clear in command mode.
Is there a real difference in trading conditions between standard brokers and Earnforex? Some traders believe spreads are higher on Islamic accounts, while others say the service is identical except for the swap-free feature. What’s your experience?
Big Limos is a world-renowned leader in the design and manufacturing of custom-built limousines, luxury SUVs, and specialty vehicles. With a strong reputation for quality, craftsmanship, and innovation, Big Limos transforms ordinary vehicles into extraordinary masterpieces of comfort, style, and performance. Every limousine created by Big Limos is a reflection of precision engineering and artistic excellence, built to meet the highest standards of luxury transportation around the globe.
Since LibreOffice 24.8, there is UNIQUE function, so now a simple
=COUNT(UNIQUE(B2:B5))
does the job.
You can train a simple classifier to check if an Excel file matches the expected structure. Put valid files in one folder and invalid ones in another, then extract structural features (e.g., number of sheets, column names, row counts, missing values) using pandas or openpyxl, and train a model (e.g., RandomForest or XGBoost).
Try tools like PyCaret, AutoGluon, or scikit-learn for quick prototyping.
It seems reasonable to have categories of products. In the future that might indicate tax exempt, eligible for bulk discounts, shipping restrictions, etc., but for now a "ghost product" category would be one you could use now.
Thank you for the break-down as I was reading into the word 'all' when it would be better explained with 'each' as the all was presumptuous to summation. Thanks again @kitt51.
If you don't add a combobox, where do you want to get and set the property from?
Can you post some images of your app? Preferably an image of how it looks on Mac and another of how it looks on Windows?
To open a Cygwin terminal with 'the same' $PWD (more precisely, with $PWD_Cygwin = $(cygpath $PWD_Windows) as in Windows (e.g. your PowerShell terminal), simply do
C:\cygwin64\bin\mintty.exe -
cd "$(cygpath -u "$OLDPWD")"
in your Windows terminal/script/etc. The logic of the code follows from the fact that, upon initialisation (C:\cygwin64\bin\mintty.exe - ), Cygwin saves the old Windows $PWD as the Cygwin variable $OLDPWD (whilst setting its $PWD variable as /home/sh).
As an aside, we note the importance of starting Cygwin as a login shell: https://stackoverflow.com/a/43300782/31298396.
I think you might be misunderstanding the statement. You don’t need to sum anything; instead, you should compare each element with every element to its right, and if the number is greater than all the elements to its right, then it is a leader number.
Example:
17 is a leader number because 17 > 4, 3, 5, 2.
4 is not a leader number because, although 4 > 3 and 2, it is less than 5.
Can you post a link to the problem?
The requirement is to be greater than each of the numbers to the right individually, not greater than the sum of the numbers to the right.
The issue isnt really with the modal itself, but with how the sidebar's collapsed state is shared.
If you cant import the internal sidebar component, the best approach is to lift that collapse-expand state up, for example, by storing it in a React Context or a global store like Zustand. Then both the sidebar and the preview dialog can read the same state and re-render automatically when it changes.
That way, your preview dialog can simply use width: calc(100% - sidebarWidth) or flexbox to fill whatever space is available, without manually setting pixel values.
OR
A temporary CSS fix is to make the layout a flex container and position the dialog relative to the main content area instead of using position: fixed. That way, it naturally resizes as the sidebar width changes.
If this doesnt fix your problem, you can share it on codepen if possible, so I can have a closer look.
Cheers!
# Source - https://stackoverflow.com/q/75225743
# Posted by AJ E., modified by community. See post 'Timeline' for change history
# Retrieved 2025-11-08, License - CC BY-SA 4.0
import json
import paho.mqtt.client as mqtt
import folium
import time
from folium.plugins import MarkerCluster
# Variable to hold the current latitude and longitude
latitude = 50.780036278929614
longitude = 6.10363592985153
# Callback function when a message is received
def on_message(client, userdata, message):
global latitude, longitude
# Convert the message payload from bytes to string
data = message.payload.decode()
# parse the json string
data = json.loads(data)
# Extract the latitude and longitude
if 'GPS' in data:
gps_data = data["GPS"]
latitude = gps_data["Latitude"]
longitude = gps_data["Longitude"]
# Create MQTT client
client = mqtt.Client()
# Attach callback function to the message event
client.on_message = on_message
# Connect to the MQTT broker
client.connect("broker.mqttdashboard.com", 1883)
# Subscribe to the desired topic
client.subscribe("gpsdata")
# Start the MQTT loop
client.loop_start()
# Initialize the map
# Initialize the map
m = folium.Map(location=[latitude, longitude], zoom_start=15)
mc = folium.MarkerCluster()
m.add_child(mc)
marker = None
while True:
# Check if the latitude and longitude have been updated
if latitude and longitude:
# Remove the previous marker
if marker:
mc.remove_child(marker)
# Update the marker on the map to the current location
marker = folium.Marker(location=[latitude, longitude])
mc.add_child(marker)
# Save the map
m.save("current_location.html")
# Wait for one second
time.sleep(1)
<style>
@reference 'tailwindcss';
.intercal-css {
@apply bg-red-500;
}
</style>
<main class="main">
<h1 class="text-3xl font-bold underline">Hello world!</h1>
<p class="intercal-css">Intercal CSS</p>
</main>
<router-outlet />
<style> in direct componet, means css modules
Depending on your version of Visual Studio Code, enter in your Terminal --> py -m pip install pandas
Some will use --> python -m pip install pandas
I am not defining this overall layout structure myself. It is imported and used directly from a proprietary, in-house library developed by the company.
How about instead of creating new independent pieces of state and managing the dependence, you just define your rMin and rMax based on these (i.e. as "derived state")?
const [thresholdMin, setThresholdMin] = useState<number>()
const [thresholdMax, setThresholdMax] = useState<number>()
const rangeMin: Range[] = Array.from({length: thresholdMax-1}, (_, i) => ({
label: v.value.toString() + " " +data.settings.sensor_unit,
value: i + 1,
}
));
const rangeMax: Range[] = Array.from({length: 10-thresholdMin}, (, i) => ({
label: v.value.toString() + " " +data.settings.sensor_unit,
value: i + thresholdMin + 1,
}));
Now these will automatically stay updated whenever thresholdMin and thresholdMax change
With no context whatsoever, I'm not sure how we're supposed to help you.
In situations where I "know" what the environment should be, but "just in case" ("sanity checks"), I will add Debug.Asserts to insure that things are as I expect; at least during development. I find that "Asserts" are as "worthy" as "unit tests" (IMO); and a lot less work. If it still crashes, I agree, there's a fundamental problem and an "application unhandled exception" (handler) and stack dump (that you can email) should be enough.
You can drop the promise with:
router.post('/registration', void registration);
6 protons, neutrons, electrons; name, d.o.b., s.s.n. all equal the same: 15(×3). 5+1=6(×3). ;)
opencv-python depends on numpy versions earlier than 2.3. However, the latest numpy version earlier than 2.3(2.2.6), is not compatible with Python 3.14.
This is the reason why opencv cannot be installed with Python 3.14.
The first thing I would like to see resolved is for opencv to support numpy 2.3 or later. I'm not sure why, but development seems to be significantly behind schedule.
The second thing I would like to see resolved is for a numpy version 2.2.6 whl to be created. However, since the latest numpy version, 2.3.4, can be installed with Python 3.14, there seems to be little incentive to create a 2.2.6 whl.
If you use containerRelativeFrame you will always end up occupying the entire view as far as I know.
There are 3 variations to containerRelativeFrame; in this case you want to use the "full custom" variation in which you can fully customize the returned dimensions relative to the container frame
Specifically, make the width of the items in your scroll view equal to the width of your container minus 2 times the padding you are using (similar to the other solution by @MatBuompy). This will allow you to achieve your goals without the need for GeometryReader.
struct CardTheme: View {
let padding: CGFloat
var body: some View {
ScrollView(.horizontal, showsIndicators: false) {
HStack {
ForEach(0..<10, id: \.self) { i in
RoundedRectangle(cornerRadius: 25)
// Use the pure custom version of `.containerRelativeFrame`
.containerRelativeFrame(.horizontal) { width, _ in
width - (self.padding * 2)
}
}
}
}
.padding(.horizontal, self.padding)
.scrollTargetLayout()
}
.scrollTargetBehavior(.viewAligned)
}
}
Too old but still happens, an alternative solution is the extension BasedPyright
It's sad to see that even in 2025 this is still an issue with the Discord API. Why can't my own user request his messages? It makes no sense discord.
There's also no documentation about which scopes are needed for which endpoints. There's just a brief explanation saying what each OAuth2 scope does but not for which endpoints it applies. If a scope says it can read my user messages I would expect it to work...
use temp match create the model of the small part to search the target in large pic.
Updating both my vscode and jupyter version fixed it for me! seems to have been a temporary version incompatibility
@Martheen to answer your question: Yes I want to have it so that it scans and try to find the .uc file in them.
@Andreas Wenzel to answer your question: Yeah sure I will look at the book on C. And also the .uc file will be a file type the user can read and write to. It is just a plane file with a random file type I gave it cuz I wanna practice making something.
@greg spears to answer you question: No as in like the name of the file can be anything but when getting the file's format it have be a ".uc".
@John Bode to answer your question: Ah ok I see that I will figure that out when I get there soon I am mostly focusing on the other thing right now, thanks tho!
I found out you have to add the API connection to each relation page. Now the relations are showing up for me
Problem seems to be with parenthesis. Enclose inner expression in parenthesis, as shown below:
scala
map + (k -> (map.getOrElse(k, 0) + 1))
Other post that you mentioned had different problem. In that post, Int was used as type parameter, which is not the case here.
Little late here, but this will solve the problem of converting newlines
in Value strings (only) either in arrays or Objects, to a literal \n
It can be tailored to to either or both types of values.
If the same needs to be done to keys, contact me for that mod.
The core JSON regex functions are done by me @sln.
More examples and explanations can be found here :
https://stackoverflow.com/a/79785886/15577665
This is converted to Ruby using Oniguruma recursion call syntax \g<name>
and a dead cluster to house the functions (?:(?<func1>..)(?<func2>..){0}, etc...
The code flows as follows -
Step1: Validate the JSON string. Uses RxValidate regex below.
Step2: If the JSON passes the validation regex, match the quoted strings that have newlines embedded.
Step3: When the string is matched, in a callback, replace all newlines CRLF in the quoted string with the literal \n
Important Note >> Because the string has been Validated, we know that all that's needed
to match the quoted values is to impose a Separator check at the end of the quote part of the regex.
This is because there is no other form where quoted values can exist in valid JSON.
This regex validates the JSON The string can only contain a Valid JSON.
\A \s*
(?: \g<V_Obj> | \g<V_Ary> )
\s* \z
# JSON functions - NoErDet
# ---------------------------------------------
(?:(?<Sep_Ary>\s*(?:,(?!\s*[}\]])|(?=\])))(?<Sep_Obj>\s*(?:,(?!\s*[}\]])|(?=})))(?<Str>(?>"[^\\"]*(?:\\[\s\S][^\\"]*)*"))(?<Numb>(?>[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?|(?:[eE][+-]?\d+)))(?<V_KeyVal>(?>\s*\g<Str>\s*:\s*\g<V_Value>\s*))(?<V_Value>(?>\g<Numb>|(?>true|false|null)|\g<Str>|\g<V_Obj>|\g<V_Ary>))(?<V_Ary>\[(?>\s*\g<V_Value>\g<Sep_Ary>)*\s*\])(?<V_Obj>{(?>\g<V_KeyVal>\g<Sep_Obj>)*\s*})){0}
This regex matches the quoted value strings containing embedded newlines.
" # The "Value" with at least one newline in it
[^\\"\r\n]*?
\r? \n [^\\"]*
(?: \\ [\s\S] [^\\"]* )*
"
(?= # Assert : Ahead an object or array separator
\s*
(?: \g<Sep_Obj> | \g<Sep_Ary> )
)
# JSON Separators
# -------------------
(?:
(?<Sep_Ary>
\s*
(?:
,
(?! \s* [}\]] )
| (?= \] )
)
)
(?<Sep_Obj>
\s*
(?:
,
(?! \s* [}\]] )
| (?= } )
)
)
){0}
Ruby Test Code The JSON sample data and output are separately at the bottom.
RxValidate = /\A\s*(?:\g<V_Obj>|\g<V_Ary>)\s*\z(?:(?<Sep_Ary>\s*(?:,(?!\s*[}\]])|(?=\])))(?<Sep_Obj>\s*(?:,(?!\s*[}\]])|(?=})))(?<Str>(?>"[^\\"]*(?:\\[\s\S][^\\"]*)*"))(?<Numb>(?>[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?|(?:[eE][+-]?\d+)))(?<V_KeyVal>(?>\s*\g<Str>\s*:\s*\g<V_Value>\s*))(?<V_Value>(?>\g<Numb>|(?>true|false|null)|\g<Str>|\g<V_Obj>|\g<V_Ary>))(?<V_Ary>\[(?>\s*\g<V_Value>\g<Sep_Ary>)*\s*\])(?<V_Obj>{(?>\g<V_KeyVal>\g<Sep_Obj>)*\s*})){0}/
RxQtNL = /"[^\\"\r\n]*?\r?\n[^\\"]*(?:\\[\s\S][^\\"]*)*"(?=\s*(?:\g<Sep_Obj>|\g<Sep_Ary>))(?:(?<Sep_Ary>\s*(?:,(?!\s*[}\]])|(?=\])))(?<Sep_Obj>\s*(?:,(?!\s*[}\]])|(?=})))){0}/
count = 0 # count on newline replacements made
## If valid json string, replace newlines into stringed '\n'
##
if json =~ RxValidate
puts "Valid JSON"
## Here, Match only Value strings with newline(s) in it
json_new = json.gsub( RxQtNL ) {
## Callback1: Matched a quoted string with newline(s)
|m| m.gsub( /\r?\n/) {
## Callback2 (just to increment counter):
|m| count+=1; # Increment counter
"\\n" # Return replacement
}
}
puts json_new
puts "Changed " + count.to_s + " newlines into literal \\n"
else
puts "Invalid JSON "
end
Coded JSON Test sample
json = '
{
"calculation":"
setCreate(formData,
path(\'hifSpendSinceLastReturn\', \'hifSpendSinceLastReturnHolder\', \'remaining\'),
String(
(parseMoney(
(get(formData, path(\'fundedThroughHIF\',\'fundedThroughHIFCurrent\')) === \'Yes\') ?
get(formData, path(\'totalCost\', \'previousAmounts\', \'baseline\')) :
get(formData, path(\'fundedThroughHIF\', \'hifSpend\', \'previousAmounts\', \'baseline\')
)
) -
parseMoney(
get(formData, path(\'hifSpendSinceLastReturn\', \'hifSpendSinceLastReturnHolder\', \'cumulativeIncCurrentReturn\')))
)
)
);
get(formData, \'anyChangeToDescription\', \'confirmation\') === \'Yes\' ?
set(formData, \'currentFundingStackDescription\', get(formData, path(\'anyChangeToDescription\', \'updatedFundingStack\'))) :
set(formData, \'currentFundingStackDescription\', get(formData, path(\'descriptionOfFundingStack\'))); set(formData[\'totalCost\'], \'percentComplete\', calculateVariance(parseMoney(get(formData, path(\'totalCost\', \'current\'))), parseMoney(get(formData, path(\'totalCost\', \'baseline\')))));"
,
"calculation": "
get(formData, \'anyChange\') === \'Yes\' ?
setCreate(formData, path(\'variance\', \'currentAmount\'), get(formData, path(\'variance\', \'current\'))) :
setCreate(formData, path(\'variance\', \'currentAmount\'), get(formData, path(\'previousAmounts\', \'lastReturn\')));
setCreate(formData, path(\'variance\', \'baseline\'),
String(parseMoney(get(formData, \'variance\', \'current\')) - parseMoney(get(formData, path(\'previousAmounts\', \'baseline\'))))
);
get(formData,\'previousAmounts\', \'lastReturn\') ?
setCreate(formData, path(\'variance\', \'lastReturn\'),
String(parseMoney(get(formData, \'variance\', \'current\')) -
parseMoney(get(formData, path(\'previousAmounts\', \'lastReturn\'))))
) :
setCreate(formData, path(\'variance\', \'lastReturn\'), \'N/A\');"
,
"calculation": "
get(formData, \'anyChange\', \'confirmation\') === \'Yes\' ?
get(formData, \'fundedThroughHIFbaseline\') === \'Yes\' ?
set(formData, \'fundedThroughHIFCurrent\', \'No\') :
set(formData, \'fundedThroughHIFCurrent\', \'Yes\')
:
set(formData, \'fundedThroughHIFCurrent\', get(formData, \'fundedThroughHIFbaseline\'));"
,
"hifSpend": {
"title": "",
"calculation": "
get(formData, \'anyChangeToBaseline\', \'confirmation\') === \'Yes\' ?
setCreate(formData, path(\'anyChangeToBaseline\', \'variance\', \'currentAmount\'), get(formData, \'anyChangeToBaseline\', \'variance\', \'current\')) :
setCreate(formData, path(\'anyChangeToBaseline\', \'variance\', \'currentAmount\'), get(formData, \'previousAmounts\', \'lastReturn\'));
setCreate(formData, path(\'anyChangeToBaseline\', \'variance\', \'baseline\'),
String(parseMoney(get(formData,\'anyChangeToBaseline\', \'variance\', \'current\'))) -
parseMoney(get(formData, \'previousAmounts\', \'baseline\'))
);
get(formData, path(\'previousAmounts\', \'lastReturn\')) ?
setCreate(formData, path(\'anyChangeToBaseline\', \'variance\', \'lastReturn\'),
String(parseMoney(get(formData, path(\'anyChangeToBaseline\', \'variance\', \'current\')))
) - parseMoney(get(formData, path(\'previousAmounts\', \'lastReturn\')))) :
setCreate(formData, [\'anyChangeToBaseline\', \'variance\', \'lastReturn\'], \'N/A\');",
"type": "object",
"properties": {
"previousAmounts": {
"type": "object",
"title": "HIF Amount",
"horizontal": true,
"properties": {
"baseline": {
"type": "string",
"title": "HIF Baseline Amount",
"sourceKey": [
"baseline_data",
"costs",
"infrastructure",
"HIFAmount"
],
"readonly": true,
"currency": true
},
"lastReturn": {
"type": "string",
"title": "Last Return",
"readonly": true,
"currency": true,
"sourceKey": [
"return_data",
"fundingPackages",
"fundingStack",
"hifSpend",
"current"
]
}
}
},
"anyChangeToBaseline": {
"type": "object",
"title": "",
"properties": {
"confirmation": {
"title": "Any change to baseline/ last return?",
"type": "string",
"enum": ["Yes", "No"],
"radio": true
}
},
"dependencies": {
"confirmation": {
"oneOf": [
{
"properties": {
"confirmation": {
"enum": ["Yes"]
},
"variance": {
"type": "object",
"title": "",
"horizontal": true,
"properties": {
"current": {
"type": "string",
"title": "Current return",
"currency": true
},
"currentAmount": {
"type": "string",
"title": "",
"hidden": true
},
"baseline": {
"type": "string",
"title": "Variance against baseline (£)",
"readonly": true
},
"lastReturn": {
"type": "string",
"title": "Variance Against Last Return (£)",
"readonly": true
}
}
},
"varianceReason": {
"type": "string",
"title": "Reason for variance",
"extendedText": true
}
}
},
{
"properties": {
"confirmation": { "enum": ["No"] }
}
}
]
}
}
}
}
}
}
'
Output
Valid JSON
Changed 51 newlines into literal `\n`
{
"calculation":"\nsetCreate(formData,\n path('hifSpendSinceLastReturn', 'hifSpendSinceLastReturnHolder', 'remaining'),\n String(\n (parseMoney(\n (get(formData, path('fundedThroughHIF','fundedThroughHIFCurrent')) === 'Yes') ?\n get(formData, path('totalCost', 'previousAmounts', 'baseline')) :\n get(formData, path('fundedThroughHIF', 'hifSpend', 'previousAmounts', 'baseline')\n )\n ) -\n parseMoney(\n get(formData, path('hifSpendSinceLastReturn', 'hifSpendSinceLastReturnHolder', 'cumulativeIncCurrentReturn')))\n )\n )\n);\n\nget(formData, 'anyChangeToDescription', 'confirmation') === 'Yes' ?\n set(formData, 'currentFundingStackDescription', get(formData, path('anyChangeToDescription', 'updatedFundingStack'))) :\n set(formData, 'currentFundingStackDescription', get(formData, path('descriptionOfFundingStack'))); set(formData['totalCost'], 'percentComplete', calculateVariance(parseMoney(get(formData, path('totalCost', 'current'))), parseMoney(get(formData, path('totalCost', 'baseline')))));"
,
"calculation": "\nget(formData, 'anyChange') === 'Yes' ?\n setCreate(formData, path('variance', 'currentAmount'), get(formData, path('variance', 'current'))) :\n setCreate(formData, path('variance', 'currentAmount'), get(formData, path('previousAmounts', 'lastReturn')));\n\nsetCreate(formData, path('variance', 'baseline'),\n String(parseMoney(get(formData, 'variance', 'current')) - parseMoney(get(formData, path('previousAmounts', 'baseline'))))\n);\n\nget(formData,'previousAmounts', 'lastReturn') ?\n setCreate(formData, path('variance', 'lastReturn'),\n String(parseMoney(get(formData, 'variance', 'current')) -\n parseMoney(get(formData, path('previousAmounts', 'lastReturn'))))\n ) :\n setCreate(formData, path('variance', 'lastReturn'), 'N/A');"
,
"calculation": "\nget(formData, 'anyChange', 'confirmation') === 'Yes' ?\n get(formData, 'fundedThroughHIFbaseline') === 'Yes' ?\n set(formData, 'fundedThroughHIFCurrent', 'No') :\n set(formData, 'fundedThroughHIFCurrent', 'Yes')\n :\n set(formData, 'fundedThroughHIFCurrent', get(formData, 'fundedThroughHIFbaseline'));"
,
"hifSpend": {
"title": "",
"calculation": "\nget(formData, 'anyChangeToBaseline', 'confirmation') === 'Yes' ?\n setCreate(formData, path('anyChangeToBaseline', 'variance', 'currentAmount'), get(formData, 'anyChangeToBaseline', 'variance', 'current')) :\n setCreate(formData, path('anyChangeToBaseline', 'variance', 'currentAmount'), get(formData, 'previousAmounts', 'lastReturn'));\n\nsetCreate(formData, path('anyChangeToBaseline', 'variance', 'baseline'),\n String(parseMoney(get(formData,'anyChangeToBaseline', 'variance', 'current'))) -\n parseMoney(get(formData, 'previousAmounts', 'baseline'))\n);\nget(formData, path('previousAmounts', 'lastReturn')) ?\n setCreate(formData, path('anyChangeToBaseline', 'variance', 'lastReturn'),\n String(parseMoney(get(formData, path('anyChangeToBaseline', 'variance', 'current')))\n ) - parseMoney(get(formData, path('previousAmounts', 'lastReturn')))) :\n setCreate(formData, ['anyChangeToBaseline', 'variance', 'lastReturn'], 'N/A');",
"type": "object",
"properties": {
"previousAmounts": {
"type": "object",
"title": "HIF Amount",
"horizontal": true,
"properties": {
"baseline": {
"type": "string",
"title": "HIF Baseline Amount",
"sourceKey": [
"baseline_data",
"costs",
"infrastructure",
"HIFAmount"
],
"readonly": true,
"currency": true
},
"lastReturn": {
"type": "string",
"title": "Last Return",
"readonly": true,
"currency": true,
"sourceKey": [
"return_data",
"fundingPackages",
"fundingStack",
"hifSpend",
"current"
]
}
}
},
"anyChangeToBaseline": {
"type": "object",
"title": "",
"properties": {
"confirmation": {
"title": "Any change to baseline/ last return?",
"type": "string",
"enum": ["Yes", "No"],
"radio": true
}
},
"dependencies": {
"confirmation": {
"oneOf": [
{
"properties": {
"confirmation": {
"enum": ["Yes"]
},
"variance": {
"type": "object",
"title": "",
"horizontal": true,
"properties": {
"current": {
"type": "string",
"title": "Current return",
"currency": true
},
"currentAmount": {
"type": "string",
"title": "",
"hidden": true
},
"baseline": {
"type": "string",
"title": "Variance against baseline (£)",
"readonly": true
},
"lastReturn": {
"type": "string",
"title": "Variance Against Last Return (£)",
"readonly": true
}
}
},
"varianceReason": {
"type": "string",
"title": "Reason for variance",
"extendedText": true
}
}
},
{
"properties": {
"confirmation": { "enum": ["No"] }
}
}
]
}
}
}
}
}
}
@Wicket - appreciate the thought. Yes, you are probably right they want that downgraded as well.
This is sort of a separate question which already has some discussion...but
The issue with presentations.currentonly is that my Add-On uses a template (a public one on my drive) for some preconfigured pie wedge shapes with varying start and sweep angles. These are copied and pasted into the users presentation via script, since it is not currently possible to adjust those angels with the API via apps script.
The only way to directly copy shapes is with SlidesApp.openById(...) which requires the full read/write presentations scope. Even using readonly with the advanced Slides API returns a JSON object of the shapes but the angles I mentioned are not included.
The API is very limited for some things.
# Source - https://stackoverflow.com/q
# Posted by Omni Master, modified by community. See post 'Timeline' for change history
# Retrieved 2025-11-08, License - CC BY-SA 4.0
import matplotlib.pyplot as plt
import numpy
import math
import random
t=0
pontos = [[0, 0],[5,math.sqrt(75)],[10, 0]]
plt.plot([0, 5, 10], [ 0, math.sqrt(75), 0], "ro")
x = random.randint(0, 100)
y = random.randint(0, 100)
while t < 100:
rv=random.choice(pontos)
rvx=rv[0]
rvy=rv[1]
medx=(rvx+x)/2
medy=(rvy+y)/2
plt.plot([medx], [medy], "ro")
t = t+1
plt.show()
``
Sub CreateObject(ByRef StrText As String)
Print StrText
End Sub
Type regex
pattern As String
IgnoreCase As Boolean
Global As Boolean
Test(0 To 100) As Integer
End Type
Dim reg_xyz As Object
Call CreateObject("VBScript.RegExp")
Sub reg_xyz_event (ByRef regex As regex)
regex.Pattern = "pizza|coke|paste"
regex.IgnoreCase = True
regex.Global = True
End Sub
Dim testString As String
testString = "I want pizza and coke"
If regex.Test = 0 Then
On Error Goto MessBox:
Print "Error: "; 0; "Match found"
End
MessBox:
regex.Test += 1
Resume Next
Else
Print MessBox; "Error: "; 0; "No match found"
End If
' ```
' 4. For simple string functions like Left and Right, you must assign or use the result:
' ```vb
Dim leftPart As String
leftPart = Left(pattern, 5) ' gets first 5 characters
Print leftPart
on winodows, HomeDir/Desktop is unreliable, should:
windows.KnownFolderPath(windows.FOLDERID_Desktop, 0)
# Source - https://stackoverflow.com/a/2933544
# Posted by Ignacio Vazquez-Abrams
# Retrieved 2025-11-07, License - CC BY-SA 2.5
grep -v -F "$data_line" "$data_dir" > ...
-v removes lines that match
-F uses string as is, special characters used without being special
Another approach could be :
This way you avoid calculating an average RGB or HSV value, which is always problematic.
import numpy as np
import sys
import cv2
IMG="your_img.jpg"
def show_wait_destroy(winname, img):
cv2.imshow(winname, img)
cv2.moveWindow(winname, 500, 0)
cv2.waitKey(0)
cv2.destroyWindow(winname)
def get_dominant_color(p_img, p_ksize):
src = cv2.imread(p_img)
src=cv2.resize(src, (p_ksize,p_ksize), interpolation=cv2.INTER_LINEAR)
show_wait_destroy('',src)
blur = cv2.blur(src,(p_ksize,p_ksize))
show_wait_destroy('',blur)
k = blur[int(p_ksize/2),int(p_ksize/2)]
return k
def main(p_img):
(b,g,r)=get_dominant_color(p_img,50)
print(r,g,b)
main(IMG)
Source image :
Thumbnail/ROI :
Blurred thumbnail :
"dominant RGB code" :
214 196 179
I was able to fix this issue by removing the android folder and creating it again using
flutter create . command.
The key to making this work is to ensure your position variable is int, but your display value is a string.
var value = i.ToString();
<FluentSliderLabel Position="@i" Style="font-size:16pt">
@value
</FluentSliderLabel>
@DavidW thanks for the reply. Unfortunately I can't provide more details. One quick question if you know. What I found is if I have a file lets say myutils.py in module1 and another file with same name myutils.py in a separate module2 and then I compile myutils.py and myutils.py separately it compiled both of them like myutils.cp312.win_amd64.pyd at both places. When I import functions from them then it fails, but if I compile only one of them the imports work. Struggling to see why it matters ? Any idea?
@Chris wow, this looks really fast, but the intersect with [ does not provide the same result as as terra::intersect. What does the is.related do? Given that these data are in lon/lat WGS 84, to calculate the area of all polygons resulting from intersect, should the data be projected using an equal area projection?
The difference between a simple pointer and std::reference_wrapper is explained here: What is the difference between std::reference_wrapper and a simple pointer?
Is that your desired result, or just a result you think was closest so far? No matter how confident you are in uselessness of the last version of your code, it helps others understand a lot about your way of approaching the problem. Also, the MRE is a requirement in questions like this, without which you will attract downvotes.
I have found a couple of options. I have tested all three and they work.
https://www.onlinegdb.com/online_c_compiler#
The only thing you need in your day is the use your phone for the next few minutes to make it work for you so I can call the today or the morning and make not a call or