« first day (1662 days earlier)      last day (3303 days later) » 

12:01 AM
you guys good haha
far beyond my knowledge base :D
 
@m59 +1 enough jQuery
 
m59
@JoeConsterdine think very, very small. You asked a big question. You need to ask little questions like "how do I move an element left"
you can google that and read all about it
 
good advice
thanks
 
i need to sleep
but caffeine pills
wat do
 
sleeping pills
 
12:17 AM
Read the ECMAscript spec, that'll put you right to sleep
 
@rlemon lol yeah saw that earlier in the comments someone ruined the magic though
showed how to do it
you see the one with the guy on the carnival ride who keeps a straight face the entire time?
 
I used to do that when I was 14 and edgy
 
lol
 
12:51 AM
good morning
 
1:11 AM
So I was looking at a bmi calc
This is how they round to the nearest tenths
function cal_bmi(lbs, ins)
{
   h2 = ins * ins;
   bmi = lbs/h2 * 703
   f_bmi = Math.floor(bmi);
   diff  = bmi - f_bmi;
   diff = diff * 10;
   diff = Math.round(diff);



   if (diff == 10)    // Need to bump up the whole thing instead
   {
      f_bmi += 1;
      diff   = 0;
   }
   bmi = f_bmi + "." + diff;
   return bmi;
}
 
2:02 AM
I have ascii data for the image and save it in the file called image.log,now I want to convert the ascii data to image file.I tried this but my image is corrupted cannot be open.
var tempbin = 'image.log';

fs.readFile( tempbin, {encoding:'ascii'},function( err, data ) {
if (err) throw err;

var wstream = fs.createWriteStream( 'myphoto.jpg',{encoding:'ascii'} );
wstream.on( 'finish', function() {
// do something
});
wstream.write( data );
wstream.end();
});
 
 
1 hour later…
3:09 AM
@monners g'mornin
 
@Luggage cool .. i am checking them ... thhanks for the help .. it doesn't hurt to learn something new :))
 
@SomeKittens, can I ask some help why my convertion to image file is not working.I cannot open the image file
 
3:27 AM
@SomeKittens Hola
 
3:51 AM
everyone pray to the demo gods for me
 
4:45 AM
@phenomnomnominal The demo gods can be cruel and unpredictable, have you made the required sacrifices?
 
@ivarni just my first born, hope it suffices!
 
@phenomnomnominal That only works the first time you do a demo
for obvious reasons
 
Fuck, then I'm fucked
 
I try to have a screencaptured videofile as backup in case things go pear-shaped
if it's any coding involved I have a git repo with tags for every step so I can recover from making dumb mistakes
 
Yeah, done. I think it'll be fine. It's been in use for a few months now
 
4:50 AM
apart from that, good luck! most of the time it works out
 
No live coding thank god
 
5:27 AM
Yotractor?
 
Yeah, doing a talk at local node meetup
 
bar.com <-- this is funny
 
@phenomnomnominal congrats!
 
should be fun!
 
Is it on GitHub?
 
5:43 AM
 
@royhowie RACIST
 
but, honestly, what purpose does this tag serve?
the tag wiki has been visited 12 times over the past 6 years
 
5:57 AM
One glance on the front page questions for the tag indicates it's not very focused
 
6:08 AM
@SomeKittens Yeah but it's a very old branch, gonna push soon
 
@phenomnomnominal Make sure you link us when there's a video
 
I have problem in my code,the device is sending this kind of data
http://pastie.org/10151092

but my code only reads line by line, I will get an error

SyntaxError: Unexpected token K
at Object.parse (native)
at Interface.<anonymous> (C:\wamp\www\Mynode\mysocket\mysocket.js:287:33)
at Interface.emit (events.js:107:17)
at Interface._onLine (readline.js:214:10)
at Interface.<anonymous> (readline.js:344:12)
at Array.forEach (native)
at Interface._normalWrite (readline.js:343:11)
at Socket.ondata (readline.js:91:10)
 
@SomeKittens no video, but I'll throw up my slides!
 
Uhm
 
6:24 AM
Yeah, haha
 
@SomeGuy lol, asshole
 
:D
 
hello guys
i want help in replacing a \ with / in a javascript variable which is an image path
it has the wrong slash but when I try to replace it it doesn't seems to work
 
did you try escaping the slash?
certain characters have special meanings in strings
 
in fact in np++ the forward slash / seems to be in black in .replace()
yup right .. but how can i escape it?
 
6:33 AM
they're a different color because / (forward slashes) are used for regex literals
 
right
 
