« first day (1436 days earlier)      last day (3512 days later) » 

11:03 AM
user image
6
 
Hahaha
 
Sorry to bother you guys. Noob here. i want to know how to target multiple values stored in an array, i.e arr[1...N] so that I can store it as a variable to be used in later functions :) By the way you guys at stack overflow are really helpful! This is where I learn the most. Not at school, not at college but here, where code can run FREEEE!
 
11:23 AM
@SecondRikudo That's awesome
I'd share it, but I'm all outta fucks to give
@Clarinetking You can assign a variable to an array
var myArray = [1, 2, 3];
Then just reference by index
myArray[1]; // 2
 
@SecondRikudo Every front end developer has there portfolio website, where's yours
If there is any, I bet it will have some sort of anime theme in it too
 
@CustomizedName He built everyone elses
 
@monners I like yours btw
degree in psychology, hmmm
 
i don't have one either but am not such frontend.. am i ? idk what i am ? idk why i am here ? omg so many questions !>!? idk answers to any !! omg idk am i an idiot ? ... imitating somebody gone nuts.
 
if you are not back end developer then you are front end one ;)
 
11:32 AM
@CustomizedName i am a full stack
 
my final place was 84th apparently
 
most developers are
 
better then 45 other entries
 
@towc were you in marathon race too xD
 
@CustomizedName nope
js13k
 
11:34 AM
wats that
 
programming competition
 
really :O
 
make a minigame in less than 13 zipped kb
@CustomizedName js13kgames.com
 
whats your name there
 
towc
they only list the first 60 winners
 
11:44 AM
thats just sad.
 
11:55 AM
@CustomizedName I'm not a front end developer.
 
sigh india :-(
 
I'm a full-stack multi-purpose web developer.
 
what's gone wrong? I thought I had it all planned perfectly :/
$('#rotate').click( function() {
var new = alphabet.slice(0,num);
alphabet.splice(0,num);
alphabet.push(new);
});
num is a variable integer
 
@AbhishekHingnikar I Like How They capitalize part of the Sentence But Not Everything
 
@SecondRikudo i love how they are naming 3 different people in the post
ankiket sharma, rajkumar sharma, post by rajkumar pandi
 
11:56 AM
JavaScript is like a girl
 
@AbhishekHingnikar Satisfaction 110% guaranteed!
Alright folks
BB
Beach time
 
have fun :D
It's as though whenever I speak the whole forum runs away xD
 
@AbhishekHingnikar why is he still a thing?
 
@Neil Okay. Will keep in mind. Thanks again for the help.
 
what's gone wrong? I thought I had it all planned perfectly :/
$('#rotate').click( function() {
var new = alphabet.slice(0,num);
alphabet.splice(0,num);
alphabet.push(new);
});
num is a variable integer
Is it because I can't use variables when it comes to manipulating arrays?
 
12:07 PM
@Clarinetking what are you trying to do?
 
I'm trying to make a caesar cipher decoder that takes the alphabet, shifts it forward 'num' spaces and rewrites it. This will culminate in me rewriting a passage using the array as a reference
 
@Clarinetking btw, .splice returns .slice
also, it's an array
you're pushing an array, not a series of elements
 
eh? What's that mean?
How can something return another function?!
 
!!> var a=[1, 2, 3, 4]; console.log(a.slice(0, 2), a.splice(0, 2))
 
@towc "undefined" Logged: [1,2],[1,2]
 
12:15 PM
slice simply returns stuff, splice deletes stuff and returns it
@Clarinetking
 
@BenjaminGruenbaum sadly
 
so you could do new = alphabet.splice(0, num)
 
@Copy @BenjaminGruenbaum need some suggestions / assistance
My uncle (inspector general of police over here), asked me if a software can predict or atleast give an optimized heatmap of crimes happening on the city map. They can provide data... and also tag the crime more.. is there something that is in open-domain that acheives such things ?
 
ok thanks :)
 
@AbhishekHingnikar dude...
 
12:19 PM
@BenjaminGruenbaum what >?
 
@AbhishekHingnikar but... why?
 
@AwalGarg cause we have shortage of policeman and patrolling needs to be more efficient
something like predpol.com
@BenjaminGruenbaum i can write it, am just too friken overloaded :-x
 
@AbhishekHingnikar and why does your uncle think the heatmap would bring efficiency in patrolling?
 
@AwalGarg no but if it can predict and visualize the areas faster the policeman actually mapping it would be reduced.
and can do productive tasks instead.
currently they map it manually.. which is shocking.
@BenjaminGruenbaum hes more interested in the prediction though. He asked the same question in various colleges but the answers were negative .. mapping i know it can be done in a matter of minutes with google maps
so are you gonna say anything ahead of it @BenjaminGruenbaum ?
@AwalGarg have you ever seen what our police uses technologically ?
 
