« first day (899 days earlier)      last day (4347 days later) » 

01:03
Hi! How can I have only questions in the search results? Usually both answers and questions are returned.
@Szabolcs Add is:question to your query
thanks!
01:40
@DanielFischer I would... :P
I think it's great :P
02:00
Hahaha.
Okay, it's 8 Central in Canada.
Where's that guy?
;)
02:56
@mootinator He got tied up ? >.<
@jcolebrand Sounds kinky. Computer programmers don't do that. I'm skeptical.
lol
Phone call I wasn't expecting to have
but some things you have to deal with
So did you see the controller model I posted earlier?
I skimmed some of your links earlier.
Was that the gist you had posted?
02:59
So you get that I'm doing an asp.net mvc3 inspired node framework, right?
so if someone is familiar with MVC3 they can mostly come right over
I'm doing stuff like named parameter stuffing, etc.
So what I'm trying to figure out is:
Right.
since there's no decorators in javascript, how do you do like [HttpGet]
typically the router provides that... router.get(function(req,res) { });
exports = module.exports = function _SomeController(models) { /* Notice that we are passing in a model here */
	var λ = this;
	λ.Index = function _index(id) {
		λ.ViewBag = {"cole":"is cool"};
		λ.ViewBag["id"] = id;
		return λ.View(models);
	}
}

