Friday, July 31, 2015

Illustrator Isometric scaling


I created a grid and started my design/illustration on it.



Deep in the project I realize that some object are supposed to be bigger in size. So first thought was to scale it up.


The problem is that I can't scale it on grid. It just won't fit anymore.


Any ideas on how I can get this done without having to do it all over again?


This is the original: This is the


And this is after scaling: enter image description here


You can see at the right side that it isn't on grid anymore. No matter how far I scale it just won't fit.



Answer



You would have to do each side manually (especially if trying to make it follow the grid).


What you do is, use the Direct Selection Tool (A) and select all the points that would have to move in that specific direction and then move just those points (it's a bit hard to explain, so I've included a screen capture)


GIF showing the proccess



You see how I selected all the anchor points that would need to move up, and then dragged it up. Followed same approach for sides.




I've made circles and arrows on what I think which Anchor points need to move where in your case etc. Image


characters - Describing body language?


This is something I've pondered before. I asked about one gesture on yahoo answers long ago. All I got was a guy saying that even he didn't know the term for it (it was the gesture where someone holds something in front of them towards someone else to indicate that they want the person to take it).


But the one I'm thinking about now is describing a posture people assume when they're nervous (the kind of nervous where say someone is in a place that scares them for whatever reason). They cross their arms and place their hands on their upper arms. I think they also put their legs together (at least, girls do). I can't really think of an efficient way to express this.



Its kind of annoying we don't have simple words for these gestures like we do for some facial expressions. We have words for to smile, to frown, to scowl, etc... but we don't have a word for showing an anxious expression.


Has anyone made a list of efficient ways to describe gestures and facial expressions? It would be quite handy.




options - how we can derive $PIDE$ of double exponential Jump-diffusion model (we know as kou model)?


I'm working in double exponential Jump-diffusion model (we know as kou model) with following form , under the physical probability measure $P$: \begin{equation} ‎\frac{dS(t)}{S(t-)}=\mu‎‏ ‎dt+\sigma ‎dW(‎t)+d(\sum_{i=1}^{N(t)}(V_i-1))‎ \end{equation}‎ where $W(t)$ is a standard Brownian motion, $N(t)$ is a Poisson process with rate $‎\lambda$ , and $\{V_i\}$ is a sequence of independent identically distributed (i.i.d.) non negative random variables such that $Y = log(V)$ has an asymmetric double exponential distribution with the density \begin{equation} f_Y(y)=p.‎\eta_1 e^{-‎\eta_{1}y‎‎}‎\upharpoonleft_{y‎\geq 0‎}+q.‎\eta_2 e^{‎\eta_2 y‎} \upharpoonleft_{y<0},\eta_{1}>1,\eta_{2}>0 ‎‎‎ ‎\end{equation}‎ where $p, q \ge 0$, $p+q = 1$, represent the probabilities of upward and downward jumps.


$$ $$ Solving the stochastic differential equation gives the dynamics of the asset price: \begin{equation} S(t)=S(0)‎\exp‎\{(\mu- ‎\frac{1}{2}‎\sigma‎^2‎)t+‎\sigma ‎W(t)‎\} ‎\prod‎_{i=1}^{N(t)}V_i ‎‎ \end{equation} and also The stock price process, $(S_t)_{t ‎\geq 0‎} $‎‎, driven by these model, is given by: \begin{equation} S_{t}=S_{0}e^{L_t} \end{equation} where $S_0$ is the stock price at time zero and $L_t$ is defined by: ‎\begin{equation} ‎L_t:=‎\gamma‎_{c}t+‎\sigma ‎W_t‎‎+\sum_{i=1}^{N_i}Y_i‎‎ \end{equation} here,$‎‎‎‎‎\gamma‎_{c}$‎ is a drift term , $‎‎‎‎‎\sigma‎$‎ is a volatility, $‎‎‎‏‎W_t‎$‎‎‎‎‎ is a Brownian motion, $‎‎‎‎N_t$‎ is a Possion process with intensity ‎$ ‎‎\lambda‎‎ $‎, $ ‎Y_i‎ $ is an i.i.d. sequence of random variables.Since $‎‎‎\sigma‎>0$ in up equation, there exists a risk-neutral probability measure $‎‎‎‎‎‏‎Q‎$‎‎‎‎ such that the discounted process ‎$‎‎‎‎\{e^{-(r-q)} S_t\}_{t ‎\geq 0‎}$‎ becomes a martingale,where ‎$ ‎r‎ $‎‎is the interest rate and $ ‎q‎ $ is the dividend rate.Then under this new measure $ ‎Q‎ $, the risk-neutral Levy triplet of $L_t$ can be described as follows: ‎\begin{equation*} (‎\gamma‎_{c},‎\sigma‎,‎‎\nu‎‎) \end{equation*} where ‎\begin{align*} ‎\gamma‎_{c} & = r-q-‎\frac{1}{2}‎\sigma‎^2+ ‎\int_{‎\mathbb{R}‎} ‎(e^x-1) ‎\nu(dx) ‎\\‎ & =‎ ‎‎r-q-‎\frac{1}{2}‎\sigma‎^2+ ‎\lambda ‎\eta‎ \end{align*}‎ Here we focus on the case where the Levy measure is associated to the pure-jump component and hence the Levy measure‎$ ‎\nu(dx)‎ $‎ can be written as ‎$ ‎‎\lambda‎‎‏ ‎f(x) ‎dx‎ $‎, where the weight function ‎$ ‎f(x)‎ $‎ can take the following form: \begin{equation} f(x):=p.‎\eta_1 e^{-‎\eta_{1}x‎‎}‎\upharpoonleft_{x‎\geq 0‎}+(1-p).‎\eta_2 e^{‎\eta_2 x‎} ‎‎‎\upharpoonleft_{x<0},\eta_1>1,\eta_2>0 \end{equation}


Also in ‎$ ‎\eta‎‏ = ‎\int_{‎\mathbb{R}‎}(e^x-1)f(x) ‎dx‎ $‎‎ represents the expected relative price change due to a jump. Since we have defined the Levy density function ‎$ ‎f(x)‎ $‎ for double exponential Jump-diffusion model, ‎$ ‎‎\eta‎‎ $‎‏‎ can be computed as: ‎\begin{equation} \eta=‏ ‎‎\frac{p‏ ‎‎\alpha‎‎_1}{‎‎\alpha‎_{1}-1}+‎\frac{(1-p)‎\alpha‎_2}{‎\alpha‎_2+1}-1‎‎ \end{equation}


This is found by integrating $ ‎e^x‎ $‎ over the real line by setting ‎$ ‎‎\alpha‎_1‎‏ ‎>1‎ $‎ and ‎$ ‎‎\alpha‎_{2}>0‎ $.



We let $\tau=T-t$, the time-to-maturity, where $T$ is the maturity of the financial option under consideration and we introduce $x = log S_t$, the underlying asset's log-price. If $u(x; \tau )$ denotes the values of some (American and European) contingent claim on $S_t$ when $log St = x$ and $\tau = T - t$, then it is well-known, see for example, (Cont and Tankov, 2004) that $u$ satisfies the following $PIDE$ in the non-exercise region: \begin{align*}‎‎‏‎ ‎\partial_‎\tau\, u(x,‎\tau‎)‏ &‎ = ‎‎\frac{1}{2}‎\sigma‎^2‏ ‎‎\partial‎_{x}^2‎ u‎ ‎+(r-q-‎\frac{1}{2}‎\sigma‎^2‎-\lambda \eta)‎\partial‎_x ‎u-(r+‎\lambda‎)u \\ ‎&+ ‎‎\lambda ‎\int ‎_{‎\mathbb{R}‎} ‎u(x+y,‎\tau‎) ‎f(y) ‎dy‎ ‎‎\end{align*}‎‎‎ with initial value ‎\begin{equation} ‎ u(x,0)=g(x):‎=G(e^x)= \begin{cases} max\{e^x-k,0\}, & \text{call option} \\ max\{k-e^x,0\}, & \text{put option} \end{cases} ‎\end{equation}


my question is how we can derive the above $PIDE$ I've searched a lot of article but most of them only mention the $PIDE$ and we said you can find in Cont and Tankov Book and also I've searched in this book but I could not find the Exactly above $PIDE$.


thanks for help.



Answer



Let $\{P_t \mid t \geq 0\}$ be a compound Poisson process, where \begin{align*} P_t = \sum_{i=1}^{N_t} (V_i -1), \end{align*} and $N_t$ is a Poisson process with intensity $\lambda$ and jump times $\tau_i$, $i = 1, \ldots, \infty$. Let $Y_i=\ln V_i$ and $f(x)$ be the density function. Then \begin{align*} P_t - \lambda t E(V_1) &= P_t - \lambda t \int_{\mathbb{R}}(e^x-1)f(x) dx \end{align*} is a martingale. We denote by $\eta = \int_{\mathbb{R}}(e^x-1)f(x) dx$. Moreover, we assume that the equity price process $\{S_t \mid t \geq 0\}$ satisfies the SDE \begin{align*} \frac{dS_t}{S_t} = (r-q-\lambda \eta)dt + \sigma dW_t + dP_t, \end{align*} where $\{W_t \mid t \geq 0\}$ is a standard Brownian motion. Then \begin{align*} S_t = S_0 \exp\Big(\big(r-q-\frac{1}{2}\sigma^2 - \lambda \eta \big)t + \sigma W_t + \sum_{i=1}^{N_t} Y_i \Big). \end{align*} That is, \begin{align*} d \ln S_t = (r-q-\frac{1}{2}\sigma^2-\lambda \eta)dt + \sigma dW_t + d\sum_{i=1}^{N_t} Y_i. \end{align*}


