Wednesday, October 27, 2021

Recent Questions - Stack Overflow

Recent Questions - Stack Overflow

Recent Questions - Stack Overflow


electron-builder error related to node-gyp

Posted: 27 Oct 2021 07:49 AM PDT

I'm having an error whenever I try building my app with Electron.

I didn't have this issue until last week or so, It was working fine before, it suddenly stopped working.

I didn't understand the issue so I reinstalled my OS and everything on the computer, but it didn't change anything. I found some messages on the terminal telling me to install python, then VSCode with C++ for desktop applications, I did, then the error changed and I don't see any way to fix it any further.

This is my package.json, im running 'npm run build':

{    "name": "reactron",    "version": "0.1.0",    "private": true,    "dependencies": {      "@szhsin/react-menu": "^1.8.0",      "brace": "^0.11.1",      "electron-is-dev": "^1.1.0",      "fs-extra": "^10.0.0",      "gpu.js": "^2.11.4",      "gsap": "^3.4.0",      "howler": "^2.1.3",      "jsoneditor": "^9.5.6",      "jsoneditor-react": "^3.1.1",      "node-sass": "^4.14.1",      "react-draggable": "^4.4.3",      "react-json-editor-ajrm": "^2.5.13",      "react-xarrows": "^1.5.2",      "vanilla-picker": "^2.11.2"    },    "main": "public/electron.js",    "homepage": "./",    "scripts": {      "react-start": "react-scripts start",      "react-build": "react-scripts build",      "react-test": "react-scripts test --env=jsdom",      "react-eject": "react-scripts eject",      "electron-build": "electron-builder",      "build-electron": "mkdir build/src && robocopy electron build/electron /S & robocopy src/shared build/src/shared /S",      "release": "npm run react-build && electron-builder --publish=always",      "build": "npm run react-build && npm run electron-build",      "start": "concurrently \"cross-env BROWSER=none npm run react-start\" \"wait-on http://localhost:3000 && electron .\""    },    "eslintConfig": {      "extends": "react-app"    },    "browserslist": {      "production": [        ">0.2%",        "not dead",        "not op_mini all"      ],      "development": [        "last 1 chrome version",        "last 1 firefox version",        "last 1 safari version"      ]    },    "devDependencies": {      "@reduxjs/toolkit": "^1.3.6",      "@testing-library/jest-dom": "^4.2.4",      "@testing-library/react": "^9.5.0",      "@testing-library/user-event": "^7.2.1",      "concurrently": "^5.1.0",      "cross-env": "^7.0.2",      "electron": "^8.1.1",      "electron-builder": "^22.13.1",      "electron-packager": "^14.2.1",      "electron-react-devtools": "^0.5.3",      "react": "^16.13.0",      "react-dom": "^16.13.0",      "react-indiana-drag-scroll": "^1.8.0",      "react-redux": "^7.2.0",      "react-scripts": "^3.4.3",      "redux": "^4.0.5",      "wait-on": "^4.0.1"    },    "build": {      "asar": false    }  }  

And this is the output:

