on-internet

miss asm/types.h in linux compile

lenge@lenge-pc:/lenge/linux/kernel_online$ git branch master * tag_v4.15 CONFIG is defconfig. when I compile kernel(v4.15), error occurred, as follows: In file included from /lenge/linux/kernel_online/include/linux/types.h:6, from /lenge/linux/kernel_online/include/linux/page-flags.h:9, from /lenge/linux/kernel_online/kernel/bounds.c:10: /lenge/linux/kernel_online/include/uapi/linux/types.h:5:10: fatal error: asm/types.h: No such file or directory #include <asm/types.h> ^~~~~~~~~~~~~ compilation terminated. That is my compile method: make ARCH=arm64 -C /lenge/linux/kernel_online O=/lenge/linux

Join the discussion →

Executing Windows PowerShell commands in a Jupyter Notebook

Would someone please suggest a way to execute Windows PowerShell commands (i.e., commands more similar to Unix commands than Command-Prompt commands) in a Jupyter notebook? Please note that I am a layperson. So far, I have added "C:\ProgramData\Anaconda3\Scripts" to my path system variable, which allows me to run "jupyter-notebook" from either Command Prompt or Windows PowerShell. I guess a shell looks in all folders in my path system variable for an application to run named "juypter-notebook". I guessed that running Jupyter Notebook from Windows PowerShell would allow my Jupyter-Notebook Chro

Join the discussion →

Unable to create a tensor using torch.Tensor

i was trying to create a tensor as below. import torch t = torch.tensor(2,3) i got the following error. TypeError Traceback (most recent call last) in () ----> 1 a=torch.tensor(2,3) TypeError: tensor() takes 1 positional argument but 2 were given so, i tried the following import torch t = torch.Tensor(2,3) # No error while creating the tensor # When i print i get an error print(t) i get the following error RuntimeError Traceback (most recent call last) in () ----> 1 print(a) D:\softwares\anaconda\lib\site-packages\torch\tensor.py in repr(self) 55 # characters to replace unicode characters with

Join the discussion →

Enable TLS 1.2 for specific Ciphers

We have a .NET application which calls an API that allows only TLS version 1.2. Server 2008 SP2. We ran following script on our server: # Copyright 2016, Alexander Hass # http://www.hass.de/content/setup-your-iis-ssl-perfect-forward-secrecy-and-tls-12 # # Version 1.7 # - Windows Version compare failed. Get-CimInstance requires Windows 2012 or later. # Version 1.6 # - OS version detection for cipher suites order. # Version 1.5 # - Enabled ECDH and more secure hash functions and reorderd cipher list. # - Added Client setting for all ciphers. # Version 1.4 # - RC4 has been disabled. # Version 1.3

Join the discussion →

Manifest merger failed with multiple errors, see logs (unity3d, Android Studio 3.2)

I am trying to add unity3d module as an on demand dynamic delivery module in a native android app. I am getting 'Manifest merger failed with multiple errors' problem while I am trying to build the project.Below I have given code for two manifest files one is for the app module that is module with native android code that I am writing and the other manifest is the manifest generated by unity3d after exporting it as an android studio project. I have added the unity3d android studio project as module in my current project. The objective is to make the unity3d project as an on demand dynamic deliv

Join the discussion →

wp multisite: add new super admin

How to create new super admin with wp multisite? I have phpmyadmin access, admin wp-admin access, ftp access. I'm unable to find wp_users info from the database nor I'm not able to find user id from wp-admin to grant_super_admin(x); with functions.php Any idea how to crack this?

Join the discussion →

How to Group by and concatenate arrays in PostgreSQL

I have a table in PostgreSQL. I want to concatenate all the arrays(i.e. col) after grouping them by time. The arrays are of varying dimensions. | time | col | |------ |------------------ | | 1 | {1,2} | | 1 | {3,4,5,6} | | 2 | {} | | 2 | {7} | | 2 | {8,9,10} | | 3 | {11,12,13,14,15} | The result should be as follows: | time | col | |------ |------------------ | | 1 | {1,2,3,4,5,6} | | 2 | {7,8,9,10} | | 3 | {11,12,13,14,15} | What I have come up with so far is as follows: SELECT ARRAY(SELECT elem FROM tab, unnest(col) elem); But this does not do the grouping. It just takes the entire table and

