This is a valid Atom 1.0 feed.
This feed is valid, but interoperability with the widest range of feed readers could be improved by implementing the following recommendations.
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:creativeCommons="http://back ...
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:re="http://purl.org/atompub/rank/1.0">
<title type="text">Recent Questions - Stack Overflow</title>
<link rel="self" href="https://stackoverflow.com/feeds" type="application/atom+xml" />
<link rel="alternate" href="https://stackoverflow.com/questions" type="text/html" />
<subtitle>most recent 30 from stackoverflow.com</subtitle>
<updated>2025-07-03T20:50:59Z</updated>
<id>https://stackoverflow.com/feeds</id>
<creativeCommons:license>https://creativecommons.org/licenses/by-sa/4.0/rdf</creativeCommons:license>
<entry>
<id>https://stackoverflow.com/q/79689452</id>
<re:rank scheme="https://stackoverflow.com">0</re:rank>
<title type="text">Rocky 8 Kickstart Installer Failing on Newer Laptops</title>
<category scheme="https://stackoverflow.com/tags" term="rocky-os" />
<author>
<name>SixDegrees</name>
<uri>https://stackoverflow.com/users/314660</uri>
</author>
<link rel="alternate" href="https://stackoverflow.com/questions/79689452/rocky-8-kickstart-installer-failing-on-newer-laptops" />
<published>2025-07-03T20:46:33Z</published>
<updated>2025-07-03T20:46:33Z</updated>
<summary type="html">
<p>We have a Kickstart installation ISO for Rocky 8 that supports both UEFI and MBR/BIOS installs. It has worked fine on a variety of laptops and virtual machines for several years. We are trying to use it on a brand new Dell laptop (UEFI) and it is failing because it appears it can't find the package repositories, although the path to them as defined in both the Kickstart file and in the EFI/BOOT/[BOOT.conf|grub.cfg] files has not changed. It's puzzling because only the hardware is more recent, but it installs correctly on both UEFI laptops using SATA drives and nvme drives. That shouldn't affect the installer, though. Poking around in the installation console I can see the paths specified in the boot files are, in fact, there, but the installation dies with &quot;Error setting up base repository&quot; message under Installation Source.</p>
<p>Browsing through the log files hints that it's just not finding the various repositories where I tell it to look (we have our own Packages area with third-party installs) notably BaseOS and AppStream. I've tried not listing these latter two as they're there by default, but no joy.</p>
<p>As noted the exact same installation runs just fine on older UEFI machines, but something about this newer hardware is killing it. I'm quite stumped.</p>

</summary>
</entry>
<entry>
<id>https://stackoverflow.com/q/79689445</id>
<re:rank scheme="https://stackoverflow.com">0</re:rank>
<title type="text">How to make a Yii2 basic-app into a module</title>
<category scheme="https://stackoverflow.com/tags" term="yii2" />
<category scheme="https://stackoverflow.com/tags" term="yii2-module" />
<author>
<name>JKofsky</name>
<uri>https://stackoverflow.com/users/19648893</uri>
</author>
<link rel="alternate" href="https://stackoverflow.com/questions/79689445/how-to-make-a-yii2-basic-app-into-a-module" />
<published>2025-07-03T20:36:07Z</published>
<updated>2025-07-03T20:36:07Z</updated>
<summary type="html">
<p>I have a basic web app that I want make into a module.</p>
<ol>
<li>Is it possible to just copy the app folders into the module folder?</li>
<li>I assume that I don't have to copy EVERYTHING.
<ul>
<li>What folders do I need?</li>
<li>config, models, controllers, views, ????</li>
</ul>
</li>
<li>I figure I'd have to change the namespaces.</li>
<li>What else do I need to do?</li>
<li>What &quot;gotcha's&quot; to look out for?</li>
</ol>
<p>I've been looking at the documentation about Modules, but I'm still a little lost.</p>

</summary>
</entry>
<entry>
<id>https://stackoverflow.com/q/79689442</id>
<re:rank scheme="https://stackoverflow.com">0</re:rank>
<title type="text">express-rate-limit: how to customize the response when the limit is exceeded and run alternative logic?</title>
<category scheme="https://stackoverflow.com/tags" term="node.js" />
<category scheme="https://stackoverflow.com/tags" term="express" />
<category scheme="https://stackoverflow.com/tags" term="rate-limiting" />
<category scheme="https://stackoverflow.com/tags" term="express-rate-limit" />
<author>
<name>Valentina Elizondo</name>
<uri>https://stackoverflow.com/users/15166486</uri>
</author>
<link rel="alternate" href="https://stackoverflow.com/questions/79689442/express-rate-limit-how-to-customize-the-response-when-the-limit-is-exceeded-and" />
<published>2025-07-03T20:29:27Z</published>
<updated>2025-07-03T20:29:27Z</updated>
<summary type="html">
<p>I am currently using rate limiter to limit the amount of requests I get with AI, and I need to implement some logic to access the DB to get the info once the AI limit is reached. I am currently utilizing the rate limiter handler to call a service with the login to get the info from the DB and I am wandering if this is the best practice or is there a better way to handle this.</p>
<pre><code>// 📌 Global AI requests limit
 exports.globalAIFraseRequestLimiter = rateLimit({
 windowMs: 24 * 60 * 60 * 1000,
 max: 1,
 message: &quot;AI Limit has been reached&quot;,
 handler: async (req, res, next) =&gt; {
 try { 
 const { categoria } = req.body;
 const frase = await obtenerTopFrasesPorCategoriaDB(categoria); // Call service
 if (typeof frase.texto !== 'string' || frase.texto.trim() === '') {
 return res.status(500).json({ error: &quot;La frase no tiene texto válido&quot; });
 }
 const texto = frase.texto
 return res.status(200).json({ frase: texto, source: &quot;BD&quot; });
 } catch (error) {
 return res.status(500).json({ error: &quot;Internal Server Error&quot; });
 }
 },
 validate: { ip: false, trustProxy: false },
 });
</code></pre>

</summary>
</entry>
<entry>
<id>https://stackoverflow.com/q/79689438</id>
<re:rank scheme="https://stackoverflow.com">0</re:rank>
<title type="text">Strapi in dev mode on cpanel with limited RAM</title>
<category scheme="https://stackoverflow.com/tags" term="cpanel" />
<category scheme="https://stackoverflow.com/tags" term="webassembly" />
<category scheme="https://stackoverflow.com/tags" term="strapi" />
<category scheme="https://stackoverflow.com/tags" term="whm" />
<author>
<name>Habib Ullah</name>
<uri>https://stackoverflow.com/users/19623589</uri>
</author>
<link rel="alternate" href="https://stackoverflow.com/questions/79689438/strapi-in-dev-mode-on-cpanel-with-limited-ram" />
<published>2025-07-03T20:26:15Z</published>
<updated>2025-07-03T20:26:15Z</updated>
<summary type="html">
<p>I have strapi deployed on cpanel with shared hosting environment.</p>
<ul>
<li>Currently strapi is running successfully on cpanel using the build with the sub-domain setup.</li>
<li>I don't have access to root ssh but I can use ssh using source of nodejs setup app.</li>
<li>I have limited RAM about 1.2 GB left on cpanel.</li>
<li>I can add/edit data but not the schema with this setup of cpanel using build.</li>
<li>I tried to run the cpanel in ssh using <code>npm run develop</code> command but got this error:</li>
</ul>
<p><em>WebAssembly.instantiate(): Out of memory: Cannot allocate Wasm memory for new instance</em></p>
<p>Is there anyway to run strapi on cpanel in dev mode without upgrading the cpanel resources?</p>

</summary>
</entry>
<entry>
<id>https://stackoverflow.com/q/79689435</id>
<re:rank scheme="https://stackoverflow.com">0</re:rank>
<title type="text">FastAPI raises 500 Internal Server Error unexpectedly</title>
<category scheme="https://stackoverflow.com/tags" term="python" />
<category scheme="https://stackoverflow.com/tags" term="fastapi" />
<author>
<name>ikianm</name>
<uri>https://stackoverflow.com/users/19712634</uri>
</author>
<link rel="alternate" href="https://stackoverflow.com/questions/79689435/fastapi-raises-500-internal-server-error-unexpectedly" />
<published>2025-07-03T20:25:13Z</published>
<updated>2025-07-03T20:25:13Z</updated>
<summary type="html">
<p>I have a login route (/v1/auth/login) which calling a login_service. I raise an Http Bad Request exception from the login_service inside an if block but fastapi returns 500 Internal Server Error to the client. To be more precised, once the code enters the if block, it must raise a 400 bad request exception, otherwise it must return a dictionary (which will be returned to the client as JSON, the flow works fine when it does not enter the if block but once the application flows into the if block, 500 internal server error exception is raised.
I have been searching over the net and asked multiple AIs but did not find any solution.</p>
<pre><code> [main.py]
 app = FastAPI()
 app.include_router(auth_router)
--------------------------------------------
 [auth.py]
 router = APIRouter(
 prefix='/v1/auth', tags=['Auth']
 )
 @router.post('/token')
 async def login(
 form_data: Annotated[OAuth2PasswordRequestForm, Depends()],
 db: Session= Depends(get_db)
 ):
 return login_service(
 email=form_data.username, 
 password=form_data.password, 
 db=db
 )
--------------------------------------------
 [auth_service.py]
 def login_service(email: str, password: str, db: Session) -&gt; dict[str, str]:
 user = db.exec(
 select(User).where(User.email == email)
 ).first()
 if not user or not user.email:
 raise HTTPException(
 status_code=status.HTTP_400_BAD_REQUEST,
 detail='No user found with the given email'
 ) 
 return {
 'access_token': user.email, 'token_type': 'bearer'
 }
</code></pre>

</summary>
</entry>
<entry>
<id>https://stackoverflow.com/q/79689434</id>
<re:rank scheme="https://stackoverflow.com">0</re:rank>
<title type="text">Connection failure: couldn't connect to host : how to externally connect to the memgraph kubernetes service?</title>
<category scheme="https://stackoverflow.com/tags" term="kubernetes" />
<category scheme="https://stackoverflow.com/tags" term="memgraphdb" />
<category scheme="https://stackoverflow.com/tags" term="kubernetes-nodeport" />
<category scheme="https://stackoverflow.com/tags" term="memgraph" />
<category scheme="https://stackoverflow.com/tags" term="loadbalancer" />
<author>
<name>Raphael10</name>
<uri>https://stackoverflow.com/users/14175733</uri>
</author>
<link rel="alternate" href="https://stackoverflow.com/questions/79689434/connection-failure-couldnt-connect-to-host-how-to-externally-connect-to-the" />
<published>2025-07-03T20:24:24Z</published>
<updated>2025-07-03T20:41:04Z</updated>
<summary type="html">
<p>I want to access the memgraph k8s service from outside
I tried with a LoadBalancer and then with NodePort, but didn't succeed:</p>
<p>LoadBalancer:</p>
<pre><code>(base) raphy@raohy:~/.talos/memgraph$ helm upgrade --install memgraph-024 memgraph/
memgraph --set service.type=LoadBalancer

(base) raphy@raohy:~$ kubectl get svc memgraph-024
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
memgraph-024 LoadBalancer aa.aaa.aaa.aa cc.c.cc.c 7687:31159/TCP 4h50m
</code></pre>
<p>Trying to connect to the memgraph-024 service I get &quot;couldn't connect to the host&quot; :</p>
<pre><code>(base) raphy@raohy:~$ mgconsole --host cc.c.cc.c --port 7687 --use-ssl=false
Connection failure: couldn't connect to host: Connection timed out
</code></pre>
<p>I then added the actual the control-plane node's IP as External-IP :</p>
<pre><code>(base) raphy@raohy:~/.talos/memgraph$ kubectl patch svc memgraph-024 -p '{&quot;spec&quot;:
{&quot;externalIPs&quot;:[&quot;bbb.bbb.bbb.bbb&quot;]}}
service/memgraph-024 patched

