« first day (1814 days earlier)      last day (3128 days later) » 

crl
4:00 PM
I wish js had some fun number literals like let x=1k; //1000
 
1e3 is ok too, imo
 
crl
sure, but that would be still fun
 
user3119231
is smart to store images in mysql database or in directorys?
 
user3119231
I want to save statistics to every image and stuff.
 
crl
!!google store images in database
 
@Maurize directories.
 
user3119231
thanks for simple answer.
 
database
actually it depends on the situation, of course :)
 
user3119231
Store information to pictures -> Like "Likes" (for example)
 
4:24 PM
63
Q: Files - in the database or not?

Jack DouglasWhat is the best place for storing binary files that are related to data in your database? Should you: Store in the database with a blob Store on the filesystem with a link in the database Store in the filesystem but rename to a hash of the contents and store the hash on the database Something ...

Disclaimer: this is biased since written by DBAs.
 
in my experience, the db will be smaller and pretty good, but will be a pain to backup once you get into terabyte of images (expecially since most won't change, so you'll be backing up a pile of static data each time.
at xerox, i migrated a few terabytes of images out of mssql onto disk to easy backups
 
user3119231
@FlorianMargaine I'll simply create a pilot project to test the db - image scenario
 
but before it got to that point, the DB ws more convenient, mostly.
 
@FlorianMargaine All the 3 "disasters" he lists for storing on FS are silly.
@Maurize how big is your app? Can you depend on a respectable 3rd party service? If so, imgur is a very viable choice.
Stack Exchange depends on imgur, for instance
 
instead of a direct link in the DB, store an id/hash/other that can be used to MAKE a link so that you can rearrange when needed.
e.g. All our images had a UUID in the DB that we'd translate to the path: 12/34/5678-0000-0000-0000-000000000000.tiff
 
user3119231
4:29 PM
I think I will try several methods and choose the best for my case.
 
well, duh, that's your job. :)
 
user3119231
thanks for all the information.
 
cs.unm.edu/~fastos/05meeting/PLAN9NOTDEADYET.pdf wonderful (@FlorianMargaine I guess you have read this already but if not, it's nice)
> you want to let a process read from
something else (i.e. Filter) and then ... open
a file ... oh wait ... IPC has no name
lol
 
@AwalGarg hangouts
 
4:47 PM
// Hm.. so I have:
let arrayOfScheduled = [ { id: 'a' }, { id: 'b' }, { id: 'c' } ];
let arrayOfActual = [ { id: 'a' }, { id: 'c' }, { id: 'd' } ];

// and want
let result = [ { a: { scheduled: {}, actual: {} }}, { b: { scheduled: {}, actual: undefined }}, ... ];
just rubber ducking here, mostly..
basically a full outer join..
 
Are you guruanteed uniqueness? So no a twice?
If so, maybe a Map is in place. It also makes solving your problem much easier.
 
yes, that's going to be a natural key that is unique
i'm thinking i need to get the unique keys from both arrays first, then one final loop that jsut .find()s from each.
 
Why are they arrays if they contain objects with a unique, distinguishing and meaningful property?
 
one is a list of scheduled events, the other is data from logged timesheets. I'm matching them up to show the discepencies
 
You don't have to find really, just go through each list, create/add to objects as you go along
 
4:53 PM
// simple plan
let allKeys = _.uniq(list1.map(x => x.key), list2.map(x => x.key));
let result = allKeys.map(key => ({ scheduled: list.find(key), actual: list2.find(key)}));
ohh, i see what you are saying, two pass. one will create { scheduled: foundItem } and the next pass will set actual (or create object if not already present.
i think yours is more effecient, only have to loop over over each array
 
How many items are there?
 
but at max of 100 items, i think readability of mine will be better
even thoguh it, potentially, loops many times
 
Why do you have [{ id: "id1" }, { id: "id2" }, …] instead of { id1: …, id2: … }
 
an array of db objects.. that's jstu how they come.
I could put them in an object with uuid keys but.. kinda odd.
 
Then do that calculation in the db?
 
4:56 PM
That's exactly what Map is for
 
Basically, a full outer join.
 
I will reduce the array into an object with keys first, and map over it
 
You will do no such thing
Punk
 
Right, luggage will
 
4:58 PM
i'm not sure what that gets me. It's a lot cleaner in my mind to loop over an array of objects than to make one object with a key for each item in the result set.
 
Why not do it in the db?
 
i'll be attaching other data as I compare. it would be a monster of a db query
 
Your solution is okay, but you should use { id1: …, id2: … } as input and output format
 
@Luggage How is something.find(x => x.id === key) cleaner than something[key] ?
 
Or do it in the db
 
5:00 PM
@Zirak yes, ok, i see that for the intermediate step
 
@BenjaminGruenbaum tough what? I don't get it
 
Currently it's accidentally quadratic
 
@AwalGarg and you never will.
 
bastard
 
but my input will always be an array of 'rows' and my output will always be an array, but yes, that'll prevent excessive looping.
 
5:01 PM
@Luggage why? You can modularize it into parts, give the db some credit it's certainly a lot better at this than underscore.
 
it's a small amount of data (<100 rows) and doing my transforms in JS, not the DB has been really successful so far. It lets me run my transforms on server and client given just a list of objects in a 'standard' form.
 
Well, I typically like doing stuff as atomically as possible to not get invalid data which means I usually prefer doing it on the db. It's also typically a lot faster and more declarative and I can make views which also help.
Oh lol, the timing, and you just discovered bash.org too, @AwalGarg makes that pun so much better.
 
Yea..
 
@BenjaminGruenbaum INSULT
 
May 13 '14 at 19:35, by Benjamin Gruenbaum
@Zirak NOTATION THAT YOU CREATE A VACUUM
 
5:06 PM
Jokes on you, I am not @Zirak
 
AND YOU'LL NEVER BE
 
THANKFULLY
 
crl
!!>'riposte'.toUpperCase() //because I don't like capitals
 
@crl That didn't make much sense. Use the !!/help command to learn more.
@crl "RIPOSTE"
 
@rlemon The Destroyer is destroying me
His bodily lasers just eviscerate me
 
5:11 PM
Because you are not invincible like me.
 
I'm fine dealing with the probes and the worm itself, but when he arches himself and lasers come all round I just lost 1/4 of my health in a few seconds
blegh farming Titanium is boring...and I don't know if it'll make that much of a difference.
 
@Zirak the importer
 
Maybe I just need to re-vamp my arena...it's all wooden platforms, for some reason I assumed the lasers are penetrating
 
he had to bring 2 for us from the US. it was definitely expensive and he said that because of customs he ended up with a small loss
 
Ouch. How much did each cost?
 
5:20 PM
1500 nis
 
...
 
it's the expensive version
$320 on amazon, so it was a pretty good deal
 
It's their "bling"
 
it gets all the gurls
 
damn right son.
 
5:22 PM
"hey toots, lemme show you some pics of mah keyboard"
 
is that supposed to be a euphemism
 
"why yes, I do use Rx"
 
Will probably wait for black friday and buy the Quickfire Rapid
 
@Mosho that looks really cool cc @argentum47
 
5:28 PM
I had an expensive mouse and keyboard once
It made me 0% more effective, and it was a bitch to get used to whenever I worked on my laptop or another computer.
 
That reminds me, I haven't seen my mouse since a few weeks. Glad and worried.
 
off impregnating the neighbor's mouse.
 
@Luggage Why would @AwalGarg do that?
 
don't knock it until you've tried it
 
5:43 PM
wow, that thread is really bad
 
It is terrible, the worst I've seen on HN
If your code does IO, it's not pure, I'm not sure how someone could miss that.
If your code performs an HTTP request, you can name it SideEffectAwesomeSauceNinjaRockstar, no matter how you wrap it something will have to be impure, somewhere.
 
Also, what's up with this github.com/python-effect/effect#example
I'll watch the talk, but that example is atrocious
 
What was that build engine based on ES6 generators that came out a while ago?
 
@copy woah.
@copy the lecture isn't really better.
It's really sad when people talk about the solution without understanding the problem.
@copy that lecture is hilarious.
 
6:07 PM
I'll grab some popcorn before watching it
 
6:33 PM
sigh. Python script taking 40s to execute because of logging to stdout.
 
Don't use logging to stdout, then
 
So don't log to stdout, log to dev/null?
 
Thankfully I was using the logging module and not print statements. just turned off all logging
 
Then you have a really shitty logging module 0_o? This is exactly the sort of thing a good logging module shouldn't do.
 
@BenjaminGruenbaum it is python's inbuilt logging module :/
 
6:40 PM
oh, lol.
 
Should I be using something else?
 
What shouldn't it do? If you mean taking significantly longer than bare print statements, I doubt that is the case.
 
No, I was doing a hell lot of logging. It's not the module's fault.
 
Would logging to a file instead help?
 
No because I don't need those logs. I am not good at python so I log a lot.
most of them are useless
I wonder when I'll get off with that habit
 
6:44 PM
When you move to an environment that doesn't let you turn off all logging with a single statement?
 
I don't care about such environments
 
When you log so much it slows things down even with logging off?
 
I use sed to remove all logging commands from code.
 
Regex programming FTW?
 
Aha! It was just one logging statement taking 38 of those seconds. dumped it.
 
6:49 PM
:O
 
@JanDvorak it was dumping a large file...
 
what
 
26 secs ago, by Jan Dvorak
:O
 
I am afraid I am getting used to this ugly snake_case
 
6:53 PM
Did you really feed the contents of an entire file to a logging statement?
 
@copy you suggested me pymotw.com/2. The version 3 version is virtually empty, any alternatives?
@JanDvorak entire what?
 
@AwalGarg The modules also exist in Python 3
 
@copy but how do I know about the bc breaking changes/additions?
 
Check the Python 3 docs
 
ugly docs are ugly.
 
6:58 PM
They're perfectly fine
 
The content is ok, but they look ugly. Unlike, say MDN or PHP docs :P
but still better than lua docs anyways
 
@towc haha feel free, it is a typo
 
@Asperger wait that's your question? WTF?
 
o/
 
wtf is that
 
7:08 PM
Use the C preprocessor
 
@Loktar thanks! I still need to figure out how PRs work tho :/
 
or sweetjs.org to use 'macros' in JS, but I think it'd be a mistake.
 
I have been longing to use sweetjs for so long just can't think where to use it
 
@thefourtheye why did you delete your answer?
 
@BenjaminGruenbaum Your answer was way better than mine :-)
 
7:14 PM
It only works on node 4 onwards
 
Ya, OP is using 4.1.0, right?
 
OP isn't the only person in the world :D
 
Correct :-) But I was not even sure if my answer was the proper way of doing it.
It just works but your answer is clean and concise
 
7:29 PM
Damn it!
whats wrong with wanting your own custom operators!
@Benjamin really lol
 
@Asperger use Haskell
 
@Asperger use C++
 
@Asperger use C
 
lol
 
but thats not javascript lol
and I only recently started php, css, html and js 2 months ago
 
7:31 PM
close enough, lol
 
@Asperger use purescript
And drop php
 
Ya but I need to learn php and later node.js regardless
Im so pissed that I need eval to do all those evil modification for the sake of simple custom operators
 
Please tell me you are trolling/kidding
 
@AwalGarg both lol
 
thanks
 
7:34 PM
@Asperger What's the use-case?
 
@copy swag
 
That's a stupid use-case and a stupid word
 
he wants SQL in his function calls' argument list
 
No
did I mention SQL somewhere?
 
yes
 
7:35 PM
the way you wrote send TO somewhere reminds me of SQL
 
@copy being fabulous, respecting elders, winning rap battles and getting the ladies is not "stupid".
 
Oh ya
I was inspired by sql
 
which is painfully obvious
 
@BenjaminGruenbaum getting the ladies is overrated
 
1. Learn the language
2. Start thinking about abusing it.
Do #1 first.
@FlorianMargaine or men..
 
7:44 PM
@Luggage men are overrated?
 
I mean, if ladies aren't your thing...
 
@FlorianMargaine why do you think jQuery's symbol is $
 
because it is as short as it gets
 
@BenjaminGruenbaum dunno. I only know that the American dollar took the sign afterwards
 
7:53 PM
@copy eeewwww
@BenjaminGruenbaum eeeewwwwww
 
@Zirak funstuff :D
 
8:06 PM
@BenjaminGruenbaum im not even close am I? jsfiddle.net/gnsaLo7h/1
 
user3119231
So I return the data of an image to javascript and make them to .src ... for some reason image is broken...
 
@Asperger No, also you have no idea what problem you're actually trying to solve.
 
@Asperger You should try to move closer to understanding that what you're doing is silly, not toward doing it
 
@Maurize you can't just assign the return text of an ajax to the .src.
 
@copy can you explain?
 
user3119231
8:07 PM
@BenjaminGruenbaum why?
 
stop trying to change syntax of the language or go invent your own language.
 
@Maurize how do you make it the src?
 
Ok well I got to be honest, in depth I have no idea what im solving
 
just gonna make a mess
 
Ok I agree
 
user3119231
8:08 PM
@FlorianMargaine I've tried it with setAttribute and .src =
 
Then stop trying to 'solve' it
 
@Maurize you need to do it with a blob
 
@Maurize I mean, what value are you assigning to it?
 
It goes way beyond what im currently capable of anyways
 
You'll learn over time how to structure your code. This just isn't a reasonable solution
 
user3119231
8:10 PM
 
@copy you are right. It most likely is my lack of knowledge. I need to learn more OOP and how do you call it? DSL?
 
@Maurize so, an url?
@Maurize because this url isn't an image
 
@Asperger DSLs are interesting and related, but probably not what you want
 
user3119231
@FlorianMargaine you know php - I used file_get_contents to "save" the image to db.
 
why do I even...
 
8:12 PM
@copy I somehow reached a point where I simply want to write better code
@AwalGarg you used eval. So is it true that it is very vulnerable?
 
user3119231
=== true
 
 
@Asperger Start writing testcases, post on codereview.stackexchange.com, write more code
 
@Maurize sorry, you just made me go full retard
 
dont be shocked if I asked this! Im really new to all this stuff and its hard to find books for intermediate level
 
8:14 PM
and you know what they say -- never go full retard
 
@FlorianMargaine lol
 
@copy thanks man
 
user3119231
@FlorianMargaine Lol, what?
 
@AwalGarg truly horrible jsfiddle. Congrats ; )
by the way, is DSL advanced or intermediate level?
 
