« first day (1673 days earlier)      last day (3280 days later) » 

12:00 AM
AngularJS: How can I set a variable to the $rootScope so when user has successfully logged in, a ng-show shows a little user control panel? How to write that expresion? like ng-show="{$rootScope.logged === logged}"
 
12:18 AM
kay, so, I have this code: hastebin.com/neyufiyaho.js, which is generating this error: hastebin.com/raw/ocedepeqic Obviously String.replace isn't causing a stack overflow, so I'm thinking it's something to do with the async module I'm using.
any thoughts? obvious memory leaks?
I managed to generate a js stack trace from that C error that was showing up earlier
 
Probably infinite recursion
 
how?
I mean how is .replace() causing infinite recursion?
 
Not in replace
 
I can't see any recursion
 
Me neither
What's quoteRegex?
 
12:26 AM
var quoteRegex = /href=|("|')/ig;
 
Looks good
 
what gets me is why it's specifically at String.replace
 
If it's an infinite loop, it has to end somewhere
 
Oh, replace callback() with setTimeout(callback, 0)
That's a bug in async.js though
lol async.js, use promises
 
12:32 AM
am n00b
/goes off to check out promises
 
!!Mad Max or Age of Ultron
 
@RyanKinal Mad Max
 
just came back from mad max
batshit
 
... I'm not sure if "batshit" means good or bad...
 
12:46 AM
thanks @copy, that fixed the memory error, and promises looks interesting
well mad max was a 99% tomatometer
so I'm going to guess "good"
 
They look promising, one might say
 
If I could, I'd totally see both... but it's too late for that tonight.
@copy </winning>
!!3D or not 3D
 
@RyanKinal 3D
 
Caprica really wants me to see Mad Max, I guess. Avengers isn't in 3D.
 
12:52 AM
@RyanKinal WATCH AVENGERS
 
lol
 
avengers was good
I saw it 2x
 
!!s/s/th/
 
@RyanKinal I <3 Lithp (source)
 
12:58 AM
haha
 
Sorry @CapricaSix, but I think I'm going for Avengers
 
    quick question , .... i have this javascript   $('.iconM-testimonials').on('click', function () {
     $("#colorscreen").addClass("fadeInUpBig");
      $("#colorscreen").css('background-color', 'rgba(164, 196, 0, 0.2)');
        $(".tile-group.main").css({ marginLeft:"-40px", width: "1080px"}).load("musability-musictherapy-company-overview.html");


});
basically i want to check if the class fadeInUpBig currently exists and if it does i want to put this code into it ...
$(".fadeInUpBig").replaceWith($(".fadeInUpBig").clone());
i need some kind of an if statement but cant for the life of me think how to do it
if fadeinupbig doesn't exist then $(".fadeInUpBig").replaceWith($(".fadeInUpBig").clone());  otherwise $("#colorscreen").addClass("fadeInUpBig");
 
user1596138
className
 
user1596138
Is @rlemon on the internet
 
probably not , he was on earlier
 
user1596138
1:11 AM
My joke is not going to work...
 
wtf
isSet(Windows)
in javascript o_o
 
dont worry i am sure it was an "in" joke that only most of the community would of got anyway
 
1:38 AM
Scala is fascinating
 
user1596138
2:09 AM
I had pizza for dinner.
 
user1596138
!!is the room dead?
 
@Jhawins Not a chance
 
DONE !
 
 
1 hour later…
user1596138
 
user1596138
@Hat
 
user2620028
looking
 
user1596138
wtf lol
 
user2620028
WTF
 
user2620028
i am so much happier now that the world has cameras placed on everything so we can record these WTF moments and just sit in awe.
 
3:25 AM
They found a ninja
 
user2620028
3:44 AM
indeed they did
 
user2620028
They fucked a ninja up is what they did haha
 
user2620028
Now you don't only need bark breakers but ninja prods too?
 
Sorry for bothering you all
Before anything else, Good night.
I have a small question, that hides a huge problem
I hope you can help me
 
@Jhawins god damn that's gotta hurt
 
I'm trying to match a number that isn't preceded by a letter
The regex I have: /(?![a-z_]+)([+\-]?\d+(?:\.\d+)?)(?=[\b\s(),])/g
It works great, except, for example, when I try to match a2 it matches the 2 when it shouldn't
Do you have any idea on how to do this work?
 
3:53 AM
@rlemon what the fuck since when was The Game in that video
@IsmaelMiguel not sure, sorry
never got around to learning how to use regex
 
MLM
@IsmaelMiguel Add a Beginning of string character ^ in front of your regex
 
@MLM I can't. It is supposed to match SQL
 
MLM
@IsmaelMiguel Some test cases would be great. Make some unit tests: debuggex.com
 
You can see there the effect
@nick If you want, I can try to help you to learn.
I'm asking about this here because Javascript doesn't have lookbehinds
Which makes it extremely hard
@MLM Notice the s1 and s2, at the bottom.
(Ignore the color choice)
 
@IsmaelMiguel I appreciate the offer but I think I'll wait until I have a situation that requires regex :)
 
MLM
3:58 AM
@IsmaelMiguel Please simplify the problem and make some clear unit tests on debuggex or regex101
 
@MLM The problem is really simple: in s1 and s2, the number is being matched, which I don't want it to. It works fine in all and every other situation.
@nick Like parsing broken HTML5?
 
@NickDugger had a look at your link, looks good. is all the keypress/movement logic contained within your engine?
 
@IsmaelMiguel i'd probably use a web scraper library
 
@MLM That won't match any other number. I will prepare a unit test, after I figure out how it works.
@nick I know, I was just joking! I would never parse HTML with regex, let alone broken HTML5!
 
MLM
4:03 AM
@IsmaelMiguel Just add some more lines to the "test string" I added the multiline flag: regex101.com/r/fG9zT0/2
 
@MLM That wouldn't be a proper unit test. I figured it out, I just need 5 minutes. Or less.
With unit test, showing what fails and what doesn't.
(don't forget to switch to Javascript, or the results will be slightly different)
(Actually, it's the same fail, disregard the last message)
 
@AwalGarg is it the same version of the module for all 3 installs?
 
MLM
4:18 AM
 
AngularJS:
    $scope.newUser = {};
    if($scope.newUser.length()) {
      $scope.gotUser = true;
    } else {
      $scope.gotUser = false;
    }
Why can't I use .length() there?
 
@MLM But it won't match a number now.
But thanks, I will look at page 4 on Google
 
@Frondor because empty objects don't have that function?
 
(Yeah, I'm that desperate. Or maybe I'm searching it wrong?)
 
@JanDvorak any idea how can I check if newUserhas any value at all?
 
4:21 AM
@Frondor You've just given it one
 
MLM
@IsmaelMiguel Add some more tests, for what you expect: regex101.com/r/bF7uY2/3
 
@JanDvorak how? it's empty and I never asign any value to it
 
An empty object is also a value. What kind of value do you want?
 
MLM
@Frondor If you want to see if the object has any keys, you could do: Object.keys($scope.newUser).length
 
4:24 AM
I want to bind a message with an input element, so when the user starts typing it's username (gotUser) the message shows.. for that I need to use something like ng-show="{{gotUser}}" so it returns true or false
 
I've added a few unit tests
 
I think I should define a variable instead
 
There's nothing complicated there, like "2" (that is handled before, and won't be affected by that regex).
 
@MLM Holy crap! That works! The only problem is that -12.5 is being matched without the -, but it should be fairly easy to fix.
Thanks a lot for your help!
 
MLM
4:28 AM
@IsmaelMiguel Matches for me, test please
 
Search for -1.25
6th number on that insert into.
 
MLM
@IsmaelMiguel Make a test on the regex101. Much easier to see if everything is in order there
 
Last test case, it even shows what I expected and what it got.
The problem is the ,-
 
MLM
(also, if it was you, unstar that regex101 revision. Not an appropriate use of stars)
 
@MLM The regex now eats up a few characters that it shouldn't.
I've added 2 unit tests
I will use the regex on revision 7 and try to figure out a way to fix it, if I can
 
MLM
4:35 AM
@IsmaelMiguel Capture group1 is the appropriate characters?
 
@MLM What do you mean?
 
MLM
,'B',3.99) captures 3.99 in group1
 
@MLM But it matches ,3.99. In that fiddle I sent, with that regex, the result of matching (1,'B',3.99) is 1,'B'3.99).
But I can try something to overcome that 'problem'
 