@AbhishekHingnikar yes. Very closely.
 
12:26 PM
I'm not taking this bait, sorry @Abhishek
 
@BenjaminGruenbaum bait ?
@AwalGarg are they not ancient ?
 
@AbhishekHingnikar I am not sure if more modern solutions exist. The only thing I see which has room for improvement is the communication system.
 
@BenjaminGruenbaum well he asked me, i asked you guys if you know of a pre-existing solution. I'll atleast give it a try.
 
Sometimes you depress me :P
 
and there is not any one thing which does all the work. If you ever walk into a control room, you will see hell lot of tech.
 
12:29 PM
@BenjaminGruenbaum I don't get why this is a bait
 
> bait
Food used to entice fish or other animals as prey
 
@FlorianMargaine it's a huge question and research subject. There are BScs on it and the India police force should not take their forensic and data analysis advice from the JS chat room in Stack Overflow.
 
@BenjaminGruenbaum oh, ok
 
^^
 
@BenjaminGruenbaum he didn't ask me to ask you.. its my decision
 
12:31 PM
@BenjaminGruenbaum the word "prediction" is the bait I didn't see there :)
 
@AbhishekHingnikar Neither should he ask you.
 
any business man in here too
 
@AwalGarg he asked me cause well he asked in colleges nobody opted with a solution, and then i showed him snapick in action, he told me his idea. What is wrong in there ?
 
@FlorianMargaine I want to predict what people are criminals, easy easy
 
@BenjaminGruenbaum not what/who*... where
 
12:33 PM
yeah, didn't see the word
just thought he wanted a heatmap of previous crimes
 
I'll probably suggest him predpol.com
 
I take it as a no then ?
 
@CustomizedName what do you call business man?
 
anyone who can make profit on ebay :D
 
thats a bot.
 
12:40 PM
who ?
 
to make profit anywhere, like a market
 
@BenjaminGruenbaum what's firebase?
just saw an answer where you proposed it stackoverflow.com/questions/15722765/…
a quick one-sentence explaination would be nice
 
A backend as a service and also syncs data x-platform.
 
and without buzzword?
 
Basically a database, which has pub-sub and can sync your data across devices.
 
12:52 PM
k, thanks
 
@FlorianMargaine I was new :P
 
@BenjaminGruenbaum it shows :D
 
@FlorianMargaine it's like localStorage on their cloud, it's very easy to use and it got a lot of traction
 
@AbhishekHingnikar you know cyberroam?
 
12:54 PM
The funny thing is that the other answers are wrong @FlorianMargaine :P
It's perfectly doable, you just make a blob and save that.
 
@AwalGarg nope
 
@BenjaminGruenbaum you need FormData though iirc
 
:-x yikes
 
@FlorianMargaine so what?
 
having file ajax in IE8... I don't want to talk about it
 
12:56 PM
Well, actually, you need Blobs which are newer
 
it's either flash or iframe
both solutions suck balls
although I'm not so hurtbutt on flash
 
people actually compress json x_x
 
@FlorianMargaine ubjson.org
and hundreds more .. i just use gzip and forget it.
 
Did you see whose github it is that I showed?
 
1:08 PM
yeah, ivo
 
1:20 PM
What is the jsfiddle url switch to show clean environment of code ( without jsfiddle)
in jsbin it's /quiet
 
Is this big traffic?
function reload() {$( "#result" ).load( "ajaxtest.php" ); setTimeout(reload, 1);}
ajaxtest.php: <?php echo date("m") . ":" . date("s"); ?>
 
@RoyiNamir /result
 
@BenjaminGruenbaum Thank you. ( i'm pretty sure they've changed it ???)
(from show)...?
 
15
A: Why say "Stack Overflow is not a crowd-sourced debugging framework" when asked to reason a script behavour?

PeeHaaConsidering you have reserved a nice side note for a comment I wrote I will explain my comment. The reason I downvoted your question and added my comment is because I indeed googled your exact error message and the first result on the page came up with the semicolon issue. Does googling for ...

 
@BenjaminGruenbaum not working ( /result)
 
1:26 PM
@TomášAresakMalčánek That doesn't even work
1 ms is way to low to do anything useful
 
Looks like you are in need of websockets
 
Maybe it's show
@PeeHaa already upvoted
 
\o/
 
http://spsd14.symbiant.cz/u/tomasm/ajaxweb.php
here
Btw hey @PeeHaa :D
 
