on-internet

Spring boot, JPA, Hibernate and H2 DB tests - Sequence not working - Unexpected code path"; SQL statement: call next value for seq_my_jobs [50000-193]

I have an entity on my spring boot app: @Entity @Table(name = "MY_JOBS") public class InstallationJobEntity { @GeneratedValue(generator="SEQUENCE_GENERATOR", strategy = GenerationType.SEQUENCE) @SequenceGenerator(name="SEQUENCE_GENERATOR",sequenceName="SEQ_MY_JOBS", allocationSize=100) @Id @Column(name = "ID") private Long id; @Column(name = "CONFIGURATION_DATA") @Lob private String configurationData; public Long getId() { return id; } public String getConfigurationData() { return configurationData; } public void setId(Long id) { this.id = id; } public void setConfigurationData(String configur

Join the discussion →

Spring boot can not find HIBERNATE_SEQUENCE

For many applications all we will need is to put the right Spring Data dependencies on the classpath.it works fine : config: @Configuration @EnableAutoConfiguration @EntityScan(basePackages = {"io.boot.spring.entities"}) @EnableJpaRepositories(basePackages = {"io.boot.spring.repositories"}) @EnableTransactionManagement public class ConfigForJPA { @Bean @ConfigurationProperties("spring.datasource.hikari") public HikariDataSource dataSource() { return (HikariDataSource) DataSourceBuilder.create() .type(HikariDataSource.class).build(); } } application.properties: spring.datasource.hikari.jdbc-url

Join the discussion →

boostrap-select error: Uncaught TypeError: Cannot read property '3'

Boostrap select live search brings an error when typing into the box snapshot and javascript console error log bootstrap-select.js:199 Uncaught TypeError: Cannot read property '3' of undefined at a.expr.pseudos.icontains (bootstrap-select.js:199) at jquery.js:15 at jquery.js:15 at jquery.js:15 at bm (jquery.js:15) at bm (jquery.js:15) at Z (jquery.js:15) at Function.Z.matches (jquery.js:15) at Function.filter (jquery.js:15) at bj (jquery.js:15) the select option <select class="selectpicker" data-live-search="true" multiple> <option data-tokens="mustard">Mustard</option> <option data-tokens="ke

Join the discussion →

Call MVC post method from postman and send parameters to it

I need to test this mvc method from postman, it is working in Browser. [HttpPost] [Route("login")] public async Task<ActionResult> Login(LogInRequest logInRequest) { User user = null; if (ModelState.IsValid) { ..... This is LogInRequest Class: public class LogInRequest { [Required] public string UserName { get; set; } [Required] public string Password { get; set; } public string Token { get; set; } public bool IsResetPassword { get; set; } public bool IsThankYouPage { get; set; } } I am not sure how to sent the LogInRequest parameter using Postman. anything I try it is not hitting the breakpoi

Join the discussion →

Python caching attributes in object with __slots__

I am trying to cache a computationally expensive property in a class defined with the __slots__ attribute. Any idea, how to store the cache for later use? Of course the usual way to store a dictionary in instance._cache would not work without __dict__ being defined. For several reasons i do not want to add a '_cache' string to __slots__. I was thinking whether this is one of the rare use cases for global. Any thoughts or examples on this matter?

Join the discussion →

How to run a task if a previous one fails in Apache Airflow

I need to do the following: Check if a server is up, if so I check if the Spark cluster in that server is up, case it's down I try to start it up, case it's already up I move forward to run my Spark job. I though about creating a task to check if the Spark cluster is up (maybe trying to run a simple Spark job). If it fails I'd start the "Start Spark cluster" task. I'm using Airflow but didn't find a way to trigger a task in case the previous one fails. Besides that I'd need to check the previous one in case it succeeds so it would branch to the Spark job task and skip the "Start Spark Cluster"

Join the discussion →

Cannot find module for a node js app running in a docker compose environment

I am sorry for my very newbie question, but I am having a terrible day figuring out this error, I have an Express app and I am trying to run it in docker compose. I've used this Dockerfile: FROM mhart/alpine-node RUN mkdir -p /usr/src/app RUN chmod -R 777 /usr/src/app WORKDIR /usr/src/app RUN npm install node-gyp -g RUN npm install nodemon -g ENV NODE_ENV development EXPOSE 3000 And this portion of my docker-compose file: backend: mem_limit: 100m build: context: . dockerfile: dockerfiles/node/Dockerfile command: npm start depends_on: - mongo - elasticsearch volumes: - ./backend/:/usr/src/app p

Join the discussion →

Overlays make emacs really slow

I use hide-show to collapse certain parts of my text and I use the code below to show the number of hidden lines. However, when a file is large enough (e.g. C++ or LaTeX) and I collapse all regions (thus creating tens of overlays), Emacs becomes really slow to the point of being unusable. Even moving the marker from one line to another takes half a second or so. Is there a way of resolving this? (defun display-code-line-counts (ov) (overlay-put ov 'display (format "...%d..." (count-lines (overlay-start ov) (overlay-end ov)) )) (overlay-put ov 'face '(:foreground "red" :box (:line-width 1 :styl

Join the discussion →

feign.RetryableException: Connection reset executing GET

We have a micro services architecture deployed on AWS ECS with Docker. The API Gateway and Eureka is from Spring. We have Java/NodeJS micro services which are working perfectly through the gateway but the .NET micro service, which uses SteelToe Eureka client gives us connection reset exception. The following are screenshots for a better understanding. Eureka app registration details Feign client stacktrace We have spent a lot of time, trying to figure it out, but at the moment with no success. Can we get some help on this to solve it please. Thank you very much!

Join the discussion →

How can I suppress "What if" text being written to the console

I commonly use SupportsShouldProcess in my PowerShell functions along with $PSCmdlet.ShouldProcess() so I can sanity-check what a script is going to do. Generally I only implement this around actions that will change the environment, e.g. Add-, New-, Set- cmdlets, etc. In some cases I also want to bypass Get- cmdlets when running a script with the -WhatIf switch. For example: I have a script that fingerprints all files in a folder using Get-FileHash before doing something to each file. In this example there are 10k+ files with an average size of 100MB or more and I don't want to spend time act

Join the discussion →

Can you force a GPO update from a different user

I am getting a "fail to update user" when executing a "gpupdate /force". The computer updates fine. I think the issue has to do with the computer is logged on as userX. I am running a cmd window with "runas /user:userY" I will answer the inevitable question "why" at the end of the post. The meat of the question, is this (runas /user:userY can failed is expected) correct? If so can I get around it. The computer has to autolog on with a domain user that has administrative privileges, users are prevented from access to any from of disk "explorer" including IE. Long story, just trust me. I been ab

Join the discussion →

BindingSource - what are the advantages of using BindingSource

What gives me using something like this: DataGridView dgvDocuments = new DataGridView(); BindingSource bindingSource = new BindingSource(); DataTable dtDocuments; dtDocuments = MsSQL.GetDocuments(dtpOd.Value, dtpDo.Value); bindingSource.DataSource = dtDocuments; dgvDocuments.DataSource = bindingSource; instead of this: DataGridView dgvDocuments = new DataGridView(); DataTable dtDocuments; dtDocuments = MsSQL.GetDocuments(dtpOd.Value, dtpDo.Value); dgvDocuments.DataSource = dtDocuments;

Join the discussion →

Filter table data by date with Reactjs

I am new to reactJs and trying to implement the below idea - A data table where data can be filtered by day of the month. A calendar which will show only days of a month in a row (pagination/tab like view): Selecting each days will filter the data of the table on the page Next month can be selected by clicking on the month name appears on the end of the row and data will be filtered accordingly. what I have tried - Use a react-bootstrap paginator Use a data table I am finding it hard to figure our how can I implement the calendar and connect it as a filter with the data table. BTW, data of the

Join the discussion →

Mergesort using CUDA

I tried to implement my own Mergesort based on bottom up/iterative mergesort algorithm. This algorithm split the data by 2 elements, and sorted. Then by 4elements and sorted and so on until all the data sorted. So, my plan is assign the each thread by 2 elements. So i do this: __global__ void mergeBU(int *d_a, int *d_aux, int sz, int N) { int idk = blockIdx.x*blockDim.x+threadIdx.x; int lo = 2 * sz * idk; int mid = lo + sz - 1; float hi = fminf(lo + sz + sz - 1, N - 1); merge(d_a, d_aux, lo, mid, hi); } __device__ void merge(int *d_a, int *d_aux, int lo, int mid, float hi) { int i = lo; int j

Join the discussion →

Why does Try::Tiny's "try {}" seem different from "eval {}" for objects created inside the try block?

I have the following initialisation code in a system tray applet: use Gtk3 -init; use Glib::Object::Introspection; eval { Glib::Object::Introspection->setup( basename => 'Notify', version => '0.7', package => "MyProgram::Notify", ); }; if ($@) { say "no notify because setup failed: $@"; $use_notify = 0; } else { MyProgram::Notify->init(); } That code is based upon fdpowermon, but seems to come more or less from the Exception handling examples in the POD of Glib::Object::Introspection. But perlcritic (at level 3) argues about it: Return value of eval not tested at line … So I tried to rewrite t

Join the discussion →

PHP Create Local Variables From String [duplicate]

Is there a way to create a variable inside an object from a string? for example: class Whatever { public function createVariables() { $this["variable_name"] = 100; } } I want to dynamically create variables depending on a set of rules that are defined by a child class.

Join the discussion →

How can I prevent \n showing in text in Mule

I am returning a JSON message and it is showing the \n new line character. How can I stop this from happening and show the return so the text looks more readable instead of just everything on a line? An example text returned is: customers who bought this also bought:\n\n- Mario Kart I am using Anypoint Studio 6.1 and Mule 3.8.1 Thanks

Join the discussion →

Default selection of radio button in tkinter

I have the code below. The intended behaviour is to set the default option in a set of radio buttons. I've used very similar code elsewhere and its worked but in this case the last 3 options are all showing as selected. I'm new to tkinter and can't for the life of me see where I've gone wrong. Any help much appreciated. charttypevar=StringVar() chart_type_1 = ttk.Radiobutton(chart_type_frame, text="3d with catagories",variable=charttypevar,value='3d with catagories')# chart_type_2 = ttk.Radiobutton(chart_type_frame, text="3d no catagories",variable=charttypevar,value='3d no catagories')# chart

Join the discussion →

What is the best alternative to strncpy()?

The function strncpy() doesn't always null terminate so I want to know what is the best alternative that always null terminates? I want a function that if: strlen(src) >= n /*n is the number of characters to be copied from source*/ there's no need to add further code like this: buf[sizeof(buf)-1] = 0;

Join the discussion →

Get Google Drive multiple shared links...in order

I've been working with Google Drive's features for a while now,but I've stumbled on quite a problematic issue. As people know,you can get multiple share links from multiple files within Google Drive,by holding the Shift button+selecting the files,and then right clicking and select 'Share' and 'Get Link' However the problem is,that the links I get are in a completely random order!,I've been checking over and over if they were sorted by date or filename or access time,but I couldn't figure out any reasoning behind the seemingly random order. This is quite a nuisance as I was trying to use Google

Join the discussion →

how do I chop up a row of numbers into columns with Perl [closed]

I am trying to convert data that is currently being processed by hand into an easier format but I am not a programmer so i really could use some help. Our tab delimited .txt datafile looks as following: Date : Time : Sample name : Temperature : : -4000 4.882813E-03 4.882813E-03 -3000 4.882813E-03 4.882813E-03 -2000 0 0 -1000 -.1367188 .1367188 0 -3.554688 3.457031 1000 -3.632813 3.491211 2000 -3.657227 3.496094 3000 -3.686523 3.491211 4000 -3.710938 3.496094 5000 -3.735352 3.496094 6000 -3.754883 3.491211 7000 -3.774414 3.496094 8000 -3.793945 3.496094 the text and all data until column A reac

Join the discussion →

org.thymeleaf.exceptions.TemplateInputException for Spring Boot

I use Spring Boot with thymeleaf, but thymeleaf is not work like ' org.thymeleaf.exceptions.TemplateInputException: Error resolving template "graduation", template might not exist or might not be accessible by any of the configured Template Resolvers' **this is Exception, when I access 'localhost:8080' ** org.thymeleaf.exceptions.TemplateInputException: Error resolving template "graduation", template might not exist or might not be accessible by any of the configured Template Resolvers at org.thymeleaf.TemplateRepository.getTemplate(TemplateRepository.java:246) ~[thymeleaf-2.1.5.RELEASE.jar:2.

Join the discussion →

How to properly set parent of a widget in Pyqt?

I have the following code from PyQt5 import QtCore, QtGui, QtWidgets from mw import Ui_MainWindow as mwin from wd import Ui_Form as wdg class widget(QtWidgets.QWidget): def __init__(self,parent = None): super(widget,self).__init__(parent) self.ui = wdg() self.ui.setupUi(self) self.show() class Main(QtWidgets.QMainWindow): def __init__(self,parent = None): super(Main,self).__init__(parent) self.ui = mwin() self.ui.setupUi(self) self.show() w = widget(self) import sys if __name__ == '__main__': app = QtWidgets.QApplication(sys.argv) mn = Main() sys.exit(app.exec_()) The Ui is generated by qt des

Join the discussion →

Mocking a method based on the parameter in Spock

Im trying to figure out mocking and for some reason it keeps returning the correct answer (win) not the one i want it to return (mac) /** * This is an empty imple class. Its intention is to allow operating * system specific information to be mocked for unit testing. */ class OsImpl extends Os { } /** * A utility convenience class that helps with pulling a variety of machine information for the build system */ class ProjectInfo { static String operatingSystem(){ operatingSystem(new OsImpl()) } /** * Returns a 3 char code on the operating system of the local machine. * @return String Code ['win'

Join the discussion →

Move a directory to another git repository while keeping the history

I'm moving a folder from one git repo to another which already exists, e.g.: repo-1 ---- dir1 ---- dir2 ---- dir-to-move ---- dir4 repo-2 ---- dir1 ---- dir2 In the end I want the repos to look like repo-1 ---- dir1 ---- dir2 ---- dir-to-move ---- dir4 repo-2 ---- dir1 ---- dir2 ---- dir-to-move That is, for a time dir-to-move will exist in both repos. But eventually I'll migrate the latest changes to repo-2 and remove dir-to-move from repo-1. My research Initially, I believed that I need to use git filter-branch as described here: How to move files from one git repo to another preserving hist

Join the discussion →

ZK Framework, Execute MVVM command when all zk components have been loaded

I am working with ZK 8.0.2. I use MVVM pattern. I want execute a view model command when all zk components have been loaded. How I can do? I annoted by @Init but @Init method is executed before all zk components are loaded. I need execute a view model command when all components (included scripts) are loaded. I annoted ny @AfterCompose but same behaviour

Join the discussion →

Center image between containers while keeping responsivity

How can I add an image on top of the other and keep the responsivity? Basically what I need is an image that is centered between one image and a container. I am using Bootstrap. Attached screenshot. I tried different variants with float, position: absolute; and so on but nothing seemed to work when the screen was being resized. Tried finding info about this but frankly I have no idea how to formulate the problem so that I find an answer. [![screenshot][1]][1]

Join the discussion →
Older stories