exports.config = module.exports.config = {
	"Index": ["GET"]
};
@Fosco you have to configure the router
in traditional C# you would just decorate the method
Because C# is magic. Doesn't seem much different to me.
03:02
Trying to think of something not ugly.
@Fosco also, I'm trying to make this all convention based, so you're never going to type router.get(function) in this app
You would if you were going to write middleware, sort of
but then again, I want to try and account for 90% of the middleware you might need and provide extensibility points for most things
So I have a thought on this, based on this article: strathweb.com/2013/01/…
This is an outdated directory structure, because I've added quite a bit, but it shows the gist of things
So in /Controllers I was thinking, I have two options:
You can either /controllers/indexcontroller/method.js or /controllers/indexcontroller.js or /controllers/indexcontroller/method/get.js
I don't mind wiring all this up, because it's just a matter of testing three different things
Everything else is already written, because I've got the auto-wire working for the router right now.
You could add some ugly convention like .MethodName_GetAttribute = true ;P
very cool.. glad to see stackchat is moving along )
exports = module.exports = function _SomeController(models) { /* Notice that we are passing in a model here */
	var λ = this;
	λ.Index = {
          get: function _index(id) {
		λ.ViewBag = {"cole":"is cool"};
		λ.ViewBag["id"] = id;
		return λ.View(models);
          }
	}
}
So you could do this, right?
Right.
03:08
Or you could return one of the lower nested models, using the same structure
I understand now.
But I'm trying to decide if it's better to just have that exporters class I just removed (scroll up for the other) and just restrict inputs, or if I should like the article provide a way to have all the options.
And I'm not entirely happy with the λ requirements for the closure, I'm going to see if I can't do better than that
I have an idea of something I could do on that, but I've got to research it
Does it sound like I'm on the right track with the triple on the folder structure alternatives, and providing the http verbs being the last option on paths?
So obviously if you only defined index for get, like above, you only get HttpGet and no Post or Put on the Index view, right?
The problem is I then take all those verbs out of the loop for potential method names.
Right.
However, I've never once in my life said "Oh, I'll call this method 'put'"
Meaningful or gtfo
I've said oh I'll call this method 'delete' ;)
03:12
As a public method on an MVC3 Controller ?
Would you be ok having that restriction?
So then the other question is parameter stuffing pattern
In that article, and sort of like what Fosco alluded to, there's patterns on URL matching, right?
> As an aside, as you guys can see, I'm trying to go balls out here and make a fricking framework for node, not just write my app. Mostly because I'm frustrated by Express overall. I may just have a shot at displacing them if I do the middleware right, or not so much displace, as provide a second alternative that some folks might like.
So like in the C# global.asax you can do router configs, and pass like:
/{controller}/{method}/{id}
I'm trying to avoid writing that complicated of a router, I just want to do conventions based and move on.
So the only thing I'm removing is the potential to:
so /{controller}/{id}/{sub-object}/{id} like the article?
03:17
Exactly, I'm not going to let you define that in my system
But what I will do is this:
GET /path/to/file/is/long/and/cumbersome?and=has&some=parameters HTTP/1.1
ok, given that URL
first things first, parse the /path/to/file/is/long/and/cumbersome out and do a split on /
then match path to a controller or static directory. Assuming I find a controller, then match to to a method. If there is no method named to, I assume that you want the index method (that's globally configurable per hosted site, you pick one convention for your site, not per effing route) and then I pass everything else as variables to your method.
So /controllers/pathcontroller/to.js:get = function(id,name,place,time,thing,and,some){
I like to do what you are... create my own convention. :)
Alternately of course: /controllers/pathcontroller.js:to = function(id,name,place,time,thing,and,some){
@Fosco what do you mean?
Sorry.. took a few edits to spit that out.
But does this all sound reasonable?
03:22
Absolutely
Does it look like it would be a reasonable restriction to place on devs to make the auto-wire magic work easily?
It doesn't sound unreasonable at all.
Though this is coming from someone who leaves the default routes alone 99.9% of the time anyway.
It's a restriction that defines the framework.
Then it's up to them if they want to build things that way.
I was going to register regexs in an array and check every incoming request to every regex, and store ancillary data about the methods in the hash, and then this morning I was like "what the fuck am I doing?!?!?" and realized I could just at startup hash all the paths and var names and then never have to guess, just keep hitting matches.
@mootinator exactly, that's what I do
No doubt someone will hate it, but you can't please everyone ;)
03:23
And they can piss off and go build shit on C# and mono ;-)
If I can make it easy to build an MVC app using basic conventions that people are familiar with, and remove all the guesswork, so be it.
Then I have this monstrosity: gist.github.com/34db9631a9132293d7b6
ignore the database part, I'm going to do something else there.
I was talking to the guy that wrote the couchbase driver for node/ruby/etc on twitter and he said if I kept the connection open for the life of the app it would fare better overall, so I'm going to pass that downstream in a certain way
So what this gist tells you is that I'm going to only do form or body requests for PATCH, POST or PUT, right?
Is that a dumb convention?
I mean, it's extra processing overhead if I do it for everything, which I want to be nothing if not efficient when I can be, and it's a good restriction to place, I feel
Besides, you get everything passed in as a this.body or this.form inside the method (magics I tell you) on method operation, so that should be fine, I think
Not sure on that one, I haven't had the privilege of looking at node.
Am I into esoterics territory at this point?
Firefox | Chrome | IE9
@jcolebrand ... What's that supposed to mean
03:29
*shakes fist at Chrome*
@mootinator no, the restriction of "you only get request body parameters if you're on PUT, POST, PATCH requests"
I mean, you could ostensibly reach into the internals of the method on your request and get those things, but I'm trying to avoid making people do that if they follow the convention.
@jcolebrand It's your framework, so you set the convention. You make whatever restrictions you want, just make sure they're the most documented feature.
I'm also going to expose an HttpContext to each method >.>
@Fosco I'm trying to make sure it makes sense
sense is relative ;)
So true
03:31
@jcolebrand Okay...
ok, so I need help, how do I go about documenting all this shit?
Documenting this framework is going to take ages longer than writing it, I expect
If you're CakePHP you don't and people adopt it anyhow.
ha!
@mootinator would you expect a GET request (made from the browser) to have a body attached to it, or should the body be empty?
I'd say find some documentation on an MVC framework you think is good, and start a wiki with a similar structure. :D
@mootinator I would prefer to XMLDoc it, I think. Maybe.
I mean, I would rather it just be intuitive based on the examples I provide one day :p
Like, my entire fricking site
03:34
@jcolebrand I would assume it doesn't.
See: no body
@mootinator Exactly
So, you stuff one in, you gotta go find it. I'm going to assume you don't.
It's like I'm a purist or something, sheesh
I'm still debating on the best way to do the exposing of the main ActionResult methods
@Fosco you do .NET right?
Ok, last thought before I quit bugging folks
Not much, no...
@jcolebrand Is that even valid?
@mootinator it is, but I don't like to acknowledge it
I mean, it's valid in so far as you can do it
03:37
I can do it, but I choose not to if I can. :)
Let's check wikipedia
I've had an idea... an app to migrate a mysql database to the Parse cloud, and I'm going to start building it.
What are we checking Wikipedia for?
03:44
lol
The spec doesn't say what to do, so I figure I'm going to ignore it
Yep.
Get the contents of this URL, and oh, BTW, here's a picture of my cat.
haha thanks, gtfo
Does it make sense to give the controller a fully developed internal representation of all the models in the app?
Since there's no using App.Models.Library;
I could allow you to var model = require('../models/thing/lib.js'); but then I gotta let you be responsible for spinning up and down a connection to the db, so I would prefer to just gen up one db connection (or one db controller) and auto-wire that for every model once.
Then when you want a specific model you would:
var m = models('thing.lib');
So you could, if you wanted, do: function Index (id) { return View(models('thing.lib').get(id)); } and we come back to what I love about how clean MVC is :D
It'd be cool if IoC were built-in.
Help me out here, I'm still a bit of an IoC newb. What do you mean?
Well, as long as 'thing.lib' isn't a reference to a specific implementation.
03:50
no
you would literally have to write:
Then I'm just talking out my butt :)
/models
  /thing
    lib.js
