on-internet

How can I invert the colors of images in bulk by Imagemagick?

I would like to invert the colour of numerous figures in a fold in Linux, the code is as follows: mogrify /home/yu/Desktop/1 -negate /home/yu/Desktop/2 The origin file is in path 1, and the target fold is path 2. However, it's wrong. It points out that "mogrify: no decode delegate for this image format `' @ error/constitute.c/ReadImage/562."

Join the discussion →

How do I conduct restricted VECM in statsmodels for hypothesis testing?

I am new to statsmodel and as above, would like to know how I can conduct restricted VECM in statsmodels for hypothesis testing? Additionally, is there a way I can find the roots of a VECM model to see if it is stable in statsmodels? I have looked at the documentation, but can't seem to find the appropriate functions.

Join the discussion →

'mat-tree' is not a known element:

I get and error when I try to add the expmle tree of material.angular ERROR in src/app/features/itemmonitor/data-options-tree/data-options-tree.component.html:1:1 - error NG8001: 'mat-tree' is not a known element: 1. If 'mat-tree' is an Angular component, then verify that it is part of this module. 2. If 'mat-tree' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. data-options-tree.component.spec.ts <mat-tree> <mat-tree-node> parent node </mat-tree-node> <mat-tree-node> -- child node1 </mat-tree-node> <mat-tree-node> --

Join the discussion →

Modded Command in Minecraft 1.8.9 command doesn't exist in Multiplayer server

