By continuing you indicate that you have read and agree to our Terms of service and Privacy policy
by ValveSoftware C++ Version: proton-7.0-5 License: Non-SPDX
by ValveSoftware C++ Version: proton-7.0-5 License: Non-SPDX
Support
Quality
Security
License
Reuse
kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample Here
Get all kandi verified functions for this library.
Get all kandi verified functions for this library.
Compatibility tool for Steam Play based on Wine and additional components
QUESTION
New Firefox Update Bookmarks Toolbar (Show more bookmarks) | Double Space Problem
Asked 2022-Mar-25 at 04:59I updated my firefox to the latest version :
Version 92.0
Now in Bookmarks Toolbar (Show more bookmarks) i have a problem about double Space between bookmarks.
There is a thread in stack like this :
new-firefox-update-menu-bookmark-padding-spacing-fix
But i could n't find any userChrome.css
file in fiefox profile folder.
How can i fix double space issue?
Try browser.proton.contextmenus.enabled > false (disables Proton UI of context menus)
Did not work for me.
As you see in the image below spaces are more than usual.
This is really annoying.
Please guide me to fix this issue without manipulating or creating new rules in css.
ANSWER
Answered 2021-Sep-10 at 22:44You have to create the file (and folder) yourself, and enable setting in about:config to tell Firefox it should apply it. Recycled howto for enabling and easy debugging from https://twitter.com/myfonj/status/1387584962354982912 :
How to inspect Firefox UI, make changes and persist them across restarts, in 9 steps: 1. Enable userChrome.cssVisit about:config, search for '.styles' and toggle toolkit.legacyUserProfileCustomizations.stylesheets
to true.
Open ≡ Menu > More Tools > Web Developer Tools > ⚙ Settings > Advanced and check (or press F12, then F1)
<profile folder>
See path at about:support#profile-row
4. Open Browser ToolboxLaunch ≡ Menu > More Tools > Browser Toolbox (or press Ctrl+Shift+Alt+I)
5. Allow incoming connection. 6. Switch to Style(sheet) Editor. 7. Create new style 8. Try canonical* { color: red !important; }
9. Save it as <profile folder>\chrome\userChrome.css
(10.) Done. Now you can close the Toolbox and Firefox without losing your precious tweaks.
QUESTION
npm run build is giving me errors I'm not sure how to fix
Asked 2022-Mar-21 at 00:35This is my first app and first time trying to deploy and I'm facing an error I really don't know how to fix. This is what I'm getting when I run "npm run build"
PS C:\Users\julyj\Desktop\CODING\00 - Proton Media\BloCurate> npm run build
> proton-market@1.1.2 build
> next build
(node:11768) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at C:\Users\julyj\Desktop\CODING\00 - Proton Media\BloCurate\node_modules\postcss\package.json.
Update this package.json to use a subpath pattern like "./*".
(Use `node --trace-deprecation ...` to show where the warning was created)
Loaded env from C:\Users\julyj\Desktop\CODING\00 - Proton Media\BloCurate\.env.local
Failed to compile.
./components/AllAssets/index.tsx:32:8
Type error: Object is possibly 'undefined'.
30 | return (
31 | <ul>
> 32 | {assets.map((result) => {
| ^
33 | const {
34 | collection: { name },
35 | data: { image },
info - Creating an optimized production build .
PS C:\Users\julyj\Desktop\CODING\00 - Proton Media\BloCurate>
I tried looking up (node:11768) [DEP0148] and there was a suggestion about changing a format under node modules from "./" to "./*" but that didn't fix the error. I'm not sure if the error is being caused by that or if it's the type error that's shown below.
Although it says info - Creating an optimized production build at the bottom, it doesn't create the build folder. Not sure if I need to post more information here but I'll gladly do so if requested in order to solve this issue.
ANSWER
Answered 2022-Mar-21 at 00:35The real error seems to be the TypeError
in your TypeScript code. This can be fixed in two ways.
1. You can add the following code.
assets!.map( // ...
This tells TypeScript that the object will never have the value of undefined
. Therefore, it will infer that the type is array
, instead of array | undefined
.
2. You can add the following code.
assets?.map( // ...
This code works both in JavaScript and TypeScript. The method used in this option is called optional chaining. It basically tells JavaScript/TypeScript that if assets
is undefined
, then it will not use the map()
method, instead of throwing an error.
Extra: The DeprecationWarning
can be safely ignored; it won't cause any issues with your deployment.
QUESTION
Array map is giving me an error when trying to call the data in a dynamic render operation
Asked 2022-Mar-09 at 19:23function UserTransactionsComponent1() {
const [accounts, setAccounts] = useState();
useEffect(() => {
async function fetchData() {
const res = await fetch(
'https://proton.api.atomicassets.io/atomicassets/v1/accounts'
);
const { data } = await res.json();
setAccounts(data);
}
fetchData();
}, []);
accounts.map((result) => {
const { account } = result;
});
return <PageLayout>Hi! {account}</PageLayout>;
}
export default UserTransactionsComponent1;
I console.log(accounts) right before I map it and all the properties are there. The issue is that the account in the acounts.map is showing greyed out on VSCode. It's not being picked up on the return. This is causing me to receive the following error: TypeError: Cannot read properties of undefined (reading 'map'). What's the reason for this?
ANSWER
Answered 2022-Mar-09 at 19:23The return statement is outside the variable (account) scope.
function UserTransactionsComponent1() {
const [accounts, setAccounts] = useState();
useEffect(() => {
async function fetchData() {
const res = await fetch(
"https://proton.api.atomicassets.io/atomicassets/v1/accounts"
);
const { data } = await res.json();
setAccounts(data);
}
fetchData();
}, []);
const getAccounts = () => {
if (accounts)
return accounts?.map((result) => {
const { account } = result;
return account;
})
}
return (
<PageLayout>
Hi!{" "}
{getAccounts()}
</PageLayout>
);
}
export default UserTransactionsComponent1;
QUESTION
Next.js, getStaticProps not working with component but does with page
Asked 2022-Mar-05 at 08:14If I visit this code on local host, it is able to pull data from the API and then display it on a card.
import { formatNumber, parseTimestampJM } from '../../utils';
import { Card } from './UserTransactions.styled';
// STEP 1 : fetch data from api
export async function getStaticProps() {
const res = await fetch(
'https://proton.api.atomicassets.io/atomicmarket/v1/sales'
);
const data = await res.json();
return {
props: {
data,
},
};
}
function UserTransactionsComponent({ data }) {
const results = data;
console.log(results);
return (
<PageLayout>
<div>
<h1>This is a list of User Transactions!</h1>
</div>
<ul>
{results.data.map((result) => {
const {
sale_id,
buyer,
seller,
listing_price,
listing_symbol,
created_at_time,
} = result;
if (buyer !== null) {
return (
<Card>
<li key={sale_id}>
<h3>
{seller} just sold item number {sale_id} to {buyer} for{' '}
{formatNumber(listing_price)} {listing_symbol} at{' '}
{parseTimestampJM(created_at_time)}
</h3>
</li>
</Card>
);
}
})}
</ul>
</PageLayout>
);
}
export default UserTransactionsComponent;
When I create a component and then call it in to my index page like so:
<PageLayout>
<Banner modalType={MODAL_TYPES.CLAIM} />
<ExploreCard />
<HomepageStatistics />
<Title>New & Noteworthy</Title>
<UserTransactionsComponent />
<Grid items={featuredTemplates} />
</PageLayout>
);
};
export default MarketPlace;
it gives me the following error
TypeError: Cannot read properties of undefined (reading 'data')
27 | <ul>
> 28 | {results.data.map((result) => {
| ^
29 | const {
30 | sale_id,
31 | buyer,
I think that the reason I'm getting this error is because of the way the data is being fetched. Perhaps it's not being included in the component.
ANSWER
Answered 2022-Mar-02 at 08:27getStaticProps
works only for pages inside pages
folder. The data is fetched at build time. If you wanna use UserTransactionsComponent
as a normal component, you should use useEffect
and make the api call on mount.
Here is what the Next.js's documentation says:
If you export a function called getStaticProps (Static Site Generation) from a page, Next.js will pre-render this page at build time using the props returned by getStaticProps.
Here is UserTransactionsComponent
as a normal component:
import {useState, useEffect} from "react"
function UserTransactionsComponent() {
const [data, setData]=useState();
useEffect(()=>{
async function fetchData() {
const res = await fetch(
'https://proton.api.atomicassets.io/atomicmarket/v1/sales'
);
const {data} = await res.json();
setData(data)
}
fetchData()
},[]);
if(!data){
return (<div>Loading...</div>)
}
return (
<PageLayout>
<div>
<h1>This is a list of User Transactions!</h1>
</div>
<ul>
{data.map((result) => {
const {
sale_id,
buyer,
seller,
listing_price,
listing_symbol,
created_at_time,
} = result;
if (buyer !== null) {
return (
<Card>
<li key={sale_id}>
<h3>
{seller} just sold item number {sale_id} to {buyer} for{' '}
{formatNumber(listing_price)} {listing_symbol} at{' '}
{parseTimestampJM(created_at_time)}
</h3>
</li>
</Card>
);
}
})}
</ul>
</PageLayout>
);
}
export default UserTransactionsComponent;
QUESTION
Trying to console.log data within useEffect. Not logging any information
Asked 2022-Mar-03 at 01:31function UserAccounts() {
const [accounts, setAccounts] = useState();
useEffect(() => {
async function fetchAccounts() {
const res = await fetch(
'https://proton.api.atomicassets.io/atomicassets/v1/accounts'
);
const { accounts } = await res.json();
setAccounts(accounts);
console.log(accounts);
}
fetchAccounts();
}, []);
}
I'm trying to understand why console.log shows nothing in this example and what is the correct way to console.log the data that is being fetched from the api.
ANSWER
Answered 2022-Mar-03 at 01:14Well, you need to get the structure of the returned payload from the API correct. It does not have an accounts
property.
The payload looks like this:
{
"success":true,
"data":[{"account":"joejerde","assets":"11933"},{"account":"protonpunks","assets":"9072"}],
"queryTime": 1646267075822
}
So you can rename the data
property while destructuring. const { data: accountList } = await res.json();
function UserAccounts() {
const [accounts, setAccounts] = useState();
useEffect(() => {
async function fetchAccounts() {
const res = await fetch(
'https://proton.api.atomicassets.io/atomicassets/v1/accounts'
);
const { data: accountList } = await res.json();
setAccounts(accountList);
// logging both the state and the fetched value
console.log(accounts, accountList);
// accounts (state) will be undefined
// if the fetch was successful, accountList will be an array of accounts (as per the API payload)
}
fetchAccounts()
}, [])
return <div>
{JSON.stringify(accounts)}
</div>
}
Edit: using some other variable name while destructuring, confusing to use the same variable name as the state (accounts
).
Working codesandbox
QUESTION
java.lang.NoSuchMethodError: 'com.microsoft.aad.msal4j.SilentParameters$SilentParametersBuilder using azure sdk for java service bus
Asked 2022-Mar-02 at 15:16Im trying to send messages to my azure service bus topic using managed identity. None of the messages are sent to the topic. I have no problem when using connectionString instead of credential.
ServiceBusSenderClient
String namespace = getNamespace();
TokenCredential credential = new DefaultAzureCredentialBuilder()
.build();
ServiceBusSenderClient senderClient = new ServiceBusClientBuilder()
.credential(namespace, credential)
.sender()
.topicName(topicName)
.buildClient();
senderClient.sendMessage(new ServiceBusMessage("TESTTEST"));
2022-02-28 10:52:11.671 INFO 14901 --- [ scheduling-1] c.azure.identity.EnvironmentCredential : Azure Identity => EnvironmentCredential invoking ClientSecretCredential
2022-02-28 10:52:11.685 INFO 14901 --- [ scheduling-1] c.a.c.i.jackson.JacksonVersion : Package versions: jackson-annotations=2.11.3, jackson-core=2.11.3, jackson-databind=2.11.3, jackson-dataformat-xml=2.11.3, jackson-datatype-jsr310=2.11.3, azure-core=1.23.1, Troubleshooting version conflicts: https://aka.ms/azsdk/java/dependency/troubleshoot
2022-02-28 10:52:11.749 INFO 14901 --- [ scheduling-1] c.a.m.s.i.ServiceBusConnectionProcessor : namespace[https://xxxx-xxxx-xxx-xxx-xx.servicebus.windows.net/] entityPath[N/A]: Setting next AMQP channel.
2022-02-28 10:52:11.749 INFO 14901 --- [ scheduling-1] c.a.m.s.i.ServiceBusConnectionProcessor : namespace[https://xxxx-xxxx-xxx-xxx-xx.servicebus.windows.net/] entityPath[N/A]: Next AMQP channel received, updating 0 current subscribers
2022-02-28 10:52:11.751 INFO 14901 --- [ scheduling-1] c.a.m.s.ServiceBusClientBuilder : # of open clients with shared connection: 1
2022-02-28 10:52:11.770 INFO 14901 --- [ scheduling-1] c.a.c.a.i.ReactorConnection : connectionId[MF_6e344f_1646041931731]: Creating and starting connection to https://xxxx-xxxx-xxx-xxx-xx.servicebus.windows.net/:5671
2022-02-28 10:52:11.783 INFO 14901 --- [ scheduling-1] c.a.c.a.implementation.ReactorExecutor : connectionId[MF_6e344f_1646041931731] message[Starting reactor.]
2022-02-28 10:52:11.786 INFO 14901 --- [ctor-executor-1] c.a.c.a.i.handler.ConnectionHandler : onConnectionInit connectionId[MF_6e344f_1646041931731] hostname[https://xxxx-xxxx-xxx-xxx-xx.servicebus.windows.net/] amqpHostname[https://xxxx-xxxx-xxx-xxx-xx.servicebus.windows.net/]
2022-02-28 10:52:11.786 INFO 14901 --- [ctor-executor-1] c.a.c.a.i.handler.ReactorHandler : connectionId[MF_6e344f_1646041931731] reactor.onReactorInit
2022-02-28 10:52:11.786 INFO 14901 --- [ctor-executor-1] c.a.c.a.i.handler.ConnectionHandler : onConnectionLocalOpen connectionId[MF_6e344f_1646041931731] hostname[https://xxxx-xxxx-xxx-xxx-xx.servicebus.windows.net/] errorCondition[null] errorDescription[null]
2022-02-28 10:52:11.828 INFO 14901 --- [ctor-executor-1] c.a.c.a.i.handler.ConnectionHandler : onConnectionBound connectionId[MF_6e344f_1646041931731] hostname[https://xxxx-xxxx-xxx-xxx-xx.servicebus.windows.net/] peerDetails[https://xxxx-xxxx-xxx-xxx-xx.servicebus.windows.net/:5671]
2022-02-28 10:52:12.021 INFO 14901 --- [ctor-executor-1] c.a.c.a.i.handler.StrictTlsContextSpi : SSLv2Hello was an enabled protocol. Filtering out.
2022-02-28 10:52:12.136 WARN 14901 --- [ctor-executor-1] c.a.c.a.i.handler.ConnectionHandler : onTransportError hostname[https://xxxx-xxxx-xxx-xxx-xx.servicebus.windows.net/], connectionId[MF_6e344f_1646041931731], error[Connection reset by peer]
2022-02-28 10:52:12.139 INFO 14901 --- [ctor-executor-1] c.a.c.a.i.ReactorConnection : connectionId[MF_6e344f_1646041931731] signal[Connection reset by peer, errorContext[NAMESPACE: https://xxxx-xxxx-xxx-xxx-xx.servicebus.windows.net/. ERROR CONTEXT: N/A], isTransient[false], initiatedByClient[false]]: Disposing of ReactorConnection.
2022-02-28 10:52:12.151 INFO 14901 --- [ctor-executor-1] c.a.c.a.i.handler.ConnectionHandler : onConnectionUnbound hostname[https://xxxx-xxxx-xxx-xxx-xx.servicebus.windows.net/], connectionId[MF_6e344f_1646041931731], state[ACTIVE], remoteState[UNINITIALIZED]
2022-02-28 10:52:12.157 INFO 14901 --- [ctor-executor-1] c.a.c.a.i.ReactorConnection : connectionId[MF_6e344f_1646041931731] Closing executor.
2022-02-28 10:52:12.159 INFO 14901 --- [ctor-executor-1] c.a.c.a.i.handler.ConnectionHandler : onConnectionLocalClose connectionId[MF_6e344f_1646041931731] hostname[https://xxxx-xxxx-xxx-xxx-xx.servicebus.windows.net/] errorCondition[null] errorDescription[null]
2022-02-28 10:52:16.167 INFO 14901 --- [ctor-executor-1] c.a.c.a.implementation.ReactorExecutor : connectionId[MF_6e344f_1646041931731] message[Processing all pending tasks and closing old reactor.]
2022-02-28 10:52:16.169 INFO 14901 --- [ctor-executor-1] c.a.c.a.i.ReactorDispatcher : connectionId[MF_6e344f_1646041931731] Reactor selectable is being disposed.
2022-02-28 10:52:16.170 INFO 14901 --- [ctor-executor-1] c.a.c.a.i.ReactorConnection : onConnectionShutdown connectionId[MF_6e344f_1646041931731], hostName[https://xxxx-xxxx-xxx-xxx-xx.servicebus.windows.net/], message[Shutting down], shutdown signal[false]
2022-02-28 10:52:16.187 ERROR 14901 --- [ctor-executor-1] reactor.core.publisher.Operators : Operator called default onErrorDropped
reactor.core.Exceptions$ErrorCallbackNotImplemented: com.azure.core.amqp.exception.AmqpException: Connection reset by peer, errorContext[NAMESPACE: https://xxxx-xxxx-xxx-xxx-xx.servicebus.windows.net/. ERROR CONTEXT: N/A]
Caused by: com.azure.core.amqp.exception.AmqpException: Connection reset by peer, errorContext[NAMESPACE: https://xxxx-xxxx-xxx-xxx-xx.servicebus.windows.net/. ERROR CONTEXT: N/A]
at com.azure.core.amqp.implementation.ExceptionUtil.toException(ExceptionUtil.java:85) ~[azure-core-amqp-2.3.7.jar:2.3.7]
at com.azure.core.amqp.implementation.handler.ConnectionHandler.notifyErrorContext(ConnectionHandler.java:325) ~[azure-core-amqp-2.3.7.jar:2.3.7]
at com.azure.core.amqp.implementation.handler.ConnectionHandler.onTransportError(ConnectionHandler.java:228) ~[azure-core-amqp-2.3.7.jar:2.3.7]
at org.apache.qpid.proton.engine.BaseHandler.handle(BaseHandler.java:191) ~[proton-j-0.33.8.jar:na]
at org.apache.qpid.proton.engine.impl.EventImpl.dispatch(EventImpl.java:108) ~[proton-j-0.33.8.jar:na]
at org.apache.qpid.proton.reactor.impl.ReactorImpl.dispatch(ReactorImpl.java:324) ~[proton-j-0.33.8.jar:na]
at org.apache.qpid.proton.reactor.impl.ReactorImpl.process(ReactorImpl.java:291) ~[proton-j-0.33.8.jar:na]
at com.azure.core.amqp.implementation.ReactorExecutor.run(ReactorExecutor.java:92) ~[azure-core-amqp-2.3.7.jar:2.3.7]
at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:68) ~[reactor-core-3.4.1.jar:3.4.1]
at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:28) ~[reactor-core-3.4.1.jar:3.4.1]
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[na:na]
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na]
at java.base/java.lang.Thread.run(Thread.java:829) ~[na:na]
EDIT: After changing the namespace from https://xxxx-xxxx-xxx-xxx-xx.servicebus.windows.net/ to xxxx-xxxx-xxx-xxx-xx.servicebus.windows.net, I got a little further.
2022-02-28 16:08:14.362 INFO 18303 --- [ scheduling-1] c.a.c.i.jackson.JacksonVersion : Package versions: jackson-annotations=2.11.3, jackson-core=2.11.3, jackson-databind=2.11.3, jackson-dataformat-xml=2.11.3, jackson-datatype-jsr310=2.11.3, azure-core=1.23.1, Troubleshooting version conflicts: https://aka.ms/azsdk/java/dependency/troubleshoot
2022-02-28 16:08:14.423 INFO 18303 --- [ scheduling-1] c.a.m.s.i.ServiceBusConnectionProcessor : namespace[xxxx-xxxx-xxx-xxx-xx.servicebus.windows.net] entityPath[N/A]: Setting next AMQP channel.
2022-02-28 16:08:14.423 INFO 18303 --- [ scheduling-1] c.a.m.s.i.ServiceBusConnectionProcessor : namespace[xxxx-xxxx-xxx-xxx-xx.servicebus.windows.net] entityPath[N/A]: Next AMQP channel received, updating 0 current subscribers
2022-02-28 16:08:14.424 INFO 18303 --- [ scheduling-1] c.a.m.s.ServiceBusClientBuilder : # of open clients with shared connection: 1
2022-02-28 16:08:14.442 INFO 18303 --- [ scheduling-1] c.a.c.a.i.ReactorConnection : connectionId[MF_2bb2ea_1646060894406]: Creating and starting connection to xxxx-xxxx-xxx-xxx-xx.servicebus.windows.net:5671
2022-02-28 16:08:14.454 INFO 18303 --- [ scheduling-1] c.a.c.a.implementation.ReactorExecutor : connectionId[MF_2bb2ea_1646060894406] message[Starting reactor.]
2022-02-28 16:08:14.456 INFO 18303 --- [ctor-executor-1] c.a.c.a.i.handler.ConnectionHandler : onConnectionInit connectionId[MF_2bb2ea_1646060894406] hostname[xxxx-xxxx-xxx-xxx-xx.servicebus.windows.net] amqpHostname[xxxx-xxxx-xxx-xxx-xx.servicebus.windows.net]
2022-02-28 16:08:14.456 INFO 18303 --- [ctor-executor-1] c.a.c.a.i.handler.ReactorHandler : connectionId[MF_2bb2ea_1646060894406] reactor.onReactorInit
2022-02-28 16:08:14.456 INFO 18303 --- [ctor-executor-1] c.a.c.a.i.handler.ConnectionHandler : onConnectionLocalOpen connectionId[MF_2bb2ea_1646060894406] hostname[xxxx-xxxx-xxx-xxx-xx.servicebus.windows.net] errorCondition[null] errorDescription[null]
2022-02-28 16:08:14.496 INFO 18303 --- [ctor-executor-1] c.a.c.a.i.handler.ConnectionHandler : onConnectionBound connectionId[MF_2bb2ea_1646060894406] hostname[xxxx-xxxx-xxx-xxx-xx.servicebus.windows.net] peerDetails[xxxx-xxxx-xxx-xxx-xx.servicebus.windows.net:5671]
2022-02-28 16:08:14.656 INFO 18303 --- [ctor-executor-1] c.a.c.a.i.handler.StrictTlsContextSpi : SSLv2Hello was an enabled protocol. Filtering out.
2022-02-28 16:08:14.979 INFO 18303 --- [ctor-executor-1] c.a.c.a.i.handler.ConnectionHandler : onConnectionRemoteOpen hostname[xxxx-xxxx-xxx-xxx-xx.servicebus.windows.net], connectionId[MF_2bb2ea_1646060894406], remoteContainer[4faee4fd82174e4e8afdc32b31b04f28_G10]
2022-02-28 16:08:14.980 INFO 18303 --- [ctor-executor-1] c.a.m.s.i.ServiceBusConnectionProcessor : namespace[xxxx-xxxx-xxx-xxx-xx.servicebus.windows.net] entityPath[N/A]: Channel is now active.
2022-02-28 16:08:15.056 INFO 18303 --- [ctor-executor-1] c.a.c.a.i.handler.SessionHandler : onSessionRemoteOpen connectionId[MF_2bb2ea_1646060894406], entityName[mdm-asset-topic], sessionIncCapacity[0], sessionOutgoingWindow[2147483647]
2022-02-28 16:08:15.071 INFO 18303 --- [ctor-executor-1] c.a.c.a.i.ReactorConnection : Setting CBS channel.
2022-02-28 16:08:15.127 INFO 18303 --- [ctor-executor-1] c.a.c.a.i.handler.SessionHandler : onSessionRemoteOpen connectionId[MF_2bb2ea_1646060894406], entityName[cbs-session], sessionIncCapacity[0], sessionOutgoingWindow[2147483647]
2022-02-28 16:08:15.136 INFO 18303 --- [ctor-executor-1] c.a.c.a.i.ReactorConnection : connectionId[MF_2bb2ea_1646060894406] entityPath[$cbs] linkName[cbs] Emitting new response channel.
2022-02-28 16:08:15.137 INFO 18303 --- [ctor-executor-1] c.a.c.a.i.RequestResponseChannel:$cbs : namespace[MF_2bb2ea_1646060894406] entityPath[$cbs]: Setting next AMQP channel.
2022-02-28 16:08:15.137 INFO 18303 --- [ctor-executor-1] c.a.c.a.i.RequestResponseChannel:$cbs : namespace[MF_2bb2ea_1646060894406] entityPath[$cbs]: Next AMQP channel received, updating 1 current subscribers
2022-02-28 16:08:15.196 ERROR 18303 --- [ctor-executor-1] reactor.core.scheduler.Schedulers : Scheduler worker in group main failed with an uncaught exception
java.lang.NoSuchMethodError: 'com.microsoft.aad.msal4j.SilentParameters$SilentParametersBuilder com.microsoft.aad.msal4j.SilentParameters$SilentParametersBuilder.tenant(java.lang.String)'
at com.azure.identity.implementation.IdentityClient.lambda$authenticateWithConfidentialClientCache$29(IdentityClient.java:771) ~[azure-identity-1.4.4.jar:1.4.4]
at reactor.core.publisher.Mono.lambda$fromFuture$2(Mono.java:649) ~[reactor-core-3.4.1.jar:3.4.1]
at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:44) ~[reactor-core-3.4.1.jar:3.4.1]
at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:64) ~[reactor-core-3.4.1.jar:3.4.1]
at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:157) ~[reactor-core-3.4.1.jar:3.4.1]
at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1784) ~[reactor-core-3.4.1.jar:3.4.1]
at reactor.core.publisher.MonoCacheTime$CoordinatorSubscriber.signalCached(MonoCacheTime.java:328) ~[reactor-core-3.4.1.jar:3.4.1]
at reactor.core.publisher.MonoCacheTime$CoordinatorSubscriber.onNext(MonoCacheTime.java:345) ~[reactor-core-3.4.1.jar:3.4.1]
at reactor.core.publisher.Operators$ScalarSubscription.request(Operators.java:2346) ~[reactor-core-3.4.1.jar:3.4.1]
at reactor.core.publisher.MonoCacheTime$CoordinatorSubscriber.onSubscribe(MonoCacheTime.java:284) ~[reactor-core-3.4.1.jar:3.4.1]
at reactor.core.publisher.MonoJust.subscribe(MonoJust.java:54) ~[reactor-core-3.4.1.jar:3.4.1]
at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:52) ~[reactor-core-3.4.1.jar:3.4.1]
at reactor.core.publisher.MonoCacheTime.subscribeOrReturn(MonoCacheTime.java:134) ~[reactor-core-3.4.1.jar:3.4.1]
at reactor.core.publisher.Mono.subscribe(Mono.java:4031) ~[reactor-core-3.4.1.jar:3.4.1]
at reactor.core.publisher.FluxFlatMap$FlatMapMain.onNext(FluxFlatMap.java:425) ~[reactor-core-3.4.1.jar:3.4.1]
at reactor.core.publisher.FluxIterable$IterableSubscription.slowPath(FluxIterable.java:270) ~[reactor-core-3.4.1.jar:3.4.1]
at reactor.core.publisher.FluxIterable$IterableSubscription.request(FluxIterable.java:228) ~[reactor-core-3.4.1.jar:3.4.1]
at reactor.core.publisher.FluxFlatMap$FlatMapMain.onSubscribe(FluxFlatMap.java:370) ~[reactor-core-3.4.1.jar:3.4.1]
at reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:164) ~[reactor-core-3.4.1.jar:3.4.1]
at reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:86) ~[reactor-core-3.4.1.jar:3.4.1]
at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:64) ~[reactor-core-3.4.1.jar:3.4.1]
at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:157) ~[reactor-core-3.4.1.jar:3.4.1]
at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1784) ~[reactor-core-3.4.1.jar:3.4.1]
at com.azure.core.amqp.implementation.AmqpChannelProcessor$ChannelSubscriber.onNext(AmqpChannelProcessor.java:389) ~[azure-core-amqp-2.3.7.jar:2.3.7]
at com.azure.core.amqp.implementation.AmqpChannelProcessor.lambda$onNext$0(AmqpChannelProcessor.java:96) ~[azure-core-amqp-2.3.7.jar:2.3.7]
at java.base/java.util.concurrent.ConcurrentLinkedDeque.forEach(ConcurrentLinkedDeque.java:1650) ~[na:na]
at com.azure.core.amqp.implementation.AmqpChannelProcessor.onNext(AmqpChannelProcessor.java:96) ~[azure-core-amqp-2.3.7.jar:2.3.7]
at reactor.core.publisher.FluxRepeatPredicate$RepeatPredicateSubscriber.onNext(FluxRepeatPredicate.java:85) ~[reactor-core-3.4.1.jar:3.4.1]
at reactor.core.publisher.FluxPeekFuseable$PeekFuseableSubscriber.onNext(FluxPeekFuseable.java:210) ~[reactor-core-3.4.1.jar:3.4.1]
at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onNext(FluxMapFuseable.java:127) ~[reactor-core-3.4.1.jar:3.4.1]
at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onNext(FluxMapFuseable.java:127) ~[reactor-core-3.4.1.jar:3.4.1]
at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1784) ~[reactor-core-3.4.1.jar:3.4.1]
at reactor.core.publisher.MonoFlatMap$FlatMapInner.onNext(MonoFlatMap.java:249) ~[reactor-core-3.4.1.jar:3.4.1]
at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1784) ~[reactor-core-3.4.1.jar:3.4.1]
at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.drain(MonoIgnoreThen.java:148) ~[reactor-core-3.4.1.jar:3.4.1]
at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.ignoreDone(MonoIgnoreThen.java:191) ~[reactor-core-3.4.1.jar:3.4.1]
at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreInner.onComplete(MonoIgnoreThen.java:248) ~[reactor-core-3.4.1.jar:3.4.1]
at reactor.core.publisher.SerializedSubscriber.onComplete(SerializedSubscriber.java:146) ~[reactor-core-3.4.1.jar:3.4.1]
at reactor.core.publisher.SerializedSubscriber.onComplete(SerializedSubscriber.java:146) ~[reactor-core-3.4.1.jar:3.4.1]
at reactor.core.publisher.FluxTimeout$TimeoutMainSubscriber.onComplete(FluxTimeout.java:233) ~[reactor-core-3.4.1.jar:3.4.1]
at reactor.core.publisher.MonoNext$NextSubscriber.onComplete(MonoNext.java:102) ~[reactor-core-3.4.1.jar:3.4.1]
at reactor.core.publisher.MonoNext$NextSubscriber.onNext(MonoNext.java:83) ~[reactor-core-3.4.1.jar:3.4.1]
at reactor.core.publisher.FluxFilterFuseable$FilterFuseableSubscriber.onNext(FluxFilterFuseable.java:118) ~[reactor-core-3.4.1.jar:3.4.1]
at reactor.core.publisher.FluxReplay$SizeBoundReplayBuffer.replayNormal(FluxReplay.java:814) ~[reactor-core-3.4.1.jar:3.4.1]
at reactor.core.publisher.FluxReplay$SizeBoundReplayBuffer.replay(FluxReplay.java:898) ~[reactor-core-3.4.1.jar:3.4.1]
at reactor.core.publisher.FluxReplay$ReplaySubscriber.onNext(FluxReplay.java:1246) ~[reactor-core-3.4.1.jar:3.4.1]
at reactor.core.publisher.FluxPeek$PeekSubscriber.onNext(FluxPeek.java:199) ~[reactor-core-3.4.1.jar:3.4.1]
at reactor.core.publisher.FluxPeek$PeekSubscriber.onNext(FluxPeek.java:199) ~[reactor-core-3.4.1.jar:3.4.1]
at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:120) ~[reactor-core-3.4.1.jar:3.4.1]
at reactor.core.publisher.FluxDistinctUntilChanged$DistinctUntilChangedSubscriber.tryOnNext(FluxDistinctUntilChanged.java:148) ~[reactor-core-3.4.1.jar:3.4.1]
at reactor.core.publisher.FluxDistinctUntilChanged$DistinctUntilChangedSubscriber.onNext(FluxDistinctUntilChanged.java:101) ~[reactor-core-3.4.1.jar:3.4.1]
at reactor.core.publisher.FluxReplay$SizeBoundReplayBuffer.replayNormal(FluxReplay.java:814) ~[reactor-core-3.4.1.jar:3.4.1]
at reactor.core.publisher.FluxReplay$SizeBoundReplayBuffer.replay(FluxReplay.java:898) ~[reactor-core-3.4.1.jar:3.4.1]
at reactor.core.publisher.ReplayProcessor.tryEmitNext(ReplayProcessor.java:508) ~[reactor-core-3.4.1.jar:3.4.1]
at reactor.core.publisher.SinkManySerialized.tryEmitNext(SinkManySerialized.java:97) ~[reactor-core-3.4.1.jar:3.4.1]
at reactor.core.publisher.InternalManySink.emitNext(InternalManySink.java:27) ~[reactor-core-3.4.1.jar:3.4.1]
at com.azure.core.amqp.implementation.handler.Handler.onNext(Handler.java:87) ~[azure-core-amqp-2.3.7.jar:2.3.7]
at com.azure.core.amqp.implementation.handler.SessionHandler.onSessionRemoteOpen(SessionHandler.java:84) ~[azure-core-amqp-2.3.7.jar:2.3.7]
at org.apache.qpid.proton.engine.BaseHandler.handle(BaseHandler.java:146) ~[proton-j-0.33.8.jar:na]
at org.apache.qpid.proton.engine.impl.EventImpl.dispatch(EventImpl.java:108) ~[proton-j-0.33.8.jar:na]
at org.apache.qpid.proton.reactor.impl.ReactorImpl.dispatch(ReactorImpl.java:324) ~[proton-j-0.33.8.jar:na]
at org.apache.qpid.proton.reactor.impl.ReactorImpl.process(ReactorImpl.java:291) ~[proton-j-0.33.8.jar:na]
at com.azure.core.amqp.implementation.ReactorExecutor.run(ReactorExecutor.java:92) ~[azure-core-amqp-2.3.7.jar:2.3.7]
at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:68) ~[reactor-core-3.4.1.jar:3.4.1]
at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:28) ~[reactor-core-3.4.1.jar:3.4.1]
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[na:na]
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na]
at java.base/java.lang.Thread.run(Thread.java:829) ~[na:na]
2022-02-28 16:08:19.199 INFO 18303 --- [ctor-executor-1] c.a.c.a.implementation.ReactorExecutor : connectionId[MF_2bb2ea_1646060894406] message[Processing all pending tasks and closing old reactor.]
2022-02-28 16:08:19.200 INFO 18303 --- [ctor-executor-1] c.a.c.a.i.handler.SessionHandler : onSessionRemoteOpen connectionId[MF_2bb2ea_1646060894406], entityName[cbs-session], sessionIncCapacity[0], sessionOutgoingWindow[2147483647]
2022-02-28 16:08:19.201 INFO 18303 --- [ctor-executor-1] c.a.c.a.i.ReactorDispatcher : connectionId[MF_2bb2ea_1646060894406] Reactor selectable is being disposed.
2022-02-28 16:08:19.201 INFO 18303 --- [ctor-executor-1] c.a.c.a.i.ReactorConnection : onConnectionShutdown connectionId[MF_2bb2ea_1646060894406], hostName[xxxx-xxxx-xxx-xxx-xx.servicebus.windows.net], message[Shutting down], shutdown signal[false]
2022-02-28 16:08:19.201 INFO 18303 --- [ctor-executor-1] c.a.c.a.i.ReactorConnection : connectionId[MF_2bb2ea_1646060894406] signal[connectionId[MF_2bb2ea_1646060894406] Reactor selectable is disposed., isTransient[false], initiatedByClient[false]]: Disposing of ReactorConnection.
2022-02-28 16:08:19.201 INFO 18303 --- [ctor-executor-1] c.a.m.s.i.ServiceBusConnectionProcessor : namespace[xxxx-xxxx-xxx-xxx-xx.servicebus.windows.net] entityPath[N/A]: Channel is closed. Requesting upstream.
2022-02-28 16:08:19.202 INFO 18303 --- [ctor-executor-1] c.a.m.s.i.ServiceBusConnectionProcessor : namespace[xxxx-xxxx-xxx-xxx-xx.servicebus.windows.net] entityPath[N/A]: Connection not requested, yet. Requesting one.
2022-02-28 16:08:19.202 INFO 18303 --- [ctor-executor-1] c.a.m.s.i.ServiceBusConnectionProcessor : namespace[xxxx-xxxx-xxx-xxx-xx.servicebus.windows.net] entityPath[N/A]: Setting next AMQP channel.
2022-02-28 16:08:19.202 INFO 18303 --- [ctor-executor-1] c.a.m.s.i.ServiceBusConnectionProcessor : namespace[xxxx-xxxx-xxx-xxx-xx.servicebus.windows.net] entityPath[N/A]: Next AMQP channel received, updating 0 current subscribers
2022-02-28 16:08:19.225 INFO 18303 --- [ctor-executor-1] c.a.c.a.i.ReactorConnection : onConnectionShutdown connectionId[MF_2bb2ea_1646060894406], hostName[xxxx-xxxx-xxx-xxx-xx.servicebus.windows.net], message[Shutting down], shutdown signal[true]
2022-02-28 16:08:19.227 INFO 18303 --- [ctor-executor-1] c.a.c.a.i.ReactorConnection : onConnectionShutdown connectionId[MF_2bb2ea_1646060894406], hostName[xxxx-xxxx-xxx-xxx-xx.servicebus.windows.net], message[Shutting down], shutdown signal[false]
2022-02-28 16:09:19.224 INFO 18303 --- [ parallel-1] c.a.c.a.i.RequestResponseChannel : connectionId[MF_2bb2ea_1646060894406] linkName[cbs] Timed out waiting for RequestResponseChannel to complete closing. Manually closing.
2022-02-28 16:09:19.227 WARN 18303 --- [ parallel-1] c.a.c.a.i.ReactorDispatcher : ReactorDispatcher instance is closed. Should not continue dispatching work to this reactor.
2022-02-28 16:09:19.227 INFO 18303 --- [ parallel-1] c.a.c.a.i.ReactorConnection : connectionId[MF_2bb2ea_1646060894406] Could not schedule closeConnection work. Manually disposing.
2022-02-28 16:09:19.229 INFO 18303 --- [ parallel-1] c.a.c.a.i.ReactorConnection : connectionId[MF_2bb2ea_1646060894406] Closing executor.
RESOLVED Solved the problem by changing azure-identity package from 1.4.4 to 1.3.7
ANSWER
Answered 2022-Mar-02 at 08:39Please check the below steps if they help to workaround -
java.lang.NoSuchMethodError
majorly occurs due to version conflicts of dependencies.NoSuchMethodError
error happens if class A expects a method in class B which was compiled but at run time the other classes does not have that method. Here the method can be a third party jar
library or normal method in the classes.JDK
itself, but your runtime is having other versions
and it might be the case of one of the modules where you have added a method, forgot to compile, so at runtime it is using the old version.QUESTION
Kafka-connect to PostgreSQL - org.apache.kafka.connect.errors.DataException: Failed to deserialize topic to to Avro
Asked 2022-Feb-11 at 14:44I've installed latest (7.0.1) version of Confluent platform in standalone mode on Ubuntu virtual machine.
Python producer for Avro formatUsing this sample Avro producer to generate stream from data to Kafka topic (pmu214).
Producer seems to work ok. I'll give full code on request. Producer output:
Raw data: {"pmu_id": 2, "time": 1644577001.22, "measurements": [{"stream_id": 2, "stat": "ok", "phasors": [[27.22379, 0.0], [24.672079638784002, -2.075237618663568], [25.11940552135938, 2.10660756475536], [3248.794237867336, -0.06468446412011757], [3068.6629010042793, -2.152472189017548], [2990.0809353594427, 2.031751749658583], [0.0, 0.0], [3101.9477751890026, -0.06193618455080409]], "analog": [], "digital": [0], "frequency": 50.022, "rocof": 0}]}
PMU record b'e5c1e5a8-3e44-465d-98c4-93f896ec1b14' successfully produced to pmu214 [0] at offset 38256
In ksqld
it seems that record reached ksqldb
ok:
rowtime: 2022/02/11 09:48:05.431 Z, key: [26151234-d3dd-4b7c-9222-2867@3486128305426751843/-], value: \x00\x00\x00\x00\x01\x04\xAA\xC3\xB1\xA0\x0C\x04\x04ok\xC2p\xD9A\x0F`\x
9F>.b\xC6A\xB9\xC8\xE2\xBF\xC5%\xC8A\x13v\x1A@\x8FVKE\xF9\xF8u>\xC5\xC5?E\xEA\xBA\xEC\xBF\xE0\xFA:E\xD5~\x15@\x00\x00\x00\x00\x00\x00\x00\x00\x84\x07BEs\xD1w>\x04[]\x020b\x0
2, partition: 0
Index 0 out of bounds for length 0
Topic printing ceased
Here is command used to connect to PostgreSQL:
bin/connect-standalone etc/kafka/connect-standalone.properties etc/schema-registry/connect-avro-standalone.properties
Here is content of connect-avro-standalone.properties
:
bootstrap.servers=localhost:9092
name=sinkIRIpostgre
connector.class=io.confluent.connect.jdbc.JdbcSinkConnector
connection.url=jdbc:postgresql://localhost:5432/mydb
topics=pmu214
connection.user=mydbuser
connection.password=mypass
auto.create=true
auto.evolve=true
insert.mode=insert
pk.mode=record_key
pk.fields=MESSAGE_KEY
key.converter=io.confluent.connect.avro.AvroConverter
key.converter.schema.registry.url=http://localhost:8081
value.converter=io.confluent.connect.avro.AvroConverter
value.converter.schema.registry.url=http://localhost:8081
internal.key.converter=org.apache.kafka.connect.json.JsonConverter
internal.value.converter=org.apache.kafka.connect.json.JsonConverter
internal.key.converter.schemas.enable=false
internal.value.converter.schemas.enable=false
offset.storage.file.filename=/tmp/connect.offsets
I didn't change anything in connect-standalone.properties
except plugins I've installed.
plugin.path=/home/proton/kafkaConnectors/confluentinc-kafka-connect-jdbc-10.3.2,/home/proton/kafkaConverters/confluentinc-kafka-connect-json-schema-converter-7.0.1,/home/proton/kafkaConverters/confluentinc-kafka-connect-avro-converter-7.0.1/
ERROR [sinkIRIpostgre|task-0] WorkerSinkTask{id=sinkIRIpostgre-0} Error converting message key in topic 'pmu214' partition 0 at offset 0 and timestamp 1644560570372: Failed to deserialize data for topic pmu214 to Avro: (org.apache.kafka.connect.runtime.WorkerSinkTask:552) org.apache.kafka.connect.errors.DataException: Failed to deserialize data for topic pmu214 to Avro: at io.confluent.connect.avro.AvroConverter.toConnectData(AvroConverter.java:124) at org.apache.kafka.connect.storage.Converter.toConnectData(Converter.java:87) at org.apache.kafka.connect.runtime.WorkerSinkTask.convertKey(WorkerSinkTask.java:550) at org.apache.kafka.connect.runtime.WorkerSinkTask.lambda$convertAndTransformRecord$3(WorkerSinkTask.java:513) at org.apache.kafka.connect.runtime.errors.RetryWithToleranceOperator.execAndRetry(RetryWithToleranceOperator.java:156) at org.apache.kafka.connect.runtime.errors.RetryWithToleranceOperator.execAndHandleError(RetryWithToleranceOperator.java:190) at org.apache.kafka.connect.runtime.errors.RetryWithToleranceOperator.execute(RetryWithToleranceOperator.java:132) at org.apache.kafka.connect.runtime.WorkerSinkTask.convertAndTransformRecord(WorkerSinkTask.java:513) at org.apache.kafka.connect.runtime.WorkerSinkTask.convertMessages(WorkerSinkTask.java:493) at org.apache.kafka.connect.runtime.WorkerSinkTask.poll(WorkerSinkTask.java:332)
ANSWER
Answered 2022-Feb-11 at 14:42If you literally ran the Python sample code, then the key is not Avro, so a failure on the key.converter
would be expected, as shown
Error converting message key
QUESTION
Python redirect the path by detection of ../ from anothers path
Asked 2022-Jan-20 at 06:28I have a path in variable A
A=r'\\omega3t.cr.in.com\shop\recipe\fad\prod\CPL\Wite\Proton\Coach_Color_Dress.xml
I have anothers path B
B="..\..\Type\Car\Proton.xml"
By using python I would like to print entire path for path B which redrive from Path A Expected output for C is:
C=r'\\omega3t.cr.in.com\shop\recipe\fad\prod\CPL\Type\Car\Proton.xml'
Anyone have ideas?
ANSWER
Answered 2022-Jan-20 at 06:28You could use the powerful pathlib
module:
from pathlib import Path
a = A.replace('\\', '/')
b = B.replace('\\', '/')
c = Path(a) / Path(b)
print(c.resolve())
gives /omega3t.cr.in.com/shop/recipe/fad/prod/CPL/Wite/Type/Car/Proton.xml
You should check if that's really what you want. It's strange to use ..
on a file path, usually that is used on a directory path.
If you really need backslashes you can still replace them:
str(c.resolve()).replace('/', '\\')
gives \omega3t.cr.in.com\shop\recipe\fad\prod\CPL\Wite\Type\Car\Proton.xml
QUESTION
Removing words from sentence when in lookup dataframe
Asked 2021-Dec-07 at 21:13I have two dataframes, the one contains Reviews for cars and the second one contains the car make and car model. What I would like to do is use the car model df_brand['name']
to be used to lookup every word in the Review sentence df['Review']
and remove matching words. I would like to remove all the words that contain car brands in them.
Input data df['Review']
:
Review
The new Ford Focus came highly recommended to me when I was looking to buy my first new car I researched its history and found that it received great reviews for comfort and safety during its European release Test driving the car I found it to be comfortable well equipped and stylish I have now driven the car for for 6 months and have put only 5000 miles on it While I have been happy with the overall performance of the car I have been sorely disappointed with the workmanship involved Realizing that new models are notorious for having manufacturing bugs I felt somewhat reassured that these would have been worked out from 1998 1999 during the first European release I was wrong My car has been in the repair shop a total of five times for manufacturers defects including a flooded passenger compartment repaired twice to date faulty master clutch cylinder misaligned striker plate on seat back latch broken break switch and cruise control While I really love my car I would hesitate to recommend it to any but my worst enemies Time will tell if the problems my Focus has had are unique or are related to intrinsic design flaws
We bought the Focus ZTS sedan because my wife needed an economical car to haul the grandkids around with We traded in a 94 Explorer with a 5 speed just before the Firestone tire fiasco became public My wife loves driving the car Although it is a bit small for me 6 1 290lbs it is OK The car handles great and with the Zetec engine it has adequate performance although I wouldnt want any less go than its got Now for the problems the main one of which is because I do my own oil changes A particular sore point for me with most cars is that the manufacturers dont make it easy to change the oil and filter without creating a mess This new Focus is particularly bad First the owners manual indicates a Motocraft FL2005 filter The car had an FL801 on it which some ham fisted factory idiot had torqued to about a million foot pounds I had to use some very large pliers and turn the filter almost 3 4 turn before it was loose enough to move by hand Poor quality control The filter happens to be mounted in a horizontal position and is almost flush with the side of the engine When I finally got it loose oil ran down the side of the engine onto the drive axle onto the frame down my arm and all over the driveway Very bad design On other cars I have been able to use a cut off soda bottle placed over the filter to catch the drips On the Focus it wont work The hood on this car is aluminum It bends very easy mine already has a dent in it and I didnt have an accident A minor problem is the power windows They wont operate with the key in the accessory position Tilt wheel also difficult to operate Bottom line only 3 000 miles on this car but its going to get traded off as soon as possible for a vehicle with a little more substance and which is easier to maintain ive owned 9 Fords since 1986 still have 3 If all the newer Fords are made this way the Focus may be the last Ford product I buy
Recently I had the need to rent a car I picked the Ford Focus I was amazed with this car I liked it better than my own more expensive 1999 Toyota Corolla LE The steering wheel is not only height adjustable but also telescopes something you do not normally find on such a reasonably priced car The drivers seat also adjusted forward and back and in height nice feature for someone tall like myself The front seats were roomy and comfortable and the back seat had I think the most leg room I HAVE EVER SEEN in a compact car The stereo sounded good considering it was stock and the face of the radio has an upward tilt to it so that it is driver friendly All the bells and whistles were located within easy reach and the air worked well In addition to having a roomy trunk there are 60 40 split rear seats Child safety seat anchors and shoulder harness seat belts for 5 passengers I rented the 4 door sedan but there are 3 body styles The 4 door sedan 4 door wagon and a sporty little hatch back I have read the safety ratings for the hatch back and from what I recall it got 5 stars This car is definately on my list of cars to consider purchasing in the near future you should take a look at it too
Cruising In My Big T I have had my 91 Thunderbird for 4 years now bought it way back in my freshman year and it has served me well throughout college I am a horrible Northern driver and brutal on my vehicles but this piece of Ford craftsmanship refuses to bail out on me Its a rough and tumble vehicle that remains an incredible deal for the price especially when bought used from a reputable dealer The Advantages 1 Seat Space These are big seats people with the kind of legroom that only those pretentious you know whats in first class usually get their hands on And that spaciousness isnt just about spoiling the people up front either it extends to the back seat as well which means that everyone feels just a little bit more comfortable and relaxed when you get to wherever you re going And not only are the seats big but the generous amount of padding in each makes for an especially comfortable ride 2 Appearance ive gt to admit it to you I just love the look of the Thunderbird though it is an acquired taste to be sure I can best describe the style as Italian sleek in a chunky way and available in colors like burgundy that make it look like a cross between a hit mobile and a hearse 3 Smooth Ride Riding in my Thunderbird has always seemed quite smooth to me especially when you consider how low to the ground it is Why so low That kind of positioning allows the Thunderbird to provide the rider with great control as your feel for the road is significantly enhanced In the same arena as the ride is the ease of use of the console which for me equals smoothness and ease The Thunderbirds radio and air console is incredibly well designed with everything within reach and intuitively organized Seem trivial to you Try changing the station at 75 miles an hour and see how important knob placement is 4 Trunk This is a important feature for me as I seem to move every 3 6 months The trunk on the Thunderbird is big enough for all of your luggage not to mention the corpse of Vinnie The Chin from a rival family My Defense I have read another review of this vehicle that criticizes the brake quality and I have to vehemently disagree with it I ride my brakes hard and I have never had a lockup or other incident The brakes do tend to squeek a bit but the noise is no indication of a performance issue The Final Verdict The bottom line is that the Thunderbird is a comfortable and well designed car at a reasonable price As long as you like burgundy vehicles and live in an area thats at least 30 Italian the Thunderbird is a great option
I arrived in the states from Australia at the end of March 1999 to stay there for a year and come home at the end of March 2000 I stayed with friends in South Carolina who is a Ford man as I have always owned GM or Chevs they lent me a 1979 red corvette until I bought myself a car so after 3 months I did buy a 1985 Z28 Camaro 350 to fix up and use for the 9 months after looking at it I thought this was a bad idea so looked in the local paper and found a red 1991 V8 Thunderbird with 114 000 miles on it for 3000 After taking it for a test drive offered the lady 2800 and drove it home it had a slight water leak from the water pump so while replacing it I installed a set of under drive pulleys which I could notice the power increase the first time I drove it put a K amp N air cleaner in as well I had a friend come over from Australia so we drove from Greenville SC across to Sequin TX did about 3000 miles in that trip we took the long way and had no trouble at all and got 27 MPG sitting on 80 MPH had a radar detector it has a highway ratio in it 2 75 My brother came over from Australia so we went from Greenville SC down to Daytona Beach and back then drove across America to California which we did about 4600 miles trouble free When we left Williams AZ the car was buried under snow as we had a cold snap and snow dig the snow away and turn the key starting the engine at once and never missing a beat The car came with the premium sound system but the radio cassette was playing up so replaced it with a Pioneer radio CD I went to the wreckers and bought an electric motor seat assembly for the right hand side so when converting to RHD will have an electric adjustment Also bought a sports instrument cluster and centre handbrake assy out of a super coupe These cars were never made for export or for Right Hand Drive so have to get all the parts needed now for conversion I did 18 000 miles in 9 months without the car stopping or letting me down I gave the car 4 oil changes added fuel octane booster with every tank of gas it has the factory 15 alloy wheels with Michelin tyres I found the car very easy to drive and steer but did experience brake shudder which appears to be a common problem due to thin brake rotors I added a rear spoiler and had the windows tinted which makes the car look sporty as in Australia the only 2 door cars are mainly Jap imports so in the end I shipped the car back to Australia where I have to convert it over to Right Hand Drive for our road rules this cars owes me 10 000 Australia 5200 US landed back at my house in Australia which when converted to RHD they sell from 35 000 to 40 000 18 000 to 21 000 US BEST CAR I HAVE EVER OWNED
This review is about Ford Mustang 3 8L Coupe with stick shift I test drove when I considered buying it I say considered because I did not buy it and here is why Test Drive The dealer talked too much during the test drive They always try to do that to distract you but I noticed the following things Styling You can argue but I think it could be better The car looks bulky the C pillars are thick which increases blind spots I was afraid to run over somebody while backing up the standard wheels look crude The previous Mustang looked more balanced Engine The 3 8L 193 hp engine does not seem all that powerful even with stick We went on the freeway onramp and I was disappointed Strange considering the 220 lb ft of torque rating at as low as 2800 rpm European and Japanese manufacturers manage to extract more than 200 hp out of 3 0 liter engines Note the A C was on during the test drive and was very efficient It might eat some power but not that much Transmission The shifter has quite short travel which is good but the clutch does not provide any feedback you cannot feel it engage by the pedal pressure or the dealer talked too much The clutch also engaged very high in the pedal travel I drove some Eastern European cars for several years and never had complaints like this one Or maybe im getting old and grumpy Suspension The suspension is not only stiff but creates a lot of unnecessary up and down motions The car uses live axle in the rear so I didnt expect much anyway Standard Equipment The list of standard equipment looks good It includes power windows mirrors locks and remote keyless entry alloy ugly wheels AM FM CD cassette player A C dual vanity mirrors etc Interior Interior materials fit and finish looks cheap I did not expect walnut for 16K but Ford could have done better As I said the C pillars are wide in coupe and the interior room is smaller than Id like The steering wheel tilts but does not telescope which might be a problem for the tall people Insurance and Safety Insurance rates are high especially if you are a male younger than 25 The crash test results are not encouraging either the overall rating is Acceptable with Poor death rate and Marginal injury rate Fuel Economy I didnt get a chance to see the actual fuel consumption myself but on paper its 19 MPG city 29 MPG highway Not impressive for the car of this size with manual transmission Warranty and Reliability Consumer Reports magazine says that Mustang has poor reliability Ford provides 36 000 mile 3 year warranty and 5 year corrosion warranty Majority of other manufacturers offers 60 000 mile 5 year powertrain warranty 100 000 mile 10 year warranty for Hyundai Kia The last three safety fuel economy and reliability also depend on the way you drive Pricing The price was good in theory I know that you can get the car for less than 16K at CarsDirect com for example but the particular dealership I went to wanted more than 17K and did not want to negotiate the price at all Besides they were very pushy and rude Needles to say they did not earn my business they didnt even try The dealer was constantly asking what monthly payment I can afford Well I can afford the payment I need to get better car I walked after which they called me several times asking how they can make me buy the car today I was unable to produce any kind of positive reply on this one I In car buying a lot depends on personal taste If you like Mustangs styling and features and decide to buy it it is a good deal providing you with electric everything remote keyless entry radio CD cassette V6 engine and alloy wheels for less than 16 If you want refinement fit and finish safety and reliability get ready to pay more for something else I
And the lookup data to be replaced in the review should be the following df_brand['name']
:
name
Alfa Romeo
Aston Martin
Audi
Bentley
BMW
Cadillac
Chery
Chevrolet
Chrysler
Citroen
Dacia
Daewoo
Daihatsu
DFM
Dodge
Ferrari
Fiat
Ford
Geely
Honda
Hyundai
Infiniti
Isuzu
Jaguar
Jeep
Kia
Lada
Lamborghini
Lancia
Land Rover
Maserati
Mazda
Mercedes
Mini
Mitsubishi
Nissan
Opel
Peugeot
Porsche
Proton
Renault
Rover
Saab
Seat
Skoda
Smart
SsangYong
Subaru
Suzuki
Tata
TofaÅŸ
Toyota
Volkswagen
Volvo
So everywhere were a car name is mentioned like Ford
or any other car brand, I would like to remove this name.
Here is my code example I tried to use:
query = df['clean_Review']
stopwords = df_brand['name'].tolist()
querywords = query
resultwords = [word for word in querywords if word.lower() not in stopwords]
result = ' '.join(resultwords)
print(result)
ANSWER
Answered 2021-Dec-07 at 20:57Your problem wasn't quite condensed enough to reproduce, or to see the desired output, but your basic approach is fine. You may run into issues with misspellings, in which case maybe use an edit distance with a threshold for determining whether to take out the stopword. Here's my version of your code that seems to do fine
import re
stopwords = ["Ford", "Hyundai", "Toyota", "Volkswagen", "Volvo"]
tests = ["Something about a Ford doing some car stuff",
"Hyundai is another car manufacturer",
"Not everyone buys cars. Some people buy trucks from Toyota.",
"Volkswagen is a German company.",
"A lot of car brands like Toyota, Volkswagen, Volvo, do things"]
stopwards_lower = [word.lower() for word in stopwords]
delimiters = " ", "...", ",", "."
for test in tests:
querywords = list(filter(None, re.split('|'.join(map(re.escape, delimiters)), test)))
resultwords = [word for word in querywords if word.lower() not in stopwards_lower]
result = ' '.join(resultwords)
print(result)
Note: it may be easier to find all stopwords in a result with something like re.findall (or use a nlp package like spacy or gensim) to remove desired stopwords.
QUESTION
How can I disable the return_bind_key in PySimpleGui?
Asked 2021-Nov-25 at 20:26I need to disable the bind_return_key parameter to false after a question is answered incorrectly. The parameter is binded to the submit button under the key 'b1'. I used the .update() method and it worked around a week ago. It not longer works and I receive this error: "TypeError: update() got an unexpected keyword argument 'bind_return_key'"
Is there a fix to this?
Things I've tried:
import PySimpleGUI as sg
import json
data = {
"question": [
"Q1. What is the equation for force",
"Q2. Define isotope",
"Q3. Define wavelength",
"Q4. Define modal dispersion"
],
"answers": [
"f=ma",
"isotopes are atoms of the same element but with a different number of neutrons",
"the least distance between adjacent particles which are in phase",
"causes light travelling at different angles to arrive at different times"
],
"automark": [
["force=massxacceleration"],
["same number of protons", "different number of neutrons", "same element"],
["minimum distance between adjacent particles", "particles which are in phase"],
["different angles", "different times"]
],
"markscheme": [
["force=massxacceleration"],
["same number of protons", "different number of neutrons", "same element"],
["minimum distance between adjacent particles", "particles which are in phase"],
["different angles", "different times"]
],
"mastery": [
0,
0,
0,
0
],
"incorrect": [
0,
0,
0,
0
]
}
def nextset(no, no2, do_not_stop, list1, list2):
endlist = [] # number in the list represent question number
while not do_not_stop:
if no == 3:
do_not_stop = True
if list2[no] == list1[no2]:
position = list1.index(list2[no])
no += 1
no2 = 0
endlist.append(position)
print(endlist)
else:
no2 += 1
savetoexternal(endlist)
def savetoexternal(endlist):
with open("savefile.json", 'w') as f: # creates external json file to be read from later
json.dump(endlist, f, indent=2)
# main program
def listdata(list1):
do_not_stop = False
no = 0
no2 = 0
list2 = list1.copy()
list2.sort(
reverse=True) # ordered question from highest to lowest while keeping original intact to preserve question number
print(list1)
print(list2)
nextset(no, no2, do_not_stop, list1, list2)
def main():
# initialise the question, question number and answer
question = data['question']
answers = data['answers']
automark = data['automark']
markscheme = data['markscheme']
mastery = data['mastery']
incorrect = data['incorrect']
q_no = 0
max_q_no = 4
sg.theme('DarkBlack') # Adding colour
# Stuff in side the window
layout = [[sg.Text(" "), sg.Text(question[0], key='_Q1_', visible=True),
sg.Text(size=(60, 1), key='-OUTPUT-')],
[sg.Text("correct answer:"), sg.Text(size=(60, 1), key='-OUTPUTA-')],
[sg.Text("automark allows:"), sg.Text(size=(60, 1), key='-OUTPUTB-')],
[sg.Text("your answer was:"), sg.Text(size=(60, 1), key='-OUTPUTC-')],
[sg.Text('Answer here: '), sg.InputText(size=(60, 1), key='-INPUT-', do_not_clear=False)],
[sg.Button('Submit', key='b1', bind_return_key=True), sg.Button('Cancel'), sg.Button('Skip')]]
# Create the Window
window = sg.Window('Rerevise', layout, size=(655, 565))
# Event Loop to process "events" and get the "values" of the inputs
while True:
event, values = window.read()
if event == sg.WIN_CLOSED or event == 'Cancel': # if user closes window or clicks cancel
break
window['_Q1_'].Update(visible=False)
window['-OUTPUT-'].update(question[q_no])
select_not_mastered_question = True
already_correct = False
if all(x == 3 for x in mastery):
print("all questions mastered") # add to gui later
list1 = []
q_no = 0
while q_no < max_q_no:
list1.append(incorrect[q_no])
q_no += 1
q_no = 0
listdata(list1)
if values['-INPUT-'].lower() == answers[q_no]: # list index out of range occurs when all questions are complete, need to add completed screen by using else statement
mastery[q_no] += 1 # need to add to gui
print(mastery)
q_no += 1
if q_no == max_q_no:
q_no = 0
while select_not_mastered_question: # make sures the next question has not already been mastered
if mastery[q_no] == 3:
if q_no == max_q_no:
q_no = 0
q_no += 1
else:
select_not_mastered_question = False
window['-OUTPUT-'].update(question[q_no]) # accepts the answer as correct and moves onto the next question
window['-OUTPUTA-'].update('')
window['-OUTPUTB-'].update('')
window['-OUTPUTC-'].update('')
if all(answer in values['-INPUT-'].lower() for answer in automark[q_no]):
print(automark[q_no])
mastery[q_no] += 1 # need to add to gui
print(mastery)
q_no += 1
if q_no == max_q_no:
q_no = 0
while select_not_mastered_question: # make sures the next question has not already been mastered
if mastery[q_no] == 3:
if q_no == max_q_no:
q_no = 0
q_no += 1
else:
select_not_mastered_question = False
window['-OUTPUT-'].update(question[q_no]) # accepts the answer as correct and moves onto the next question
window['-OUTPUTA-'].update('')
window['-OUTPUTB-'].update('')
window['-OUTPUTC-'].update('')
already_correct = True
if any(answer in values['-INPUT-'].lower() for answer in automark[q_no]): # shows the answer was correct but missing some key points
if already_correct:
return
else:
window['-OUTPUTA-'].update(answers[q_no])
window['-OUTPUTB-'].update(markscheme[q_no])
window['-OUTPUTC-'].update('partially correct')
window['-INPUT-'].update(disabled=True)
window['b1'].update(disabled=True)
window['b1'].update(bind_return_key=False)
if event == 'Skip':
q_no += 1
if q_no == max_q_no:
q_no = 0
while select_not_mastered_question: # make sures the next question has not already been mastered
if mastery[q_no] == 3:
if q_no == max_q_no:
q_no = 0
q_no += 1
else:
select_not_mastered_question = False
window['-OUTPUT-'].update(question[q_no]) # moves onto the next question
window['-OUTPUTA-'].update('')
window['-OUTPUTB-'].update('')
window['-OUTPUTC-'].update('')
window['-INPUT-'].update(disabled=False)
window['b1'].update(disabled=False)
window['b1'].update(bind_return_key=True)
elif values['-INPUT-'] == '':
print('answer was:', answers[q_no]) # for testing
window['-OUTPUTA-'].update(
answers[q_no]) # shows that the answer is incorrect and displays the right answer
window['-OUTPUTB-'].update(markscheme[q_no])
window['-OUTPUTC-'].update('incorrect')
window['-INPUT-'].update(disabled=True)
window['b1'].update(disabled=True)
window['b1'].update(bind_return_key=False)
incorrect[q_no] += 1
if mastery[q_no] == 0:
print(mastery)
else:
mastery[q_no] -= 1
print(mastery)
window.close()
main()
ANSWER
Answered 2021-Nov-25 at 20:26This was an issue 2548 in PySimpleGUI.
Since version 4.16.0 there is also a shortcut to unbind a key from an element:
I've also added an
Element.unbind
method to match theElement.bind
method. This will allow you to unbind tkinter events from an element without needing to access the element's Widget member variable.
Thus you can use following to unbind tkinter's return key-press events ('<Return>'
) from your element, which is not the button (with key b1
) but the input (text-field with key -INPUT-
):
# window['b1'].update(bind_return_key=False) # raises error
window['-INPUT-'].unbind('<Return>')
Analogously you can bind the return-key to the text input by:
# window['b1'].update(bind_return_key=True) # raises your error
window['-INPUT-'].bind('<Return>', None) # bind just the return key with no modifiers
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
No vulnerabilities reported
Find more information at:
Save this library and start creating your kit
HTTPS
https://github.com/ValveSoftware/Proton.git
CLI
gh repo clone ValveSoftware/Proton
SSH
git@github.com:ValveSoftware/Proton.git
Share this Page
See Similar Libraries in
by ValveSoftware
by JustArchiNET
by MinecraftForge
by raphw
by fogleman
See all Video Game Libraries
by ValveSoftware C++
by ValveSoftware C++
by ValveSoftware C++
by ValveSoftware C++
by ValveSoftware C++
See all Libraries by this author
by FabricMC
by jMonkeyEngine
by raphw
by CFPAOrg
by cabaletta
See all Video Game Libraries
by graylog-labs
by Steffion
by WildBamaBoy
by LordFokas
by MinecraftWars
See all Video Game Libraries
by graylog-labs
by Steffion
by WildBamaBoy
by LordFokas
by MinecraftWars
See all Video Game Libraries
by zhuowei
by jadar
by scottkillen-vault
by MinecraftWars
by mekanism
See all Video Game Libraries
by JulioC
by mathiasbynens
by mark9064
by davispuh
by davispuh
See all Video Game Libraries
Save this library and start creating your kit
Open Weaver – Develop Applications Faster with Open Source