Let $X_t = \ln S_t$, and $u(X_t, t)$ be the option price at time $t$, where $0 \leq t \leq T$. Then, by Ito's formula, \begin{align*} u(X_t, t) &= u(X_0, 0) + \int_0^t\partial_t u(X_s, s) ds + \int_0^t\partial_x u(X_{s-}, s) dX_s + \frac{1}{2}\sigma^2 \int_0^t \partial_{xx} u(X_s, s)ds\\ & \qquad +\sum_{s \leq t}\big[u(X_s, s) - u(X_{s-}, s) - \partial_x u(X_{s-}, s)\Delta X_s\big] \quad (\mbox{where } \Delta X_s=X_s - X_{s-})\\ &= u(X_0, 0) + \int_0^t\partial_t u(X_s, s) ds + \int_0^t\partial_x u(X_{s}, s) dX_s^c + \frac{1}{2}\sigma^2 \int_0^t \partial_{xx} u(X_s, s)ds\\ & \qquad +\sum_{s \leq t}\big[u(X_t, t) - u(X_{t-}, t) \big] \quad (\mbox{where } X_t^c = \big(r-q-\frac{1}{2}\sigma^2 - \lambda \eta \big)t + \sigma W_t)\\ &= u(X_0, 0) + \int_0^t\partial_t u(X_s, s) ds + \int_0^t\partial_x u(X_{s}, s) dX_s^c + \frac{1}{2}\sigma^2 \int_0^t \partial_{xx} u(X_s, s)ds\\ & \qquad +\int_0^t \int_{\mathbb{R}}\big[ u(X_{s-} + y, s) - u(X_{s-}, s))\big]\mu(ds, dy) \quad (\mbox{where } \mu = \sum_{i=1}^{\infty} \delta_{\tau_i, Y_i})\\ &= u(X_0, 0) + \int_0^t\partial_t u(X_s, s) ds + \int_0^t\partial_x u(X_{s}, s) dX_s^c + \frac{1}{2}\sigma^2 \int_0^t \partial_{xx} u(X_s, s)ds\\ &\qquad +\int_0^t \int_{\mathbb{R}}\big[ u(X_{s-} + y, s) - u(X_{s-}, s))\big](\mu(ds, dy) - ds v(dy)) \\ &\qquad +\int_0^t ds\int_{\mathbb{R}}\big[ u(X_{s} + y, s) - u(X_{s}, s))\big]\lambda f(y)dy, \end{align*} where $v(dy) = \lambda f(y)dy$. Here \begin{align*} M_t = \int_0^t \int_{\mathbb{R}}\big[ u(X_{s-} + y, s) - u(X_{s-}, s))\big](\mu(ds, dy) - ds v(dy)) \end{align*} is a martingale. Since $u(X_t, t) e^{-rt}$ is a martingale, and \begin{align*} d\big(u(X_t, t) e^{-rt}\big) &= e^{-rt}\big[-r u dt + du\big], \end{align*} we obtain that \begin{align*} &-ru(X_t, t) + \partial_t u(X_t, t) + \big(r-q-\frac{1}{2}\sigma^2 - \lambda \eta \big)\partial_x u(X_{s}, s) + \frac{1}{2}\sigma^2 \partial_{xx} u(X_t, t) \\ & \qquad\qquad + \int_{\mathbb{R}}\big[ u(X_{t} + y, t) - u(X_{t}, t))\big]\lambda f(y)dy = 0. \end{align*} That is, \begin{align*} & \partial_t u(X_t, t) + \big(r-q-\frac{1}{2}\sigma^2 - \lambda \eta \big)\partial_x u(X_{s}, s) + \frac{1}{2}\sigma^2 \partial_{xx} u(X_t, t) -(r+\lambda)u(X_t, t)\\ & \qquad\qquad + \lambda \int_{\mathbb{R}} u(X_{t} + y, t) f(y)dy = 0. \end{align*}


Thursday, July 30, 2015

options - Risk management tools for long term Gamma/Vega sellers subject to margin calls


TL;DR: if you're a retail investor and you systematically sell long-term vertical spreads while staying Delta-neutral, your main risk comes from Vega and the Gamma of opening gaps that can throw you in a margin call. Which model can help you to size the liquidity buffer to overcome these risks while allowing for acceptable returns over capital?




Background


For a while, I've investigated which trading strategies retail options traders use to steadily make meaningful profits by selling Gamma on European index options. So, before the actual question, I would like to share with you some of my findings. I stress the point of being "retail" because there are perks and flaws different than the ones belonging to professional players (like hedge funds):




  • usually, transaction costs are a serious problem. This means, for instance, that the frequency of Delta hedging shall be low. Moreover, synthetic exposures to Vega such as those provided by proper long/short positions along the whole chain are unworkable. Even an Iron Condor could be too expensive for some moneyness, that is, its payoff doesn't properly reward the risks taken when you subtract transaction costs from the final expected gain;

  • there is no lifeboat. If your mark-to-market current loss exceeds your current margin requirements and you don't have a liquidity buffer, the game is over even if your sold options are still OTM;

  • market liquidity is almost never a problem. It's hard to find a strike with a reasonable moneyness where the market maker isn't buying or selling an amount suitable to your needs. Therefore, you're never supposed to give some market makers a call to trade OTC.


So, according to my research, the natural selection kept alive only a small fraction of Gamma sellers. This Darwinian process killed those who took the shortcut of the proverbial "Picking Up Nickels In Front Of A Steam Roller" by keeping themselves too close to the crushing machine, that is, selling high Gamma options (even with "wings" properly hedged, e.g. vertical spreads). As you already know, bid-ask spreads make this short-term game unfair and Delta hedging cannot work while you're approaching the so-called "pin risk". In short, if you systematically sell short-term Gamma to harvest some variance risk premium, you end up... dead. That's what I've seen to occur with a scary frequency.


This pushed the survivors to move to longer maturities: they saw how much easier was to hedge the Delta and the Gamma, while at the same time keeping transaction costs low. However, there's no free lunch:



  • those who set aside a lot of buffer capital found out that time decay is a negligible source of profits when you're far from the expiration date, thus they found out that a Treasury bill would have given them better returns;

  • those who set aside only a small multiple of the margins required by their brokers met their new horrible reality: as soon as the implied volatility term structure makes a spike, Delta and Gamma neutrality means nothing and they blow up anyway;

  • even with enough capital set aside and a meticulous Delta management, there's no way you can deal with a gargantuan opening gap unless already hedged somehow.



This triggered another natural selection round. The (few) survivors put together the puzzle pieces and - according to my research - the highest survivability rate so far has been achieved by those who roughly trade like this:



  1. start on a medium or long-term implied volatility skew setup which allegedly makes bode for a mean reversion. Two easy examples: (1) rolling skew time series as difference between constant moneyness implied volatility time series; (2) large difference between implied risk neutral density and historical density. Generally speaking, playing with percentiles can show something worth trying;

  2. open a simple even-legs vertical spread, e.g. short 95% Put and long 90% Put. The long protective option is a necessary evil because you cannot forecast gargantuan opening gaps;

  3. don't reset Delta to zero already. Instead, overhedge it to make it slightly negative: as implied volatility is usually correlated with underlying negative returns, you would want a slightly negative Delta to partially hedge Vega in case of an implied volatility spike and a market drop.


You could end up with a very simple position like this (Delta -5% is just an example, you should run some regression analysis about the implied volatility-negative returns beta):


enter image description here


Question



From a broader perspective, it's clear what these traders are striving to do: homemade high yield bonds. They're always seeking for a fixed income because of their risk aversion, and this sounds more natural to them than small bleedings followed by uncommon large returns.


Ok, it seems easy, right? Wrong! Aside from blatant risks (e.g. Delta hedging open at least a "wing" downward), here comes the hard part: if you have $M$ dollars and one of those trades requires $m dollars margin, how many of those trades can you open with your broker to optimize the trade off between returns and risks?


Possible insights


