« first day (891 days earlier)      last day (4074 days later) » 

7:00 PM
Its really easy to make a horrible mess in PHP
 
@PeeHaa Like I said before PHP can be done right!
@PeeHaa You can write good, scaleable PHP, beautiful code. It has a lot of good concepts in it.
 
If only internals wasn't that retardad... :(
 
Please note: "PHP: The Good Parts" is not a good book.
 
@PeeHaa I just always got the feeling I was fighting the language when trying to write good code in PHP, it encourages people to do stuff wrong.
 
@BenjaminGruenbaum Not going to argue there. Especially when people keep whining about BC breaks
 
7:02 PM
@dievardump Wha?
 
@PeeHaa It's a dynamic language with strong OOP and solid lambdas, in theory it should be better than Python but in practice I can't find one programmer who'd say that.
 
@BenjaminGruenbaum I kinda love python myself :)
 
@BenjaminGruenbaum It seems like PHP is a bit like if Javascript randomly had jQuery built into the language.
2
So you never know which option to choose
 
I doubt there are lots of people who don't like python
 
It's strange... I find that I grasp JavaScript almost intuitively. But I don't feel that kind of connection with PHP.
 
7:03 PM
@twiz I really have no idea why they thought it was a good idea to pollute the global namespace with thousands of functions, they should have killed that with PHP5
 
@BenjaminGruenbaum Indeed... I wont be too surprised if PHP evolves into a "good" language one day though
 
@RyanKinal I find PHP much easier than JS, you can teach someone enough PHP in a day to make a living doing web-programming. mysqli_connect, mysqli_fetch_assoc, $_POST $_GET, prepared statements, that's it. You can make money using PHP
 
Sure, the initial learning curve is different. But after years of experience with both, JavaScript is just so much clearer.
 
@RyanKinal JavaScript is reactive, even if you've done C#, Java, Python, PHP, and all sorts of languages before, you have to learn new stuff. Lexical closures are awesome, your programming is reactive, it's really hard to understand clearly
It's very easy to use to make a web-page a bit dynamic, but the people who learn that much hate JavaScript
 
Agreed
 
7:06 PM
If I had a dollar for every PHP or ASP developer who told me JS wasn't a real programming language, that it was retarded and horrible 10 years ago I'd probably have enough to buy a license for Visual Studio. People don't like new
 
lol
 
@AmaanCheval Kangax is the creator of CanIUse, so I think he had trouble to parse this valid ES6 Expression
 
"Flash Developers are not programmers" <- heard that thousands of times too
Also heard that about PHP a bit, but only from corporate idiots
 
@RyanKinal baaah. they always did
at least in recent memory
 
@dievardump Yeah, I know. I don't get the expression, though. :/
I don't know what computed properties are
 
7:08 PM
@Neal Maybe my discovery of this just coincided with the UI change, then
 
@RyanKinal maybe
 
Personally, PHP doesn't really give me anything much anymore. It's slower than node.js for real-time apps, both in development time and speed. It's slower in development time for large back-ends and big websites. PHP is defiantly still very relevant for small projects but I wouldn't choose it for anything personally. Then again I'm in an environment where I can use interesting tools that are really expensive.
I would have probably used PHP again for writing a website for my dad, or a friend's small business. Hosting it is cheap and it does that sort of thing really well.
 
I might leave work (.NET) and go home (to code in PHP)
 
@RyanKinal .NET became AMAZING :) It got really good really fast, I keep saying that over and over because I'm still surprised how something that started as a Java knockoff could be so good.
Especially since you'll be able to script in .NET soon with Roslyn, it's going to open up a lot of options
 
As of right now, I'm on .NET 2.0
Web Forms and VB
 
7:11 PM
@BenjaminGruenbaum im now into django.
 
:hatred:
 
w00t
 
@RyanKinal I'd kill myself
 
@RyanKinal every action has an equal an opposite reaction
people made good language of its time called php , the opposite reaction was a pile of shit ... "Microsoft's ASP.net"
 
@RyanKinal .NET 2 is aweful, WebForms are a horrible idea - Microsoft did not understand the internet at that time, thought they could make the internet stateful
 
7:13 PM
Yeah...
 
@Darkyen Microsoft ASP.NET is amazing today, WebForms was the mistake
 
Hopefully we'll be moving away from 2.0 soon.
 
@BenjaminGruenbaum i tried it .. i puked
 
Classic ASP is the problem, it's like VB Script. ASP.NET can be coded in languages like C#, it's really powerful
 
but then i tried it after ... err tasting node.js
 
7:14 PM
That's the other thing... two of the devs here are totally stuck on VB. They're terrified of C#
 
i know its really powerful because it integrates with the whole .net library
 
Node.js is sexy. But thinking in asynchronous is kinda difficult
 
Mmmm. Node.
 