!!> 'some\\text'.replace(/\\/, '/')
 
@SomeGuy "some/text"
 
!!> 'some\\text'
 
@SomeGuy "some\\text"
 
6:33 AM
suppose a string is like 4\something.png
how to replace that with /
 
@CapricaSix Erm, that isn't right :p
 
so you want to do imgString.replace(/\\/g, "/");
@SomeGuy does she do auto string escaping when printing?
 
Maybe
 
!!> "some\\text".replace("\\", "/");
 
@royhowie "some/text"
 
6:35 AM
@SomeGuy also, if you use regex, you want to add the g flag
 
Yeah
 
how can i make this work
?
 
@PreetiMaurya I literally just gave you the answer
 
ooops sorry
 
"some\\text".replace("\\", "/");
 
6:36 AM
i will see it
hey thanks
@royhowie
 
@PreetiMaurya any time
 
actually there's a problem
it did work.. i was using that in ckeditor cum filemanager to select a file.. previously it used to at least select the file and show it in the ckeditor though with the wrong path.. but now it doesn't
the path of the image is right though
 
@PreetiMaurya windows or unix?
 
windows
 
shouldn't you be using backslashes then?
 
6:43 AM
but we have been using forward slashes till now
and also that the server is ubuntu but i am working on windows
 
hi to all,
have some doubt, i have one csv , then i read data from csv using ajax
but duplicate values need to filter so is it possible?
 
yes
 
Hello
 
@vanduc1102 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.
 
for example i have column heading as year, under year have 2014,2014,2015,2015 like
how can i filter duplicate values, please advice me
 
6:53 AM
Is there a primary key column? Then just use a map ID -> row
If the entire row is the primary key, the easiest way would be to filter before parsing each row
Any chance you should be using a proper database instead?
 
@KarthiShan Do you mean filter an array of data in JS, or do you mean display the data, create a combo box, fill in with values and "make it work" a.k.a. Excel auto filter?
 
hi all
 
in excel no need filter, but when i read values from jquery i dont get duplicate values @Sheepy @JanDvorak
for examples once i update in excel 2013, 2012,2013, 2014,2013, means i get unique 2012,2013,2014, like only
i already converted csv to json data.
but duplicate values are need to filter
have any refernce links for this?
 
7:09 AM
@PreetiMaurya then you might as well be on unix
 
7:27 AM
@KarthiShan Search on google or SO. Example: stackoverflow.com/questions/23507853/…
 
For people knowing Apache: Would there be today a serious reason to choose it over nginx ? Something it can do that nginx can't do (or badly) ?
(I'm wondering why a user I'm answering to is using nginx as front-end to Apache)
 
I don't know Apache but I haven't had a single reason in my life ever
I used it once I think. When PHP was still a thing
in the dark ages
 
nginx processes PHP natively so that wouldn't be a reason
(on the contrary as configuring PHP for Apache is a nightmare)
 
@dystroy sorry but I only noticed "PHP" and "nightmare" in your sentence
 
@dystroy That package manager might handle that for you though
 
7:37 AM
@dystroy it's not a nightmare... !
 
You basically pack your code into a package and ship it somewhere far away
 
@dystroy if you're using php, apache is much simpler
 
Well... as I don't want to remember too deeply the problems related to Apache configuration, I won't argue...
 
this isn't the area I'd want to venture into either
 
I work with both professionally in a hosting environment... trust me :P
apache is just "enable mod_php"
 
7:39 AM
@FlorianMargaine this is the reason why we can't have nice things websites
 
nginx is "enable and configure php-fpm, hope it works, proxy_pass to fpm with correct config
 
@dystroy well tbh, i'm comfortable with apache now, i used it for few years, now I tried nginx a few days ago, and it looked like a mess to me to configure it...^^
 
it's never "just"
it's an illusion
 
TBH I was deploying on windows at that time... so it certainly wasn't just "enable mod_php"
 
@BartekBanachewicz with apache? it totally is
 
7:40 AM
@FlorianMargaine PHP and the whole (shitty) ecosystem around it tries to hide the fact that some things aren't simple
IMHO it's actively harmful
if you're a newbie and want to deploy your first page use a ready hosting
 
<VirtualHost *:80>
        DocumentRoot /app/www

        <Directory />
                Options FollowSymlinks
                AllowOverride All
                Require all granted
        </Directory>
</VirtualHost>
when you have mod_php, the only apache conf you need is this ^
 
not a good reason ^^
No it's wordpress site. It doesn't work with nginx with first try and I do it with apache. — Sergey Kolesov 2 mins ago
 