It seems that the main variable here is: margins volatility. If you can estimate a density for $m$, you can optimize the use of your capital buffer. Margins can be calculated according to many metodologies, but according to my investigations almost every possible algorithm involves stress testing (see examples from Interactive Brokers):



  1. unfavourable set of underlying movements;

  2. unfavourable set of implied volatility spikes (or unfavourable risk neutral density tails enlargement, if you're working under a model free framework);

  3. portfolio re-pricing;

  4. $m$ is the loss under the worst case scenario.



Trying to quantitatively shape retail traders' rules of thumb led me to assume some usage of Extreme Value Theory applied to scenarios that have already been stressed. If the margin required by the broker was like a Value-at-Risk, here the problem would be to estimate an Expected Shortfall.


Moreover, I found out that using risk neutral density instead of stochastic or local volatility could simplify the job. For example, if you stick to a lognormal mixture framework (see Lognormal-mixture dynamics and calibration to market volatility smiles), a shock scenario doesn't need to disturb SDE's parameters neither to alter a volatility surface in a consistent (and arbitrage free) manner: just inflate the tails, shift the weighted mean(s) and rebuild your stressed chain to get the new worst case prices. A stress test scenario could be sparingly described just by five parameters (two standard deviations, two means, one weight) instead of a whole set of perturbed volatilities.


As you can see, I grope around in the dark. Any effective tool will be the answer.




What is the purpose of the resolution property of images (when creating/editing)?



I want to check something I don't quite understand with the size/quality properties of an image.


OK, as much as I understand, the size of an image you create in Photoshop, for example, will determine what rectangular area of screen pixels it takes.


And the resolution determines what will be the area of the smallest editable element/block on this picture.


So, if I have an image 1024x1024 with 72 PPI:



  • it will take 1024x1024 pixels on screen;

  • but what area will an editable block will take - how do you calculate it?


Update:


What do I mean by the smallest editable block is the smallest area of the picture you can manipulate. I probably am deeply mistaken, but I think that if you set smaller PPI, you will not be able to edit every single pixel on the picture, but instead will be able to manipulate only bigger chunks of it. Is this correct?



And finally, the produced image, doesn't have a metadata (besides having single colour blocks with size x pixels^2) about the used resolution, right?


It will be awesome if someone answers this, thanks in advance!



Answer



I'll try a short-n-sweet answer:



What is the purpose of the resolution property of images (when creating/editing)?



The purpose of the PPI is to tell certain software what size the image should be when printed on a piece of paper. That is all. And most software doesn't care anyways.


A 100x100px image at 72dpi is the exact same image as 100x100px at 300dpi. The only difference is that certain software will print them at different sizes by default.


I believe you're getting confused because you are connecting PPI to 'interpolate' in PhotoShop's set up screens. In this situation, PPI is merely a calculation tool. And does confuse lots of people.



icons - How should I mark "Mandatory" and "Optional" fields in a form?


I'm making a web app and in the admin panel there is in one place a list of items where (among other things) the administrator can select which items will be mandatory for the users, and which will be optional. I can't come up with a good visual way of representing this. Ideally I'd like a little icon next to the item name, but I cannot imagine icons that would intuitively represent the concepts of "mandatory" and "optional". Any suggestions?



Answer



For passive display, an asterisk behind the field label has become the common indicator for required fields. It's fine for an administrative interface, too, though I would keep the notification:




Name *
Age *
Fetish
SSN


*fields are required



For modifying that, A list of fields, with a checkbox column "required" seems straightforward (if a bit dull).


mobile application - Should I be more worried about creating a consistent UI among platforms or creating native experiences?



I am starting to develop for all three major mobile platforms (Android, iOS, and Windows UWP), and have run into a UX issue a few times. Each platform has it's own design guide. Android has Material, Windows has Metro (I'm not sure what iOS's is called). Each design looks really good on its platform and only its platform. For example, Material looks beautiful on Android, but it would seem odd on iOS.


Now, I would like to follow these guidelines, and design per platform, but I feel that users would like it better if the app had a consistent design across all platforms. Furthermore, I also develop web apps, and since the web has no real "design guide", I would have to make yet another design. I could choose one design and make it universal across all platforms, but I feel like I would be performing some sort of "bad practice" to not use Metro and Material, and so on (plus, it may end up being harder to design and might look out of place).


In this scenario, what should I do? Use native styles for the different platforms, or create a single style, to be used across all platforms.



Answer




but I fell that users would like it better if the app had a consistent design across all platforms




Do a lot of your users carry around iPhones, Androids and Windows phones and use them interchangeably?


Probably not.


And if they did, they're likely power users already familiar with the different OS idiosyncrasies anyways.


Point being, from a user perspective, consistency across platform isn't likely all that important. It won't hurt, but isn't something most people would even notice.


fixed income - How do you quantify the impact on bond if it becomes special?


If the bond is trading at 5% and it becomes special, how do you quantify the impact this has on the bond? Or am I misunderstanding the concept of specialness?



Answer




I'll use a real life example back from the early 2000s, since the specialness effect was much more pronounced.


Back on Feb 14, 2001, the 10-year on-the-run note (5s of Feb 15, 2011) traded at a yield of 5.121% / price of 99.062. We assume that the bond will lose its specialness in three months, so we reference the 3-month forward market for clues.


On this day, this issue's 3-month repo rate was 3.14%, so the 3-month forward price is simply: $$ 99.062 \times \left(1 + 3.14\% \times \frac{89}{360}\right) - 1.230 = 98.602, $$ where 1.230 was the accrued interest as of the forward settlement date.


The general collateral repo rate on the same day was over 200 bp higher at 5.19%. If the bond weren't trading special and had to be financed at GC, the forward price calculated above would imply a spot price as follows: $$ P \times \left(1 + 5.19\% \times \frac{89}{360}\right) - 1.230 = 98.602. $$ So without repo advantage, the bond's price should be $P = 98.567$, or a yield of 5.18%. This is 6 bp higher than the quoted yield of 5.12%, indicating that specialness richened the bond by 6 bp.


adobe photoshop - Question about spot colours in full colour documents


I am trying to understand various aspects of spot colours. If I am working in photoshop and I use say a pantone colour for a part of my artwork (in my CYMK file) ... lets suppose I've used it as the colour for a logo which is overlaid on top of a full colour image ... and then export this as a PDF and give to my printer ( who is using an offset printer) ... what will happen? I cant imagine that the pantone will print as intended - how would the printer know that I had used a spot colour? Would the pantone be approximated as CYMK? How would I do something like this properly?




Answer



You typically wouldn't apply spot colors within the PSD file, though you can. There are various ways to do this.


One would be as part of a duotone image. In which case you'd set up your image to print as a duotone and use the spot color as one of the colors.


Another option is to create a new channel and apply the spot color to that channel. And communicate to your printer that you are going to use a spot color.


http://helpx.adobe.com/en/photoshop/using/printing-spot-colors.html


If you simply choose a spot color but print as CMYK, the pantone color chosen will be converted to CMYK--likely to varying degrees of success depending on the particular color you wanted to use.


option pricing - Determine price of financial contract


I wonder if some one can help me with the solution to this question from Björk's "Arbitrage theory in continuous time":




At date of maturity $T_2$ the holder of a financial contract will obtain the amount: $$ \frac{1}{T_2 - T_1 } \int_{T_1}^{T_2} S(u) du $$ where $T_1$ is some time point before $T_2$. Determine the arbitrage free price of the contract at time $t$. Assume you live in a Black-Scholes world and that $t


Earlier in the book he states this theorem that I think one might use:



The arbitrage free price of a claim $\Phi(S(T))$ is given by: $$ \Pi(t,\Phi)=F(s,t) $$ where $F(\cdot,\cdot)$ is given by the formula $$ F(s,t)=e^{-r(T-t)}E_{s,t}^Q [\Phi(S(T))] $$ where the $Q$-dynamics of $S(t)$ are given by $$ dS(t)=rS(t)dt + S(t)\sigma(t,S(t))dW(t) $$



However I'm not really sure how to apply it in this case. Can anybody help me out here?




Wednesday, July 29, 2015

creative writing - I'm scared that my story is plagiarizing another story


I am working on my debut story. In my freetime, I write another story that will be the start of a series. The series consists of Steampunk fairytale retellings.


Lately, I have been worrying that it copies The Lunar Chronicles by Marissa Meyer. To its credit, it is the reason I even knew what a fairytale was. I understand that there are going to be similarities between certain books. A group banding together to overthrow a corrupt leader... that is nothing new in the world of dystopian books.


But the fact that mine is a Fairytale retelling series along with other details, that is what scares me. I have chosen not to read The Lunar Chronicles so I can keep my stories as original as possible. However, whenever I hear of a detail, I worry that I will be under legal fire if I publish my story. I am willing to move on to other projects after my debut and write this series to keep my sanity.


If anyone has advice, please respond as I am anxious with fear.




language - Best Practice for designing UI for a multilingual site?


I'm in charge of UI for a company that offers a brand monitoring and social media analytics for international clients. We currently offer the system in 3 different languages, but this is expected to grow.


I'm looking for some guidelines or heuristics on how best to design UI in circumstances where, for example, text string length might vary immensely from one language to the other. Any ideas? referrals?



Answer



I am not aware of any heuristics or best practices since there are different use cases depending upon the countries you are designing for. However this excellent article Global by Design : Creating a world-ready web design gives some valuable inputs:



  • Look at the scope of designing a global template (except in unique cases) : A availability of a global template with sufficient customization options to change the color and font specifications will help in keeping a uniform look across all your sites and also ensure that users dont have to look around to find the same information (since the layout is structured in a similar manner). To quote from the above mentioned article :




Consider Eli Lilly. Years ago, its local offices managed uniquely designed sites. While there is nothing inherently wrong with every country having its own unique design, the collective costs of designing and maintaining all these designs is significant. Local resources are better spent on creating local content. A global design template frees up local offices to do just that while also improving the user experience for those who may travel between country websites. For example, if a web user lands on the .com site and then travels to a specific country’s website, a consistent design is less disruptive; the user does not have to relearn the navigation.


Today, Eli Lilly uses an excellent global template that supports global consistency while allowing room for local content and promotions.



enter image description here


However though global templates should work for most languages you might to reconsider your design for languages might might read from left to right as your entire design would be flipped in that case. Take a example here of how Facebook structures its Arabic page:


enter image description here



  • Design for Text Expansion and Contraction : As you rightly pointed out text may scale or contract in different languages. To account for that,the above mentioned article states that:




The general rule is to plan for text expansion of up to 30% to 40% when going from English to German, which is one of the more extreme examples of text expansion. Going from English to Spanish or French will probably only result in a 10% to 20% expansion. To safely design for any target language, a goal of 35% expansion is a good guideline.


Text expansion can wreak havoc with the menu; translating a single word from one language into another, while maintaining a strict character length, can be extremely challenging. For example, "Search" in English translates to "Rechercher" in French, which is nearly twice as long. Allow space for an additional 40% or more of room for expansion in the menu.



Also the article raises an excellent point about the importance of using professional translators to ensure the correct words are used to denote navigation or content since current web translators or auto translators are not exactly correct



  • Design for different font sizes : Font sizes can vary from language to language and we have to ensure there is consistency in the standards. To give an example from the above mentioned article:



For example, consider the German and Chinese web pages from Accor Hotels. As shown here, Accor specifies the Chinese font at 12 points while the German font is specified at 10 points.




enter image description here


Here are some additional resources for you to read through:


Select Country; Select Language : Developing a user-friendly global gateway


Tips For Making Your Website Multilingual Friendly - This one has some really good tips about aspects to consider while designing multilingual sites which are briefly summarized below:




  • Use Unicode : By using Unicode you are making your website multilingual ready for the future as it supports over a hundred thousand characters of different types. It is also supported by most, if not, all web browsers and platforms. Therefore, switching to Unicode will only benefit you in the long run.

  • Flexible design : When designing for multilingual support, your design needs to be built around the languages in the sense that it should be easily compatible with left to right and right to left languages

  • Cut Back on images containing text : This is because the text is embedded in these images and when the user flips through languages he would see the same text (unless he redirected to a specific page for that language) or alternate images are automatically inserted on the language switching

  • Choose your colors wisely : However, when adding multilingual support, you need to assure the colors you pick for your website also reflect what you do without having a negative affect within certain cultures :




enter image description here


Another article worth would be worth reading : 7 Tips and Techniques For Multi-lingual Website Accessibility


portfolio management - Risk minimization by investing in all assets with positive expected return


Suppose I have an amount $T$ to invest and $N$ available assets.


The stochastic return per invested unit of asset $i$ is $R_i$.


The variance and the expectation of $R_i$ are $\sigma^2_i$ and $\mu_i$ for $i=1,...,N$ (different across $i$).



The returns are independent across $i$.


Consider the assets with $\mu_i>s$. Let $\mathcal{N}:=\{i \text{ s.t. } \mu_i>s\}$ with cardinality $n\leq N$.


Could you give me an analytical justification (with proof) for deciding to invest in ALL assets in $\mathcal{N}$ and the associated economic intuition? In addition, I need an analytical argument that explains why I do not invest just in the asset that gives the highest expected return.


I think that what would work here is a measure of portfolio's risk that is minimised when I invest in all assets in $\mathcal{N}$. Or, in alternative, an utility function which is maximized when I invest in all assets in $\mathcal{N}$.



Answer



since you've assumed that all returns are independent, the covariance matrix, $C,$ is diagonal. In the comments, you are assuming that the investor is a mean-variance investor. It's a general result that every portfolio that maximizes return for a given variance is a tangent portfolio for some risk-free rate, $R.$


Let $e=(1,1,...,1).$ and let $\mu$ be the vector of expected returns.


So we have the weights $x$ satisfy $$ x_i = y_i / \sum y_j $$ and $$ y = C^{-1}(\mu - Re) $$ Now $C^{-1}$ is diagonal with positive entries. So you will only get negative weights if $R$ is greater than $\mu_i$ for some $i.$ However, that won't actually happen for economic reasons.


(See my book "introduction to mathematical portfolio" for more details.)


accessibility - Patterns for keyboard accessible drop down lists


Are there any standard keyboard shortcuts for making drop down lists appear? (in any kind of software, not just web based.)


I'm going to write some JavaScript to make the drop down lists (select and option tags) in a web app accessible via the keyboard.


I'm aware that Up Arrow and Down Arrow can change the selection, and pressing a letter key will cycle through the items starting with that letter (or typing a pattern will jump to the item starting with that sequence). But as selecting options in the list may change the form in this app I'd like to have a way to open the drop down so you can see the entire list and pick one of the options whilst viewing the entire list (or as much as will fit on screen).



Update:


AHA! Found something that works for some browsers.


When pressing Up Arrow or Down Arrow drop downs stay closed in web pages on Chrome, Firefox and IE9, and in those browsers settings dialogs.


However, in Firefox and IE pressing Alt+Up Arrow or Alt+Down Arrow opens the drop down for web pages and settings dialogs. It doesn't work in Chrome but there is a workaround. There is also a bug for chrome: Not able to open view/open drop-down list using keyboard


Also, the ribbon UI and settings dialogs in Excel 2010 do open the drop down when pressing just the up/down arrow keys.


Are the Alt+Up Arrow / Alt+Down Arrow shortcuts widely know/used? I'm debating whether to just add a polyfill for Chrome or write something to mimic the Office Ribbon behaviour in all browsers.




Tuesday, July 28, 2015

brainstorming - Tips for humor writing


Are there any techniques you can use while brainstorming to find humor to include in an article?



Answer



1) Pick any one item and take it to an extreme.