Join the discussion →

Getting error "Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8" while publishing code metrics on SonarQube from VSTS Build machine

Getting error "Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8" while publishing code metrics on SonarQube from VSTS Build machine through build definition. find below sonar-project.properties file, sonar.projectBaseDir=$(Build.SourcesDirectory)/app sonar.verbose=true sonar.analysis.mode=publish sonar.sourceEncoding=UTF-8 sonar.sources=$(Build.SourcesDirectory)/app sonar.language=ts sonar.ts.tslint.projectPath=tsconfig.json sonar.ts.tslint.path=node_modules/tslint/bin/tslint sonar.ts.tslint.typeCheck=true sonar.exclusions=node_modules/** sonar.ts.coverage.lcovReportPath=$(Build.SourcesDirect

Join the discussion →

How does this work? "YNEOS"[(w%2)|(w<=2)::2]

I was just trying to solve this problem on Codeforces: Check whether it's possible to split a number w (1 ≤ w ≤ 100) into a sum of 2 even numbers. I solved the problem like this: w = int(input()) if (w-2)%2 == 0 and w > 2: print("YES") else: print("NO") Next, I looked at other solutions for the problem. Then I found this solution: w = int(input()) print("YNEOS"[(w%2)|(w<=2)::2]) It took half of the time than mine. Unfortunately I am not understanding: how it is working, and why it is faster than mine. I am a beginner in Python. So it would help me to get a proper explanation.

Join the discussion →

What does print("YNEOS"[(w%2)|(w<=2)::2])?

I was just trying to solve this problem on Codeforces: Check whether it's possible to split a number w (1 ≤ w ≤ 100) into a sum of 2 even numbers. I solved the problem like this: n = int(input()) if (n-2)%2 == 0 and n > 2: print("YES") else: print("NO") Next, I looked at other solutions for the problem. Then I found this solution: w = int(input()) print("YNEOS"[(w%2)|(w<=2)::2]) It took half of the time than mine. Unfortunately I am not understanding: how it is working, and why it is faster than mine. I am a beginner in Python. So it would help me to get a proper explanation.

Join the discussion →

Gutenberg - Multiple InnerBlocks in one block-type

I am trying to make custom columns block since the wordpress default used by gutenberg is not what I need. So i have looked up how it works, its uses InnerBlocks block with a layout definition, but there is no way to specify the html tag and the class for the columns so it's useless for me. Then I have decided to loop out columns using map, which works fine, then i added inside each column the InnerBlocks component to allow inserting other blocks to the column, but the problem is that in each column the content of InnerBlocks is shared, so I have tried to set key property for each InnerBlock a

Join the discussion →

Is there any possible using tag inside tag

have tried to add two texts in an option tag where the two text should be in different color. However, the below code is not working fine.. Kindly assist me what should I added in this css or js.. Also suggest me if there is any plugin to use. <select name="dropdown" title="Corporate Select" class="custom-select" id="target" aria-label="Corporate Select"> <option selected>Select</option> <option value="">Offers<span class="calc">New </span></option> <option value="">Discounts<span class="calc">New </span></option> </select> <style> option span.calc { color: red; } </style>

Join the discussion →

Oracle Job Scheduler cannot stop running Job

We have an issue in one of our production databases which I cannot find a solution for. One of our Jobs is stuck in the RUNNING state and attempting to stop it produces a ORA-27366: job "NameSpace"."Some_Job" is not running. Querying the DBA_SCHEDULER_JOBS table have the job listed as RUNNING, but what's odd is that The Next_Run_Date is greater than the Last_Start_Date by about 10 minutes. Attempting to stop the job by using: -- Stop Job BEGIN DBMS_SCHEDULER.STOP_JOB(job_name => 'NameSpace.SomeJob', force => TRUE); DBMS_OUTPUT.PUT_LINE('Stopped Job - SUCCESS'); EXCEPTION WHEN OTHERS THEN DBMS_

Join the discussion →

NodeJS, getting username of logged in user within route

I am getting in to NodeJS and have followed some video tutorials for making stuff, to understand NodeJS and Express. It turned more in to copying as little were explained, so tried to make my own thing using what I learned and so on. Making a simple login function with PassportJS, ExpressJs and Mongoose. The login and stuff works, and I can get the username of the currently logged in user and display it if I define it within the main app.js using this: app.get("/stuff", (req,res) => { res.render("stuff.html", {username:req.user.username}); }); Now if I want to make nice and structured by using

Join the discussion →

stream.ReadTimeout' threw an exception of type 'System.InvalidOperationException'

I am trying to download a zip file from SFTP and unzip in the memory to process the file I am using SSH.Net to download the file. private static void processfilesfromftp(List<TSOracleMicrosDownLoadSetUp> list) { SftpClient sftp = HelperFunctions.GetClientConnection(); if(sftp.IsConnected) { var files = sftp.ListDirectory("/"); ZipFile zips = new ZipFile(); string path = string.Empty; foreach(var file in files) { Stream unzippedEntryStream = new MemoryStream(); path = string.Format("/{0}", file.Name); //byte[] arr = sftp.ReadAllBytes(file.FullName); var stream = new BufferedStream(sftp.OpenRead

Join the discussion →

No qualifying bean of type [org.springframework.test.web.servlet.MockMvc] found for dependency:

I am trying to run test cases on my spring controllers. I get the following error. No qualifying bean of type [org.springframework.test.web.servlet.MockMvc] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations After reading several QA's on SO, I got my build.gradle right. But now Im stuck at this point. The other questions on SO related to this did not help identify an issue with the code below. package test.controllers; import static org.hamcrest.Matchers.equalTo; import static org.springframework.test.web.servlet.res

Join the discussion →

NuGet "Unable to find package" for local source

This has worked previously, and now it doesn't. Maybe because I upgraded Visual Studio to 15.7.4, maybe because I completely replaced the project that provides the local package source, maybe ... yes, who knows? Here's the setup for my local source. (I've temporarily deselected nuget.org to try to reduce confusion - in vain.) The path to the local NuGet package must be correct because when I select my local package source the package gets displayed with the correct version info. But when I select a project and click Install it displays the following output: Restoring packages for E:\Roslyn\356

Join the discussion →

Converting docx to pdf with pure python (on linux, without libreoffice)

I'm dealing with a problem trying to develop a web-app, part of which converts uploaded docx files to pdf files (after some processing). With python-docx and other methods, I do not require a windows machine with word installed, or even libreoffice on linux, for most of the processing (my web server is pythonanywhere - linux but without libreoffice and without sudo or apt install permissions). But converting to pdf seems to require one of those. From exploring questions here and elsewhere, this is what I have so far: import subprocess try: from comtypes import client except ImportError: client

Join the discussion →

Why network-first strategy is slower than no service worker?

While benchmarking performance of service worker with workbox, we found an interesting phenomena. When service worker is applied, network-first strategy of workbox takes about 30 ms slower than no service worker networking. Then, we tried to skip workbox and implement network-first strategy manually, it is about 20ms slower. My guess is that, if service worker kicks in, all request has to be handled by javascript code. It is the execution of JavaScript code that make the networking slower. Then, I checked cache-first strategy, it turns out that fetching content from cache-storage is slower tha

Join the discussion →

Controlling RGB LED Light with Raspberry Pi and Python

I bought this LED light on ebay. The model is CJMCU-KZQ. My question is, how can I get it to work on a raspberry pi and python? I have looked everywhere but cannot find any documentation for it. Also, keep in mind that this light uses SDA/SCL I2C bus.

Join the discussion →

Full centering component

I would like to know if there is a component that allows me to center vertical/horizontal anything I want without writing custom CSS? I have tried react-center and react-flexbox-grid but without any success. It would be nice if there is some component that allows me to set how I want to align both horizontal and vertical trough properties. EDIT: This is the code I have: import React from 'react'; import {InputGroup, InputGroupAddon, Input, Button} from 'reactstrap'; import {Row, Col} from 'react-flexbox-grid'; import FlexView from 'react-flexview'; class Login extends React.Component{ render()

Join the discussion →

How do I have calculations done when everything is in a string?

On this calculator project, when a number button is pressed I have it saved in an array: @IBAction func buttonPressed(_ sender: UIButton) { if numBtnPressed == true { numArray.append(sender.title(for: .normal)!) } } If the button labeled 1 is pressed it stores ["1"] as a string in the empty array numArray. I have a separate structure for operators: struct calcFuncs { var add : String var subtract : String var divide : String var multiply : String } var calc = calcFuncs(add: "+", subtract: "-", divide: "/", multiply: "x") How do I, with a string of numbers and operators (1 + 2 x 3 + 4 / 5 + 5),

Join the discussion →

For Calculator in Swift

Just gonna warn you, I'm brand new to swift and I'm still getting used to how this works. I've been trying to work on this Calculator project for class. The problem is, I need practice simplifying code. Right now, when a number button is pressed, I have it saved in an array like this. @IBAction func buttonPressed(_ sender: UIButton) { if numBtnPressed == true { numArray.append(sender.title(for: .normal)!) } } so if the button labeled 1 is pressed, it stores ["1"] as a string in the empty array numArray I have a separate structure for operators in case I need it. struct calcFuncs { var add : St

Join the discussion →

How to stream trades from Binance web socket API in Node.js?

I am trying to use the Binance API to get the latest trades on a crypto-currency pair. Here is the endpoint to the API, say for BTC/USDT: wss://stream.binance.com:9443/ws/btcusdt@trade I tested this API on https://www.websocket.org/echo.html, and was successful in getting a continuous stream of new trades. How do I use this API in Node.js to continuously output the trades on the console? Is there any specific library or package you recommend?

Join the discussion →

BLE cadence characteristic parsing iOS bluetooth Swift

I am trying to create an iOS app that reads a cadence sensor (Wahoo fitness cadence). This is bluetooth characteristic 0x2A5B (CSC Measurement). In this example, cadence is how fast the pedals rotate on a bike. I am using the code below in Swift to read the characteristic from the sensor: Version 1: private func cadence(from characteristic: CBCharacteristic) -> Int { guard let characteristicData = characteristic.value else {return -1 } let byteArray = [UInt8](characteristicData) print(byteArray) let firstBitValue = byteArray[1] & 0x01 //set bit 1 (not 0) if firstBitValue == 1 { //IF crank revo

Join the discussion →

Form validation before submit data to SharePoint list (PowerApps)

I have a form created in PowerApps. Few fields are required for user to fill in. I need to have a form validation before user can click Submit button. Upon submit button: - All required are fill in - All data saved to SharePoint list - Navigate to 'Thank you' page I have this link in 'OnSelect' for Submit button If((IsEmpty(Data1, Data2), SubmitForm(Form), Navigate(ThankYouPage, Fade)), false) But it just navigate to Thank you page even required fields are empty. Looking forward to your responses. Thanks in advance!

Join the discussion →

Datatable lento ao carregar muitos resultados

Tenho um banco de dados com uns 500 registros com pedidos do sistema, porem preciso exibir esses registros no DataTable para melhor organização e pesquisa. Ao carregar a pagina ele demora muito para exibir os dados no DataTable. PHP: <div class="table-responsive"> <table id="pedidosTable" class="table table-striped table-bordered display"> <thead> <tr> <th>Nº</th> <th>Nome do Cliente</th> <th class="d-none">Telefone </th> <th class="d-none">Email</th> <th>D. Inicial</th> <th>D. atuali.</th> <th>Situação</th> <th>Responsavel</th> <th>Valor</th> </tr> </thead> <tbody> <?php while($rowsPedidos =

Join the discussion →
Older stories