« first day (1010 days earlier)      last day (3941 days later) » 

user1596138
4:00 AM
Mobile is horrible on here.
 
@EliteGamer in order to be doing json requests and stuff you need to learn the basics of the language first then you wont even need a tutorial for ebay stuff
 
but i have no idea how to get the value in it...this is what i have...
    $.getJSON('/tweet/tweets.php',
        function(feeds)
		{
            var profileimage = feeds[i].user.profile_image_url_https;
	    }

    });
 
@Jhawinsss It almost always turns out for just about everyone that they are extremely nervous before the interview and once its over, they feel relaxed and ask themselves, "Why was I nervous in the first place? It wasn't that hard!" Sometimes, they get relaxed so much that they wouldn't mind having the interview again.
 
@AshKetchum would that get the image url?
 
@EliteGamer $.getJSON doesn't return the response.
but you can pass it a function that it will call with the response (eventually)
see the docs
 
4:05 AM
@JanDvorak the PHP echos the data
 
@EliteGamer see if this helps you:
 
yeah, but $.getJSON does not return those
 
@AshKetchum i am trying to
get all my followers
images
 
is the php echo'in json encoded data
 
yea
here is the PHP...well the main part
$followers = $connection->get("https://api.twitter.com/1.1/followers/list.json");

echo json_encode($followers);
 
4:09 AM
wont it already be json data if the file is .json ?
 
You could get the ID of all your followers in one command and then in a separate command, you could fetch the profile pictures of those people by using the ID.
 
idk, but Twitter has it written that way
 
@EliteGamer doesn't twitter API provide JSONP API or CORS?
 
@AshKetchum how would i do that?
 
JSONP yes
 
4:10 AM
also how is it getting your followers from that url?
i see no identification
 
i am authorized to get it
 
but how does it know to get yours specifically
 
identification?
 
user1596138
@ash I get that. It's just my first interview for a real salaried job. In the SF Bay too. It's everything I've wanted for years. So its a big deal to me.
 
unless your id is 1.1
 
4:11 AM
it connects to my account
with my consumer key etc.
 
@Jhawinsss Good luck! :)
 
i have a super simple node app running on heroku that gets my last tweets
 
yea, but my goal is to get all my followers profile images
well, a certain number of them
like 10 or so
 
yeah but the set up is the same, just a different url
 
controlled by a var
@phenomnomnominal actually, that is what i did, and changed the url
did not work out though lol
 
yea
 
What's the issue?
 
in the php
 
user1596138
Thanks
 
i need to get just their images
profile images
 
4:15 AM
so parse the json?
 
that is my problem
i have no idea how
 
json.parse(the_json_data);
 
watch the case though
 
4:16 AM
i have to do it though ajax
basically, fill a "ul" with the images
 
so why are you bothering with parsing the json in php?
 
hmm where can i find a good tutorial that explains js promises im struggling to understand it with my ajax stuff
 
@phenomnomnominal i am not. I need to parse it in javascript
 
just use the PHP as a proxy, have your oauth stuff there and just feed the json result back to the javascript?
then it is SO easy?
 
the php side is done
 
4:18 AM
Can I assume you're using jquery?
 
i do not know how to get the image links out of it with javascript
yea
 
@Dave a promise is just an object where you can submit your callbacks
it fires them right away if the associated event already passed
 
@JanDvorak so will that solve the issue of recieving the wrong response with ajax if you sent two requests together
 
here is what i have so far
    $.getJSON('/tweet/tweets.php',
        function(followers)
		{

	    }
    });
 
@Dave plain callbacks solve that too
 
4:21 AM
$.getJSON('/tweet/tweets.php', function (followers) {
        followers = JSON.parse(followers);
        var users = followers.users;
    }
});
 
@phenomnomnominal scratch the second line
jQuery already parses that for you
 
oh true,
i hit enter early
 
@phenomnomnominal, so i loop through them, the add them to a ul
 
I'm just finishing it
 
