on-internet

How to make icecast as service and restart it?

I installed Icecast 2.4.3 on my server using direct download to get the latest version available. In this way, I don't use the version distributed by my distribution (debian 8) and thus don't have the daemon activated by default. I found a script that I modified with my corresponding paths, but the execution is in error. The script icecast.sh : #!/bin/bash # # Init file for Icecast server daemon # # chkconfig: 345 55 25 # description: Icecast streaming mp3 server daemon # # processname: icecast # config: /etc/icecast.xml # pidfile: /var/run/icecast.pid # source function library # . /etc/rc.d/i

Join the discussion →

Using SharePoint CSOM inside .Net Core application

I want to get data from SharePoint list by CSOM library on .Net Core MVC application. There are absolutely no problem to achieve that on .Net Framework aplication because Microsoft.SharePoint.Client library contains ExecuteQuery method. Unfortunately .Net Core equivalent not. I've made Async function public async Task<ActionResult> GetRequests() { ClientContext context = new ClientContext("https://xxx/sites/xxx/"); List certificatesList = context.Web.Lists.GetByTitle("Items"); CamlQuery query = CamlQuery.CreateAllItemsQuery(100); ListItemCollection items = certificatesList.GetItems(query); con

Join the discussion →

How to fix the error "Form submission canceled because the form is not connected" in the latest browser versions (IE, Mozilla and Chrome)

I had this piece of code perfectly running until a week back when chrome was updated to version 56. Now it does not work, When I checked the console I got the error "Form submission canceled because the form is not connected". The submit function is not triggered when clicked. I'm new to coding so please help me with this issue. function report_submit(){ var max = document.getElementById("totalCount").value; var frm = document.createElement("form"); frm.setAttribute("method", "POST"); frm.setAttribute("action", "insertnew.php"); frm.setAttribute("target", "selectnew.php"); var hiddenField1 = d

Join the discussion →

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 →

java.util.ServiceConfigurationError: javax.xml.stream.XMLInputFactory: Provider com.ctc.wstx.stax.WstxInputFactory not a subtype

I am using Weblogic 12c. I'm trying to deploy myApplication.war in Weblogic. While deploying I get below error. An error occurred during activation of changes, please see the log for details. Message icon - Error java.util.ServiceConfigurationError: javax.xml.stream.XMLInputFactory: Provider com.ctc.wstx.stax.WstxInputFactory not a subtype Message icon - Error javax.xml.stream.XMLInputFactory: Provider com.ctc.wstx.stax.WstxInputFactory not a subtype The same myApplication.war I am able to deploy in weblogic-10,Jboss and Tomcat, but not in weblgic-12c. I googled and found that I need to includ

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 →

Forbidden (403) CSRF verification failed. Request aborted using django

hello i am user python and Django. i will follow this question(Can I have a Django form without Model) but for my task i need images. i will try to run my code and i have this error Forbidden (403) : any idea how to fix that ? Forbidden (403) CSRF verification failed. Request aborted. You are seeing this message because this site requires a CSRF cookie when submitting forms. This cookie is required for security reasons, to ensure that your browser is not being hijacked by third parties. If you have configured your browser to disable cookies, please re-enable them, at least for this site, or fo

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 →

Correctly allocating multi-dimensional arrays

The intent of this question is to provide a reference about how to correctly allocate multi-dimensional arrays dynamically in C. This is a topic often misunderstood and poorly explained even in some C programming books. Therefore even seasoned C programmers struggle to get it right. I have been taught from my programming teacher/book/tutorial that the correct way to dynamically allocate a multi-dimensional array is by using pointer-to-pointers. However, several high rep users on SO now tell me that this is wrong and bad practice. They say that pointer-to-pointers are not arrays, that I am not

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 →

Controlar visualizações diárias de imagem [fechada]

Não quero o script pronto, apenas saber a melhor estratégia. Pessoal, estou com uma dificuldade em descobrir qual a melhor forma de controlar a quantidade de visualizações diárias de um banner. Por exemplo: Tenho um BD com 500 banners (nome, link, imagem, dias q vai aparecer) mas em cada página do site só mostram 7 banners de cada vez. Como fazer para que: Todos os banners fossem vistos a mesma quantidade de vezes; Só repetir um banner após todos os outros terem sido mostrados; Não usasse visualizações aleatórias Cada banner aparecerá certa quantidade de dias e depois será apagado. A pergunta

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 →

How to check the sidekiq queue

In a separate tab, I'm running bundle exec sidekiq and in another tab I'm running: SendWithUsInviteeMailerJob.perform_async(invitee.id) which kicks off a job that is here: class SendWithUsInviteeMailerJob include Sidekiq::Worker sidekiq_options queue: :mailer, retry: 2 def perform(invitee_id) SendWithUsInviteeMailer.welcome(invitee_id).deliver end end How do I determine if this job is enqueued in sidekiq? Say this is a test environment. I basically want to see that this job was enqueued for the purposes of a test. Here's my gemfile: ... gem 'sidekiq' gem 'redis' ... and in my spec_helper: requ

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 →

Issue with opening oracle form you must install the J2SE Plugin version

I working on an application where want to open oracle form but every time it shows message like this In order to access this application, you must install the J2SE Plugin version 1.6.0_07. To install this plugin, click here to download the oaj2se.exe executable. Once the download is complete, double-click the oaj2se.exe file to install the plugin. You will be prompted to restart your browser when the installation is complete. and I download many versions of java as you can see in the picture ever uninstall and install of version I restart my computer but still gets the same problem my system i

Join the discussion →

Install Laravel using Composer

I'm trying to install Laravel using Composer, but after running the following command composer create-project laravel/laravel cmsLaravel 5.2 pointing to my c/xampp/htddocs directory, I get the error below: C:\xampp\htdocs\laravelCMS\bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in C:\xampp\htdocs\laravelCMS\bootstrap\autoload.php on line 17

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 →
Older stories