« first day (1106 days earlier)      last day (3825 days later) » 

11:00 AM
@Yansee 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 the fkey thing is trivial, you need it for every request.
 
Does anyone know how I can remove the duplicate data values from this Json array?
 
I'm on TS now hint hint @Zirak
 
It is pretty large but I noticed that some of the nutrient data is duplicated 3 times. I don't know how this happened but i'd like to cut away the duplicates and some of the useless food types to make it a smaller file.
 
@OctavianDamiean not every, but yeah
 
11:10 AM
@FlorianMargaine Every request on the chat I mean
 
anyway the issue right now is to get the gauth cookie
for this I need to know how this cookie is made: __utma=140029553.1610243970.1382754114.1382754114.1382754114.1; __utmb=140029553.1.10.1382754114; __utmc=140029553; __utmz=140029553.1382754114.1.1.utmcsr=chat.stackoverflow.com|utmccn=(referral)|u‌​tmcmd=referral|utmcct=/rooms/17/javascript; __qca=P0-2013663316-1382754412532
 
@FlorianMargaine you can just remove the openid from your account
 
@ThiefMaster uh? how?
 
"my logins" in your profile
 
ok that's the request giving back the cookies for gauth: stackoverflow.com/users/jambalaya?_=1382754118
@ThiefMaster thanks
hm no
it has them in the request...
 
11:15 AM
Do we actually need that gauth cookie?
 
yeah, gauth means global auth
without it I can only be logged in on SO, but not on chat.SO
 
btw, there is already working code available to login to chat using SE openid... (unless something was changed since i wrote it and broke it)
 
Oh yea, makes sense.
 
@ThiefMaster node! :P
 
yes, for node
 
11:16 AM
wat!?
 
@JonSmith 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.
 
Holy crap!
Why didn't you tell us? :D
 
user: *** pass: ***some1 pls log on to my acct and fix my acct PLEASE!!!
 
wtf
 
11:18 AM
ha. 'Fix'.
 
ha! why do I have so complicated stuff :D
 
@JonSmith: what's wrong with your account? and please change your password now that you posted it in a public place..
 
@CapricaSix is a bot i real don't know 0_o
 
@chintankhetiya we figured that you didn't know.
 
11:19 AM
@ThiefMaster i cant see my old questioms
questions
 