@FlorianMargaine THE GOGGLES
@dystroy RIP. Abandon ship.
 
there's also the fact that wordpress/drupal/etc use htaccess files...
 
@FlorianMargaine unless when you're on windows where DLLs fight against you to stay unloaded
 
7:42 AM
@dystroy never used windows
2
 
on windows XAMPP is the easiest thing to use
 
If you're on Windows, download a package from apachefriends or whatever :P
 
at least was last time I checked
 
well, I did, but I was using wamp or w/e back then
or was it easyphp? don't remember
 
eh who cares install Gunicorn and write in Python
dum dum dummm
 
7:43 AM
@FlorianMargaine I try... But in 20 years working in the steel industry I had very few successes in making them install and maintain linux servers for production...
 
@dystroy hehe
 
I really, really miss mod_rewrite whenever I try to configure nginx.
 
well, on linux, having apache/mod_php is much easier than nginx.
 
having cancer is also technically easier
ok I'll stop now
last time I configured a web server was nginx+uWSGI and it wasn't that hard
 
Yeah, we should all take the hard way and write in Node.JS, I know. By the time we are done we should have reinvented the whole eco.
 
7:45 AM
> node.js
> hard way
are you sure?
this is the first time ever I see anyone say Javascript is "the hard way"
 
Well, if we do not have WordPress or Mediawiki on Node.js, it is the hard way to my company.
 
One thing is that both of those are ultimately shitty.
 
@BartekBanachewicz yup, that's not hard. As I said, there's the fact that most CMS use htaccess files. If you're on nginx, you have to reproduce its config, so it makes it harder
 
why don't you relax your requirements to, well, actual requirements and then look for alternatives?
@FlorianMargaine I see.
Derp, Haskell has its own HTTPd :)
 
php too
most platforms too, actually...
 
7:48 AM
well, I meant prod-ready
 
@BartekBanachewicz Like democracy. Or money.
 
@Sheepy Except we don't have a better alternative to democracy or money yet
Also, afterthought, I don't consider money shitty.
 
@BartekBanachewicz If you can point me to a better WordPress, I'm all ears.
 
@Sheepy I don't know your requirements (besides "has to be wordpress")
either way, have you ever tried to google for "wordpress alternative"?
 
As far as other CMS goes, keystone.js seems decent so far but I don't know if it's considered production ready yet
probably a massive job to migrate though
 
7:51 AM
Of course. We used quite a lot CMS and frameworks. Plus an inhouse one. Plus many tailor made ones that we inherited.
 
8:01 AM
morning
 
Hi
@AwalGarg you must practise more of RAF
and my first exam went tarnished shit
 
8:21 AM
good night meow
 
voted
I really miss the ctrl-up here...
 
Morning
 
it's half past ten already
 
not if you are british
 
8:28 AM
I'm still upvoted for an answer which only applies to retired versions of Java. I suspect many java coders are still building applications for JVM which don't receive security updates anymore...
 
Maybe it's because latest security updates for JVM essentially mean "forbid it from running in browsers"
 
it's not related to browsers. Nobody uses java in the browser. They failed that from the start.
 
polish tax system does
but they're switching to HTML 5 I think
 
Haha a question tagged both "feature-request" and "chat". Good luck! — rightfold yesterday
 
8:43 AM
@dystroy Meet India
@AwalGarg also its better to use a bound when showing a landscape
because the viewport could be of any size
where it might not be pleasing to look :-)
 
9:01 AM
@dystroy Actually, I think the rule is that Java in the browser must only be used for the most business-critical processes
 
@AlexisC. Right, it's prettier, I'll update. As java7 doesn't even receive Oracle's updates anymore, I took for granted devs are all using at least Java8. I know I'm somewhat optimistic but I'm reluctant to assume bad practices... — dystroy 4 mins ago
Will this ignite flames ?
It's so prettier to use streams instead of loops...
 
Wow, Java in the browser reminded me of a Java game I used to play - I enter the site, and it didn't change from 1997 - this is pretty funny :D ffiends.com
 
> ©1997-2015
 
@BartekBanachewicz $2 says it autoupdates :D
 
9:07 AM
// above icon used in marker
			var marker = new google.maps.Marker({
				position: info.pos,
				map: map,
				title: info.title || 'yo mama',
				icon: icon,
				opacity: 1
			});
@AwalGarg o_O 'yo mama' ?
you do realize where we live this will translate to hey uncle ?
 
> Best Viewed with Netscape and JVM 1.3.*
 
'View Source' to see how it is written. test
 
