« first day (1704 days earlier)      last day (3261 days later) » 

8:00 PM
@KarelG You can almost always write tests first.
 
eh, figured out how to message people anyway.
 
I've never met a situation where that wasn't possible.
 
@rlemon sent you the pic. right strip is them.
 
@MadaraUchiha Yes it was just the first test I am going to make others
 
I can't find good greentext these shits are weird as fuck
 
8:00 PM
@rlemon I chose a flat directory in the name of the sha1 hash
 
yea but I'm only keeping a hash and a url
I don't need a file per
 
That's true
So why do you want to cache the files?
 
problem is not completely solved
I have the following line
$('#totalAmount').val(finalValue.toFixed(2));
 
You want the url/hash cache to persist?
 
@MadaraUchiha so I don't have to make multiple imgur requests for the exact same text
 
8:02 PM
console tells me finalValue.toFixed is not a function
 
@rlemon mongo/postgres ftw
I need to make improvements to my cache too
Text and text and TEXT all yield the same image, but different hashes.
 
@MadaraUchiha but for json storage (or even store as csv) wouldn't opening the fs once on load to memory and then append with only new values be faster?
seems like it is too basic to bother with a db
 
@rlemon How would you append to JSON?
 
do I need to parse finalValue?
 
8:05 PM
You have to rewrite the whole file
 
@MadaraUchiha I was thinking moreso csv
hash,url
@FrancescoDS finalValue isn't a Number
 
csv looks like a pain to work with
Unless you have a library handy?
 
really? it is super handy
parse-csv works
or read the entire file split on \n and then again on ','
 
@rlemon there is some limited escaping
 
@rlemon how to parse it to Number?
 
