« first day (2070 days earlier)      last day (2863 days later) » 

12:12 AM
ended up with shorts and a "fuck it" shirt
and it was pouring rain like... (put something not dirty here)
but I think I nailed it
I mean, I was like "why am I on stage again?" a couple of times
but people had a laugh and I got more applauses than the courtesy ones, so that's good
 
wrong link wrong chat sigh
 
What did you do a talk on?
 
@Luggage in between talks the meetup has a show and tell session, in which I quickly explained how the lazy 3d with lazy canvas works and the things you can do with it
it was more to spark the interest than to have any real knowledge sharing
can't wait to see how fucked up my accent was
 
Anybody intrested I just configured Star Topology with RTC, TBH this is bs mixing audio in JS FFS for every client seperately :-| </rant>
 
ahh, cool
 
12:26 AM
Btw Hi guys
and cool @towc can we see the talk :D
 
hey @Abhishrek :D
when it comes out I'll make sure to spam about it
 
:D :D Atta boy!
 
Why the hell is the title still about that question?
 
12:41 AM
Cause people n here are apparently
awaiting the Javatar
 
1:18 AM
@AndrewL htm is basic for java
 
@VeronicaDeane Is the question still there?
 
@AndrewL deleted 1 hour ago
 
Damn
The memories
 
1:36 AM
yo
 
Ahoy hoy
 
o boy
yo soy
 
1:59 AM
hello guys
/^0$|^[1-9]+[0-9]*$/.test($(this).val()); how can i change it to work with negative and positive integers?
 
@gtzinos maybe regexr.com will help
\d maybe?
I just hack regex when I need it
cya kids
 
2:33 AM
Hey they found the body of the kid who was killed by a gator
 
was it inside an alligator?
 
No
Gators don't eat humans
Just drown them
 
what wasteful jerks
 
They don't like being stepped on
 
Hello, i can ask a small question here?
 
2:42 AM
!!welcome MagicHat
 
@MagicHat Welcome to the JavaScript chat! Please review the room 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.
 