I would figure out from the namespace you give me what model class to pull back
Right... How would I throw a mocked class in there?
Without changing the controller.
I provide a db class upstream, you would mock the db class?
The individual method doesn't need to know shit about the database, that's a model job.
I just tell the controller "here's your models object"
That's usually more difficult than mocking a specific domain.
03:53
but you know what you're going to need?
idk, I never said I was perfect :p
You ask an excellent question
Not impossible either, mind you.
I don't have a great answer, but I have a feeling that because I'm doing constructor property injection it could be done
That's how I set up my MVC controllers, generally.
Is that what you mean then?
public SomethingController(Model1 foo, Model2 bar);
03:56
Yeah, except I'm giving all the models as one object
Ah, ok.
Does that make sense?
So if you wanted to mock-test the controller, you would declare a models class (I can give a dummy on that) and then you would just var c = require('/path/to/controller')(dummy)
Because there's no type class, obviously, so you have to tell it what file to use
That sounds sensible.
03:58
It would actually take a ittle more work than that right now, I've got to rework the "getController" into a module. But now that you've asked me that, the getController will expect a models object as well
Sweet. I like how my design already makes it easy to test with IoC and I didn't even intend on it, I just wanted to be lazy.
I might actually begin to know wtf I'm doing here
@Fosco did you see this gist yet?
This is mostly all the stuff I want to implement (oh, there's more I assure you)
Thanks for the rubberducking and feedback Kevin
Much obliged, I assure you
So does this mean I'll be able to count on you to help me write some tests for demonstrative purposes one day? ;-)
@jcolebrand Well, your collection of models can sort of act as a quasi IoC container.
I must admit I don't like to UnitTest my Controller methods
@mootinator Aye
I figure it's responsible for "knowing things" about the convention
I really do hate configurations
@jcolebrand lol, I'm not great at it either, I just took some time to see how well it suited me once ;)
				"node": {
					"hostname": "localhost",
					"port": "8080"
				},
				"couchnode": {
					"hosts": ["localhost:8091"],
					"bucket": "default"
				},
				"app": {
					"baseDir": "",
					"controllerPath": "",
					"viewPath": "",
					"modelPath": "",
					"defaultController": "Index",
					"defaultMethod": "Index"
				},
				"regex": {
					"defaultController": {},
					"defaultMethod": {}
				},
				"bodyParser": {
					"strict": false,
					"reviver": null,
					"limit": 2097152
				}
@jcolebrand Just looked.. very cool
04:02
This is just "so far"
But I'll be willing to help out, if that's what you need from me, looks cool =)
@Fosco you know I'm going to want you to help with this at some point ;-)
I'm sorry but I'm too distracted to have much of an opinion =\
@mootinator I'm going to lean on all the SE Chat regulars at some point to help accelerate development ;-)
The move to san francisco is constantly interrupting any train of thought I have.
04:04
I figure I need to nail the models, how the controllers work, and get some basic view engine work going, and then wire up an extensible set of translators on certain things (like OneBox is going to have a plugin system, so to speak, to make adding new support as easy as coding up one file), and then I can say "ok, here's the punch list, who can help" and spread it all out
So, I've gotta finish up my Razor ViewEngine this weekend so I can do Razor Views :D
.jshtml -> Razor
Except there's already a jshtml viewengine app out there, and it SUCKS for what I want
I want ViewBag support, Url helpers (also extensible), Html helpers (also extensible), and model, and layouts, and partials
I've got 60% of that already done.
Anyways, I asked for time to 10pm, it's 10PM. I appreciate it
@Fosco even tho you don't do .NET normally, does all this generally make sense on app architecture and usage?
Woot, time to go work on my VE, tty later fellas
Yes, it makes sense.
@Fosco good
Honestly I wouldn't use that type of system, but that doesn't mean it isn't reasonable or awesome.
@Fosco out of curiousity, why not?
too much "under the hood"?
I eschew complexity and over-engineering. I try to stay close to the program flow and not depend on magic.
04:12
I can appreciate that
But I definitely feel like a minority on that topic.
I just want to have auto-wired variables, and I felt like that would be a lot more work to implement on express, so I just wrote my own
I can appreciate that.. that's what I meant earlier, I like to build my own too )
I like to depend on magic, but have the source code available, so I can actually understand how the magic works.
But if I can make it extensible, then I can at least use it to write the handful of sites I want, and maybe let other people use it too
@mootinator that's why I do .NET MVC3 :D
04:14
.NOT
Psssh, you're just jealous that PHP doesn't do compile time type checking
(not that nodejs does either >.< )
When I go to an interview, I claim to like whatever pisses off the interviewers the most. I have a sixth sense for that.
Surprisingly, I haven't touched PHP in over a year. Node and Objective-C are my top 2 now.
04:16
oOo
I really like Objective-C. Took a while to break through, but I understand it now.
So how are you doing your HTML on your websites?
Or are you just doing API access from node and doing all the UI in objc
Ooo I got a limited edition Kickstarter reward that actually sold out. That's unusual.
Or are you writing node.js websites and native iOS apps?
@mootinator that would mean he was doing HTML :p
@jcolebrand Yeah, sometimes I type faster than I think.
04:21
lol, I do that a lot
If I'm doing Obj-C I'm not using html at all.. not web projects. For Node I either use express (minimally) or my own home-grown ways.
really pretty & fast site.. every resource is cached.
That's you?
built it myself.. caching, sessions, shopping cart.. Stripe for payments.
(a project I did at work)
(the graphics were provided)
Stripe! I just found out about them today!
how are you caching things?
Very very simply. Let me show you an example.
// CFG Tools About page script
// Loaded from main server.js