@Darkyen What did you try? I have many problems with using ASP.NET but none of them are with the development process (mainly licensing and hosting costs)
 
I'm excited to learn more. And I have a project planned to do so.
 
7:15 PM
@BenjaminGruenbaum writing a chatsite :D // my first expereince of all languages is writing a chatsite
 
@theGreenCabbage Think about it as thinking in reactive, you are teaching your program how to react.
 
Guys sorry to bother you again but I'm doing a tic-tac-toe for a coworker and for some reason the click event isn't being trigger. Can anyone take a look at it? And yes, the code is pretty ugly. :( codepen.io/anon/pen/pDuzg
 
@Darkyen Then node.js is obviously a better fit than ASP.NET, no argument there
 
^
i know node.js sucks for simple solutions
 
@BenjaminGruenbaum Hehe. True. Takes some time to get used to. You're thinking that for everything you do there has to be a reaction to that
 
7:16 PM
I didn't like .NET, spending my time trying to figure out which library already implements my task isn't my idea of programming.
 
@AndréSilva You have a syntax error "Uncaught SyntaxError: Unexpected identifier "
 
Dealing with errors for when I first started using Node.js was very weird. I never even knew what callbacks or closures were
 
Ah.. I'm going to put it in jsfiddle..
 
@Darkyen WHAT? I couldn't disagree more, node.js is awesome for simple solution, just don't try to make a website with it. It's awesome for web services, it's only ok with websites
 
I always screw things up at codepen
 
7:17 PM
@theGreenCabbage It's very different
@Umbrella It is exactly my idea of programming, whenever I'm trying to do something the first thing I do is always see what other people did. Often I don't end up using that code but I learn a lot from looking at other solutions.
 
@BenjaminGruenbaum Same. I learn much better via examples
Maybe Im just dumb
 
@BenjaminGruenbaum if you want a small dynamic page node.js is sort of over kill
sometimes .... very sometimes php & asp.net can be better
 
Speaking of the devil, anyone familiar with using res.headers in node.js?
I need some help
 
@Darkyen Oh, if you just want to make a web page dynamic node.js probably isn't the best tool. I'd argue .NET isn't either because deployment is harder but it's still a better option than node.js. It's doable, just more work
 
@theGreenCabbage damn easy :P
 
7:20 PM
@theGreenCabbage Pretty much everyone :) response headers are a biggie, headers are a big part of how HTTP works
 
if you use express , still damn easy if you know how http headers actually work
 
@Darkyen Sweet. Ill post the snippet of code here? I promise it's clean
 
@theGreenCabbage don't forget to format it! (control+k)
 
@Darkyen Every web developer should know how headers work
 
7:21 PM
@BenjaminGruenbaum should
 
@dievardump Very interesting!
Any idea why someone would downvote thishttp://stackoverflow.com/a/15622461/1348195 ?
 
You should know that I always post interesting links.
 
imgur.com/v6nTB5j Alright, here it is. Currently this script prints to Terminal. The headers section posts a bunch of information, some which I don't need. For my uses, I only want it to parse "server" "x-aspnet-version" and "x-powered-by". Any ideas?
obj.headers escapes illegal characters (which I need in order to store things into Mongo)
 
@dievardump guess whose codepen is in there -_-
fucking anand's
 
aha I saw
 
7:24 PM
@theGreenCabbage I don't think you need to escape in order to store in Mongo. Also, You can just access res.headers["x-aspnet-version"]
 
@copy I'm stuck. any hints on your 88?
 
You do. Since I'm parsing in thousands of URLs, if there's an illegal character, it stops the script (also stops writing into Mongo)
 
@theGreenCabbage What's an 'illegal character'
 
Like
"."
There's an object that's called "page.ly: v4.0"
I don't know what it is IMO, but it breaks write() into Mongo
XD
 
@Shmiddty Build every line from both sides
 
7:27 PM
@BenjaminGruenbaum Oh, I'm not saying I don't look at what others have done, just that .NET feels more like connecting libraries than solving problems.
 
@theGreenCabbage I'm not sure why that would break 'write' it seems unlikely
 
I've already put my solution on codegolf.se, by the way
 
@copy But then how do you solve the right padding issue?
 
@Shmiddty There are two cases. In the one you put the number on both sides, in the other you put a space on the left side
 
7:28 PM
@Umbrella Ok, I'm not sure how you got that feeling though.
@theGreenCabbage Interesting.
 
@theGreenCabbage Oh, that's a field name, that's just how MongoDB works, I thought you meant a value
 
It's not documented anywhere. TOok me awhile to fix
Oh yeah, sorry
Back to my question. Is it possible to maintain the BSON structure but omit unnecessary field-names?
 
