« first day (1320 days earlier)      last day (3622 days later) » 

4:00 PM
@JanDvorak I believe lookup tables and some genius electrical engineering
 
I may have missed something
 
you can do it in O(1) time as long as you disregard gate (and wire) delay
 
^
I'm a theorist :P
 
just an array of ANDs and a lot of adders.
 
that's what I was thinking of
I just didn't know exactly how
 
4:01 PM
but I can't think of a better way to do integer division than to emulate the binary long division, which will have huge gate delays and O(n^2) space.
 
@dystroy I think the "recent names" thing goes away after like 30 days
and I've seen a lot of high rep long time users recently switch to identicon :?
idk why that is
 
people sad with the current state of SO and not willing to be associated to it anymore ?
 
@dystroy I don't mind association. I've merely given up.
 
user1596138
guys guys guys guys guys
 
user1596138
 
user1596138
4:09 PM
An hour ago this was 4 down and 0.4 up :D
 
Anybody good at date conversion in python?
 
@RUJordan would you like some regexes?
 
Naw, I'm just unfamiliar with converting a string to a date. I can never seem to get it right
 
is it acceptable to first convert the python program to javascript or go ?
 
lol it's just python. Figured I'd ask here before the Py room
never been in there
 
4:20 PM
@Jhawins Nice
 
I have zero experience with python dates
 
I've got a better upload speed, I think
 
@JanDvorak no worries, will hit up the PyRoom
 
@RUJordan What's your input format and why don't you try before getting it wrong
 
user1596138
@SomeGuy Watcha got
 
4:21 PM
2 up, 2 down :P
 
@copy I do have a try lol
 
user1596138
Hahaha. I have 2.0149 down technically
 
in Python, 1 min ago, by RUJordan
How would I convert a string like "Thu, 21 Feb 2013 16:35:56 +0000" to mm/dd/yyy format? I tried convert = time.strptime(d, "%m %d %Y") but that gave me this error: ValueError: time data u'Wed, 24 Oct 2012 18:23:49 +0000' does not match format '%m %d %Y'
 
@JanDvorak I got three quarters of my dates with Python ;)
 
user1596138
4:22 PM
@RUJordan ugh...
 
user1596138
from dateutil.parser import parse
parse('Tue, 26 May 2009 19:58:20 -0500').strftime('%s')
 
user1596138
This is only doable with a library tho
 
@SomeGuy "Seven Star Internet Service" one two three four five
2
 
user1596138
dateutilitize or something
 
@Jhawins no libs
 
user1596138
4:23 PM
But it you wanna do it plain. Just start bashing your face with a brick now. :)
 
user1596138
From what I saw.
 
@KendallFrey Hahaha
 
@RUJordan The format looks like it has a name, but it should be possible to do with strptime if you give it a complete format string
 
@copy unfortunately I have no control over the date string. It's from an API return
 
The API documentation should tell you what format that is
 