"Organizing is good."




  • Okay, can I alphabetize my spices? (bad example. I actually do that.)

  • Uh, can I sort my vegetable drawer by size and then by color?

  • How about putting the living room furniture in rainbow order?

  • Where do I file the cat, under P for Pet, F for Felix domesticus, or O for Ollie (his name)?


2) Slip in some judicious puns. For example, if you're comparing shredders, you might write that you don't want to get snippy, but Brand X is really a cut above, and anyone who doesn't think so simply isn't all that sharp. (Caveat scriptor: your mileage may vary.)


3) Take a metaphor and run it off a cliff of absurdity.


"Okay, so imagine that your desk is an elephant, and you're going to eat it one bite at a time. So first you start with a foot, represented by a desk drawer. The file folders are the toes, and the tabs are the toenails. Any punched-out holes, lost post-its, orphaned notes, or faded fax cover sheets would be elephant toejam. That's probably kind of nasty-smelling, but don't worry; just crumple the whole thing up and make a toejam football out of it, and throw it into the nearest wastebasket."


adobe photoshop - How to completely remove the background from an image?


I have an image (a logo) that was on a black background.


I have used Photoshop's (CS5) Background Eraser Tool to remove the background.


enter image description here



This is great except that there are black (well grey/black) dots around the image on the curves.


How can I remove them?




toggle - Best choice for three-state value?


In my application, the user can filter fields by selecting one of three possible values for each field:



  • True

  • False

  • Both



I currently have a drop-down box, but this requires two clicks while the options are simple and should preferably being able to be selected by one click.


I faced the tri-state checkbox which shows either a tick, a square or nothing. However, this still sometimes requires two clicks to get from empty to square if the order is empty - tick - square.


Could someone please recommend what would be the best choice in this scenario?



Answer



Radio buttons. This is the exact situation that they are designed for.


color - How to prepare RGB image for silk-screen printing


I have an image in RGB which I would like to silk-screen on a t-shirt. I want to prepare the file so that the result is as close as possible to the original image.


I could simply convert the image into CMYK, but being for a silk-screen print I would like to use as few plates if possible. Perhaps the black one is not needed? Or maybe if I used two or three different plates the result would be sufficiently close for the given particular image?


So my question is:


How do I convert (and preview!) my RGB image into duotone or tri-tone as bunch of spot colours?


Addendum: The question got edited few times so I will try to rephrase it: how to convert RGB image into 2 or 3 spot-colours, so that the end result is as close as possible to original data? The conversion might (or might not!) make use of the colour of the medium (i.e. black or white t-shirt).



Answer



The process of separating images for screen-printing takes a whole lot of practice, trial and error, and patience. Being a good separator is almost kind of an art in its own right. In fact, there are statistics that show that over 80% of all screen-printing problems occur before the screens even make it to the press. Excluding screen printing equipment difficulties and preparations, most of the problems occur starting with the separations.


One of the major obstacles is that most graphic designers/separators have zero hands on knowledge of actually registering the screens on the press, pulling squeegees, exposing screens, Etc. In fact, almost every single screen printer I know, blames the separator and the separations for unacceptable screen prints. Communication between the two teams is crucial.