@theGreenCabbage It's because of how mongo works, the "." is usually used for the same use in JavaScript. In Mongo you can query based on object.subobject.value and stuff like that
@theGreenCabbage Of course! Instead of using a for... in loop just store the two values you'd like
@theGreenCabbage Your for... in iterates through every header and adds that property, escaped, to obj. Instead of doing that just add the two relevant properties
obj["whateverProperty"] = res.headers["whateverProperty"];
obj["whateverProperty2"] = res.headers["whateverProperty2"];
 
Great! However, I would like that in headers: { }
 
Suggestions?
 
for those interested in js-ci: ci.testling.com/substack/mocha-testling-ci-example (in the open source field)
 
var headersObj = {
    "prop1":headers["prop1"],
    "prop2":headers["prop2"]
};
//store that object later
 
@copy I see.
 
Wow, jQuery is so stupid, they have a .toggle method that shows an hidden element and hides a shown element so users wouldn't have to type .show() or .hide(), but toggle accepts a boolaen value of either true or false to either show or hide.
 
7:37 PM
@copy accidentally stole the lead (if I golf more, I'll attribute you)
 
87 with the old approach?
 
codegolf link?
 
@copy basically used your code from codegolf/se adapted to input/output, and I didn't realize it was one char shorter
 
Damnit
 
not sure how mine would be different from what you had previously:

for(i=n=+readline();--i+n;print(s))for(j=n;j;s=j--^n?k>0?k+s+k:" "+s:k+"")k=i<0?j+i:j-i
 
7:40 PM
Yeah, got it myself
I had for(a=i=readline();--i>-a;print(s))for(j=+a;j;s=j--^a?k>0?k+s+k:" "+s:k+"")k=i<0?j+i:j-i and added the +9 later
 
ah. I see
 
@BenjaminGruenbaum I receive the error "headers is not defined"
 
@theGreenCabbage don't just use code I paste here, it's to illustrate a point, in your case those are res.headers and not headers
 
@BenjaminGruenbaum Oops!
 
7:44 PM
@theGreenCabbage if you don't understand a bit of code it's better that you ask why it is that way
 
That is one of my malfunctions
@BenjaminGruenbaum When you mention "store the object later", what do you mean?
 
@PeterTaylor, I thought "natural numbers" meant positive integers. Checking wikipedia, I see that there is actually no agreement on whether zero is a natural number. At this point, I choose to take refuge in the ambiguity rather than change my solution :) — dan1111 5 hours ago
hahaha
 
@theGreenCabbage You want to store i in mongo right?
 
Oh, no, [i] is just the number of URLs in that specific array of URLs
Do you mean hostNames[i]?
 
@theGreenCabbage but you want to store some headers, right?
 
7:46 PM
Yes
 
Not gonna test this. I believe you. — tomsmeding Mar 21 at 21:43
 
"server" "x-aspnet-version" "x-powered-by"
Those three items
 
fun comments on codegolf
 
Isn't obj creating the object you want to store? Instead of storing the entire headers array, or escaping it, we're creating the object we'll store
 
Time to download Fedora and check what the other distributions are doing.
 
7:47 PM
Ah
Through that*
 
@theGreenCabbage Please format your code, (control+k)
 
var headersObj = {
        "server":res.headers["server"],
        "x-aspnet-version":res.headers["x-aspnet-version"],
        "x-powered-by":res.headers["x-powered-by"]
      }
Sorry about that.
 
Yes, then we'll store headerObj in Mongo
1 message moved to Trash can
 
What I want to do is wrap this into "headers: {}"
Ill show you an example
 
In that case you can do "headers: headersObj" and assign it
 
7:50 PM
{
    "url": "google.com",
    "statusCode": 301,
    "headers": {
        "location": "http://www.google.com/",
        "content-type": "text/html; charset=UTF-8",
        "date": "Mon, 25 Mar 2013 19:11:54 GMT",
        "expires": "Wed, 24 Apr 2013 19:11:54 GMT",
        "cache-control": "public, max-age=2592000",
        "server": "gws",
        "content-length": "219",
        "x-xss-protection": "1; mode=block",
        "x-frame-options": "SAMEORIGIN"
    }
}
There's the "headers" object, which also shows the list of header information
My goal is to show only "server" and the two other titles I mentioned previously
 
psst
 
@theGreenCabbage I wouldn't change the response object, I'd create a new object for storing, it's best practice and safer
 
you can put JavaScript inside of an SVG
and it works
/vanishes
 
@BenjaminGruenbaum We were close, right?
 
7:55 PM
@theGreenCabbage Right
@Incognito Also, inside CSS in IE :P
 
@BenjaminGruenbaum Can you show me the rest of the steps to wrap it into headers: {}?
We are creating a new object
 
(I don't know why, but I always get a lot of satisfaction in giving a non-regex answer to a regex question ( stackoverflow.com/questions/15623466/regex-for-query-string/… ))
@theGreenCabbage What exactly would you like to store?
 

« first day (891 days earlier)      last day (4074 days later) »