MLM
@IsmaelMiguel Why is DOUBLE(16,2) fine in your current system? If ,'B',3.99) is not
 
@MLM That's an old unit test. But I've fixed it. I used your regex, but I used a different replace string. instead of '<span class="number">$1</span>' I used '$1<span class="number">$2</span>$3' and changed the regex to capture 3 groups.
 
MLM
4:43 AM
@IsmaelMiguel Cool
 
jsfiddle.net/8vd2ktaz/2 <-- Check here, the result
Thanks a lot for your help
 
MLM
@IsmaelMiguel no problem. Have you looked at other sql highlighters?
 
I did, but I'm making my own multi-language syntax highlighter
You know, for fun.
I have around 90% coverage on SQL.
In PHP, it only matches variables, here/nowdocs and keywords.
Javascript matches a bit more, but nothing interesting
CSS is completely broken
 
MLM
lol, I tried doing some CSS selector splitting and ended up with this. Got some help from OnlineCop in the IRC #regex channel for that though: github.com/MadLittleMods/postcss-css-variables/blob/…
 
I have something a little different, in a question
I tried to 'fix' CSS selectors and 'clean' them up to 'regularize' them.
 
MLM
4:49 AM
If word boundary \b were configurable (define what a word is). It could of been as simple as /\b\s(?![><+~][\s]+?)/
 