Doing separations can range from simple 1,2,3 simple spot color separations which are completely solid colors with no shading, all the way up to 10 or maybe 12 colors containing all sorts of half-toning for photorealistic screen prints on white or dark garments. Before doing any separations, there will always be information you will need before you start the process. For example: what will the garment sizes be? You will need two different sets of separations if you have sizes ranging from youth small all the way up to adult double XL or triple XL sizes. Garment color also needs to be considered. Will there be only one garment color or all different colors? For example, In most cases if you are printing on a black garment, you may not need to use a black screen. So you go ahead and do your separations without including the black screen and then, uh oh.. At the very last minute, The customer decides to have the design printed on royal blue shirts also… which will need a black screen, after you have already completed the separations and printed the films. Another scenario could be that the design was intended to be printed on white shirts only, then at the last minute the customer wants to print on black shirts also. The problem with that is that 99% of the time you will need a white underlay screen as your first ink color so that the other colors printed won't be affected by the garment color..(If you print yellow ink on a blue shirt, the result would be a dull looking greenish color because in essence, combining yellow and blue will give you green). Another thing to consider is there are some images that when printed on white visually look correct but that same image printed on a black garment does not look correct. Sometimes the fix for this could be as simple as just inverting the image and doing a second set of separations for the black shirts. My point to all of this is that knowing these things will dictate the way you will approach your separations.


You posted a comment that I will try to simplify for you.



My question is this: given RGB raster image and how to separate it into two or three plates? I mean, precisely, how do I do that? I know that " the techniques will have them screened and you will use probably more ink from program to program", that I can assign spot colours if there are only two colours. "will have them screened and you will use probably more inks", yes, this is what I try to avoid. – CyanMagentaYellowBlack yesterday



Using the image you posted as an example:



@Rafael Ok, just for demonstration sake, let's take this picture... – CyanMagentaYellowBlack 2 days ago



Having been in the screen printing industry for 30 years now, I just know by looking at an image, whether it needs to be color corrected for screen printing. The image in that link you supplied was way too dull with low contrast and low saturation for printing on garments. The image on the left is the original and the image on the right is color corrected for screen printing.



I created a set of Photoshop actions for color correcting images for screenprinting with a brief explanation dialogue before each command is executed. Download the action here


enter image description here


If this image was only going on white garments, we could do 4 color process separations. Four color process is the technique of using only four ink colors (cyan, magenta, yellow, black) or "CMYK" Those four colors printed on top of each other and blended together can create hundreds, if not thousands, of secondary and tertiary colors.


Just to make life more difficult I decided let's separate this for black garments. This is known as "simulated process" in the screen-printing industry. In essence, we are "simulating" the 4 color process by using ink colors chosen from the design itself, with nontransparent plastisol inks. The result usually creates more screens than CMYK.



So your question was "given RGB raster image and how to separate it into two or three plates? I mean, precisely, how do I do that?




  1. Now using your color corrected image, we simply start out in Photoshop by going to menu item Select/Color Range



enter image description here


Looking at this specific design, I just intuitively know it's going to take six screens if we are going to use a black screen and a gray screen. So I know I can separate this design into White underlay, black, red, blue, gray, and a highlight white screen. Now that I know the colors I will use for screen printing, I will use the color range selection menu to select each one of those colors and create new spot channels with those color selections.


enter image description here enter image description here enter image description here



  1. Continue the process for each color you want to add for your separations (keep in mind that it may take multiple attempts for each color with the color range tool to be able to select the right amount of each color you want to use) the next image is the final results with all my spot channels added along with the shirt color as a background. Keep in mind we are trying to simulate the original image which uses thousands of colors and blends with only six spot colors.


enter image description here


@CyanMagentaYellowBlack there are a few things to consider with CMYK printing on garments. CMYK a.k.a. four color process screen printing is intended for white garments only because the inks are transparent and if there is any other color other than white underneath the printed inks, the resulting screenprint will be unacceptable. Also consider this… CMYK screen printing relies on the white shirt color to be used as the white part of the image. This is what CMYK a.k.a. four color process screen printing would look like on a black garment…


enter image description here


So to sum it up, there is no RGB printing method like there is a CMYK printing method. RGB is only a, for lack of better term, a color space used in computer graphics. There are no RGB screen printing inks or an RGB printing process in comparison to CMYK. So for this image, CMYK screen printing can be used only if the garment colors will be white only. For any other garment colors, this entire post explains what needs to be done for screen separations



navigation - Best way to display a nav item with a single sub-page?


I am working on a nav which includes a page that has a single sub page like so: Home > Careers > Profile. If I want people to go to the overview or landing page first which has the majority of the information on it, would having a single drop-down item be misleading to people and deter them from clicking on the main nav item? Should I create a second drop-down item to link to the parent page?




Monday, July 27, 2015

programming - To calculate the Hedge Efficiency and Optimal Hedge Ratio with BEKK in R




I estimated an MGARCH-BEKK model (using the R package BEKK, i.e. Baba, Engle, Kraft and Kroner; see Engle and Kroner (1995)) on time series of spot and futures prices. The estimated parameters are:


  =====================================================
Estimate Std. Error t value Pr(> | t| )
-----------------------------------------------------
mu1.DLog_Base -0.002 0.001 -1.498 0.134
mu2.DLog_B3 0.0003 0.001 0.282 0.778
A011 0.004 0.003 1.047 0.295
A021 0.0004
A022 0.013 0.001 14.475 0
A11 0.008 0.027 0.314 0.754

A21 -0.096 0.089 -1.077 0.282
A12 -0.052 0.088 -0.588 0.557
A22 0.661 0.122 5.395 0.00000
B11 0.967 0.010 96.058 0
B21 0.124
B12 0.073 0.123 0.596 0.551
B22 0.011 0.185 0.058 0.953
-----------------------------------------------------

I don't now to calculate the conditional variance and covariance matrix.



$$ \left[ {\begin{array}{cc} \sigma_{ss} & \sigma_{sf} \\ \sigma_{fs} & \sigma_{ff} \\ \end{array} } \right] = \left[ {\begin{array}{cc} c_{11} & 0 \\ c_{21} & c_{22} \\ \end{array} } \right] \left[ {\begin{array}{cc} c_{11} & 0 \\ c_{21} & c_{22} \\ \end{array} } \right] + \left[ {\begin{array}{cc} a_{11} & 0 \\ 0 & a_{22} \\ \end{array} } \right] \left[ {\begin{array}{cc} \epsilon_{s,t-1}^2 & \epsilon_{s,t-1}\epsilon_{f,t-1} \\ \epsilon_{fs,t-1}\epsilon_{s,t-1} & \epsilon_{f,t-1}^2 \\ \end{array} } \right] \left[ {\begin{array}{cc} a_{11} & 0 \\ 0 & a_{22} \\ \end{array} } \right]$$


$$ + \left[ {\begin{array}{cc} b_{11} & 0 \\ 0 & b_{22} \\ \end{array} } \right] \left[ {\begin{array}{cc} \sigma_{ss,t-1} & \sigma_{sf,t-1} \\ \sigma_{fs,t-1} & \sigma_{ff,t-1} \\ \end{array} } \right] \left[ {\begin{array}{cc} b_{11} & 0 \\ 0 & b_{22} \\ \end{array} } \right] $$


My conditional variance and covariance matrix:


$$ \left[ {\begin{array}{cc} \sigma_{ss} & \sigma_{sf} \\ \sigma_{fs} & \sigma_{ff} \\ \end{array} } \right] = $$ $$ \left[ {\begin{array}{cc} 0.004 & 0 \\ 0.0004 & 0.013 \\ \end{array} } \right] \left[ {\begin{array}{cc} 0.004 & 0 \\ 0.0004 & 0.013 \\ \end{array} } \right] + \left[ {\begin{array}{cc} 0.008 & 0 \\ 0 & 0.661 \\ \end{array} } \right] \left[ {\begin{array}{cc} \epsilon_{s,t-1}^2 & \epsilon_{s,t-1}\epsilon_{f,t-1} \\ \epsilon_{fs,t-1}\epsilon_{s,t-1} & \epsilon_{f,t-1}^2 \\ \end{array} } \right] \left[ {\begin{array}{cc} 0.008 & 0 \\ 0 & 0.661 \\ \end{array} } \right]$$


$$ + \left[ {\begin{array}{cc} 0.967 & 0 \\ 0 & 0.011 \\ \end{array} } \right] \left[ {\begin{array}{cc} \sigma_{ss,t-1} & \sigma_{sf,t-1} \\ \sigma_{fs,t-1} & \sigma_{ff,t-1} \\ \end{array} } \right] \left[ {\begin{array}{cc} 0.967 & 0 \\ 0 & 0.011 \\ \end{array} } \right] $$


To calculate the optimal hedge ratio BEKK:


$$h_t = \frac{cov \left( \Delta S_t, \Delta f_t \mid \Omega_{t-1} \right) }{var \left( \Delta f_t \mid \Omega_{t-1} \right)}$$


$\Delta S_t$, $\Delta f_t$ is the return price spot and future, and $\Omega_{t-1}$ is conditional variance and covariance matrix.




business - Offline billing software for freelancers