@CapricaSix right
<input type="file" id="files" multiple />
<div id="list"></div>
<script type="text/javascript">
function handleFileSelect(evt) {
var files = evt.target.files;
for (var i = 0, f; f = files[i]; i++) {
if (!f.type.match('image.*')) {
continue;
}
var reader = new FileReader();
reader.onload = (function(theFile) {
return function(e) {
var span = document.createElement('span');
span.innerHTML = ['<img style="height: 75px; border: 1px solid #000; margin: 5px" src="',e.target.result,'" title="', escape(theFile.name),'"/>'].join('');
 
Idea: Predictive Refactoring. Your editor detects a repetitive action performed in multiple files, identifies the common bits and asks to keep applying it to other files for you.
 
Is simple upload multiple files with thumb, but i need reset thumb if select more at 5 images
@Luggage tks for see my problem, i can't undertand your idea
 
@MagicHat The thumbnails are set in onload, and your "not work" line is set outside of (and thus before) those onloads.
 
2:52 AM
morning
 
@MagicHat Luggage is not exactly responding to your question, just throwing some idea around.
 
@Sheepy sorry my poor interpretation, but why the alert and your sister line work around de if?
 
@MagicHat All three lines work. They just work before reader.onload.
If you watch carefully you should see that the thumbnails (in the onload) does not come up before the alert is dismissed (outside onload).
Try moving the whole if block into reader.onload. If it still don't do what you want, rethink how to do it.
 
@Sheepy u are a great Sheepy...tks
 
Cheers. May God bless and guide you. :)
 
3:38 AM
!!s/God/Satan/
 
@phenomnomnominal Cheers. May Satan bless and guide you. :) (source)
 
lol
 
3:59 AM
@VeronicaDeane that's interesting.
 
 
2 hours later…
user3119231
6:00 AM
Good morning from Germany!
 
@Maurice Guten Morgen! o/
and god morgen from Denmark! :)
 
god morgen DK o/
 
\o
let's put your early morning brains to the test:
 
6:16 AM
partial attention only! re-routing power to figure out all these errors I introduced before bed
 
i've got a factory for making parts of a menu system, and works fine. but I have a section of repetitive menu options ("program 1", "program 2", etc.) that would be nice to loop over, instead of having to write out each of the 10 factory generator lines. i was thinking something along the lines of the following, but it just doesn't seem like it would work... smells wrong, you could say.. like it's... like it is too easy an answer.. :) have a look:
var my_list =  ["program1","program2","program3"];
my_list.forEach(function(programs) {
    var programs = menuFactory.makeMenu(title = programs);
});

// produces... ??
// console.log(program1.title)   gives me "program1"
// console.log(program2.title)   gives me "program2"
but smacks of the need for 'variable variables' again... which i don't want to really do
(this is just off the top of my head, mind you... before coffee is injected)
or injested*
 
ah, great one while I wait for the kettle
 
other stuff is going on inside the makemenu method, just truncated so i don't have to make a fiddle
 
best use Array.prototype.map(), that will give you back an array with all the factorized items
 
ooooh... haven't played with Array.prototype.map yet...
googles
 
6:26 AM
if you find yourself having to pass custom options to makeMenu, then you can use an array of tuples: [[title, options], [title, options], ...]
 
right. my original idea some months ago was to just pass an array or JSON object to a function to spit oout the entire menu layout, but then found out about factories.. i have something like this already, but is only used for a standard drop-down menu that was easy to iterate through.
menuData = {
    "menu": [
      { id: 0, name: 'DasnBoard', image:'/Images/dashboard_on.gif', link: { topic: 'DashBoard', tab: null }, subMenu: [
          { id: 0, name: 'Main', image: null,
            link: { topic: 'DashBoards',
                    grids: [ { g: 5 }, { g: 6 }, { g: 8 }, { g: 13 }, { g: 27 }, { g: 28 }, { g: 71 } ]
                  },
            subMenu: null
                  },
          { id: 1, name: 'ET & Moisture', image: null,
            link: { topic: 'DashBoards',
...and so on
 
yup, looks good, supports nesting!
 
but building a completely new menu system using svgs didn't pan out the same way, as i have to build the menu first, *then build the event handlers on after (because i don't know what menu options are happening later)... old demo is here: jsfiddle.net/digitalmouse/by8w6ky9
so i thought the above menuData array would not be helpful, and i switched to factories...
but now you lead me to Array.prototype.map()...
hmmm
reads and attempts to grok
!!s/Satan/Nachos
 
@thedigitalmouse That didn't make much sense. Use the !!/help command to learn more.
 
aw..lost context
oh well xD
 
user3119231
6:39 AM
is nice. I like the system.
 
just didn't want to hand write out - and later maintain - all that stuff seen in the jsFiddle link above for about 150 menu entries... has to be a better way to generate the wheel menu parts, so factories looked good up until now where I encounter the prog1, prog2, problem... especially when each of those menu items has three submenus >.<
so i'm still doing the same as in the fiddle, just instead of 25 lines per menu, I only have about 10 :P
by using factories
or maybe 5 if i trim stuff down
 
@thedigitalmouse If you do your best to DRY - Don't Repeat Yourself, you will recreate many design patterns without needing to learn them.
 
aw.. you gonna make me read again? :D
 
Mornin'
 
\o @Cerbrus
 
6:51 AM
@thedigitalmouse What can I say? I kind of love reading. When the mood strikes me. :) Currently reading "From Girl to Goddess" and another book that, uh, research the evolution of Hong Kong Chinese and its difference with Standard Chinese. Both are short. The later managed to spend less than 20 pages talking about what is Chinese.
 
nice @Sheepy ! I just finished (again, after 30 years), "Stranger in A Strange Land" (Heinlein)
 
\o
unfortunately, @Sheepy reading is a luxury... this menu system is one of those "should have been built last week" projects with a client breathing down the manager's neck sort-of-thing :) So I must skim and use what i can figure out and move on with the knowledge that i'll have to go back and refactor at some point
although i try to refactor on-the-fly as I go, wherever I can
 
@thedigitalmouse A good book. Anyway, DRY is a pretty basic principle. Don't repeat your code. Spend the time to rewrite them into functions and perhaps object. Soon you'll have your own library.
 
7:06 AM
(☉ω⊙)/
 
\o too bad there isn't a text-only angry bird to compliment that pig xD
 
That's a pig? 😕
 
Y ☰(▽∋▽)☆ (XωX)
 
well it looks a bit like the pig from the Angry Birds game
 
Not much into games.. :|
 
7:13 AM
looks at the chatroom title, "ah i see we are still abusing poor zeeshan with his expert javascript knowledge :D
 
@cswl It's ok. A movie is comming this year. B)
 
@Sheepy damn communists!
 
I don't watch movies either :|
 
I watched warcraft film
I was disappoint.
 
Well. We don't have communist party here. In fact, they are so unpopular that their puppets have to call themselves "Democratic Alliance"......
 
7:21 AM
Communism is very popular in italy surprisingly
 
@cswl I immediately lost my interest in that one after merely looking at its poster. :|
 
The central reason is because some considered the Russians saviors after second world war
 
@Neil They also thought the Nazis were the good guys (at least initially)
This leads me to believe that the Italian government's decision making skills are lacking :P
 
Though as I understand it, it is a weak form of communism that they support. No Marxists
@MadaraUchiha you determine this only from the information that I gave you? Read the news more often ;)
 
@Neil I determined that 8 years ago in 10th grade History lessons.
 
7:26 AM
The grandmother of my wife recalls a bombing during ww2 where they had stacked cast iron cooking pots in which strangely only the center one shattered
 
lolwut
imgur.com/gallery/UPF0z I'm going to hell.
 
Did you see the video of that drunken idiot that tried to pet lions?
 
user3119231
insane
 
@Neil Deep down inside I wanted him to get mauled
Horrible I know
 
I do think if anyone is stupid enough to let their child wander into a gorilla cage or drunkenly stumble into a lion pit, efforts to save that person should be limited to the extent of not harming the animal
It is one thing if the animal escapes and quite another if the animal is not in the wrong
A tranquilizer is more than sufficient
 
7:39 AM
> Dark humor is like a child with cancer, it never gets old.
oh shit :D
 
@thedigitalmouse it's an owl
 
@littlepootis never seen an owl with a nose like that :p
 
8:01 AM
Ello
If I use something like parsedUrl.query like 50 times in the form of parsedUrl.query.w, parsedUrl.query.h, parsedUrl.query.quality and parsedUrl.query.gravity
Would it be better to do var query = parsedUrl.query; and then query.w, query.h etc?
For node.js
 
Better. But do it for readibility rather than speed.
 
Would speed be more of a factor if it'd be like parsedUrl.query.whatever.something.x used like 10 times?
And then doing var whatever = parsedUrl.query.whatever.something;
Does that matter at all? Or am I understanding it wrong that in a situation like that speed would be affected more
 
user3119231
Everytime I used "function" instead of the arrow I know I was very tired or in rush.
 
8:26 AM
@StrahBehry test it and see
Only way to be sure
@Maurice wife: "I know you don't like archery, but what is with you today? " you: "function! function! function! function! "
 
config.web.containers.sizes.size if I turn that into one variable
And there are more then 3 usages
It's a performance gain
 
user3119231
@Neil he, good one this was
 
@Maurice I swear I am turning into my dad
 
apple does not fall far from the tree sort-of-thing? :)
 
@thedigitalmouse no, science experiment gone wrong
 
8:43 AM
Anyone experienced with Anuglar?
Angular*
 
@BenjaminGruenbaum they are completely different
blessed is a library that splits css into multiple files
to avoid IE9 rule limit
 
@Mosho yeah, that's an awful "bug"
and if anyone is interested: github.com/BlessCSS
 
feature*
 
@StrahBehry In theory, yes. In reality, may be. In practice, property access is a lightning fast common operation. Your test may run it a hundred millions times and still unable to find a meaningful difference.
 
8:50 AM
@Mosho that's why "bug" is in quotations :p
it's unexpected, it's an imperfection (i guess), therefore "bug"
 
@StrahBehry Like Neil said, the only way to be certain is to test it. But worry about its speed is premature optimisation and is bad.
(Readibility, however, is a very valid reason to optimise it :)
 
@Sheepy There is a meaningful difference of half a second tho
 
> After the attack, five alligators were seized and killed in an attempt to find the boy's remains.
for serious?
5?
 
It's called 10 times per file in my POST request
If my post request has 5000 files...
It went from 31 seconds everytime to 30,4-30,6
 
Need some help with Angular: stackoverflow.com/questions/37854414/…
 
8:56 AM
@StrahBehry that isn't meaningful
 
Many small things like that add up
 
But it wouldn't do harm to put it into a variable the same
 
When I started on it did 300 images in 90sec
Now it does 14k in 90sec
 
> asked 1 min ago
Give it fucking time
 
But yeah it does increase readability a bit but I'm afraid
The code I wrote as intern for this image resizer
Isn't understandable for anyone but me which is obviously really bad
 
8:59 AM
@Mosho oh
 
@StrahBehry deep dark code secrets get buried in a hard-to-find function for no one else to see
Not that I have such code. <.< >.>
 
@Neil The problem is that the libraries I ended up using have terrible documentation that misses things or has wrong info so it was trial and error for me
 
@StrahBehry so rewrite it, now that you know more
 
I have? Like 5 times
But also now that the node.js team has deprecated fs.exists
you need to use this shitty callback on fs.statSync to catch an error to see if something exists
Because they say why would you check if something exists if you can just try to open it and catch the error if it doesn't?
Yeah like when I want to open a file it's the only time I want to check if it exists /s
 
@StrahBehry statSync doesn't have a callback
 
9:11 AM
I mean the async one my bad
Like this for example (bot is gonna remove it because I forgot the combination to post code)
 
1 message moved to Trash can
@StrahBehry Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
 
fs.unlink(filepath, function(err){
                if(err)
                console.log(err);
            });
form.onPart = function (part) {
        try {
            var file = part.filename.split('.'),
                ext = file.pop();
        }
        catch (err) {
        }
        try {
            fs.statSync((form.uploadDir + '/' + part.filename + '_w' + query.w + '_h' + query.h + '_q' + query.quality + '.' + ext).replace('//', '/'))
        }
        catch (err) {
            if (!part.filename || part.filename.match(/\.(jpg|jpeg|png)$/i)) {
                this.handlePart(part);
            }
How understandable is that part?
 
So long as you learn something new and fundamental of a library, you should strongly consider rewriting your interface with that library
 
Like I have no idea how to make the form.onPart more understandable for others
And the documentation to what it actually does is basically non existant
 
Does sound like an awful library though, to your credit
 
9:16 AM
@Neil Nothing wrong with it, github.com/felixge/node-formidable
 
Yeah and that documentation really explains
 
@StrahBehry Never had a problem with it, used it multiple times in the past. What are you having trouble with?
 
@StrahBehry What happens if you simply call handlePart, without checking file existance? Would it throw error or would it not throw error but do something wrong?
 
what handlePart does it pass the file on and then it goes through the code like it would without the onPart
It the follows the default behavior
The try catch around statSync is to see if the image already exists and if it does it won't process the image and pass it through the resizer eventually
Well Ben a issue I'm still having is that there seems to be no way to check the Magic Number of a file (to confirm file extesion) so you can't rename a .exe to a .jpg and then upload it BEFORE the file is uploaded to the uploadDir
 
user3119231
@bitten for me it doesn't matter if you're muslim or christ, because I hate the whole world anyway.
 
9:20 AM
@StrahBehry What I mean is, Node.js deprecated fs.exists to force you to consider race condition. Your code still has that race in it.
 
I'm not sure I understand what you mean
If I call handlePart without checking file existance it overwrites existing images which is a huge performance loss if it already exists
 
@Sheepy It's sync
 
Yeah it has to or it passes on before it's confirmed @BenFortune
 
@BenFortune Doesn't mean it won't change from non-exist to exist between the check and handlePart, which I assume will create and open the file.
 
handlePart will start writing the file in the current stream to the uploadDir
Then there is a check if any query was passed that implies I want the image resized at the same time it's posted
And if it is then it gets resized, if not it just gets uploaded to the specified uploadDir
 
9:27 AM
@StrahBehry Just curious... does handlePart do that filename stitching too?
 
Yes but like this fullDestinationPath = (form.uploadDir + '/' + file.name + '_w' + size['w'] + '_h' + size['h'] + '_q' + query.quality + '.' + file.type.split('/').pop()).replace('//', '/');
If that's what you mean @Sheepy
 
Ok......
 
Why?
 
1) You can get your extension (no dot) with require( 'path' ).extname( part.filename ).substr( 1 )
2) Let handlePart call fs.open with flag 'wx'. It will fail if the file already exist.
3) This way, you only need to compose the filename once, and have two less try.
Oh I almost forget. Pushing the exist check to fs.open not only improves performance, but also avoid the race condition.
 
What do you mean with handlePart(part) calling it?
 
9:37 AM
Can I have a mapping array ?
one way or other :|
or maybe it should be an object instead
 
I changed 1)
 
@StrahBehry Can your show me your handlePart Code? Is it long?
 
2) isn't possible because there is an autoresize option
It's from the library
 
@StrahBehry pass link to library then :P
 
9:39 AM
I don't like node, at least for now
 
Which goes back to my question... What happens if you call handlePart while the file exists? Would it throw error or would it not throw error but do something wrong?
 
Let's say I make a post request with 5000 files in the body
No
handlePart then uploads the file to uploadDir
And then it starts processing it and overwriting the file if it'd already existed
If I remove the whole form.onPart = function (part) {
It would be the same as doing
 
I see. Forget (2), then, if you don't want to modify library code.
 
form.onPart = function (part) {
       this.handlePart(part);
    };
this.handlePart just says, Formidable you can handle it
Not calling that in onPart tells it I want to handle the processing completly
But if I then just do nothing with it, it "skips" the file
Which is what it should do if it's an .exe for example
Or it would upload the .exe to my uploadDir and then try to resize a .exe
 
But you can move the if to before the try.
 
9:43 AM
No?
Then it doesn't check first if the file exists
Also what I wanted there is to check for the magic number before uploading but that seems to be impossible
So now I could rename a .exe to .jpg and upload it
And then when it tries to resize it the resizer library is like... hmm that isn't actually an image and it throws an error which i then have to handle
@Sheepy is it possible to do like a private message?
 
Is there any library that converts singular words to plural
and plural to singular ?
*English only
 
@Mathematics Pluralize
 
thank you :)
 
10:00 AM
hi, is there a library of some sorts for grunt/gulp/brunch that will generate a resultant file having a md5 checksum, like app.js will be app.<md5(app contents).js and will generate a manifest file for the same?
 
@shortCircuit I am not sure
 
hm.. at first fingerprint-brunch felt good, but I realize I a m mistaken .. I should go and ask the guy on gitter
 
10:39 AM
Did anyone here ever work with both Vue and React?
 
who is the bitch that resets the stars over and over again
my hate goes towards you :p
 
10:56 AM
stars?
5
 
11:20 AM
twinkle twinkle little stars, i wanna get featured in the sidebar
 
user3119231
CSS is fine but with JS it's <3
 
a nightmare came true
I may be starting to like emacs
 
@ssube How'd you setup tmux with the key bindings?
In Atom
 
11:37 AM
give me VIM or give me DEATH! \o/
(actually i'm recently partial to Atom)
 
!!xkcd real programmers
 
True!
 
@VeronicaDeane I got you fam
 
0
Q: What is the significance of the so called Planck force?

ZoranSo, what is the significance of the so called Planck force, and why is it called Planck force, when it has nothing to do with any of the Planck's discoveries? The Maxwell’s wave equation is $\nabla^2 \mathbf{E} = \epsilon \mu \frac{\partial^2 \mathbf{E}}{\partial t^2}$ that is, $\nabla^2 \mat...

This guy needs to mellow out a bit
 
0
Q: How to get Specific chars from string in jquery

Ram SinghI have following html, can't use "attr", so according to me only substring is the option to get specific data from following html: <video poster="images/IMG_4979.jpg" controls=""><source type="video/mp4" src="video/IMG_4979.mp4"></source></video> Actually, i want to get poster tag's data. i tr...

please help me
 
11:51 AM
Hey guys
 
@RamSingh document.querySelector('video').getAttribute('poster')
 
Hi Ben
I am dealing with Banks right now
and they have this secure pin
that they want to keep a secret
Let's say a user enters the secret pin and then I am sending it via my backend
is there anyway to make sure when the password reaches me at the backend it is such that I cannot log the real mpin
 
which part is not clear?
 
@GandalftheWhite Sounds like you shouldn't be dealing with banks...
 
11:58 AM
it a*
@BenFortune :l is there any way?
 

« first day (2070 days earlier)      last day (2863 days later) »