1:28 PM
heya @TomášAresakMalčánek
 
What the bloody hell ??? jsfiddle.net/L159ybr8/show
 
@TomášAresakMalčánek yes but as you can see requests are not being fired every 1ms
 
/show nor /quiet nor /result works
 
yeah
It was on 1 second, now it's 1ms
 
@RoyiNamir is this what you're looking for? jsfiddle.net/L159ybr8/embedded/result
 
1:30 PM
If you need to do something with that frequency en depending on the use case you probably are looking to send out pushes using websockets instead
 
Let's say chat.. It has to be highly frequented or no?
 
Chat should not be polled using requests everytime imho
 
To this time I was using iframes and force refresh o.O <== Soo nooby :D
 
@PeeHaa depends
if it's every 15 seconds, it's better than WS
WS have a cost, you know
 
@FlorianMargaine chat with 15 seconds interval?
 
That's not chatting anymore that's snailmail :P
 
like, comcast chat support
 
@FlorianMargaine Isn't comcast that stupid comapny everybody hates because they do stupid things? ;)\
 
1:33 PM
Polling every 500 miliseconds or using a long lived HTTP Request both work, websockets are just easier and likely faster
 
websockets all of the things!
 
^
Last night I had sex with websockets and I am hoping for little peehaawebsocket children!
 
that is a library for websockets
 
@PeeHaa I don't think children work that way.
 
1:34 PM
:(
 
Sorry bro, they were GC'd
 
BTW semi related. Have you guys already been dicking around with webrtc?
 
@PeeHaa yeah
miaou uses it to have audio/video calls :)
 
@FlorianMargaine ow cool didn't know that was implemented
tnx
 
1:39 PM
he's probably going to use webrtc for file sharing too
the file has a lot of unrelated stuff...
@PeeHaa this is a good article html5rocks.com/en/tutorials/webrtc/basics
 
Yeh I was looking into the filesharing part, but got utterly confused with the rfc
 
html5rocks is usually pretty good
 
tnx
 
fwiw... stun = little server exchanging a couple of connection initialization data, turn = full server to fall back in case straight communication is blocked
google provides free stun servers
 
My goal is to not route through the US of Stupid at all ;-)
 
1:45 PM
well, setting up a simple stun server shouldn't hurt then
 
Yeah think I will try again to write one, because last time I checked it was all crap (for php)
 
@PeeHaa you can reuse existing stun servers... the spec isn't hard if you choose to write it yourself
 
Hi guys, quick question

if I have a string like this:

foo,bar,cookies

how do I convert it to an array like this?
['foo','bar','cookies']
is it the splice function?
 
2:01 PM
@Deep try googling
btw it's 'string'.split(',')
 
ah. I googled js splice
cheers
 
m59
I know some of you study random things like Psychology... does anyone know a term for examining your past self (2-3 years back) and realizing how unpleasant you found yourself to be then? @SomeKittens @SomeGuy
The "Somes" might know, LOL.
 
@m59 autofrustration?
selffrustration?
 
m59
nope
It's presently sort of the opposite "look how far I've come", not "look how bad I am"
 
2:21 PM
@m59 Well no, it isn't the opposite, it's that
Just that rather than focus on how much better you are, you focus on how bad you were
 
@m59 lol, know that feeling
 
Programmer's curse
 
return v.replace(/([a])/g, alphabet[num]);
WHAT. IS. WRONG. WITH. THIS???? D:
Sorry, having a crisis here :(
 
@Clarinetking what do you want it to do?
 
^
 
2:32 PM
Switch all 'a's with another letter (in array alphabet)
Sorry if I sound snappy or something. I've just been trying for ages :/
 
!!> "this is a test".replace(/[i]/g, 'o')
 
@Neil "thos os a test"
 
Looks correct to me. Seems like the problem is input
 
@FlorianMargaine Tnx for reply. no. as you can see : the view source contains jsfiddle's rubbish :view-source:jsfiddle.net/L159ybr8/embedded/result
 
@RoyiNamir oh yeah, you have to render it from an iframe
or you could find how show/light is blocked and send the correct http headers I guess
 
2:35 PM
Ok :) I'll see where it's gone wrong. Any idea how to debug inside JSFiddle?
Thanks for dealing with Grumpy Me :P
 
@Clarinetking Just do console.log(alphabet[num]); before running that code
 
ok :) thanks :)
 
I don't think it is v, but if it weren't alphabet[num], then it is v
 
I have finally realised that I can take programming as a career. Now I just need to forget about career.
@Neil why does your message appear between two dotted horizontal lines?
 