> reactron@0.1.0 electron-build C:\Users\Toqu\Documents\_works\reactron  > electron-builder      • electron-builder  version=22.13.1 os=10.0.19043    • loaded configuration  file=package.json ("build" field)    • loaded parent configuration  preset=react-cra    • description is missed in the package.json  appPackageFile=C:\Users\Toqu\Documents\_works\reactron\package.json    • author is missed in the package.json  appPackageFile=C:\Users\Toqu\Documents\_works\reactron\package.json    • writing effective config  file=dist\builder-effective-config.yaml    • rebuilding native dependencies  dependencies=gl@4.9.2, node-sass@4.14.1 platform=win32 arch=x64    • install prebuilt binary  name=gl version=4.9.2 platform=win32 arch=x64 napi=    • build native dependency from sources  name=gl                                            version=4.9.2                                            platform=win32                                            arch=x64                                            napi=                                            reason=prebuild-install failed with error (run with env DEBUG=electron-builder to get more information)                                            error=prebuild-install info begin Prebuild-install version   5.3.6      prebuild-install WARN install prebuilt binaries enforced with --force!      prebuild-install WARN install prebuilt binaries may be out of date!      prebuild-install info looking for cached prebuild @ C:\Users\Toqu\AppData\Roaming\npm-cache\_prebuilds\370169-gl-v4.9.2-electron-v76-win32-x64.tar.gz      prebuild-install http request GET https://github.com/stackgl/headless-gl/releases/download/v4.9.2/gl-v4.9.2-electron-v76-win32-x64.tar.gz      prebuild-install http 404 https://github.com/stackgl/headless-gl/releases/download/v4.9.2/gl-v4.9.2-electron-v76-win32-x64.tar.gz      prebuild-install WARN install No prebuilt binaries found (target=8.5.5 runtime=electron arch=x64   libc= platform=win32)      ⨯ cannot execute  cause=exit status 1                      out=      > gl@4.9.2 install C:\Users\Toqu\Documents\_works\reactron\node_modules\gl      > prebuild-install || node-gyp rebuild          C:\Users\Toqu\Documents\_works\reactron\node_modules\gl>if not defined npm_config_node_gyp (node   "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )      Building the projects in this solution one at a time. To enable parallel build, please add the "-m" switch.        Copying C:\Users\Toqu\Documents\_works\reactron\node_modules\gl/deps/windows/dll/x64/libEGL.dll to C:\Users\Toqu\Documents\_works\reactron\node_modules\gl\build\Release\libEGL.dll                1 file(s) copied.        Copying C:\Users\Toqu\Documents\_works\reactron\node_modules\gl/deps/windows/dll/x64/libGLESv2.dll to C:\Users\Toqu\Documents\_works\reactron\node_modules\gl\build\Release\libGLESv2.dll                1 file(s) copied.        Copying C:\Users\Toqu\Documents\_works\reactron\node_modules\gl/deps/windows/dll/x64/d3dcompiler_47.dll to C:\Users\Toqu\Documents\_works\reactron\node_modules\gl\build\Release\d3dcompiler_47.dll                 1 file(s) copied.        bindings.cc        webgl.cc        procs.cc        win_delay_load_hook.cc      C:\Users\Toqu\.electron-gyp\8.5.5\include\node\v8.h(8923,39): warning C4996: 'v8::MicrotasksCompletedCallback': Use *WithData version. (compiling source file ..\src\native\procs.cc) [C:\Users\Toqu\Documents\_works\reactron\node_modules\gl\build\webgl.vcxproj]      C:\Users\Toqu\.electron-gyp\8.5.5\include\node\v8.h(8931,42): warning C4996: 'v8::MicrotasksCompletedCallback': Use *WithData version. (compiling source file ..\src\native\procs.cc) [C:\Users\Toqu\Documents\_works\reactron\node_modules\gl\build\webgl.vcxproj]      C:\Users\Toqu\.electron-gyp\8.5.5\include\node\v8.h(8923,39): warning C4996: 'v8::MicrotasksCompletedCallback': Use *WithData version. (compiling source file ..\src\native\bindings.cc) [C:\Users\Toqu\Documents\_works\reactron\node_modules\gl\build\webgl.vcxproj]      C:\Users\Toqu\.electron-gyp\8.5.5\include\node\v8.h(8931,42): warning C4996: 'v8::MicrotasksCompletedCallback': Use *WithData version. (compiling source file ..\src\native\bindings.cc) [C:\Users\Toqu\Documents\_works\reactron\node_modules\gl\build\webgl.vcxproj]      C:\Users\Toqu\.electron-gyp\8.5.5\include\node\v8.h(8923,39): warning C4996: 'v8::MicrotasksCompletedCallback': Use *WithData version. (compiling source file ..\src\native\webgl.cc) [C:\Users\Toqu\Documents\_works\reactron\node_modules\gl\build\webgl.vcxproj]      C:\Users\Toqu\.electron-gyp\8.5.5\include\node\v8.h(8931,42): warning C4996: 'v8::MicrotasksCompletedCallback': Use *WithData version. (compiling source file ..\src\native\webgl.cc) [C:\Users\Toqu\Documents\_works\reactron\node_modules\gl\build\webgl.vcxproj]      C:\Users\Toqu\Documents\_works\reactron\node_modules\gl\src\native\webgl.cc(466,37): warning C4312: 'reinterpret_cast': conversion from 'GLint' to 'GLvoid *' of greater size [C:\Users\Toqu\Documents\_works\reactron\node_modules\gl\build\webgl.vcxproj]           Creating library C:\Users\Toqu\Documents\_works\reactron\node_modules\gl\build\Release\webgl.lib and object C:\Users\Toqu\Documents\_works\reactron\node_modules\gl\build\Release\webgl.exp            webgl.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class std::shared_ptr<class v8::BackingStore> __cdecl v8::ArrayBuffer::GetBackingStore(void)" (__imp_?GetBackingStore@ArrayBuffer@v8@@QEAA?AV?$shared_ptr@VBackingStore@v8@@@std@@XZ) referenced in function "public:   __cdecl Nan::TypedArrayContents<char>::TypedArrayContents<char>(class v8::Local<class v8::Value>)" (??0?$TypedArrayContents@D@Nan@@QEAA@V?$Local@VValue@v8@@@v8@@@Z) [C:\Users\Toqu\Documents\_works\reactron\node_modules\gl\build\webgl.vcxproj]      C:\Users\Toqu\Documents\_works\reactron\node_modules\gl\build\Release\webgl.node : fatal error LNK1120: 1 unresolved externals [C:\Users\Toqu\Documents\_works\reactron\node_modules\gl\build\webgl.vcxproj]                        errorOut=prebuild-install WARN install No prebuilt binaries found (target=8.5.5 runtime=electron arch=x64 libc= platform=win32)      gyp ERR! build error      gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1      gyp ERR! stack     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)      gyp ERR! stack     at ChildProcess.emit (events.js:400:28)      gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:282:12)           gyp ERR! System Windows_NT 10.0.19043      gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"      gyp ERR! cwd C:\Users\Toqu\Documents\_works\reactron\node_modules\gl      gyp ERR! node -v v14.18.1      gyp ERR! node-gyp -v v5.1.0      gyp ERR! not ok      npm ERR! code ELIFECYCLE      npm ERR! errno 1      npm ERR! gl@4.9.2 install: `prebuild-install || node-gyp rebuild`      npm ERR! Exit status 1      npm ERR!      npm ERR! Failed at the gl@4.9.2 install script.      npm ERR! This is probably not a problem with npm. There is likely additional logging output above.        npm ERR! A complete log of this run can be found in:      npm ERR!     C:\Users\Toqu\AppData\Roaming\npm-cache\_logs\2021-10-27T14_22_32_528Z-debug.log                            command='C:\Program Files\nodejs\node.exe' 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js' rebuild gl@4.9.2 node-sass@4.14.1                      workingDir=  npm ERR! code ELIFECYCLE  npm ERR! errno 1  npm ERR! reactron@0.1.0 electron-build: `electron-builder`  npm ERR! Exit status 1  npm ERR!   npm ERR! Failed at the reactron@0.1.0 electron-build script.  npm ERR! This is probably not a problem with npm. There is likely additional logging output above.       npm ERR! A complete log of this run can be found in:  npm ERR!     C:\Users\Toqu\AppData\Roaming\npm-cache\_logs\2021-10-27T14_22_32_631Z-debug.log          npm ERR! code ELIFECYCLE  npm ERR! errno 1  npm ERR! reactron@0.1.0 build: `npm run react-build && npm run electron-build`  npm ERR! Exit status 1  npm ERR!  npm ERR! Failed at the reactron@0.1.0 build script.  npm ERR! This is probably not a problem with npm. There is likely additional logging output above.       npm ERR! A complete log of this run can be found in:  npm ERR!     C:\Users\Toqu\AppData\Roaming\npm-cache\_logs\2021-10-27T14_22_32_666Z-debug.log  