user3119231
However - I've saved the content of the image and the type into the database. I use AJAX to get the data from the database... But image is broken...
 
user3119231
8:19 PM
limb.src("data:image/" + limbs[i].type + ";base64," + limbs[i].source);
 
@Asperger you know what the definition of a DSL is?
> dsl — A domain specific language, where code is written in one language and errors are given in another.
 
lol
 
@Asperger Read that some time ago, I disagree with his notion of DSL
 
@Zirak I really need some DSL tutorial for starters and a good one
 
8:24 PM
He's writing libraries, which isn't bad, but not altering the language
 
can you recommend one?
 
@Asperger that is anything but a dsl
 
@Asperger You're hung up on concepts when you're running circles around yourself with relatively petty issues.
 
@Asperger with(this)
 
I assume it means writing code like this: find().inElement().index()
 
8:25 PM
Work on some things for a while, build some confidence in yourself, and come back.
Then you'll be able to look at your past messages and laugh.
 
@Zirak you are right
@Zirak any keywords I can google?
 
"how to become javascript developer in 21 hours"
 
lol
 
"dragon book"
 
8:28 PM
Don't google bukkake
4
 
Unless he wants to explore some different aspects of his sexuality.
 
damn you guys are brutal. Its a good thing though.
 
@Zirak thanks, I need to send that to a few dozen people
 