var fs = require('fs');

// The following readFileSync calls will take place when the server process is executed.
// They will only occur once, and the contents will be stored in memory.
// Serving these template pieces to web visitors will be done without disk access.

console.log('Loading HTML template file into memory: about');
exports.pageContent = fs.readFileSync('./pages/about.html','utf8');
04:30
you're chunking back everything? It can't browser-cache any of that ...
oh, all your pages are static?
Static pages, everything else is javascript.
your modules are cached, but your files aren't.
you're reading it in everytime, according to that
No....
Hmm. I last did my weekly backup in August.
04:32
I'm on borrowed time here O_o.
require is read in and statically cached
var about = require('./cfg_page_about.js');
but the module is executed on every request
The performance of the application and the console logs state that it is only loaded once.
then why is it taking 4s to load a page?
04:34
your connection is slow?
I just clicked through about 6 pages in 5 seconds
That could be it >.<
I really hate the network speed here
A tech form the phone company came and improved my line last week such that I now get 4.5mbps instead of 2.2.
However, my phone line no longer hangs up after a call.
So there's that.
That's handy
04:49
@mootinator My friend's iPhone used to patch through incoming audio before she'd pick up the call. That was exciting.
Ha! I bet.
It was the weirdest thing.
Been searching for "facehoof" eh?
Come to think of it, that bothers me a lot
To Chat Feedback!
WHat bothers you a lot?
That the box isn't cleared when I submit the search
05:13
It doesn't clear, and I think that's fine
The behavior is consistent with other search boxes
I get annoyed because then I go to search for something else later and there's text there I have to clear.
Other search boxes don't pop open a new tab though :P
Actually, whenever I get a fresh Firefox installation one of the first thing I do is to mess with about:config so that the browser search bar opens results in a new tab automatically
Uh-oh.
Ah, I just Ctrl+T whenever I want to search with Chrome
Yeah, but you know, one less step
Since most of the time you want your results in a new tab
But then Chrome is different, since you automatically get focus in the location bar, which is also used in search
So that's alright I guess
05:16
Right
writing a cli node app using commander and cli-color
05:32
@Fosco oooooh, question
sup?
How can I build in a CLI to the base of my server so I can talk to it before the http stack kicks in?
aka
I sometimes run one of my apps interactively like that... by just using the REPL.
tell it to restart without killing the process
tell what to restart?
05:33
the httpServer
Because I'm thinking about how to multihome in nodejs as well
so if you want to restart one of the sites, but not all of them
I know I know, just put a proxy on the frontend
How do you restart the http server?
Apache and IIS don't need that
@Fosco load one, start it. load a second, detach the first and attach the second to the port
Are you doing that because something has changed?
Ah. Never had to deal with that. Not sure.
05:36
me either
but it should be doable
Just something to think about and tickle the back of your mind next to mine
Sometimes I run the REPL and then var s = require('./server.js')... it gives you live access to your app.. if you exported a function that restarted it, you could always just execute it on the repl.
Sure
but then I gotta run it on the repl
Also, there should be a way to neatly shut down the server, like for reboots
I'm sure there is. There's a module for everything.
What's a numerical digest?
lol, digits?
06:50
Hello. I have one suggestion. Day by day I have been noticing that quality of answers given are deteriorating. Many users (mostly the new ones who wants sudden reputation increase) are posting of links many a times as an answers and also getting upvoted mostly. Moreover so many times links do not contain exactly what is being asked in question. My proposition is should not we include a section of stating guidelines for How to answer a question in FAQs
Downvoting and flagging is there but including a guideline would have some impact I believe.
0
Q: Getting an editable text from UIImage of text in Xcode