4:24 AM
$.getJSON('/tweet/tweets.php', function (followers) {
    var users = followers.users;
    var $ul = $('<ul>');
    var photoUrls = users.map(function (user) { return user.profile_image_url; });
    photoUrls.forEach(function (url) {
        $ul.append($('<li>').append($('<img>', { src: url }));
    });
    $(document.body).append($ul);
});
I dunno, something like that
 
@EliteGamer do you understand most of what is happening in the script
 
yea, but...
hm, ok, now i see the foreach
 
@phenomnomnominal I would merge the map into the following loop.
 
i was wondering how he looped it
 
note: ES5-only
 
4:27 AM
@JanDvorak, yeah, fair, I thought it might look a bit clearer
 
I'd still use it with a shim
 
or be using underscore
 
@phenomnomnominal thanks, let me fiddle with that and see what i come up with
 
_(users).pluck("profile_image_url")?
 
yeah exactly, though I don't really like doing the wrapper thing
 
4:30 AM
@phenomnomnominal i am getting a syntax error
 
it's cool for chaining
 
damn it i tried to fix it and broke it xD
 
@EliteGamer did you use the updated version?
I can't see another issue, but I might be being stupid
 
@phenomnomnominal you're missing a right paren on L7
 
4:32 AM
it says missing semi-colon, but i have no idea where you would put it
@JanDvorak what? lol
 
four opening, three closing
 
i count four and four?
 
i see
 
> $ul.append($('<li>').append($('<img>', { src: url }));
 
can some one explain why it won't process the request : jsfiddle.net/gAAg5 i know it won't work in jsfiddle that way but some one might see the mistake im making
 
4:34 AM
ah bang on
 
one is after li, two at the end
 
was counting {}s
 
lol
i saw it right when he said 4 open 3 clsoe
 
it's 5/4 including curlies
 
or something like that XD
 
4:35 AM
4 { and 4 } in the whole thing haha
@EliteGamer is it working?
 
@phenomnomnominal oh yea, perfectly.
My next step is to add the username to a tooltip on the image
and a link
to the person's profile
but i think i get it now
thanks sooo much
 
use the map function to return objects with the data that you want, or just pull it out in the forEach
 
i will show you what i am making out of it when i am finished :D
ok
 
what are common reasons these not to occur:
if (xhttp.readyState == 4 && xhttp.status==200) {

even though the file is requested in the xhr tab
they both show 0 every time, i don't know where to start for debugging
 
200 isn't the only valid status
 
4:43 AM
i console.log them both - they both display 0
every time
 
how many times do they run?
 
once
its called like this : xhttp.onreadystatechange = process(type);
ignore "type" thats just a string for something unrelated
 
that should be a function
it's a callback function
you're calling it and assigning the result
 
ah ok put it in an unnamed function
works now :) thanks
 
there's also the ES5-only bind ;-)
 
4:47 AM
or again, _.bind
 
4:57 AM
 
m59
It turns out that if you re-factor the same 6 functions for 12 hours, it really looks a lot cleaner at the end.
 
5:20 AM
@m59, it can go either way!
 
m59
lol
 
refactoring is always fun
 
5:39 AM
@Amaan Have you read "Faust" yet? You should read Faust.
 
!!>Array(16).join("wat" - 1) + "BatMan"
 
@Darkyen "NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNBatMan"
 
good job @CapricaSix pats back
!!/eval "BatMan"
 
@Darkyen "BatMan"
 
!!/quine
 
5:50 AM
!!/quine
 
!!/forget BatMan
 
@Darkyen Command batman learned
 
!!/Batman
 
@Darkyen Try !!>Array(16).join(wat - 1) + 'BatMan' noobshark!
 
duh :-|
 
user1596138
5:52 AM
You forgot the <>...
 
@Darkyen Command batman forgotten.
 
user1596138
But this is the best command I've ever seen.
 
!!/learn Batman 'try !!>Array(16).join("wat" - 1) + "BatMan" noobshark'
 
@Darkyen Command batman learned
 
!!/batman
 
5:52 AM
@Darkyen try !!>Array(16).join("wat" - 1) + "BatMan" noobshark
 
good job :->
 
user1596138
You even used the right amount of "na na"s. 16!
 
user1596138
Looks pretty nice!
 
sad that the project died :-(
some more of its awesome ui ^ .. :'(
 
user1596138
6:06 AM
Dang. How did it die?
 
I was working on it alone
a friend of mine wants me to re-vamp it and put it up in parts.. or even just this sexy timeline u see up
 
6:38 AM
Am not sure of myself
@Darkyen nice
nevermind, I was wrong ^^
 
@dievardump ?
 
m59
this loop is killing me :(
 
@Darkyen The UI. Is it not your's ?
 
its 100% mine
 
m59
I'm adding a function to a global object and then checking for it in the rest of the loop, and it's empty every time
how can that be!?
 
6:44 AM
It's nice.
 
i posted it months back when i was making it ;-)
 
@m59 hum ?
 
then the project died now one of my friend is making me re-vamp it :P
but i dont see any market
 
Hi guys - maybe I'm being stupid and overlooking something simple because of doing an all-nighter. If I have an array of characters, how can I check if a variable contains any of them?
 
m59
hold on, let me try one last thing
 
6:47 AM
file = content.document.getElementById('filename').value;

// Restricted characters and file names
var contain = ['"', '*', ':', '<', '>', '?', '\\', '/', '|', '+', '[', ']'];
var fullname = ['AUX', 'COM1', 'COM2', 'COM3', 'COM4', 'COM5', 'COM6', 'COM7', 'COM8', 'COM9', 'CON', 'LPT1', 'LPT2', 'LPT3', 'LPT4', 'LPT5', 'LPT6', 'LPT7', 'LPT8', 'LPT9', 'NUL', 'PRN'];

if(fullname.indexOf(file.toUpperCase()) >= 0)
{
	alert(STR.NAME_FULL + '\n\n' + fullname.join(' '));
	return;
}

if()
{
	alert(STR.NAME_CONTAIN + '\n\n' + contain.join(' '));
 
Is it possible to completely disable/disallow certain extensions like ".html" and ".php" ??
 
@Darkyen what ae you trying to do with it ?
 
Like /index works but /index.php throws a 404 error?
 
@DannyBeckett if () ?
 
@dievardump just a private and social timeline app
 
6:48 AM
Would it be possible to do that in htaccess?
 
@dievardump Yeah, I'm wondering what I can use there (see previous message)
 
allows u to share statuses and talk and chatter and shit
bleh simple social networking
thats why i run away from it..
there are too many fishes in that pool
 
@AshKetchum RewriteRule ^*.php$ /404 [L]
 
@Darkyen what is it?
 
@Tomarinator 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.
 
6:52 AM
@dievardump Crashes the server to 500 error
 
m59
@dievardump yep, this is senseless.
I can't explain it....let me show you
 
and with *\.php \/404 ?
 
m59
var myObj = {
  baz : {}
}

var bar = function(i) {
  if (!myObj['baz']) {
    myObj['baz'] = function() {
      console.log('baz');
    }
  }
  else {
    console.log('Already has baz!');
  }
};

for (var i=0; i<10; ++i) {
  bar(i);
}
I'm doing something that seems exactly like that, but it never goes to else. It should go to else after the first iteration,
 
@ZeeshanAli 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.
 
@dievardump still 500
 
6:54 AM
@AshKetchum RewriteRule \.(php|html)$ \/404 [L]
 
@Darkyen Not true.
@dievardump :
 
That is what you want.
 
Not Found

The requested URL /404 was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
 
Now you create a 404
That makes a 404 error.
 
Except now no page is working.
/index doesn't work.
 
6:56 AM
@Aadit M Shah , I would implement CORS in it. (yeah I know, only in a parallel universe ;)
 
I only want /index to work, not /index.php. If the extension is there, it should redirect to 404.
Let me correct myself. If the URL contains ".php" then it should go to 404
 
m59
KIDDING ME
I know one of you guys knows this....I figured it out, but don't get it
 
Posted it as a question if anyone feels like earning some rep: stackoverflow.com/questions/17781637/…
 
m59
what would cause this:
 
m59
6:59 AM
waittt
nm
 
@AshKetchum ,try using a if else statement with document.location.origin
 
@Tomarinator But that would bring me to JS. I am trying to do this server-side in htaccess
 
user1125394
@AshKetchum is it for your profession or just a personnal website?
 
@Tomarinator what ?
 
user1125394
because if #2 there are many better options
 
7:02 AM
@cx #2.
 
user1125394
so stop suffering with apache
 
@Tomarinator location.origin doesn't work in IE8
 
LOL, then what do you think I should do instead?
 
user1125394
anything else: nginx, nodejs, cowboy (erlang)
 
m59
freakin ajax
I finally got it
 
7:03 AM
@cx Not really helping. Plus, I don't know much about NGinx and others.
 
user1125394
learning?
 
user1125394
knowing doesn't pops up like that
 
RewriteCond .*\.php$
RewriteRule 404.php
something like this...
 
@cx So I would have to learn a whole new thing without there being any major difference?
 
omg it's 9:10 O_o
I thought it was 8:30
 
user1125394
7:07 AM
@AshKetchum as you want, I'm just telling you the process I followed myself when discovering other things than apache :)
 
@cx Which I appreciate, but see there is almost no point (right now at least) in learning a whole new thing when there is no significant or major difference or advantage between the two.
 
good job flo
Pats back
 
no9
I have to develop an app that reads barcodes and fetches data from DB. Should I go for android/ios app + rest services or should I consider jquery mobile (with no expericene whatsoever) that runs on the server ... any thoughts?
forgot to mention ... it has to work on phones and tablets
 
"jquery mobile that runs on the server"? what?
 
7:15 AM
@FlorianMargaine Thanks
 
no9
what i ment is web app @zirak
to put it simple
 
@FlorianMargaine By the way, that didn't work either :(
 
@AshKetchum of course it didn't
 
@FlorianMargaine ...
 
it should be more something like this
RewriteCond %{REQUEST_URI} \.php$
RewriteRule %{HTTP_HOST}/404 [L,R=301]
but meh, you got the idea.
 
no9
7:19 AM
@zirak is my question clear? :)
 
@no9 you have to = for work, paid for that ?
 
@no9 And as someone who made nothing for mobile, my only suggestion can be "go for what you're more comfortable with"
 
@FlorianMargaine not really but ok lol
 
user1125394
!!google apache sucks
 
no9
@dievardump kindoff, If you consider that the company I work for pays me as a janitor ...
 
0
Q: JavaScript module pattern with example

SrleHy all, i don't have any concrete question about module pattern i just can't find any small example that will show how everything is hook together or in another words how two(or more) different modules work together to achieve some task. So wanted to ask that can anyone have time to write some e...

 
Actually that code has no effect on the app. Almost as if it doesn't matter whether it is there or not.
 
no9
@zirak An honest opinion ... but I wanted to hear any pros and cons, since I noticed many people tent to develop HTML5 sites instead of mobile apps
 
@no9 it's a business decision more than a technical one. Both ways are possible, each has its advantages/drawbacks, but it's usually a business decision.
 
@no9 have you look at paying for that code ? This is a really common task and sometims, it will be cheaper, faster and safer to just buy a tool that does the barcode reading. When you see how QRCodes readers are a mess... a multiplatform one can be a pain
@Srle I saw your question yesterday night. what have you found already ? There is a lot of stuff all over the web, and notsaying what you already saw does not help
 
no9
7:26 AM
@FlorianMargaine @dievardump true, true ... I will check the available solutions first. But im 90% sure that the manager will force me to do it anyways ...
 
@dievardump, can you give me a link?, i just need small example showing two or more modules working together.
 
What have you tried and search already ?
 
no9
@dievardump I am searching now, just got the task in Jira couple of minutes ago and I asked streight forward for opinions...
 
I was talking to Srle :p
Google: JavaScript Design PAtterns - First Link - ctrl+f(Module) - Content table - click -> addyosmani.com/resources/essentialjsdesignpatterns/book/…
 
7:29 AM
although this line could be seen as "complicated"
require('./init')(cvs, ctx, config);
 
user1125394
'use strict';
 
user1125394
what is it for?
 
always use strict.
 
!!tell cx mdn strict mode
 
7:30 AM
1645
Q: What does "use strict" do in JavaScript, and what is the reasoning behind it?

Mark RogersRecently, I ran some of my JavaScript code through Crockford's JSLint, and it gave the following error: Problem at line 1 character 1: Missing "use strict" statement. Doing some searching, I realized that some people add "use strict"; into their JavaScript code. Once I added the statement, ...

 
@dievardump, Florian Margaine, thanks
 
1645 upvotes, nice.
 
meh, and the answer just sucks
 
1
A: Is there official JavaScript and CSS icons?

Arun BertilCheck the following images for JS and CSS according to visual Studio-MSDn Standard......

Not sure it's an upvote that this answer deserved by referring to Visual Studio MSDN
 
Which languages do have an official icon? Some have these icons people attach to them, like Perl's camel.
 
7:40 AM
This question is off-topic and the answers are so bad...
 
@Zirak Lisp has an elephant
 
Isn't the common file extension far more recognizable?
 
PHP does too iirc
so does python
 
Saying the icons are free to use because they're in a proprietary software sounds stupid. And it's strange to see that MS has stolen AppleScript icons...
 
@FlorianMargaine Probably because of some O'Reilly book or manual.
 
7:41 AM
.NET's icon:
http://www.tomstricks.com/wp-content/uploads/2009/04/error_icon_tomstricks.png
 
Can anyone spot why the error doesn't fire here? jsfiddle.net/UcLsR
 
@Bryant 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.
 
@FlorianMargaine yeah, you're right, Python does have the...well..python
 
The fullname check works great, but the contain check doesn't fire
 
7:42 AM
 
realgirlscode.com
 
 
Can anyone tell me why this alert doesn't fire? jsfiddle.net/UcLsR/2
 
7:48 AM
I like the Dart's geometrical shape
 
That's the JavaScript logo.
 
So all the real programming languages don't have icons.
The fakes like Ruby and Python can go suck it
 
Zirak in bad guy mode, as funny as always
 
Nobody? :(
Even more concise: jsfiddle.net/UcLsR/3
 
@dystroy wtf!!!!
 
7:54 AM
@ShyamK He just likes to be spanked.
 
@DannyBeckett You don't escape the chars, how would it work ? Did you think about this regex : /[[]/ ?
A solution :
    var containR = new RegExp('[' + contain.map(function(v){return '\\'+v}).join('') + ']');
 
@dystroy I was told by a 100k+ user they don't need escaping
Because they're inside [ and ]
 
@DannyBeckett That's true for some
 
I tried escaping them too - no difference
 
Well... I just tried and it works. Try the code I gave you.
 
7:55 AM
Oh!
 
How did you think the engine would parse this ?
[]]
 
.map is bad and you should feel bad.
 
@dievardump Why is it bad ? It cures from IE8-.
 
@dystroy I completely agree with you
 
ie9+
 
7:57 AM
I was told otherwise here: stackoverflow.com/questions/17781637/…
@dievardump That's ok, it's targeting Adobe AIR (Webkit) :)
Thanks @dystroy! :D
 
targetting adobe air webkit ?
 
[air]
Oh, tags don't work here
 
I know what Air is
 
Then what's your question?
 
Targeting Adobe Air (Webkit) is just weird to me.
 
7:59 AM
Because who'd target AIR?
 

« first day (1010 days earlier)      last day (3941 days later) »