All page full of these pictures of flowers.
 
Does anyone use process monitor on windows and know what the "base" column on memory pane represent? it's the virtual memory address or actually the physical one?
 
8:31 PM
@BenjaminGruenbaum You've piqued my curiosity, which may be your point. Considering whether to bite.
Also, you now have "bukkake" in your search history. Forever.
 
@Zirak turn on safe filter, he might be right
 
@Zirak apparently it's a legitimate search term.
@RoyMiloh I don't see a base column.
 
*process explorer -_-"
of sysinternals. my fault.
 
Oh, I don't have that installed anymore
 
[history]
omg
 
8:34 PM
an apple a day keeps the doctor away
 
@RoyMiloh I think that it shows the virtual address, showing the physical one would be damn near impossible given how modern mmus work.
 
@copy thankfully I am homealone right now
 
unless you can't aim properly
 
cc @Mosho ^
 
8:35 PM
@FlorianMargaine Don't play games, your hideous personality keeps the doctor away.
 
s/the doctor/everyone/
:P
 
@Zirak he doesn't know until he's come close to me
 
@Zirak now that you've had ample time to consider, you might want to consider I didn't actually have to google that in order to post that picture of violets.
 
@BenjaminGruenbaum it's possible, because sysinternals work with drivers (=kernel mode)
 