hmm :(
 
that's not a bug, you deleted them or they were deleted
 
@chintankhetiya it's not like it would have been tough to find out if you can actually read.
 
ok
 
why would you think that someone else logging in as you could 'fix' that?
 
i omitted the two crap questions where you posted your login data and asked for people to "fix" your account
did you change your password btw?
 
@TomW because people are weird.
@JonSmith I'd also advise you change the password everywhere you've ever used it.
 
well with a crap password like that one i doubt he used it anywhere else
 
which is a good thing.
 
11:23 AM
@TomW well you could log on and find them then tell me
 
why would I be able to find them if I am logged in as you?
why would I be able to do anything you can't do yourself?
the mind boggles...
 
only moderators can see deleted questions in a profile.
 
Told you, people are weird.
 
Because I can't maneuver? Someone else said the problem was PEBCAK or PEBKAC but I dont know how to find that? They said ask in Meta so here I am
 
PEBKAC is also known as the 40cm problem
 
11:25 AM
Except that you are not on Meta
 
Or PEMBAK? I dont remember exactlu they also deleted that question and told me togo to META
what is this then?
not meta?
 
PEBKAC - Problem Exists Between Keyboard And Chair
@JonSmith Not, this is the main SO chat.
More specifically the JS chat room.
 
hmmm..
 
That's where you wanted to go,
But no need to anymore.
ThiefMaster already told you now.
 
lol look at the user profile description. @JonSmith 's account is compromised anyway :P
 
11:28 AM
@ThiefMaster your script doesn't work
 
@BenjaminGruenbaum he shouldn't have posted his credentials in a public chat room.
 
@BenjaminGruenbaum uh thanks for telling me. i forced a logout for everyone logged in to his account
@FlorianMargaine: oh, there's a return before the message is actually sent. remove that
 
yeah ofc
 
darn I just got flashed, awesome new procedure
 
I get the body for logged-out users
 
11:30 AM
@jAndy WAT
I didn't know cats were operating those!
 
@Indians 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.
 
the python-less node chat client says hello
 
loginSEOpenID('florian+2@margaine.com', 'somepass', function() {
    loginSO(function() {
        console.log('Chat: Retrieving form key');
        request.get({
            url: 'http://chat.stackoverflow.com'
        }, function(error, response, body) {
            var $ = cheerio.load(body);
            var fkey = $('input[name="fkey"]').attr('value');
            console.log('Chat: Current username: ' + $('#top-menu > a:first-child').text());

            console.log('Chat: Sending message');
 
@OctavianDamiean see! cats are still the enemy !
 
@ThiefMaster works for you?
damn
 
11:31 AM
@ThiefMaster Hah
 
cheerio, oh hello!
Interesting.
 
less bloated than jsdom - and jsdom didn't work for me when i tried it anyway
 
meta.stackoverflow.com/questions/203099/… OK GUYS I FOUND THE META NOW WILL YOU HELP ME
 
JSDom is horribly broken. Cheerio is acceptable
@JonSmith @ThiefMaster -_-'
 
11:34 AM
meta.stackoverflow.com/questions/203099/… if you click you can see my question there and then help me. when you log on my acct just dont change my password. just find my questions for me. then log out.
 
@JonSmith: Are you fucking stupid? I told you to STOP PASTING YOUR DAMN PASSWORD IN PUBLIC AND CHANGE IT INSTEAD.
 
and i'll stay here and watch and you can type what i need to do
 
@ThiefMaster LOL
 
hey i trust you guys you're expert programmers
 
11:35 AM
NOBODY can help you by logging in to your account. Your questions are only visible to moderators looking at your profile and i already provided you with the links to them!
 
i just wouldn't trust google or like anyone on facebook
but you guys are the best so y would u hack it
 
Ok, you are clearly a troll. Locking your account now...
 
@JonSmith in order to fix your account we need your credit card and your social security number too, otherwise it won't let us log in to fix your account. Also, your first pet's name and your mother's maiden name.
@ThiefMaster OH RLY? You think he's a troll :P?
 
@JonSmith You must be a troll, there's no way you're real.
 
@ThiefMaster would you please roll out the "NOBODY CAN HELP YOU" part so I can star it ?
 
11:36 AM
i AM real!
 
Yea, right, you're a real troll.
 
wil you help or not?
 
@apero 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.
 
!!/mute JonSmith 120m
 
@BenjaminGruenbaum Muted user 2756257 for 120m
 
11:38 AM
Buh bye troll, go bug the cpp room or something
room mode changed to Gallery: anyone may enter, but only approved users can talk
3 messages moved to Java
 
lol@Java
 
Tried to figure out what's worse than the trash can :)
 
hi im using lazy load for loading images on my website, but it waits till i scroll how can i let him show the images whitout scroll?
 
@apero don't lazy load the images?
 
11:40 AM
Hi?
 
If you want to have them load before the user needs them - then you don't want to lazy load them. That's the meaning of that term.
 
Cool. I'm approved.
 
feel free to unmute, he's not going to chat anymore :p
 
Cool, thanks.
room mode changed to Public: anyone may enter and talk
 
the first like 10 images must be shown but after that it must lazy load
 
11:41 AM
ThiefMaster just went Agent Smith style...
 
and even the first 10 must load after the website is done loading
 
@ThiefMaster doesn't work for me. How do you debug the request cookies?
 
@FlorianMargaine: iirc it just worked when i tried it so i never had to look at the cookies - the lib i'm using is supposed to handle cookies like a browser
 
The request object is quite opaque
 
11:45 AM
what's your console output? should look like this:
 
> SE OpenID: Loading login form
SE OpenID: Logging in
SE OpenID: Logged in (hopefully)
SO: Loading login form
SO: Logging in via SE OpenID
SO: Logged in as ThiefMaster
Chat: Retrieving form key
Chat: Current username: ThiefMaster
Chat: Sending message
Chat: Sent message {"id":12593156,"time":1382787073}
 
Doesn't find my username
SE OpenID: Loading login form
SE OpenID: Logging in
SE OpenID: Logged in (hopefully)
SO: Loading login form
SO: Logging in via SE OpenID
SO: Logged in as
Chat: Retrieving form key
Chat: Current username:
(END)
it's so weird
these cookies get out of nowhere
__qca=P0-2049343796-1382786188194; gauthed=1; __utma=140029553.962761475.1382786188.1382786188.1382786188.1; __utmc=140029553; __utmz=140029553.1382786128.1.1.utmcsr=chat.stackoverflow.com|utmccn=(referral)|utmcmd=referral|utmcct=/rooms/17/javascript
and I'm pretty sure they're the ones giving the global auth
 
@FlorianMargaine The utma and so forth are google analytics stuff.
 
@Zirak I was thinking that too... but not sure
qca too?
 
11:58 AM
Well, I'm sure
qca too
 
to print them: var jar = request.jar(); and then add jar: jar to the options object when calling get()/post() and simply console.log(jar)
 
12:13 PM
0
Q: Add highlighting feature to my webpage?

ShareBefore I tried to cobble something myself, I wanted to see if someone knows of a current project that can do or be tweaked to do what I want. I am in the process of setting up a site and would like to add a highlighting feature. For example the page shows several paragraphs of text and the user...

 
hey
why this not works?
flexbox not works with padding and margin correctly
I've added box-sizing: border-box but it still not works.
 
it not works in Firefox.
 
"it doesn't work in firefox" and don't repeat yourself.
 
12:28 PM
@ThiefMaster why is there a huge Python2 and Python3 split? I think it's one of the suckiest things I have to deal with now with Python.
(Just wondering if you knew, not implying you should :P)
 
yeah it sucks
i'd love to use 3.3 but then i check what libs i'm going to use and usually there's something not yet ported to 3.3... for example, flask/werkzeug are 3.3-ready but many extensions aren't
 
We switched from Java to 3.3 for our freshman students (great success!) so I had to learn that. I use 2.7 for an AI course, and I use 2.7 for open source code I write.
 
but one major version change with breaking changes is better than keeping crap forever like PHP usually does just to avoid breaking anything (even if it could be fixed by renaming a function call)
3.3? nice! most distros use 3.2 as the default python3 version
 
Yeah, but you don't want a huge split like that - you have two languages that just look very similar.
 
i guess the problem is that some library developers don't care about porting stuff :x
 
12:32 PM
New features are added to 3.* and 2.* at the same time, but some of the nicest features aren't. For example I wanted a closure yesterday but I couldn't because python 2.7
 
what's much worse is that 2.6 is still the default on many distributions
 
IMO the problem is never with the users of the language, it's always with language design.
TBH JavaScript isn't much better in that regard, "strict mode" is a huge missed opportunity imo.
(Although I think fixing CPython is a bigger priority)
 
why does this CHAT open two times ?
 
Yes! I'm Lieutenant Commander now! BOOYAH!
 
user1125394
12:46 PM
"I should have bought that boat"
 
@matejkramny 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.
 
1:06 PM
posted on October 26, 2013

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) {} Hey geeks! I'm auctioning a caricature to raise funds for some frien

 
1:20 PM
When you do this console.log(window.setInterval(function(){}, 0)); and you get 33074 do you panic?
 
I panic and set fire to my computer
 
Hey @BadgerGirl and @copy, the two of you are in a relationship right? Please commit to the Relationships and Dating StackExchange site: area51.stackexchange.com/proposals/44577/…
 
I don't think @copy is going to commit to that :P Eva might
 
@Zirak That's angular... I haven't used 1 setInterval in my project so angular must be using 33 thousand
 
@BenjaminGruenbaum Cold feet I presume? You may take his place if you wish. I'm sure @BadgerGirl will be accomodating. =D
 
1:23 PM
@AaditMShah Nono, they're still happily together. I just don't think @copy will spend his time doing that sort of thing.
 
Do you think @Zirak and @CapricaSix should commit?
 
@AaditMShah Yes, they're a couple.
 
We are just misunderstood
 
@Zirak I understand how that's possible.
 
1:24 PM
@AaditMShah I think it's a bad idea for an SE site, all the questions will be open discussion. That's the problem with most SE sites.
Even sites like "programmers" are like that, there are very few SE sites that actually work because of the Q&A format.
 
@BenjaminGruenbaum Communication is always good for a relationship right? I think opening up is a positive step.
 
@AaditMShah Right, communication between partners who are in a relationship , not with the world.
Life in general doesn't have right or wrong answers.
All the commit questions are stupid there anyway.
"When is it appropriate to maintain eye contact and when can it be shown to intimidate or induce desire?" 14 upvotes in the commit. @AaditMShah seriously...
 
I'm aware that life is actually many shades of grey, but isn't that the point of StackExchange: to get different opinions of different people?
 
uh, no
It's to get answers from credible sources
 
@AaditMShah No, that's exactly what SE is not , Stack Exchange is built to minimize discussion - that was always a high priority and a goal for the site and network.
The Q&A format works against discussion and for clear solutions that actually solve problems.
 
1:28 PM
I imagine it'll quickly fall into "Dear Cupid" letters on how they can fix their relationship or how he can get that girl with pretty thighs.
 
There is no right answer that can be peer reviewed on how to live your life.
 
...I meant to write "eyes" instead of "thighs".
 
@BenjaminGruenbaum Makes sense. I would like to see how this site will function though.
That's the reason we have to go through a beta.
 
@AaditMShah Poorly, just like all other SE sites that are on subjective things. Even programmers, seriously.
 
@Zirak It's hard to imagine that you didn't do that on purpose.
 
1:30 PM
@AaditMShah Right, and I'm not mr. know it all - maybe it'll work well. I just don't think so.
 
@AaditMShah You people know me too well
 
@BenjaminGruenbaum It might. It might not. I'm nobody to judge.
Still I would like to see the site unto commitment.
 
I'm off to a family birthday, then do some AI fun stuff.
Cya people later.
 
Bye. Take care Benji.
 
1:32 PM
Happy birthday to your family
2
 
!!afk timeout
 
@BenjaminGruenbaum Stay safe.
 
@Zirak Are you dating yourself? It would be hilarious to see a conversation between @CapricaSix and yourself.
 
What...uh...how...I...I'm not sure how to interpret that sentence
 
Syntax error?
 
1:34 PM
More like a logical error
On my side, most likely
 
It wouldn't be the first time a manufacturer has produced faulty microprocessors.
So have you been working on any new JavaScript projects lately?
 
I'm sure I will.
Unfortunately I'm a uniprocessor system, so I can't take the quiz while talking to you at the same time.
 
0
Q: A quiz with results

Keon DaviesI'm currently working on programming a quiz withe results. I've tried this: <html> <body> <h1></h1> <form> <ol> <li> How much are you willing to spend on a phone per month?</li> <ul> <li><input type = "radio" name = "q1" id="q1_1"> £5-£10.</input></li> <li><input type = "radio" name = "q1" id=...

 
Speaking of a quiz. ^ What a coincidence.
 
1:38 PM
...or is it?
THE PLOT THICKENS
 
Speaking of a quiz. ^ What a coincidence.
 
...or is it?
THE PLOT THICKENS
 
What is this plot that you speak of? Is it like Manchow Soup?
 
Unfortunately, no soup for me, one year.
 
Awww. That's sad. Why so?
 
1:40 PM
 
!!weather Zagreb
 
@AlanKis Zagreb: 20.893C (294.043K), Sky is Clear
 
@Zirak Were you yelled at by the soup nazi?
 
:(
 
Awww, you poor thing. There. There. It'll be better.
 
1:44 PM
Hello, stackers, can anyone recommend me good book to dive in OO JS? More I'm thinking about it, it is more confusing to me. JS is weird
Maybe Crockford's Javascript: The good parts
 
@AlanKis I haven't read a single book on JS till now, so I wouldn't be able to refer a good book. However there are a lot of great blog posts and SO answers out there. Google for them.
49
Q: Benefits of prototypal inheritance over classical?

PierretenSo I finally stopped dragging my feet all these years and decided to learn JavaScript "properly". One of the most head-scratching elements of the languages design is it's implementation of inheritance. Having experience in Ruby, I was really happy to see closures and dynamic typing; but for the...

 
user1125394
 
@AlanKis You may like the above linked answer. ^
 
@AaditMShah I'm doing that all the time. I'll check it out. Well, prototypal inheritance is what confuses me most.
 
@AlanKis Hence I linked you to this question: stackoverflow.com/q/2800964/783743
 
user1125394
1:49 PM
!!define resources
 
@cↄ resources Plural form of
 
@AlanKis Prototypal inheritance is actually simple. However prototypal inheritance in JavaScript is wrong. It's confusing. The following answer explains prototypal inheritance as simply as possible:
55
A: Benefits of prototypal inheritance over classical?

Aadit M ShahI know that this answer is 3 years late but I really think the current answers do not provide enough information about how prototypal inheritance is better than classical inheritance. First let's see the most common arguments JavaScript programmers state in defence of prototypal inheritance (I'm...

 
@AaditMShah I'm tired of c/p other code and using plugins where I actually don't need it, point is that I want to bi JS ninja :) Like @Zirak :D
 
bi js ninja? how is being bisexual related to the ability to write great javascript code? :p
2
 
But I'm not bisexual!
@AaditMShah That's a really good answer
 
1:55 PM
0
Q: How to disable a certain javascript script

D-VeeOn an active website I go to, there is this javascript code that is displayed on every page. <script type="text/javascript"> (function(){var d=document;var i=d.getElementsByTagName('iframe');if(google_ad_client!=null||(window.getComputedStyle?d.defaultView.getComputedStyle(i[i.length-1],null).ge...

 
@Zirak Thank you. =)
@AlanKis There's only one way to be a JavaScript ninja. Write JavaScript code. Keep writing and writing and writing. It's like cycling. The first time you try it you'll fall. The next time you'll fall again, and the time after that too. However if you have the perseverance then you'll get the hang of it and soon not only will you be able to cycle without trainer wheels, but you'll also be able to do wheelies and other cool stunts.
 
@Zirak Hahahaha
@Zirak I didn't watch it because their accents are annoying :p
 
Your accent is annoying
 
2:06 PM
@SomeGuy Are you talking about Seinfeld? Take that back!
 
@Zirak Well, yeah, it probably is
 
@SomeGuy That's a witty comeback.
 
Look how pretty it is! I feel almost like Kirk.
 
These people shouldn't be allowed to use javascript!
 
2:16 PM
if (projectid instanceof Array)
      var projectid = projectid;
   else
      var projectid = Array(projectid);
Oh my
 
Facepalm!
 
o/
 
Hey!
I missed you! Actually, I didn't, but I did miss the riddles.
 
What is red and green and goes 60 miles per hour?
a frog in a blender.
 
Hahaha
I was thinking of an Elf :p
 
2:24 PM
Watermelon in a car?
 
What's the default contentType for a jQuery.ajax() request?
 
!!tell Connor jquery ajax
 
Yeah, sorry
 
2:38 PM
@eyered 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.
 
@OctavianDamiean what the bloody hell
it won't let me register for a perfectworld account
no matter what username I use it just says "User Name is invalid"
 
Why would you play Perfect World?
 
i'm not
star trek online
 
3:10 PM
@Zirak Very nice game
It's a bit easy so far
 
The bit war one, or 10?
 
Bit war
What is 10?
 
oh, didn't I ping you with another game?
 
Nope
 
@BenjaminGruenbaum will probably also like it, and @KendallFrey
 
3:12 PM
@Zirak BenjaminGruenbaum is afk: timeout
 
0
Q: (CanvsEngine) Collission problem ( TypeError: this._polygon[this._frame] is undefined)

user2127102How can i fix this error TypeError: this._polygon[this._frame] is undefined Heres my code: html: <!DOCTYPE Html> <head> <meta charset="utf-8"> <title>Project</title> <link href="css/style.css" rel="stylesheet"> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jq...

 
@user96546 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.
 
@CapricaSix : Thanks, I will keep that in mind :)
 
hey
 
3:22 PM
@rlemon jsfiddle.net/uLp2Q i had to cheat to get the desired effect
 
user1125394
dang I just broke the chain
 
Good afternoon, I have some trouble with a JS script in a one page design site. I have a JS code for smooth scrolling to parts of the page. This works great. The issue was that the header is always overlapping some part of the sections. I have solved this by get the outerHeight of the header. This works also.
But the each portfolio item has its own page. When I on that page (single.html) and click in the navigation of for example "Video" than, it will navigate to (index.html) and also go to that part of the site with the id of "video". Only the header height isn't minus the achor position, so it will overlap as before.
How can I fix this issue?
 
@Caspert manually offset the scroll position by the right amount on page load?
 
@Zirak ~ it's nice, nothing too interesting tbh
 
3:33 PM
@BenjaminGruenbaum Were you bitten!? Strip! Prove you weren't bitten.
 
:12595535 On the top of the page I have set the following: var header = $('#header').outerHeight();
 
@Caspert that's a good start, assuming you're doing it at the right time
 
@JanDvorak So yes I manually set the offset for the header
 
that code determines the header height. You still need to scroll up by that amount.
 
@JanDvorak This is the rest of my code for the navigation.. snippi.com/s/zhpjynt
 
@JanDvorak On line 12 I minus the header.
 
@Caspert are you sure the header is computed correctly?
 
@JanDvorak How do you mean if I may ask?
 
@Dave the title appears to be the question. — Jan Dvorak 41 secs ago
@Caspert are you computing the height inside $(document).ready?
 
How can a driver not support doubles...
 
3:40 PM
ah true
 
@BenjaminGruenbaum ?
 
4 mins ago, by Benjamin Gruenbaum
wth is he talking about http://stackoverflow.com/questions/19579985/which-mongodb-dirver-for-node-js-support-double-datatype?noredirect=1#comment29106293_19579985 ?
 
@BenjaminGruenbaum Oh sorry haha, yes I have set it in the document ready function.
 
@Caspert could the height be changing after document ready?
 
@AaditMShah that gives all new perspective to that crazy redline jTypes guy. Also btw, the people you're quoting don't really hold the opinions you're quoting them for there.
 
3:43 PM
say, by an external CSS sheet having been loaded?
 
@JanDvorak I think so? So I should try to set the height function after document ready?
 
@Caspert you could recompute the height at document load, then
@Caspert or you could recompute the height just before using it
 
@JanDvorak Okay so instead of document ready, load document
 
@AaditMShah sorry, I respect you both personally and professionally, but I don't like your answer. It gives a false sense that prototypical inheritance is magical without mentioning the elephant in the room - the typesystem.
Kudos for quoting Yegge though, I enjoyed that part a lot.
 
@Caspert yep. Unless the height can change after page load, in which case, stick to the other approach.
 
3:46 PM
@JanDvorak Okay, and should I set it after document ready or?
 
@BenjaminGruenbaum he might suffer from some sort of brain damage.
 
@Caspert define "after document ready". Things not written inside a function are executed immediately.
 
im confused who is this Aadit ? I don't see such a person in here
 
@Dave Make sure he's not on your ignore list.
 
how do i check that
 
3:49 PM
@OctavianDamiean That's what I thought.
 
Also, he's not in here right now.
 
ah
ok no hes not on my ignore list
 
@JanDvorak I have set it after the document ready function but it doesn't work..
 
@BenjaminGruenbaum I'm voting to hold as unclear what he's asking.
 
3:51 PM
i guess his translating program sucks
 
@BenjaminGruenbaum Do you know an algorithmically faster method for this: min((a * x + b) % n for x in s)
 
@copy that's python?
 
Yes
Minimum of list after applying a linear function to each element
 
yeah
Is the list sorted?
 
It can be, yes
 
3:54 PM
urm, ok...so this question is asking to implement a linked list, and the implementation methods (last item, previous item, etc) can't contain any loops or recursion (so basically, store this shit in the objects). And one of the methods is the average of the list. I don't quite see how it's possible to sum something without any sort of loop. Am I missing something?
 
It's actually a set
 
I mean, sorting the list is probably more expensive than doing the min calls. If it's already sorted you can find the maximal value between the bounds and take the closest element to it in the set.
 
I should also mention that I do this 600 times on the same set with different values for a, b and n
 
Then yes, sort it
 
0
Q: how i can include news ticker?

Smart Shovoni want to use breaking news like this site http://www.banglamail24.com/ . please see this site footer you can see a floating breaking news. any one can tell me how i can add this breaking news in my site? . i find some code like this </script> <span id="scroller2"></span> <script language="java...

 
3:57 PM
@copy Check the value of a, that's pretty much all you need to know the result
It's the only indication if the line is increasing or decreasing and based on that take the smallest or biggest element in the set.
Well, except the % n part, how often does a*x+b go above n?
 
Almost every time
 
There is a closed form for finding an integer solution in a Diophantine equation but I don't think it's worth it
 

« first day (1106 days earlier)      last day (3825 days later) »