JavaScript

Topic: Anything JavaScript, ECMAScript including Node, React, ...
Jun 24, 2020 13:37
What are proper terms for classifying a media-related asset such as images, videos or copy text vs an asset that defines the flow of an application
Jun 24, 2020 13:34
Hello fellow software devs, I have a question not inherently related to js but software assets
Apr 6, 2020 15:38
with browser-env it wanted pretendToBeVisual set to true because it defaults to false
Apr 6, 2020 15:37
Yes, there are a few I was just not passing in the correct settings
Apr 6, 2020 15:14
That is why at the top of my class file I have the code above, if the global window instance is undefined then spoof it so that animation libraries can work
Apr 6, 2020 15:13
I am making a node module for easy DMX control over the network. I want to have an object that I can pass an ip address to and then use animejs to animate between colors. This module wants compatibility both inside the client side browser and inside a server side nodejs enviroment
Apr 6, 2020 15:06
if(typeof window == "undefined") {
    require('browser-env')({
        pretendToBeVisual: true
    });
}
Apr 6, 2020 15:06
For anyone following, this is how I have gotten AnimeJS to work inside NodeJS
Apr 6, 2020 15:01
So I want to create a server side script that can animate lights over the network. Running inside Node all animation libraries fail because requestAnimationFrame. I have tried using the browser-env node module but I have not had success
Apr 6, 2020 14:59
ArtNet is used to control DMX lights, I can set a DMX channel values over the network with this protocol
Apr 6, 2020 14:33
I want to make a Node Library that can easily run animations for a DMX controller over ARTNET
Apr 6, 2020 14:29
I want to animate something over a network connection using a nodejs script but AnimeJS needs the dom for requestAnimationFrame
Apr 6, 2020 14:28
Yeah, most animation libraries need to run inside the DOM for obvious reasons
Apr 6, 2020 14:27
Anyone know of a good nodejs animation library that can run outside of the DOM?
Jan 9, 2020 14:10
I have two screens stacked vertically that I need to render an electron app to. The displays are 1920 x 540 but only accept 1080 video signal so the screens only show the top half of the screen. I need to account for the bottom half of the screen missing and draw empty space there inside my app to make the software look seemless. Any ideas how to do this in HTML, JS and CSS?
Nov 14, 2019 18:53
For anyone that is curious: stackoverflow.com/questions/10473994/…
Nov 14, 2019 18:51
wait I dont understand
Nov 14, 2019 18:50
and 6.000000000000004 % 1 == 0 evaluates to false
Nov 14, 2019 18:50
How come 6.0000000000000004 % 1 == 0 evaluates to true
Nov 12, 2019 21:42
thanks man
Nov 12, 2019 21:39
did you just read my mind
Nov 12, 2019 21:37
Yeah I couldn't get .mov's to work
Nov 12, 2019 21:34
I have not
Nov 12, 2019 21:34
anyone know of a video format that supports an alpha layer that works in chrome? I cannot get my .mov videos to play in chrome.
Oct 9, 2019 21:22
Yeah I have been pulling my hair out
Oct 9, 2019 20:19
Tried everything suggested any no success
Oct 9, 2019 20:19
Oct 9, 2019 20:18
I implemented the solution originally with opencv4nodejs but there are a few problems. One is that it is a massive library for such a seemingly simple task. The second is that it fails to build when electron-rebuild is run (I am using this in an electron project)
Oct 9, 2019 19:50
:(
Oct 9, 2019 19:28
No but I have seen other people ask similar questions that don't have great answers
Oct 9, 2019 19:27
I am having no luck
Oct 9, 2019 19:16
is there any possible way to extract video data from a NodeJS process? More specifically I am trying to extract frame data from videos. I am looking for a single dimensional array of RGB data for every frame. I was using OpenCV4NodeJS but that is extreme overkill. Any ideas?
Oct 9, 2019 19:15
I have a question for you guys
Sep 10, 2019 15:07
Does anyone know of a good node.js package that caches network requests and uses the cache if the server is unresponsive?
Apr 18, 2019 16:19
soooooooooooooooooooooo readable
 

Python

Room rules: sopython.com/chatroom Code formatting guide: tinyu...
Feb 1, 2020 20:25
@AndrasDeak Yes you were, thank you!
Feb 1, 2020 20:08
I was able to get the mat using gray = cv2.cvtColor(imageShaped.astype(np.uint8), cv2.COLOR_GRAY2RGB)
Feb 1, 2020 19:17
I just want to convert my 1d bytearray to a cv2 mat
Feb 1, 2020 19:05
thats what i think it is actually returning
Feb 1, 2020 19:03
Feb 1, 2020 18:58
imdecode doesn't like that: OpenCV(4.1.2) C:\projects\opencv-python\opencv\modules\imgcodecs\src\loadsave.cpp:732: error: (-215:Assertion failed) buf.checkVector(1, CV_8U) > 0 in function 'cv::imdecode_
Feb 1, 2020 18:50
Null as in None
Feb 1, 2020 18:50
imageBuffer is a bytearry.
Feb 1, 2020 18:49
imageBuffer = camera.get_current_image()["buffer"]
imageData = np.asarray(imageBuffer, dtype=np.byte)
imageMat = cv2.imdecode(imageData, cv2.IMREAD_UNCHANGED)
Feb 1, 2020 18:47
I am trying to use cv2.imdecode but it always returns null
Feb 1, 2020 18:47
Haha that makes a lot of sense
Feb 1, 2020 18:45
anyone know how to display a <bytearray> with cv2?