@Zirak I hope you liked the full page of gross though.
 
8:36 PM
But yes, it's probably the virtual
 
@BenjaminGruenbaum That was my dilemma. It was obviously a picture of violets, one doesn't even have to know that, it's in the url. However, maybe it's their ancient Hindu-whatever name.
Luckily the internet scarred me enough to not search anything in google images.
Yay.
 
i.stack.imgur.com/5scmg.png awesome. stuff like this restores my hope on the internet
 
@RoyMiloh actually, it makes sense for process explorer to show the base address as the legit physical address. I recall people using it that way.
 
@BenjaminGruenbaum I know it exists, but i think it's from another sysinternals' tool (?)
 
I think it's what Base means. Isn't it pretty easy to fire up a ton of small processes and check though?
 
8:41 PM
I'm on my mac right now :-)
 
user3119231
okay: Store your image in directorys and just add path to database -> This is much easier and makes good performance of database
 
@Maurize it's also not atomic
And doesn't scale well when you shard the database.
 
Anyway, I've been told that native dlls are shared via virtual address. It doesn't make much sense for me, on the other hand, how would they? I have a vague recall that you can define a virtual address for dll with VS, but not sure about that.
 
They can be shared at different virtual addresses
 
@copy How?
 
8:52 PM
The virtual mapping can be changed
 