The billing/invoicing/time-tracking software I use, iBiz, is no longer being supported by its manufacturer. I am a freelancer, so I need software which allows me to:




  • Track time on jobs

  • Track tasks on jobs

  • Automatically fill in a rate for a task (not all tasks are the same hourly rate)

  • Add notes about a job

  • Put in flat-rate items

  • Organize clients, preferably by allowing me to have more than one point of contact in a company

  • Generate invoices

  • Record payments and log them against invoices

  • Customize the invoices with a logo


  • Generate earnings reports for tax season


Cost is not an enormous issue, although I'd rather not spend several thousand dollars.


I do not want something online or cloud-based. I want something I can buy, once, and download, once, and which works offline. I do not want to pay a subscription fee. I do not want something which is a web app, because if the company disappears, so do all my records.


What are your suggestions? What experience have you had with the software, and why would you recommend for/against it?


I am in the U.S. working on a Mac, so the software must be Mac-compatible.




black scholes - Why must the risk free rate be free from risk in risk neutral valuation?


I am reading through documentation related to Funding Valuation Adjustments (FVA) which discuss risk free rate and funding matters and the following question came to my mind: in risk neutral valuation theory, why do we require the risk free rate to be risk free?


Indeed, let's assume a Black-Scholes framework but with a stochastic risk free interest rate, whose dynamics are specified by the Hull-White model:


$$ \begin{align} & dS_t = \mu S_tdt + \sigma_S S_tdW_t^{(S)} \\[6pt] & dr_t = (\theta_t-\alpha r_t) dt + \sigma_rdW_t^{(r)} \\[6pt] &dW_t^{(S)}\cdot dW_t^{(r)}=\rho_{S,r}dt \end{align} $$


The way I see it is that the risk free rate is supposed to be free of credit risk $-$ indeed, in a stochastic rate framework, this rate has nonetheless market risk. However, nowhere in the specifications of the above model does credit risk appear: it seems to me that $(r_t)_{t \geq 0}$ could represent any rate process. I see 2 situations where it could really make sense to speak about a risk free rate:



  • In the original Black-Scholes world, the risk free rate is indeed free of risk because it is the unique process which does not have a random component $-$ it is constant, hence additionally it is also free from market risk.

  • If we were modelling asset prices $(S_t)_{t \geq 0}$ with some jump component $-$ to represent default $-$ and the risk free rate was the unique price process free from this credit risk, then it seems it would also make sense to speak about a risk free rate.



Generally speaking, it seems to me that we can speak of risk free rate when the process $(r_t)_{t \geq 0}$ lacks a type of risk that all other assets have $-$ market risk, credit risk. However, I have the impression that in practice the 2 modelling choices above are not common: jump processes are not widely used for pricing, and complex, hybrid and long-dated derivatives tend to be priced with stochastic rates if I am not mistaken.


Hence it seems like $(r_t)_{t \geq 0}$ could very well be anything, for example and importantly the option hedger's cost of funding.


The only characteristic I can think of the risk free rate that might justify its importance is the assumption that any market participant can lend and borrow (without limit) at that rate $-$ hence it represents some sort of "average" or "market" funding rate, like Libor for example. But this does not mean it should be risk free; it does not justify the name of the rate.


Why then stress so much the risk free part, why does the rate need to be free from risk? Couldn't the process $(r_t)_{t \geq 0}$ simply represent the option writer's cost of funding? What am I missing?


P.S.: note that I am not asking why there should be a risk free rate; rather, I am asking why, within the framework of option risk neutral valuation, we have required the "reference" rate under which we discount cash flows in the valuation measure $\mathbb{Q}$ to be free from risk.


Edit 1: my question is a theoretical one mostly. From a practical point of view, my thinking is that the choice of rate used for discounting under $\mathbb{Q}$ $-$ hence to price derivatives $-$ is mostly driven by funding considerations; happily, in a collateralised environment, these funding rates (OIS, Fed Funds) happen to be good proxies for a risk free rate and so there is a matching between theory and practice $-$ maybe my thinking/belief here is wrong.




copyright - Is permission needed to use a fictitious character from another novel in my story as a point of reference?



I am writing a novel and I would like to introduce characters from other published works as time travelers. Is this a bad idea or even legal? Copyright infringement comes to mind... Is there a legal way to use the names of established fictitious characters in my story? I'd hate to make a rookie mistake, but I am a rookie...




command line - UX guidelines for writing into log files?


Do you know a set of guidelines for writing into a log file?


The file can be long, it should contain a log message per line, including dates and system feedback / audit actions. I may contain user names, status messages, ERRORs, references to files or applications, etc. Each line should not be so long, but there could be exceptions. We cannot use colors, font formatting (like bold or italic) or GUI.


The purpose is to make it more readable and to help the reader to visually scan and find important information easily.





Hint: the user may be a system admin / technical user and it's on Linux environment. Information about well-known characters and words is also valid.




print design - How would you create an 'experience' with an invoice keeping ink cartridges in mind?


I wanted to make receiving an invoice a little bit better by creating a bit more colorful, nice invoice instead of the regular ol' black and white monochrome typewriter font-like invoices from the past.


My business color is turquoise and so I used that color throughout my business card and my invoice. However, I've gotten the complaint a few times my invoice is ink-heavy and therefor people don't prefer to print it, although they have to.


Below is a screenshot of a 3-page default invoice of mine. A frontpage with with the primary product and the client, a second page with the products and their description & individual prices and a end page with my business information. It starts with turquoise and ends with turquoise.


I know it's ink-heavy, but how would I decrease the cost of printing my invoice, but trying to keep/create the happier experience.


Really wondering.


In my opinion, simply adjusting the turquoise to black isn't sufficient..


enter image description here




Answer



This is building on David Mulders answer, and things others have said but this is something I've wanted to do for a long time and have never got round to doing.



Having the whole invoice system online is actually a great Idea. You are almost guaranteed that the invoice is going to be received via an internet enabled device (be it a desktop computer, laptop, tablet, smart phone etc) so why not take advantage of that fact.


User Experience


It actually makes a lot of sense from a user experience point of view to give the client the ability to view, pay, query, download, and access any other after-sales services directly from the invoice you send. Getting an invoice, which is essentially a document telling you how much money you need to part with, isn't usually something look forward to. Making the invoice about more than just parting with your money will make it a much less unpleasant experience.


Each item on the invoice can be expandable to reveal more info and actions for that item. You can include any deliverables, so any print files or digital downloads can be downloaded directly from the item in the invoice. You can give quick preview images too so the client isn't forced to download the files if they aren't sure what is what. If you provide support, that can be directly accessed from the item in the invoice. You can let the client query anything on the invoice by providing an easily accessible contact form.. It completely depends on your situation but the possibilities are endless.


Payment


There are plenty of online payment systems available so of course you can include a system to pay the directly from the invoice. Making this part as easy and painless as possible will definitely keep clients happy (or at least not unhappy).


Printing



Your design, as it is, doesn't work very well as a printable invoice for the reasons others have pointed out. But as a digital invoice it makes more sense, and fits more with what people expect on digital platforms. You can easily use a CSS print stylesheet to provide a printer friendly version via a handy "Print Invoice" button. This will save your clients ink (costs) and make scanning and archiving easier (as go-junta pointed out).


Delivery


You can even send a simplified version as an HTML email that would contain all the standard invoice information and that can then link directly to the online version if they need to download/query/pay etc.




I understand from your question that you may not have been thinking about something this complicated, but this is - in my opinion - how you 'create an experience with an invoice'.


Something like this won't be quick or easy to set up from scratch, but it should be easily automatable and will definitely be worth the effort. There are services that allow you to invoice online like this, but i'm not sure if there are any that will let you design the actual invoice and experience to this level.


I havn't got time now but I will try and mockup my ideas to explain more clearly.


Sunday, July 26, 2015

gui design - Is User Guide really necessary


Firstly please help me understand what guide truely means with respect to this link.

Secondly I had read that guide is an important part of a great UX, also by the answer of jensgram over here, it makes sense having such guides.
So as a UX designer,my dilemma is should i add guide on my app or just let the users discover its features?

PS: there is a FAQ page on the website, and the product will be used by users of all age groups and even by non tech savy people.




novel - What are the signs of accidental self insertion?



I am currently writing a novel where the main character will be far more powerful than most of the people in the world and I am worried that I will end up losing sight of what I am writing and start writing a power fantasy where the main character will be a Mary Sue with every hot guy kneeling before her and telling her just how beautiful she is and that she is the only woman they will love.


The last part may be a bit of an exaggeration I am using to make a point. What I want to ask is: what are the warnings signs I should watch out for in order to not end up with a character that is obviously self inserted?



Answer



Neither being powerful, nor reflecting the author is an insurmountable problem for a character. What you want to avoid is a character who faces no significant problems on her path to success, whose character flaws are all overlooked, and who is unjustifiably treated as intrinsically lovable. Self-insertion isn't the problem, it's the explanation. If it was intrinsically problematic to "insert yourself" into your work, no one would ever read autobiographies, and all the loosely autobiographical novels would have to be pulled from the shelves. Rather, "self-insertion" is a frequent explanation for poorly conceived, unrealistic characters who star in plots of interest solely to the author.