(base) raphy@raohy:~/.talos/memgraph$ kubectl get svc memgraph-024
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
memgraph-024 LoadBalancer aa.aaa.aaa.aa cc.c.cc.c,bbb.bbb.bbb.bbb 7687:31159/TCP 6h14m
</code></pre>
<p>I get &quot;couldn't connect to the host&quot; :</p>
<pre><code>(base) raphy@raohy:~$ mgconsole --host cc.c.cc.c --port 7687 --use-ssl=false
Connection failure: couldn't connect to host: Connection timed out

(base) raphy@raohy:~$ mgconsole --host bbb.bbb.bbb.bbb --port 7687 --use-ssl=false
Connection failure: couldn't connect to host: Connection refused
</code></pre>
<p>NodePort:</p>
<pre><code>(base) raphy@raohy:~/.talos/memgraph$ helm upgrade --install memgraph-024 memgraph/
memgraph --set service.type=NodePort

(base) raphy@raohy:~/.talos/memgraph$ kubectl get svc memgraph-024
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
memgraph-024 NodePort aa.aaa.aaa.aa bbb.bbb.bbb.bbb 7687:31159/TCP 6h25m
</code></pre>
<p>I get &quot;couldn't connect to the host&quot; :</p>
<pre><code>(base) raphy@raohy:~/.talos/memgraph$ mgconsole --host bbb.bbb.bbb.bbb --port 7687 --
use-ssl=false
Connection failure: couldn't connect to host: Connection refused


(base) raphy@raohy:~/.talos/memgraph$ mgconsole --host aa.aaa.aaa.aa --port 7687 --use-
ssl=false
Connection failure: couldn't connect to host: Connection timed out
</code></pre>
<p>What am I missing and/or doing wrong? How to externally connect to the kubernetes memgraph service?</p>

</summary>
</entry>
<entry>
<id>https://stackoverflow.com/q/79689424</id>
<re:rank scheme="https://stackoverflow.com">4</re:rank>
<title type="text">Rank values without skipping a rank for values after duplicates</title>
<category scheme="https://stackoverflow.com/tags" term="r" />
<category scheme="https://stackoverflow.com/tags" term="rank" />
<author>
<name>dcoy</name>
<uri>https://stackoverflow.com/users/12880070</uri>
</author>
<link rel="alternate" href="https://stackoverflow.com/questions/79689424/rank-values-without-skipping-a-rank-for-values-after-duplicates" />
<published>2025-07-03T20:14:11Z</published>
<updated>2025-07-03T20:36:41Z</updated>
<summary type="html">
<p>The returned vector must be the same length as the original; must not skip ranks; must give same rank for duplicate values.</p>
<p>Input:</p>
<pre><code>x &lt;- c(1, 5, 10, 10, 50)
</code></pre>
<p>Desired Output:</p>
<pre><code>[1] 1 2 3 3 4
</code></pre>
<p>Below is close but skips 4, and <code>ties.method = &quot;first&quot;</code> gives <code>1 2 3 4 5</code>. I can't use unique(), because that will return different length vector.</p>
<pre><code>rank(c(1, 5, 10, 10, 50), ties.method = &quot;min&quot;)
[1] 1 2 3 3 5
</code></pre>

</summary>
</entry>
<entry>
<id>https://stackoverflow.com/q/79689419</id>
<re:rank scheme="https://stackoverflow.com">0</re:rank>
<title type="text">How does `template for` iteration work in C++26?</title>
<category scheme="https://stackoverflow.com/tags" term="c++" />
<category scheme="https://stackoverflow.com/tags" term="for-loop" />
<category scheme="https://stackoverflow.com/tags" term="templates" />
<category scheme="https://stackoverflow.com/tags" term="range-based-loop" />
<category scheme="https://stackoverflow.com/tags" term="c++26" />
<author>
<name>Artem Selivanov</name>
<uri>https://stackoverflow.com/users/4467714</uri>
</author>
<link rel="alternate" href="https://stackoverflow.com/questions/79689419/how-does-template-for-iteration-work-in-c26" />
<published>2025-07-03T20:06:37Z</published>
<updated>2025-07-03T20:44:34Z</updated>
<summary type="html">
<p>I'm experimenting with the new C++ compile-time reflection features (as described in P2996R0) and I testing a simple <code>enum_to_string()</code> utility using <code>template for</code>:</p>
<pre><code>template &lt;typename E&gt;
 requires std::is_enum_v&lt;E&gt;
constexpr std::string enum_to_string(E value) {
 template for (constexpr auto e : std::meta::members_of(^E)) {
 if (value == [:e:]) {
 return std::string(std::meta::name_of(e));
 }
 }

 return &quot;&lt;unnamed&gt;&quot;;
} 
</code></pre>
<p>As I understand it, this is not a regular loop but rather a compile-time unrolling of repeated code with different template substitutions.</p>
<p>Is this mechanism compatible with the <code>begin()</code>/<code>end()</code> functions used by <code>range-based for</code> loops?</p>
<p>My concrete questions:</p>
<ol>
<li><p>What is the actual type returned by <code>std::meta::members_of(^E)</code>?</p>
</li>
<li><p>What enables it to be iterated using <code>template for</code>? Does <code>template for</code> rely on <code>begin()</code>/<code>end()</code>?</p>
</li>
<li><p>Are there any formal requirements for the right-hand side of a <code>template for</code>? Does it need to model a specific concept or structure?</p>
</li>
<li><p>Can a user-defined function return something that's usable in a <code>template for</code> loop?</p>
</li>
<li><p>Is there a way to define our own object that behaves like <code>members_of</code> or <code>enumerators_of</code>?</p>
</li>
</ol>

</summary>
</entry>
<entry>
<id>https://stackoverflow.com/q/79689397</id>
<re:rank scheme="https://stackoverflow.com">0</re:rank>
<title type="text">Cannot understand the behaviour of pandas case_when</title>
<category scheme="https://stackoverflow.com/tags" term="python" />
<category scheme="https://stackoverflow.com/tags" term="pandas" />
<author>
<name>karpan</name>
<uri>https://stackoverflow.com/users/2540336</uri>
</author>
<link rel="alternate" href="https://stackoverflow.com/questions/79689397/cannot-understand-the-behaviour-of-pandas-case-when" />
<published>2025-07-03T19:42:11Z</published>
<updated>2025-07-03T20:47:15Z</updated>
<summary type="html">
<p>I am trying to use the case_when of a pandas Series and I am not sure I understand why it behaves like below. I indicate the behaviour that looks odd to me. It seems it has to do with the index of the Series, but why?</p>
<pre class="lang-py prettyprint-override"><code>import pandas as pd
print(pd.__version__)
# 2.3.0
a = pd.Series([1, 2, 3, 4, 5], index=['a', 'b', 'c', 'd', 'e'], dtype='int')
b = pd.Series([1, 2, 3, 4, 5], index=['A', 'B', 'C', 'D', 'E'], dtype='int')
res = a.case_when(
 [(a.gt(3), 'greater than 3'),
 (a.lt(3), 'less than 3')])
print(res)
# a less than 3
# b less than 3
# c 3
# d greater than 3
# e greater than 3
res = a.case_when(
 [(a.gt(3), 'greater than 3'),
 (b.lt(3), 'less than 3')])
print(res)
# a less than 3
# b less than 3
# c less than 3 &lt;- why is this not 3?
# d greater than 3
# e greater than 3
res = a.case_when(
 [(b.gt(3), 'greater than 3'),
 (b.lt(3), 'less than 3')])
print(res)
# a greater than 3 &lt;- why is this not less than 3?
# b greater than 3 &lt;- why is this not less than 3?
# c greater than 3 &lt;- why is this not 3?
# d greater than 3
# e greater than 3
res = a.case_when(
 [(b.gt(3).to_list(), 'greater than 3'),
 (b.lt(3).to_list(), 'less than 3')])
print(res)
# a less than 3
# b less than 3
# c 3
# d greater than 3
# e greater than 3
</code></pre>

</summary>
</entry>
<entry>
<id>https://stackoverflow.com/q/79689360</id>
<re:rank scheme="https://stackoverflow.com">1</re:rank>
<title type="text">Can I set a language attribute on the col element of a table</title>
<category scheme="https://stackoverflow.com/tags" term="html" />
<category scheme="https://stackoverflow.com/tags" term="attributes" />
<category scheme="https://stackoverflow.com/tags" term="internationalization" />
<category scheme="https://stackoverflow.com/tags" term="accessibility" />
<author>
<name>paceaux</name>
<uri>https://stackoverflow.com/users/1045901</uri>
</author>
<link rel="alternate" href="https://stackoverflow.com/questions/79689360/can-i-set-a-language-attribute-on-the-col-element-of-a-table" />
<published>2025-07-03T19:14:27Z</published>
<updated>2025-07-03T20:33:41Z</updated>
<summary type="html">
<p>I have a table that has mixed languages. One column has English and the other column has another language. Is it possible to set the language for that column at a <em>column level</em> or do I need to set the language at each cell.</p>
<p>for example, would this produce a properly accessible table for anyone using a screenreader:</p>
<pre><code>&lt;table&gt;
 &lt;colgroup&gt;
 &lt;col lang=&quot;en&quot; /&gt;
 &lt;col lang=&quot;fr&quot; /&gt;
 &lt;/colgroup&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th id=&quot;product-name&quot; lang=&quot;fr&quot;&gt;Produit&lt;/th&gt;
 &lt;th id=&quot;product-cta&quot;&gt;Essai de Produit&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;th headers=&quot;product-name&quot; id=&quot;widgetos&quot;&gt;WidgetOS&lt;/th&gt;
 &lt;td headers=&quot;widgetos product-cta&quot;&gt;&lt;a href=&quot;#&quot;&gt;essaye-le&lt;/a&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;th headers=&quot;product-name&quot; id=&quot;widgetplugins&quot;&gt;Widget Plugins&lt;/th&gt;
 &lt;td headers=&quot;widgetplugins product-cta&quot;&gt;&lt;a href=&quot;#&quot;&gt;essaye-le&lt;/a&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