@AwalGarg Help me out, I'm struggling with this one
Oh, the dashed horizontal line just divides recent posts with older ones
 
2:42 PM
hu?
 
Not sure with what criteria it does that though
 
the messages above came in the space of a minute
...
it is appearing over my message now
and your's is fading
 
Strange, it is appearing above mine, not yours
 
this is pathetic, is this some easter egg?
@Neil no, it is below yours and above mine.
 
@AwalGarg Not for me it isn't
 
2:49 PM
'; DROP DOTTEDLINES;--
 
I imagine this must be how those pizza places must feel when someone plays the prank on them where they ask them to repeat their order to another pizza place who's expecting to receive an order
 
is it possible to put js variables in between html? kinda like templating?
 
m59
@Neil not that it matters, but "self frustration" is definitely not what I am talking about. That is simply being frustrated with one's self.
Not at all what I mean.
If you were presently so frustrated with yourself, you would instead be looking back at the disaster you were and comparing it with the disaster you presently are, rather than looking at how much better off you are now compared to then
It usually comes from present satisfaction with the self (though wise people still recognize they'll do the same thing years down the road)
@AwalGarg You can template anything. What are you trying to do, exactly?
I'm not sure if Florian was trolling or if I'm not understanding your question.
 
3:19 PM
http://stackoverflow.com/questions/25960588/return-regex-not-working-with-array-calculations
Here is one of my questions on array/return problems :)
 
Eem guys can jQuery on JavaScript send a request on any page so the page can act like it's called by a user?
ex: calling /call.php?value=true which writes a true to a text file.
- Possible output?
Like .get() but it takes so long to process
 
I don't know about .get()
Do you know why my return() isn't working?
http://stackoverflow.com/questions/25960588/return-regex-not-working-with-array-calculations
 
I'm not sure, but I think you will close it after A, aren't you?
 
I want it to repeat for all 26 letters of the alphabet
 
3:34 PM
Noobie style:
var x = 0; while(x < 26) {/*Code*/; x++;}
 
Ah, yes. I should've thought of that '_'
Damnit
 
:P
WTF - .load() does't returning just page's output :O
 
posted on September 21, 2014

var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); try { var pageTracker = _gat._getTracker("UA-3727700-1"); pageTracker._trackPageview(); } catch(err) {} 70% of general admission tickets have now sold for BAHFest East! Buy

 
m59
@Clarinetking code after return doesn't run.
return x;
//this is useless
x.whatever
 
3:49 PM
oh. That's unfortunate. Thank you :)
 
m59
you can chain chainable things, if that's what you wanted
return x.replace()
  .replace()
  .replace();
@Clarinetking further, you could just put the same code on the otherside of the relplace, but you'd have to use it correctly
x = x.replace()
x = x.replace();
return x;
kinda redundant rather than chaining it.
 
actually, why don't they run code after the return?
Seems a somewhat technical issue, not a conceptual one
 
m59
Oh, like return the value from a certain point, then keep doing stuff (unrelated)
 
They could run the equivalent of moving the return to the end, and saving the result of the return mentioned earlier to return later
 
m59
I bet that would encourage some serious SRP breakage.
 
3:53 PM
@Neil generators
coroutines if you want to go further
 
@FlorianMargaine Would confuse parsers you mean?
or slow them down
 
no, I mean that "code run after return" is a generator
 
Thanks guys :) Still no closer to getting the damn thing to run though :/
 
return being yield in this case
 
@FlorianMargaine I didn't know there was a name for it
 
3:55 PM
@Neil rather, look up what a coroutine is
 
@Neil Go has that
 
Oh god, the nerds are coming :P
Joking :) Wish I was at your level of omnipotence xD
 
Most languages don't have that, but Go has the ability to "Run code just before return regardless of where you wrote it"
 
Maybe not easily accomplished in a scripting language
 
JavaScript also has that with async code to some extent
 
3:56 PM
@BenjaminGruenbaum oh, you mean defer. I didn't understand what you meant
 
@FlorianMargaine yeah
 
it's more like register_shutdown for a single function though
or something like that
 
You can usually just spin off a thread or something.
 
uh?
no, defer is run in the same thread
it's more like adding the line of code right before the return, afaik
but in code, it's easier to remember when you write it just after the open
 
@FlorianMargaine I meant in general
As a solution to "run code after return"
 
3:59 PM
it's run before the return though
I'm sure we're saying the same thing anyway
 
In defer. Not in the thread case
 
can't wait to start using yield
 