8:07 PM
not when I control the data
@FrancescoDS you can google how to convert a string to a Number (it's really easy... I almost gave you the answer by writing this)
 
just quote your fields and you shouldn't have to ever worry about it
 
I'm going to use the library
just because it is easy and i've used it before
but parsing them by hand isn't a pain is all I'm saying
 
Hi, Please help.. Annoying bug when executing Javascript App on "SLOW" Devices. Problem is array getting unusual length and added NaN or just no value separated with commas .. array length should be 2... but on a slow device it will be 4 or 5 with empty and NaN values,,, how to avoid this?
 
And this is why it works without an app id
 
@Vishnu can you post an example that could reproduce the problem?
 
8:13 PM
@rlemon thanks
 
@MadaraUchiha ahh, okay that makes sense.
 
@rlemon I'm surprised that they don't support direct piping, since they use streams anyway behind the scenes
How awesome would that have been?
gm()
.bla()
.bla()
.bla()
.pipe(imgur.uploadStream())
 
@ssube it is simple as getting current time. Self.newTime[n] = Date.now();
There is 2 functions using Self.newTime array accessing values by Self.newTime[0] & Self.newTime[1]. but is a slow system Self.newTime array will be like this [2121, , ,NaN]
 
yea I was trying to figure out how to get the convert as a stream or at the very least as base64 to the console.
I'm sure that is possible
just haven't got it yet
then temp files is a non issue
 
@rlemon You can .pipe(process.stdout)
 
8:16 PM
it doesn't output
I haven't looked into the docs much
(at work)
I will when I go home
also I'm not using the gm node module. I'm execing still
 
finally a good one
 
Can anyone recommend a light yet powerful text editor? Atom, Brackets?
I wanna use it for small edits, for bigger projects I'm using an IDE
 
@simpe vim
Is there an in-chain equivalent of Promise.all?
 
True, but I want a UI to work with
 
@simpe Sublime or atom are both pretty good.
 
8:22 PM
@SterlingArcher D: :D
 
Yeah, I like Atom as well. Sublime is ok
 
@simpe what language?
JS, TS, ES6?
 
Anything web-related. JS, HTML, CSS, PHP etc.
But it should also support like Typescript and others
 
If you want everything, webstorm/intellij is your only real option.
If most of them are good enough, try VSCode. It's like Atom but more responsive.
 
Yeah that's what I'm using for bigger projects, but I don't want to start it up for a small edit
VSCode, i'll check that out. thx
VSCode doesn't look too light though
 
8:24 PM
@KendallFrey inoright!
 
!!urban inoright
 
@KendallFrey No definition found for inoright
 
@simpe it feels pretty light
it's based on all the same stuff as atom, doesn't really get in your way much, supports most languages (except es6)
 
Could be that anything Microsoft related just makes me shiver..
 
sooooo /r/greentext is a thing
 
8:27 PM
So it's not like VS? What's the difference between them?
 
@simpe the only thing they have in common is the color scheme :P
it's related by brand-name only
 
All right, then I'll check it out!
 
$ server started and listening on port 8080
$ writing temp image c53bbab9-cad8-4218-85f4-89df176f156a
$ deleting temp image c53bbab9-cad8-4218-85f4-89df176f156a
$ removed c53bbab9-cad8-4218-85f4-89df176f156a
.. now I submit the same image request again...
$ image found in cache
.. fuckyea!
@MadaraUchiha
 
8:31 PM
it worked first time
I'm suspicious
time to put it on the server and see if it works as well from there
 
How does createReadStream behave on a file that doesn't exist?
 
no clue
never tried it
 
ENOENT apparently
And one I can't catch too
 
process.on('uncaughtException', function (err) {
 // do stuff
});
@MadaraUchiha
but you'll have to verify the error is from your attempt to make the read stream
 
8:38 PM
@rlemon Still not caught
process.on('uncaughtExceptionn', function(err) { console.error('I HAD ERRORZ', err); });
try { fs.createReadStream('foo'); } catch (e) { console.log('boop', e); }
Neither caught it
Try it in your repl for a second
 
'./../foo' how is this not a valid path
 
@MadaraUchiha github.com/afonsomatos/cli-parser/tree/master/tests It's hard to write all these tests gosh, I'm going to add some more later but I'm tired now :( Also the crazy indentation is because of my text editor but I fixed the problem.
 
fs.createReadStream('foo').on('error', function(err) {
  console.log('haz error'); // works
});
@MadaraUchiha
 
still dumps the error
but you can at least capture it now
 
8:44 PM
@SterlingArcher he got damn high
 
@MadaraUchiha you realize you can send the 'w' flag in the optional options param
if you wanna just create the file if it doesn't exist
but I imagine you already know that
 
That doesn't work with a read stream
Error: EBADF: bad file descriptor, read
 
to whomever I have said in the past that I don't need tests, you are allowed to punch me.
 
@AwalGarg On my way.
 
8:47 PM
this is seriously awesome
I feel so stupid for procrastinating this
 
@rlemon ^^^
 
Interview went awesomely
 
read this. like, right now! higherperspectives.com/hell/?ts_pid=2
 
can't stop laughing
 
8:48 PM
@NickDugger congrats
 
I struggled on the angularjs part, though...
but the code still worked
 
nice @NickDugger :D
 
They were impressed with my regex knowledge, at least
 
son of a bitch that was clever and elaborate
 
@NickDugger Grats
 
8:51 PM
@NickDugger who was the interview with (and grats!)
 
the company is Workfront
 
nice
 
I am going to fap, sleep and celebrate. Have the most fantastic day of your life. Cya.
 
@rlemon Who knew creating a file if it doesn't exist would be such a pain in the ass? :|
 
@MadaraUchiha dude
fs.createReadStream(filename, { flags: 'w' });
might be 'flag'
I can't remember the option name now
 
8:56 PM
@rlemon Did you try it?
Error: EBADF: bad file descriptor, read
 
@ssube if using bluebird, returning an array will keep the chain going
 
That's what I get
 
@MadaraUchiha w+ or a+
 
@copy Aaaaand now I feel stupid.
Thanks
 
on my linux laptop it works with just 'w'
shrugs
 
@rlemon w+ is read+write
@rlemon Google "man fopen", the C function, look at the mode argument
 
@SterlingArcher LMFAO
 
@FlorianMargaine I used to know them when I PHP'd
 
@SterlingArcher You want elaborate? longestjokeintheworld.com
 
9:01 PM
i'll be damned if I'm reading that
 
@SterlingArcher @KendallFrey gist.github.com/rlemon/4586368
 
I'll be damned if you're not
I did
 
hand mother fucking written
 
It only took half an hour
 
!!afk going home
 
9:02 PM
@rlemon ah, that classic
 
I kind of want to email the hiring manager and tell him to hire me
 
I read it
and I hate you like the unstoppable flow of post taco bell mortem.
 
Which one
 
lemons
was shorter
highly upsetting
 
I read the longer one in bed one night
totally worth it
 
9:11 PM
@KendallFrey I lied
oh. my. god. I hope it's true.
 
I'm hungry
 
why is there so much greentext about shit
 
I don't know but i lost it when the projector shook
TIL many people shit themselves violently frequently
 
@rlemon can you share your cache init phase code?
 
@MadaraUchiha rlemon is afk: going home
 
9:16 PM
I learned a lot about low-viscosity shit while in Asia
 
blocktext or idgaf
 
@MadaraUchiha how inappropriate would it be to email the hiring manager soon after the interview concluded?
 
crl
Job interview question I had today: write a calculator, that transforms an expression of positive integers, parenthesis, + and * to a binary tree, and a function that eval the tree
 
@NickDugger Depends, email for what?
 
Email to express interest in being hired
or is that absurdly redundant?
 
9:20 PM
@NickDugger Nah, don't do it.
 
Alright
 
@NickDugger handwritten letters sealed with wax do the trick
quill tip or no job
 
And they arrive late enough so that you don't seem desperate too
 
time to go home and eat
goodnight squad
#believeinyourself
 
do any of the built-in number formatting functions in JS return a string with "+" in fonrt of positive numbers?
 
9:26 PM
lol
 
very inventive
 
Sometimes you just gotta make pancakes
 
Can I use \n in template strings?
 
0
Q: Unable to insert node at base level while pasting in contentEditable element

Rahul DesaiI am trying to make my WYSIWYG editor same as Medium's. When someone pastes a paragraph of text, it should get into a <p> element right below the contentEditable element and at the position where the caret is. It shouldn't get nested inside the element where we pasted. As of now, it is getting n...

 
In short: Yes.
 
9:38 PM
@Luggage As in, use it to break lines
Not as literal '\n'
 
according to that, you just have a line break
where it says: // Multiline strings
 
So I had uploaded a package to npm and now (some days later) I want to update that same package because I have done some work on it. How do I do this?
 
@MadaraUchiha yessir
I can share all of it
it is pretty bad
 
@rlemon Already managed to roll my own
 
var parser = parse({
    delimiter: ','
}, function(err, data) {
    if (err) {
        return console.error(err);
    }
    data.forEach(function(row) {
        memory[row[0]] = row[1];
    });
    init();
});
var memory = {};

....

fs.createReadStream(__dirname + '/memory.csv').pipe(parser);

function init() {

    app.listen(8080);
    console.log('server started and listening on port', 8080);

}
 
9:49 PM
It does some ugly assumptions about asynchronous being complete, but since it's only called on startup, IDGAF :D
Mine is a little prettier
export class Cache {
    constructor(file) {
        this.file = file;
        this.cache = new Map();
    }

    static fromCsvFile(file) {
        let cacheInstance = new Cache(file);
        fs.readFileAsync('cache.csv', {flag: 'a+'})
            .then(parseAsync)
            .then(parsed => {
                debugger;
                cacheInstance.cache = parsed.reduce((map, row) => map.set(row[0], row[1]), new Map());
                return Promise.resolve();
            })
            .then(() => console.log('Cache is ready!'));
 
just because you es6, doesn't make it prettier :P
but yes mine was rushed
will be working on it tonight
 
This is the main method
app.post('/', async function handlePost(req, res) {
    console.log(req.body);

    req.body.top = req.body.top.toUpperCase();
    req.body.bottom = req.body.bottom.toUpperCase();

    let sha = sha1(JSON.stringify(req.body));
    console.log("SHA1:", sha);
    debugger;
    if (cache.get(sha)) {
        console.log("Getting from cache:", cache.get(sha));
        res.end(cache.get(sha));
        return;
    }
    console.log("Fetching image");
    let location = await fetchImage(req.body.uri, `./${targetDir}/${sha}`);
That async syntax is sexy as hell
 
here it the complete server.js
as it is right now
but I just got home from work
need to #2 then get a beer then get to the code :D
the only reason I use uuid is I am afraid two users will create a file at the same time.
:/
probably wouldn't be an issue
0
Q: If you have a language L ⊆ Σ∗ ,, then is |Σ∗| finite?

mojeer nanaIn formal language : which is a set of strings of symbols that may be constrained by rules that are specific to it... wikipedia examples: Σ1 = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9} — 10-element set of decimal digits. Σ2 = {a, b, c, . . . , x, y, z} — 26-element set of lower-case characters of the Engl...

@BenjaminGruenbaum
I see math like symbols.
 
I wish node-canvas worked.
build has been failing for months now
 
haha!
csv was a good idea :D
but you don't need to import all of csv
node-csv-parse is the actual module (just csv-parse)
 
@rlemon vOv
 
just saying
> parse = require('csv-parse'),
 
If it were client-side I would have cared
 
I just don't care to import the other two modules that makeup csv
:/
if all it takes is installing the right module and changing the require call
 
10:08 PM
I don't really mind you loading a couple more objects into memory (that will get GCed very quickly) on the first tick :P
Also, at first I thought I'd have to use transform too, so I loaded the whole thing
 
fair enough
just pointing it out :P
 
also, your code reeks of Java structure :D
(not a bad thing. it is readable)
 
@rlemon What, class? :P
 
just the way it is organized and written
reminds me of Java. can't explain it
 
10:10 PM
I think it's closer to procedural more than it is to Java/OOP style
Thanks to all the asyncs, I don't have long chains of .then()
But, well, it's a fairly simple code
4-5 functions?
 
how do you handle concurrency? does the gm module just work?
 
@rlemon I haven't given it much thought
And I haven't really looked into gm code to make sure it really does operate concurrently
 
I posted mine in Android and like ten people tried to use it at the same time
 
I trust the API since it's callback based
 
the service crashed once
 
10:14 PM
Interesting
 
it seems to me spawning gm multiple times doesn't work well
 
Maybe it's a job for threads wink wink elbow elbow @BenjaminGruenbaum
 
so I'm wondering if node-gm queues the requests
I could easily implement a queue
but might there be a better approach?
I don't want users waiting like 30 seconds
 
@rlemon How about a worker?
 
the problem is with the exec'd command
not js or node
it throws errors
 
10:16 PM
Ah, right, you're using exec
 
node-gm at some level calls gm
so we're both facing the same problem.. only node-gm probably handles it
 
@rlemon Looking at the source code, I don't see any particular handling done
gm does it with child_process.spawn
 
ahh yea
 
1
Q: Asynchronous GraphicsMagick For Node

Saransh MohapatraI am using GraphicsMagick for node. I basically crop the photos and retrieve the exif data of the photos uploaded by the user. I don't want to block the flow of request waiting for these task to be completed, therefore I need to use asynchronous functions to be able to do so. And I think I should...

 
exec I think happens all on the same shell
spawn would solve that
good thinking
 
10:30 PM
this kid is going places
 
haha
 
nice hehe
 
Anyone able to spot the problem with this pen? http://codepen.io/Chevex/pen/bdrxqb

Simply adding 'ngMock' to the dependency array in angular.module stops the controller from running at all. Remove the string from the dependencies and everything works again. No errors in console and angular-mocks.js is present. Been scratching my head for ten minutes. You can tell when the controller stops registering because the binding in the DOM stops processing.
 
@Loktar I sign my closing papers on thursday and hand over my down payment.
4
IM FREAKING OUT MAN!
 
Had to remove the cd drive for it to fit
...it's not that dirty, it's just the lighting
 
10:43 PM
@rlemon And when he does, his parents are likely not to find him :P
 
@Cereal do you have an exhaust vent on the side cover ?
 
@tereško It's metal siding with an acrylic window. I'm wondering about the heat, but the 760 that was in there before always sat around 60. If it gets too hot, they sell vent sides, so not worried
 
what chip is it ?
I am not too familiar with MSI
if it's 980 or 290, you will need an exhaust there
both of those chips run hot (I am not too sure about 970)
 
980. I'll watch the temps and pop the window out if it's bad.
 
anyway, you probably should looks for modding options for that chassis of yours
you should be able to but a side panel with openings
 
10:57 PM
FFS Parallels
 
@rlemon DOOOOOD
good luck man :)
@Cereal waity wtf?
How is that hooked up lol
 
@Loktar Did you get that thing I sent ya?
 
@monners nope
my alerts go away when I switch rooms..
its super annoying
 
@Cereal I'm getting a FuryX bruh
 
10:58 PM
@Loktar Lol. mobo is flat on the bottom.
 
OOOh yes I did see that
I had to run to a meeting though
lol that thing is so crazy man!
@Cereal ahh ok makes sense, lol it looked like a joke post at first
 
@Loktar I was selling my soul just to afford the 980 lol
 
@Loktar I'll be on edge until I hand over the cheque and sign the papers Thursday morning.
:/
can't be helped.
 
I backed the project. Been meaning to try out an ergo keyboard (and got sick of waiting for the ergodox massdrop)
 
dude... those fans are like right up on the edge, def monitor the temps lol
 
10:59 PM
@rlemon Did you buy a house?
 
@monners damn, pricey, but really nice
 
Yeah yeah, I always have speedfan open
 
Meh, it's only money
 
@monners looks cray
 
10:59 PM
@rlemon haha yeah man, then once you get it its like... wtf this is mine?!
 
I use a Kinesis
 

« first day (1704 days earlier)      last day (3261 days later) »