« first day (3378 days earlier)      last day (1573 days later) » 

12:24 AM
Why is the bot pinging me?
 
It isn't. Go back to bed.
 
12:58 AM
there was another user with the same display name
 
hey sam o/
@ndugger Whats your experience with EME?
used it before? know it well?
 
hello :)
 
 
3 hours later…
4:21 AM
is this new
 
@tytyf Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
4:33 AM
How to change keys of array object using another array ?
 
5:05 AM
 
 
6 hours later…
10:50 AM
Ho
I'm using "jspdf": "^1.5.3" package in my "@angular/cli": "~7.0.7" project,

I have created simple file using pdf library as below, now the requirement is append http://www.africau.edu/images/default/sample.pdf pdf to my created jsPDF file & download it.
 
@AshD Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
1 message moved to Trash can
@AshD Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. Please separate code blocks from your actual question. Put your question in 1 message and then your code in a 2nd and format it. For posting large code blocks, use a paste site like like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
 
this is my code
//app.component.ts file
   <a (click)="download();">ClickHere</a>

//app.component.ts file
import * as jsPDF from 'jspdf'

download() {
  var doc = new jsPDF('p', 'pt', 'letter');
  var pageHeight = doc.internal.pageSize.height;
  var y = 800;
  var x = 800;
  doc.text(100, 100, 'com1');

  if (y >= pageHeight) {
    doc.addPage();
    doc.text(100, 100, 'com1');
    y = 0;
  }
  if (x >= pageHeight) {
    doc.addPage();
    doc.text(100, 100, 'com1');
    x = 0;
  }

  const merge = require('easy-pdf-merge');
 
 
4 hours later…
3:13 PM
Cordova is the worst tech ever
 
Luckily I haven't had too many issues with it, besides removing and re-adding platforms occasionally
 
how so?
 
 
2 hours later…
5:10 PM
How can I check if a folder path provided by the user is in another (root) folder in node?
 
6:09 PM
@JBis If you don't know where to start, you can use the filesystem built-in library nodejs.org/api/fs.html
 
Guys do you know how can I insert a float inside here? position: {lat: {{ latitude }}, lng: longitude} I get an error because of double curly brackets
its javascript
 
@DzITC Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
why are there double curly brackets?
 
cause I need to insert a value there
 
that's not what double curly braces do.
 
6:14 PM
{{ longitude }} *
How can I do that then?
 
remove them? your float value is contained in the longitude variable?
if that's the case, just remove them
let longitude = 23.92746;
let latitude = 283.274
let position = {lat: latitude, lng: longitude};
 
@FélixGagnon-Grenier I think I figured it out. Used a path.resolve with a String.startsWith()
 
I'm editing the position in google maps
I'm really green guys on javascript
wait ill show u the code
 
1 message moved to Trash can
@DzITC Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. Please separate code blocks from your actual question. Put your question in 1 message and then your code in a 2nd and format it. For posting large code blocks, use a paste site like like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
 
6:20 PM
`marker = new google.maps.Marker({
          map: map,
          draggable: false,
          title: '{{camera_name[0]}}',
          icon: "https://developers.google.com/maps/documentation/javascript/examples/full/images/info-i_maps.png",
          animation: google.maps.Animation.DROP,
          position: {lat: camera1_lat, lng: camera1_lat_log}
        });
        marker.addListener('click', function() {
          infowindow.open(map, marker);
        });`
 
@JBis interesting. without being too sure what you are trying to do, I would have tought something like is_file (other_root / filename) would have been correct?
@DzITC almost certainly you don't want the title to be the literal string "camera_name[0]", but rather the content of that. remove all these curly braces and single quotes
double curly braces are sometimes used in templating systems to denote variables, but in javascript code they do not mean that, they're actually not valid syntax afaik.
 
I have an list of many camera names that's why i use an list
 
yes, that's cool, that is not what I mean.
in JavaScript, '{{camera_name[0]}}' is a string literal.
It will not display the first element of that list, it will display '{{camera_name[0]}}'
if you want the first element of that list as the title, use title: camera_name[0],
 
hmm, if we would deal with the lat and log I also have a list of floats, but they are converted as strings, that's why i don't use the list
 
For that, I believe googling for things such as "how to parse string as float javascript" could be helpful
 
6:28 PM
var camera14_lat = parseFloat("{{camera14_lat}}", 10);
var camera14_log = parseFloat("{{camera14_log}}", 10);
But that's just too much of code
maybe there's another way of doing that?
 
man, remove the double quotes and curly braces, are you just typing characters at random?
languages have rules, that do not depend on your intention. You can't will the double quotes into transforming the bizarre expression in a string.
 
var camera1_lat = parseFloat(camera_lat[0], 10);
var camera1_log = parseFloat(camera_log[0], 10);
still dont work
 
you now need to define what "work" and "don't work" mean.
what's the content of camera_lat, and what do you expect it to be transformed to with that.
 
Also when I changed from "{{camera_name[0]}}" to camera_name[0] the marker didn't showed up so that means something bad with that
 
6:44 PM
I have no idea what "marker" means for you. it's not a universal thing.
do you plan on answering my questions?
there could be a very vast amount of reasons for your code not doing what you want it to do, and currently it's hard to tease information out of you
 
      position: {lat: camera_lat[0], lng: camera_log[0]}
the camera_lat stands for float
same camera_log
the marker is a marker which is used to show a place on google maps
i have integrated google maps in javascript
and to edit the marker place i use these these variables
that code which i just posted doesnt work
Also I double checked the list and its in this format - (3, 'hikvision 1', '73.2.51.0', 54.737769, 25.251693, 'slezeviciaus g. 7', '10 jan 16:04 2020', '106b817d-8320-4a06-b496-adc72s586e6ca')
So its already float not string, I do not need to change it from string
 
thanks for the precisions, that's much clearer.
@DzITC what is that list? in what variable is it contained? is that the camera_lat variable?
 
(id, name, ip, lat, log, street, update_time, api)
just add camera_ in front of every value
 
that is not how list access works in javascript
it seems that here, lat = list[4] and lon = list[5]
 
also i send the list from python
i didn't made the list in javascript
 
6:56 PM
ok, what is the variable name that contains the list you receive from python?
also, at this point you might need to start using the developper console, do you know what that is?
 
ohh man I don't really know I just use this - title: "{{camera_name[0]}}", to get the value from it
 
as I said, that will not get any value from anything
 
{
    "status": "ok",
    "total_cameras": 3,
    "cameras": [
        {
            "camera_id": 3,
            "camera_name": "hikvision 1",
            "camera_ip": "73.2.51.0",
            "camera_lat": 53.736406,
            "camera_log": 15.11621,
            "camera_street": "slezeviciaus g. 7",
            "camera_lastUPD": "10 jan 16:04 2020"
        },
        {
            "camera_id": 4,
            "camera_name": "hikvision 2",
            "camera_ip": "213.2.51.0",
            "camera_lat": 51.67,
This is JSON response which I'm working with
 
ok. how is that JSON response extracted?
it would be something like JSON.parse(response.text) or varia
or res.json() or maybe just res.text, depending on the presence of a framework.
(don't despair, it might not look like it, but we're like a lifetime closer to getting the lat and lon in variables you can use)
lat_0 = json['cameras'][0]['camera_lat'];
lon_0 = json['cameras'][0]['camera_lon'];
 
Wondering if it's in a Django template, if "{{ variable }}" is working?
 
7:02 PM
 xx = Reach_sr.GetCameras_Info(api_key)
        JSON_DATA = json.loads(xx)
        template_render_params = defaultdict(list)

        for camera in JSON_DATA["cameras"]:
            template_render_params['camera_name'].append(camera['camera_name'])
            template_render_params['camera_ip'].append(camera['camera_ip'])
            template_render_params['camera_lat'].append(camera['camera_lat'])
            template_render_params['camera_log'].append(camera['camera_log'])
            template_render_params['camera_street'].append(camera['camera_street'])
 
that's... not javascript :)
 
the <script></script> is not javascript?
I'm green on this stuff man
 
I don't see that <script></script> you speak of
 
1 message moved to Trash can
@DzITC Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. Please separate code blocks from your actual question. Put your question in 1 message and then your code in a 2nd and format it. For posting large code blocks, use a paste site like like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
 
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Interkodas - Main </title>
    <style>
      #map {
        height: 100%;
      }
      html, body {
        height: 100%;
        margin: 0;
        padding: 0;
      }
    </style>
  </head>
  <body>

    <div id="map"></div>
    <script>

      var marker;

      // ALL Camera settings
      //1
      var camera1_lat = parseFloat("{camera_lat[0]}", 10);
      var camera1_log = parseFloat("{camera_log[0]}", 10);

      //2
      var camera2_lat = parseFloat("{{camera2_lat}}", 10);
 
7:06 PM
excellent! I think I get the picture now, @Cameron is right. So, what's the problem?
 
Maybe there's any way to insert a value from the list to - position: {lat: camera_lat[0], lng: camera_log[0]} ?
cause it's not working in this case
if i would just put numbers rather than camera_lat[0]
it would work
 
you'll have to revert to the double quotes and curly braces, I was wrong
 
yes
i did that
but now how to deal w the numbers there
 
ok. at this point, we could use the help of the developper console. Does your page load in a browser? are you aware of the developper console? having an error message here would be worthwhile
 
Man write me to pm i have to go for now
 
 
2 hours later…
9:27 PM
@FélixGagnon-Grenier a user could break out with relative paths ../../../
 
10:11 PM
@FélixGagnon-Grenier u here man?
 

« first day (3378 days earlier)      last day (1573 days later) »