As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
Thought I would put this out there before I embark on my own research.
In a current MVC 4 app, I am looking for a way to track/audit visitors. I am looking for a way to:
Record a record on each site request.
Record will include things like logged in user, session id, requested page, page coming from, etc., etc.
Action methods will be decorated with an attribute to trigger the creation of that record, so we can specify exactly which action methods get logged.
Anyone attempted or heard of anything like this?
Thanks in advance for any replies.
An ActionFilter seems to be the way to go. I have an example of a similar requirement that I'd be willing to send you, let me know.
You should consider writing a base controller that all your controllers will inherit from and then do all the logging in there.
Related
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
From the UIWebView, The UIWebView class should not be subclassed.
I just want to know why. There is no more detail about this.
Because I met a memory out issue in my project, which create one extended UIWebView, which could cause memory out issue. Otherwise, just create the UIWebView instance will not cause the issue.
That is why I want to address this problem and try to analyze more.
Thanks for the guy to give some comments in terms of the design pattern with MVC.
I hope to close this once get some comments for memory management.
Thanks,
iOS development works on MVC concept and V part which is View should be as generic as possible. If you write a custom view, when the model changes the view has to change as well. It becomes interlinked..This means the view cannot be reused, especially when a new UI comes out..Better to put the code in the controller portion...Key: Keep the view as generic as possible..
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I like to use the strongly defined routes like
#Html.RouteLink("Home", RouteName.HomeIndex)
Why there is no equivalent helper for child actions? I don't like the actual #Html.Action(actionName, controllerName, routeValues) helper.
In addition, the performance would be better. There is no need to check all routes internal in the RouteCollection.
Contribute your idea and even the helper at http://aspnet.codeplex.com/ - it's open source.
The answer to Why isn't there one is that either:
Nobody thought of it yet
Someone thought of it but didn't do anything about it
Someone thought of it but thought better of it - for example because a route can be very general and you would need to supply controller, action and routevalues for most routes, which means the Action helper works fine.
In terms of performance, I've not had any problems with the performance of Html.Action so you might want to measure it before you get too concerned about optimising this aspect of the framework.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
I am starting with web development. I looked at the URL design of a few websites, especially github and stack overflow.
A user page on github is of the form github.com/<username> (e.g. github.com/roma1n). This strikes me as requiring careful reservation of top-level identifiers, i.e. there cannot be a user explore in github, because github.com/explore shows a list of trending/interesting repositories. It also seems hard to extend once usernames that would make useful page names (e.g. latest, all) have been taken up by users.
Stackoverflow seems to go on the opposite route, where a user page is of the form stackoverflow.com/<numeric id>/<username>. This seems to add redundancy to the address, unless multiple users with the same nickname are allowed (e.g. to make life easier when identifying through other providers such as OpenId?).
What are the pros and cons of each solution, (and of the other obvious ones such as example.com/users/<numeric_id> or example.com/users/<nickname>)? Is there a current best practice or reasonable default?
I think your suggestion example.com/users/<nickname> is pretty reasonable. given a choice I'd pick this, becuase it's more memorable for users than an id, and it sidesteps the the users nickname problem. of course you're free to adopt any convention that fits your use case, so whatever works!
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
In Rails, we offen write a lot of code in our models such as class methods, plugin methods, named_scopes, callbacks... I am wondering if there is a good pattern to organize the sequence. I saw the best example in a presentation before, but now I forgot.
Anyone have suggestion? Thanks
There is no set way... If you are using a scope (since Rails 3, named_scope is deprecated) that relies on a method, it has to be defined after the method in the model. It's possible to mix and match and sometimes it's necessary to do so.
It doesn't affect load time or efficiency to the best of my knowledge
I'm pretty OCD when writing ruby, so I have a very opinionated answer to your question. I created this gist as an example of the structure we use.
I wrote about that a while back as part of my style-guide:
acts_as_good_style.
YMMV as to what the "best" grouping/ordering is, but if you'd like my take it's there under the "Model idiom" section
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I am looking for a way to get the essence or the most important aspect of a webpage? If I provide a URL, is there any external service which can accomplish this? I am not looking for snap.com like service as it provides a snapshot.
I might be willing to even implement such a system on my own. For beginning I do not want to put excessive effort, but rather would love to able to get some basic results. Are there any thoughts on how I may approach this problem?
You can try Yahoo's Term extraction service
Update 02-May-2012
Yahoo has release a new Content Analysis Web service which will be replacing the Term extraction service. It can be invoked by syntactically sweet YQL as shown below
select * from contentanalysis.analyze where url='http://www.cnn.com/2011/11/11/world/europe/greece-main/index.html';
There is also AlchemyAPI which offers a weservice which may serve your purpose.
By snippet, do you mean like a quote that sums up the entire page you want to link to?
So if snap.com isn't a fancy, what about the entire page? For verbosity's sake? You could try out BackupURL if you want like a cache of the entire page of the site instead just a snapshot of a portion of it.