0
Q: CSS selector clean-up function not working properly

Ismael MiguelI have this "simple" function to clean a css selector. clear=function(selector){ return selector //trims whitespace and removes newlines .replace(/(?:^\s+|[\r\n]|\s+$)/g,'') //remove double spaces .replace(/[ ]+/g,' ') //normalize the pseudo-selector...

I did that there
Which is some frankencode.
I tried to do too much at once:
Remove unneeded whitespace
Remove comments
Replace :: with :
 
MLM
@IsmaelMiguel Too much at once? They look split up into discrete steps to me?
 
@MLM It is, but it didn't work out and I abandoned it.
 
MLM
ahh, unit tests are great for regex otherwise it is just a little brittle piece of magic
 
In fact, the interest in it was so weak that I didn't even tried to put reputation for it.
@MLM That's true.
But for people who just like copy-paste, they will have a surprise
Either good or bad, depending on their degree of attention.
Can you get me the most complicated piece of mysql code you can find?
 
MLM
4:58 AM
@IsmaelMiguel The code you had in the fiddle is beyond what I have used. Maybe the specs can help with some unit tests?
 
That would be a nice place to look at
I know it won't highlight things like begin, end, definer, delimiter and (probably) file.
 
hi guys actually i am not good in JS so i need help or suggestion
 
@SangeetShukla 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.
 
i created a function called getvote(int) but i am want to call it with no argument too...what should i do for it?
 
@SangeetShukla You should call it without passing arguments (e.g.: getvote()).
 
5:02 AM
@IsmaelMiguel but it is not giving any output
 
@MLM Thanks a lot for the edit! Sadly, the question is dead and no one will see your improvements.
@SangeetShukla Can you make a pastebin with the full code?
Also, check your browser console. Most likely it is dying somewhere.
 
@IsmaelMiguel this is what i am doing in php for JS function call .echo '<script type="text/javascript">'
, 'getVote();'
, '</script>';
 
MLM
@IsmaelMiguel Here are some tests. Download the ISQL one because it has raw .sql files: itl.nist.gov/div897/ctg/sql_form.htm
 
@MLM Wow, I downloaded it right away!
 
@IsmaelMiguel and one more thing i created function above the call code
 
5:04 AM
I'm checking it now! Thanks a lot, once again
@SangeetShukla What do you mean?
 
@IsmaelMiguel is it possible to check if a function has an argument or not if it has argument it will call getVote(int) otherwise getVote()???possible? @MLM
 
@SangeetShukla What are you trying to accomplish here?
 
i am passing radio button value onclick="getVote(this.value)"
 
!!> function yes() { console.log(arguments) }; yes('you can');
 
@ivarni "undefined" Logged: {"0":"you can"}
 
5:10 AM
getVote(int) take the radio button value for further process,now on the other side i want to only see the output of the getVote(int) for it if i will pass anything in the argument it will take it as input,which is problem
 
But what is that int there?
Are you trying to run the function with an integer parameter?
 
int is the value from selected radio button onclick="getVote(this.value)"
radio button has 0,1,2,3 values
yes getVote(int) only take integer value
 
That's impossible in Javascript. What you can do is to divide the value by 1 and test with isNaN( value / 1). If that is true, then you have something that isn't a number. If that is false, you either have a Number or a String.
Or something that returns a Number or a String that can be converted to a Number.
The point is: Javascript doesn't enforce specific types, like in C, C++, VB and so on.
 
5:29 AM
OK.thanks for your comments...
 
@SangeetShukla You're welcome, I'm here to help.
 
 
1 hour later…
6:46 AM
hello any one online?
 
7:17 AM
@IsmaelMiguel i was not able to do with JS so i done with PHP
 
7:55 AM
@rlemon zzzzzz
 
sure, it's b+1, don't copy and past... understand what you do! — cocco 42 mins ago
pretty sure he's purposefully leaving incorrect information in his post
never mind…he fixed it
 
8:45 AM
hello anyone online here willing to do a payed job?
 
@macroscripts look at careers.stackexchange.com
 
ok
but just to be sure
1
Q: how to change firefox proxy settings using xpcom

Dr DeoI have a proxy server running on localhost (127.0.0.1) and i have grown tired of having to train users on how to switch proxies in firefox to bypass blocked websites. I decided to write an addon. I wonder how to use xpcom to tell firefox to use a certain proxy eg for http, use 127.0.0.1 port 808...

this answer here
can someone configure it to place proxy with username and password?
 
>:(
 
@macroscripts Maybe have a look at bountify.co
When it was just starting I grabbed a bounty for fun
 
is there a paypal payment for this?
 
8:48 AM
I think so
 
@dystroy That's a nice idea for a website, I'd love to see something like that done for larger projects
At least here, it's not that easy to make a living as an independent, but that could be a localized problem
 
9:04 AM
what a load of crap
I have to pay 20$ to get a bounty of 10$
can someone help me solve this issue here
 
@macroscripts Eh?
 
1
Q: how to change firefox proxy settings using xpcom

Dr DeoI have a proxy server running on localhost (127.0.0.1) and i have grown tired of having to train users on how to switch proxies in firefox to bypass blocked websites. I decided to write an addon. I wonder how to use xpcom to tell firefox to use a certain proxy eg for http, use 127.0.0.1 port 808...

someone please. I will pay for this
 
>:(
 
9:22 AM
@rlemon you are the worst/best
 
@macroscripts You mean 10$ are worrying you ?! Stop pretending you'd "pay" us then, we're not cheap sweepers
 
@dystroy I have to pay 20$ in total
for someone to get 10$
on that site
 
19
Q: Is a hamburger considered a sandwich?

snailboatToday, a fellow user was given a CAPTCHA that looks like this: He wasn't sure how to solve the CAPTCHA, so he asked me: Are hamburgers considered sandwiches? Well, I couldn't figure it out, so I'm asking here! I know that the hamburger has in the past been called a sandwich. Wikiped...

 
@macroscripts And how much do you have to pay for someone to receive 100$ ?
 
@dystroy I take it maybe 150-160$ if I am lucky
if you can offer me a working solution
I will pay you
 
9:37 AM
@macroscripts I'm not interested, sorry
 
@dystroy so why are you first to reply my questions?
 
!!afk
 
@macroscripts How many more times will you come here with things like that before realising it won't work?
 
@Zirak as many as it takes. Won't work what?
 
You've come here numerous times in the past offering to pay for assorted menial tasks, or asking for general XPCOM stuff. Your success rate has been 0. Why do you come back?
 
9:44 AM
Oh well. I guess I'll just flat out kick you out if you try this again
 
Never mind that I personally remember less-than-nice conversations.
So I'm genuinely interested. What makes you come back?
 
WTF is this not a JS channel or not?
I come here because I think there are people who can help me
 
That assumption has been proven wrong. Yet you come back. Why?
 
Well you never know
 
doing someone's work != help. We are willing to teach those who are willing to learn, though.
 
9:46 AM
Ok np teach me
teach me how to do this part of my project
I think this xpcom code can help me.
 
ok, I know. You won't find it here.
 
Hello
 
g2g, sorry. But if you have a specific question, do ask.
 
@rlemon updates on the portrait-to-pixelart thing?
 
10:31 AM
String imageString = (String) req.getParameter("imagedata");
BufferedImage image = null;
byte[] imageByte;

BASE64Decoder decoder = new BASE64Decoder();
imageByte = decoder.decodeBuffer(imageString);
ByteArrayInputStream bis = new ByteArrayInputStream(imageByte);
javax.imageio.IIOException: Error reading PNG image data
 
 
1 hour later…
11:34 AM
@Mosho It downloaded is-array@1.0.1 two times, and isarray@0.0.1 once
@GopiSankar That's java. We don't like java. Because java is not JavaScript.
 
user1648409
@AwalGarg hey man, im back with another question :D
 
@Shiuyin Did you troll Zirak yet?
 
user1648409
@AwalGarg I don't troll people ;D
 
@Shiuyin I don't answer people who don't play fair. ;P
 
user1648409
@AwalGarg that's a shame
 
11:43 AM
Y U NO TROLL ZIRAK??
anyways, ask away
 
user1648409
@Zirak dear sir: DO U WANT TO BE TROLLED?
 
user1648409
@AwalGarg can it be, that when coping stuff like var foo = $("#Editor").children() the listeners on every children() elem get lost?
 
@Zirak sir i need a halp
jquery says it needs moar ram
is der a plugin 4 dat
i dnt wnt 2 use downloadmoreram.com
 
@Shiuyin yes, cloning an element doesn't preserve any event listeners
 
user1648409
@AwalGarg damnit
 
user1648409
11:46 AM
:23331837 i need to preserve those listeners, i tried the following:
 pages[currentPage].data = $("#Editor").children();
    for(var i = 0; i < pages[currentPage].data.length; i++) {
        addClickHandler($(pages[currentPage].data[i]));
    }
 
user1648409
shiat, i forgot the ctrl + k thingie
 
@Shiuyin you can't do this
 
@Shiuyin Press up to edit older messages
 
use event delegation instead
 
user1648409
@AwalGarg you mean someting like $(elem).delegate() ?
 
11:49 AM
no, see this:
!!tell Shi mdn event delegation
 
you assign the listeners on a common parent element, and route them to children
I dunno if jquery does this for you or not, I don't use jquery.
 
user1648409
brb
 
user1648409
:23331866 well its the same problem as yesterday:
c.click(function() {
        $(this).children("input, textarea").focus();
    });
10 divs, each with 10 input / textarea field inside. Additionally i swap the Content of #Editor now. So those 10 divs will be replaced by some other divs and thats where the listeners get lost.
 
user1648409
@AwalGarg so i add the listener to the parent element editor?
 
11:54 AM
@Shiuyin yes
remember to set capturing to true
 
user1648409
@AwalGarg but if i bind the listener to the parent elem, how can i tell which child has been clicked if there are plenty of children?
 
10 mins ago, by Caprica Six
 
user1648409
12:11 PM
:23331912 doesnt quite work:
$(document).ready(function() {
    document.getElementById("Editor").addEventListener("click", function(e) {
        $(e.target).children("input, textarea").focus();
    }, true);
});
 
user1648409
@AwalGarg i got it working with just setting the background color to red, but the focus doesnt work :(
 
put it in a fiddle
 
user1648409
@AwalGarg as i said, its 700 lines of code with a few external libs ... cant really put that in a fiddle?
 
user1648409
oh nevermind
 
user1648409
e.target really gives back the correct elem i clicked on, not just the container div like i thought
 
user1648409
12:13 PM
so the children() call is unnecessary here
 
12:43 PM
good evening guys !
i had a quick question !
how do you check an elements display property in mozilla ?
@FlorianMargaine hey Alien :D
hehe
 
@AlexanderSolonik $0.style.display after selecting the element in the inspector
or getComputedStyle
lot of ways
inspector shows them as well
 
@AwalGarg what if computed styles does't show the display property !
it does't always show the property !
in such a case do i assume that the display property is the default "inline"
 
example?
getComputedStyle will return whatever is presently applied, whether default or user defined
 
in the console in the right side
i see
"Rules" , "Fonts" , "computed styles" , "Box model"
are you talking about that computed styles ?
 
No, console has a function called getComputedStyle
!!tell Alex mdn getComputedStyl
 
Oh so you mean i select the element in JS and the use getComputedStle() and then i'll see the display property ?
 
yes
read that page
 
@NikhilDaga 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.
 
Thanks Awal and Caprica :)
 
12:56 PM
I need help with asynchronous code stackoverflow.com/questions/30275045/…
 
@AlexanderSolonik ^
 
what is $0 inside getcomputed styles ?
 
the last element selected in the inspector can beget by $0
second last from $1.. etc
 
user1648409
:23332271 one last question, then i should be finished:
data: $(this).children('textarea, input[type="text"]').val(),
size: $(this).children('select option:first').val()

This reads out the textarea and input data, however it doesnt read out the size and always gives "undefined", any idea why? ..
 
function () {
xyz = [];
var locArr = Cooks.findOne(this._id).locations;
geocoder = new google.maps.Geocoder();
for (var n = 0; n < locArr.length; n++) {
var latlngStr = locArr[n].location.split(',', 2);
var lat = parseFloat(latlngStr[0]);
var lng = parseFloat(latlngStr[1]);
var latlng = new google.maps.LatLng(lat, lng);
geocoder.geocode({
'latLng': latlng
}, function (results, status) {
if (status == google.maps.GeocoderStatus.OK) {
if (results[1]) {
xyz[--n] = results[1].formatted_address;
} else {
 
12:58 PM
@Shiuyin .length property of the value gives the size
 
How to ensure that xyz is returned only after the for loop has completed its execution?
 
user1648409
@AwalGarg nono, you can select a font size there like "14", "20" etc. i need the value, that has been selected not the length of the value :D
 

« first day (1673 days earlier)      last day (3280 days later) »