4:28 PM
You'd think that but it's pretty bad documentation :(
Crow helped me get it to convert = datetime.strptime(d, '%a, %d %b %Y %H:%M:%S').strftime('%m/%d/%Y') but this still gives: unconverted data remains: +0000
 
It's RFC 1123
 
I am going to be putting in offline support in my web app. my thinking is to use a callback on all my ajax when the http status indicates there is 'no internet connection'
i am wondering if a filter of <= 400 would be good?
or <=500 for http statuses?
 
Sometimes, I wish I could !!urban in Skype
 
@copy got it handled. My boss said precision isn't important so I just substringed it.
d = d[:-6] ftw
 
Sounds legit. Until it explodes
 
4:42 PM
And on that day, I will stand proudly and say...
"Not my problem!"
God bless America dammit.
 
!!nudge 30m 16*22
 
@rlemon Nudge #3 registered.
 
Excited for thai food today
 
wow, turns out it wasn't dumdum who serial voted me a while back
was "reversed" now "user removed"
@ThiefMaster if a users account is 'suspended' would that show up in the rep as "removed" ?
!!afk back to work.
 
5:00 PM
!!afk thai food
 
@rlemon No, I don't see why it would
 
@rlemon when that happens I'm always sad I can't see who it was
 
@dystroy rlemon is afk: back to work.
 
10 minutes in the python room and I already learned something
and it's not lunchtime yet :( so butthurt
 
it's a good thing! I have to spend a few days here to learn something
 
5:07 PM
Man you're a slow learner
 
h8u
 
lol
 
Mornin Kitten
 
@DarrellPayne 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.
 
5:13 PM
How's life?
 
Hungry :( You?
 
@rlemon nudge 16*22
 
@RUJordan Just got to work, so not too great
 
understandable
it stormed bad yesterday and knocked out some traffic lights so that was fun
 
Ooh, that's fun.
 
5:17 PM
Sounds like fun
 
it was fun
 
The book Javascript Ninja has a Samurai on the cover. That happens because JS is not strongly typed.
 
@Jhawins Aside from /learn, which is the only validly complex command when you look at its possible inputs, would you really benefit from flags?
 
@SomeKittensUx2666 ShitSOSays?
 
Usually you just pass a bare word, like /something input modifier
Which may not be ideal, but commands are generally simple
 
@Zirak More syntax! Spaces is for python. Parens are good.
 
confused whaaat
 
@bjb568 you must be a lisp fan
@SomeKittensUx2666 ahaha
 
@BartekBanachewicz pretty sure he's too young for lisp
 
@SomeKittensUx2666 LOL
thats awesome
 
5:22 PM
@dystroy that is what I'm trying to deduce lol
 
@bjb568 has a point though, if you reinvent Bash, a piano will fall on your head
 
@SomeKittensUx2666 It also coincides with John Resig being a poser
 
Yay pianos!
 
But if we reinvent zsh...
We won't ever finish
 
Half a piano
 
5:22 PM
@SomeKittens he was suspended from so for a year.
Did that happen before his rage fit?
 
Who was
You people confuse me :(
 
Myth
On mobile can't link
Well can. Won't.
 
I got suspended once. "Hello,

I'm writing in reference to your Stack Overflow account:

http://stackoverflow.com/users/2888561/bjb568

After reports of unusual voting patterns, we've determined that you engaged in a pattern of downvoting against specific users.

The focus of your voting should be on the post, not the user; this kind of community hostile behavior will not be tolerated.

These downvotes have been removed. Please refrain from engaging in malicious or revenge voting in the future.
But that was a misspress. I wasn't the right person.
The suspension lasted about 90 seconds.
 
@bjb568 that's strange
go complain
and burn them all
 
user1596138
> This address uses a network port which is normally used for purposes other than Web browsing. Firefox has canceled the request for your protection.
 
user1596138
5:26 PM
Fuck you if I know enough to manually type my port in I damn well better be able to go to it.
 
@t1wc No, they undid it because it was the wrong person.
 
@bjb568 burn them anyway
 
This creep was the one who got suspended.
 
user1596138
There is no possible override. You just cant use firefix to interact with people stupid enough to use standard ports
 
@Jhawins facepalm. At least there's Chrome
 
5:27 PM
@bjb568 can you even downvote with that rep?
 
@Jhawins wat
 
@t1wc There were multiple sock puppets, one of them had enough rep apparently.
 
How did you even get that? I've been using nonstandard ports for a while with no problem
 
@bjb568 oh
 
I barely have enough time to spend here at SO with one account... let alone have the time/energy to sock-puppet. Oh to be young again.
 
5:29 PM
@Zirak Protection from connecting to Email/FTP/whatever servers using HTTP requests
 
@Zirak him
 
Browsers have a blacklist
 
@rlemon Nice
@copy So no connecting to localhost:25 ?
 
Because some of these servers don't terminate the connection when you send garbage
 
ooohhh
That's clever
 
user1596138
5:31 PM
@Zirak Firefox doesn't warn you you're working with a retard, it says "fuck you I'm putting my foot down" and that's that. There is NO way around it.
 
user1596138
Chrome and safari
 
How do you call a constructor with new when the arguments to pass are in an array ?
 
@dystroy working with bad API, are you?
 
user1596138
Seriously why can't I at least try to connect to google.com:21?
 
do you know the max. number of arguments in advance?
 
5:32 PM
@JanDvorak trying to build a bad API
 
@rlemon Yeah, before.
 
@dystroy don't.
 
user1596138
Who cares lol. Firefox. You bitch. It's been awhile since I've complained about you.
 
@JanDvorak yes but I want some light code
 
@dystroy accept an array. Square brackets are cheap
 
5:32 PM
too bad everyone ignored my link.
 
want to simplify this :
function fun(a, b, c, d, e) {
    return new Thing(a, b, c, d, e);
}
 
@dystroy fun = Thing
 
if it weren't the new, I would have used arguments
 
ah right new
 
@dystroy Inside Thing, check if it's called with new (with typeof this).
 
5:33 PM
@dystroy not simplifiable
 
@Zirak eww
 
@Zirak same problem elsewhere
 
new should be a function
 
function Thing (a, b, c, d, e) {
    if (typeof this !== 'Thing') { return new Thing(a, b, c, d, e); }
}
 
actually...
 
5:34 PM
it's an operator
 
It's not varargs, but it's nicer
 
could you express it as a function, though?
 
Easily, use Object.create
 
Why can't you just do function fun(array)
 
^ he makes sense
 
5:34 PM
then return new Thing(array[0], etc)
 
Now he made less sense. But accepting an array is an ok solution
 
accept an object
that being said, it says a bit about language if its default function syntax has to be walked around
 
… unlike Haskell
 
> Google’s New Car Is Tiny, Cuddly, and Could Change Transportation Forever
I like the priorities there.
 
5:37 PM
I'm not sure why you want to simplify that though
I mean if the properties aren't crucial to know on initialization, you could have some reasonable defaults and have the user inject values as necessary
 
@Zirak - something like
function fun() {
    function instance() {
        return Thing.apply(this, arguments);
    }
    instance.prototype = Thing.prototype;
    return new instance();
}
 
@BartekBanachewicz yes, that's a limit
 
We had this discussion at work the other day and i think I like the current one. Explicit is better than implicit.
 
@adeneo That wouldn't work for me : the constructor call the prototype functions. I don't want to change the constructor
!!afk 1 hour
 
hi guys
 
5:39 PM
function newOperator (proto) {
    var args = [].slice.call(arguments) // Array.from(arguments)
    args.shift();

    var res = proto.init ? proto.init.apply(proto, args) : proto;

    if (Object(res) === res) {
        return res;
    }
    return proto;
};

var superAwesomeness = {
    init : function (a, b) {
        this.foo = a;
        this.bar = b;
    },
    blah : function () {
        return this.foo + this.bar;
    }
};

var obj = newOperator(superAwesomeness, 1, 2);
console.log(obj);
@BartekBanachewicz Definitely. The new operator is terrible.
It can be implemented as shown above, since Object.create is awesome and does all things
It'd be lovely though if we didn't have statements, and operators were functions as well. Ah well.
Anyway @dystroy, drop new, use the super enhanced newOperator or just Object.create :P
 
So what advantage does that have over the new operator?
 
@dystroy It's also usually a bad sign for the constructor to do any functionality
 
@Zirak dystroy is afk: 1 hour
 
@Meredith It's not magical, it can be used on everything (any object, not just a function), it's more true to the prototypical way of doing things.
 
user1596138
@rlemon I just saw your complaint lol.
 
5:43 PM
which one? I complain a lot now-a-days
ohh grooveshark!
gotcha
 
hey all
 
user1596138
My complaint is that the queue is per session. They needa persist that shit because I (like many other I'm sure) completely close my browser when I walk out and reopen it to the same tabs. This clears my queue on page reload.
 
so newOperator(superAwesomeness, 1, 2) is roughly equivalent to new superAwesomeness(1, 2), right?
 
user1596138
They're all JS but dude the obfuscation they try to pull is BULLSHIT!
 
Except it's not magical, can be used on everything, and it's more prototypical
 
5:44 PM
Could you do ?
function fun() {
    return new (Function.prototype.bind.apply(Thing, arguments));
}
 
As I implemented it, it's functionally equivalent. You won't get typeof or instanceof, but who cares.
 
user1596138
Hahaha they have some of the most mini-raped-ified code ever
 
hi
 
@adeneo No
 
is there a way for an image's width to not expand the window and just get cut off?
 
5:44 PM
So if they're functionally equivalent, what's the point?
 
user1596138
@zirak you see my ping earlier? Modifying commandArgsParser?
 
The point of new is that it passes a this value
@Jhawins I even replied to it
 
i have a negative margin pulling an image left out of the window a certain amount but the right margin is messing things up
 
why someone called me in chat? i got a ping.
 
@Meredith Of using the more robust Object.create? All the reasons I mentioned above.
 
5:45 PM
tell me everything
 
Yeah I guess I'm just not understanding why Object.create is better
 
25 mins ago, by Zirak
@Jhawins Aside from /learn, which is the only validly complex command when you look at its possible inputs, would you really benefit from flags?
 
I thought the point of new was to create a new instance ?
 
Exactly, and that's passed as the this value to the "constructor"
 
user1596138
I want to extend /learn so you can teach commands that support flags
 
5:46 PM
So, new automatically passes this to the constructor, but your method doesn't?
 
Flags = logic, logic = bigger macro language. /learnEval would be better
4 mins ago, by Zirak
@Meredith It's not magical, it can be used on everything (any object, not just a function), it's more true to the prototypical way of doing things.
Those are the reasons
 
but I like new so FU
 
I read that but it isn't a very good explanation
Which is why I've been asking for clarification
 
If I have var o = { a : 4 }, and I want another one of it, why can't I do new o ?
 
Because new creates, it doesn't copy
 
5:48 PM
But new just creates another copy of func.prototype
 
I generally have some initialization I want done right away
 
user1596138
Why? We could have automatic flags on everything like /urban for filtering, /google. /color can have a gradient flag. Eh. Maybe it's pointless. Either way I'm pull requesting the color command with a -g flag
 
Oh
This is starting to make sense
 
user1596138
Good input thanks
 
@Loktar And when you have a wrapper around Object.create, you can
 
5:49 PM
idk I've struggled with the reasoning besides its the cool thing to do
so I just default to new
 
@Jhawins Oh, so you don't mean /learned commands, you mean globally accepted flags
 
I've had to use create for extending
 
Which, again, I don't quite get
 
but new has satisfied what I want to do every other time
 
user1596138
Yeah. Do you use the terminal a lot?
 
5:49 PM
Whoever's starring like an idiot...don't
 
user1596138
I do.
 
user1596138
I like flags better than string arguments.
 
I really want some good answers damnit because this is something I've wanted to know!
 
Wasn't there that bug that would reveal the starer's name?
 
@Jhawins The bot isn't the terminal, the commands aren't as complex, it's not as branched, you don't have a lot of functionality
 
user1596138
It's ok. I built "deathStar.js" for this reason. Star every single message if you like and I will clear them to a specified location instantly
 
@Zirak second time today
 
    var o = {a: 4};

    var p = new o; // TypeError: object is not a function
    q = newOperator(o);
 
user1596138
I know @zirak. I'm trying to add functionality.
 
user1596138
One step at a time.
 
5:51 PM
@Loktar I've laid out my points. Object.create is general, it's not magical, it can be used more naturally
 
This is pretty cool @Zirak thanks
 
@dondom My guess is that it's you, so stop it
 
so its just the "right" way basically?
 
user1596138
Don't you run out of stars?
 
Also Bash and the likes are old and not very well thought through, we want something more intuitive
 
5:52 PM
yea but you get like 40 or some shit
 
@Loktar Under some definition of "right", yes. I find it much more natural and easy to reason about. If you don't, use whatever you want.
 
user1596138
Like. If you star 50 messages in a day you are permanently out of stars @dondom
 
user1596138
;)
 
@Meredith Enjoy. You may be interested in the spec for the new operator: es5.github.io/#x11.2.2 and [[Construct]]
 
@Zirak yeah not trying to argue, just genuine curiosity
 
user1596138
5:53 PM
Believe me and stop
 
HAMMERTIME!
 
Thanks @Zirak I'll read up on that
 
lolol
 
@Jhawins I just don't see how the current commands (besides /learn which is a mess) can be improved upon by adding flags. Convince me with examples, and I'll be in.
 
5:54 PM
guys is there any way i can have an element not effect the overall width of the window/body?
 
user1596138
Cool. That's fine bro. Just wanted your opinion on where I should parse these.
 
@KevinMurphy - position: fixed
 
user1596138
No harm in fucking around with my fork
 
^sounds painful
 
shivers uncomfortably
 
user1596138
5:56 PM
> too much spooning leads to forking
 
@Jhawins Definitely. If you do something awesome, I'll be glad to put it in. ...so to speak
 
> too much spoonfeeding leads to forked code
 
@adeneo thanks!!
 
@KevinMurphy but taking it out of the flow, like @adeneo suggested would be the better way.
 
5:58 PM
@mikedidthis thanks man this was the solution i was looking for. there are elements that are in line with it where i can't really change the positioning so this is ideal thanks!
 
huh, dondom is here
 
user1596138
 

« first day (1320 days earlier)      last day (3622 days later) »