I am developing some minecraft mod for 1.8.9. What I'm trying to create is command that simply send message to sender. here's the code for command class and main class command class: package happyandjust.happymod.commands; import java.util.HashMap; import java.util.List; import net.minecraft.command.CommandBase; import net.minecraft.command.CommandException; import net.minecraft.command.ICommandSender; import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; public class Command extends CommandBase { private HashMap<String, String> collection = new HashMap<Str

Join the discussion →

Autonumber - start from ZERO

So, I know how to add an autonumber field to a table using SQL: dblocal.Data.Execute "CREATE TABLE " & TableName & " (" & FieldName & " COUNTER(1,1) )" Where dblocal is the passed database reference with TableName & FieldName the appropriate names for the desired creation of the table. However, I want the counter to start at ZERO not ONE. And I know it's possible because the table I need to repair / duplicate starts with ZERO What am I not finding on the internet to aid me in this task? My search-fu fails me. --- edit many months later: Just why did not I realize that using the AUTOINCREMENT(0

Join the discussion →

Getting 'psutil.AccessDenied (pid=6836)' error using psutil

I want to check if a program is running or not, so I searched and I tried this , in this way: import psutil if "notepad.exe" in (p.name() for p in psutil.process_iter()): print('program is running') else: print('not running') but I get this error: During handling of the above exception, another exception occurred: Traceback (most recent call last): File "~/temp.py", line 2, in <module> if "notepad.exe" in (p.name() for p in psutil.process_iter()): File "~/temp.py", line 2, in <genexpr> if "notepad.exe" in (p.name() for p in psutil.process_iter()): File "~\Python\Python38-32\lib\site-packages\p

Join the discussion →

scroll behaviour smooth not working at all

I am wondering why my scroll smooth isn't working at all. I am not too sure why? I thought adding overflow-y: scroll; scroll-behavior: smooth; will help but its not working. Here is my code: #container{ overflow-y: scroll; scroll-behavior: smooth; } .topTab{ bottom: 0; position: fixed; font-size: 25px; color: white; } .pg{ font-size: 100px; height: 100vh; background-color: blue; text-align: center; } a{ color: white; } <div class = "topTab"> <li><a href="#1">1</a></li> <li><a href="#2">2</a></li> <li><a href="#3">3</a></li> </div> <div id = "container"> <div id = "1" class= "pg">1</div> <div i

Join the discussion →

Edit HTTP Request header with WebView2

I am using the new WebView2 control that has recently been released for .NET and I need to add an authorization value to the request header when navigating to a site but am unable to find a way to do it. Since this is control is relatively new and my first time using it, I could also be completely missing the method that actually does this. The only information I can find so far is found in the c++ documentation: ICoreWebView2HttpRequestHeaders It specifically says Used to inspect the HTTP request on WebResourceRequested event and NavigationStarting event. Note, you can modify the HTTP request

Join the discussion →

Skip lines while reading csv - Azure Data Factory

I am trying to copy data from Blob to Azure SQL using data flows within a pipeline. Data Files is in csv format and the Header is at 4th row in the csv file. i want to use the header as is what is available in the csv data file. I want to loop through all the files and upload data. Thanks

Join the discussion →

Angular/Typescript - This expression is not constructable. Type 'MoveDataClass' has no construct signatures

I am doing a class with 3 methods to create new instances of that class, but when i try to that , the following error appears : "Angular/Typescript - This expression is not constructable. Type 'MoveDataClass' has no construct signatures." What i am doing wrong? The class: export class MoveDataClass { power; stab; efect; constructor(power,stab,efect) { this.power= power; this.stab =stab; this.efect= efect; } } What i do to create the new class : this.pokemonMovesCalculated[0] = new this.moveData(type); The error appears on the "this.moveData" in red

Join the discussion →

Setting default for StrongAuthenticationMethods via Powershell

I'm using the following script to enable MFA methods for a user in Azure Active Directory (snippet taken from this article): Connect-MsolService $UserPrincipalName = "[email protected]" $SMS = New-Object -TypeName Microsoft.Online.Administration.StrongAuthenticationMethod $SMS.IsDefault = $true $SMS.MethodType = "OneWaySMS" $Phone = New-Object -TypeName Microsoft.Online.Administration.StrongAuthenticationMethod $Phone.IsDefault = $false $Phone.MethodType = "TwoWayVoiceMobile" $PrePopulate = @($SMS, $Phone) Set-MsolUser -UserPrincipalName $UserPrincipalName -StrongAuthenticationMethods $P

Join the discussion →

Find a Pattern across Multiple lines with R

I am trying to identify a pattern across multiple lines, to be exact 2 lines. Since the pattern in either individual line is not unique I am using this approach. So far I have tried to go with the function "grep" but I think I am missing the correct regular expression here. grep("^Item\\s{0,}2[^A]", f.text, ignore.case = TRUE) This part is a modified version of the edgar package function "getfillings" and tries to extract only the Management's Comment/Item 2 for quarterly results. If possible I would include something after ... 2[^A] in the function that reacts to the new line and then the str

Join the discussion →

Is there a way to include a comment in an f-string?

It would be useful for me to include a comment in an f-string. For instance, take this code: f""" <a href="{ escape(url) }" target="_blank" { # users expect link to open in new tab } >bla</a> """ It would be nice if this code was equivalent to: f""" <a href="{ escape(url) }" target="_blank" >bla</a> """ You can include full Python expressions in between the curly braces, but it looks like you can't include comments. Am I correct? Is there a way to do this?

Join the discussion →

How to cut all Lines/Characters in R after specific Characters

I am currently taking a course that teaches textual analysis in R. As I am fairly new to R, I could not figure out yet how to cut all Lines after a specific set of characters. For example, I have the following given: documentName <- "Hello my name is Johann my had is the largest to be deleted X" My desired outcome is: documentName <- "Hello my name is Johann" So far I have tried the following but it is not getting me anywhere. gsub("(\Johann).*\\","",documentName)

Join the discussion →

lsnrctl: command not found in Ubuntu 18.04

I am trying to make connection to Oracle Database 18c XE with sqldeveloper, but I am getting : Status : Failure -Test failed: Listener refused the connection with the following error: ORA-12505, TNS:listener does not currently know of SID given in connect descriptor So I am trying to start my listener, which I have inside /opt/oracle/product/18c/dbhomeXE/network/admin/samples And I am getting lsnrctl: command not found I am also getting the same message for sqlplus which is inside /opt/oracle/product/18c/dbhomeXE/bin I know that you are going to say Oracle is not supported for Ubuntu, but I am

Join the discussion →

Is there an existing solution to swaping two vectors in h2o-3?

Lets say theres a Frame fr consisting of 3 vectors with column names "a" "b" "c". I have an MRTask giving me a new vector. Vec new_vec_a = FooReturningNewVec(fr.vec("a")). Now I want to swap fr.vec("a") with new_vec_a. Can I use an already existing method, if not how would you suggest on creating this method.

Join the discussion →

Javascript map add value to exist key

Hello I've got problem with map in js, I've got list of orders in form like this=> const ORDERS = [ { orderId:1, category:"sport", amount:350, time:'2019-12-15T19:23:30.000Z' }, { orderId:2, category:"sport", amount:350, time:'2019-12-15T19:21:30.000Z' }, { orderId:3, category:"garden", amount:120, time:'2019-12-15T19:25:30.000Z' }, { orderId:4, category:"sport", amount:250, time:'2019-12-15T19:23:30.000Z' } ] I want to create map key based on unique category and amount and map value is a array with times. For example reffered to above order list: key: {category:'Sport',amount:350} and value:

Join the discussion →

PDFBox: No glyph for U+0050 in extracted font

I'm trying to create new page in document and write some text to it, while using the font contained in the file. The font is extracted from the resources: PDPage page = document.getPage(0); PDResources res = page.getResources(); List<PDFont> fonts = new ArrayList<>(); for (COSName fontName : res.getFontNames()) { PDFont font = res.getFont(fontName); System.out.println(font); fonts.add(font); } And later used to write some text: stream.beginText(); stream.setFont(fonts.get(0), 12); stream.setTextMatrix(Matrix.getTranslateInstance(20, 50)); stream.showText("Protokol"); stream.endText(); The show

Join the discussion →

Swift - How to make a cURL request? (Swift 5.2 / macOS Catalina)

I'm developing a test app on MacOS - intended for the Mac desktop. Looking to make a API call to Gumroad (digital products seller). They say that we have to make a cURL request: like this - curl https://api.gumroad.com/v2/licenses/verify \ -d "product_permalink=QMGY" \ -d "license_key=YOUR_CUSTOMERS_LICENSE_KEY" \ -X POST I'm very new to swift and everything MacOS development. Clueless how I'd do this - lot of documentation is years old or iOS, or talks of other http requests (and I don't know how to relate that to making a cURL call) which makes it hard. Any help is appreciated. The call retu

