How to get an unobfuscated client-secret for keycloak client-secret REST call Posted: 15 Jul 2021 08:35 AM PDT when calling the keycloak REST api (see below) the output value is a string of asterisks (stars) - is it possible to get this information in clear text? curl \ --silent \ --request GET \ -H "Authorization: bearer <MYACCESSTOKEN>" \ --header 'Content-Type: application/x-www-form-urlencoded' \ "http://keycloakserver:8180/auth/admin/realms/myrealm/clients/<MYCLIENTID>/client-secret" returns/output: {"type":"secret","value":"**********"} How can it be retrieved in a text (not stars) format? The client is configured with: - clientt protocol: openid-connect
- access type: confidential
- standard flow: enabled
 |
How to implement the slot time in the fullcalender angular Posted: 15 Jul 2021 08:35 AM PDT I am getting a response from the backend like this { day: "Mon" freeSlot: {label: "11:15 am", value: 11.15} {label: "12:15 pm", value: 12.15} lockedSlot: [] value: 1 }, { day: "Tue" freeSlot: [] lockedSlot: [] value: 2 }, { day: "Wed" freeSlot: [] lockedSlot: [] value: 3 }, { day: "Thu", value: 4, freeSlot: [], lockedSlot: [] }, { day: "Fri" freeSlot: [] lockedSlot: [] value: 5 }, { day: "Sat" freeSlot: {label: "01:00 pm", value: 13} lockedSlot: [] value: 6 }, { day: "Sun" freeSlot: [] lockedSlot: [] value: 0 } note: value are represented here as dayNumber like 0 for sun, 1 for mon.. Freeslot has the time slot and someone locked in the mobile app i will get the lockedslot array. I been trying to implement timeGridWeek in which i need to patch these data above. how to make this possible. I dont know how to set the starttime and endtime with this.  |
Excel conditional formating columns based on formula Posted: 15 Jul 2021 08:34 AM PDT I would like to highlight a row based on the current week (dynamically) by filling the cell(s) with a blue color. So if the current week changes to 3 then the third row should be blue. My spreadsheet would look like this: Current date 15-07-2021 ;=TODAY() Current week 2 ;=ISOWEEKNUM(A1) Weeknumber | Availability | 1 | 2 days | 2 | 3 days | 3 | 1 day | 4 | 1 day | 5 | 4 days | Does anybody have any thoughts on this matter? Thanks! SQLShane  |
lld-link: error: could not open 'icuuc': no such file or directory Posted: 15 Jul 2021 08:34 AM PDT I try to compile the library skia on Windows with icu as dependency. I use clang as compiler. I always get the error message at the end of the compile process: lld-link: error: could not open 'icuuc': no such file or directory I try to compile that library like this: gn "gen out/Release --args="target_os=\"win\" target_cpu=\"x64\" is_official_build=true is_component_build=true clang_win=\"%LLVM_PATH%\" extra_cflags=[ ... ] skia_use_system_expat=false skia_use_system_libjpeg_turbo=false skia_use_system_libpng=false skia_use_system_libwebp=false skia_use_system_zlib=false skia_use_system_icu=true skia_use_system_harfbuzz=true" ninja -v -C out/Release I have a file called icuuc.lib , but this file lies in a specific directory (for now, let's say its under C:\path\to\icu\lib64 . I tried several ways so gn can find this file. These were my tries: Add the path to the icu file to the PATH environment variable. Call gn with the argument extra_ldflags = [ \"-LC:\path\to\icu\lib64\" ] . I also tried this way: extra_ldflags = [ \"/LIBPATH:C:\path\to\icu\lib64\" ] . Adjust BUILD.gn . Every line with lib_dirs = [ ] is changed to lib_dirs = [ "C:\path\to\icu\lib64" ] Nothing worked here really. Any tips how to solve this problem?  |
Should-Throw Method in Powershell Posted: 15 Jul 2021 08:34 AM PDT I am trying to run some test in PowerShell that will check is the version in SolutionInfo.cs file in correct format, is it missing or it is okay. With my tests I am trying to cover those scenarios. One of them for checking the file, when the version is okay, is passing but the rest is failing. In addition I am sending you the script and the tests. The solution files contain version. Can someone please help me with these two cases and how the throw method or any other that is fit for my case should look like? function Get-VersionFromSolutionInfoFile($path) { try { [Version]$version = (Get-Content -Raw $path) -replace '(?s).*\bAssemblyVersion\("(.*?)"\).*', '$1' } catch { throw "Missing version or incorrect format." } return $version.ToString() } it "returns version from SolutionInfo.cs file"{ Get-VersionFromSolutionInfoFile("$pwd/SolutionInfo.cs") | Should -Be '1.0.0.0' } it "returns exception if there aren't any versions in the file"{ Get-VersionFromSolutionInfoFile("$pwd/SolutionInfo2.cs") | Should -Throw } it "returns exception if the version is not in the correct format"{ Get-VersionFromSolutionInfoFile("$pwd/SolutionInfo3.cs") | Should -Throw }  |
How to Configure Artemis as a Broker in JBoss-4? Posted: 15 Jul 2021 08:34 AM PDT I configured a standalone ActiveMQ-5.16.1 to be used as a Broker from a JBoss-4.2.3 Server (Here is how to do this) and my Camel-routes are able to get Messages from this Broker. I replaced the standalone ActiveMQ-5.16.1 with an ActiveMQ Artemis-2.17.0 broker and beside few changement in the subscriptions the whole system is working. I am aware that ActiveMQ-5.16.1 and ActiveMQ Artemis-2.17.0 quite different are and I am trying to replace the activemq-rar-5.4.3.rar downloaded from here with the artemis-rar-2.17.0.rar downloaded from here. This .rar file is deployed under $JBOSS_HOME/server/default/deploy together with an <own-choosen-name>-ds.xml file. In the <own-choosen-name>-ds.xml file 2 connection-factories for respectively queues and topics are declared. This file references a file contained in the activemq-rar-5.4.3.rar META-INF/ra.xml and in this file are defined the connection-factories. The problem is that eventough the artemis-rar-2.17.0.rar contains the same META-INF/ra.xml file, it's not obvious and not documented what to configure and how to configure it. I didn't succeed to find an example or a documentation about this. I am gratefull for any help.  |
Failed to remove unexpected space Posted: 15 Jul 2021 08:34 AM PDT this is my css: .panel-tabel { background-color: white; border-radius: 10px; padding: 15px 25px; max-width: 1040px; width: 80%; display: flex; flex-direction: column; text-align: center; text-transform: uppercase; align-items: center; } .plan { border-bottom: 1px solid #e1f1ff; align-items: center; text-align: center; display: flex; flex-direction:column; margin-top: 10px; } @media (min-width: 1050px){ .panel-tabel { flex-direction: row; margin-top: 2.5%; padding: 0; } .plan { border-bottom: none; border-right: 1px solid #adb5bd; text-align: center; width: 30%; padding: 0 2.5%; margin: 1.5% 0; border-top: none; height: 100%; margin-top: 0; } In chrome it's look weird becousr in the first column there is unwanted space between the outside box and the inside box. The box with no space Other box with space Can someone help me figure it out?  |
How do i use XPATH properly in scrapy? Posted: 15 Jul 2021 08:34 AM PDT |
SQL - how to check if we have digits in column Posted: 15 Jul 2021 08:35 AM PDT I have this script: df1 = spark.sql("select * from table where field LIKE '%[0-9]%'") display(df1) this gives me empty DF. I have table contains:   |
Angular - Property 'results' does not exist on type 'ICandidate'.ngt Posted: 15 Jul 2021 08:34 AM PDT I have a code using Angular-12. It's as shown below: Interface: export interface ICandidate { id: number; first_name: string; other_name: string; last_name : string; email: string; gender : string; user_photo: any; marital_status: string; dob : Date; address : string; cv_file: any; achievement: IAchievement[]; certificate: ICertificate[]; education: IEducation[]; experience: IExperience[]; skills: ISkill[]; } candidate.service: import { ICandidate, IAchievement, ICertificate, IEducation, IExperience, ISkill } from '../models/candidate.model'; @Injectable({ providedIn: 'root' }) export class CandidateService { constructor( private http: HttpClient, private token: TokenService, private api: ApiService ) { } private candidateDetails!: ICandidate; getCandidateDetails(): ICandidate { return this.candidateDetails; } setCandidateDetails(candidateDetails: ICandidate): void { this.candidateDetails = candidateDetails; } getCandidateProfile(): Observable<ICandidate> { let headers = new HttpHeaders(); headers = headers.set('Authorization', this.token.get()); const url: string = this.api.baseURL + 'display'; return this.http.get<ICandidate>(url, { headers }); } } component: import { Component, OnInit } from '@angular/core'; import { CandidateService } from 'src/app/features/driver/services/candidate.service'; import { ICandidate } from 'src/app/features/driver/models/candidate.model'; import { AppState } from 'src/app/store/reducers'; @Component({ selector: 'app-profile-list', templateUrl: './profile-list.component.html', styleUrls: ['./profile-list.component.scss'] }) export class ProfileListComponent implements OnInit { public loggedIn!: boolean; candidateDetails!: ICandidate; constructor( private store: Store<fromStore.AppState>, private router: Router, private auth: AuthService, private token: TokenService, private api : ApiService, private candidateService: CandidateService, ) { } ngOnInit(): void { this.candidateService.getCandidateProfile().subscribe( (response) => { console.log(response); this.candidateDetails = response; console.log(this.candidateDetails); this.candidateService.setCandidateDetails(this.candidateDetails); }); } } When I did console.log(response); in component, I got: { "message": "Profile Successfully Retrieved.", "error": false, "code": 200, "results": { "profile": { "id": 2, "user_type": "Teacher", "created_at": "2021-07-07T07:19:13.000000Z", "updated_at": "2021-07-15T09:57:48.000000Z", "deleted_at": null, "last_login_at": "2021-07-15T09:57:48.000000Z", "detail": { "id": 1, "user_id": 2, "first_name": "Lamptey", "last_name": "Akwetey", "other_name": null, "email": "lamptey@yahoo.com", "gender": null, "user_photo": null, "marital_status": null, "dob": null, "address": null, "cv_file": null, "summary": null, "created_at": "2021-07-07T07:19:13.000000Z", "updated_at": null }, "educations": [], "experiences": [], "achievements": [], "certificates": [], "skills": [], "employees": [] } } profile and detail have single data. Now I want to display the profile, detail, educations and experiences {{ candidateDetails.results.profile.user_type }} gives this error: Property 'results' does not exist on type 'ICandidate'.ngt Likewise {{ candidateDetails.results.profile.detail.first_name }} How do I get this resolved? Thanks  |
flutter bottomsheet with overlay button on top Posted: 15 Jul 2021 08:34 AM PDT Can someone give guidance on how to create a bottomsheet with a button on top like below? I think typically we should be able to achieve it using a stack widget. But not sure how to do this with a bottomsheet. Thanks for your help.   |
How can I extract rows that does't have a specific value , referring to another table? Posted: 15 Jul 2021 08:34 AM PDT Suppose two tables: 1° Table_Menu ID Description_Menu Type_of_Menu Suppose we have 2 Type_of_Menu : - L stands for lunch
- D stands for dinner
2° Table_Dishes ID_menu (foreign key for the ID of Table_Menu) Descritpion_Dish Type_of_Dish Suppose we have 4 Type of Dish : - V stands for vegetable
- M stands for meat
- F stands for fish
- D stands for drinks
Every single menu can be for dinner or lunch and it can have multiple dishes and different types of dishes (all V, all M, a mix of V, M F . . .whatever you want) What would be my query if I want to extract from the Table_Menu all the menus from the dinner that HAVE NOT vegetable dishes? If there is al least one dish with V type in a linked menu, I don't want that menu in my result Thank you!  |
Destroy one window and open another in Tkinter Python Posted: 15 Jul 2021 08:34 AM PDT I created a library management system with GUI and want to add a login GUI on it as well. What I want in the login window to pop up first and then, if the credentials are right, the management system opens up. The problem I'm facing is that when I hit the login button, the management system opens but the login window also stays there. I have tried self.root.destroy() before creating the window for management system but it closes all the windows and the management system also shuts down.` What can I do? class login_system(): def __init__(self, root): self.root = root self.root.title('Login') self.root.geometry('500x250') self.root.config(background='black') self.loggedin = False user = Label(root, text='Username:', font=('times new roman',20, 'bold'), fg='white', bg='black', padx=15,pady=10) user.grid(row=0, column=0, padx=10, pady=10) password = Label(root, text='Password:', font=('times new roman',20, 'bold'), fg='white', bg='black', padx=15 ) password.grid(row=1, column=0, padx=10, pady=10) self.user_var= StringVar() self.pass_var= StringVar() user_ent = Entry(root, width=20, font=('times new roman',18, 'bold'),textvariable=self.user_var) user_ent.grid(row=0, column=1) pass_ent = Entry(root, width=20,font=('times new roman',18, 'bold'),textvariable=self.pass_var) pass_ent.grid(row=1, column=1) submit = Button(root, text='Login', command=self.login,font=('times new roman',18, 'bold')) submit.grid(row=3, column=1, pady=10) def login(self): userinfo = self.user_var.get() passinfo= self.pass_var.get() conn = mysql.connector.connect(host='localhost', username='root', password = 'testpass', database = 'librarydb') my_cursor = conn.cursor() my_cursor.execute('SELECT username, password FROM login_system') rows = my_cursor.fetchall() conn.close() for row in rows: if row[0] ==userinfo: if row[1]==passinfo: tmsg.showinfo('Successful!', 'Logged In') self.loggedin=True self.newWindow= Toplevel(self.root) self.app = LibraryManagementSystem(self.newWindow) else: tmsg.showinfo('Incorrect', 'Incorrect Password. Please try again') break else: tmsg.showinfo('Incorrect', 'Incorrect username. Please try again') break class LibraryManagementSystem(): def __init__(self, root): self.root= root self.root.title('Library Management System') self.root.geometry('1366x768')  |
How to make the button inactive during animation Posted: 15 Jul 2021 08:35 AM PDT I want to deactivate the button until the animation is finished. I want it to be active when the animation is over. I wrote the following, but it didn't work. It activates immediately. import SwiftUI struct ContentView: View { @State private var scale: CGFloat = 1 @State private var isDisable = false var body: some View { VStack { Button( action: { isDisable = true withAnimation( .linear(duration: 1) ) { scale = scale - 0.1 isDisable = false } }, label: { Text("Tap Me") } ) .disabled( isDisable ) RectangleView().scaleEffect( scale ) } } } struct RectangleView: View { var body: some View { Rectangle().fill( Color.blue ) .frame( width:200, height: 150 ) } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } }  |
How do I refresh the page with an onPress in ReactNative Posted: 15 Jul 2021 08:34 AM PDT I am new to ReactNative and have encountered an issue regarding page refreshing. I have some filters in my screen and will like the page to refresh once any of these filters are pressed, but am unable to find any guides on how to do so. I have searched endlessly but only found numerous guides on refreshing with pulldown, and I feel like the solution has something to do with React.useEffect but am unfamiliar with that. The important parts of my code are as below: The TouchableOpacity component to trigger the refresh: <TouchableOpacity style={styles.filterButton} onPress={() => { sortByRating() }} > where sortByRating() is a function to sort my eateriesToShow array based on their ratings. The FlatList I want to be refreshed on filter: <FlatList data={eateriesToShow} keyExtractor={item => item.id.toString()} renderItem={renderItem} showsVerticalScrollIndicator={true} /> </View> ) } Currently my eateriesToShow array gets sorted, but the FlatList does not get refreshed. Any help will be appreciated.  |
How to add current datetime in POST API request? Posted: 15 Jul 2021 08:34 AM PDT I want the start and end date to be in current datetime. I don't know whether it is possible. I need that because I want to trigger the data everyday using my pipeline.   |
Elasticsearch array with duplicates Posted: 15 Jul 2021 08:35 AM PDT |
cannot get the scraped data to show up in the table from tkinter Posted: 15 Jul 2021 08:35 AM PDT this is the code for the tkinter part I want tkinter to show my scraped data from tkinter import * from tkinter import ttk import requests from bs4 import BeautifulSoup root = Tk() table = ttk.Treeview(root) table['columns'] = ('Rank', 'Name') table.column('#0', width=0, stretch=NO) table.column('Rank', anchor=CENTER, width=200) table.column('Name', anchor=CENTER, width=120) table.heading('#0', text='', anchor=CENTER) table.heading('Rank', text='Id', anchor=CENTER) table.heading('Name', text='rank', anchor=CENTER) drink_price = {} index = 0 for i in drink_price: price = drink_price.get(i) table.insert(parent='', index=index, iid=index, text='', values=(i, price)) index += 1 table.pack() this is the web scraper webpage = requests.get( "https://www.spinneyslebanon.com/catalogsearch/result/?q=pepsi" ) soup = BeautifulSoup(webpage.content, "html.parser") title = soup.find_all("a", "product-item-link") price = soup.find_all("span", class_="price") titles = [] prices = [] for index, tp in enumerate(zip(title, price)): if index >= 10: break drink_price[tp[0].get_text(strip=True)] = tp[1].get_text(strip=True) print(titles) print(prices) root.mainloop() output of the scraper ['Pepsi Pepsi Max - 330Ml', 'Pepsi Regular Bottle 330ml', 'Pepsi Black Regular Bottle 330ml', 'Pepsi Diet Bottle 2.25L', 'Pepsi Regular 2.25L', 'Pepsi Regular Can 185ml', 'Pepsi Diet Bottle 1.25L', 'Pepsi Diet Can 185ml', 'Pepsi Regular Bottle 1.25L', 'Pepsi Diet Pet - 330Ml'] ['LBP 17,999', 'LBP 3,999', 'LBP 3,999', 'LBP 10,999', 'LBP 10,999', 'LBP 4,999', 'LBP 8,999', 'LBP 4,999', 'LBP 8,999', 'LBP 3,999'] the web scraper does its job I will edit its output now so you can see, the above part is the tkinter code that will place the output of the web scraper in a table but I can't seem to figure out how to get the data into the table  |
Error when setting up Boolean filter on Report Builder Posted: 15 Jul 2021 08:35 AM PDT I am in the process of creating a metrics dashboard for my department. I am trying to filter a tablix to show the results that are "rejected" Or are "accepted/Pending" when they are assigned to a designer. I have gotten this code to work as an expression. Showing "True" For all of the variables I need and "False" for all of the ones I do not want, but when I input the expression into the filter box I get this error. I have also given my code as well. The filter is set as a Boolean filter with the value being True. I have tried changing the filter expression a few times and am not sure what to try next. Failed to evaluate the FilterExpression of the Tablix 'Tablix1'. (rsFilterEvaluationError) The execution failed for the shared data set 'DataSet1'. (rsDataSetExecutionError) An error has occurred during report processing. (rsProcessingAborted) =IIF(Fields!Status.Value.Contains("Rejected") or ((Fields!Status.Value.Contains("Accepted") or Fields!Status.Value.Contains("Pending")) AND Fields!RoutingDescription.Value.Contains("1") OR Fields!RoutingDescription.Value.Contains("2") or Fields!RoutingDescription.Value.Contains("3") or Fields!RoutingDescription.Value.Contains("4") or Fields!RoutingDescription.Value.Contains("5") or Fields!RoutingDescription.Value.Contains("6") or Fields!RoutingDescription.Value.Contains("7")), True, False)  |
Construct a new map using List of Maps using Java 8 streams Posted: 15 Jul 2021 08:34 AM PDT I converted below json data (in example) to List<Map<String, String>> and from that i want to construct a new Map using Java 8 streams and the output should look like below. could someone help me with this? Key value Service1: DEACTIVATED Service2: ACTIVATED Service3: DEACTIVATED Ex: [ { name=Service1, desiredState=DEACTIVATED }, { name=Service2, desiredState=ACTIVATED }, { name=Service3, desiredState=DEACTIVATED } ]  |
Allow only the branch creater to force push and disable for other Posted: 15 Jul 2021 08:34 AM PDT Background: Earlier in our org, we had allowed force push for branches other than master. There were many instances where dev did git push -f --all . This caused lots of problems. So the admin disabled force push for all the branches. Problem: I still want to force push to the branches that I have created as I often rebase my branches just to keep the commit history clean. Is there a way to allow force push by the branch creater and not allow for others?  |
HoloLens 2 Emulator Developer Mode - Grayed Out Posted: 15 Jul 2021 08:35 AM PDT I recently installed the HoloLens 2 Emulator on my PC. The developer mode option in settings is grayed out I was wondering if anyone would know why or encountered the same issue? The message in settings is: "some settings are hidden or managed by your organization" I am currently not logged in to a Microsoft account - visitor0 and have the Windows Home edition on my PC.  |
Javascript: A Problem with Prettier Formmating Posted: 15 Jul 2021 08:35 AM PDT I have an annoying problem with the Prettier formatter. Whenever I type in an object, array or a JSX component, there's a line break that I can't find a way to disable. For example, trying to type a long mongoose enum: I want it to look like this: genres: { type: [String], enum: [ 'Pop', 'Rock', 'Disco', 'Jazz', 'Hip Hop', 'Folk', 'Blues', 'Metal', Country', 'Classical', 'RnB', 'Soul', Dance', Funk','Reggae'], But Prettier always formats it like this: genres: { type: [String], enum: [ 'Pop', 'Rock', 'Disco', 'Jazz', 'Hip Hop', 'Folk', 'Blues', 'Metal', 'Country', 'Classical', 'RnB', 'Soul', 'Dance', 'Funk', 'Reggae', ], JSX example: I want it to look like this: <SomeElement prop1="bla" prop2="bla" prop3="bla" prop4="bla" prop5="bla" prop6="bla" prop7="bla" /> But Prettier formats it like this: <SomeElement prop1="bla" prop2="bla" prop3="bla" prop4="bla" prop5="bla" prop6="bla" prop7="bla" /> Am I missing anything, or is this just not possible with Prettier? I tried changing the 'Print Width' option, but it didn't help much because whenever i pass the print width length it will break lines like this again.  |
javax.persistence.TransactionRequiredException: no transaction is in progress on @Lock annotation Posted: 15 Jul 2021 08:34 AM PDT I'm facing an issue I've never experienced before. I'm trying to use a @Lock on a repository Method to avoid concurrency issues and I'm getting the error described on the Title. DB Configuration - @Configuration @EnableTransactionManagement @EnableJpaRepositories( entityManagerFactoryRef = "entityManager", transactionManagerRef = "transactionManager", basePackages = "com.sample.repositories" ) public class DataBaseConfiguration { @Bean(name = "dataSource") @ConfigurationProperties(prefix = "sample.datasource") public DataSource dataSource() { PoolProperties properties = new PoolProperties(); properties.setTestOnBorrow(true); properties.setValidationQuery("SELECT 1"); return new org.apache.tomcat.jdbc.pool.DataSource(properties); } @Bean(name = "jdbcTemplate") public JdbcTemplate jdbcTemplate(@Qualifier("dataSource") DataSource dataSource) { return new JdbcTemplate(dataSource); } @Bean(name = "entityManager") public LocalContainerEntityManagerFactoryBean entityManagerFactory(EntityManagerFactoryBuilder builder) { return builder .dataSource(dataSource()) .properties(hibernateProperties()) .packages("com.sample.domains") .persistenceUnit("persistenceUnit") .build(); } @Bean(name = "transactionManager") public PlatformTransactionManager transactionManager( @Qualifier("entityManager") EntityManagerFactory entityManagerFactory) { return new JpaTransactionManager(entityManagerFactory); } private Map<String, Object> hibernateProperties() { Resource resource = new ClassPathResource("sampleHibernate.properties"); try { Properties properties = PropertiesLoaderUtils.loadProperties(resource); return properties.entrySet().stream() .collect(Collectors.toMap( e -> e.getKey().toString(), e -> e.getValue()) ); } catch (IOException e) { return new HashMap<String, Object>(); } } } So, the flux of the application starts in a regular controller, which have the following service autowired by builder.. This is the service: @Service public class SampleServiceImpl implements SampleService { private SampleRepository sampleRepository; public SampleServiceImpl (SampleRepository sampleRepository) { this.sampleRepository= sampleRepository; } @Override @Transactional public void sampleMethod(String parameter1, String parameter2) { SampleObject sampleObject = sampleRepository.findSampleObjectByParameter1AndParameter2(parameter1, parameter2); System.out.println("SAMPLE REGISTRIE: " + sampleObject); sampleRepository.save(sampleObject.setUpdateDate(new Date())); } } And of course, this is the repository: public interface SampleRepository extends JpaRepository<SampleObject, Long> { @Lock(LockModeType.PESSIMISTIC_WRITE) @Query(value = "SELECT so FROM SampleObject so WHERE so.parameter1 = ?1 AND so.parameter2 = ?2") SampleObject findSampleObjectByParameter1AndParameter2(String parameter1, String parameter2); } This is actually a very simple flux... but I'm getting the: org.springframework.dao.InvalidDataAccessApiUsageException: no transaction is in progress; nested exception is javax.persistence.TransactionRequiredException: no transaction is in progress And this is just calling the method of the repository with the @Lock annotation.. I don't get why, becase i'm ussing @Transactional annotations all over my application but is the first time using the lock. Anyone can help me out? UPDATE 1: Here is the code where I call the method. @RestController @RequestMapping("/api/sample") public class SampleController { private SampleService sampleService; public SampleController (SampleService sampleService) { this.sampleService = sampleService; } @GetMapping("/executeSample") public ResponseEntity<Void> executeSample(){ sampleService.sampleMethod(parameter1, parameter2); return ResponseEntity.noContent().build(); } }  |
ngx-image-zoom set max-width and -height Posted: 15 Jul 2021 08:34 AM PDT ngx-image-zoom is a great product. After some testing we found out it will be necessary to set a max-width so a large image won't bump other content off the cliff. No matter what we do like the followings and/or combination won't do the tricks to contain and auto-resize it <lib-ngx-image-zoom style="max-width:100px" ...> <div style="width:100px; max-width:100px"> F12 shows it has this setting <div _ngcontent-tnl-c230="" class="ngxImageZoomContainer" style="width: 773px; height: 768px;"> manually decreased the width and height just like cut out and show the corresponding area from upper left corner.  |
fixed position vuetify alert component Posted: 15 Jul 2021 08:34 AM PDT I'm trying to create an alert component in VueJS/nuxtjs that will model the behavior of a snackbar (in this case fixed-bottom position, where it is fixed at the bottom when we scroll, so we see the alert as we're scrolling.) For some reason I couldn't find much documentation on it. I've gone thru the alert component API on vuetify, and compared it to the snackbar component, but still can't seem to figure out why it's not working. I've tried changing the position to absolute and it works, but for some reason instead of being fixed-bottom as the page scrolls it's literally fixed at the bottom and the user can't see the alert until they scroll down to the end of the page... when I use a snackbar component it works just fine, but I like the icon that alert comes with, hence the reason for using that component instead. I'll attach the code for the alert, as well as its parent component: parent: <div class="help-center-page max-w-none"> alert component: <div class="text-center"> <v-alert :dismissible="true" prominent type="error"> This is an alert. </v-alert> </div>  |
Is it possible to tree-shake module imports in live-served storybook? Posted: 15 Jul 2021 08:35 AM PDT I use Storybook with CRA preset in my project and run Storybook locally. I would like to use namespace imports in my storybook for better developer experience: // this is more convenient import { ArrowForward, Star } from '@material-ui/icons'; // than this import ArrowForward from '@material-ui/icons/ArrowForward' import Star from '@material-ui/icons/Star' It seems to be tree-shaking correctly during the build process - both approaches yield the same bundle size. However when running storybook locally via yarn storybook , importing from the aggregate namespace: import { ArrowForward, Star } from '@material-ui/icons' results in approximately 20 seconds longer build time. I tried using both tree-shaking plugins from material ui guide with the suggested config inside projectRoot/.storybook.babelrc.js , but with no luck. It sure processes the .babelrc.js , since invalid syntax there breaks the build. However it still loads all the icons. Is it possible to get it working within a CRA?  |
How to make Brew show the size of the formula before installing it? Posted: 15 Jul 2021 08:35 AM PDT I'm looking for a way to make brew show the size of a formula without installing it. I've tried various options to brew info and brew install , but neither let me view the size of the formula. However, when installing a formula, its size is shown as part of the output. Any ideas? nlykkei-mbp:Projects nlykkei$ brew info llvm llvm: stable 8.0.1 (bottled), HEAD [keg-only] Next-gen compiler infrastructure https://llvm.org/ Not installed From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/llvm.rb ==> Dependencies Build: cmake ✔ Required: libffi ✔, swig ✔ ==> Requirements Build: xcode ✔ ==> Options --HEAD Install HEAD version ==> Caveats To use the bundled libc++ please add the following LDFLAGS: LDFLAGS="-L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib" llvm is keg-only, which means it was not symlinked into /usr/local, because macOS already provides this software and installing another version in parallel can cause all kinds of trouble. ==> Analytics install: 15,199 (30 days), 39,871 (90 days), 183,880 (365 days) install_on_request: 11,125 (30 days), 30,095 (90 days), 140,885 (365 days) build_error: 0 (30 days)  |
"Run as Administrator" (System.Net.WebException: The request was aborted: Could not create SSL/TLS secure channel.) Posted: 15 Jul 2021 08:35 AM PDT I am getting the WebException error only on 2 PCs (i tryed 5 diferent PCs). The problem does not occure if i start application "As administrator". I have tryed to add ServicePointManager.Expect100Continue = true; ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls; and also change diferent flags for certificate X509Certificate2 Cert = new X509Certificate2(fileName, "", X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.PersistKeySet); But it didn't help. try { string webLink = @"https://" + destinationIP + "/apps/MMC/"; //get firmware version of trellisware radio string fileName = Path.GetDirectoryName(Application.ExecutablePath) + Path.DirectorySeparatorChar + "etc" + Path.DirectorySeparatorChar + "default.p12"; X509Certificate2 Cert = new X509Certificate2(fileName, "", X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.PersistKeySet); CertificateWebClient myWebClient = new CertificateWebClient(Cert); string webData = myWebClient.DownloadString(webLink); Uri responseUri = myWebClient.ResponseUri; string[] response = responseUri.ToString().Split('/'); } catch (WebException ws) { logger.Error("WebException: " + webLink + Environment.NewLine + ws); } catch (SocketException) { } catch (ThreadAbortException) { } catch (Exception ex) { logger.Error("Exception: " + webLink + Environment.NewLine + ex); } public class CertificateWebClient : WebClient { private readonly X509Certificate2 certificate; public CertificateWebClient(X509Certificate2 cert) { certificate = cert; } protected override WebRequest GetWebRequest(Uri address) { HttpWebRequest request = (HttpWebRequest)base.GetWebRequest(address); System.Net.ServicePointManager.ServerCertificateValidationCallback = delegate (Object obj, X509Certificate X509certificate, X509Chain chain, System.Net.Security.SslPolicyErrors errors) { return true; }; request.ClientCertificates.Add(certificate); return request; } Uri _responseUri; public Uri ResponseUri { get { return _responseUri; } } protected override WebResponse GetWebResponse(WebRequest request) { WebResponse response = base.GetWebResponse(request); _responseUri = response.ResponseUri; return response; } } Exceptions: 2019-05-13 07:04:48.0050 | Error | OManager | WebException: https://169.1.28.23/apps/MMC/ System.Net.WebException: The request was aborted: Could not create SSL/TLS secure channel. at System.Net.WebClient.DownloadDataInternal(Uri address, WebRequest& request) at System.Net.WebClient.DownloadString(Uri address) at CAstralPilot.OcelotManager.<>c__DisplayClass26_0.<getGCSTrelliswareVersion>b__0() in 2019-05-13 07:04:48.2081 | Warn | Genesys.Bayeux.Client | Request transport failed. Retrying after 00:00:00 Exception: Genesys.Bayeux.Client.BayeuxTransportException: Unable to connect to the remote server ---> System.Net.WebSockets.WebSocketException: Unable to connect to the remote server ---> System.Net.WebException: The request was aborted: Could not create SSL/TLS secure channel. at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult) at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Net.WebSockets.ClientWebSocket.<ConnectAsyncCore>d__21.MoveNext() --- End of inner exception stack trace --- at System.Net.WebSockets.ClientWebSocket.<ConnectAsyncCore>d__21.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Genesys.Bayeux.Client.WebSocketTransport.<Open>d__12.MoveNext() --- End of inner exception stack trace --- at Genesys.Bayeux.Client.WebSocketTransport.<Open>d__12.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Genesys.Bayeux.Client.ConnectLoop.<Poll>d__16.MoveNext() I expected the code to work on al PCs, why some of them need administrator rights so WebClient can connect? Do i need to add certificate on some trusted location so it can work?  |
Receiving error: AttributeError: module 'cv2.cv2' has no attribute 'CompareHist' when trying to call a openCV method Posted: 15 Jul 2021 08:35 AM PDT I'm trying to find the distance between two vectors using openCV's compareHist() method. I'm using opencv-contrib-python 3.4.2.17. If I try to use the compareHist() method as described in the documentation here https://docs.opencv.org/3.4.2/d6/dc7/group__imgproc__hist.html#gaf4190090efa5c47cb367cf97a9a519bd I get an error "AttributeError: module 'cv2.cv2' has no attribute 'CompareHist'" Am I calling the method incorrectly, or am I using the documentation incorrectly? My snippet of testing code is below for reference. Thanks. import numpy as np import cv2 as cv img = cv.imread('../data/im3.jpg') img2 = cv.imread('../data/im4.jpg') gray = cv.cvtColor(img, cv.COLOR_BGR2GRAY) gray2 = cv.cvtColor(img2, cv.COLOR_BGR2GRAY) sift = cv.xfeatures2d.SIFT_create() kp, des1 = sift.detectAndCompute(gray,None) kp2, des2 = sift.detectAndCompute(gray2,None) print(cv.CompareHist(des1[0], des2[0], CV_COMP_CORREL))  |
No comments:
Post a Comment