115 questions
111
votes
10
answers
187k
views
ASP.NET MVC Custom Error Handling Application_Error Global.asax?
I have some basic code to determine errors in my MVC application. Currently in my project I have a controller called Error with action methods HTTPError404(), HTTPError500(), and General(). They all ...
82
votes
11
answers
27k
views
What is a better way to sort by a 5 star rating?
I'm trying to sort a bunch of products by customer ratings using a 5 star system. The site I'm setting this up for does not have a lot of ratings and continue to add new products so it will usually ...
75
votes
3
answers
68k
views
Hide traceback unless a debug flag is set
What is the idiomatic python way to hide traceback errors unless a verbose or debug flag is set?
Example code:
their_md5 = 'c38f03d2b7160f891fc36ec776ca4685'
my_md5 = '...
49
votes
6
answers
28k
views
JavaScript in <head> or just before </body>?
I am about to embark on a new web project and I plan to put some JavaScripts in the <head> and also some before </body>, using the following scheme:
Scripts that are essential for the UX ...
9
votes
4
answers
4k
views
What is the most accurate way to emulate the "placeholder" attribute in browsers that don't support it natively?
Recently I have been looking at jquery/javascript solutions to emulating the placeholder attribute, but none of them seem to have it right. Common issues are:
Native browser support is not used first
...
207
votes
9
answers
719k
views
Setting background colour of Android layout element
I am trying to, somewhat clone the design of an activity from a set of slides on Android UI design. However I am having a problem with a very simple task.
I have created the layout as shown in the ...
43
votes
4
answers
21k
views
How to set initial values for NSUserDefault Keys?
I want to set some initial values for my NSUserDefault keys so that the first run of the app has some reasonable initial settings. I thought I ran across a simple way to do this in the app bundle ....
30
votes
5
answers
20k
views
Make a wizard like application in Android
Which you think is the best way of doing a wizard like application (user can navigate between screens with a next and back button, and each screen has to save some state data) in Android platform.
I ...
8
votes
1
answer
2k
views
In VSCode, how to open local files without using a dialog but just by typing and Tab-complete?
I was so used to the way of opening a file in Emacs, by just C-x C-f and typing and tab-completing, without needing to use a mouse. In VS Code, I have to go through a "open file" system ...
41
votes
9
answers
40k
views
Possible to detect if a user has multiple tabs of your site open?
I'm just thinking about the whole site registration process.
A user goes to your site, signs up, and then you tell him you've sent him an email and he needs to verify his email address. So he hits ...
12
votes
1
answer
561
views
Setting the cursor in the element's default styles, or in element:hover?
Is there any practical difference between the following two?
button {
cursor: pointer;
}
And:
button:hover {
cursor: pointer;
}
The MDN docs specifically state that:
The cursor CSS property ...
20
votes
8
answers
83k
views
How to implement a blinking label on a form
I have a form that displays queue of messages and number this messages can be changed. Really I want to blink label (queue length) when the number of messages were increased to improve form usability.
...
1
vote
3
answers
830
views
Accessible toggle
We are redesigning our website and there are some concerns internally that accessibility affects the design element. A toggle mode was suggested. Our standard version would still be accessible with ...
100
votes
3
answers
65k
views
How long should you debounce text input
Lets say we have a simple example as below.
<input id="filter" type="text" />
<script>
function reload() {
// get data via ajax
}
$('#filter').change($.debounce(250,...
80
votes
2
answers
42k
views
Client-side "Feature Tour" (tutorial/instructional) overlay system? [closed]
Is there a system/framework in existence which focuses on providing tutorial / help like overlays in the browser?
Example: You have a webapp which requires a certain level of instruction to the user. ...