Questions tagged as 'nodejs'

2
answers

run example from github library

I'm trying to try a library link this is the code which is on the page // include the library <script src="./svmjs/lib/svm.js"></script> <script> data = [[0,0], [0,1], [1,0], [1,1]]; labels = [-1, 1, 1, -1]; svm = new sv...
asked by 24.11.2016 / 01:40
1
answer

Insert data into an array inside a json

I need to store data in an array that is inside a json, that is, I will have several users that will have data let nombresUsuarios={ datos:[{nombre :''}, {acierto:''}, {fallo :''}]...
asked by 08.01.2017 / 07:18
2
answers

Restart NodeJS server with every change in the index?

I have mounted a Parse Server on an ubuntu, and every time I add a modification to the index.js I have to restart, which takes 4 or 5 seconds to come back to life. Is there a more optimal way to add changes without dropping the server?     
asked by 10.07.2016 / 12:56
3
answers

How to travel with foreach backwards forward

I am doing a blog and I would like the blog entries to be shown from the newest to the oldest, I was wondering if there is any way to go back and forth with a foreach. The code I have now is this: <% blogs.forEach(function(blog){ %> &...
asked by 16.04.2018 / 14:29
1
answer

return true or false from a function that is inside another function in nodejs

This function is to detect if there were no errors at the time of deleting the records but I call it from another function as well if(!deleteAllSectionsPage(123) ) { //alguna accion. } I have function deleteAllSectionsPage(idpage) {...
asked by 02.04.2018 / 05:29
2
answers

Angular-Cli clear cache

I am making changes to a project generated with angular-cli but it seems that I am hanging some file in cache and node does not realize it and keeps sending me an error message ERROR in D:/Workspace/NodeJs/TrackEditor/src/app/pages/pages/p...
asked by 11.04.2017 / 20:25
2
answers

Django urls.py error

Good morning, I am trying to put the 'MEDIA_ROOT' in 'urls.py' but when I run the 'runserver' I get the following error:    File   "C: \ Users \ Manux \ Desktop \ pd110 \ lib \ site-packages \ django \ conf \ urls \ static.py",   line 24, in...
asked by 31.03.2017 / 16:33
1
answer

Load source into a .ttf file from JavaScript

I am trying to add a source to my project, the issue is that I need to do everything from JS, how do I load a source from a .ttf file? since to apply the font-family I need the font to be already loaded (since apparently it only receives as para...
asked by 27.11.2016 / 01:17
1
answer

how to iterate an object in nodejs

I did this function: const obj = [{id: 'a', time: 1}, {id: 'a', time: 2}, {id: 'b', time: 1}]; const objMapped = obj.reduce((acc, item) => { let { id, time } = item; acc[id] = acc[id] || []; acc[id].push(time); return acc; }, {});...
asked by 20.09.2016 / 16:24
1
answer

convert array to Map in javascript

I want to convert an array to Map (), in this console "console.log (arrayParaMap);" sale undefined the example I use is this // example {a: 1, a: 2, a: 1, b: 1, b: 5, b: 6} the map I intend to obtain is [a, {1,2,1}                               ...
asked by 17.09.2016 / 03:10