Basically, most readers, when they read a book, or watch a movie, want to be able to put themselves in the place of the main character, and to learn something from her story. Either they want to see her overcome a significant problem, or they want to learn what NOT to do in the same situation. But if the challenges are too easy, it feels like a cheat. We all know how to wish ourselves out of a bad situation, or how to fantasize a perfect scenario for ourselves. We don't need a writer to do that for us.


A super-powerful heroine isn't the most promising start for a compelling narrative, but there are interesting places to take it. Her biggest challenges are likely to be internal. Given how overpowered she is, you'll need to focus on her problems and her failures, not her successes. How does she keep from becoming a monster? How does she form real relationships with ordinary people? How does she maintain perspective? How does she deal with the boredom? How does she deal with the crushing responsibility? How does she keep from hurting people or destroying them accidentally? What unexpected, hidden, or paradoxical limits to her power are there? While few of us will ever actually be in the shoes of someone who is that powerful, we can still relate it to situations we do face in real life --getting a promotion, perhaps, or caretaking a child, situations that with intrinsic power differentials that can easily lead to abusive situations.


layers - How can I export sublayers to png in Adobe illustrator?




A designer did a design for me. It is in Adobe illustrator. In order to write my program, I need to export sublayers one by one to .png files. How can I do that?




Spot/Next and Tom/Next FX forward swaps


could somebody please tell me what is the main difference between Spot/Next and Tom/Next FX forward swaps? I know that both are used to roll spot FX position settlement to 1 day forward but I really appreciate some more information of the functions behind each of the swaps.


Thanks.



Answer



Let’s say the settlement period is T+2, and you made a deal on the 8/10/2018. The spot date would be 10/10/2018 (assuming no holidays!), that’s when the physical exchange would happen. Now if you don’t want physical delivery, then tomorrow (9/10/18) you can use T/N (tommorow/next) swap to delay the physical delivery by one day, T/N is essentially swap between tomorrow and the next business day. You can keep rolling your position with T/N swap.


S/N (spot next) is the period from spot date to the next business day, so the delivery in the above example would be a day later (11/10/18) if you use S/N. O/N (overnight) is the period from today to next business day(tomorrow).


So in summary using T+2 conventions:


Spot: one exchange (only one leg) on T+2.



T/N: first leg of the swap on next business day, and the second leg on the following business day.


S/N: first leg of the swap on T+2, and the second leg on the following businesss day.


Saturday, July 25, 2015

page layout - InDesign: How to create lines for form design?



Every once in awhile I make forms (applications and whatnot) in InDesign, and, as it often is with ID, there is more than one way to get it done.


I have a few techniques that I use, but I often float from one to another without being sure which is the best. And, as I often find on sites like these, I don't have all of the answers!


I'm sure people here do form design; what do you find to be the best way? I'm thinking about ease of doing in the first place, ease of aligning lines to each other and to margins, ease of editing later, ease of Acrobat making it fillable, and perhaps semantic considerations?


Some of my techniques are: Drawing a straight line, drawing a line then pasting it inline into the text frame, underscores, underlines (with tabs, non-breaking spaces, alignment tricks), table cells.



Answer



I always use tabs with an underline leader.


tabs


The method of creating lines, then anchoring them in text makes for sloppy editing later. And using repeated underscores doesn't allow for proper alignment.


Another option, depending upon desired design, is to use Paragraph Rules:


rules



If I want anything containing more rules than these two methods I move to tables and applying specific rules to table cells to define areas.


In short, I never draw any lines.


The advantage to these methods for me, is that the rules are part of the text itself and not anchored or inline elements such as drawn lines. Since the rules are part of the text, they flow and move correctly while maintaining position during most edits. When you start anchoring a bunch of objects within text boxes you can have trouble with editing later.


In addition, with these methods you can create paragraph styles. So, applying them simply takes a click rather than a few minutes to draw lines and make certain they are aligned correctly, the re-align things after any edits.


Should search result urls be accessible and intuitive?


We usually aim for friendly (vanity) urls to help visitors identify where they are in the website, e.g. www.website.com/products/acme-product. But, are there standards here for search results?


At the moment our search results are something like this:


http://www.website.com/search?by==&=


The search query string seems intuitive to me, but I am looking for some standards here - or, if it's been identified that we don't need to worry about intuitive URLs for search results.



Answer



I recently did some research on that, and I came to the conclusion that the search urls needn't be accessible. It is surely nice to have them accessible like http://yourdomain.com/search?q=hello, but if you cannot manage that, it's no big issue.


How I came to these results:



There may be, however, other things which speak for considering an easy search url




  • If you want to make your search url an access point of your API, for example, developers are surely happy to have easy accessible urls





  • If you want to implement Open Search on your site so the user can use your site as a search engine in his/her browser, easily accessible urls reduce implementation time.




Friday, July 24, 2015

icon - How to achieve a gradient in adobe illustrator


I am looking for someone to explain how to achieve a subtle gradient in adobe illustrator like the one in this icon.



much thanks.


enter image description here



Answer



It's hard to tell in your example, but it is common for apparently flat icons to gain that extra touch of polish by using subtle gradients.


To get it right you should work with tints and/or shades of a color to build your gradient. I find it easiest to work in the HSB model and carefully adjust the Saturation and Brightness values to step up or down on the gradient scale. You can also plug a base color in at 0to255.com to see a nice range of choices in hex.


In the sample below, you can see that there isn't a whole lot of room for steps between these two greens. The difference is just enough to give a little light affect to the small circle. The separation between the colors should be greater as the distance of your gradient increases.


enter image description here


What are pros and cons of mean absolute deviation portfolio optimization?


In this question a paper about mean absolute deviation portfolio optimization is mentioned and in the answer a spreadsheet with an implementation is attached.


What is the use of this procedure? Does it produce sparse portfolios (it says something about the number of zeros)? Does it give better results than mean-variance optimization? Can we see a back-test? Reference to a back test?




forms - Are there any suggested username conventions?



I am currently designing a form for a registration to a portal which contains very personal information. I am exploring the idea of having a suggested username(s) to be presented to the user to choose if they struggle to create their own one.


There are two reasons for this: 1. The people using it are older, 50-60 years old and are not so tech savvy. 2. Due to the average age of the people using it, I want to to make the Registration as seamless as possible and reduce errors while choosing a username.


My question is: Are there any good conventions for displaying this in forms?




gui design - How to best enter long digits on a small touch device without using keyboard input


my current task is to create an user interface for a mobile strategy game. stuff can be transported from point a to point b. the user can select an amount of stuff between 1 and 1.000.000. it is importan that he can choose any amount he likes. how would you solve this without using a textfield and keyboard entry? i have some ideas in mind but am eager to listen to other ideas.



Answer