Does anyone know how to solve this?

"locationError.config()" returns a NameError in my Python code

Posted: 27 Oct 2021 07:49 AM PDT

I'm making this simple Youtube downloader software, but locationError is underlined in red and when I run the code it retuns this error:

    locationError.config(text=Folder_Name, fg="green")  NameError: name 'locationError' is not defined  

However, when I copy and paste the same code (the whole code, not just the block that includes locationError line) from the tutorial everything works fine and no errors are given at all.

Code:

from tkinter import *  from tkinter import ttk  from tkinter import filedialog  from pytube import YouTube    Folder_Name = ""    def open_location():      global Folder_Name      Folder_Name = filedialog.askdirectory()      if (len(Folder_Name) > 1):          locationError.config(text=Folder_Name, fg="green")        else:          locationError.config(text="Please specify a folder!", fg="red")      def download_youtube():      choice = quality.get()      url = url_box.get()        if (len(url) > 1) and "youtube".encode() in url:          url_error.config(text="")          yt = YouTube(url)            if choice == choices[0]:              select = yt.streams.get_highest_resolution()          elif choice == choices[1]:              select = yt.streams.filter(progressive=True,file_extension='mp4').last()          elif choice == choices[2]:              select = yt.streams.filter(only_audio=True).first()            else:              url_error.config(text="Paste link again", fg="red")        select.download(Folder_Name)      url_error.config(text="Download completed!")    root = Tk()    root.title("Youtube Downloader")  root.geometry("350x400")  root.columnconfigure(0, weight=1)    space = Label(text="")  space.grid()  url_label = Label(root, text="Enter URL of the video",  font=("jost", 9, "bold"))  url_label.grid()    EntryVar = StringVar()  url_box = Entry(root, width=50, textvariable=EntryVar)  url_box.grid()      url_error = Label(root, text="URL Error", fg="red", font=("jost", 9, "bold"))  url_error.grid()    space = Label(text="")  space.grid()    path_label = Label(root, text="Save the video file", font=("jost", 9, "bold"))  path_label.grid()    path_btn = Button(root, width=10,bg="green", fg="white", text="Choose Path", command=open_location)  path_btn.grid()    path_url = Label(root, text="Path Error", fg="red", font=("jost", 9, "bold"))  path_url.grid()    space = Label(text="")  space.grid()  quality_label = Label(root, text="Select quality", font=("jost", 9, "bold"))  quality_label.grid()    choices = ["Highest", "Lowest", "Audio"]  quality = ttk.Combobox(root, values=choices)  quality.grid()    space = Label(text="")  space.grid()  space = Label(text="")  space.grid()  download_btn = Button(width=15, height=2, bg="green", fg="white", text="Download", font=("bold"), command=download_youtube)  download_btn.grid()    for i in range(0,2):      space = Label(text="")      space.grid()    dev_label = Label(root, text="Developed by Totenkopf 💀", bg="black", fg="red", font=("jost", 11))  dev_label.grid()    root.mainloop()  