</code></pre>
<p><em>or</em> do I have no choice but to set the <code>lang</code> at each table cell:</p>
<pre><code>&lt;table&gt;
 &lt;thead lang=&quot;fr&quot;&gt;
 &lt;tr&gt;
 &lt;th id=&quot;product-name&quot;Produit&lt;/th&gt;
 &lt;th id=&quot;product-cta&quot;&gt;Essai de Produit&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;th headers=&quot;product-name&quot; id=&quot;widgetos&quot; lang=&quot;en&quot;&gt;WidgetOS&lt;/th&gt;
 &lt;td headers=&quot;widgetos product-cta&quot; lang=&quot;fr&quot;&gt;&lt;a href=&quot;#&quot;&gt;essaye-le&lt;/a&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;th headers=&quot;product-name&quot; id=&quot;widgetplugins&quot; lang=&quot;en&quot;&gt;Widget Plugins&lt;/th&gt;
 &lt;td headers=&quot;widgetplugins product-cta&quot; lang=&quot;fr&quot;&gt;&lt;a href=&quot;#&quot;&gt;essaye-le&lt;/a&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
 
</code></pre>

</summary>
</entry>
<entry>
<id>https://stackoverflow.com/q/79689339</id>
<re:rank scheme="https://stackoverflow.com">-2</re:rank>
<title type="text">Import vars, constant, arrays from another .js file</title>
<category scheme="https://stackoverflow.com/tags" term="javascript" />
<author>
<name>HIMYM</name>
<uri>https://stackoverflow.com/users/28686468</uri>
</author>
<link rel="alternate" href="https://stackoverflow.com/questions/79689339/import-vars-constant-arrays-from-another-js-file" />
<published>2025-07-03T18:47:31Z</published>
<updated>2025-07-03T20:35:43Z</updated>
<summary type="html">
<p>I'm starting to practice with JavaScript and I'm stuck because I can't find a way to import a .js file that only contains data from another file that contains the code that will use the data.
I've tried import, use, and require, but I always get the same error.</p>
<p><code>somedata.js</code></p>
<pre><code>myhost = “localhost”;
myuser = “root”;
mypassword = “dumb”;
mydatabase = “yourdb”;
valid_values = [‘P’,‘M’,'S',‘CM’,‘CP’,‘CS’,‘VM’,‘VP’,‘VS’,‘EM’,‘EP’,‘ES’,‘AM’,‘AP’,‘AS’,‘BM’]
headers = [‘A’, ‘B’, ‘C’, ‘D’, ‘E’, ‘F’, ‘G’, ‘H’, ‘I’, ‘J’, ‘K’]
</code></pre>
<p><code>mainfile.js</code></p>
<pre><code>import('somedata.js')

mysql = require('mysql');
con = mysql.createConnection({
host: myhost,
user: myuser
password: mypassword,
database: mydatabase
});
con.connect(function(err) {
query =“SELECT * FROM table WHERE year= ? AND month = ?”
 var year = 2025
 var month = ‘7’
 if (err) throw err;
 con.query(query, [year, month], function (err, result) {
 if (err) throw err;
 console.log(result);
 con.end()
 });
});
</code></pre>

</summary>
</entry>
<entry>
<id>https://stackoverflow.com/q/79689322</id>
<re:rank scheme="https://stackoverflow.com">1</re:rank>
<title type="text">How to reconcile a constexpr function's argument being not constexpr?</title>
<category scheme="https://stackoverflow.com/tags" term="c++" />
<category scheme="https://stackoverflow.com/tags" term="constexpr" />
<category scheme="https://stackoverflow.com/tags" term="constexpr-function" />
<author>
<name>sh1</name>
<uri>https://stackoverflow.com/users/2417578</uri>
</author>
<link rel="alternate" href="https://stackoverflow.com/questions/79689322/how-to-reconcile-a-constexpr-functions-argument-being-not-constexpr" />
<published>2025-07-03T18:28:20Z</published>
<updated>2025-07-03T20:39:49Z</updated>
<summary type="html">
<p>A simple function like:</p>
<pre class="lang-cpp prettyprint-override"><code>constexpr int f(int x) {
 constexpr int y = x;
 return y;
}
</code></pre>
<p>Seems to not be legal because <code>x</code> is not <code>constexpr</code>. This complaint is made even before I <em>call</em> the function, which seems a little unfair, because my intent is to only use it with arguments that are <code>constexpr</code>.</p>
<p>I can <em>sort of</em> work around that problem this with:</p>
<pre class="lang-cpp prettyprint-override"><code>template &lt;int x&gt;
constexpr int f() {
 constexpr int y = x;
 return y;
}
</code></pre>
<p>But in real usage this becomes challenging because the argument might be something like a <code>std::string_view</code> instead of an <code>int</code> and that's not suitable as a template argument because it generates more complicated errors regarding the object's internal implementation.</p>
<p>Here's an illustration of where this matters:</p>
<pre class="lang-cpp prettyprint-override"><code>constexpr std::array easy{'h', 'e', 'l', 'l', 'o'};

constexpr struct Hard {
 constexpr Hard(int n) : size_(n) {}
 size_t size_;
 constexpr size_t size() const { return size_; }
} hard(10);

constexpr std::string_view nope{&quot;hello&quot;};

template &lt;typename T&gt;
constexpr auto f(T s) {
 return std::array&lt;char, s.size()&gt;();
}

auto arr_easy = f(easy); // OK
auto arr_hard = f(hard); // `s` isn't constexpr even though `hard` is
auto arr_nope = f(nope); // `s` isn't constexpr even though `nope` is

// Alternative approach:
template &lt;typename T, T s&gt;
constexpr auto tf() {
 return std::array&lt;char, s.size()&gt;();
}

auto tmpl_arr_easy = tf&lt;decltype(easy), easy&gt;(); // OK
auto tmpl_arr_hard = tf&lt;decltype(hard), hard&gt;(); // OK
auto tmpl_arr_nope = tf&lt;decltype(nope), nope&gt;(); // can't use std::string_view as template argument
</code></pre>
<p>How do I write a <code>constexpr</code> function which takes only <code>constexpr</code> arguments?</p>

</summary>
</entry>
<entry>
<id>https://stackoverflow.com/q/79689151</id>
<re:rank scheme="https://stackoverflow.com">3</re:rank>
<title type="text">Google Crawler cant find my privacy policy link NEXT JS 15</title>
<category scheme="https://stackoverflow.com/tags" term="next.js" />
<category scheme="https://stackoverflow.com/tags" term="google-cloud-console" />
<author>
<name>Rahul Mishra</name>
<uri>https://stackoverflow.com/users/23854782</uri>
</author>
<link rel="alternate" href="https://stackoverflow.com/questions/79689151/google-crawler-cant-find-my-privacy-policy-link-next-js-15" />
<published>2025-07-03T16:05:01Z</published>
<updated>2025-07-03T20:42:39Z</updated>
<summary type="html">
<h1>Google Search Console Crawler Can't Find Privacy Policy Link During Verification</h1>
<h2>Problem</h2>
<p>Google Search Console's verification crawler cannot find my privacy policy page, preventing successful homepage verification. The error shows that Google's crawler is unable to locate the privacy policy URL.</p>
<h2>Setup Details</h2>
<ul>
<li><strong>Framework</strong>: Next.js</li>
<li><strong>Issue</strong>: Google verification crawler returns error when trying to access privacy policy</li>
<li><strong>Current Status</strong>: Privacy policy link is visible in both header and footer, and included in sitemap</li>
</ul>
<h2>Current Implementation</h2>
<h3>Sitemap Configuration (<code>sitemap.ts</code>)</h3>
<pre class="lang-js prettyprint-override"><code>import { siteConfig } from '@/config/site-config';
import type { MetadataRoute } from 'next';

export default function sitemap(): MetadataRoute.Sitemap {
 const baseUrl = siteConfig.url;
 
 return [
 {
 url: baseUrl,
 lastModified: new Date(),
 changeFrequency: 'weekly',
 priority: 1.0,
 },
 {
 url: `${baseUrl}privacy-policy`,
 lastModified: new Date(),
 changeFrequency: 'monthly',
 priority: 0.9,
 },
 {
 url: `${baseUrl}terms`,
 lastModified: new Date(),
 changeFrequency: 'monthly',
 priority: 0.9,
 },
 {
 url: `${baseUrl}pricing`,
 lastModified: new Date(),
 changeFrequency: 'weekly',
 priority: 0.8,
 },
 {
 url: `${baseUrl}support`,
 lastModified: new Date(),
 changeFrequency: 'weekly',
 priority: 0.7,
 },
 ];
}
</code></pre>
<h3>Privacy Policy Link Implementation</h3>
<pre class="lang-jsx prettyprint-override"><code>&lt;Link href=&quot;/privacy-policy&quot; className=&quot;text-sm text-muted-foreground hover:text-primary&quot;&gt;
 Privacy Policy
&lt;/Link&gt;
</code></pre>
<h3>Robots.txt Configuration (<code>robots.ts</code>)</h3>
<pre class="lang-js prettyprint-override"><code>import { siteConfig } from '@/config/site-config';
import type { MetadataRoute } from 'next';

export default function robots(): MetadataRoute.Robots {
 return {
 rules: {
 userAgent: '*',
 allow: '/',
 disallow: ['/api/'],
 },
 sitemap: `${siteConfig.url}sitemap.xml`,
 };
}
</code></pre>
<h2>What I've Tried</h2>
<ul>
<li>Privacy policy page is accessible via direct URL</li>
<li>Link is present in both header and footer</li>
<li>Page is included in sitemap with proper priority</li>
<li>Robots.txt allows crawling of the page</li>
</ul>
<h2>Configuration Details</h2>
<ul>
<li><strong>Base URL</strong>: <code>https://www.nebulaodyssey.com/</code> (note: ends with slash)</li>
<li><strong>Privacy Policy URL</strong>: Resolves to <code>https://www.nebulaodyssey.com/privacy-policy</code></li>
<li><strong>URL Construction</strong>: <code>${baseUrl}privacy-policy</code> is correct since baseUrl already ends with <code>/</code></li>
</ul>
<h2>Questions</h2>
<ol>
<li><strong>Page Route</strong>: Is there a specific file structure required for the privacy policy page in Next.js App Router?</li>
<li><strong>Crawler Access</strong>: Are there additional meta tags or configurations needed for Google's verification crawler?</li>
<li><strong>Content Requirements</strong>: Does the privacy policy page need specific content or formatting for Google verification?</li>
<li><strong>Debugging</strong>: How can I test if the privacy policy page is actually accessible to crawlers?</li>
<li><strong>Verification Process</strong>: Are there alternative ways to satisfy Google's privacy policy requirement during verification?</li>
</ol>
<h2>Expected Behavior</h2>
<p>Google's verification crawler should be able to find and access the privacy policy page at <code>/privacy-policy</code> route.</p>
<h2>Actual Behavior</h2>
<p>Verification fails with crawler unable to locate the privacy policy page.</p>
<hr />
<p><strong>Screenshots:</strong></p>
<ul>
<li><a href="https://i.sstatic.net/Jf1HWOQ2.png" rel="nofollow noreferrer">Google Console Error</a></li>
<li><a href="https://i.sstatic.net/QKrdxtnZ.png" rel="nofollow noreferrer">Site Footer</a></li>
<li><a href="https://i.sstatic.net/feZWly6t.png" rel="nofollow noreferrer">Site Header</a></li>
</ul>
<p>Given that the configuration looks correct and the link is prominently displayed in the header and footer, the crawler should have been able to find it but it doesnt help.</p>