user1990172I want to develop an application in which I capture an image of text (a business card, for example), and now I want it to be scanned and converted into an editable text. Is it possible? Something like optical character recognition.

recent example. :/
@Shog9 per my reading, "hotness formula" implicitly assumes that amount and score of deleted answers are ignored, is that correct?
93
Q: What formula should be used to determine "hot" questions?

Jeff AtwoodRight now the front page Popular tab is fairly broken -- it's a simple descending sort by views. As Joel said in podcast #18, it is "a self-fulfilling prophecy." But this is not intentional, it's only because we haven't had time to improve it yet! As I sit down to write a better algorithm, I tho...

07:28
@rohan-patel No, they just need suggestive and corrective guidance. Just comment, downvote, and flag egregious users.
07:38
@jcolebrand Thanks for looking into it. I have been doing that only in most possible gentle way. But they seem offended when they are downvoted. They kind of take it personal. :( :/ One or two tried to visit my profile and downvoted one or two of my question/answer as some kind of retaliation.. =D
 
9 hours later…
16:20
@gnat AFAIK, the count and score of answers are denormalized, but should usually exclude deleted answers.
 
1 hour later…
17:26
@jcolebrand finished what I started building last night... github.com/gfosco/mysql2parse
 
2 hours later…
18:59
On seeing your own deleted questions, I just put a bounty on it to draw attention, since the situation has completely changed with banning.
Here's my bounty add text: This situation has changed now that there is question-banning for deleted and bad posts. The user needs to be able to fix his posts to work towards unbanning.
311
Q: Show all of my question/answers to me even if they are deleted

vavaI would really like to see all of my questions and answers on the profile page, even if some of them were deleted, and I don't have enough rep to see them on the site. (Note that some questions are automatically deleted after 30 days or 1 year, and the author might be oblivious about what happen...

Anonymous
19:11
I'm hopeful. (I was previously disappointed that this Shog-supported idea wasn't implemented, but that's considerably more dramatic.)
Anonymous
4
A: Moderator deletion comments on questions are fairly useless

Shog9 Make deleted questions always visible to their owners This is the only clean solution here. Fortunately, the original concern - question owners undeleting their crappy questions - has been resolved since that post was status-declined. I don't think deleted questions should be visible i...

My answer:
0
A: Show all of my question/answers to me even if they are deleted

Lance RobertsThe situation has completely changed on deleted questions now that we are banning users from asking questions because of their self-deletions and bad questions. We need to enable those users to see their deleted questions so that they can edit them into shape, and if they self-deleted, then unde...

While I like his answer somewhat, I don't see why there would be a problem allowing deleted questions to show up in one's own profile.
Anonymous
19:55
@LanceRoberts I agree. Going to notifications to find deleted posts to improve isn't ideal.
20:15
This made me completely LOL
146
Q: About your f***ing website

Jeff AtwoodPresented for your enjoyment-slash-amusement. Email received by [email protected] from Name Jesus Christ Almighty, what a f***ing mess of a website. I'm trying to post a question. Just the one, you know, f***ing question. So I sign up for an ID and I'm sent an email that doesn't real...

2
 
3 hours later…
22:56
hello!!
23:08
howdy
'ello
23:46
howdy y'all

« first day (899 days earlier)      last day (4347 days later) »