Strange behaviour: if( takes boolean false

Posted: 27 Oct 2021 07:48 AM PDT

Hi I'm writing a firebase cloud function to send an email if the user wants to receive emails. The problem is, that with userData.notifications.emails true or false, it always sends the email. With false the log shows:

Send Emails YES: false   
 if (userData?.notifications?.emails) {         functions.logger.log('Send Emails YES: ' + userData.notifications.emails);         admin.firestore().collection(`emails`).add({               to: email,               message: {                 subject: subject,                 html: text,               }          })   }   else {        functions.logger.log('Don't send Email')   }  

Gray the card on click in Bootstrap

Posted: 27 Oct 2021 07:48 AM PDT

A common function in infinite list is that, the item will be grayed after when we clicked on him. Can we get this effect with only HTML, CSS, JS, jQuery(on the user's side)?

How it works?

1.) the user clicks on the card element enter image description here 2.) When pressed, class text-muted is added to the card element, causing it to be grayed out as below enter image description here

The simplest example of code in bootarap looks like this:

  {% for obj in objects %}    <a href="/detail/id/" target="_blank">      <div class="card" id="card{{ obj.id }}">        <!--..content card..-->      </div>    </a>    {% endfor %}  

Unable to install spicy (and scikit-learn)

Posted: 27 Oct 2021 07:48 AM PDT

I am trying to install scipy (and scikit-learn) on my Mac. I already have numpy installed so this is what I have done:

pip3 install spicy  

Unfortunately I am getting a huge error:

Failed to build scipy  Installing collected packages: scipy      Running setup.py install for scipy ... error      ERROR: Command errored out with exit status 1:       command: /Library/Developer/CommandLineTools/usr/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/gh/hgbtzhqd5xv5rwqj0snp33qm0000gn/T/pip-install-jgly5cty/scipy_27e69cc659614845a206f15ddd2d7331/setup.py'"'"'; __file__='"'"'/private/var/folders/gh/hgbtzhqd5xv5rwqj0snp33qm0000gn/T/pip-install-jgly5cty/scipy_27e69cc659614845a206f15ddd2d7331/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/gh/hgbtzhqd5xv5rwqj0snp33qm0000gn/T/pip-record-44zbzkef/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /Users/alessandroquirile/Library/Python/3.8/include/python3.8/scipy           cwd: /private/var/folders/gh/hgbtzhqd5xv5rwqj0snp33qm0000gn/T/pip-install-jgly5cty/scipy_27e69cc659614845a206f15ddd2d7331/      Complete output (97 lines):            Note: if you need reliable uninstall behavior, then install      with pip instead of using `setup.py install`:              - `pip install .`       (from a git repo or downloaded source                                 release)        - `pip install scipy`   (last SciPy release on PyPI)                  Running from scipy source directory.      lapack_opt_info:      lapack_mkl_info:      customize UnixCCompiler        libraries mkl_rt not found in ['/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib', '/usr/lib']        NOT AVAILABLE            openblas_lapack_info:        libraries openblas not found in ['/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib', '/usr/lib']        NOT AVAILABLE            openblas_clapack_info:        libraries openblas,lapack not found in ['/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib', '/usr/lib']        NOT AVAILABLE            flame_info:        libraries flame not found in ['/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib', '/usr/lib']        NOT AVAILABLE            accelerate_info:        NOT AVAILABLE            atlas_3_10_threads_info:      Setting PTATLAS=ATLAS        libraries lapack_atlas not found in /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib        libraries tatlas,tatlas not found in /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib        libraries lapack_atlas not found in /usr/lib        libraries tatlas,tatlas not found in /usr/lib      <class 'numpy.distutils.system_info.atlas_3_10_threads_info'>        NOT AVAILABLE            atlas_3_10_info:        libraries lapack_atlas not found in /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib        libraries satlas,satlas not found in /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib        libraries lapack_atlas not found in /usr/lib        libraries satlas,satlas not found in /usr/lib      <class 'numpy.distutils.system_info.atlas_3_10_info'>        NOT AVAILABLE            atlas_threads_info:      Setting PTATLAS=ATLAS        libraries lapack_atlas not found in /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib        libraries ptf77blas,ptcblas,atlas not found in /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib        libraries lapack_atlas not found in /usr/lib        libraries ptf77blas,ptcblas,atlas not found in /usr/lib      <class 'numpy.distutils.system_info.atlas_threads_info'>        NOT AVAILABLE            atlas_info:        libraries lapack_atlas not found in /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib        libraries f77blas,cblas,atlas not found in /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib        libraries lapack_atlas not found in /usr/lib        libraries f77blas,cblas,atlas not found in /usr/lib      <class 'numpy.distutils.system_info.atlas_info'>        NOT AVAILABLE            lapack_info:        libraries lapack not found in ['/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib', '/usr/lib']        NOT AVAILABLE            /Users/alessandroquirile/Library/Python/3.8/lib/python/site-packages/numpy/distutils/system_info.py:1858: UserWarning:          Lapack (http://www.netlib.org/lapack/) libraries not found.          Directories to search for the libraries can be specified in the          numpy/distutils/site.cfg file (section [lapack]) or by setting          the LAPACK environment variable.        return getattr(self, '_calc_info_{}'.format(name))()      lapack_src_info:        NOT AVAILABLE            /Users/alessandroquirile/Library/Python/3.8/lib/python/site-packages/numpy/distutils/system_info.py:1858: UserWarning:          Lapack (http://www.netlib.org/lapack/) sources not found.          Directories to search for the sources can be specified in the          numpy/distutils/site.cfg file (section [lapack_src]) or by setting          the LAPACK_SRC environment variable.        return getattr(self, '_calc_info_{}'.format(name))()        NOT AVAILABLE            Traceback (most recent call last):        File "<string>", line 1, in <module>        File "/private/var/folders/gh/hgbtzhqd5xv5rwqj0snp33qm0000gn/T/pip-install-jgly5cty/scipy_27e69cc659614845a206f15ddd2d7331/setup.py", line 492, in <module>          setup_package()        File "/private/var/folders/gh/hgbtzhqd5xv5rwqj0snp33qm0000gn/T/pip-install-jgly5cty/scipy_27e69cc659614845a206f15ddd2d7331/setup.py", line 488, in setup_package          setup(**metadata)        File "/Users/alessandroquirile/Library/Python/3.8/lib/python/site-packages/numpy/distutils/core.py", line 135, in setup          config = configuration()        File "/private/var/folders/gh/hgbtzhqd5xv5rwqj0snp33qm0000gn/T/pip-install-jgly5cty/scipy_27e69cc659614845a206f15ddd2d7331/setup.py", line 395, in configuration          raise NotFoundError(msg)      numpy.distutils.system_info.NotFoundError: No lapack/blas resources found. Note: Accelerate is no longer supported.      ----------------------------------------  ERROR: Command errored out with exit status 1: /Library/Developer/CommandLineTools/usr/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/gh/hgbtzhqd5xv5rwqj0snp33qm0000gn/T/pip-install-jgly5cty/scipy_27e69cc659614845a206f15ddd2d7331/setup.py'"'"'; __file__='"'"'/private/var/folders/gh/hgbtzhqd5xv5rwqj0snp33qm0000gn/T/pip-install-jgly5cty/scipy_27e69cc659614845a206f15ddd2d7331/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/gh/hgbtzhqd5xv5rwqj0snp33qm0000gn/T/pip-record-44zbzkef/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /Users/alessandroquirile/Library/Python/3.8/include/python3.8/scipy Check the logs for full command output.  

How can I solve? Python version is 3.8.9

how to looping numbers the first and last is disappear php

Posted: 27 Oct 2021 07:48 AM PDT

hay can you help me? i have the question in php loop what i will do for the looping like this

enter image description here

im try code like this

        $number = $this->input->post('number');                    for ($i=1; $i<=$number; $i++){              for ($j=$i; $j<=$number; $j++){              echo $j;              }              echo "<br>";          }  

im very appreciate for your answer thankyou

Main.java uses or overrides a deprecated API error

Posted: 27 Oct 2021 07:48 AM PDT

Here is my code I use code chum as compiler. but I am having trouble with imports and API stating the errors below. any help is much appreciated.

import java.util.ArrayList;  import java.util.Scanner;     public class Main  {           public static void main(String[] args)       {                  Scanner sc = new Scanner(System.in);                  ArrayList<Character> list = new ArrayList<Character>();                  ArrayList<Integer> list2 = new ArrayList<Integer>();                  int cardSet = sc.nextInt();                  int sum = 0;                  for(int i = 0; i < cardSet; i++)                  {                          int cardNum = sc.nextInt();                          char cardChar = sc.next().charAt(0);                          list2.add(cardNum);                          list.add(cardChar);                   }                  int temp = sc.nextInt();                  int removeNum = temp - temp - temp;                  char removeChar = sc.next().charAt(0);                  list.remove(new Character(removeChar));                  list2.remove(new Integer(removeNum));                  for(int i = 0; i < list.size() - 1; i++)                  {                          if(list.get(i).equals(list.get(i + 1)))                          {                              sum = list2.get(i) + list2.get(i + 1);                              list2.set(i, sum);                              list2.remove(i + 1);                              list.remove(i + 1);                                                        }                                        }                  for(int i = 0; i < list.size(); i++)                  {                         String buffer = " -> ";                      if(i == list.size() - 1)                      {                          buffer = "";                      }                      System.out.print(list2.get(i) + " " + list.get(i));                      System.out.print(buffer);                  }      }        }  

this is the result when I compile it.

Note: Main.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details.

big thanks in advance :)

How to get maximum value after groupby mysql

Posted: 27 Oct 2021 07:48 AM PDT

Im trying to get a maximum value after im preforming a groupby clause.

select count(*) as count, store_id from sakila.customer  group by store_id  

my output for this code is:

count store_id
326 1
273 2

how can i get a max value from the count column? i tried several things and nothing seems to work.

RTP Parse H264 Embedded (Interleaved) Binary Data (RTP/AVP/TCP) to get NAL Units

Posted: 27 Oct 2021 07:48 AM PDT

Hey Guys

I am strugle with parsing rtp payload/data from rtp packages to get h264 NAL Units (Source RTSP Axis Camera)

Parsing the header works but I dont find any NAL Unit after RTP Header.

Parsing the header according to RFC 2326 10.12

  as_bitstream = BitStream(socket.recv(4096)) # from bitstring import BitStream    if as_bitstream.read(8) == "0x24:           # check if package start with $ (0x24)        channel_identifier = as_bitstream.read("uint:8")        length = as_bitstream.read("uint:16")        version = as_bitstream.read("uint:2")        padding = as_bitstream.read("uint:1")        extension = as_bitstream.read("uint:1")        csrc_count = as_bitstream.read("uint:4")        marker = as_bitstream.read("uint:1")        payload_type = as_bitstream.read("uint:7")        sequence_number = as_bitstream.read("uint:16")        timestamp = as_bitstream.read("uint:32")        ssrc = as_bitstream.read("uint:32")  

Parsed fields looks good to me and have correct values:

  • payload = 96
  • version = 2
  • sequence number is increasing.

Two questions:

  1. Are remeaing bytes after ssrc location the rtp payload if extension = 0 ?
  2. When a recived data starts with $ it is a RTP packed, I also recive data without a starting $ what is this ?
  3. Should every rtp packed include NAL Units?

Also I read this post Link but I am currios why there are no NAL units after the RTP Header.

Example RTP Package Dump (Google Drive)

I am new to these topic and maybe anyone can help me. Thank you

Is it possible use socat to open an existing tun device instead of creating a new one?

Posted: 27 Oct 2021 07:48 AM PDT

It is known that socat can create a tun device and open it to relay. But I wonder how can I use it to relay an existing tun interface? The tun0 is created by other script.

flutter remove tab bar for specific pages

Posted: 27 Oct 2021 07:48 AM PDT

Main Page (CategoryViewDetail) generating Tabbar and BottomNavigationBar and parsing JSON to NewsView Page.

My BottomNavigationBar has got 4 buttons and for 4th button I would like to remove the TabBar. This is again NewsView page but with different widget.id.

I would like to remove TabBar only for 4th button.

NewsView does not have any controller, it is only generating content according to widget.id.

Is there any way to do this?

VBA integrating FileExist() into loop before attachment.add link [duplicate]

Posted: 27 Oct 2021 07:48 AM PDT

current at work, I have a script where i would need help on the section involving the

Attachment.Add function in VBA

currently as the script loops

Attachment.Add link returns a runtime error message warning file doesnt exists and stalls up the script from moving forward

where link = cell(rows,44)

and cell that carries the link usually goes like this P:\test.pdf

im trying to find something similar to

If FileExist("Link") = True THEN attachment.add link end if

Rewrite TypeScript property to be optional via type merging

Posted: 27 Oct 2021 07:48 AM PDT

Is there a single way to make property of type optional via intersection for example?

I was thinking that if we have type T:

type T = {   x: string   y: string   z: string  }  

then:

T & { z?: string }  

would rewrite z property of T to become optional. But this is not the case.

How can I achieve, so z will be optional property?

Thanks.

Splitting class definition in .h and .cpp file [duplicate]

Posted: 27 Oct 2021 07:48 AM PDT

following standards, I splitted class definition in two files, these are they

fraction.h

#ifndef FRACTION_H  #define FRACTION_H    #include <string>  #include <cmath>  #include <climits>  using std::string;  using std::log10;  using std::ceil;      class fraction  {  private:      int __max_arr_len = (int)ceil(log10(__LONG_MAX__));      long numerator;      long denomenator;      string convertion(long _num);    public:      void reduce();      inline void set_numerator(long _new);      inline void set_denominator(long _new);      inline long get_numerator();      inline long get_denominator();      inline double get_fraction();      inline string get_str_fraction();      fraction(long _num, long _den);  };    

No comments:

Post a Comment