Categories
Development

How to implement in console quiz the removal of an option every t2 seconds (t2

I am new to C# and I am trying to build console quiz. Here is my problem: For every option removed I have to reduce one option (let’s say the total points are 100). If one option is removed I need to reduce the total points by 25 (i.e now the total points will be […]

Categories
Development

Exploitation of data provider elements inside test as array, using testNG

I created a selenium testNG webdriver automation programe which grab data fome excel sheet and use them for fill some fields and execute some tasks, So I wrote a code that is successfully executed when the tasks are hard coded,but I want to avoid hard coding and lot of repetition inside @test, so I injected […]

Categories
Development

Spring – Same entity detached on the @EventListener but attached in the @Service class

I have following classes in my Spring application: TaskService and DevStartup. When application starts DevStartup is run, but the Tag(“Home”) is seen as detached entity on tasksRepository.save(task) which throws detached entity exception during startup. @Component @AllArgsConstructor @Slf4j @Profile(“dev”) public class DevStartup { private final TagsService tagsService; private final TagsRepository tagsRepository; private final TasksRepository tasksRepository; private […]

Categories
Development

Spring – detached entity passed to persist in one context, but not in the other

I have two similar pieces of code using Java 11, Spring Boot 2. First, class that runs on a application startup @Component @AllArgsConstructor @Slf4j @Profile(“dev”) public class DevStartup { private final TagsService tagsService; private final TasksRepository tasksRepository; private final Clock clock; @EventListener(ApplicationReadyEvent.class) public void initializeApplication() { Task webinarTask = new Task(“Run webinar”, “Na zoom.us”, clock.time()); […]

Categories
Development

How to iterate input value in thymeleaf

I’m trying to iterate an input field thru GET in Java Controller and thymeleaf but it’s giving me the error of “result returns more than one elements” My GET can receive the Array of String ID’s but I can’t put them in my Form, I will use my Form to POST it and delete the […]

Categories
Development

Webview audio player Stoped music after 5-7 min

I’ve created a Webview audio player. The app is working well. But when the music was playing, after some time when the mobile is locked, the song stops itself after 5-7 minutes. Please help me how do I correct? I’ve created a Webview audio player. The app is working well. But when the music was […]

Categories
Development

Cannot Retrieve data from Firebase Database into my Android App

I have stored data into the Firebase Database, but I am unable to retrieve a set of data.The getPname(), getDescription(), getPrice() and the image is not showing up.I can only see the button of Add to cart and the ElegantButton but it shows the text written in activity_products_category that is it shows statically product price, […]

Categories
Development

How to test the child class for equality in Java?

I am working on a project, but I got stuck in some issue. I need to test equality of child class (DiscountProduct). Relation between classes can be understood as: Order class has-a Product and Product is parent of DiscountProduct. I want to test DiscountProduct for equality. Any help is much appreciated. Thank you! Below is […]

Categories
Development

Getting error when trying get values from sqlite table

I’m using SQLite and is trying get some values from the Database. I have 2 tables in the database. A database called FOOD and one called DRINK. The problem that occurs happens in the FOOD table. I can the erorr message: no such table: FOOD. Which I don’t understand as the the tables and the […]

Categories
Development

Check Url completely loaded Webview

I want to show a progressBar till all resources are loaded. I’ve tried below code, but progressBar will go off when resources starts loading. dataBinding.webviewGallery.setWebViewClient(new WebViewClient() { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { if (!loadingFinished) { redirect = true; } return false; } @Override public void onPageStarted(WebView view, String url, Bitmap favicon) { […]