@copy I know that, but I'm not sure about the whole idea of sharing by virtual addresses.
 
Why not?
 
it can be reserved
or committed by other page
 
That doesn't matter, it can be mapped anywhere
 
hi, could someone help me understand regular expressions?
 
8:56 PM
@StanleyDharan Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
You should determine where it's mapped before loading it to memory
@StanleyDharan go ahead
 
The location is determined before the program starts, isn't it?
 
so I'm trying to understand why when I made my expression it only half works
 
@copy you mean the address? yes.
@StanleyDharan what's your expression and how should it work?
 
like when I enter stuff into the prompt the inital entry is checked but anything after that fails, ill put a pastebin of what I mean
@RoyMiloh pastebin.com/r21SjGP8 so it checks if the entry is a alphanumeric but if i enter a special char after that it'll pass as true, im not sure how to stop that
 
9:00 PM
I've just read that default base address for VS dlls is 0x10000000. that means if you try loading several dlls and all are located in this address, only one will be shared.
@StanleyDharan example? it looks ok.
 
@RoyMiloh so if i enter "Stan$" itll pass as working but if I enter "%%$$$" it'll fail, I only want entries of a-z, A-Z, 0-9, -, and _ to pass as working
 
@StanleyDharan "Stan$" doesn't pass.
 
@RoyMiloh It does when I do it on my end, it pass's as true then alert's working, could something else be causing this?
 
@StanleyDharan maybe? I guess...
 
@RoyMiloh jsfiddle.net/9tv97gqq here is what i mean
 
9:12 PM
@StanleyDharan you forgot '$' at the end of the expression
 
@RoyMiloh with the $ it says when entering "Stan" it fails though thats why I removed it
 
because it allows one char
/^[\w-]+$/
it allows A-Za-z0-9_- one or more occurrences
 
yah im reading up on it on hte mozilla dev site, it matchs alphanumeric chars including the underscore, what allows it to occur more then once?
oh its the + right?
 
yes.
 
ohh okay cool, I never knew there was shortcuts, I thought you had to make the pattern manually everytime
I'm going to ask my prof if she can go over the reg expressions in more detail, still alittle iffy on the subject, thanks for the help
 
9:23 PM
no problem.
 

« first day (1814 days earlier)      last day (3128 days later) »