WHY U NO RUN????
$('#write').click(function () {
$('#txt').html(function (i, v) {
for(x=0;x<alphabet.length;x++) {
return v.replace(alphabet[x], alphabet[x+num]);
}
});
});
Any ideas you insanely clever ninjas?
It just returns undefined :/
 
m59
you can only return once.
 
4:02 PM
if you could format your code, we'd have more ideas
 
Sorry :)
 
m59
You really need to learn some basic js before doing what you're doing.
when I said "after return" I meant "after".
 
I DO KNOW BASIC JS >:( I just don't appear intelligent as I don't often undertake such laborious tasks
 
m59
You kinda cheated the concept.
 
@Neil regenerator
 
m59
4:03 PM
A loop runs 1 AFTER another
hmm, actually.
just a sec
 
@BenjaminGruenbaum I suppose generator is the term
 
m59
Yeah, that first loop returns and the function is done. So it really doesn't loop.
 
Oh. So a return is basically saying 'do this and no more' then
 
programming by accident, heh
I like this term
 
Any idea of a workaround?
It doesn't need to be pretty, just effective
Like me xD
 
4:08 PM
Small pet peeve, you should add var before your x, otherwise you're creating a global variable
 
I can see why that might be annoying :P
 
m59
You don't need a workaround...
You just need the very basics of programming
 
Please don't insult me. I'm fairly young for a programmer. I'm just being pestered into doing this for a 'friend'
 
m59
That wasn't an insult. Lesson 1: Accept help and advice from others graciously.
If you are bothered by being told that you're doing things wrong, don't expect to make it very far in anything.
 
it's not an insult, it's the truth. You don't have to be ashamed to be new or not understanding, but you're just being annoying there, and simply asking for the solution right away. Well, sorry if people tell you to fuck off.
 
m59
4:12 PM
I'm not even annoyed. I was just letting you know that you failed to learn the previous thing I demonstrated.
 
I try to, but if I feel insulted I'll say so :) It's just that stackoverflow feels like a bunch of people looking down on me giggling at my inability to code 'basic' programs :/
Ok thanks :)
 
m59
When I started here, I was just as bad as you and people let me know all the time.
 
Heh, ok thanks :) You've raised my opinion of myself and that's a rarity :P
 
m59
I see no issue with that. They let me know when I was being terrible and how to do better.
 
@m59 don't worry, you're still terrible
 
m59
4:13 PM
yep, just as AS terrible as I once was :)
 
Computing at college is so boring. We're starting with the basics which involves sitting around being lectured about semi-colons and variables in Pascal xD
 
m59
I dunno what you're trying to do, or what this does, but here's this at least without the issue
$('#write').click(function () {
  $('#txt').html(function (i, v) {
    for(x=0;x<alphabet.length;x++) {
      v = v.replace(alphabet[x], alphabet[x+num]);
    }
    return v;
  });
});
 
@m59 Ahem, pet peeve...
 
that might not work in strict mode
arguments are immutable
 
m59
4:15 PM
I was just thinking it would be bad practice to do that anyway
My point was to demonstrate how to avoid the return
 
excuses!
 
m59
I have no idea what he's trying to do, so meh
then you can help :)
 
Thanks :) It gave me a ton of undefineds but that's probably because my array maths is wrong or something similar :)
Here it is anyway :) Giggle at your leisure :P
http://jsfiddle.net/clarinetking/kLy83oxj/16/
 
m59
@Clarinetking Learn Single Responsibility Principle (SRP)
Write a function that does one thing and make sure it does that one thing perfectly
 
oh. Ok :) That's actually a really good idea :)
 
m59
4:18 PM
You have a festival of functions going on all at once
 
Then I can debug easier too :)
 
@Clarinetking google "SOLID"
 
m59
ditch all the jquery junk and the loop and make sure that just your replace is good and working the way you want
then add the next layer (looping that logic) and so on.
 
be right back in about 15 mins. sorry, doing jobs :)
I will thanks :)
 
@Clarinetking you might be interested in charCodeAt and fromCharCode or something similar
 
4:40 PM
So, I'm using Object.create() in my code instead of new Something() and it works wonderfully, but I still have to do new Promise()?
 
Thanks :) What do they do? @FlorianMargaine
 
@Clarinetking how about you look that up?
 
hah, ok :) Only fair I do some work :) I misread that as char code eat :)
 
modern.ie/en-us/ie6countdown#escape-from-xp WUT microsoft features a game against xp ?
 
Marketing.
 
4:55 PM
with a horrible game :-/ so microsofty
 
Scored 141'850 :D
Kinda fun actually xD
 

« first day (1436 days earlier)      last day (3512 days later) »