</summary>
</entry>
<entry>
<id>https://stackoverflow.com/q/79689145</id>
<re:rank scheme="https://stackoverflow.com">2</re:rank>
<title type="text">Query to find the product name which has a continuous increase in sales every year</title>
<category scheme="https://stackoverflow.com/tags" term="sql" />
<category scheme="https://stackoverflow.com/tags" term="sql-server" />
<category scheme="https://stackoverflow.com/tags" term="aggregate-functions" />
<category scheme="https://stackoverflow.com/tags" term="common-table-expression" />
<author>
<name>Rohan Srivastwa</name>
<uri>https://stackoverflow.com/users/16753548</uri>
</author>
<link rel="alternate" href="https://stackoverflow.com/questions/79689145/query-to-find-the-product-name-which-has-a-continuous-increase-in-sales-every-ye" />
<published>2025-07-03T15:59:24Z</published>
<updated>2025-07-03T20:35:38Z</updated>
<summary type="html">
<p>Product table with columns - PRODUCT_ID PRODUCT_NAME</p>
<div class="s-table-container"><table class="s-table">
<thead>
<tr>
<th>PRODUCT_ID</th>
<th>PRODUCT_NAME</th>
</tr>
</thead>
<tbody>
<tr>
<td>100</td>
<td>NOKIA</td>
</tr>
<tr>
<td>200</td>
<td>IPHONE</td>
</tr>
<tr>
<td>300</td>
<td>SAMSUNG</td>
</tr>
<tr>
<td>400</td>
<td>OPPO</td>
</tr>
</tbody>
</table></div>
<p>Sales table with columns - SALE_ID PRODUCT_ID YEAR QUANTITY Price</p>
<div class="s-table-container"><table class="s-table">
<thead>
<tr>
<th>SALE_ID</th>
<th>PRODUCT_ID</th>
<th>YEAR</th>
<th>QUANTITY</th>
<th>PRICE</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>100</td>
<td>2010</td>
<td>25</td>
<td>5000</td>
</tr>
<tr>
<td>2</td>
<td>100</td>
<td>2011</td>
<td>16</td>
<td>5000</td>
</tr>
<tr>
<td>3</td>
<td>100</td>
<td>2012</td>
<td>8</td>
<td>5000</td>
</tr>
<tr>
<td>4</td>
<td>200</td>
<td>2010</td>
<td>10</td>
<td>9000</td>
</tr>
<tr>
<td>5</td>
<td>200</td>
<td>2011</td>
<td>15</td>
<td>9000</td>
</tr>
<tr>
<td>6</td>
<td>200</td>
<td>2012</td>
<td>20</td>
<td>9000</td>
</tr>
<tr>
<td>7</td>
<td>300</td>
<td>2010</td>
<td>20</td>
<td>7000</td>
</tr>
<tr>
<td>8</td>
<td>300</td>
<td>2011</td>
<td>18</td>
<td>7000</td>
</tr>
<tr>
<td>9</td>
<td>300</td>
<td>2012</td>
<td>20</td>
<td>7000</td>
</tr>
<tr>
<td>10</td>
<td>400</td>
<td>2010</td>
<td>15</td>
<td>7000</td>
</tr>
<tr>
<td>11</td>
<td>400</td>
<td>2011</td>
<td>18</td>
<td>7000</td>
</tr>
<tr>
<td>12</td>
<td>400</td>
<td>2012</td>
<td>22</td>
<td>7000</td>
</tr>
<tr>
<td>13</td>
<td>400</td>
<td>2013</td>
<td>23</td>
<td>7000</td>
</tr>
</tbody>
</table></div>
<p>Here Quantity is the number of products sold each year. Price is the sale price of each product.
Write a SQL query to find the product name which has a continuous increase in sales every year?</p>
<p>Output:
PRODUCT_NAME</p>
<pre><code>IPHONE

OPPO
</code></pre>
<p>I tried the below query, it can solve if we have only one product_id with increasing value, but it fails when we have multiple product_ids with increasing sales values.</p>
<pre class="lang-sql prettyprint-override"><code>WITH cte1 AS
(
 SELECT a.*,
 (a.QUANTITY * a.PRICE) AS total_sales,
 LAG(a.QUANTITY * a.PRICE, 1, a.QUANTITY * a.PRICE) 
 OVER(PARTITION BY a.product_id ORDER BY year) as next_sales,
 B.PRODUCT_NAME
 FROM Sales AS a
 INNER JOIN Products AS b
 ON a.PRODUCT_ID = b.PRODUCT_ID
), 
cte2 AS
(
 SELECT *,
 (total_sales - next_sales) AS diff,
 CASE WHEN (total_sales - next_sales) &gt; 0 THEN 1
 WHEN (total_sales - next_sales) &lt; 0 THEN 0
 ELSE 0
 END AS val
 FROM cte1
),
cte3 AS
(
 SELECT
 PRODUCT_ID,
 SUM(val) AS max_val
 FROM cte2
 GROUP BY
 PRODUCT_ID
)
SELECT
 PRODUCT_ID
FROM cte3
WHERE max_val = (SELECT MAX(max_val) FROM cte3);
</code></pre>

</summary>
</entry>
<entry>
<id>https://stackoverflow.com/q/79687191</id>
<re:rank scheme="https://stackoverflow.com">0</re:rank>
<title type="text">Error: Invalid data encountered during Robot Framework result import into Xray</title>
<category scheme="https://stackoverflow.com/tags" term="gitlab-ci" />
<category scheme="https://stackoverflow.com/tags" term="robotframework" />
<category scheme="https://stackoverflow.com/tags" term="jira-xray" />
<author>
<name>sabrine tounsi</name>
<uri>https://stackoverflow.com/users/14707767</uri>
</author>
<link rel="alternate" href="https://stackoverflow.com/questions/79687191/error-invalid-data-encountered-during-robot-framework-result-import-into-xray" />
<published>2025-07-02T09:35:55Z</published>
<updated>2025-07-03T20:39:54Z</updated>
<summary type="html">
<p>I'm trying to synchronize Robot Framework test results that are executed via GitLab CI into Xray, but the import fails with an 'invalid data' error. Could you help identify the root cause or suggest how to properly format the results for Xray?</p>
<p><strong>Robot Framework version: 7.0</strong></p>
<p>Here is my <code>gitlab-ci.yml</code> file:</p>
<pre class="lang-yaml prettyprint-override"><code> - echo &quot;Uploading output.xml to Xray...&quot;
 - &gt;
 curl --trace-ascii - \
 -H &quot;Authorization: Bearer $XRAY_TOKEN&quot; \
 -F results=@reports/output.xml \
 &quot;https://eu.xray.cloud.getxray.app/api/v2/import/execution/robot?projectKey=BC&amp;testPlanKey=BC-8&quot;
</code></pre>
<p>Here is my <code>output.xml</code> file;</p>
<pre class="lang-xml prettyprint-override"><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;robot generator=&quot;Robot 7.0 (Python 3.9.22 on linux)&quot; generated=&quot;2025-07-01T12:59:01.526616&quot; rpa=&quot;false&quot; schemaversion=&quot;5&quot;&gt;
&lt;suite id=&quot;s1&quot; name=&quot;Frontend-Test&quot; source=&quot;/builds/tounsisabrine/bookcart-robot/frontend-test&quot;&gt;
&lt;suite id=&quot;s1-s1&quot; name=&quot;Login.Feature&quot; source=&quot;/builds/tounsisabrine/bookcart-robot/frontend-test/login.feature.robot&quot;&gt;
&lt;test id=&quot;s1-s1-t1&quot; name=&quot;BC-7: Successful login with valid credentials&quot; line=&quot;8&quot;&gt;
&lt;kw name=&quot;Begin Test&quot; owner=&quot;common&quot; type=&quot;SETUP&quot;&gt;
&lt;kw name=&quot;Set Selenium Speed&quot; owner=&quot;SeleniumLibrary&quot;&gt;
&lt;arg&gt;.2s&lt;/arg&gt;
&lt;doc&gt;Sets the delay that is waited after each Selenium command.&lt;/doc&gt;
&lt;status status=&quot;PASS&quot; start=&quot;2025-07-01T12:58:09.692484&quot; elapsed=&quot;0.000472&quot;/&gt;
&lt;/kw&gt;
</code></pre>
<p>Always getting this error in GitLab CI execution:</p>
<pre class="lang-none prettyprint-override"><code>% Total % Received % Xferd Average Speed Time Time Time Current
 Dload Upload Total Spent Left Speed
100 46003 100 60 100 45943 84 64416 --:--:-- --:--:-- --:--:-- 64429
{&quot;error&quot;:&quot;Missing data in the robot results import request&quot;}
Cleaning up project directory and file based variables
</code></pre>

</summary>
</entry>
<entry>
<id>https://stackoverflow.com/q/79562986</id>
<re:rank scheme="https://stackoverflow.com">0</re:rank>
<title type="text">I have a problem with the sound script in Roblox Studio</title>
<category scheme="https://stackoverflow.com/tags" term="roblox" />
<author>
<name>Арсений</name>
<uri>https://stackoverflow.com/users/30214132</uri>
</author>
<link rel="alternate" href="https://stackoverflow.com/questions/79562986/i-have-a-problem-with-the-sound-script-in-roblox-studio" />
<published>2025-04-08T20:21:52Z</published>
<updated>2025-07-03T20:44:02Z</updated>
<summary type="html">
<p>I have a model that appears and disappears repeatedly. I want to add a sound that plays when the model appears, but I’m having trouble limiting the sound’s range. It’s currently audible across the entire map, and I only want it to be heard within a certain radius of the model. I’ve tried various methods using <code>RollOffMinDistance</code> and <code>RollOffMaxDistance</code>, but none of them seem to work correctly. I’ve searched YouTube and other places, but haven’t found a solution.</p>
<pre class="lang-lua prettyprint-override"><code>local model = script.Parent -- We get a link to the model (platform)
local interval = 3 -- Interval between disappearing and appearing (in seconds)
local soundId = &quot;rbxassetid://9125626281&quot; -- ID of the sound
local soundVolume = 0.5 -- Volume of the sound (from 0 to 1)
local rollOffMinDistance = 5 -- Minimum distance where the sound is heard
local rollOffMaxDistance = 20 -- Maximum distance where the sound is heard
local soundDelay = 0.1 -- Delay before playing the sound (in seconds)

-- Creating a Sound object inside the script
local sound = Instance.new(&quot;Sound&quot;)
sound.SoundId = soundId
sound.Volume = soundVolume
sound.RollOffMode = Enum.RollOffMode.LinearSquare -- Or LinearTapered
sound.RollOffMinDistance = rollOffMinDistance
sound.RollOffMaxDistance = rollOffMaxDistance
sound.Looped = false -- The sound should not loop
sound.Parent = model -- Setting the parent of the sound to the model

-- Function to set the visibility and collision of all parts of the platform
local function setVisible(visible)
Iterating over all child elements of the model
for i, child in ipairs(model:GetChildren()) do
Checking if the child element is a part (BasePart)
if child:IsA(&quot;BasePart&quot;) then
Setting transparency and collision depending on the visible value
child.Transparency = visible and 0 or 1
child.CanCollide = visible
end
end