Join the discussion →

Use table variable in dynamic SQL in SAP HANA?

Inside a procedure, I use a table variable to store the result from table A. I have to use this table variable in dynamic SQL. Here is my code: Call Procedure A() Begin VAR_TAB = select customer_id from table_A; EXEC ' select * from'||: var_tab; End; The above code will throw an error. How do I fix this?

Join the discussion →

Correctly move rigidbody at constant speed

This is currently my code. The object moves at the desired speed but using rb.velocity = movement * speed if it jump it remains glued to the ground. I can't understand how I can fix things. private Vector3 movement; private float speed = 3; public bool isGrounded; void Start() { rb = GetComponent<Rigidbody>(); } void Update() { float Horizontal = Input.GetAxis("Horizontal"); float Vertical = Input.GetAxis("Vertical"); movement = transform.right * Horizontal + transform.forward * Vertical; float origMagnitude = movement.magnitude; movement.y = 0.0f; movement = movement.normalized * origMagnitud

Join the discussion →

Powershell throws an error "The term 'sqlcmd' is not recognized as the name of a cmdlet, function, script file, or operable program"

I have to schedule a jams job for sending a report to a client. But my job failed and I get an error in the log file The term 'sqlcmd' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. This is my PowerShell script: param ( [string]$DatabaseServer = "COREP02P.centiv.com", [string]$SFTPPath = "/home/cdibrm02/", [string]$SFTPServer = "test-externalftp.prudential.com", [string]$SFTPCredential = "PrudentiaReport-SFTP-Test", [string]$JamsServerName = "jams01d

Join the discussion →

How to set a custom DNS resolver for axios

axios uses http.request in NodeJs which has an option (lookup) for a custom lookup function. Its default value is dns.lookup. However, we want to use another dns resolver which has the cache ability. How can I set lookup when using axios?

Join the discussion →

Jenkins Pipeline docker.withRegistry() push leads to endless loop

I managed to setup a jenkins on kubernetes and gitbucket on kubernetes. Now I am trying out to create my own first docker file for uploading on dockerhub. Unfortunately it fails while uploading to docker. Build is successfully, but I cant manage how to upload it to dockerhub (private repository). Jenkinsfile def label = "${BUILD_TAG}" podTemplate(label: label, containers: [ containerTemplate(name: 'docker', image: 'docker:latest', command: 'cat', ttyEnabled: true) ], volumes: [ hostPathVolume(mountPath: '/var/run/docker.sock', hostPath: '/var/run/docker.sock') ]) { node(label) { def app def my

Join the discussion →

Get attribute set on class 'property method'

I have this simple decorator which sets an attribute mark='marked' on the decorated method def mark(fn): @wraps(fn) def wrapper(*args, **kwargs): return fn(*args, **kwargs) setattr(wrapper, 'mark', 'marked') return wrapper I use it on a class property method like this class Car(object): @property @mark def move(self): return "move" Now since Car.move is a property method, how do I access the marked attribute I created? >>> c = Car() >>> getattr(c.move, 'mark') AttributeError: 'str' object has no attribute 'mark' The error makes sense since c.move invokes the __get__ method on the property desc

Join the discussion →

How to use abs, sqrt etc on OperateOnAll with OjAlgo?

I'm trying to take square root on all elements in a matrix A by doing the following command. A.operateOnAll() But the argument must be UnaryFunction<N> and I don't know how to create that. I reading the API documention, but still don't know how to create a sqrt procedure for matrix A https://javadoc.scijava.org/ojAlgo/index.html?org/ojalgo/function/FunctionSet.html

Join the discussion →

Insert Access2D element in Primitive64Store in OjAlgo at specific column and row

Is it possible to insert a Access2D element in a Primitive64Store in OjAlgo? Access2D<Double> data = Access2D.wrap(mu.toRawCopy2D()); Primitive64Store B = Primitive64Store.FACTORY.make(rows * m, columns * n); I want to insert data into B at a specific start row and start column. For the moment. I have implement the procedure like this: public class Repmat { static public MatrixStore<Double> repmat(MatrixStore<Double> mu, int m, int n) { long rows = mu.countRows(); long columns = mu.countColumns(); double[][] data = mu.toRawCopy2D(); Primitive64Store B = Primitive64Store.FACTORY.make(rows * m,

Join the discussion →

Adjusting date tick settings on seaborn lineplot

I'm experiencing crowding on my x-axis when using lineplot in seaborn. I initially plotted the data with the following: import pandas as pd import matplotlib matplotlib.use('TkAgg') import seaborn as sns for state in states_list: starting_point = state_covid_data[(state_covid_data.cases > 9) & (state_covid_data.state == state)] plot = sns.lineplot(data=starting_point, x='date', y='cases') plot Here is the output: To try and fix the crowding, I adjusted my code as follows from the recommendation in this answer: for state in states_list: starting_point = state_covid_data[(state_covid_data.cases

Join the discussion →

Change input text color on dark or light mode

I created a dark/light theme switcher. The problem that I discovered is that when I enter any information in the input field while the website is in dark mode, the text inside the input field appears black. How can I change it to keep the black text colour in light mode and white text colour in dark mode? Here is my CSS for light/dark mode. How can I add a different text color for dark mode? :root { --primary-color: rgb(82, 80, 144); --secondary-color: #536390; --font-color: #424242; --bg-color: #fff; --heading-color: #292922; --color: black; } [data-theme="dark"] { --primary-color: rgb(107, 1

Join the discussion →

Problem detected: Apache Not Found !, Disabling Apache buttons

I have been using xampp for a long time, everything was fine and work correctly. one month ago the xampp server shut down suddenly and when try to start the apache I couldn't, it shows that start button disabled and I cant start it. it gave me an error: Problem detected: Apache Not Found! 8:16:51 PM [Apache] Disabling Apache buttons 8:16:51 PM [Apache] Run this program from your XAMPP root directory! 8:16:51 PM [mysql] Problem detected: MySQL Not Found! 8:16:51 PM [mysql] Disabling MySQL buttons 8:16:51 PM [mysql] Run this program from your XAMPP root directory! I have tried all solutions: I t

Join the discussion →
Older stories