« first day (111 days earlier)      last day (4829 days later) » 

3:02 PM
cross browser local storage
I have cookies. What else can we use?
 
flash
!
 
Anyone good with jquery and json here?
 
that's sort of a broad question
 
OK, let me explain.
I have a page which saves html to to the database.
when the data is sent to serverside, the html is encoded
then i want to bring that data back to the clientside using json
but when i stick the encoded data into json and try to display an element of the data in an alert box
the alert box does not work, it just sticks the html from the database on the web page...
any ideas?
 
I'm confused. JSON is a notation for data structures. are you saying you're putting HTML into a string in a JSON object?
 
3:13 PM
yes, encoded html as in style="color: #ffffff">
 
If you just want to grab HTML from the server, you don't need to use JSON
 
I need json, becuase I want to grab more than the html, i need to grab the id, text and html.
i.e.
 
ok... can you post your jQuery code?
 
{"id":0,"heading":"heading goes here","content":"style="color: #ffffff">"}
 
@IvoWetzel hate you.
 
3:15 PM
@davethieben Yes, 1 sec.
 
lol
 
@oshirowanen ew. I would look at re-engineering it.
 
function get_page( id ) {
$.ajax({
url: 'get_json.aspx?rand=' + Math.random(),
type: 'POST',
data: { intPageID:id },
dataType: 'json',
error: function(xhr, status, error) {
$('div#divMain').empty().append(xhr.responseText + '<br /><br />');
},
success: function(results) {
alert(results);
/*
$('input#txtID').val(results.id);
$('input#txtHeading').val(results.heading);
$('textarea#taContent').val(results.content);
*/
}
});
the alert will not work, let alone trying to stick the jquery into the input controls.
 
@Raynos ?
 
have you looked at the HTTP response to make sure the JSON is correct?
in the very least the alert should pop up a message that says "[Object object]"
 
3:19 PM
I am not even getting that, i am just getting the json written on the html page itself as text.
i will check out the http response in a few moment, being called away...
 
@Raynos ???
@Raynos !?!?!??????????????????1111111111111111?!?!?!!?!
 
the other thing I would recommend is to use Firebug in Firefox to set a breakpoint on your 'alert(results);' line and see what the results variable contains
 
I would use console.log instead of alert...
 
I don't have firefox, however I have chromium, so i should be able to see the details in the developer tools. give me a few moments and I will try it out.
 
IMHO, you NEED to have Firebug in Firefox if you're doing web development. period.
 
3:33 PM
@davethieben This is the reponse I am getting from chromium:
{"id":3,"heading":"heading four","content":"&lt;p&gt;
Content &lt;span style=&quot;color: #ffffff&quot;&gt;&lt;span style=&quot;background-color: #ff0000&quot;&gt;1+1+1+1=4&lt;/span&gt;&lt;/span&gt;.&lt;/p&gt;
"}
looks ok to me.
i could be wrong...
now if you look at the jquery alert will not work if I do the following
success: function(results) {
alert(results);
}
instead it just sticks the following on screen as html text:
{"id":3,"heading":"heading four","content":"<p> Content <span style="color: #ffffff"><span style="background-color: #ff0000">1+1+1+1=4</span></span>.</p> "}
 
uh
alert(results.content) ??
 
...
 
what do you mean by "sticks the following on screen" ?
 
@davethieben The same way the following gets displayed here: {"id":3,"heading":"heading four","content":"<p> Content <span style="color: #ffffff"><span style="background-color: #ff0000">1+1+1+1=4</span></span>.</p> "}
just as flat text on the page and not in an alert box.
@IvoWetzel That gives me nothing even though the reponse says I am getting the following json:
{"id":3,"heading":"heading four","content":"&lt;p&gt;
Content &lt;span style=&quot;color: #ffffff&quot;&gt;&lt;span style=&quot;background-color: #ff0000&quot;&gt;1+1+1+1=4&lt;/span&gt;&lt;/span&gt;.&lt;/p&gt;
"}
On my serverside page which generates the json, I have the following: Response.ContentType = "application/json"
That is right isn't it?
 
3:48 PM
yeah. not sure what's going on.
try using console.log()
instead of alert
 
1 sec.
i've not used console.log before, so....
not sure whats going on.
 
Sigh... kitteh's input stream is now probably filed with those code blocks
@CodingKitten Yes?
 
@YiJiang link to it, but post a link, 3 people will use of WTF
 
@CodingKitten Okay, not quite
 
@YiJiang should we rewrite $.Deferred better? It guys
 
4:03 PM
@davethieben I've changed the error section to the following:
                error: function(xhr, status, error) {
                    alert(error);
                    alert(status);
                    alert(xhr.responseText);
                },
and I am getting the following in alert boxes:
 
@oshirowanen Just use console.log, seriously. You can even copy and paste the output here more easily
 
aha... which is why it was getting appended to your document
 
@davethieben yes...
now need to find out why the error is happening.
but
 
?!?!?!?!
 
error = SyntaxError: Unexpected token ILLEGAL
status = parsererror
xhr.response.Text = {"id":3,"heading":"heading four","content":"&lt;p&gt;
Content &lt;span style=&quot;color: #ffffff&quot;&gt;&lt;span style=&quot;background-color: #ff0000&quot;&gt;1+1+1+1=4&lt;/span&gt;&lt;/span&gt;.&lt;/p&gt;
"}
 
4:06 PM
@IvoWetzel !?!?!?!?
 
random guess
 
@oshirowanen You've got invalid JSON, I think
 
is the request on the same domain?
I had it once that chrome did the request cross domain but then failed with the above syntax error...
 
@YiJiang This is the json I am getting, which part is wrong?
@IvoWetzel Yes, same domain, I am using an intranet server.
{"id":3,"heading":"heading four","content":"&lt;p&gt;
Content &lt;span style=&quot;color: #ffffff&quot;&gt;&lt;span style=&quot;background-color: #ff0000&quot;&gt;1+1+1+1=4&lt;/span&gt;&lt;/span&gt;.&lt;/p&gt;
"}
 
restarts kitten for tons of code in responses fun
 
4:08 PM
Hi! :)
 
@IvoWetzel groans
 
thanks for letting me know about console.log by the way, very useful!
 
for (var i = 0; isFinite(i); i++) {
    console.log('A very looong loop.');
}
 
@oshirowanen Looks valid, hmmm
 
@oshirowanen try console.dir too :) e.g. var myObj = { foo: 'bar', baz: 'quux' }; console.dir(myObj);
 
yc
4:10 PM
Has anyone here had success with the Facebook JavaScript SDK and registering events? This SO answer uses widely cited code, but for the life of me, I can't get it to work.
2
Q: Facebook "Like" button callback

MattHello, I am interested in implementing the facebook "Like" button, but I would like to know what user is clicking on this button so I can get some useful information from this. From what I have read, facebook is leaving us in the dark on who is clicking on what. ANyone have an idea on how I could...

 
no, but I'm about to in the next couple of days...
 
yc
I'm really just looking if someone knows of a working version of a Like button callback so I can pinpoint what I'm doing wrong
 
Hi all do you think it is possible to make a metronome with jQuery?
 
with javascript 100% yes
idk what specifically jquery would make or break about a metronome though.
 
@Opoe what's a metronome?
 
4:16 PM
@Loktar coool :o
 
@Nyuszika7H a city-going gnome
 
lol
 
LOL wtf dave
that was pretty random
 
metro-gnome. not random
 
@Nyuszika7H well you can adjust bmp and then the metrognome :')
 
4:17 PM
playing with words.
 
hahah
 
sorry... my job is driving me a little batty...
 
yc
var interval = setInterval(function() { tickMetronome(); }, 250); // assuming you want it to tick every 250 milliseconds
 
@yc nice nice nice
but how do you link to a sound mp3/wav :p
 
@Opoe var mySnd = new Audio('path-to-sound'); and mySnd.play()
 
:')
i mean how do you link your sound to the metrognome
 
yc
@davethieben not a helpful search; lots of 90s era methods sown there.
 
yc
The SO result is ok, but not good for a metronome, since the methods shown are slow.
 
exactly
well ill do my research :$
 
yc
4:25 PM
@Nyuszika7H is that HTML5 Audio?
 
@yc yeah
 
yc
So, Opoe, assuming you're okay with HTML5 Audio supporting browsers only, you'd just define the Audio object once, and then trigger the mySnd.play(); call from within the setInterval function
 
@yc well thank you very much for you help:)
goodbye all!
 
what are the HTML5 supporting browsers?
 
depends on feature.
 
4:55 PM
@davethieben caniuse.com
 
5:29 PM
@CodingKitten Say something!
 
@IvoWetzel I that sucks considered "rep-whoring" just want to grab HTML from the advice i got so far
 
nice
 
Code Golf is in Public Beta! It's really nice.
 
3
Q: Sort a list of numbers

ircmaxellAbout Code-Bowling: In golf, you try to get the lowest score (smallest application, most elegant, etc). In Bowling, you try to get the highest score. So if you follow, the goal of a Code-Bowling challenge is to make the biggest, most bastardized, hardest to maintain piece of code that still m...

 
@ircmaxell I'm going to answer that :)
> This account is temporarily suspended. The suspension period ends in 3 hours.
 
5:39 PM
assert(INT_MIN == -2147483647 - 1 && INT_MAX == 2147483647); Just checking whether those integers are behaving
 
nice
 
No WW, No sockets, no SVG, no CSS3, no webgl, no file api.
 
@Raynos Pretty outdated... yes
"MPEG-4/H.264 video format" Chrome 10 Yes
 
Hi guys
any advice on this?
1
Q: Changes showing in FF4.0 but no other browsers?

Myles GrayHi Guys, I'm having a VERY weird problem, I have added a tabbed content style switcher on the right hand sidebar of my site but it's only showing up in FF4.0, all other browsers are showing the old version, I have tried cache clearing and everything but to no avail, Screenshots: FF4.0b10: Any...

 
5:49 PM
clear cache?
pointing at the right server?
proxy issue?
DNS issue?
 
Moonsnails?
 
@MylesGray open chrome Ctrl+Shift+N then go to it
 
@MylesGray your going crazy
 
in privacy mode it should elminate any cache issues
 
@ircmaxell cache has been cleared, pointing at right server, no proxies in place DNS was "fixed" by my crap hosters yesterday
@IvoWetzel Your option seems most likely
@Raynos tell me about it every damn thing i do goes on fire
 
5:52 PM
whos your host?
 
domainexpress.co.uk
Im thinking of moving to mediatemple
 
I love hostgator
for my shared hosting that is
hosted zombiegames.net on there for years until i had to switch to dedicated hosting
 
what are they like with DNS issues and downtime?
 
there was downtime once in like 2008
 
my hosters are as slow as a turtle with 4 broken legs and a limp
 
5:54 PM
router issue, for 30 minutes
hostgator is friggin awesome
their backend was theplanet
now theplanet is softlayer or something like that
 
i might just go and self-host
i've done it before
only stopped as i didnt have Fibre Optic then
 
yeah i used to as well.. but i couldnt support the number of users
once it was hitting 2k daily my server was dying
 
@MylesGray: Are you sure you're pointing at the right server?
have you wiresharked the connection to determine if it's going to the right IP
 
@ircmaxell I assume it is pointing at the right server as my hosters said they had fixed it and its the same web address in all browsers
I just find it strange that it only works on one browser on one computer
 
that is very odd
god i remember when dns changes would take over 48 hours..
 
5:58 PM
DNS can take a long time to propegate
@Loktar: they still can if your ISP sucks
 
ill run a tracert
oh dear
TraceRt wont trace the route properly
this is a joke
my hosters have blocked my IP now
 
wow..
 
huh?
 
i went to the IP of my site
 
what's the IP of the new host
 
6:01 PM
84.45.20.98
 
tracert 84.45.20.98
traceroute to 84.45.20.98 (84.45.20.98), 30 hops max, 40 byte packets
1 1-16-13-69.cust.propagation.net (69.13.16.1) 0.360 ms 0.333 ms 0.390 ms
2 64.182.161.1 (64.182.161.1) 0.231 ms 0.239 ms 0.241 ms
3 ge-11-1-5.er1.dfw2.us.above.net (64.124.196.153) 0.305 ms 0.367 ms 0.361 ms
4 above-ntt.dfw2.us.above.net (64.125.12.222) 0.598 ms 0.755 ms 0.860 ms
5 ae-6.r20.dllstx09.us.bb.gin.ntt.net (129.250.3.66) 0.729 ms 0.724 ms 0.733 ms
6 as-1.r20.asbnva02.us.bb.gin.ntt.net (129.250.3.43) 35.138 ms 35.018 ms 35.031 ms
 
and I get a page saying that my ip has been blocked by the hosters firewall
 
what's the hostname?
 
helium.domainexpress.co.uk
 
dig helium.domainexpress.co.uk

; <<>> DiG 9.3.3rc2 <<>> helium.domainexpress.co.uk
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 16054
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 0

;; QUESTION SECTION:
;helium.domainexpress.co.uk. IN A

;; ANSWER SECTION:
helium.domainexpress.co.uk. 120 IN A 84.45.20.98

;; AUTHORITY SECTION:
domainexpress.co.uk. 172800 IN NS nserv1.domainexpress.co.uk.
domainexpress.co.uk. 172800 IN NS nserv0.domainexpress.co.uk.
so that looks good
but I get a parking page
 
6:03 PM
yep all is well there
I had a problem yesterday and had to get them to fix the DNS
they had the A records pointing at nothing
idiots
 
nothing?
 
yeah it was hitting 404s all the time
it went on for about a week at random intervals
same happened to 2 of my clients sites
 
404 has nothing to do with an A record
 
same hosters
well it might do as it wouldn't work and then all a sudden would work
 
(well, it could, but not directly)
 
6:06 PM
yep that
 
@MylesGray: DNS issues causing something like that are very very rare due to the way DNS is cached
 
Yes I know but I got onto the hosters and said they had messed up the DNS records and would fix them
 
fair enough
 
fail:
 
did you try to nmap the server or something?
 
6:10 PM
nope nothing just tried to tracert
they have a rediculously low ban threshold
If I use upload on save for my FTP it blocks me
 
get a new host
it's not worth a host that does things like that
 
who do you reccommend?
i was looking into the media temple (ve) package and then use a bolt on CDN
or then again, if you want it done right, do it yourself
 
there are a ton
 
hostgator has unlimited bandwidth
 
I don't recommend a shared host. Ever
 
6:13 PM
but your limited on processing
meh shared hosts have thier place
 
Shared hosts are for amateurs / hobbists
 
tkae an old pc. Install linux. Tada server!
 
lol or for people who want to maximize profits
 
well im mainly hosting blogs/static sites and small e-commerce solutions
 
If you care about your site on any level, go for a VPS for the security gain alone (yet alone performance, etc)
@Loktar: You're willing to tradeoff security for profits? Interesting...
 
6:14 PM
my costs went from $20 to $300
 
Nope
 
@Raynos have done this before and will be looking into it again, just need a 100% rock solid ISP
 
you can get a good VPS for $10 per month
 
yeah i went to a full dedicated server
 
@ircmaxell Aren't in plain text passwords enough security?
 
6:15 PM
lol
 
i used shared hosting for my crappy blogs/cent makers
 
@Loktar I'm up to 3 colocated servers for my personal endevours
 
@ircmaxell The solution i linked to was a VPS
 
id love to do colocation.
so expensive though
well ones ive looked into
 
@Loktar: it's cheaper than dedicated
 
6:16 PM
@IvoWetzel I have statics passwords. static string password = "password" It is like efficient.
 
I pay an average of $70 per month for each server
 
wow.. where at?
 
2 TB transfer on a 100mbit pipe
 
Are you in the US?
 
a few places
yes
 
6:16 PM
Im in Omaha
 
but I own the servers, so there's capital outlay
 
no one local i could find at a decent rate
 
what do you think of CDN solutions?
they look good in theory
but in practise how is it?
 
(each server is a dual - dual core Xeon with between 2 and 8 gb ram, and dual SCSI RAID-1 drives)
 
yeah im looking for exactly that, I have no problem purchasing a server, up front cost is fine
 
6:17 PM
CDN is good if you have the traffic level to justify it
 
my problem was finding a colocation under $200
 
I have 2 in NY area, and one in Texas
 
im looking for a sort of $200-$300 a year host, as at the moment I'm still in full time education + design is my part-time job
how thick can they be:
Matthew Brown: Thank you
Matthew Brown: Looking into this
Matthew Brown: Thank you for waiting
Matthew Brown: I have checked the DNS records and they are correct
Matthew Brown: Also the website is working fine
Myles Gray: it seems to work fine but
Myles Gray: on the right hand side menu bar
Myles Gray: I have updated it to include a tabbed slider in javascript
Myles Gray: and it isnt showing on anyones computers except mine
Matthew Brown: ok
Myles Gray: if you look here can you tell me which you see?
WTF does this even mean
Matthew Brown: The plugin is not configured correctly
Myles Gray: what wordpress in general or one of it's plugins?
Matthew Brown: Only plugin is not configured correctly
 
Im surprised your getting that much support out of them
 
pack of feckless idiots
 
6:24 PM
look man idk, on hostgator I was able to get up to 12k people daily before I had to move it. TMK they are aslo the biggest shared hosting provider. There are always better options, but for a simple blog I dont see anything wrong with throwin git on a shared host and paying $10 monthly.
Its really hard to find any legitimate info on hosting
they seem to pay $$ for reviews online
 
Yeah I have noticed that too
Ill look up TMK
 
to my knowledge
= tmk
 
ohh my acronyms suck
 
Or do the vps thing
thats $30 monthly right?
 
aye aye
 
6:27 PM
but yeah man your host sucks lol
shared hosts never really care, your just $20 monthly to them
 
Haha, my hosting costs $40 per year ATM
 
oh wow..
lol thats insanely cheap
 
aparrently there is a reason for that
it works now... case closed
anyone want to anwer the question for a few rep?
:P
 
ircmaxell was the man on that one
lol unless he hit is rep cap today already
 
you get what you pay for
 
6:30 PM
1
Q: Changes showing in FF4.0 but no other browsers?

Myles GrayHi Guys, I'm having a VERY weird problem, I have added a tabbed content style switcher on the right hand sidebar of my site but it's only showing up in FF4.0, all other browsers are showing the old version, I have tried cache clearing and everything but to no avail, Screenshots: FF4.0b10: Any...

 
I am 50 away from rep-cap, so post the Q
 
its open to anyone that wants it
 
answered
 
accepted + up'd
 
:-D
 
6:36 PM
god i love some good old fashioned corruption in the morning
 
up voted
 
hehehe. I've always made it known that I'm not against whoring like it's nobodys business...
 
I would rep whore but im too slow to get the questions answered :(
 
Tip from experience. Speed doesn't matter as much as correctness for most of the questions.
Stupid simple ones with 10+ answers will depend on speed
but more complicated or specialized questions are not dependent on speed as much as you'd think...
 
I find it frustrating that a 1 minute answer gets me 14 upvotes, while a detailed answer to a complicated question can give me none, with an accept if I'm lucky
 
6:43 PM
@lonesomeday: post things like that here, since I actively up-vote the better answer over the faster one
I can't stand that it happens like that (speed is rewarded where thoroughness and correctness is ignored)
 
@ircmaxell It's more that questions that can't be answered quickly are worth far less rep
 
I know
 
It's a perverse incentive that's inherent to the SO model, IMO, but it's frustrating all the same
 
another thing that bothers me, i won a bounty for a question but the guy doesn't accept it!
surely the bounty should be linked to the accepted answer
 
it is, if the person accepts it during the bounty period
 
6:47 PM
Posted by Jeff Atwood on June 18th, 2010

We originally rolled out the question bounty system in January 2009. It has worked fairly well, in terms of motivating answerers and increasing the connection between askers and answerers. But I think we made some mistakes in being overly strict in our design of the bounty system.

Just take a look at some of these highly voted meta requests in the [bounty] tag:

The feedback on the bounty system is quite extensive; this is an indication that there are what I’ll euphemestically call er … “issues” … with the current system.  …

 
but now the guy can't accept it unless he starts a new bounty
 
> all bounties are completely independent of and unrelated to accepting an answer
 
righttt, okay got it
 
And then you get the other way. Where the Q is upvoted, but none of the answers really are:
4
Q: Php (eval vs call_user_func vs variable functions ...)

AleksandarEven though there's some discussions regarding this issue I wanted to check on certain example what would be the best approach. Instead of using existing solutions I created my own persistence layer (like many do) So my approach is also in question here. For every table in db I have model class ...

 
hmm, is someone looking for an up-vote :D
 
6:50 PM
not really.
if I was I would have linked to my answer. I was just providing an example from today
Getting close to rep-cap
 
yay, @haltman actually found my "use less jQuery" advice helpful :D
1
A: jquery/ajax general question about limits and cache management

NathanI guess the answer to "is it correct load data when requested instead of pre-load it and show them when called?" is "which will the user prefer when switching to a different tab?" no delay (all content loaded during initial page load) short delay (ajax lookup of the new tab's content) a full pa...

 
7:05 PM
commented
 
all that hosting talk... I can't stand monthly payments for anything. I guess I'm a cheapskate.
 
I pay yearly, so I don't have monthly payments for that ;-)
 
Oh, but colo is still an expensive recurring cost. I use cheap shared hosting (Dreamhost these days) for everything, and have a dyndns Mac mini serving a little bit from home.
@ircmaxell and @Loktar , I'm curious, how do you justify the expense? Are you bringing in ad revenue on your personal sites?
 
7:30 PM
+1 on what @Nathan said, I cannot really even justify 2-300$ per year
 
in Sandbox, 25 secs ago, by Coding Kitten
@Nyuszika7H arg. I'm never going to create this place is websites that tell this guy to fart and not be amused?" === too old enough to create tags on older or newer browsers and not be amused?" === too old enough to fart and I will try it seems not
He said the F word!!!
 
@MylesGray I think vanilla shared hosting is pretty good these days and can be had for closer to $100/year.
 
Who do you host with atm @Nathan?
 
@MylesGray DreamHost, and I would recommend them wholeheartedly.
I still have some stuff on the "lifetime" account I bought a few years ago at CornerHost, whom I would not recommend
 
@Nathan - Not much hope if this is them: dreamhost.co.uk
 
7:41 PM
@MylesGray no, dreamhost.com . Californian, but I think they have machines in Europe if you prefer?
oh no... that was a different host I was thinking of.
 
yc
I've had pretty good experiences with MediaTemple. Shared for $16/mo, dedicated virtual for $40/mo (if you use a lifetime promo code from retailmenot)
 
@yc I'm only hosting 4-5 websites at the moment would a VPS solution suit better?
@ $30 per month
 
yc
@MylesGray what kind of traffic do you get, and how important is performance to you
(by 'what kind', i mean 'how much')
 
I'm a performance whore, even if I don't get that much traffic I have this thing where I MUST get my pages loading ASAP, kind of overkill really
Can I share google analytics with public?
 
@Nathan: Yes, advertising (I make a decent enough profit)
 
7:51 PM
@ircmaxell what do ad agency do you use?
 
yc
@MylesGray I find mt dv to be quite performant for $40 a month. You definitely want to stay from Shared Hosting if performance is a bugaboo for you.
@MylesGray don't need exact numbers. I just mean, do you get 1000 visitors a day or 100000 a day; they have different needs.
 
hahaha oh god no
hang on ill check my stats
 
@MylesGray: google
has seen 90k unique visitors per day (but almost 4 million pageviews)
 
oh dear...
 
@MylesGray DreamHost lets you host many (100?) multiple domains or subdomains for that $9/month shared hosting account, and so far performance has been great.
 
7:54 PM
I'm a smallfry
in the last 28 days
(dont laugh)
266 absolute unique
1K page views
 
starts a ddos on Myles to make him feel better
 
really must write more content...
 
yc
@MylesGray you almost certainly can afford to downgrade to shared hosting.
 
lol
 
@Nathan <3 you'd do that for me
 
7:56 PM
joins @Nathan's DDOS
 
someone want to spread a DDOS worm on my site? :)
 
Done
Oh, and you really should change your password from toor...
 
toor...?
 

« first day (111 days earlier)      last day (4829 days later) »