dat document.layers
 
9:14 AM
any websockets "teacher" in here? ^^
 
onMouseOver="if (document.images) {document.m2about.src='/Images/Inc/Menu/CompanyOver.gif'};"
dat feature detection
 
@Julo0sS Depends. What's the rate ?
 
106
Q: How can I animate the drawing of text on a web page?

strugeeI want to have a web page which has one centered word. I want this word to be drawn with an animation, such that the page "writes" the word out the same way that we would, i.e. it starts at one point and draws lines and curves over time such that the end result is a glyph. I do not care if th...

this is really cool
 
@dystroy well, i'm totally noob about it, looking for tutorials, but I don't really understand the logic... I installed nginx (@AwalGarg told me it was the best way to go for ws) but now i did that, idk what to do at all. I have a simple js script which seems to test browser ws compat, that seems to work, but thats all i got
@dystroy short : I'm nowhere
@dystroy what I have is only a "client-side" script. What I need is to understand & create simple server-side
 
nginx doesn't do websockets. At best it proxies them. You need an application server (be it in java, go, iojs, assembly, etc.)
 
9:24 AM
@dystroy apache does?
 
!!afk
What is exactly the question ? Is it whether the code is running ? Or whether your code is hacky, dirty and just a trap for maintainers ? — dystroy 11 secs ago
I don't know what to do with that silly opiniated question
 
is it ok to put <div>s into <label>s? My editor is giving me weird warnings about it.
 
how do you call a combobox where you can see multiple lines in it
for example 3
 
<select multiple>
 
9:41 AM
@Neoares that's not what I want, I want to be able to select a single item from the list, but the line has multiple lines so I want to see at least 3 of them
 
<select size="3">
 
Cool. The quotes in the code blocks in eloquentjavascript.net/Eloquent_JavaScript.pdf were fixed :)
 
hello guys. Good afternoon!
has anyone worked with JSX?
 
@Neoares you still don't understand, I just want a combo like a normal combo, but that allows for multiline values
I don't want a list of all items
 
9:51 AM
I'm only listing 3 :d
 
@iAnum Is this a poll?
 
@iAnum yes, lots of people
 
@OliverSalzburg lol no it is not
 
too late, now it is
 
9:59 AM
@BenjaminGruenbaum well that's great. Actually I am bit afraid of asking Question since I am a newbie. Hopefully, I won't get a harsh response from here :P
@Neoares just saw that link. Nice one ^
 
@Neoares man you don't understand or you are trolling, seriously, I said a single item with 3 text lines, not 3 separate items
 
@ziGi last message was troll :)
 
@ziGi don't be rude.
 
I am not
how can you tell the tone of what I am saying by reading it
 
Fun shower thought, the voices in your head are always the same volume.
 
10:34 AM
I DON'T THINK SO
I mean, in a way
 
@BenFortune I have a difficult time gauging the volume of screams
 
@dystroy where's the question?
 
@Neoares You probably can't see it because of your rep. It was closed.
 
Users with low reputation can see closed questions, can't they ?
 
10:44 AM
yes
 
I have only 46 rep xD
 
not deleted questions, though, and closed questions often get deleted
 
I'm seeing it as On hold
 
how would you make the #ball div less sensitive to the arrows? if you hold on too long it keeps going for ages hhaha

https://jsfiddle.net/84fng66y/
 
@BenjaminGruenbaum Please stop web stalking me.
 
10:52 AM
Hey guys
how are you all doing , hope you all are having a great day
i have a small question
var images = [
{ src: '1.png', alt: 'I am the first image' },
{ src: '2.png', alt: 'Second image' }
];
??????
what on earth is this kind of an array called
 
It's an array of objects.
 
whats the difference between such an array and a normal array ?
is it a common occurance in JS
?
 
it's just an array, period.
 
iirc benjamins birthday is coming soon right ?
 
Thank guy guys !
have a nice day !
 
10:56 AM
@AlexanderSolonik nothing, it's a usual array that contains objects as elements
you can mix elements in the array up too, doesn't matter
 
@darkyen00 Really?
 
who had the list of regular birthdays?
@SomeGuy ?
 
@GNi33 facebook
 
yep it should be 9th -- unless something on my phone is wrong
 
10:58 AM
@AlexanderSolonik An array could contain anything
 
That's one I have bookmarked. I think there's an updated one somewhere too
 
Including other objects and other arrays
 
@darkyen00 yeah, facebook tells me the same :)
 
Bartek is on 7th btw
 

« first day (1662 days earlier)      last day (3303 days later) »