I had the same problem and solved it simply by removing the constant Trace and unticking the "Optimize code" box in the Build section of the UWP project for all platforms (X64, X86, ARM) in the "Release" configuration. The problem likely was that these options were not identical for the 3 platforms
Here is my answer to your questions:
Why does a IO device(NIC/SSD) need a IO page table for DMA?
An IO device does not necessarily need an IO page table. If the system supports IOMMU with Shared Virtual Addressing (SVA), the device can use a process's page table environment instead. This allows DMA operations to use virtual addresses (VA) directly instead of requiring IO virtual addresses (IOVA). For more details, refer to the article 'Shared Virtual Addressing for IOMMU': https://lwn.net/Articles/747230/.
If the IOVA is used only once and is not reused after a single DMA transfer, then is it really necessary to manage the IOVA-PA mapping through a page table?
The IO page table is used by IOMMU hardware to translate IOVA to physical addresses (PA). The IO page table is managed by the operating system, not by individual processes. It means IO page table is a shared resource. Even if the IOVA is used only once, the page table ensures hardware-level address translation and isolation, which are critical for system security and performance.
Is it possible that a single DMA operation uses the IOVA multiple times?
Yes, a single DMA operation can use the same IOVA multiple times. However, this is not recommended due to potential performance overheads and complexity in managing the mapping.
My proposal:
If you prefer to avoid using an IO page table, consider using Shared Virtual Addressing (SVA), which allows DMA operations to leverage process-level virtual addresses without the need for IOVA.
this needs explicit type narrowing -
if (typeof result === "object" && !Array.isArray(result)) {
if (result?.error) {
log(result.error)
}
} else {
if (Array.isArray(result)) {
setData(result);
}
}
I am not sure what is your exact question, but you can convert the time zone with a function in PowerAutomate: convertTimeZone(), etc: convertFromUtchttps://learn.microsoft.com/en-us/power-automate/convert-time-zone
To achieve that you can use powershell
It is an interesting question that has multiple possible solutions or needs further explanations.
Your issue generally is not connected to SqlAlchemy, it is a very common Python problem. However, here it is triggered by specific SqlAlchemy behavior.
I'll try to explain the problem as I see it and you'll correct me if I misunderstand the situation.
From SqlAlchemy point of view: why do you try to use class reference instead of string reference? As far as I understand, class needs to be imported at the moment of execution, while string is processed by SqlAlchemy itself without the need to load the class. I'm using string references everywhere and haven't, so far, seen any tutorials that say I'm doing it wrong.
Also: why do you need relationship(Left)
or relationship("Left")
at all? You already has "Left" in lefts: Mapped[InstrumentedList["Left"]]
. It is not an error, it is, I think, redundant. I use it this way:
breed_groups: Mapped[Optional[list["BreedGroup"]]] = relationship(secondary=user2breed_group)
And it works fine, as far as I can judge. What are you trying to achieve here?
Now, for your actual question, which is not about SqlAlchemy, but about Python.
Generally, you have 2 classes which reference each other. You try to execute a class Right, which imports class Left, but class Left imports class Right, so it tries to import it back, but can't, because class Right imports class Left. And so on, that's a circle. It is a very common problem in Python. It doesn't matter if you are using SqlAlchemy or not, if you are trying to import Left from Right AND Right from Left, it will tell you, at a runtime, that you can't do that. But obviously you need that connection, and often.
The solution (as I understand it, because there are as many opinions on the matter in the Internets and there are python programmers) is to load and initialise both classes before runtime, so at runtime they were both loaded and cached and could reference each other without problem. You can't do it from inside their files, it's just not how Python runs.
What I do: I add more files. First, I use init.py file for a module (lets call it "models") where both my classes are stored, in this way:
from .left import Left
from .right import Right
There are no imports inside my 'left.py' and 'right.py' classes! At least no imports referencing each other.
Then, when I need the classes to be actually USED, executed, be it, for example, for create_all, I load and initialise the module in full:
from models import *
At this point models' init.py loads and caches both Right and Left classes, and when any of the classes is run, the other, referenced, class is already loaded and cached and nothing needs to be imported. So when Right tries to do something with Left, Left is already loaded and initiated by models and vice versa.
@declared_attr, @classmethod and any other "solutions" do not, in any way, influence the problem of "file right.py imports from file left.py which imports from file right.py"
Also, do you understand what you are doing with TYPE_CHECKING? It is a VERY specific boolean needed for very specific reason (purely as a technical aid for IDEs and other tools) and I have a suspicion you don't understand why it's there and what does it does. I would advice you to not use it at all, despite what tutorials show, until you know why you need it. It may deceive you. It is always false at runtime, so none of your imports would actually work at runtime and other imports, non-obvious for you, would be used. Or not used. I don't really understand TYPE_CHECKING and never use it.
There are many, many, many tutorials and explanations about circular import and not all of them are any good, but you really should understand the concept, because it's one of the main problems and flaws of Python, in my opinion, and you would have to work around it for your whole programming life. Not that I have that much experience with Python, either. You may start with something like that https://medium.com/@hamana.hadrien/so-you-got-a-circular-import-in-python-e9142fe10591 and experiment further.
If I misunderstood something, I apologise, I'm using Python for less than half a year myself. If you want to correct me or add a question, please do. That goes for anyone who understand imports or SqlAlchemy better than me.
Digital Marketing đang ngày càng trở thành yếu tố không thể thiếu cho các doanh nghiệp và cá nhân muốn xây dựng và phát triển thương hiệu trong thời đại công nghệ số. Với nhu cầu nhân lực chuyên nghiệp trong ngành ngày càng cao, các khóa học Digital Marketing được thiết kế để cung cấp kiến thức và kỹ năng từ cơ bản đến nâng cao. Vậy khóa học Digital Marketing bao gồm những nội dung gì? Hãy cùng tìm hiểu!
I would like to thank @kikon for the answer
box1: {
type: "box",
drawTime: "beforeDraw",
yMin: 22,
yMax: 40,
backgroundColor: "rgba(255, 229, 153, 1)",
borderColor: "rgba(100, 100, 100, 0.2)",
},
According to the Java documentation, an SQLException is thrown only when a database access error occurs. This can happen in the following situations:
transactions = [-100, -200, -100, 1000, 50, -90] l = (transactions) print(l) for i in range(l): if i > 0: print(suma(i))
Step 1: Removing unused packages
!sudo apt autoremove
Step 2: Remove conflicting packages
!sudo apt-get remove --purge libnode-dev nodejs libnode72:amd64
Step 3: Update and install Node.js
!sudo apt-get update
!sudo apt-get install -y nodejs
Step 4: Verify the installation
!node -v
!npm -v
Telegram
An error occurred:
PUBLIC_KEY_INVALID
Apart from the correct data from @jwilliamson45
Please note how to place the public_key
. Here is an example that works for tests,
Since the documentation of python-telegram-bot
doesn't explain this in detail, it just mentions it (until today, December 7, 2024):
<?php
$tg_passport = empty($_GET["tg_passport"])? "":$_GET["tg_passport"];
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title> Telegram passport (test1) </title>
<meta charset="utf-8">
<meta content="IE=edge" http-equiv="X-UA-Compatible">
<meta content="width=device-width, initial-scale=1" name="viewport">
</head>
<body>
<h1>Telegram passport (test1)</h1>
<?php
if ($tg_passport == "cancel") {
echo "Canceled!";
}
?>
<div id="telegram_passport_auth"></div>
</body>
<!--- Needs file from https://github.com/TelegramMessenger/TGPassportJsSDK downloaded --->
<script src="../telegram-passport.js"></script>
<script src="../uuid.min.js"></script>
<script>
"use strict";
var host = "https://your-host.net"
var nonce = uuid.v4(), callback_url = host+"/apps/telegram_passport_auth",
files_base_url = callback_url+"/files",
files_dir = callback_url+"/files_saved";
// Example of public key
var p_k="-----BEGIN PUBLIC KEY-----\n"+
"MIIBIjANBC\n"+
"mPPAR7busb\n"+
"TmxT4yQswX\n"+
"2TLg46ccdi\n"+
"Tbam9PQiw4\n"+
"Sb7Tqii9xl\n"+
"QQIAB\n"+
"-----END PUBLIC KEY-----\n";
Telegram.Passport.createAuthButton('telegram_passport_auth', {
// ROLL BOT:
bot_id: 999999999,
// WHAT DATA YOU WANT TO RECEIVE:
scope: {
data: [{
type: 'id_document',
selfie: true
}, 'address_document', 'phone_number', 'email'],
v: 1
},
// YOUR PUBLIC KEY
public_key: p_k,
// YOUR BOT WILL RECEIVE THIS DATA WITH THE REQUEST
nonce: nonce,
// TELEGRAM WILL SEND YOUR USER BACK TO THIS URL
callback_url: callback_url+"/?"
});
</script>
</html>
The nonce
is generated with uuid.v4() from uuid.min.js.
Maybe this detail influences or not in the error: PUBLIC_KEY_REQUIRED
How about building the ONNX Runtime source code? You can run ONNX Runtime without relying on WinML or the .NET framework.
For your information - https://onnxruntime.ai/docs/build/inferencing.html
As @dandavis says, I think you can do element.innerHTML
to preserve formatting if what you mean by formatting is: list, font weight, font size, etc.
For example, for this page: https://www.linkedin.com/jobs/collections/hiring-in-network/?currentJobId=4093133656
I can do document.querySelector('article').innerHTML
to obtain the job description with it's format as shown here:
<div class="jobs-description__content jobs-description-content
">
<div class="jobs-box__html-content
gCeSRvuwijzmTJHsHVmaREDPgtRKEJIw
t-14 t-normal
jobs-description-content__text--stretch" id="job-details" tabindex="-1">
<h2 class="text-heading-large">
About the job
</h2>
<!----> <div class="mt4">
<p dir="ltr">
<span><p><!---->Hi! We are GeekGarden, a consultant IT
company.<!----></p></span><span><p><!---->We're hiring
the best candidate for
position:<!----></p></span><span><p><span><br></span></p></span><span><p><!---->Backend
Developer Golang<!----><span><strong><span
class="white-space-pre">
</span>OR<!----></strong></span><span
class="white-space-pre">
</span>Ruby<!----></p></span><span><p><span><br></span></p></span><span><p><!---->This
position is for our client : SaaS
company<!----></p></span><span><p><!---->Onsite
Yogyakarta<!----></p></span><span><p><!---->For 6 months
contract
base<!----></p></span><span><p><span><br></span></p></span><span><p><!---->Job
Descriptions<!----></p></span><span>
<ul><span><li><!---->Design, develop, and maintain backend
services and APIs using Golang or using Ruby on
Rails<!----></li></span><span><li><!---->Write
clean, maintainable, and efficient
code<!----></li></span><span><li><!---->Implement
scalable server-side logic and optimize
applications for
performance<!----></li></span><span><li><!---->Collaborate
with the product team to understand requirements
and translate them into technical
specifications<!----></li></span><span><li><!---->Integrate
third-party APIs and services as
needed<!----></li></span><span><li><!---->Identify,
troubleshoot, and resolve performance
bottlenecks and
bugs<!----></li></span><span><li><!---->Conduct
code reviews and provide constructive feedback
to other team
members<!----></li></span><span><li><!---->Ensure
data security, system scalability, and high
availability<!----></li></span><span><li><!---->Participate
in the full software development lifecycle,
including testing and
deployment<!----></li></span></ul>
</span><span><p><span><br></span></p></span><span><p><!---->Job
Requirements<!----></p></span><span>
<ul><span><li><!---->Bachelor's degree in Computer Science,
Engineering, or a related field (or equivalent
experience)<!----></li></span><span><li><!---->3+
years of proven experience as a Backend
Developer<!----></li></span><span><li><!---->Strong
expertise in Golang or Ruby on Rails programming
languages<!----></li></span><span><li><!---->Experience
with RESTful APIs, microservices architecture,
and web service
frameworks<!----></li></span><span><li><!---->Familiarity
with SQL and NoSQL databases (e.g., PostgreSQL,
MySQL, MongoDB,
Redis)<!----></li></span><span><li><!---->Understanding
of version control systems (e.g.,
Git)<!----></li></span><span><li><!---->Strong
problem-solving skills and the ability to write
efficient, scalable
code<!----></li></span><span><li><span><strong><!---->Willing
to work with project-based
contract<!----></strong></span></li></span><span><li><span><strong><!---->Willing
to join
immediately<!----></strong></span></li></span><span><li><span><strong><!---->Willing
to work onsite in
Yogyakarta<!----></strong></span></li></span></ul>
</span>
</p>
<!----> </div>
</div>
<div class="jobs-description__details">
<!----> </div>
</div>
<div class="jobs-description__content jobs-description-content
">
<div class="jobs-box__html-content
gCeSRvuwijzmTJHsHVmaREDPgtRKEJIw
t-14 t-normal
jobs-description-content__text--stretch" id="job-details" tabindex="-1">
<h2 class="text-heading-large">
About the job
</h2>
<!----> <div class="mt4">
<p dir="ltr">
<span><p><!---->Hi! We are GeekGarden, a consultant IT
company.<!----></p></span><span><p><!---->We're hiring
the best candidate for
position:<!----></p></span><span><p><span><br></span></p></span><span><p><!---->Backend
Developer Golang<!----><span><strong><span
class="white-space-pre">
</span>OR<!----></strong></span><span
class="white-space-pre">
</span>Ruby<!----></p></span><span><p><span><br></span></p></span><span><p><!---->This
position is for our client : SaaS
company<!----></p></span><span><p><!---->Onsite
Yogyakarta<!----></p></span><span><p><!---->For 6 months
contract
base<!----></p></span><span><p><span><br></span></p></span><span><p><!---->Job
Descriptions<!----></p></span><span>
<ul><span><li><!---->Design, develop, and maintain backend
services and APIs using Golang or using Ruby on
Rails<!----></li></span><span><li><!---->Write
clean, maintainable, and efficient
code<!----></li></span><span><li><!---->Implement
scalable server-side logic and optimize
applications for
performance<!----></li></span><span><li><!---->Collaborate
with the product team to understand requirements
and translate them into technical
specifications<!----></li></span><span><li><!---->Integrate
third-party APIs and services as
needed<!----></li></span><span><li><!---->Identify,
troubleshoot, and resolve performance
bottlenecks and
bugs<!----></li></span><span><li><!---->Conduct
code reviews and provide constructive feedback
to other team
members<!----></li></span><span><li><!---->Ensure
data security, system scalability, and high
availability<!----></li></span><span><li><!---->Participate
in the full software development lifecycle,
including testing and
deployment<!----></li></span></ul>
</span><span><p><span><br></span></p></span><span><p><!---->Job
Requirements<!----></p></span><span>
<ul><span><li><!---->Bachelor's degree in Computer Science,
Engineering, or a related field (or equivalent
experience)<!----></li></span><span><li><!---->3+
years of proven experience as a Backend
Developer<!----></li></span><span><li><!---->Strong
expertise in Golang or Ruby on Rails programming
languages<!----></li></span><span><li><!---->Experience
with RESTful APIs, microservices architecture,
and web service
frameworks<!----></li></span><span><li><!---->Familiarity
with SQL and NoSQL databases (e.g., PostgreSQL,
MySQL, MongoDB,
Redis)<!----></li></span><span><li><!---->Understanding
of version control systems (e.g.,
Git)<!----></li></span><span><li><!---->Strong
problem-solving skills and the ability to write
efficient, scalable
code<!----></li></span><span><li><span><strong><!---->Willing
to work with project-based
contract<!----></strong></span></li></span><span><li><span><strong><!---->Willing
to join
immediately<!----></strong></span></li></span><span><li><span><strong><!---->Willing
to work onsite in
Yogyakarta<!----></strong></span></li></span></ul>
</span>
</p>
<!----> </div>
</div>
<div class="jobs-description__details">
<!----> </div>
</div>
If this is not what you're looking for, then please specify what you mean by format
Scan the qrcode with the built-in camera app. It should give you an url, and you just have to click on it to open in the development build
From 30th Oct 2024, Your Firebase project must be on the pay-as-you-go Blaze pricing plan.
You can check the updated policy here: https://firebase.google.com/docs/storage/web/start#before-you-begin
This is still free & available same as before, but Blaze plan is required to access this feature.
Here is a working solution, but I'm not sure if it's ok.
if (criteria.getActive() != null) {
specification = specification.and((root, query, builder) -> {
HibernateCriteriaBuilder hb = (HibernateCriteriaBuilder) builder;
JpaExpression<Duration> oneMinute = hb.durationScaled(root.get(Activity_.duration), Duration.ofMinutes(1));
Expression<ZonedDateTime> result = hb.addDuration(root.get(Activity_.dateStart), oneMinute);
if (criteria.getActive()) {
return builder.greaterThanOrEqualTo(result, ZonedDateTime.now());
}
return builder.lessThan(result, ZonedDateTime.now());
});
}
do you find the answer? it also happen in my react-js code .
struct MessageTextField: View {
@Binding var inputText: String
@FocusState private var isFocused: Bool
var body: some View {
VStack {
Spacer()
HStack(alignment: .bottom) {
ZStack(alignment: .bottomLeading) {
TextEditor(text: $inputText)
.frame(minHeight: 36)
.fixedSize(horizontal: false, vertical: true)
.submitLabel(.done)
.focused($isFocused)
.multilineTextAlignment(.leading)
.lineLimit(4)
.font(.system(size: 15))
.padding([.top, .bottom, .leading], 2)
.accentColor(Color.green)
.ignoresSafeArea(.keyboard, edges: .bottom)
.overlay(
// Placeholder
Group {
if inputText.isEmpty {
Text("Enter your message")
.foregroundColor(.gray.opacity(0.5))
.font(.system(size: 15))
.padding(.leading, 6)
}
},
alignment: .leading
)
.onSubmit {
dismissKeyboard()
}
.onChange(of: inputText) { textInput in
var newValue = textInput
if textInput.count > 400 {
newValue = String(textInput.prefix(400))
if (textInput.last?.isNewline) ?? false {
isFocused = false
}
}
inputText = newValue
}
}
// Mic Button
Button(action: {
// Add microphone action here
}) {
Image(systemName: "mic")
.font(.system(size: 20))
.foregroundColor(.green)
}
.padding(.bottom, 8)
// Send Button
Button(action: {
if !inputText.isEmpty {
// Add send message action here
}
}) {
Image(systemName: "arrow.up.circle.fill")
.font(.system(size: 20, weight: .bold))
.foregroundColor(inputText.isEmpty ? .gray : .green)
}
.padding(.trailing, 4)
.padding(.bottom, 8)
.disabled(inputText.isEmpty)
}
.padding()
.background(
RoundedRectangle(cornerRadius: 10)
.fill(Color.white)
.overlay(
RoundedRectangle(cornerRadius: 10)
.stroke(Color.gray.opacity(0.5), lineWidth: 1)
)
)
}
.padding([.leading, .trailing], 20)
}
// Helper function to dismiss the keyboard
private func dismissKeyboard() {
withAnimation(.easeInOut(duration: 0.3)) {
isFocused = false
}
UIApplication.shared.sendAction(#selector(UIResponder.resignFirstResponder), to: nil, from: nil, for: nil)
}
}
extension View {
func onEnter(@Binding of text: String, action: @escaping () -> ()) -> some View {
onChange(of: text) { newValue in
if let last = newValue.last, last == "\n" {
text.removeLast()
action()
}
}
}
}
You got the error "The token '&&' is not a valid statement separator in this version"; I think the problem is with the shell environment that does not recognize && token as a valid token. It happens if the default shell in the Dockerfile (/bin/sh) is incompatible. Please try these ways:
pip install --upgrade --pre --extra-index-url https://marcelotduarte.github.io/packages/ cx_Freeze
It can use in MacOS 15.1, Oh My god!
I write an open source software named 'mybatis-py', it is hosted on github, the address is mybatis. Maybe it can help you.
I suggest you to check the cmakelists in your third_party subdirectory where it has "add_library" or something. Maybe set the config and use "find_package" for more information.
I thought I had done adequate research before making this post but it wasn't until I submitted that I found 'related questions' which already cover the topic. Is it a Lexer's Job to Parse Numbers and Strings? & Where should I draw the line between lexer and parser? sufficiently answer my question.
Apologies for the duplicate
SQLite has a returing clause for INSERT;
see https://www.sqlite.org/lang_insert.html
demo:
sqlite> .schema test
CREATE TABLE temp.test(
id integer primary key autoincrement, value integer);
sqlite> insert into test (value) values (44) RETURNING id;
10
Ran into same problem, you just need to add "use client"
on top of your file
I have used "coding" : 8 in my api send content but not working good the message is recive on the destionation mobile as ??????
You are using wrong volume name. container name is db and volume name is postgres_data.
Simply, you can use this command "docker volume rm postgres_data"
In think problem is with how you handle incoming request
BOT_RESPONSE_TIMEOUT is returned (thrown) when the bot doesn't acknowledge the button-press within 10 seconds.
It either mean the bot is offline, or it correctly received your request but didn't call answerCallbackQuery in time.
In any case, nothing wrong on your side. But you HAVE to try..catch this error because it can happen.
pipx
applications that are dependent on other modules installed in the system, need to have those modules preinstalled into the pipx virtual environment:
pipx install --preinstall pyqt5 --preinstall cryptography Electrum-4.5.8.tar.gz
I just wrote a short and simple function which can automatically detect links/hyperlinks in your text/string and convert them into clickable links/hyperlinks.
It uses the newly introduced LinkAnnotation (unlike the deprecated ClickableText).
The regex matches all the possible combinations of a valid URL format.
fun linkifiedText(str: String): AnnotatedString {
val urlRegex = Regex("\\b((https?://)?([a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,}(:\\d+)?(/\\S*)?)\\b")
val matches = urlRegex.findAll(str).map { it.range }
var lastIntRangeIndex = 0
return buildAnnotatedString {
matches.forEach { intRange ->
append(str.slice(IntRange(0, intRange.first - 1)))
withLink(
LinkAnnotation.Url(
if (str.slice(intRange)
.startsWith("www")
) "https://" + str.slice(intRange) else str.slice(intRange),
TextLinkStyles(
style = SpanStyle(
color = Color.Blue,
textDecoration = TextDecoration.Underline
)
)
)
) {
append(str.slice(intRange))
}
lastIntRangeIndex = intRange.last + 1
}
append(str.slice(IntRange(lastIntRangeIndex, str.length - 1)))
}
}
The usage is pretty simple
Text(text = linkifiedText("your_text"))
Any optimization suggestions are appreciated
To do so you have to click
You don't need to add columns to the session table since session data is serialized as JSON (in most cases) when stored to the database, including any custom fields added to it.
When the server pulls the session from the storage it is deserialized and you can access those custom fields.
Note that if you are using connect-session-sequelize, you have the option to configure extendDefaultFields which affect your ability to query session data by those specific fields, but it is not mandatory in order to store custom fields as part of the session data object.
I tried all the solutions given on stack overflow or in the official documentation of neon, prisma, etc. for a whole day. The only thing that magically worked was unchecking the "Internet Protocol version 6 (TCP/IPv6)" box in the Ethernet properties.
This worked for me .
step 1: git remote -v
step 2: git remote set-url origin https://@github.com/user1/project1.git
step 3: git push -u origin main
.table {
// text-wrap: nowrap;
border-collapse: collapse;
}
.form-control{
box-shadow: none !important;
}
.entries-value{
width: 5rem;
}
table.dynamicScroll thead {
position: sticky;
top: 0;
z-index: 10;
}
.table-responsive {
border-radius: 0.6rem;
height: 58vh;
overflow: auto;
&::-webkit-scrollbar{
width: 3px;
height: 3px;
}
&::-webkit-scrollbar-thumb{
border-radius: 5px;
background-color: #7e7e7e;
}
&::-webkit-scrollbar-track{
border-radius: 5px;
background-color: #e4e4e4;
}
thead {
--bs-table-color: #ffffff;
background: var(--gradient-color);
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
--bs-table-bg: none !important;
user-select: none;
th {
font-weight: 500;
}
}
// td , th{
// max-width: 300px;
// }
.table > tbody > tr:hover {
box-shadow: 0 4px 0.8rem rgba(0, 0, 0, 0.233);
transition: 0.3s all ease;
cursor: pointer;
transform: scaleY(1.01);
}
.table > :not(caption) > * > * {
padding: 0.4rem 0.8rem;
font-size: 14px;
}
.dropdown-menu {
transform: translate(-50px, 0px) !important;
}
.dropdown-overflow{
overflow: visible !important;
}
}
.table-bottom {
span {
font-size: 14px;
}
::ng-deep .ngx-pagination {
margin-bottom: 0rem !important;
.pagination-previous.disabled:before{
margin-right: 0rem;
}
.pagination-next.disabled:after{
margin-left: 0rem;
}
.current {
background: var(--table-sec-color) !important;
border-radius: 10px;
font-size: 14px;
}
a {
font-size: 14px;
&:hover{
border-radius: 8px;
}
&:after{
margin-left: 0rem;
}
&::before{
margin-right: 0rem;
}
.disabled:before{
margin-right: 0rem;
}
}
}
}
::ng-deep {
.p-tooltip{
max-width: 25rem !important;
.p-tooltip-text{
font-size: 12px !important;
letter-spacing: 0.5px;
padding: 0.55rem 0.55rem !important;
background-color: #ffffff !important;
color: #000000 !important;
line-height: 25px;
}
&.p-tooltip-top .p-tooltip-arrow {
border-top-color: #ffffff !important;
}
&.p-tooltip-bottom .p-tooltip-arrow {
border-bottom-color: #ffffff !important;
}
&.p-tooltip-left .p-tooltip-arrow {
border-left-color: #ffffff !important;
}
&.p-tooltip-right .p-tooltip-arrow {
border-right-color: #ffffff !important;
}
}
}
:root{
--table-pri-color: #009c97;
// --table-pri-color: #ad5389;
// --table-sec-color: #3c1053;
--table-sec-color: #00076f;
--gradient-color: linear-gradient(
to right,
var(--table-pri-color) 0%,
var(--table-sec-color) 100%
);
// --gradient-color:radial-gradient(circle , var(--table-pri-color) 0%,
// var(--table-sec-color) 100%);
}
how to make the table header fixed
now you can use model_dump_json
Correct.
In Kmip 3.0 there is also an option to retrieve multiple keys in a single operation from a single locate.
Create an assets
folder inside the public
folder to move all your images into. Then, you can access the images directly without using require()
like this:
<img
src={`/assets/${tagEl.value}.png`}
alt="tag"
style={{ width: "3rem" }}
className="suggestion-img-img"
/>
here's. I solve these problem using easy and quick steps
Type Set-ExecutionPolicy -Scope CurrentUser
Type RemoteSigned
Then Yes as Y type
then solved the error
class Solution { public: int removeDuplicates(vector& nums) { set nums1;
for(int i=0; i<nums.size(); i++)
{
nums1.insert(nums[i]);
}
nums.clear();
nums.assign(nums1.begin(), nums1.end());
return nums1.size();
}
};
I have the same issue. Did you find a solution for it?
Add the below condition inside the try
block present in the getTokenFirebase
function with this:
try {
if (typeof window !== 'undefined' && 'serviceWorker' in navigator) {
...
}
}
If I understand what you are trying to say, you want to get the id number of the second highest manager assigned to any given employee? If so, just count the number of ids assigned to the given employee and return the second last one:
=INDEX(D3:M3,COUNT(D3:M3)-1)
Today this error occurred on my prod build. The dev build was fine. My error was, some debug paths to libraries outside my project in tsconfig.app.json -> compilerOptions -> paths.
I got it done by using, BMfont. : https://www.angelcode.com/products/bmfont/
[https://ttf2fnt.com by @Milos_Bejda is a very simple solution. With a few easy steps we can convert any ttf files into fnt. And if your application needs a-z, A-Z, numbers and basic special characters its the place for you. It will generate a mapping file and a png image with the above mentioned characters.]
If you are in need of more special characters [é,®,û, ï, ü : like @Alextoul has asked] we need to go with a sophisticated tool like bmfont which will enable us to choose all the characters we want.
Once downloaded: you open it: the home screen of bmfont
The 1st step is to load the font you want in 'Font Settings' . font selection is done here
And now in 'Export Options' make required changes. font size can be set here. And for normal black characters set the ARGB as A: glyph, R: zero, G: zero, B: zero. (refer image)
Once done you can see the all the character sets as a list in the homepage. Select the sets you need. select the character sets.
Now in the options 'Save bitmap font as' or hit ctrl+s.
If you have done it right, you will get a fnt file along with all the character sets in a set of png files.
I have the same issue. Living in Belgium, the default keyboard layout is French AZERTY, but I use an international QWERTY layout. However, the simulator and the canvas are set to AZERTY by default! And changing it only works for one run, when I start it up again next time it switches back! I really don't understand why the system's keyboard layout is not used.
This Post is for: understanding the relation bt hidden_size & output_size
+ h_t vs out
+ value visualize
in Rnn.
(disclaimer: This is just my personal understanding. I can be wrong.)
Even though, in math, the output_size of y should be customizable base on the shape of the weight matrix of y.
Math:
\[{{\mathbf{h}}_t} = \operatorname{activation} \left( {{{\mathbf{x}}_t}{{\mathbf{W}}_i} + {{\mathbf{h}}_{t - 1}}{{\mathbf{W}}_h} + {{\mathbf{b}}_h}} \right)\]
\[{{\mathbf{y}}_t} = {{\mathbf{h}}_t}{{\mathbf{W}}_o} + {{\mathbf{b}}_o}\]
It seems that Pytroch decided to treat the output y == hidden state h
-- (use output as hidden state for next time step).
Which is ok, some people use this design for rnn.
So, in pytorch, the output_size == hidden_size
. \
Related:
@note: [h_t vs out]
Though I said, >"Pytroch decided to treat the output y == hidden state h".
The actual output has slight difference.
h_t : This is the final hidden state after processing all time steps.
out : contains output at each time step
You can try & see the values are indeed the same. (Which many other answer posts have done.)
out, h_t = self.rnn(x, h0)
for i in range(0, h_t.shape[1]):
# for every batch, the tensor in the last time step of {y_t} output == the tensor in the last layer of h_t hidden_state
if not torch.equal(out[i, -1], h_t[-1, i]):
Following is the a design of RNN,
for complete code, see https://www.youtube.com/watch?v=0_PgWWmauHk
-> https://github.com/patrickloeber/pytorch-examples/blob/master/rnn-lstm-gru/main.py
This uses rnn to predict mnist digits.
Uses Row-wise Flattening of a 2d mnist matrix.
With
input_size = 28 # H_in - input_size – The number of expected features in the input x # size of each vector (row or col wise)
sequence_length = 28 # L - sequence length or the number of time steps
Uses 2 stacked layers in rnn.
The output_size is transformed after rnn, at
self.fc = nn.Linear(hidden_size, num_classes)
# @shape: (batch_size, 128) -> (batch_size, 10)
(//...)
out = self.fc(out)
class RNN(nn.Module):
def __init__(self, input_size, hidden_size, num_layers, num_classes):
super(RNN, self).__init__()
self.num_layers = num_layers
self.hidden_size = hidden_size
# RNN — PyTorch 2.5 documentation
# https://pytorch.org/docs/stable/generated/torch.nn.RNN.html
self.rnn = nn.RNN(input_size, hidden_size, num_layers, batch_first=True, nonlinearity="tanh", bidirectional=False)
# @shape: 28, 128, 2
# or:
# self.gru = nn.GRU(input_size, hidden_size, num_layers, batch_first=True)
# self.lstm = nn.LSTM(input_size, hidden_size, num_layers, batch_first=True)
self.fc = nn.Linear(hidden_size, num_classes)
# @shape: (batch_size, 128) -> (batch_size, 10)
def forward(self, x: Tensor):
# Set initial hidden states (and cell states for LSTM)
h0 = torch.zeros(self.num_layers, x.size(0), self.hidden_size).to(device)
# @nota: n = batch_size = 100
# @shape: x: (batch_size, sequence_length, input_size) = (n, 28, 28)
# @shape: h0: (2, n, 128)
# or with:
# c0 = torch.zeros(self.num_layers, x.size(0), self.hidden_size).to(device)
# Forward propagate RNN // em, no that self loop for recurrent now ..
out, h_t = self.rnn(x, h0)
out: Tensor
# @shape: out: (batch_size, seq_length, hidden_size) = (n, 28, 128)
# (h_t): Shape: (num_layers, batch_size, hidden_size)
# print(">--")
# print(out)
# print(h_t)
# for i in range(0, h_t.shape[1]):
# # for every batch, the tensor in the last time step of {y_t} output == the tensor in the last layer of h_t hidden_state
# if not torch.equal(out[i, -1], h_t[-1, i]):
# raise ValueError("")
# or:
# out, _ = self.lstm(x, (h0,c0))
# Decode the hidden state of the last time step # The `-1` index refers to the last element along the second dimension (sequence length in this case).
out = out[:, -1, :]
# @shape: out: (n, 128) # output of the 28th/last time step
out = self.fc(out)
# @shape: out: (n, 10)
return out
Here is one real output from out, h_t = self.rnn(x, h0) # print(out) # print(h_t)
.
Watch this tensor: [ 0.118, 0.049, 0.117, -0.012, 0.138, ..., -0.074, -0.069, 0.046, -0.004, 0.098], // << eg see this line, they are same
You can find each row tensor in the h_t
in the last row tensor of out
.
>--
tensor([[[ 0.057, 0.105, -0.045, -0.055, 0.214, ..., -0.022, -0.023, 0.018, 0.058, -0.041],
[ 0.069, 0.013, 0.026, -0.040, 0.123, ..., -0.054, 0.014, 0.114, 0.029, 0.067],
[ 0.142, 0.028, 0.018, -0.053, 0.123, ..., -0.046, -0.019, 0.104, 0.024, 0.047],
[ 0.159, 0.032, 0.028, -0.059, 0.115, ..., -0.034, -0.002, 0.121, -0.036, 0.056],
[ 0.132, 0.046, 0.054, -0.046, 0.109, ..., -0.043, -0.005, 0.098, -0.038, 0.072],
...,
[ 0.093, 0.082, 0.231, -0.073, 0.143, ..., -0.067, -0.138, 0.016, 0.007, 0.150],
[ 0.098, 0.067, 0.218, -0.055, 0.120, ..., -0.082, -0.096, 0.034, -0.005, 0.149],
[ 0.158, 0.026, 0.242, -0.053, 0.095, ..., -0.100, -0.105, 0.032, -0.022, 0.121],
[ 0.184, 0.051, 0.244, -0.048, 0.115, ..., -0.125, -0.123, 0.023, 0.007, 0.129],
[ 0.147, 0.050, 0.239, -0.025, 0.126, ..., -0.100, -0.135, 0.031, -0.027, 0.131]],
[[ 0.057, 0.105, -0.045, -0.055, 0.214, ..., -0.022, -0.023, 0.018, 0.058, -0.041],
[ 0.069, 0.013, 0.026, -0.040, 0.123, ..., -0.054, 0.014, 0.114, 0.029, 0.067],
[ 0.142, 0.028, 0.018, -0.053, 0.123, ..., -0.046, -0.019, 0.104, 0.024, 0.047],
[ 0.159, 0.032, 0.028, -0.059, 0.115, ..., -0.034, -0.002, 0.121, -0.036, 0.056],
[ 0.122, 0.021, 0.088, -0.125, 0.089, ..., -0.045, -0.003, 0.064, 0.024, 0.040],
...,
[ 0.071, -0.062, 0.179, -0.167, -0.020, ..., -0.195, -0.090, 0.108, 0.166, 0.113],
[ 0.137, -0.026, 0.259, -0.002, 0.045, ..., -0.156, -0.108, 0.046, 0.049, 0.138],
[ 0.122, -0.019, 0.159, 0.013, 0.085, ..., -0.098, -0.046, 0.006, -0.002, 0.072],
[ 0.133, 0.047, 0.095, 0.011, 0.123, ..., -0.081, -0.055, 0.033, -0.026, 0.107],
[ 0.090, 0.078, 0.068, -0.047, 0.153, ..., -0.052, -0.063, 0.069, -0.030, 0.119]],
[[ 0.057, 0.105, -0.045, -0.055, 0.214, ..., -0.022, -0.023, 0.018, 0.058, -0.041],
[ 0.069, 0.013, 0.026, -0.040, 0.123, ..., -0.054, 0.014, 0.114, 0.029, 0.067],
[ 0.142, 0.028, 0.018, -0.053, 0.123, ..., -0.046, -0.019, 0.104, 0.024, 0.047],
[ 0.159, 0.032, 0.028, -0.059, 0.115, ..., -0.034, -0.002, 0.121, -0.036, 0.056],
[ 0.132, 0.046, 0.054, -0.046, 0.109, ..., -0.043, -0.005, 0.098, -0.038, 0.072],
...,
[ 0.064, 0.077, -0.109, -0.184, 0.064, ..., 0.100, -0.053, 0.139, 0.047, 0.058],
[ 0.062, 0.056, -0.136, -0.172, 0.081, ..., 0.073, -0.063, 0.159, 0.054, 0.100],
[ 0.026, 0.006, -0.107, -0.160, 0.105, ..., 0.041, -0.043, 0.172, 0.049, 0.113],
[ 0.087, -0.002, 0.011, -0.106, 0.083, ..., -0.021, -0.031, 0.087, 0.058, 0.047],
[ 0.099, 0.001, 0.045, -0.068, 0.126, ..., -0.043, -0.028, 0.099, 0.008, 0.101]],
[[ 0.057, 0.105, -0.045, -0.055, 0.214, ..., -0.022, -0.023, 0.018, 0.058, -0.041],
[ 0.069, 0.013, 0.026, -0.040, 0.123, ..., -0.054, 0.014, 0.114, 0.029, 0.067],
[ 0.142, 0.028, 0.018, -0.053, 0.123, ..., -0.046, -0.019, 0.104, 0.024, 0.047],
[ 0.159, 0.032, 0.028, -0.059, 0.115, ..., -0.034, -0.002, 0.121, -0.036, 0.056],
[ 0.132, 0.046, 0.054, -0.046, 0.109, ..., -0.043, -0.005, 0.098, -0.038, 0.072],
...,
[ 0.046, 0.065, -0.045, -0.082, 0.068, ..., 0.069, -0.037, 0.106, 0.019, 0.102],
[ 0.040, 0.045, -0.063, -0.106, 0.046, ..., 0.068, -0.051, 0.122, 0.023, 0.072],
[ 0.101, 0.050, -0.019, -0.106, 0.068, ..., 0.007, -0.035, 0.119, 0.045, 0.034],
[ 0.126, 0.035, 0.041, -0.078, 0.091, ..., -0.039, -0.030, 0.111, 0.004, 0.087],
[ 0.125, 0.028, 0.066, -0.058, 0.122, ..., -0.053, -0.031, 0.084, -0.016, 0.088]],
[[ 0.057, 0.105, -0.045, -0.055, 0.214, ..., -0.022, -0.023, 0.018, 0.058, -0.041],
[ 0.069, 0.013, 0.026, -0.040, 0.123, ..., -0.054, 0.014, 0.114, 0.029, 0.067],
[ 0.142, 0.028, 0.018, -0.053, 0.123, ..., -0.046, -0.019, 0.104, 0.024, 0.047],
[ 0.159, 0.032, 0.028, -0.059, 0.115, ..., -0.034, -0.002, 0.121, -0.036, 0.056],
[ 0.132, 0.046, 0.054, -0.046, 0.109, ..., -0.043, -0.005, 0.098, -0.038, 0.072],
...,
[ 0.090, 0.034, -0.028, -0.124, 0.030, ..., 0.071, -0.059, 0.109, 0.089, 0.058],
[ 0.109, 0.058, -0.057, -0.142, 0.042, ..., 0.064, -0.043, 0.122, 0.082, 0.047],
[ 0.091, 0.036, -0.018, -0.094, 0.039, ..., 0.036, -0.003, 0.126, 0.028, 0.066],
[ 0.122, 0.046, 0.041, -0.068, 0.088, ..., -0.023, -0.023, 0.114, 0.007, 0.052],
[ 0.127, 0.034, 0.056, -0.061, 0.126, ..., -0.047, -0.022, 0.102, -0.010, 0.079]],
...,
[[ 0.057, 0.105, -0.045, -0.055, 0.214, ..., -0.022, -0.023, 0.018, 0.058, -0.041],
[ 0.069, 0.013, 0.026, -0.040, 0.123, ..., -0.054, 0.014, 0.114, 0.029, 0.067],
[ 0.142, 0.028, 0.018, -0.053, 0.123, ..., -0.046, -0.019, 0.104, 0.024, 0.047],
[ 0.159, 0.032, 0.028, -0.059, 0.115, ..., -0.034, -0.002, 0.121, -0.036, 0.056],
[ 0.132, 0.046, 0.054, -0.046, 0.109, ..., -0.043, -0.005, 0.098, -0.038, 0.072],
...,
[-0.042, -0.062, 0.058, -0.124, 0.102, ..., 0.064, -0.063, 0.070, 0.269, 0.059],
[ 0.005, -0.011, -0.033, -0.105, 0.090, ..., 0.051, -0.037, 0.088, 0.175, 0.086],
[ 0.050, -0.022, -0.007, -0.003, 0.033, ..., 0.051, -0.002, 0.010, 0.080, 0.041],
[ 0.107, 0.045, 0.001, -0.022, 0.127, ..., -0.013, -0.072, 0.049, 0.027, 0.059],
[ 0.121, 0.076, 0.010, -0.044, 0.148, ..., -0.042, -0.076, 0.044, 0.004, 0.082]],
[[ 0.057, 0.105, -0.045, -0.055, 0.214, ..., -0.022, -0.023, 0.018, 0.058, -0.041],
[ 0.069, 0.013, 0.026, -0.040, 0.123, ..., -0.054, 0.014, 0.114, 0.029, 0.067],
[ 0.142, 0.028, 0.018, -0.053, 0.123, ..., -0.046, -0.019, 0.104, 0.024, 0.047],
[ 0.159, 0.032, 0.028, -0.059, 0.115, ..., -0.034, -0.002, 0.121, -0.036, 0.056],
[ 0.132, 0.046, 0.054, -0.046, 0.109, ..., -0.043, -0.005, 0.098, -0.038, 0.072],
...,
[ 0.106, 0.021, 0.173, -0.125, 0.190, ..., -0.045, -0.106, 0.089, 0.073, 0.136],
[ 0.077, 0.070, 0.030, -0.137, 0.173, ..., 0.030, -0.067, 0.129, 0.023, 0.162],
[ 0.067, 0.056, 0.031, -0.074, 0.039, ..., 0.057, -0.016, 0.059, 0.012, 0.073],
[ 0.095, 0.077, 0.036, -0.066, 0.120, ..., 0.021, -0.044, 0.117, -0.004, 0.073],
[ 0.125, 0.057, 0.063, -0.060, 0.109, ..., -0.030, -0.051, 0.102, -0.016, 0.085]],
[[ 0.057, 0.105, -0.045, -0.055, 0.214, ..., -0.022, -0.023, 0.018, 0.058, -0.041],
[ 0.069, 0.013, 0.026, -0.040, 0.123, ..., -0.054, 0.014, 0.114, 0.029, 0.067],
[ 0.142, 0.028, 0.018, -0.053, 0.123, ..., -0.046, -0.019, 0.104, 0.024, 0.047],
[ 0.159, 0.032, 0.028, -0.059, 0.115, ..., -0.034, -0.002, 0.121, -0.036, 0.056],
[ 0.132, 0.046, 0.054, -0.046, 0.109, ..., -0.043, -0.005, 0.098, -0.038, 0.072],
...,
[ 0.048, 0.031, -0.103, -0.133, 0.037, ..., 0.069, -0.058, 0.122, 0.030, 0.073],
[ 0.043, -0.006, -0.082, -0.113, 0.040, ..., 0.040, -0.053, 0.122, 0.032, 0.083],
[ 0.088, 0.013, -0.004, -0.104, 0.083, ..., -0.036, -0.046, 0.100, 0.048, 0.055],
[ 0.115, 0.017, 0.061, -0.080, 0.102, ..., -0.054, -0.037, 0.096, -0.002, 0.102],
[ 0.113, 0.023, 0.075, -0.052, 0.118, ..., -0.050, -0.031, 0.078, -0.022, 0.093]],
[[ 0.057, 0.105, -0.045, -0.055, 0.214, ..., -0.022, -0.023, 0.018, 0.058, -0.041],
[ 0.069, 0.013, 0.026, -0.040, 0.123, ..., -0.054, 0.014, 0.114, 0.029, 0.067],
[ 0.142, 0.028, 0.018, -0.053, 0.123, ..., -0.046, -0.019, 0.104, 0.024, 0.047],
[ 0.159, 0.032, 0.028, -0.059, 0.115, ..., -0.034, -0.002, 0.121, -0.036, 0.056],
[ 0.132, 0.046, 0.054, -0.046, 0.109, ..., -0.043, -0.005, 0.098, -0.038, 0.072],
...,
[ 0.091, -0.014, 0.236, -0.042, 0.136, ..., -0.139, -0.112, -0.028, 0.070, 0.103],
[ 0.095, -0.008, 0.239, -0.029, 0.136, ..., -0.127, -0.120, -0.014, 0.055, 0.126],
[ 0.123, 0.026, 0.213, -0.024, 0.147, ..., -0.134, -0.105, 0.010, 0.061, 0.121],
[ 0.127, 0.038, 0.211, -0.009, 0.147, ..., -0.092, -0.124, 0.040, 0.005, 0.114],
[ 0.118, 0.049, 0.117, -0.012, 0.138, ..., -0.074, -0.069, 0.046, -0.004, 0.098]], // << eg see this line, they are same
[[ 0.057, 0.105, -0.045, -0.055, 0.214, ..., -0.022, -0.023, 0.018, 0.058, -0.041],
[ 0.069, 0.013, 0.026, -0.040, 0.123, ..., -0.054, 0.014, 0.114, 0.029, 0.067],
[ 0.142, 0.028, 0.018, -0.053, 0.123, ..., -0.046, -0.019, 0.104, 0.024, 0.047],
[ 0.159, 0.032, 0.028, -0.059, 0.115, ..., -0.034, -0.002, 0.121, -0.036, 0.056],
[ 0.132, 0.046, 0.054, -0.046, 0.109, ..., -0.043, -0.005, 0.098, -0.038, 0.072],
...,
[ 0.152, -0.010, 0.118, -0.057, 0.071, ..., -0.202, 0.018, 0.039, 0.035, 0.105],
[ 0.118, -0.042, 0.180, -0.128, 0.109, ..., -0.099, -0.110, 0.044, 0.063, 0.076],
[ 0.073, -0.049, 0.173, -0.136, 0.087, ..., -0.036, -0.123, 0.002, 0.133, 0.087],
[ 0.069, -0.013, 0.158, -0.002, 0.055, ..., -0.063, -0.058, 0.019, 0.025, 0.139],
[ 0.124, 0.043, 0.126, 0.003, 0.102, ..., -0.062, -0.050, 0.027, 0.027, 0.043]]], device='cuda:0', grad_fn=<CudnnRnnBackward0>)
tensor([[[ 0.183, -0.012, 0.073, -0.071, -0.109, ..., 0.137, -0.035, -0.130, -0.083, 0.095],
[ 0.180, 0.006, -0.001, -0.072, -0.091, ..., 0.107, -0.048, -0.102, -0.115, 0.042],
[ 0.172, -0.030, -0.035, -0.092, -0.117, ..., 0.134, -0.004, -0.097, -0.090, 0.047],
[ 0.174, -0.006, -0.010, -0.082, -0.100, ..., 0.104, -0.027, -0.120, -0.122, 0.045],
[ 0.185, 0.012, -0.005, -0.058, -0.087, ..., 0.119, -0.025, -0.112, -0.108, 0.044],
...,
[ 0.133, 0.020, -0.024, -0.084, -0.078, ..., 0.120, -0.073, -0.125, -0.093, 0.026],
[ 0.162, -0.003, -0.011, -0.075, -0.095, ..., 0.102, -0.036, -0.110, -0.100, 0.031],
[ 0.172, -0.020, -0.010, -0.087, -0.097, ..., 0.100, -0.028, -0.122, -0.131, 0.044],
[ 0.165, 0.015, 0.037, -0.078, -0.044, ..., 0.125, -0.020, -0.113, -0.134, 0.039],
[ 0.124, 0.012, -0.002, -0.105, 0.006, ..., 0.146, -0.070, -0.155, -0.155, 0.038]],
[[ 0.147, 0.050, 0.239, -0.025, 0.126, ..., -0.100, -0.135, 0.031, -0.027, 0.131],
[ 0.090, 0.078, 0.068, -0.047, 0.153, ..., -0.052, -0.063, 0.069, -0.030, 0.119],
[ 0.099, 0.001, 0.045, -0.068, 0.126, ..., -0.043, -0.028, 0.099, 0.008, 0.101],
[ 0.125, 0.028, 0.066, -0.058, 0.122, ..., -0.053, -0.031, 0.084, -0.016, 0.088],
[ 0.127, 0.034, 0.056, -0.061, 0.126, ..., -0.047, -0.022, 0.102, -0.010, 0.079],
...,
[ 0.121, 0.076, 0.010, -0.044, 0.148, ..., -0.042, -0.076, 0.044, 0.004, 0.082],
[ 0.125, 0.057, 0.063, -0.060, 0.109, ..., -0.030, -0.051, 0.102, -0.016, 0.085],
[ 0.113, 0.023, 0.075, -0.052, 0.118, ..., -0.050, -0.031, 0.078, -0.022, 0.093],
[ 0.118, 0.049, 0.117, -0.012, 0.138, ..., -0.074, -0.069, 0.046, -0.004, 0.098], // << eg see this line, they are same
[ 0.124, 0.043, 0.126, 0.003, 0.102, ..., -0.062, -0.050, 0.027, 0.027, 0.043]]], device='cuda:0', grad_fn=<CudnnRnnBackward0>)
you can change it by just writing p
...
ie
p myBoolVariable = false
verify by po
command and it should return false
Seems like I missed to set the following environment variables,
PYSPARK_PYTHON=path\python
PYSPARK_DRIVER_PYTHON=path\python
After setting above variables in the env, everything works fine.
but I still wonder why only the DF created using spark.createDataFrame()
failed, but the one created using spark.read()
worked when the above env variables are missing. Please let me know.
set the module resolution to node
"moduleResolution": "node"
and use
npm install @types/firebase --save-dev
before this delete node modules, package lock file
For the public_html directory:
chmod 711 /home/username/public_html This lets the owner read, write, and execute, while others can execute.
For the .htaccess file:
chmod 644 /home/username/public_html/.htaccess This lets the owner read and write, while others can only read.
Run this command to set ownership:
chown username:username /home/username/public_html/.htaccess chown username:username /home/username/public_html Replace username with your account's username.
For example:
chmod 711 /home/username 4. Look Over Your .htaccess File for Grammar Mistakes If the permissions and ownership are right, the .htaccess file might have grammar errors. Take a close look at what's inside to spot any slip-ups.
I'm running into the same issue. The best I've found so far is to set output = "data.frame"
from datasummary/modelsummary and pipe that into kbl(), which is set to format = "latex
.
However, the dataframe from modelsummary is converted to characters so no numerical formatting options in kableExtra function.
You can use countdown.js JavaScript file. I implemented this library to create countdown timer so easy and fast. You can get it from this link on my github.
v1 API No longer works, you have to migrate to HTTP v1 https://firebase.google.com/docs/cloud-messaging/migrate-v1
Library Google Api Client https://github.com/googleapis/google-api-php-client/releases
Get JSON from Firebase "Manage Service Accounts".
Can check this code example:
require_once '/google-api-php-client/vendor/autoload.php';
function notification($notifications){
$serviceAccountPath = 'service-account-file.json';
// Your Firebase project ID
$projectId = 'xxxxxx';
// Example message payload
$message = [
'token' => 'deviceToken',
'notification' => [
'title' => $title,
'body' => $msg,
],
];
$accessToken = getAccessToken($serviceAccountPath);
$response = sendMessage($accessToken, $projectId, $message);
}
function getAccessToken($serviceAccountPath) {
$client = new Client();
$client->setAuthConfig($serviceAccountPath);
$client->addScope('https://www.googleapis.com/auth/firebase.messaging');
$client->useApplicationDefaultCredentials();
$token = $client->fetchAccessTokenWithAssertion();
return $token['access_token'];
}
function sendMessage($accessToken, $projectId, $message) {
$url = 'https://fcm.googleapis.com/v1/projects/' . $projectId . '/messages:send';
$headers = [
'Authorization: Bearer ' . $accessToken,
'Content-Type: application/json',
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(['message' => $message]));
$response = curl_exec($ch);
curl_close($ch);
return $response;
}
If you also found yourself here and are using Jolt3d. The answer is in the advanced project settings of Jolt3D. You will need to enable "Areas detect static bodies". This is not enabled by default.
Binding the child form is the correct way but need to do one more step. // Create an instance of the child form var childForm = new ChildForm();`
// Bind the FormClosed event to a handler in the main form
childForm.FormClosed += ChildForm_FormClosed;`
Yeah, so the only way that I could get this to work was by force passing the command line tag. Could not find a way to do this better :(
The issue you're facing is due to how SQL Server handles floating-point numbers.
In summary, the difference arises because floating-point numbers are not always exact, and the HAVING clause checks for exact values. Using ROUND helps to avoid this issue by rounding the sum to a whole number.
I was attempting to deploy to a shared web app service on Azure which only supports 32-bit applications. Checked my project settings and realized I was targeting 64-bit; changing it to 32-bit resolved this error for me.
to fix the timezone issue on Django application,which ensures Use_Tz = True in settings of the application, and make sure to set your TIME_ZONE, and use the timezone template filter in the HTML to display the datetime in the timezone :
{% load tz %} {{ datatime_variable|timezone:"America/Sao_Paulo" }}
This worked for me:
plt.gca().get_figure().set_frameon(False)
The error "No 'Access-Control-Allow-Origin' header is present on the requested resource" occurs because the server you are trying to access does not allow cross-origin requests from your domain. This is due to CORS (Cross-Origin Resource Sharing) restrictions.
Modify the server to include the Access-Control-Allow-Origin
header in the response:
Access-Control-Allow-Origin: *
Access-Control-Allow-Origin: https://your-allowed-domain.com
Access-Control-Allow-Methods: GET, POST, OPTIONS
Access-Control-Allow-Headers: Content-Type
How to Avoid It
Simply return the existing promise without wrapping
Example:
function getStuffDone(param) {
return myPromiseFn(param + 1);
}
If additional logic is neede
function getStuffDone(param) {
return myPromiseFn(param + 1)
.then((val) => {
return val;
});
}
Avoid creating a new Promise or deferred object unless absolutely necessary. Leverage chaining and existing promises instead.
Client-side programming runs in the user's browser and is responsible for the user interface, interactivity, and immediate feedback. Examples include HTML, CSS, and JavaScript. It handles tasks like form validation, animations, and dynamic content rendering.
Server-side programming runs on the server and handles data processing, database interactions, authentication, and business logic. Examples include PHP, Python, Node.js, and Java. It generates responses to client requests, like rendering HTML or sending JSON data.
The key difference: client-side focuses on user experience, while server-side focuses on backend logic and data management. Both often work together to create dynamic, interactive web applications.
Yeah, php_admin_value open_basedir none
works perfectly, I forgot to apply this setting to SSL section in vhost, just in normal vhost (no SSL) so it did not work
i tried above code, did not bring to front. i modified code, now only opens (1) calculator, and if behind my form, brings to the front. only issue, if calculator is minimized, does not bring up from taskbar??
Dim calc As Process = Process.GetProcesses.FirstOrDefault(Function(p) p.MainWindowTitle = "Calculator") Dim r() As Process = Process.GetProcessesByName("CalculatorApp") If r.Count > 0 Then 'bring calculator to the front BringWindowToTop(calc.MainWindowHandle).Equals(True) Else 'open the calculator Process.Start("C:\Windows\system32\calc.exe") End If
require("ggplot2")
ggplot(DATASET, aes(x=discount, y=hit, color=application, group=application)) +
geom_points() +
geom_smooth(method="lm")
Just change DATASET for the name of your dataframe.
cd "C:\Program Files\MySQL\MySQL Server 8.0\bin"
mysql -u username -p database_name < path\to\your\file.sql
unzip -p filename.zip | mysql -u username -p database_name
zcat filename.sql.gz | mysql -u username -p database_name
The kind people from the Svelte Discord helped me with this one.
You'll want to create a constant to alias the component and then use that in the template.
e.g.
const Amenity = amenityMap[amenity] ?? CornerDownRight;
<Amenity class="h-fit w-fit scale-75" {...restProps} />
So in the end, it was an issue with OpenPGP.js v6.0.0. The bug was fixed on November 21: https://github.com/openpgpjs/openpgpjs/commit/f75447afaa681dc6fa7448a4bf82c63b10265b46
were you able to solve this issue? I'm encountering the same problem.
I saw your query, and would like to suggest something:
I hope this helps.
You're only reading one character from cin
per iteration of the while loop. This means your program is going to process each character individually until it has cleared the cin
buffer.
The simple fix is to add fflush(stdin)
inside and at the end of your while loop. This way, you're only reading the first character in the cin
buffer and discarding the rest.
Some may tell you to read the entirety of cin
into a std::string
, but for your case you'll be able to get away with discarding every character but the first one.
In case you didn't read, here is your code snippet:
do{
cout << "Would you like to play (Y/N): ";
cin >> gameSelect;
if(gameSelect == 'Y'){
}
else if(gameSelect == 'N'){
cout << "Thank You For Playing!\n";
}
else{
cout << "Invalid Input, Try Again (Y/N)\n";
}
fflush(stdin); // discard all remaining characters in cin
}while(gameSelect != 'N');
Javascript issue : Ensure loadContacts isn't called repeatedly. Using isDataLoaded correctly and debug with console.log.
Unexpected webSocket calls : To checks for external scripts
form or redirect loops
cache-control headers
server heandlings
HTML validations
sd takes a vector as an argument, while dailyReturns seems to take a data.frame (you're using nrow on it).
You'd need to change:
mutate(yrReturn=sapply(StockReturns[row_number()+1], yearReturn))
to
mutate(yrReturn=sapply(StockReturns[row_number()+1,], yearReturn))
So it sends a data.frame to the sub function.
The issue has been resolved. There were 2 issues that needed to be addressed to resolve this problem. First, when deploying to the IIS web server, the certificate being used was a machine cert not a user cert so in the appsettings.json "CertificateStorePath": "CurrentUser/My" needed to be replaced with "CertificateStorePath": "LocalMachine/My". The second was the account running the IIS application pool for the site needs to be granted access to the certificate used through the management console.
It is impossible to simply inherit gRPC.Channel to work with Redis, because gRPC works on top of HTTP/2 with proto-buffers, and Redis uses its own unique protocol (RESP). These formats are incompatible. Even if you inherit, you need to completely rewrite the logic to adapt gRPC.Channel to work with the Redis protocol, which negates the point of inheritance. gRPC is designed to call methods on remote services, and not to work with arbitrary protocols, like Redis.
Still gRPC can be used for connection management and I/O multiplexing, but this is only possible if you implement your own transport and protocol for Redis on top of gRPC.
While gRPC provides excellent connection management and concurrency support, using it in the context of Redis can be a complex and inefficient solution. For using Redis in a cluster, it is much easier to use specialized client libraries such as redis-py, which already take into account the specifics of Redis working with a cluster, connection management, and multiplexing.
There is a simple way to do that in eclipse just select the contents and right click-> qick fix-> generate text block.
This will add “”” comtents “””.
Happy Coding!!!
It's helped me (Changed MTU to 1400) stackoverflow.com/a/75452499
Just maintain the correct path for both.
For me the command was,
C:/omnetpp/veins-master/sumo-launchd.py -vv -c 'C:/Program Files (x86)/Eclipse/Sumo/bin/sumo-gui.exe'
It is working fine. Please be aware while copying the path. I faced the same issue because while copying I missed the drive name. That's why the system thought it was a relative path.
Also, check the compatibility of Veins, INet, Omnet, Sumo
The "Index" headline is the default behavior in JSDoc when generating documentation for your files. To change it, you can do the following:
Use @module instead of @file: This will display the module name instead of "Index."
javascript
/**
Use a custom JSDoc template: You can switch to a template like Minami to get a cleaner output. For example:
bash
npm install minami --save-dev jsdoc -t ./node_modules/minami
Modify jsdoc.json config: Adjust the jsdoc.json file to customize the output or suppress the default file index.
This will allow you to replace or remove the "Index" headline with something more meaningful.
I don't think you can assign to t-1. Something like:
if t == 1861:
continue
if t == 1862:
previous_t = 1860
else:
previous_t = t - 1
For me this happened on a matrix job where I was migrating from npm
to pnpm
and the action was configured assuming both branches has the pnpm-lock.yaml
file.
All I had to do to fix it was synchronize the branches.
Floating-point arithmetic is dodgy; in other words, adding two floats doesn't give the expected result due to how the numbers are stored in memory.
In my case pkg update wasn't enough so i ran apt full upgrade
Failure to include #!/bin/bash or similar in the .sh file can and WILL lead to very strange things! In example, here's a daily backup script snippet:
cd /home/user/
rsync -vaHAWXS --delete --exclude={"BOINC/","TEMP/","DATA/","NTFS/",".*","snap/"} ~/ ~/DATA/BACKUPS/home/user >rsync_home.out 2>rsync_home.err
Without #!/bin/bash in daily_backup.sh, the script still works perfectly when invoked from the command line via SSH. However, when invoked via Crontab, the rsync still runs, but the --exclude= is ignored. This caused a circular reference in the backup source files which filled the backup destination drive and crashed the system.
These files from 2023 and later are still up, if you have active support you would seem them in your account.
But Intel purged the old stuff, before 2023 and Parallel Studio XE.
m_BaseKit_p_2023.0.0.25441.dmg https://registrationcenter-download.intel.com/akdlm/IRC_NAS/19080/m_BaseKit_p_2023.0.0.25441.dmg MD5 : a827910f55d6baf1a84f123f619f715f SHA384 : 137ca9e24accb11c730ae4e59d946b23abb46c6b28abe7084c82ded6cd16a50d7df465a350ac093efb8909f67ce2de7b
m_BaseKit_p_2023.0.0.25441_offline.dmg https://registrationcenter-download.intel.com/akdlm/IRC_NAS/19080/m_BaseKit_p_2023.0.0.25441_offline.dmg MD5 : f092313993c836e97c2d997ef9c6541b SHA384 : 77f8cb24b2e858b285dec6c38ca0f7131fe1ac776817dd7b11eda9999695ba1102d2c03e1dd1cca55ee3c9f243ba5b66
I'm in even worse situation: calling some methods of the host class works fine, while other give this "undefined" error. Leaning towards shared library, but would love to understand why???
How do you navigate in your tests ? when I set port instead of url
await page.goto("http://localhost:3000");
is not working
No, you cannot use a tag to preconnect to a WebSocket destination.
The tag in HTML is designed to preconnect to HTTP/HTTPS destinations to improve the performance of subsequent requests. This preconnect feature works by establishing a connection to a specified host early in the page load process, which can reduce latency when resources (like CSS, JavaScript, or images) are requested from that host.
However, WebSockets work differently from traditional HTTP/HTTPS connections. A WebSocket connection is established using the WebSocket API in JavaScript, and it uses a different protocol (ws:// or wss://) compared to HTTP/HTTPS. As a result, the tag cannot be used to preconnect to a WebSocket server.
To optimize WebSocket connections, you would typically initiate the WebSocket connection in your JavaScript code after the page has loaded, like so:
The requestAnimationFrame
method in the browser passes a timestamp to the callback function. By default, your animation method is not set up to accept this argument.
Try def animation(self, timestamp=none):
.
Try Something like this Get-childItem -path D:\Root\b* -Include *.html > C:\A_Temp_Folder\test.txt -Recurse -Force
apt install python3-pygame
include the 3.
just wanted to ask a question. I am a newbie on leetcode and just wanted to ask doesn't the .size() function just returns the size of the array and not the actual length of the array, won't it be .size()/4. I am also confused with it for a few days so just wanted to ask. Would be very thankful if you could answer and explain it to me
You also can get a .lib file on github for compiling php-cpp with Windows:
https://github.com/subabrain/phpcpp_win/releases/tag/phpcpp_win
As I can't post this in a comment …
I get a strange comportment :\
>>> with open("./Python/nombres_premiers", "r") as f:
... a = f.seek(0,2)
... l = ""
... for i in range(a-2,0,-1):
... f.seek(i)
... l = f.readline() + l
... if l[0]=="\n":
... break
...
1023648626
1023648625
1023648624
1023648623
1023648622
1023648621
1023648620
1023648619
1023648618
1023648617
1023648616
>>> l
'\n2001098251\n001098251\n01098251\n1098251\n098251\n98251\n8251\n251\n51\n1\n'
>>> with open("./Python/nombres_premiers", "r") as f:
... a = f.seek(0,2)
... l = ""
... for i in range(a-2,0,-1):
... f.seek(i)
... l = f.readline()
... if l[0]=="\n":
... break
...
1023648626
1023648625
1023648624
1023648623
1023648622
1023648621
1023648620
1023648619
1023648618
1023648617
1023648616
>>> l
'\n'
How to get l = 2001098251
?
In my observation, if you reuse the groupId + artifactId for another GitHub Packages repository, the issue is reproduced. After changing the combination to a new and unique one at the point of time, the original one will become available again. The behavior sounds strange, but it is what I am seeing, I believe. Hoping insights from more knowledgeable people.