Open Side Menu Go to the Top
Register
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

11-01-2018 , 10:58 AM
True, but I think focusing as heavily as I am on bash scripting and linux system stuff is a mistake, it’s kind of a dying skillset in my opinion.

Maybe not, and general scripting abilities are always useful no matter the language. I am going to start learning python in my free time. Getting complicated programs and systems to play nice with each other is really challenging and fun to me, so I hope I can leverage it elsewhere.

My deskmate is a pretty good mentor and reminds me of my dad. He has a lot of faults but if it weren’t for him i’d probably be freaking out a lot more.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-01-2018 , 11:45 AM
I generally agree that its not particularly valuable (relative to a lot of other things - not in an absolute sense). Especially if its being devoted to building a home grown testing framework.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-01-2018 , 11:50 AM
Unix admin is the route one of my best friends took and I expect he still does it plenty (he's still on call 24/7), but also does security and some management and authority, and he makes $350k so it can be lucrative enough.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-01-2018 , 11:51 AM
My instinct tells me that those types of jobs are dominated by graybeards, lol
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-01-2018 , 12:12 PM
is there some good tutorial to understanding javascript dependencies, package.json, npm, nvm, etc? every time i do something javascript related i just end up mashing my keyboard until it works. it is pretty frustrating, especially when it comes to legacy apps.

'oh hi there, this app has not been updated in 18 months and just failed... run `npm run setup` and then kill yourself'... and ... 'no stupid, you cant use that library version unless you use a new version of node! but you cant use a new version of node with this other dependency...'

i'm guessing you should keep the apps upgraded often enough so that dependency updates can be handled linearly?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-01-2018 , 12:15 PM
Quote:
Originally Posted by jmakin
My instinct tells me that those types of jobs are dominated by graybeards, lol
He's like 47. Grayish. He doesn't have a lot of direct reports, but makes a lot of the big IT decisions for the company. That's going to be a somewhat graybeard position as having 25 years experience can be valuable. But still, definitely people making $200k or so with just a few years experience and technical proficiency.

I'm doing some node stuff, but trying not to drop my python project altogether. I've gone to one python meetup and might continue if I can. It's in Culver City, so probably too far for you. I've been to a few different meetup groups and this one is probably the best for me. It's just like a dozen people at a big cafe and they just work on their projects.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-01-2018 , 12:19 PM
Quote:
Originally Posted by OmgGlutten!
is there some good tutorial to understanding javascript dependencies, package.json, npm, nvm, etc? every time i do something javascript related i just end up mashing my keyboard until it works. it is pretty frustrating, especially when it comes to legacy apps.

'oh hi there, this app has not been updated in 18 months and just failed... run `npm run setup` and then kill yourself'... and ... 'no stupid, you cant use that library version unless you use a new version of node! but you cant use a new version of node with this other dependency...'

i'm guessing you should keep the apps upgraded often enough so that dependency updates can be handled linearly?
I don't know. I just google stuff. But having been in programming 20 years ago, skipping a couple decades and then doing it now, I can say it's freaking amazing how easy installing software/packages/dependencies and whatnot is now.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-01-2018 , 12:39 PM
Yum is my favorite tool ever

Micro, I might be down for something like that depending on when it is
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-01-2018 , 12:40 PM
Quote:
Originally Posted by OmgGlutten!
is there some good tutorial to understanding javascript dependencies, package.json, npm, nvm, etc?

i'm guessing you should keep the apps upgraded often enough so that dependency updates can be handled linearly?
Most apps should work on node 6 and higher. Again big problem is that node 10 was moved to LTS this week and it broke a bunch of crap.

Package.json should have an "engines" entry that says what node to use with it. If not look at .nvmrc.

Maybe every 6 months I update dependencies or at least the big ones.

But yeah basically everyone bangs away at things until it works
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-01-2018 , 01:01 PM
Interesting thought on interviews from a very smart guy who I think a few of you already know of:



Of course, on the flip side, dude managed to get hired at Google.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-01-2018 , 01:12 PM
As someone who was never nervous in interviews - then became very nervous when I lost the ability to recall basic stuff - that rings very true.

I'd probably do a lot better now that I'm developing 8 hours a day. Being old and taking time off is definitely a detriment.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-01-2018 , 01:19 PM
Quote:
Originally Posted by jmakin
Yum is my favorite tool ever

Micro, I might be down for something like that depending on when it is
https://www.meetup.com/LearnTeachCod.../xfppbqyxlbrb/

Monday evenings 6:45-9pm
Coffee Connection
3838 S. Centinela Ave · Los Angeles, CA

It's sponsored by "Girl Develop It" which in the IT world means there will probably be at least one woman there. When I went I think there were two.

For me that's diversity though because in the solar/electrical contracting world there are basically no women.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-01-2018 , 06:26 PM
Ah, hard to make it after 5pm irvine to culver city by that time I think.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-01-2018 , 06:49 PM
This site is pretty great for learning the ins and outs of git: https://learngitbranching.js.org/

My new job has a rebase strategy where every merge to master is a single squashed commit and the history is a nice clean straight line of changes.

I had to sheepishly admit that I had never rebased before, basically just automerged by using pull and push. But after completing this tutorial I have a much better understanding of git.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-01-2018 , 07:05 PM
I have a feeling I'm going to regret going with git submodules. There seems to be a lot of weird flaky behavior as far as keeping them in sync - a submodule added by one dev doesn't automatically show up when another dev pulls from the parent repo.

One would think running git submodule sync would help - but that rarely seems to do anything. git submodule init, then git submodule update, then git submodule sync (because why not?) seems to do the trick.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-01-2018 , 07:57 PM
Yeah, I gave up on submodules pretty quick for similar reasons
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-01-2018 , 09:28 PM
I wonder if Visual Studio is smart enough to mimic the same behavior. Hmmm. I'll play around with it.

Perfect scenario would be your Visual Studio solution is smart enough to have a bunch of projects that all have their own git repos. So to get the code you just right-click and do the version control thing from the context menu.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-01-2018 , 09:49 PM
Quote:
Originally Posted by PJo336
Yeah, I gave up on submodules pretty quick for similar reasons
Ditto.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-01-2018 , 09:50 PM
Quote:
Originally Posted by Wolfram
My new job has a rebase strategy where every merge to master is a single squashed commit and the history is a nice clean straight line of changes.
I think we've had this discussion before, but just curious - do you get much value out of the nice clean straight line history?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-01-2018 , 10:19 PM
I like my git history like I like my women
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-01-2018 , 10:44 PM
Maybe too specific of a question, but...the task is to read an image from a https url and insert it into a pdf. What I have working in code not shown is writing text and drawing stuff to pdf as well as inserting images from the filesystem.

Using node, https, pdfkit

Code:
const PDFDocument = require('pdfkit');
const https = require('https');

let pdf = new PDFDocument;
let writeSecondStream = fs.createWriteStream('out.pdf');
pdf.pipe(writeSecondStream);
let body = [];
https.get('https://compote.slate.com/images/c9320bfa-e49d-41af-bccc-f85351038055.jpg', function(res) {
	if (res.statusCode != 200) {
		return console.log('HTTP Response code ' + res.statusCode);
	}
	res.on('data', (chunk) => {
		console.log(chunk);
		body.push(chunk);
	}).on('end', () => {
		let allbody = body.join();
		console.log("allbody = ", allbody);
		pdf.image(allbody, 25, 25);
	})
});
pdf.end();
with console.log(allbody) commented out
console.log(chunk) is like 20 lines of this:

Code:
<Buffer 8a 28 00 a2 8a 28 00 a2 8a 28 00 a2 8a 28 00 a2 8a 28 00 a2 8a 28 00 a2 8a 28 00 a2 8a 28 00 a2 8a 28 00 a2 8a 28 00 a2 8a 28 00 a4 a5 a4 eb 40 05 14 ... >
<Buffer c7 91 f4 35 d1 1c 5c 5b b3 56 29 49 33 a3 a2 a2 b7 b9 8a e6 3d f1 36 40 ea 31 c8 fc 2a 5a ea 4d 35 74 50 51 da 8a 29 80 52 52 d1 40 09 4b 40 f6 a2 80 ... >
console.log(allbody) makes everything in the console look like:

Code:
��o}�،��<z��V��ư�G�#����(:U��B��UsK�sK��n��x��
�um� =��� ��́�?�I��v�������.�������H/m[��k�.�cpO@V��{!�Tz���]������:�n�*���4��y2�L�i*�2:U'.�^E������G�`�`P�ґ��}�����S�ڋ˰��Mw� ��T��j���q�
if console.log(allbody) is commented out the output ends with this error

Code:
fs.js:162
      throw er;
      ^

Error: Path must be a string without null bytes
    at nullCheck (fs.js:159:14)
    at Object.fs.openSync (fs.js:645:3)
    at Object.fs.readFileSync (fs.js:551:33)
    at Function.PDFImage.open (C:\Users\jayne\nodeauthapi\node_modules\pdfkit\js\image.js:32:21)
    at PDFDocument.openImage (C:\Users\jayne\nodeauthapi\node_modules\pdfkit\js\mixins\images.js:102:26)
    at PDFDocument.image (C:\Users\jayne\nodeauthapi\node_modules\pdfkit\js\mixins\images.js:30:24)
    at IncomingMessage.res.on.on (C:\Users\jayne\nodeauthapi\app.js:499:9)
    at emitNone (events.js:111:20)
    at IncomingMessage.emit (events.js:208:7)
    at endReadableNT (_stream_readable.js:1064:12)
[nodemon] app crashed - waiting for file changes before starting...
I figure it's some kind of encoding/decoding/headers thing, but have been trying various things for hours. ?

Last edited by microbet; 11-01-2018 at 10:50 PM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-01-2018 , 10:52 PM
Looks like pdf.image() is trying to read an image file from the file system, not as a binary blob or buffer or whatever that is. Try saving the image that comes back from slate.com first, then call pdf.image().

Basically save the image in the last block (not sure how to save an image grabbed from the web, but there should be plenty of examples), then feed it as a File object (which might just be the file path, I forget) to pdf.image(savedFile, 25, 25);
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-01-2018 , 10:55 PM
Quote:
Originally Posted by suzzer99
Looks like pdf.image is trying to read a file from the file system, not as a binary blob or buffer or whatever that is. Try saving the image that comes back from slate.com first, then call pdf.image();
I believe I could successfully do that, but this should be possible and isn't saving to filesystem and then reading it pretty bad? It's not like this is going on Instagram or anything, but (should the code not be rejected) it will be in production and potentially used in many places.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-01-2018 , 11:03 PM
Well then you'd need to find another pdf generator that can take a binary blob (or more likely it's a binary buffer - which means it's a stream basically and that gets messy).

The key is to use fs.writeFile not fs.writeFileSync - so node can do other work while your file is saving (or reading). Then file access is fine and standard for image manipulation stuff.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-01-2018 , 11:14 PM
Quote:
Originally Posted by suzzer99
Well then you'd need to find another pdf generator that can take a binary blob (or more likely it's a binary buffer - which means it's a stream basically and that gets messy).

The key is to use fs.writeFile not fs.writeFileSync - so node can do other work while your file is saving (or reading). Then file access is fine and standard for image manipulation stuff.
I'm doing solar work tomorrow, but this weekend if there's no direct solution I'll download the file and then import. According to the internet pdfkit is supposedly capable of doing this on the fly.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote

      
m