Tuesday, May 2, 2017

gui design - What is the iOS alternative to a radio button?



There is a radio button in android and WEB but what is the best alternative in iOS? And please don't say segmented control becuase it's not working in my case.


The case is a list of items 3-6 which have 1-3 words of text each and it is required to pick 1.


Screenshot of web radio buttons that i need to adapt for ios



Answer



Usually this is done using a table view, which is basically a list of items as well, only with a checkmark instead of a radio button. Sometimes such lists are on a new 'page' in the navigation structure. How this fits in your navigational structure depends on the context.


List of items


terminology - What's the name of the web design pattern of showing the shape of content while actual content is loading?


It's pretty common for Single Page Application (SPA) sites to load and display the site layout before loading its content. Lately, I've noticed that instead of just showing a wait-spinner or "Loading..." message, a lot of theses sites show the template / layout that the content will populate, with the text and images filled in with flat geometric shapes.


Example from Slack


It seems like a good pattern because it's less jarring than having one small line of wait-text replaced by a big dump of messages or whatever. I'd like to read up on the pattern, maybe find a library for doing it more easily on my site, but I have no idea what to call it, and I'm having trouble even describing it succinctly enough to search the web effectively. The closest example I could find was this old article which doesn't give the practice a specific name.


"Placeholder" is the first thing I could think of, but of course tags now have an actual placeholdler attribute and lots of people ask about filler text or other content (Lorem Ipsum, Kitten Ipsum, and the like) so the results tend to be unhelpful. I'm hoping that the industry has agreed upon a unique, descriptive name for this practice and I just haven't found it yet.



Answer



The first thing that occurred to me was that the suggestion of type being shown in your example is certainly referred to as greeking.


Searching “greeking used in loading screens” led me to multiple articles about this UX technique, and specifically this one which refers to the concept as a Content Placeholder.



As good a term as any I think.


So specifically here you have greeking and image Placeholders and together the whole thing can be referred to as a Content Placeholder.


risk management - Expected shortfall minimization as portfolio objective


I'm trying to solve portfolio problem with minimising its Expected shortfall, assuming the returns follow a stable distribution. If I'm able to calculate MLE fit to the series, calculate expected shortfall of that instrument, then how would I optimise the portfolio? I've read for instance here it is then linear programming problem.


I've tried to calculate ES of each of my instrument and then optimize the objective function weights*ES, but I always get minimum for vector weights 0, which makes sense, that's when its lowest. But that's of course not what I want, what is it that I'm missing? Is it good idea to take code which calculates this for normally distributed returns and just replace the function which calculates the actual ES?


Thanks a lot



Answer



The ES of the optimized portfolio is (except in trivial cases) not the same as the weighted sum to the ES of the individual instruments; your objective function should be the expected shortfall of the weighted sum of the losses, not the weighted sum of the expected shortfalls of the individual instruments. (So it is an integral over the weighted sum of instrument losses.) This is equation (20) or (21) in the paper you linked. Minimization is facilitated by breaking this into two pieces (shown as equations (22) and (23)) by introducing the auxiliary variables $z_i$.


There are two other constraints. One is the constraint on the sum of the weights (mentioned by a Alex C above); this is equation (25). The other is the constraint that the portfolio delivers a desired level of return, equation (24). The optimization program you want is analogous to equations (22)-(25) in the doc you linked.



It's really a pretty amazing thing that minimizing expected shortfall is numerically feasible. That insight is due to Rockafellar and Uryasev (and these papers are mostly available online link1); but getting from an intuitive description of the problem to the operational form of the programming problem isn't as pretty as you would like! On operationalization, however, I found these slides by Guy Yollin invaluable: http://www.r-programming.org/files/RFinance2009.pdf


Monday, May 1, 2017

Photoshop / Illustrator / InDesign - placed image different dimensions and resolution


The same problem over and over again - why do images placed in Id/Ai show different size than in PS?


I've made image in PS of about 2000x1500 pixels at 300 PPI.