-- Playing the sound with a delay
if visible then
task.delay(soundDelay, function()
sound:Play()
end)
end
end

-- Infinite loop for changing the visibility of the platform
while true do
setVisible(false) -- Make invisible
task.wait(interval)
setVisible(true) -- Make visible
task.wait(interval)
end
</code></pre>

</summary>
</entry>
<entry>
<id>https://stackoverflow.com/q/78656704</id>
<re:rank scheme="https://stackoverflow.com">-3</re:rank>
<title type="text">Python-Flask Application issue [closed]</title>
<category scheme="https://stackoverflow.com/tags" term="python" />
<category scheme="https://stackoverflow.com/tags" term="forms" />
<category scheme="https://stackoverflow.com/tags" term="flask-sqlalchemy" />
<category scheme="https://stackoverflow.com/tags" term="fee" />
<author>
<name>Mehmood Ashraf</name>
<uri>https://stackoverflow.com/users/25678128</uri>
</author>
<link rel="alternate" href="https://stackoverflow.com/questions/78656704/python-flask-application-issue" />
<published>2024-06-22T17:10:18Z</published>
<updated>2025-07-03T20:28:43Z</updated>
<summary type="html">
<p>I am building student management system using flask for this i want to make student fee form based on below criteria</p>
<ol>
<li><p>Select the course and then relative subcourse and then list of student (name, father name, cnic, phone number, email address) appeared which are enrolled in subcourse - course with enter fee and edit fee button</p>
</li>
<li><p>When I click on enter fee button then new form open with fee details as following</p>
<p>a. Date bydefault today<br />
b. Admission fee<br />
c. Admission discount<br />
d. Net admission fee (formula is admission fee – admission discount)<br />
e. Installment type (one time, monthly)<br />
f. Fee amount<br />
g. Fee discount (absolute)<br />
h. Fee % discount (show the discount amount as (fee amount * fee % dicsount)<br />
i. Other charges<br />
j. Net fee payable, formulta is (fee amount – fee discount – fee % discount- other charges)<br />
k. In case of monthly then appeared (month and year)<br />
l. Payment mode (Cash, Online transfer, credit card)<br />
m. Fee Paid<br />
n. Outstanding Fee amount (show the balance amount formula is (net fee payabale – fee paid)</p>
</li>
<li><p>I case of edit fee then new form of edit fee appeared against students and we can edit / add fees of students.</p>
</li>
</ol>
<p>I am facing error which is facing error of</p>
<pre><code>sqlalchemy.exc.IntegrityError: (pymysql.err.IntegrityError) 
(1048, &quot;Column 'subcourse_id' cannot be null&quot;)
</code></pre>
<p>My db code is</p>
<pre><code>class Fee(db.Model):

 id = db.Column(db.Integer, primary_key=True)
 student_id = db.Column(db.Integer, db.ForeignKey('student.id'), nullable=False)
 subcourse_id = db.Column(db.Integer, db.ForeignKey('sub_course.id'), nullable=False)
 course_id = db.Column(db.Integer, db.ForeignKey('course.id'), nullable=False)
 fee_amount = db.Column(db.Float, nullable=False)
 discount_amount = db.Column(db.Float, nullable=True)
 discount_percentage = db.Column(db.Float, nullable=True)
 net_fee = db.Column(db.Float, nullable=False)
 installment_type = db.Column(db.String(10), nullable=False)
 year = db.Column(db.String(10), nullable=True)
 month = db.Column(db.String(10), nullable=True)
 payment_made = db.Column(db.Float, nullable=True)
 other_charges = db.Column(db.Float, nullable=True)
 date = db.Column(db.Date, default=datetime.utcnow, nullable=False)
 admission_fee = db.Column(db.Float, nullable=True)
 admission_discount = db.Column(db.Float, nullable=True)
 balance_admission_fee = db.Column(db.Float, nullable=True)
</code></pre>
<p>and my function is</p>
<pre><code>@app.route('/get_subcourses/&lt;int:course_id&gt;')
def get_subcourses(course_id):
 subcourses = SubCourse.query.filter_by(course_id=course_id).all()
 subcourses_list = [{'id': sc.id, 'name': sc.name} for sc in subcourses]
 return jsonify({'subcourses': subcourses_list})

@app.route('/get_students/&lt;int:subcourse_id&gt;')
def get_students(subcourse_id):
 students = Student.query.filter_by(subcourse_id=subcourse_id).all()
 students_list = [{'id': s.id, 'name': s.name, 'father_name': s.father_name, 'cnic': s.cnic, 'mobile': s.mobile} for s in students]
 return jsonify({'students': students_list})

# Route to handle the fee entry form submission
@app.route('/fee_selection', methods=['GET', 'POST'])
def fee_selection():
 courses = Course.query.all()
 subcourses = SubCourse.query.all()
 return render_template('fee_selection.html', courses=courses, subcourses=subcourses)

@app.route('/fee_form', methods=['GET', 'POST'])
def fee_form():
 if request.method == 'POST':
 student_id = request.form['student_id']
 subcourse_id = request.form['subcourse_id']
 course_id = request.form['course_id']
 date = request.form['date']
 admission_fee = request.form['admission_fee']
 admission_discount = request.form['admission_discount']
 balance_admission_fee = request.form['balance_admission_fee']
 installment_type = request.form['installment_type']
 fee_amount = request.form['fee_amount']
 discount_amount = request.form['discount_amount']
 discount_percentage = request.form['discount_percentage']
 other_charges = request.form['other_charges']
 
 month = request.form.get('month')
 year = request.form.get('year')
 payment_mode = request.form['payment_mode']
 payment_made = request.form['payment_made']
 net_fee = request.form['net_fee']

 
 fee = Fee(
 student_id=student_id,
 # subcourse_id=subcourse_id,
 # course_id=course_id,
 date=date,
 fee_amount=fee_amount,
 discount_amount=discount_amount,
 discount_percentage=discount_percentage,
 net_fee=net_fee,
 installment_type=installment_type,
 year=year,
 month=month,
 payment_made=payment_made,
 
 other_charges=other_charges,
 
 admission_fee=admission_fee,
 admission_discount=admission_discount,
 balance_admission_fee=balance_admission_fee
 )

 db.session.add(fee)
 db.session.commit()
 return redirect(url_for('fee_selection'))

 courses = Course.query.all()
 subcourses = SubCourse.query.all()
 fees = Fee.query.all()
 today = datetime.today().strftime('%Y-%m-%d')
 return render_template('fee_form.html',fees=fees, courses=courses, subcourses=subcourses, today=today)


# Route to fetch existing fee details for editing
@app.route('/get_fee/&lt;int:student_id&gt;', methods=['GET'])
def get_fee(student_id):
 fee = Fee.query.filter_by(student_id=student_id).first()
 if fee:
 fee_data = {
 'id': fee.id,
 'fee_amount': fee.fee_amount,
 'discount_amount': fee.discount_amount,
 'discount_percentage': fee.discount_percentage,
 'net_fee': fee.net_fee,
 'installment_type': fee.installment_type,
 'year': fee.year,
 'month': fee.month,
 'payment_made': fee.payment_made,
 'other_charges': fee.other_charges,
 'date': fee.date.strftime('%Y-%m-%d'),
 'admission_fee': fee.admission_fee,
 'admission_discount': fee.admission_discount,
 'balance_admission_fee': fee.balance_admission_fee
 }
 return jsonify(fee_data)
 return jsonify(None)
</code></pre>
<p>Here is my html codes including js codes</p>
<p>fee_selection.html code</p>
<pre><code>{% extends &quot;base.html&quot; %}

{% block title %}Fees{% endblock %}


{% block content %}
 &lt;h2&gt;Add Fee&lt;/h2&gt;
 &lt;div class=&quot;container mt-5&quot;&gt;
 &lt;h2&gt;Fee Form&lt;/h2&gt;
 &lt;div class=&quot;form-group&quot;&gt;
 &lt;label for=&quot;course_id&quot;&gt;Course:&lt;/label&gt;
 &lt;select class=&quot;form-control&quot; id=&quot;course_id&quot; name=&quot;course_id&quot; required&gt;
 &lt;option value=&quot;&quot;&gt;Select Course&lt;/option&gt;
 {% for course in courses %}
 &lt;option value=&quot;{{ course.id }}&quot;&gt;{{ course.name }}&lt;/option&gt;
 {% endfor %}
 &lt;/select&gt;
 &lt;/div&gt;
 &lt;div class=&quot;form-group&quot;&gt;
 &lt;label for=&quot;subcourse_id&quot;&gt;Subcourse:&lt;/label&gt;
 &lt;select class=&quot;form-control&quot; id=&quot;subcourse_id&quot; name=&quot;subcourse_id&quot; required&gt;
 &lt;option value=&quot;&quot;&gt;Select Subcourse&lt;/option&gt;
 &lt;/select&gt;
 &lt;/div&gt;
 &lt;div class=&quot;form-group&quot;&gt;
 &lt;label for=&quot;student_id&quot;&gt;Student:&lt;/label&gt;
 &lt;div id=&quot;student_list&quot;&gt;
 &lt;table border=&quot;1&quot; id=&quot;students-table&quot; style=&quot;display:none;&quot;&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th&gt;Student Name&lt;/th&gt;
 &lt;th&gt;Father Name&lt;/th&gt;
 &lt;th&gt;CNIC&lt;/th&gt;
 &lt;th&gt;Mobile Number&lt;/th&gt;
 &lt;th&gt;Actions&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody id=&quot;students-tbody&quot;&gt;
 &lt;!-- Student rows will be appended here by JavaScript --&gt;
 &lt;/tbody&gt;
 &lt;/table&gt;&lt;br&gt;
 &lt;/div&gt;
 &lt;/div&gt;
 

 &lt;script&gt;
 
 document.getElementById('course_id').addEventListener('change', function() {
 const courseId = this.value;
 fetch(`/get_subcourses/${courseId}`)
 .then(response =&gt; response.json())
 .then(data =&gt; {
 const subcourseSelect = document.getElementById('subcourse_id');
 subcourseSelect.innerHTML = '&lt;option value=&quot;&quot;&gt;Select Subcourse&lt;/option&gt;';
 data.subcourses.forEach(subcourse =&gt; {
 subcourseSelect.innerHTML += `&lt;option value=&quot;${subcourse.id}&quot;&gt;${subcourse.name}&lt;/option&gt;`;
 });
 });
});
document.getElementById('subcourse_id').addEventListener('change', function() {
 const subcourseId = this.value;
 fetch(`/get_students/${subcourseId}`)
 .then(response =&gt; response.json())
 .then(data =&gt; {
 const studentsTable = document.getElementById('students-table');
 const studentsTbody = document.getElementById('students-tbody');
 studentsTbody.innerHTML = '';
 if (data.students.length &gt; 0) {
 studentsTable.style.display = 'block';
 data.students.forEach(student =&gt; {
 studentsTbody.innerHTML += `
 &lt;tr&gt;
 &lt;td&gt;${student.name}&lt;/td&gt;
 &lt;td&gt;${student.father_name}&lt;/td&gt;
 &lt;td&gt;${student.cnic}&lt;/td&gt;
 &lt;td&gt;${student.mobile}&lt;/td&gt;
 &lt;td&gt;
 &lt;button onclick=&quot;enterFee(${student.id})&quot;&gt;Enter Fee&lt;/button&gt;
 &lt;button onclick=&quot;editFee(${student.id})&quot;&gt;Edit Fee&lt;/button&gt;
 &lt;/td&gt;
 
 &lt;/tr&gt;
 `;
 });
 } else {
 studentsTable.style.display = 'none';
 }
 });
 }); 
 

 function enterFee(studentId) {
 window.location.href = '/fee_form?student_id=' + studentId ;
 
 }

 function editFee(studentId) {
 window.location.href = '/fee_form?student_id=' + studentId + '&amp;edit=true';
 }

 
 &lt;/script&gt;
{% endblock %}
</code></pre>
<p>and fee_form.html code is</p>
<pre><code>{% extends &quot;base.html&quot; %}

{% block title %}Fees{% endblock %}

{% block content %}
&lt;h1&gt;Fee Form&lt;/h1&gt;
 &lt;form method=&quot;POST&quot; action=&quot;/fee_form&quot;&gt;
 &lt;input type=&quot;hidden&quot; name=&quot;fee_id&quot; id=&quot;fee_id&quot;&gt;
 &lt;input type=&quot;number&quot; name=&quot;student_id&quot; id=&quot;student_id&quot; value=&quot;{{ 'student_id' }}&quot;&gt;
 
 &lt;input type=&quot;number&quot; name=&quot;course_id&quot; id = &quot;course_id&quot; value=&quot;{{ 'student.course_id' }}&quot;&gt;
 &lt;input type=&quot;number&quot; name=&quot;subcourse_id&quot; value=&quot;{{ subcourse_id }}&quot;&gt;
 
 &lt;label for=&quot;date&quot;&gt;Date:&lt;/label&gt;
 &lt;input type=&quot;date&quot; id=&quot;date&quot; name=&quot;date&quot; value=&quot;{{ today }}&quot;&gt;&lt;br&gt;
 
 &lt;label for=&quot;admission_fee&quot;&gt;Admission Fee:&lt;/label&gt;
 &lt;input type=&quot;number&quot; id=&quot;admission_fee&quot; name=&quot;admission_fee&quot;&gt;&lt;br&gt;
 
 &lt;label for=&quot;admission_discount&quot;&gt;Admission Discount:&lt;/label&gt;
 &lt;input type=&quot;number&quot; id=&quot;admission_discount&quot; name=&quot;admission_discount&quot;&gt;&lt;br&gt;
 
 &lt;label for=&quot;balance_admission_fee&quot;&gt;Net Admission Fee:&lt;/label&gt;
 &lt;input type=&quot;number&quot; id=&quot;balance_admission_fee&quot; name=&quot;balance_admission_fee&quot; readonly&gt;&lt;br&gt;
 
 &lt;label for=&quot;installment_type&quot;&gt;Installment Type:&lt;/label&gt;
 &lt;select id=&quot;installment_type&quot; name=&quot;installment_type&quot;&gt;
 &lt;option value=&quot;one_time&quot;&gt;One Time&lt;/option&gt;
 &lt;option value=&quot;monthly&quot;&gt;Monthly&lt;/option&gt;
 &lt;/select&gt;&lt;br&gt;
 &lt;div id=&quot;monthly_fields&quot; style=&quot;display:none;&quot;&gt;
 &lt;label for=&quot;year&quot;&gt;Year:&lt;/label&gt;
 &lt;input type=&quot;text&quot; id=&quot;year&quot; name=&quot;year&quot;&gt;&lt;br&gt;
 
 &lt;label for=&quot;month&quot;&gt;Month:&lt;/label&gt;
 &lt;input type=&quot;text&quot; id=&quot;month&quot; name=&quot;month&quot;&gt;&lt;br&gt;
 &lt;/div&gt;
 
 &lt;label for=&quot;fee_amount&quot;&gt;Fee Amount:&lt;/label&gt;
 &lt;input type=&quot;number&quot; id=&quot;fee_amount&quot; name=&quot;fee_amount&quot;&gt;&lt;br&gt;
 
 &lt;label for=&quot;discount_amount&quot;&gt;Discount Amount:&lt;/label&gt;
 &lt;input type=&quot;number&quot; id=&quot;discount_amount&quot; name=&quot;discount_amount&quot;&gt;&lt;br&gt;
 
 &lt;label for=&quot;discount_percentage&quot;&gt;Discount Percentage:&lt;/label&gt;
 &lt;input type=&quot;number&quot; id=&quot;discount_percentage&quot; name=&quot;discount_percentage&quot;&gt;&lt;br&gt;
 
 &lt;label for=&quot;other_charges&quot;&gt;Other Charges:&lt;/label&gt;
 &lt;input type=&quot;number&quot; id=&quot;other_charges&quot; name=&quot;other_charges&quot;&gt;&lt;br&gt;
 
 
 &lt;label for=&quot;net_fee&quot;&gt;Net Fee:&lt;/label&gt;
 &lt;input type=&quot;number&quot; id=&quot;net_fee&quot; name=&quot;net_fee&quot; readonly&gt;&lt;br&gt;
 
 
 
 
 
 &lt;label for=&quot;payment_mode&quot;&gt;Payment Mode:&lt;/label&gt;
 &lt;select id=&quot;payment_mode&quot; name=&quot;payment_mode&quot;&gt;
 &lt;option value=&quot;cash&quot;&gt;Cash&lt;/option&gt;
 &lt;option value=&quot;online_transfer&quot;&gt;Online Transfer&lt;/option&gt;
 &lt;option value=&quot;credit_card&quot;&gt;Credit Card&lt;/option&gt;
 &lt;/select&gt;&lt;br&gt;
 
 &lt;label for=&quot;payment_made&quot;&gt;Payment Made:&lt;/label&gt;
 &lt;input type=&quot;number&quot; id=&quot;payment_made&quot; name=&quot;payment_made&quot;&gt;&lt;br&gt;
 
 &lt;label for=&quot;outstanding_fee&quot;&gt;Balance Fee:&lt;/label&gt;
 &lt;input type=&quot;number&quot; id=&quot;outstanding_fee&quot; name=&quot;outstanding_fee&quot; readonly&gt;&lt;br&gt;
 
 &lt;button type=&quot;submit&quot;&gt;Submit&lt;/button&gt;
 &lt;/form&gt;

 &lt;script&gt;
 document.getElementById('installment_type').addEventListener('change', function() {
 var monthlyFields = document.getElementById('monthly_fields');
 if (this.value === 'monthly') {
 monthlyFields.style.display = 'block';
 } else {
 monthlyFields.style.display = 'none';
 }
 });

 document.getElementById('admission_fee').addEventListener('input', calculateNetAdmissionFee);
 document.getElementById('admission_discount').addEventListener('input', calculateNetAdmissionFee);
 document.getElementById('fee_amount').addEventListener('input', calculateNetFee);
 document.getElementById('discount_amount').addEventListener('input', calculateNetFee);
 document.getElementById('discount_percentage').addEventListener('input', calculateNetFee);
 document.getElementById('other_charges').addEventListener('input', calculateNetFee);
 document.getElementById('payment_made').addEventListener('input', calculateOutstandingFee);

 function calculateNetAdmissionFee() {
 var admissionFee = parseFloat(document.getElementById('admission_fee').value) || 0;
 var admissionDiscount = parseFloat(document.getElementById('admission_discount').value) || 0;
 var netAdmissionFee = admissionFee - admissionDiscount;
 document.getElementById('balance_admission_fee').value = netAdmissionFee;
 calculateNetFee();
 }

 function calculateNetFee() {
 var feeAmount = parseFloat(document.getElementById('fee_amount').value) || 0;
 var discountAmount = parseFloat(document.getElementById('discount_amount').value) || 0;
 var discountPercentage = parseFloat(document.getElementById('discount_percentage').value) || 0;
 var netAddmissionFee = parseFloat(document.getElementById('balance_admission_fee').value) || 0;
 var otherCharges = parseFloat(document.getElementById('other_charges').value) || 0;
 var feePercentageDiscount = feeAmount * (discountPercentage / 100);
 var netFeePayable = feeAmount - discountAmount - feePercentageDiscount + otherCharges + netAddmissionFee;
 document.getElementById('net_fee').value = netFeePayable;
 calculateOutstandingFee();
 }

 function calculateOutstandingFee() {
 var netFeePayable = parseFloat(document.getElementById('net_fee').value) || 0;
 var paymentMade = parseFloat(document.getElementById('payment_made').value) || 0;
 var outstandingFee = netFeePayable - paymentMade;
 document.getElementById('outstanding_fee').value = outstandingFee;
 }

 
 // {% if request.args.get('edit') %}
 // fetch('/get_fee/' + {{ request.args.get('student_id') }})
 // .then(response =&gt; response.json())
 // .then(data =&gt; {
 // if (data) {
 // document.getElementById('fee_id').value = data.id;
 // document.getElementById('fee_amount').value = data.fee_amount;
 // document.getElementById('discount_amount').value = data.discount_amount;
 // document.getElementById('discount_percentage').value = data.discount_percentage;
 // document.getElementById('net_fee').value = data.net_fee;
 // document.getElementById('installment_type').value = data.installment_type;
 // document.getElementById('year').value = data.year;
 // document.getElementById('month').value = data.month;
 // document.getElementById('payment_made').value = data.payment_made;
 // document.getElementById('other_charges').value = data.other_charges;
 // document.getElementById('date').value = data.date;
 // document.getElementById('admission_fee').value = data.admission_fee;
 // document.getElementById('admission_discount').value = data.admission_discount;
 // document.getElementById('balance_admission_fee').value = data.balance_admission_fee;
 // calculateNetFee();
 // calculateOutstandingFee();
 // }
 // });
 // {% endif %}

 &lt;/script&gt;
 
{% endblock %}
</code></pre>

</summary>
</entry>
<entry>
<id>https://stackoverflow.com/q/72833380</id>
<re:rank scheme="https://stackoverflow.com">3</re:rank>
<title type="text">How to get value from Configuration object via HostBuilder?</title>
<category scheme="https://stackoverflow.com/tags" term=".net-core" />
<category scheme="https://stackoverflow.com/tags" term="dependency-injection" />
<author>
<name>bitshift</name>
<uri>https://stackoverflow.com/users/3206983</uri>
</author>
<link rel="alternate" href="https://stackoverflow.com/questions/72833380/how-to-get-value-from-configuration-object-via-hostbuilder" />
<published>2022-07-01T18:33:33Z</published>
<updated>2025-07-03T20:25:42Z</updated>
<summary type="html">
<p>Started a new Console app in .NET 6 and am adding Dependency Injection. In the code below, how can I get access to the IConfiguration object to read a value from appsettings (after calling Build?</p>
<p>The configuration is available within the StoreFactory service, as its injected via the constructor, but if I want to read values from appsettings within the main section of code within program.cs, how can I get at it?</p>
<p><strong>program.cs</strong></p>
<pre><code>var SvcBuilder = new HostBuilder()
 .ConfigureAppConfiguration((hostingContext, config) =&gt;
 {
 config.SetBasePath(Directory.GetCurrentDirectory());
 config.AddJsonFile(&quot;appsettings.json&quot;, optional: true);
 config.AddEnvironmentVariables();
 
 if (args != null)
 {
 config.AddCommandLine(args);
 }
 })
 .ConfigureServices((hostContext, services) =&gt;
 {
 services.AddLogging(configure =&gt; configure.AddConsole())
 .AddTransient&lt;IStoreFactory, StoreCtxFactory&gt;();
 });

var host = SvcBuilder.Build();
</code></pre>

</summary>
</entry>
<entry>
<id>https://stackoverflow.com/q/72667644</id>
<re:rank scheme="https://stackoverflow.com">0</re:rank>
<title type="text">How does scramble function works? (Chapter 1 of The Seasoned Schemer)</title>
<category scheme="https://stackoverflow.com/tags" term="recursion" />
<category scheme="https://stackoverflow.com/tags" term="functional-programming" />
<category scheme="https://stackoverflow.com/tags" term="scheme" />
<category scheme="https://stackoverflow.com/tags" term="lisp" />
<category scheme="https://stackoverflow.com/tags" term="seasoned-schemer" />
<author>
<name>Hermann</name>
<uri>https://stackoverflow.com/users/17869778</uri>
</author>
<link rel="alternate" href="https://stackoverflow.com/questions/72667644/how-does-scramble-function-works-chapter-1-of-the-seasoned-schemer" />
<published>2022-06-18T07:54:36Z</published>
<updated>2025-07-03T20:50:05Z</updated>
<summary type="html">
<p>According to the book, this is what the function definition is,</p>
<blockquote>
<p>The function scramble takes a non-empty tuple in which no argument is greater than its own index and returns a tuple of same length. Each number in the argument is treated as a backward index from its own position to a point earlier in tuple. The result at each position is obtained by counting backward from the current position according to this index.</p>
</blockquote>
<p>And these are some examples,</p>
<pre><code>; Examples of scramble
(scramble '(1 1 1 3 4 2 1 1 9 2)) ; '(1 1 1 1 1 4 1 1 1 9)
(scramble '(1 2 3 4 5 6 7 8 9)) ; '(1 1 1 1 1 1 1 1 1)
(scramble '(1 2 3 1 2 3 4 1 8 2 10)) ; '(1 1 1 1 1 1 1 1 2 8 2)
</code></pre>
<p>Here is the implementation,</p>
<pre><code>(define pick
 (λ (i lat)
 (cond
 ((eq? i 1) (car lat))
 (else (pick (sub1 i)
 (cdr lat))))))

(define scramble-b
 (lambda (tup rev-pre)
 (cond
 ((null? tup) '())
 (else
 (cons (pick (car tup) (cons (car tup) rev-pre))
 (scramble-b (cdr tup)
 (cons (car tup) rev-pre)))))))

(define scramble
 (lambda (tup)
 (scramble-b tup '())))
</code></pre>

</summary>
</entry>
<entry>
<id>https://stackoverflow.com/q/66418584</id>
<re:rank scheme="https://stackoverflow.com">6</re:rank>
<title type="text">HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\<SID> State value meaning</title>
<category scheme="https://stackoverflow.com/tags" term="windows" />
<category scheme="https://stackoverflow.com/tags" term="registry" />
<author>
<name>cogumel0</name>
<uri>https://stackoverflow.com/users/2672827</uri>
</author>
<link rel="alternate" href="https://stackoverflow.com/questions/66418584/hkey-local-machine-software-microsoft-windows-nt-currentversion-profilelist-sid" />
<published>2021-03-01T08:10:10Z</published>
<updated>2025-07-03T20:41:29Z</updated>
<summary type="html">
<p><code>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\&lt;SID&gt;</code> contains a value called <code>State</code> which is a bit mask <code>DWORD</code>.</p>
<p>All information I could find about it is this:</p>
<pre><code>001 = PROFILE_MANDATORY
Profile is mandatory.

002 = PROFILE_USE_CACHE
Update locally Cached profile.

004 = PROFILE_NEW_LOCAL
Using a new local profile.

008 = PROFILE_NEW_CENTRAL
Using a new central profile.

010 = PROFILE_UPDATE_CENTRAL
Need to update central profile.

020 = PROFILE_DELETE_CACHE
Need to delete cached profile.

040 = PROFILE_UPGRADE
Need to upgrade profile.

080 = PROFILE_GUEST_USER
Using guest user profile.

100 = PROFILE_ADMIN_USER
Using administrator profile.

200 = DEFAULT_NET_READY
Default net profile is available &amp; ready.

400 = PROFILE_SLOW_LINK
Identified slow network link.

800 = PROFILE_TEMP_ASSIGNED
Temporary profile loaded.
</code></pre>
<p>But exactly what do those values mean?! I've seen a non-administrator account with <code>State = 100</code> for example.</p>
<p>Does <code>State = 4</code> only appear when a user logged in for the first time and their profile got created, changing to a different state on 2nd login?</p>
<p>Will a <code>State = 2</code> appear if a user is not using roaming profiles? What will be the value of <code>State</code> when a user is using a roaming profile that just got copied from the server?!</p>
<p>What exactly does <code>State = 200</code> mean??</p>
<p>So many questions, because this information really seems to not be great.</p>
<p>Also that list appears to be missing at least one value, as I found a <code>State = 8000</code> on a few users.</p>
<p>Does anyone happen to know exactly what these values mean??</p>

</summary>
</entry>
<entry>
<id>https://stackoverflow.com/q/65679529</id>
<re:rank scheme="https://stackoverflow.com">-1</re:rank>
<title type="text">Set sticky bit permission using bash script</title>
<category scheme="https://stackoverflow.com/tags" term="bash" />
<category scheme="https://stackoverflow.com/tags" term="shell" />
<author>
<name>catty</name>
<uri>https://stackoverflow.com/users/11850295</uri>
</author>
<link rel="alternate" href="https://stackoverflow.com/questions/65679529/set-sticky-bit-permission-using-bash-script" />
<published>2021-01-12T07:21:11Z</published>
<updated>2025-07-03T20:45:44Z</updated>
<summary type="html">
<p>Can anyone guide, how to implement this linux command into a bash script</p>
<pre><code>df --local -P | awk {'if (NR!=1) print $6'} | xargs -I '{}' find '{}' -xdev -type d -perm -0002 2&gt;/dev/null | xargs chmod a+t
</code></pre>

</summary>
</entry>
<entry>
<id>https://stackoverflow.com/q/65615133</id>
<re:rank scheme="https://stackoverflow.com">2</re:rank>
<title type="text">How to comprehensively check for unsaved work?</title>
<category scheme="https://stackoverflow.com/tags" term="git" />
<author>
<name>studog</name>
<uri>https://stackoverflow.com/users/1352761</uri>
</author>
<link rel="alternate" href="https://stackoverflow.com/questions/65615133/how-to-comprehensively-check-for-unsaved-work" />
<published>2021-01-07T15:21:52Z</published>
<updated>2025-07-03T20:36:52Z</updated>
<summary type="html">
<p>I'm working with a large number of git repositories that aren't terribly small. Disk space is an issue so I need to remove some repos I'm not using to make room for others.</p>
<p>How do I comprehensively check for unsaved work before <code>rm -rf project/</code>?</p>
<p>I've googled around and haven't found anything that's a direct answer. I have cobbled together this alias that so far seems sufficient, if a bit ugly in output.</p>
<pre><code> unsaved = &quot;!f() { \
 echo '=====[ Unpushed commits ]=================================================='; \
 git branch -v; \
 echo '=====[ Uncommited work ]==================================================='; \
 git status; \
 echo '=====[ Uncommited stashes ]================================================'; \
 git stash list; \
 echo '=====[ Unpushed tags ]====================================================='; \
 git push --tags --dry-run; \
 }; f&quot;
</code></pre>
<p>This checks in all the corners I know of for work that would be lost if the repo is deleted. Pretty self-explanatory, but a couple of notes: LFS changes should be revealed by the <code>git status</code> command; changes in submodules should similarly be revealed. Orphaned commits are not handled, would be lost on repo deletion, but that's okay for my current purposes. I have an alias for finding all orphans if I change my mind later.</p>
<p>Have I missed anything?</p>
<p>I just remembered worktrees are a thing. I don't know how to handle that right now since I've never worked with them. A quick google doesn't help. Are worktree changes reflected in <code>git status</code>?</p>
<p>Update 2025-07-03: I have since learned that the &quot;unpushed tags detection&quot; only works when you have write access to the remote. I don't yet know if there is a better way to do that.</p>

</summary>
</entry>
<entry>
<id>https://stackoverflow.com/q/61915691</id>
<re:rank scheme="https://stackoverflow.com">1</re:rank>
<title type="text">Django Admin Debounce</title>
<category scheme="https://stackoverflow.com/tags" term="jquery" />
<category scheme="https://stackoverflow.com/tags" term="django" />
<category scheme="https://stackoverflow.com/tags" term="django-admin" />
<category scheme="https://stackoverflow.com/tags" term="debouncing" />
<author>
<name>Klik Kliković</name>
<uri>https://stackoverflow.com/users/7302971</uri>
</author>
<link rel="alternate" href="https://stackoverflow.com/questions/61915691/django-admin-debounce" />
<published>2020-05-20T14:29:51Z</published>
<updated>2025-07-03T20:43:26Z</updated>
<summary type="html">
<p>I am using <a href="https://docs.djangoproject.com/en/3.0/ref/contrib/admin/" rel="nofollow noreferrer">Python Django Admin</a> with as little as possible custom templates and javascript code. </p>

<p>Is there a way to <a href="https://www.npmjs.com/package/lodash.debounce" rel="nofollow noreferrer">debounce</a> click on specific button (or form submit)?</p>

<p>E.g. if user clicks two times (in a short period of time) on the save button, only one call should be made.</p>

</summary>
</entry>
<entry>
<id>https://stackoverflow.com/q/60065447</id>
<re:rank scheme="https://stackoverflow.com">3</re:rank>
<title type="text">Strapi CMS - how to install it on cpanel?</title>
<category scheme="https://stackoverflow.com/tags" term="node.js" />
<category scheme="https://stackoverflow.com/tags" term="content-management-system" />
<category scheme="https://stackoverflow.com/tags" term="headless" />
<category scheme="https://stackoverflow.com/tags" term="strapi" />
<author>
<name>Mayanktaker</name>
<uri>https://stackoverflow.com/users/9137211</uri>
</author>
<link rel="alternate" href="https://stackoverflow.com/questions/60065447/strapi-cms-how-to-install-it-on-cpanel" />
<published>2020-02-04T20:58:44Z</published>
<updated>2025-07-03T20:40:14Z</updated>
<summary type="html">
<p>I am trying to install Strapi headless CMS on my Cpanel Shared server and I failed.
I have SSh Access, 
I have nodeJs Access on my cpanel 
Anyone know how to install <strong>Strapi</strong> and get access to Admin panel?</p>

<p>Edit: I managed to install it and runnning fine on server but when I close the SSH, it shows me 503 error on my browser ( because of htaccess)
How to keep the process running ? </p>

</summary>
</entry>
<entry>
<id>https://stackoverflow.com/q/53231023</id>
<re:rank scheme="https://stackoverflow.com">4</re:rank>
<title type="text">Why does chrome keep inserting the __web-inspector-hide-shortcut__ class</title>
<category scheme="https://stackoverflow.com/tags" term="google-chrome-devtools" />
<author>
<name>Gregg Duncan</name>
<uri>https://stackoverflow.com/users/5202722</uri>
</author>
<link rel="alternate" href="https://stackoverflow.com/questions/53231023/why-does-chrome-keep-inserting-the-web-inspector-hide-shortcut-class" />
<published>2018-11-09T17:57:11Z</published>
<updated>2025-07-03T20:27:30Z</updated>
<summary type="html">
<p>Almost every time I edit the css applied to an element in the Chrome dev tools, chrome inserts the <strong>web-inspector-hide-shortcut</strong> class which make the element not display. The whole reason I'm editing the css is to see what it looks like with the new style applied. I have to go to the HTML of the element and remove the class so I can see the changes. </p>

<p>How can I stop chrome from doing this automatically?</p>

</summary>
</entry>
<entry>
<id>https://stackoverflow.com/q/51999812</id>
<re:rank scheme="https://stackoverflow.com">4</re:rank>
<title type="text">node module - aes256 - crypto.createHash is not a function</title>
<category scheme="https://stackoverflow.com/tags" term="node.js" />
<category scheme="https://stackoverflow.com/tags" term="npm" />
<category scheme="https://stackoverflow.com/tags" term="angular5" />
<category scheme="https://stackoverflow.com/tags" term="node-modules" />
<author>
<name>OpieOP</name>
<uri>https://stackoverflow.com/users/3530336</uri>
</author>
<link rel="alternate" href="https://stackoverflow.com/questions/51999812/node-module-aes256-crypto-createhash-is-not-a-function" />
<published>2018-08-24T07:49:32Z</published>
<updated>2025-07-03T20:40:22Z</updated>
<summary type="html">
<p>So I have this Angular 5 application which uses <code>aes256</code> library from NPM for encrypting password for login form. Inside that <code>aes256</code> library, theres <code>var crypto = require('crypto')</code>. When I run my application and try the login form, I encountered <code>crypto.createHash is not a function</code> error. 
When I debugged my app to find out whats wrong, I see that <code>var crypto</code> was just an empty object.
<a href="https://i.sstatic.net/ZjPZD.png" rel="nofollow noreferrer">crypto.createHash is not a function</a>
<a href="https://i.sstatic.net/6I4F3.png" rel="nofollow noreferrer">crypto - empty object</a></p>

</summary>
</entry>
<entry>
<id>https://stackoverflow.com/q/49860324</id>
<re:rank scheme="https://stackoverflow.com">6</re:rank>
<title type="text">HttpRequest and reportProgress not working or messing up my requests</title>
<category scheme="https://stackoverflow.com/tags" term="angular" />
<category scheme="https://stackoverflow.com/tags" term="file-upload" />
<category scheme="https://stackoverflow.com/tags" term="httprequest" />
<category scheme="https://stackoverflow.com/tags" term="angular-httpclient" />
<author>
<name>tommueller</name>
<uri>https://stackoverflow.com/users/1423259</uri>
</author>
<link rel="alternate" href="https://stackoverflow.com/questions/49860324/httprequest-and-reportprogress-not-working-or-messing-up-my-requests" />
<published>2018-04-16T14:53:55Z</published>
<updated>2025-07-03T20:40:03Z</updated>
<summary type="html">
<p>I am implementing a file upload service with Angular 5 and I want to give the user some feedback on the upload progress. I found several pages suggesting to use the <code>reportProgress</code> parameter that comes with Angulars <code>HttpClient</code>, but I cannot get it working.</p>

<p>I use a wrapper class for all my http-requests, which then does some logic and finally all requests end up in the same method that's being called:</p>

<pre><code>public request(request: HttpRequest&lt;any&gt;, options?: any): Observable&lt;any&gt; {
 return this.httpClient.request(request.method, request.url, {
 body: request.body,
 headers: request.headers,
 responseType: request.responseType,
 ...options
 });
}
</code></pre>

<p>I then pass a upload (post) call to it, with <code>{ reportProgress: true }</code> as <code>options</code>. This did not work at all, nothing on the request changed. So I suspected, that I actually need to use the <code>reportProgress</code>-parameter in the HttpRequest constructor to make it work and changed my code accordingly:</p>

<pre><code>public request(request: HttpRequest&lt;any&gt;, options?: any): Observable&lt;any&gt; {
 return this.httpClient.request(
 new HttpRequest(request.method, request.url, request.body, {
 headers: request.headers,
 responseType: request.responseType,
 ...options
 })
 );
}
</code></pre>

<p>This leads to the even more weird behavior, that now no matter what my options look like, I always only receive <code>{type: 0}</code> as response from the request.</p>

<p>What am I overseeing? I use Angular 5.1.1 and I am really a bit puzzled here right now.</p>

<p>So to give an explicit example, right now I receive the same response for those two HttpRequests:</p>

<pre><code>{ 
 "url":"http://127.0.0.1:8888/test",
 "body":{ 
 "data":"testdata"
 },
 "reportProgress":false,
 "withCredentials":false,
 "responseType":"json",
 "method":"POST",
 "headers":{ some-headers ... }
}
</code></pre>

<p>and this request:</p>

<pre><code>{ 
 "url":"http://127.0.0.1:8888/api/pages",
 "body":{ 
 "pageUrl":"http://localhost:1234/"
 },
 "reportProgress":true,
 "withCredentials":false,
 "responseType":"json",
 "method":"POST",
 "headers":{ some-headers ... }
}
</code></pre>

</summary>
</entry>
<entry>
<id>https://stackoverflow.com/q/43587056</id>
<re:rank scheme="https://stackoverflow.com">2</re:rank>
<title type="text">Is it possible to click on a certain point in a webpage using Java?</title>
<category scheme="https://stackoverflow.com/tags" term="java" />
<category scheme="https://stackoverflow.com/tags" term="selenium-webdriver" />
<author>
<name>Reggie Redge</name>
<uri>https://stackoverflow.com/users/7896393</uri>
</author>
<link rel="alternate" href="https://stackoverflow.com/questions/43587056/is-it-possible-to-click-on-a-certain-point-in-a-webpage-using-java" />
<published>2017-04-24T11:38:30Z</published>
<updated>2025-07-03T20:42:14Z</updated>
<summary type="html">
<p>I am importing the following methods:</p>

<pre><code>import helper.webdriver.ExtraMethods;
import helper.webdriver.JavascriptMethods;
import org.junit.Test;
import org.openqa.selenium.By;
</code></pre>

<p>I need to click (or clickAndWait) on a span element which seems to be bigger than the CTA itself, without any child elements iside it (except for the text).</p>

<p>So, I would like to know if there is a way to have my IDE click on a certain point on a webpage (like if you enter coordinates, it will click on the corresponding location).</p>

<p>Alternatively, I would like to know if it is possible to directly click on the actual text (as the text is included in the CTA, and the command would validate).</p>

<p>Thank you in advance!</p>

<p>Later Edit:</p>

<p>The URL in which I am attempting this is <a href="http://www.chevrolet.com/current-deals" rel="nofollow noreferrer">http://www.chevrolet.com/current-deals</a> </p>

<p>My problem is that I would like to click on the "Request a Quote" CTA for any vehicle (this appears after clicking on any "Offers" button). I went within the iframe but i tried clicking by xpath and css, but the span in which this CTA is included seems to be larger than the actual CTA. </p>

<p>I used the following import statements:</p>

<pre><code>import helper.webdriver.ExtraMethods;
import helper.webdriver.JavascriptMethods;
import org.junit.Test;
import org.openqa.selenium.By;
</code></pre>

<p>And my actual code for this was:</p>

<pre><code>clickAndWait(resolve("xpath=(//*[@class='CTA btn_prim'])[1]"));
</code></pre>

<p>I also tried using the "tabindex" atribute, which has a specific index for each item.</p>

</summary>
</entry>
<entry>
<id>https://stackoverflow.com/q/21476748</id>
<re:rank scheme="https://stackoverflow.com">6</re:rank>
<title type="text">How to change the color of HTML5 progress bar</title>
<category scheme="https://stackoverflow.com/tags" term="html" />
<category scheme="https://stackoverflow.com/tags" term="progress-bar" />
<author>
<name>n92</name>
<uri>https://stackoverflow.com/users/625454</uri>
</author>
<link rel="alternate" href="https://stackoverflow.com/questions/21476748/how-to-change-the-color-of-html5-progress-bar" />
<published>2014-01-31T09:41:29Z</published>
<updated>2025-07-03T20:47:26Z</updated>
<summary type="html">
<p>I have HTML progress bar, which values changes dynamically</p>
<pre><code>&lt;progress value=&quot;${salesDone}&quot; max=&quot;${salesTarget}&quot;&gt;&lt;/progress&gt; 
</code></pre>
<ul>
<li>I want to show the completed task in one color and remaining tasks in other color.</li>
<li>If the value exceeds the max value specified, then exceeded value must be show in diff color.</li>
</ul>
<p>How to do this?</p>

</summary>
</entry>
<entry>
<id>https://stackoverflow.com/q/2857135</id>
<re:rank scheme="https://stackoverflow.com">3</re:rank>
<title type="text">Convert Hexadecimal String to Data</title>
<category scheme="https://stackoverflow.com/tags" term="c" />
<category scheme="https://stackoverflow.com/tags" term="hex" />
<author>
<name>AriX</name>
<uri>https://stackoverflow.com/users/111870</uri>
</author>
<link rel="alternate" href="https://stackoverflow.com/questions/2857135/convert-hexadecimal-string-to-data" />
<published>2010-05-18T12:20:31Z</published>
<updated>2025-07-03T20:24:20Z</updated>
<summary type="html">
<p>I have found a whole lot of different solutions to this problem, but not all of them work, and a lot of them seem somewhat hacky and inefficient. Basically I have a string of hexadecimal data (i.e. "55 AA 41 2A 00 94 55 AA BB BB 00 FF") which I would like to convert to raw data. What is the best way to do this?</p>

<p><strong>UPDATE</strong>: Vicky's solution worked great for me, but I changed it to work with hexadecimal strings that don't have spaces in between and changed the style a bit.</p>

<pre><code>int i = 0;
char *hexString = "55AA412A009455AABBBB00FF"
char *hexPtr = hexString;
unsigned int *result = calloc(strlen(hexString)/2 + 1, sizeof *result);

while (sscanf(hexPtr, "%02x", &amp;result[i++])) {
 hexPtr += 2;
 if (hexPtr &gt;= hexString + strlen(hexString)) break;
}

return result;
</code></pre>

</summary>
</entry>
</feed>
If you would like to create a banner that links to this page (i.e. this validation result), do the following:
Download the "valid Atom 1.0" banner.
Upload the image to your own server. (This step is important. Please do not link directly to the image on this server.)
Add this HTML to your page (change the image src
attribute if necessary):
If you would like to create a text link instead, here is the URL you can use:
http://www.feedvalidator.org/check.cgi?url=http%3A//stackoverflow.com/feeds