Common solutions to this problem:



  1. Use a text field, not a label. Even with the methods below, you can still allow the user to select the text field as a backup input method. Make sure the text field is set as a digit entry (tells the mobile device to only show numbers, not the full keyboard).

  2. Slider (Alexey's suggestion)

  3. Up/Down control: Use an up/down control. Tap the button to add 1. Hold the button to add many. The speed will change if the button is held longer. Having two or more up/down controls (e.g., one for +/- 1, one for +/- 1000) may help.

  4. Send X. Clicking "Send X" will send X stuff immediately (clicking twice will send 2X, etc.). In many contexts, choices like "Send All", "Send Max" and "Send Half" are appropriate. In a fast-paced real-time game, removing a click may be important.



Thursday, July 23, 2015

Do audio players on Mobile need volume controls?



I see in almost all audio players, there is the ability to adjust the volume in the audio player. iTunes does this along with other apps like Podcast.


My question is, if you can control the volume with hardware on an iPhone and Android, why do we need the volume controls in the audio player?



Answer



4 Reasons:



  • The hardware buttons are low-res step-wise controls. If you want to go super-soft to super-loud or vice versa, the sliders are much more useful. Also, to fine-tune the level, you need to use the slider - sometimes the steps of the hardware buttons take you neither here nor there (particularly the case when listening on headphones in a noisy environment).

  • The slider is more accessible when the device is not hand held, like when on a dock or on a stand. Using the slider means there's no need to grab the device to counter the force applied on the buttons.

  • Lastly, the function of the hardware buttons will be ambiguous for some - most of the time you change the ringer level; upon entering certain apps, they still change the ringer level unless you play some media - only then the hardware buttons alter the level of the media. So you can argue that there is a benefit in providing a level control that is not ambiguous - the slider within the app. After users have learnt the behaviour of the hardware buttons, these can be seen as somewhat 'expert controls'.

  • A few weeks ago a friend of mine had an egg splash on her iPhone; the result - the volume buttons are now stuck and these volume sliders prove to be very useful. But I don't think this is taken into consideration by app developers.



Using Apache 2 Licensed fonts in a Logo


This matter seems to be quite unclear since Apache License v2 is normally used for software. There are actually quite a few fonts that I find interesting and, I would like to use them in some company logos I'm designing. Reading the license, the confusion persists. Is it "allowed" or "legal" to use such a font, in its unmodified form (excluding color and size), in a commercial logo or company logo? If so, are there any requirements?



Answer



I think section 2 sums it up fairly clearly (well, as clearly as licenses can be):





  1. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.



To me that reads as "it's open source, do with it as you please..."


fixed income - Question on pure carry for two bonds


If two bonds have yield of 5% and 2% and assume there's no price change, can we say that the carry is simply 5%-2% = 3% for a year. Does this take into account coupons?


Equivalently, let's say the 10s30s curve is 60 basis points. Can you simply take 60 and divide by 20 years to get 3 basis point of carry per year. Does this even make sense?



Answer



The quick answer - No, not really, on any of the points..


Cost-of-carry (and its counterpart, roll-down) are concepts very misunderstood in the fixed income world if you ask me. Most people seem to have their own, ill-defined definitions of what cost-of-carry and roll-down are. Sometimes people interchange or even bastardise these terms.


My definition is as follows:


Cost-of-carry: the physically payable cost for holding a trade for a defined period of time. A bond purchased on repo would incur the cost of financing the purchase, for example. Regulatory capital charges would be another example for a bank.


Roll-down: the mark-to-market (MTM) gain or loss on a position if the yield curve remains static over a period of time. For example; today 9Y and 10Y yields might be, say, 1.870% and 1.917% and in 1Y time assume they will still be 1.870% and 1.917% (even though today's fwd curve does not price that outcome - it actually prices 1Y9Y at, say, 1.943%)


So if you buy a 10Y bond with an annual 3% coupon at a yield of 1.917% for a dirty price of 109.81, financed by a repo rate of say 1.70% what will happen?



Your cost-of-carry is the repo cost minus the coupon = (109.81*1.7%=1.87) - 3 = 1.13 gain. Your mark-to-market is affected by the new yield of 1.943% and price of 108.68, meaning a loss of 1.13. So if the yield curve evolves as expected you gain cash and lose on MTM in the same amounts. This is arbitrage free pricing in action. If this didn't happen everyone would purchase bonds financed on repo and hope to accrue gains.


But now lets assume roll-down: if the yield curve remains the same then the price of the bond is instead 109.10 so you only lose 0.71 on MTM and hence your net gain is 0.42.


These example numbers are all consistent within the context I created in a spreadsheet for a specific term structure, but in the real world different bonds can have different repos, the term structure of the curve will be different, but the principle are the same.


For your two specific bonds at 5% (long) and 2% (short), if they both have the same repo then after a year your cost-of-carry will be +3 whilst your MTM will be -3 under an arbitrage free pricing model. If you assume roll down then this will depend upon the shape of the curve it is entirely possible that depending on which curves you have purchased you will see a negative roll-down.


This other answer shares the same opinion. Another answer I give to swaps shares the same concept.


forms - Is required validation possible on a switch/toggle control?


Scenario


I want to make sure a user has made a selection on a switch input.


On page load it is either on (1 - in image) or off (2 - in image) depending on what state it is set to in the code.




Problems



  1. On submit the input is read as either being on or off (never unselected)

  2. Visually it is not obvious whether the current selection is made by the user or the default state on page load





Solution


To get around the two issues mentioned above, I could change the switch to a couple of radio buttons (3 - in image) That way required validation will fire and also you can visually see no selection has been made by a user.




Alternative Solution?


However, I would like to hear any ideas about solving the two problems mentioned but still retaining the switch control. Is it even possible?




enter image description here




Wednesday, July 22, 2015

Bachelier model call option pricing formula


Does anybody have the Bachelier model call option pricing formula for $r > 0$?


All the references I've read assume $r = 0$. I don't speak French, so I can't read Bachelier's original paper.





style - Is it a good idea to write a summary of a plot before writing the full version?


Sometimes when I write a plot I get confused about the motivations of the characters and how events connect as I change elements.


Is it a good idea to write a summary first in order to organise things in a simple way? And then writing the actual novel?



Answer



Yes.


Write the summary.



Write an outline.


Write it on notecards so you can rearrange things and reconnect elements in different ways. Use string.


Write up briefs of your characters. Know their backgrounds, their personalities, motivations, likes and dislikes, fears and loves. "Brief" is a misnomer.


Otherwise you don't have a novel. You have logorrhea.


fullscreen - What are the advantages and disadvantages of full screen mode


I'm trying to understand how viewing a website in full screen mode could impact our browsing experience. Full screen mode has existed for some time for videos (e.g. YouTube) and Flash games. I've also seen it recently on Google Docs.


I wonder if web designers have considered offering full screen mode as a "readabily enhancer"? I certainly haven't really seen it. Is it because fullscreen is too restrictive (because users have to escape full screen to go somewhere else)? Are there other pitfalls of fullscreen?




Answer



The main problem with full screen mode would be whether users know how to get out of it again - especially when the fall into it accidently.


I suspect a lot of users wouldn't know how to escape from it.


notification - UI : Is it fine to have MessageBox without a caption?


A trivial UI guideline question - Is it ok to have MessageBox without caption ? I have a Winforms GUI with 3 confirmation boxes at different scenarios. Can anybody provide me some formal UI guidelines information on whether it is mandatory to have Captions on MessageBoxes ?



Answer



There's certainly no rule against it, but you aren't helping the user out without a title. Even a simple title such as "Warning" or "Confirm" is helpful to the user.


The title should describe what the message is about, where as a message icon helps distinguish the type of message.


But you should try to keep MessageBoxes to a minimum. They are usually disruptive to the end user.


Illustrator - my rectangles are all sheared skewed?


When I try to create a rectangle in a certain .ai file they all come out sheared:


enter image description here


but this isn't the case in other projects. Is there any way to fix



Answer



I almost 100% sure your question is a duplicate. Anyway, check the prefs -


enter image description here





Otherwise disable the Perspective tool by clicking on its "x" in the Left-top corner.


illustration - Designing a logarithmic/phyllotactic-like pattern in Illustrator


After watching today's Apple Keynote, I witnessed a modal used in one of the HomePod slides. It shows a mesh design for the fabric that encloses the device.


How might I reproduce this in Illustrator? At least the shape. Not the entire gradient color and shading.


I'm assuming I'll need to create a spiral graph, however I am having a hard time doing that in Illustrator.


Example pattern



Answer



Here goes for the shape...I can further my answer tomorrow if you require more help for shading.



  1. Create an elliptical shape in Illustrator.


  2. Rotate it by 137.5 degrees and copy it. (Also known as the Golden Angle...this is key!)

  3. Hit ctrl+d or cmd+d to duplicate until your shapes start to seem thicker (that means you went too far so you can undo until you have a nice, uniform texture).

  4. Cover the center with a circle. Go on with recreating the shading!


enter image description here enter image description here enter image description here enter image description here


Tuesday, July 21, 2015

trademark - Is it legal to write a novel about people playing "League of Legends"?


I was wondering if using trademarked items such as a bottle of "Pepsi", or a video game like "League of Legends" can make you vulnerable to lawsuits. I think so, but I am not sure, because I see a lot of media where products are often renamed into something similar like "Google" to "Poodle" and so on.



Answer




What you're talking about here is trademark law. "Pepsi", "League of Legends", etc, are trademarks. It's completely legal to refer to someone else's trademark, as long as you use it properly. But there are two big catches.


Number 1: You can't use someone else's trademark as your own. You can say, "George liked to play League of Legends". But you can't make up your own game and call it "League of Legends".


Number 2: You can't use a trademark as a generic term. For example, Coca Cola company's lawyers used to go after anyone who used the word "coke" with a small "c" as a generic word for "cola". They had a good legal reason to do this: The courts have ruled that if a company does not vigorously defend their trademarks from generic use, that they can lose their exclusive legal rights to the name. "Escalator" used to be a trademark, but the company failed to protect it, and the courts ruled that it was now a generic term for a moving staircase, not the property of any one company.


Number 3: If you refer to a trademark, you are clearly identifying who you are talking about. And if you say anything negative about them, they could sue you for libel. If you just wrote, say, "George Googled the word 'aardvark' and quickly found the information he needed", I can't imagine that Google would object. They're probably happy when lots of people talk about their company in a generic or positive way. But if you write a story about companies invading people's privacy by collecting personal information, and the chief villain in your story is an evil company named "Google", you might be hearing from Google's lawyers.


(Those are the issues I can think of, anyway. They're might be others.)


Unless you really need to refer to a real trademark for your story to make sense, it just avoids trouble to use made-up trademarks.


Like if you're making a TV show and the hero looks something up on the Internet, maybe in real life he's use Google, but it's easy enough to have the computer screen on the TV show say "Frugle". The audience will still understand what's happening and you avoid any potential problem.


In your case, if you want to say that the characters play a video game, does it HAVE to be "League of Legends"? Would it hurt the story if you said that they like to play "Hall of Heroes" or some such made-up name instead? If for your story to make sense the reader has to know some crucial fact about League of Legends, well I think that's just a bad idea. What if a reader has never played the game? I don't know what percentage of the world's population has played this particular game, but I'm guessing it's fairly small. (Personally I've never heard of it before reading this post.) So to make the story work you'd have to explain anything about this game that is relevant to the story. At which point you could use a made up game and explain the same things just as well.


Of course I don't know what you have in mind to write. It may be that there's some very good reason for naming this specific game.


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...