Then made Ai document of 2500x1600 pixels at 300 PPI. To avoid any conversion/compression surprises I simply placed the Ps document in Ai document. Guess what? It's shrunk and terribly pixelated though MB size in link properties seems correct. Ok, then maybe for some reason it reduced the resolution: let's make an Ai doc at 72 PPI. Surprise again - the placed PS doc is exactly the same size as it was in 300 PPI doc. And exactly the same pixelated.


Let's try Id then: one with print intent (so it should have like 300 PPI) and one with web intent (should have about 72 PPI), both size like before. Guess what? Absolutely no change - Ps doc is shrunk and pixelated (and appears same size in both cases), though shows correct MB size, Actual PPI = Effective PPI = 300 and correct dimensions according to link description.



When tried with *.png file instead of Ps, nothing changed as well.


I'm totally dumbstruck by now. How is it that suddenly one 300 PPI file is not working with other 300 PPI file and 2000pix height becomes less than 1/5 of 2500pix height?...




probability question about brownian motion


Assume $W_{t}$ is a standard Brownian Motion, calculate the the probability that $W_{t}*W_{2t}$ is negative, i.e., $P(W_{t}*W_{2t}<0)$. I find it tricky to calculate the probability.Thank you.



Answer



Your decomposition is correct. I will show here the computation for one term: \begin{align*} P(W_t < 0, W_{2t} >0) &= P(W_t < 0, W_{2t}-W_t > -W_t)\\ &= E\Big(E\big(\mathbb{1}_{\{W_t < 0\}}\mathbb{1}_{\{W_{2t}-W_t > -W_t\}}\mid W_t\big)\Big)\\ &= E\Big(\mathbb{1}_{\{W_t < 0\}} \Phi\big(W_t/\sqrt{t}\big)\Big) \\ &=E\Big(\mathbb{1}_{\{W_t/\sqrt{t} < 0\}} \Phi\big(W_t/\sqrt{t}\big)\Big) \\ &=\int_{-\infty}^0 \phi(x) \Phi(x) dx\\ &=\frac{1}{2}\Phi(x)^2\mid_{-\infty}^0\\ &=\frac{1}{8}, \end{align*} where \begin{align*} \phi(x)=\frac{1}{\sqrt{2\pi}} e^{-\frac{x^2}{2}} \end{align*} is the density of a standard normal random variable, and $\Phi(x)$ is the cumulative distribution function.


design patterns - Is there any resource for UI examples?




I run a Usability/UX blog, and my biggest hurdle right now is finding examples to illustrate the topics I write about (bad error messages, good implementation of tabs, bad interactions...etc)


So is there a website that has, for example, a database of categorized/tagged interface screenshots from various web sites on the web?




website design - What's the best way to make a user read terms and conditions before continuing a form?


What's the best way to make a user read terms and conditions before continuing a form?


Structure of Form:
Label1 [Textbox]

Label2 [Textbox]
Terms and Conditions [Textarea]
Checkbox ["I agree to the terms and conditions."]
Submit Button


The form has a requirement of checking off the checkbox "I agree to terms and conditions" before submitting the form. The goal is for the user to scroll to the bottom of Terms and Conditions text area before allowing them to check off "I agree to terms and conditions".


One option is to disable the checkbox until the user scrolls to the bottom of the Terms and Conditions textarea... but how what is the best way to tell the user they have to scroll in order to activate the checkbox?


Are there better options?



Answer



There is no reason to force a user to read the terms and conditions first. It is not a legal requirement and it doesn't improve the UX.


Don't do it.



Legally they simply have to agree to the terms and conditions, and if they choose not to read them, then that is their problem.


UX wise, what part of the experience are you trying to improve by doing this? Sure, make the terms and conditions more readable, and make them easy to find. But don't force someone to do something that has no benefit for them.




On the off chance that this has been handed down from some manager on high, and you have no say in the matter (stranger things have happened), I would follow the example set by Windows 98 (I never thought I would ever say that!).




  1. Make sure that it is clear to a user that they have to read to the bottom of the terms and conditions. Something like "You need to read to the bottom of these terms and conditions before you can continue".




  2. Make the "I agree" button active only when they have read to the bottom of the terms and conditions.





technique - How credible is wikipedia?

I understand that this question relates more to wikipedia than it does writing but... If I was going to use wikipedia for a source for a res...