Wednesday, May 31, 2017

adobe illustrator - Gradient effect with dots


I was trying to create a gradient effect using dots, but not using the halftone effect. Examples of what I'm trying to achieve can be seen here: enter image description here



and here:


enter image description here


I was hoping to achieve this in Illustrator as a gradient fill so it would be easier to control the direction of the dots. Any way this is possible? Thanks for assistance in advance!




Best practice for InDesign document translation?


What are the best practice for translating documents in InDesign?


I guess there is some mechanism for import-export XML like Illustrator Variables to translate without using installed Indesign?


I'm thinking about this workflow:




  1. export InDesign data into XML

  2. translate texts inside XML

  3. import XML into InDesign

  4. correct translated pages



Answer



Depending on how you plan to do the translation and how your InDesign document is set up, the simplest approach might be to export the individual stories as RTF files, which will retain all your stylesheet information. The translations can be done using the RTF files then imported back to a copy of the original InDesign file using 'File > Place' with the cursor in an empty text frame. This is how I normally approach a project like this. The down side is that you will inevitably end up with a great deal of copyfitting work to compensate for the different lengths of text in each language.


Exporting as XML requires you to first set up the XML structure in InDesign, which can be a tedious process if your document is large and complex. The advantage is that you can recreate the entire document from the XML using a template. I would only consider this workflow if you have a large number of translations to do and the tools to work easily with the XML data once it's exported. James Malvaid's excellent "A Designer's Guide to Adobe InDesign and XML" is your reference for the techniques you'll need.


If this is a workflow you expect to be using on a continuing basis with fixed number of staff translators, you might find that using InCopy will work out best in the long run.



website design - What are some good resources for web page composition?


I'm looking for resources on the composition of web pages.


I'd like to learn about pros and cons of different page layouts and techniques for moving the eye around a page.



Answer



The question can have a quite wide answer that needs days and days of studying, but I'll give a try on something short.


You have to design your layout following an invisible grid, like in paper so on the web that will help you on keep everything on the right alignment and tidyness. The difficulties are that on the web, sizes and proportions are changeable, and content is dynamic on many aspects (setting preferences, monitor calibration, illumination, monitor size, browser, operative system, etc...).


For this reason let's not consider proportion between things, but let's concentrate on a classic setup. A classic layout is header on top, footer on the bottom, and 3 columns on the centre (with the left and right smaller than a centre). That could be website on two columns or more columns, it all depends on how much information you have, and how much you want to display or how much "air" (aka: white space) you wants to put between the informations that you have.


Note: Be aware that there are some technical CSS limitations like aligning columns (that are on the same horizontal row) on the same height when they have different content that fill the column. People are trying to fix with creative solution until browser will update their CSS rendering on the newest standard



There are 4 possible layouts:


1) Fixed layout: You define every div in px that fit inside a specific size that will be visible inside a browser (for example inside: 800x600)


pro: the design is stable con: you could have to much white space depending on user screen


Of this solution you can decide to left (knowing that a big gap will be on your right and you could play with a graphic background), or align center (dividing the white space on left and right, reducing its amount than left alignment).


2) Fluid layout: The page will adapt to the size of the screen, moving and adapting content around


pro: it always will fill the page not leaving uncontrolled white space con: you will loose control on the proportions and the grid where you position your content (example: one paragraph on more lines that become one long single line sentence on higher screen resolutions)


Technique Example or another one more complex


3) Original layout: They are based on breaking the rules of layouts and grids. They don't use the a classic column layout and are based mostly on graphic design effects, like displaying information all over the website, and they are using more absolute positioning than any other solution. Good for artistic fun on the web or crazy portfolio and nothing more (I am not against it, but they require knowledge of the rules of web design communication, technical and good creative effort).


I don't find an example at the moment, sorry.


pro: great aesthetic and original con: you cannot use this for commercial websites, or for blogs or for anything with a big amount of info.



4) Dynamic fixed layout: It is what I use nowdays for my personal websites, and for client websites that have time to spend in make a website flexible but under control. It is nothing more than a fixed layout, but with a javascript that is constantly checking your screen size (in case of resizing or to determine which size is it) and pass the appropriate css for that size. So no matter what is the size of your screen, you will always have a good control. For example if I have a 3 column layout, if I resize down the browser I can decide that the third column will disappear and go on the bottom of the content, before the footer.


pro: Complete control + flexibility con: A lot of effort in designing and debugging time to spend to check that everything it is ok, thinking even ahead because you will add new content later in the future and everything has to work fine.


Article where I did take inspiration (Nowadays jquery does a great job with resize(), 3 years ago I had a long long script for that :) )


A last note There is nowadays a new trend on graphic web designers (people that are more graphic designer than programmers), that using fixed layout they are designing each single page og their blog as magazine do with their articles. Creative, and designing every article with his own style.


An exponent is Jason Santa Maria


Other articles:



There are more articles out there. Look for "css layouts". Or follow places where talks about usability and design like Signal Vs Noise


All that there is to know on composition is experience and study, or usability testing (trial and error). Put someone on front your website and see how they react on your designing. Or an Eye tracking device :)


I am self-taught so I cannot suggest about books on composition, but a good book about grid layout can help you a lot.



messagebox - What properly goes into the "caption" of a message box?


By convention, what is the best practice for the text that goes into the "caption" field of a text box?


The "caption" field is the text that shows up in the title bar:


enter image description here


I have experimented with various things such as the application name, "Error", "Invalid Operation" and the like, but have never come up with anything that is wholly satisfying that I could use consistently.


Is there a "best practice" for this?




Color Theory: Is there a measurement of "colorfulness"?


I was adding some colors to a Windows application. A column was going to be colored in order to indicate groupings to the user. So in Photoshop i first selected some colors to use. Being mathematically (rather than graphically) inclined, i chose to use the hue from every 60 degrees:


enter image description here



Note: This question is going to be about color theory; and less about graphic design or usability.



Since i was going to have to have Black text (e.g. 13 of 27) over top these colors, i needed them to be fairly light. I know that the L value in Photoshop refers to the human's intrinsic sense of how "light" the color is. I chose a Luma of 90. So with more fiddling in Photoshop i adjusted the L of each color so each had a Luma of 90.


enter image description here



Note: i'm going to use L, or Luma interchangeable. i know there are precise, and separate, definitions for L, L*, Luma, Luminance, brightness, and lightness. Some definitions may be precise, some not. Lets avoid that holy war and just know that i'm using the L thing in Photoshop. And lets assume that two colors with the same L in photoshop will have the same apparent "brightness", or "lightness" to them. Again, forgive brightness and lightness. Yes, i'm inadequate.




As i change the L value, the Hue would change. So it was juggling act. Adjust the L, fudge the hue back to the value i want, adjust up the L, fudge the hue back, fudge the L, fudge the hue:


enter image description here


Eventually i get the hue i want to have the L i want.



The code i was updating also used "gray" as one of the colors that could be shown to the user. I realized that grey doesn't fit into any of my hues. Intrigued, i added to my photoshop doodle. It's simply a "saturation" of zero (which is the S knob in Photoshop):


enter image description here


So then the question dawned on me. I decided to use a Luma=90 for all my colors. This means that visually/psychologically/perceptually all the colors would be equally "bright". I've pinned down a Hue i want, and i've pinned down a Luma i want. But what Saturation do i want?


Ideally, and i don't know if this is a thing, they could all be equally "colorful". i don't want them to all be gray, i want them more colorful than that. And i want them to all the the same "colorfullness" - if that's a word.


So i did what anyone would do, i googled wikipedia colorfullness, and there's an entry:




In colorimetry and color theory, colorfulness, chroma, and saturation are related but distinct concepts referring to the perceived intensity of a specific color.



  • Colorfulness is the degree of difference between a color and gray.

  • Chroma is the colorfulness relative to the brightness of another color that appears white under similar viewing conditions.

  • Saturation is the colorfulness of a color relative to its own brightness.


Though this general concept is intuitive, terms such as chroma, saturation, purity, and intensity are often used without great precision, and even when well-defined depend greatly on the specific color model in use.



And then the article devolves into CIE, Lab, Luv. And i don't know what i want.



I went back to Photoshop, and started to just increase the "saturation" knob of each color. For a given hue, and the fixed luma, i increased the saturation in 5% increments (having to do fiddling along the way):


enter image description here


But at some point, the colors cannot "saturate" anymore without losing Luma:


enter image description here


And some colors can reach all the way to the end with S=100 and L=100:


enter image description here



In the same way the Luma defines the perceived "lightness" of a color:



is there a metric for the perceived "colourfulness" of a color?




Is there such a metric? Is the Saturation in Photoshop's HSB color model a perceptual one?


i noticed one snippet in the wikipedia article that's easy enough for me to understand: use the hypotenuse of a and b:


enter image description here


i could do that, and figure out which of my color chips have the same "Chroma".



In the end, in the real application, i used a color wheel centered around blue 210, and avoided green (in case the user things green means good), and use complimentary colors as much as possible.


enter image description here


But i still want to know about the color theory of "colorfullness".




Assuming the magnitude of an ab vector in Lab color model, i.e.:



  • colorfulness = Sqrt(a2 + b2)


i calculated the chroma lengths of various colors:


enter image description here


Colors of different hues with approximately the same "chroma lengths" look to me like they have the same "colorfulness". If nothing else comes up, i might go back and recalculate all my existing constants using this formula.


Otherwise it will nag at me.



Answer



After doing a lot of reading, turns out there is a useful metric of "colorfulness".



The hint came from the wikipedia page i cited, which mentions the L*C*h* color space. The L*C*h* is a variation of the L*a*b* color space.


Take the Lab color space you are used to from Photoshop:


enter image description here


Where a and b are cartesian coordinates:


But you can also represent colors on that plane using polar coordinates.


Rather than a pair of cartesian coordinates:



enter image description here


coordinates, it can be a pair of polar coordinates




enter image description here


So that C* is a measure of Chroma and h is a hue angle.


The formula to convert a, b into a C* length is high school pytheogrean theory:


enter image description here


The defined hue angle doesn't quite match the HSL/HSB hue angle. But it works out well enough to base a color model off it:


enter image description here



But the jist of what i learned is that the distance from the center (a=0, b=0) makes the color more colorful.


I also learned that some colors in the Lab color picker are outside the human ability to perceive as color; and so are not actually colors. There is a GiMP LCh color picker, and it points out the colors that are out of human gamut:


enter image description here



Why using Spaces in Names of Files and Directory in Sketch?



So I am actually a computer scientist, who works also as a designer. When I use other sketch files, I always see that the namings of files and directories have spaces in it. For me it does not make sense, because in coding file and directory names with spaces cause trouble. It starts when you use a terminal - you can not open a directory which includes spaces easily, there is always some more writing because the directory or file you want to open needs to start with " and ends with ".


what is the actual added value here?




conventions - Should there be a space after the copyright symbol ©?



To space, or not to space, that is the question:


Whether 'tis nobler in the mind to place the copyright statement in the footer of an application, or somewhere else, is beside the point. What I want to know is: regardless of where one places it, is there a best practice, convention, or standard that states whether or not one should put a space between the copyright symbol © and the year?







© 2014 Some Company, Inc.









©2014 Some Company, Inc.




I'm not looking for opinions, but I figured I'd give mine. My personal opinion is that my eye is immediately drawn to the "with space" option as a cleaner solution; the "without space" option somehow just doesn't look right to me.



Answer



A poke around Google suggests that most guides on usage of the symbol agree with your intuition. This article emphasizes that you should use a non-breaking space to avoid the symbol and the copyright holder being on two different lines or pages. Their reasoning is as follows:



Must you put a space af­ter the copy­right sym­bol? No, but se­man­ti­cal­ly, it makes good sense. The © di­rect­ly re­places the word copyright, so it should be spaced like any oth­er word.




trademark - Our company's new logo looks similar to another logo. Will this be a problem in the future?



We are into Fintech space. We are doing a rebrand and the logo we have finalised unfortunately looks similar to the one on left in the below image. Now we are in a dilemma that if we should go ahead with this or not. Can anyone tell us if we can trademark this? Is it going to be a problem? Can the other company file a lawsuit against us? Also, did you see any other logo similar to us?




After your feedback, we have updated it like this. What do you think?


enter image description here




Answer



Back when I was doing commercial art for my living, I'd occasionally run across news of some lawsuit based on a logo (symbol) causing confusion. The standard is (or was, anyway) not whether the logos can be distinguished when side by side, but whether seeing Logo B makes people think it's a new version of Logo A. If that happens, the owners of Logo B are in some legal trouble.


Given that there are very few differences between the two logos, and none of the differences are significant, it's not hard to foresee major trouble. So yes, do change it now, while it's still inexpensive to do so.


(While you're at it, design it in one-color black. To get that halftone effect you have now requires either halftones, which weakens the color, or some tricky work on the press, which more than doubles the cost. It was a common heuristic back in the day that anyone who can't design a good logo in one-color black can't design a good logo at all!)




Suggestions for differentiation:




  • rotate the symbol 45 degrees anti-clockwise





  • reverse the symbol out of a very dark (just short of optical-black) green square. You can use cool, neutral, or warm green. Cool reinforces the pine-tree motive, but is distancing; warm is more approachable, but reduces the tree effect; neutral leaves everything alone.




  • reverse it out of a dark green triangle, base down. A triangle reinforces "tree" and feels "stable", but can also feel "spiky". Same warm-cool caveats.




  • reverse it out of a dark green circle. A circle is friendlier and more inclusive, but is much less tree-ish. Same warm-cool caveats.





  • go to 5 needle pairs rather than 3 (going to 4 is unlikely to be visually distinctive enough, but you could try it)




  • add 1 or 2 pinecones -- but mind out that it doesn't end up reminding people of a WW2 SS collar patch!!




Tuesday, May 30, 2017

placement - Comment Box above or below ?



I am creating a commenting block on my website. I just want to know which is the better way to put the comment box above the list of comments or below it ? enter image description here


Show i place the Comments above or below the comments ?


this is the page layout


enter image description here



Answer



In this case, people are commenting about the restaurant rather than responding to comments about the restaurant. So there is no requirement for someone to read the existing comments before adding their own.


In fact people would probably find it quite tedious to trawl through all the comments and would thus be less likely to add their own if the comments were at the bottom.


So I would say comment box above.


usability - UX responsibilities


Is there a number of responsibilities that fall under UX (for example, graphic design, usability etc), or is UX a sub responsibility of design?




Answer



The short answer: Design can be one of the responsibilities that fall under the larger category of UX.


According the A Project Guide to UX Design, a UX designer generally fulfills the rolls of three other categories of job, which may have separate people to perform them in extraordinarily large companies:



  • Information Architect

  • Interaction Designer

  • User Researcher


According to that same book, the UX designer may also interact with (or in some companies act as) the following six roles.




  • Brand strategist or steward

  • Business analyst

  • Content strategist

  • Copywriter

  • Visual designer

  • Front-end developer


So a UX designer won't necessarily have any experience in graphic design, but it's common for someone working in UX to have at least some graphic design knowledge.


fx - VaR mapping - Forward Foreign Currency Contract


I have a question about VaR mapping for FX forwards. Please bear with me while I outline the problem.


Philippe Jorion's book discusses VaR mapping; a means to break down complex instruments into simple risk factors and calculate the amount of risk against these risk factors across the portfolio.


The example given for FX forwards is a 1 year contract to buy 100 MM EUR for 138.09 MM USD. The forward rate is $1.3013. The FX contract is broken down into 3 components:


a long position in the EUR spot ($1.2877) a long position in a EUR risk free bill (2.281%) a short position in a USD risk free bill (3.330%)


A VaR is given for each of the above positions, along with a correlation matrix. The author then calculates the present value of the cash flows from each of the 3 positions above as such:


PV cash flow of long position in the EUR spot = $$130.09 * 1/(1+USD risk free bill rate) = 125.89$$


PV of the cash flow of long position in the EUR risk free bill = $$100 * EUR spot * 1/(1+EUR risk free bill rate) = 125.90$$



PV of the cash flow of short position in the USD risk free bill = $$-130.09 * 1/(1+USD risk free bill rate) = - $125.89$$


The PV cash flows are then multiplied by the given VaRs for those risk factors and summed up to produce an aggregate undiversified var.


My question:


I don't understand why the cash flow for the EUR spot long position is being calculated the way it is. It makes no sense to me. Seeing as it is a spot rate why is it's cash flow not simply spot * 100 MM EUR notional ?


Here is a YouTube video on this problem in case my textual description isn't clear. https://www.youtube.com/watch?v=Um8e_teI_dw


(This contrived question is a topic on my Financial Risk Manager exam)


Thanks




adobe illustrator - How can I add multiple concentric outlines around text?


I can get this effect very easily in Photoshop using the stroke layer style and making it a shape burst gradient, but I want to be able to do it in illustrator so the stroke around the text can be a separate editable path. Is it possible to do this in illustrator?


image



Answer



You can simply add new strokes, each increasing in size, via the Appearance Panel.



sample


Note, the strokes are all below the item in the panel.


The initial white stroke is used to create the negative space around the characters themselves.


If you then want independent paths for each color, follow these steps:


choose...
Object> Expand Appearance
Object > Ungroup
Object > Expand
Object > Ungroup
Object > Expand

Pathfinder Panel > Merge


That will result in a separate shape for each color with the contour of the characters.


expanded


volatility - SPX options vs VIX futures trading


Forward volatility implied by SPX options, and that of VIX futures get out of line. If there existed VIX SQUARED futures they could easily be replicated (and arbitraged) with a strip of SPX options. However replicating VIX futures would theoretically require dynamic trading in options (all strikes) and is also would depend on the model for distribution of vol of vol.


Question for traders: have you or someone you know ever traded SPX options (variance) vs VIX futures, and if yes then please provide some clues. Please don't write that there is an academic article about this; I'm asking if someone did this is practice.



Answer




Short answer: yes. Long answer: the challenge in trading these things, like you mentioned, is that each contract is not perfectly hedgable. This is an intentional choice made by the exchanges that list these products, so that they can provide an incentive to trading firms(locals) to provide liquidity for these new products and help boost trading volume.


The primary challenge in trading spx options vs vix futures, or spx options vs vix options, or vix options vs vix futures, is the fact that all three have different expirations. This fact combined with the wildly different notionals for each (vix futures = 1000*vix, vix options = 100 * vix, and spx = 250*vix) makes it more difficult to hedge and trade one versus the other.


What most liquidity providers do instead of trying some kind of variance-gamma model approach is to simply hedge vix options or vix futures using spx straddles, and updating their hedges several times a day. This isn't a perfect hedge, and has lots of additional timing risks. However, there is something like 1% to 1.5% edge in trading this approach, so levering up can make it a reasonable strategy when considered with mean reverting nature of vix.


Monday, May 29, 2017

website design - Minimalism, Maximalism(?) or whatever?


Tufte & Nielsen believe that screen real estate is one of the most important asset for a (UX) designer. Utilize available screen space - Jakob Nielsen’s Alertbox: May 9, 2011 & The Visual Display of Quantitative Information - Edward Tufte: May 2001.


Nielsen's review of Windows 8 had one specific point, 'Low Information Density' amongst others, saying that this leads to unnecessary scrolling on the users part and is bad UX.


On the other hand, you have the "Less is More" campaigners. Here's an UX booth article from Oct 2010, Less is More: Simplifying your User Experience. It has it's origin in the Arts and architecture with the minimalism movement. You see many websites being designed along these principles. Windows 8 is also pushing in this direction. The recent Facebook home also seems to be a good candidate for this design.


My question is: Is there any scenario where the "less is more" style holds true? If yes, is there any threshold value of sorts till which the minimalist concepts holds true (a couple page website vs. ecommerce website)?


Or, are these concepts unrelated?




organization - External folders in scrivener?


I have a couple of folders with artwork, maps etc. I would like to include this folders to my scrivener project but I don't know how.


The furthest I've got is to drag files from folder to Scrivener window. That way I can open my files, but they are all put in folder with all the other files and get renamed to a number (in scrivener project folder /files/docs).


What I want is to have an "external" folder inside my project. I want to have a folder which would be outside of the project directory but at the same time be able to view its contents and open files from scrivener.


Also any other solution that doesn't require to open the project from scrivener to change/add/remove/etc files is completely acceptable.


Note that all of this "externel" files would be images or sound files. I often work on and organize only the images and don't want to have to open scrivener every single time I want to add an image.



Answer




You can add external references to a Scrivener Project. Gwen Hernandes describes the procedure in her blog (images below taken from the linked site):


Click the References button in the inspector, then click the header of the References pane to toggle between Project References and Document References:


enter image description here


Click the + to "Look Up & Add External Reference ..."


enter image description here


The files added to that folder are not added to Scrivener automatically. If you are adventurous, you could have launchd watch that folder for changes and trigger a Shell script that edits the relevant Scrivener project files.


statistics - Skewness and Kurtosis under aggregation


Returns possess non-zero skewness and excess kurtosis. If these assets are temporally aggregated both will disappear due to the law of large numbers. To be exact, if we assume IID returns skewness scales with $\frac{1}{\sqrt{n}}$ and kurtosis with $\frac{1}{n}$.


I'm interested in a concise, clear and openly accessible proof for the above statement preferably for all higher moments.


This question is inspired by this question by Richard which deals with, among other things, the behaviour of the higher moments of returns under temporal aggregation. I know about two papers that answer this question. Hawawini (1980) is wrong and Hon-Shiang and Wingender (1989) is behind a paywall and a bit inscrutable.



Answer



Just to be painfully clear, it only seems to make sense to consider the logarithm of returns, i.e. $X=\log (1+\frac r{100})$ for a simple return of $r\%$ in an arbitrary period because this is what sums when returns are temporally aggregated. A basic property of cumulants is that cumulants of all orders are additive under convolution, for which a proof can be found here here.



So if $X_1$, $X_2$, ... $X_n$ are i.i.d., then all the cumulants of $$Y_n = \sum_{i=1}^nX_i$$ scale linearly with $n$, i.e. $$\kappa_k(Y_n)=n\kappa_k(Y_1).$$ However, I suspect that you are normalizing this sum so that the variance (or volatility) remains constant with increasing $n$. So instead let us consider $$Z_n=\frac{Y_n}{\sqrt n}= \frac 1 {\sqrt n} \sum_{i=1}^nX_i.$$ Another basic property of cumulants is that the $k$th cumulant is homogeneous of order $k$ as to scale. Using both properties together we have $$\kappa_k(Z_n)=\left(\frac 1 {\sqrt n}\right)^k\kappa_k(Y_n)=\left(\frac 1 {\sqrt n}\right)^kn\kappa_k(Y_1)=\frac {\kappa_k(Z_1)}{n^{(k-2)/2}}.$$


(Don't forget that $Z_1=Y_1=X_1$.) Now we can show that the statistics scale as you have described: $$\textrm{variance}=\kappa_2(Z_n)=\kappa_2(Z_1)\propto 1;$$ $$\textrm{skewness} =\frac{\kappa_3(Z_n)}{\kappa_2(Z_n)^{3/2}}=\frac{\frac{1}{n^{1/2}}\kappa_3(Z_1)}{\kappa_2(Z_1)^{3/2}}\propto \frac 1{\sqrt n};$$ $$\textrm{ex. kurtosis}=\frac{\kappa_4(Z_n)}{\kappa_2(Z_n)^2}=\frac{\frac{1}{n}\kappa_4(Z_1)}{\kappa_2(Z_1)^{2}}\propto \frac 1 n.$$


There is no reason this cannot be extended to higher orders, although it works out more directly in terms of cumulants than of moments.


adobe photoshop - How to select all shapes with specific color and replace this color with an other one?


I am totally new in Photoshop scripting, but I have some JavaScript experience.


I want to make a script (or find an existing one and study it) that finds every shape with a specific fill color in my Photoshop project and replaces it with an other one. But I have no idea where to start.




Answer



Normally you'd expect a script for this to be something like


activeDocument.layers.forEach(function(el) {
if (el.fillColor == oldColor) el.fillColor = newColor
});

I welcome you to a world of Photoshop Scripting: a world of pain and suffering. While there's a certain number of things you can achieve using Photoshop DOM, a lot of functions and properties are only a available as Action Manager code, used to drive Photoshop at a lower level.


So while the algorithm stays the same — I look for the shape layers with a particular color and then change it — the code may look a little confusing.


var layers = getAllShapeLayersData(),
sourceColor = [255, 0, 255], // color to look for

targetColor = [128, 128, 128]; // color to change to

// creating a native Photoshop color object to compare hex values instead of RGBs
var colorToChange = new SolidColor();
colorToChange.rgb.red = sourceColor[0];
colorToChange.rgb.green = sourceColor[1];
colorToChange.rgb.blue = sourceColor[2];

// for all found layers
for (var i = 0; i < layers.length; i++)

{
// if the shape fill color hex value is the same as source color
if (layers[i].color.rgb.hexValue == colorToChange.rgb.hexValue)
{
// select it first
selectById(layers[i].id);
//apply a different color
changeShapeColor(targetColor);
}
}


function getAllShapeLayersData()
{
var lyrs = [];
try
{
activeDocument.backgroundLayer;
var layers = 0
}
catch (e)

{
var layers = 1;
};
while (true)
{
ref = new ActionReference();
ref.putIndex(charIDToTypeID('Lyr '), layers);
try
{
var desc = executeActionGet(ref);

}
catch (err)
{
break;
}

var lyr = {};
lyr.type = desc.getInteger(stringIDToTypeID("layerKind"));
lyr.name = desc.getString(charIDToTypeID("Nm "));
lyr.id = desc.getInteger(stringIDToTypeID("layerID"));


if (lyr.type == 4) // shape layer
{
var adj = desc.getList(stringIDToTypeID("adjustment")).getObjectValue(0);

if (adj.hasKey(stringIDToTypeID("color")))
{
var curColor = new SolidColor();
curColor.rgb.red = adj.getObjectValue(stringIDToTypeID("color")).getUnitDoubleValue(stringIDToTypeID("red"));
curColor.rgb.green = adj.getObjectValue(stringIDToTypeID("color")).getUnitDoubleValue(stringIDToTypeID("grain"));

curColor.rgb.blue = adj.getObjectValue(stringIDToTypeID("color")).getUnitDoubleValue(stringIDToTypeID("blue"));
lyr.color = curColor;
lyrs.push(lyr);
}


}


layers++;

}
return lyrs
}; // end of getAllLayersData()

function changeShapeColor(color)
{
var desc8 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putEnumerated(stringIDToTypeID('contentLayer'), charIDToTypeID('Ordn'), charIDToTypeID('Trgt'));
desc8.putReference(charIDToTypeID('null'), ref1);

var desc9 = new ActionDescriptor();
var desc10 = new ActionDescriptor();
desc10.putDouble(charIDToTypeID('Rd '), color[0]);
desc10.putDouble(charIDToTypeID('Grn '), color[1]);
desc10.putDouble(charIDToTypeID('Bl '), color[2]);
desc9.putObject(charIDToTypeID('Clr '), charIDToTypeID('RGBC'), desc10);
desc8.putObject(charIDToTypeID('T '), stringIDToTypeID('solidColorLayer'), desc9);
executeAction(charIDToTypeID('setd'), desc8, DialogModes.NO);
}; // end of changeShapeColor()


function selectById(id)
{
var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putIdentifier(charIDToTypeID('Lyr '), id);
desc1.putReference(charIDToTypeID('null'), ref1);
executeAction(charIDToTypeID('slct'), desc1, DialogModes.NO);
}; // end of selectById()

How can I take my graphic design to the next level?


I'm a full-time professional designer in the early middle of my career -- I have been working as a designer full-time for 15 years.


I create lots of work that I am very proud of. However, when I look through something like a design annual, there is so much beautiful work that it makes me want to improve even more.


I've been thinking about this, and I think I mean that I want to improve in an aesthetic sense (which I know is subjective). I want my design to look more beautiful and pleasing. I'm very confident with achieving the communication goals of my design, and I even like how a lot of my design looks. But I would love to reach that higher level of beauty the masters seem capable of.


What should I do? How do I take my daily work to what I consider the next aesthetic level?





selection - Rely on user awareness by autoselecting or prompt the user to actively choose?


I came across a small dilemma in my development, namely whether as a designer I should rely on a user to actively review settings before submitting an action, thereby justifying having it pre-set, or letting the user actively choose setting before submitting.


An hypothetical example:


mockup


download bmml source – Wireframes created with Balsamiq Mockups



Consider the examples above. The user will perform a fairly sensitive action and has to select which company should be the owner of some valuable asset. The combobox will contain a small amount of items, many times it only contains one and rarely more than five. In the case of a user choosing the wrong owner it will lead to additional efforts and headache to sort up the situation.


Note, this is a hypothetical scenario.


The examples above differ in the fact that the upper auto selects the top item in the combobox with the chance of it being the intended owner and the user can proceed immediately. In the second example the combobox has no selection and the user can't proceed before a selection has been made.


Which of these two examples would be the most suitable in this situation? I have been running with the second since the action was introduced but has lately come to question whether it should be pre-set or not. Especially after I noticed that my banking service has pre-set comboboxes of which account I want to transact from and to which account the money should be transacted too every time I perform an online transaction. They apparently take for granted that the user will review the settings before continuing, and therefore has it pre-set.



Answer



The better option largely depends on:



  1. How easily this can be undone without ill effect

  2. How smart your choice is (does it have a reasonable default, like last used option?)

  3. How often they're going to be running into this



From your question I'm assuming this can not easily be undone with no consequences, so #1 is moot. If it could easily be undone I'd be more inclined to allow a "default" option if this is a commonly repeated action. Since it can't, you should already be erring on the cautious side.


If there's no logical default, don't use a default. Alphabetical order/the first item in the box is not a logical default; don't populate the dropdown with the first item like that. Alphabetical order is effectively random order in this case.


If your box is going to prefill, it needs to be something like "I'm editing this company, so default to this company" or "the last entry in this same session was X, I'll populate the field with X". Even if this is the case, we still need to consider point #3, frequency of use.


If this is an uncommon and dangerous action that occurs maybe once a week or even once a day, I would definitely force a choice. If an action is rare and dangerous, the extra certainty is vital. You're favoring Heuristics and Effectiveness over Efficiency because the Efficiency gain is minor, and the risks are major. Rare actions have the additional trouble that users may forget important details like where your app gets the default, so if there's any chance your user forgets, don't make risky assumptions.


From here on it's a numbers game; if I'm going to be filling out this form 500 times with the same data and you don't default populate it, it's going to be frustrating. If I'm going to fill it out 500 times with different values almost every time, a default would be frustrating! Find the more common use-case but err on the side of caution unless your users or data indicate you're being too cautious.


Sunday, May 28, 2017

Physical description of characters


Does a physical description have to be specific to make a character feel real, or can the physical description be general and the details be left to the reader's imagination?



Answer




A character does not have to be described at all to feel real. In many stories we are told little of their appearance beyond whether they are male or female, and occasionally not even that.


Where physical appearance is described it can really go no further than to place the character in a general class of people (An cavalry officer. A southern belle. A poor sharecropper. Etc.) and specify certain significant physical traits (fat, thin, bald, etc.).


You can go into more detail, but language does not give us the facility to easily describe the particular details of face and form that allow us to recognize individuals in real life. If a character has a face to a reader, it is the reader, not the writer who has supplied it, at least until the movie gets made, at which point the actor provides the face.


What makes a character feel real, more than anything else, is their behavior. When the characters in as story do not feel real, it is because the author has treated them as props instead of people, has made them behave in a way that advances the plot or make the point the author wants to make, but is simply not the way a real person, particular not that real person, would behave.


Saturday, May 27, 2017

adobe illustrator - Combining transparency


A 50% opaque white object put on top of another 50% opaque white object is not anywhere near as white as a 100% opaque white object (blending mode normal). I tried this in Illustrator and Inkscape, and the results seem to be similar, so my question is: how are overlapping transparencies calculated? Is there a way to force either to use simple addition (30% opaque on top of 20% opaque = 50% opaque)?



Answer



Let the 2 otherwise identical layers have opacities 80% and 40%.


Represent the opacities as decimal numbers ie. 0,8 for 80% and 0,4 for 40%


The combined opacity as decimal number is 1 - (1-0,8)*(1- 0,4) = 1 - 0,2 * 0,6 = 1 - 0,12 = 0,88


As percentage that is 88%


The general formula for combining opacities A and B as decimal numbers:


Opacity = 1 - (1 -A)*(1 - B)



This is easy, if one thinks 1-A and 1-B as "transparencies". The combined transparency is calculated by multiplying the single layer transparencies. The opacity is = 1 - the transparency.


Your example: A=0,3 and B=0,2. The transparencies are 0,7 and 0,8


The combined opacity is 1 - 0,7 * 0,8 = 1 - 0,56 = 0,44 = 44%


ADDENDUM: The questioner wanted a way to force the combined opacity to be the sum of single layer opacities. This unfortunately is impossible. Let the layer opacities be 60% and 70%. We have no way to make something to have 130% opacity. 100% is the maximum. Nothing can be less transparent than the absolutely non-transparent.


If one has the single layer opacity = A (decimal) and wants to pile these layers to get the combined opacity = C, he needs log(1-C)/log(1-A) layers.


automation - Update Text Content on Multiple Artboards at Once in Sketch


I need to generate a number of banner ads each week and currently use Sketch for doing so. In order to save time, I'm trying to automate (or at least improve the process flow) for this as much as possible. One of the things that needs to be done is to update both the special offer details and the offer code that needs to be used in ever banner size.


So what I'm looking for is a way to update the text in these 10 different text fields (one for each banner size) without having to manually select each one and type in the new text. Bonus points if the same (or similar) method will allow me to swap images on each of the 10 artboards too!


I've already looked through the Sketch Plugin Directory but haven't found anything I think will really do it.



Answer




You can do that by creating symbols of text and image. In this case you'll just need to change one and all the others will be changed.

Create an artboard and insert text.

Create an artboard with a text

With text selected goto layer > create symbol

goto layer in menu and create symbol

Give you symbol a name i.e. Banner Main Heading

name your symbol

make a copy of the artboard

make a copy of artboard

double click any Text and it'll open up another page of symbol. Change the text here to hello

double click on text and change text

This is how symbol works. Whereever you copy this symbol in the same project will not matter. If you change it at one place it'll be changed at all places

see the changed result

You can do the same for images and symbols that you make. Like if you have made an icon a symbol and you change it's color it'll be change at all places. While working with symbols you need to be careful though.


technique - How can I get into the mindset to write?


Depending on the weather, the days events, and other factors, I find myself with a different emotion everyday when I write which I'm afraid is making my novel a little bit choppy. For example, one chapter might be portrayed in a light mood, while the very next, for no literary reason, is written much darker because I received a bad phone call while I was writing. What I've tried to do is to abstain from writing until I'm in the appropriate mood with which I had started off the piece, but this is stopping me from writing on it a regular basis and slowing down the whole process significantly. I'm afraid that keeping the same personality is becoming more difficult as I stretch the length of time which which I'm writing it as I'm becoming a different person. So how do experienced writers help get into a specific "writing mood" for the piece they are working on?



Answer




I read somewhere, don't ask where because I forgot, that if you wait for the right mood to write, you won't get anything done.


So, I think if you just try to sit in front of your computer/paper, relax for a few minutes and delve into your character's mind, it would be better than to just not write until your mood gets better. It's hard, I know because I struggle with it too, but maybe in time it gets easier. Try to write at least a 100 words. It'd be better than nothing. Also, music might help. Putting a song in the background, very low if you don't like to hear music while you write, that goes with the tone of the scene, could help you keep the scene consistent.


Friday, May 26, 2017

Client wants font as logo



I wrote the business name of my client's using a font for a design I created. The client wants me to send him "that" - the name of his business in "that type of fancy/cool" font - as a logo to him. In other words he thinks it is a logo.


What should I say and how should I approach this situation, knowing that what he is requesting is not a logo? It's simply just a type of font... What he is requesting would fall under me sending him the type of font name/file.. but in my personal opinion I don't think that should be done due to purchasing fee's restrictions and such.


I should state that the font is free to use for personal use only. The purchased version is for commercial use, which I did purchase.


I would appreciate any recommendations on how to address these types of issues when clients request such things. Thanks in advance.



Answer



First of all, it is possible to simple have a typographic logo solution. Logos do not have to be graphic marks or use an original font. If your client is happy with what you've made as a standalone logo, then you should be able to create outlines out of the logo and send him a vector form of the logo without going against the copyright. However, perhaps you'd like to encourage your client to have a more complete branding made for his company. Corporate branding really involves much more than simply a type treatment of the company's name or even a great logo.


You cannot send your client a copy of the actual font software, but you can send him the name of the font and like I said, a vector of what he's considering to be his logo.


Hope this helps a little.


Thursday, May 25, 2017

interaction design - Update list when a user is viewing the list without annoying them


We have a list of items that the user will be interacting with frequently during sessions. Each session will last a minute or two and during that time they are changing state on items and updating them in other ways. At the same time other people could be updating the list elsewhere.


Is there a good way to show that we are updating the list? Or should we try to understand that they are using the list and avoid updating it until they aren't (detect inactivity)?


One anti-case is when using Netflix on Roku XR. It comes up when it has been asleep for a bit (in standby with the screensaver) and I wake it up to pick something to watch. It gives me about 5 seconds to scroll around before it wipes everything out and then refreshes the queue and other lists.


That 5 seconds is about enough time to pick something quickly, but then it just destroys the location I have so I have to find it again. Super annoying, but I understand it wants to give me the latest information.


The user could be interacting with the service via mouse/keyboard as well as a touch screen.



Thoughts on strategies for this?



Answer



There are a few different considerations here:



  • Addition of new items

  • Deletion of previously available items

  • Changes to existing items


The exact nature of your app will have a lot of bearing on what the "right" approach is (and if you give us more information about the type of app and it's users, we can be more specific)... however...




The current design pattern for this seems to be to highlight the new item.


Most commonly, this is exhibited in social applications that support real-time updates. For instance, Facebook will highlight "just added" comments as they appear attached to a newsfeed story or on a wall -- comments that are new since last page load have a thin blue highlight on the left side.


Google Docs highlights new content as it is added (with a small "added by" indicator on the cursor):


Google Docs


Additionally, if the addition is relevant to the task at hand, you can notify users with a notification message or "toast", which is what StackExchange does when an answer is posted to a topic you're currently replying to:


StackExchange Action



To maintain the user's context, it's really important that you don't remove already-seen things from a user's view without letting them know about it. I would recommend striking-out or graying the line that is no longer relevant, but keeping it on screen until the user refreshes the page.


Additionally, if it's relevant to the task at hand (for instance, if a user has selected an item that is no longer available), you'll want to let them know. Again, a notification can work well in this case, such as Amazon shows when the price of an item in your cart has changed, or an item in your cart is no longer available:


Amazon Cart



In the case of tabular data, it would also make sense to have a link on the notification to scroll back to the offending line.



Changes to existing items should be weighed carefully as to their importance to the user. For instance, if a table shows the quantity of an item available, and that quantity goes down by 1, you probably don't want to make a big production out of it - unless that change affect the user (e.g. they had added indicated that they wanted 2 of an item but now you only have 1 in stock).


Assuming, however, that a change will affect the user, you'll probably want to employ some combination of the methods outlined above to simultaneously highlight the new value, strike-through the old value, and notify the user IF the change is relevant to the task at hand.


Good luck!


optimization - Maximum Certainty Equivalent Portfolio with Transaction Costs


Out of curiosity I tried to compute the portfolio weights of a maximum certainty equivalent allocation, however, by incorporating (quadratic) transaction costs. However, my result is not as intuitive as I thought =( I would be happy for each and every hint to solve this problem:


Let the parameters of the return distribution be $\Sigma$ and $\mu$. The current allocation vector is $\omega_c$. The risk aversion factor of the investor is defined as $\gamma$. When shifting his wealth to allocation $\alpha$, the investor pays a fee of the form $T = c(\alpha - \omega_c)'(\alpha - \omega_c)$ with some parameter $c$, therefore transaction costs increase quadratically by factor $c$. Therefore, at time point $t+1$ the investor expects the portfolio returns to be $$\mu_\text{PF} = \alpha'\mu - T(\alpha,\omega_c)$$ and the corresponding variance of the portfolio $$\sigma^2_\text{PF} = \alpha'\Sigma\alpha.$$ In one line, the allocation is chosen as the solution to the maximization problem $$\alpha^* = \arg \max _{\sum \alpha = 1} \alpha'\mu - T(\alpha,\omega_c) - \frac{\gamma}{2}\alpha'\Sigma\alpha.$$ Equivalently, we have: $$\alpha^* = \omega_c + \arg \max _{\sum \Delta = 0} (\omega_c+\Delta)'\mu - c\Delta'\Delta - \frac{\gamma}{2}(\omega_c+\Delta)'\Sigma(\omega_c+\Delta).$$ $$ \Delta^* = \arg \max _{\sum \Delta = 0} \underbrace{\omega_c '\mu - \frac{\gamma}{2}\omega_c'\Sigma\omega_c}_{CE(\omega_c)} +\Delta'\mu - c\Delta'\Delta - \frac{\gamma}{2}\Delta'\Sigma\Delta - \gamma \Delta'\Sigma\omega_c.$$ $$ \Delta^* = \arg \max _{\sum \Delta = 0} \Delta'\mu - \Delta'\underbrace{(c I + \frac{\gamma}{2}\Sigma)}_{:=A}\Delta - \gamma \Delta'\Sigma\omega_c.$$


The first-order conditions take the form: $$\mu - 2A\Delta - \gamma \Sigma\omega_c -\lambda\iota= 0$$ $$ \iota ' \Delta = 0$$ It follows that $$A^{-1} (\mu-\gamma \Sigma \omega_c - \lambda \iota) = 2\Delta$$ Evaluating $\iota'\Delta = 0$ with $\Delta$ as above results in $$\lambda = \frac{1}{\iota' A^{-1}\iota}\iota'A^{-1}[\mu - \gamma \Sigma \omega_c]$$ Plug-in gives $$\Delta = A^{-1} (I - \frac{1}{\iota'A^{-1}\iota} \iota' A^{-1}\iota) (\mu-\gamma \Sigma \omega_c ) = 0\iota.$$ In other words, no matter how sub-optimal the current allocation and irrespective of the sice of $c$, there will never be any rebalancing. I do not believe this result but I also do not see the mistake in my computations. Anyone an idea, where did I miss something/ did something wrong?



Answer



Seems like a small mistake in the last equation. It should read



$\Delta^* = A^{-1} \left[\mu-\gamma \Sigma \omega_c - \frac{1}{\iota'A^{-1}\iota} \iota' A^{-1}(\mu-\gamma \Sigma \omega_c )\iota\right]$,


which is not equivalent to your result.


Wednesday, May 24, 2017

style - Writing a Platonic Relationship


I'm writing a story, however I just can't seem to form a platonic relationship between my characters.


Whenever I am writing my characters (Eric and Abigail), it feels they should just kiss and make out on the spot. The thing is I do not want their relationship to go too fast but let a few events pass before I make them committed to each other.



I (and they) know that it's love, but don't want to commit because of the situation they are both stuck in. What are the qualities of a platonic relationship and how do I apply this to my characters in my writing?




plot - The seven story archetypes. Are they truly all of them?


The seven archetypes are as follows:



Overcoming the Monster.


Rags to Riches.



The Quest.


Voyage and Return.


Comedy.


Tragedy.


Rebirth.



But surely, there are more? For example, riches to rags? That is one, right? Or would that go into another one, like rebirth, tragedy or even overcoming the monster, the monster being poverty?


What I'm asking is: Are the seven archetypes all of them, or simply the most common, fundamental ones?




user behavior - Why is Google's "I'm Feeling Lucky" button still next to the search bar?


I'm sure that Google must put a lot of thought into the display of its homepage. With such a minimalistic design, every element matters.


So what's up with the "I'm feeling lucky" button? Why is it right next to the search bar?


enter image description here


Before Google Instant, the button could be clicked to go directly to the page of the first search results, but now as soon as you start typing, the search results begin to display and the page changes to one without the "I'm Feeling Lucky" button.


Nowadays, the button serves a new function. If you hover over it, it changes to say something else, such as "I'm Feeling Wonderful," a link to Google's World Wonders Project or "I'm Feeling Trendy," a link to Google Trends. This seems like an effective way to bring traffic to some of Google's pages that users might not know about, but it doesn't explain why the button is right next to the search bar when it's no longer related to the search function. (It also doesn't explain why the working "I'm Feeling Lucky" button is sitting next to a button that does absolutely nothing.)


I know that in 2009, Google tested removing both buttons, but decided to keep them for now, so my question isn't just why the button exists. I also wonder why it exists there. Since it's no longer related to the search function or to the "button" next to it, it seems like it would make sense to move it elsewhere. Maybe shift to one of the large side margins and give it a color and shape that draws attention to it. If Google really wants users to know about the sites the button links to, wouldn't it make more sense to emphasize that the button no longer serves its former function?




Answer



After thinking about this question for the last couple months and reading some related literature (Stephen P. Anderson's Seductive Interaction Design in particular), I've decided that the continuing existence of the button is likely due to a combination of three factors:



  1. Branding - As @RachelKeslensky writes in her answer: keeping the button says "Yes, you're at the Google site, we even have the button." Maintaining the random nature of the button even though its function has changed keeps with the branding as well.

  2. Surprise gifting (It's a "delighter") - By sending users to a fun new site that they might not know about, Google creates a pleasant surprise. And because that new site is also created by Google, such linking feels like a personal gift. The most unanticipated gifts are the most emotional, and emotion helps ensure you remember the experience and maybe even tell others about it.

  3. Variable rewards - Because the site the button links to is random, innate curiosity compels you to try clicking on it multiple times just to see where it leads you. Not knowing what you'll find makes you explore more. I've even gotten into the habit of returning to it from time to time to see if any new links have been added.


physical - Keyboard number row ordering


On a typical keyboard, why is the 0 in the number row next to the 9 instead of the 1?


This seems like a question which should have a straight-forward answer, but the only one I could find is this yahoo question which has two instances of entirely unsourced speculation as answers. (0 as 10, and because 0 is rarely at the start of a number)


To complicate things, the wikipedia article adds that



0 and 1 were omitted to simplify the design and reduce the manufacturing and maintenance costs; they were chosen specifically because they were "redundant" and could be recreated using other keys. Typists who learned on these machines learned the habit of using the uppercase letter I (or lowercase letter L) for the digit one, and the uppercase O for the zero.



One might speculate that the 0 is placed where it is because of it's proximity to the O, but since the 1 was added down at the other end (nowhere near the I), it would have made just as much sense to put 0 down there too.


Almost every keyboard layout I've seen listed on wikipedia is this way, even the ones which don't use latin script at all. Only the Hungarian one (thanks, Gildas) puts 0 before the 1. This may be due to inheriting from latin-alphabet keyboards, though.



Anyone have an explanation for this oddity? Or specific sources backing up the yahoo theories?




Edit: Based on everyone's answers, I've done more research and come up with what I think is the logical explanation. I don't have specific sources to cite, though, so I'm still open to an "official" answer, if anyone has one.



Answer



Via further research, I've discovered that I was acting under a bad assumption. I had assumed that 0 and 1 became standard around the same time, but the very next section in the wikipedia article says:



The 0 key was added and standardized in its modern position early in the history of the typewriter, but the 1 and exclamation point were left off some typewriter keyboards into the 1970s.



It appears to be the IBM Selectric which really popularized the 1 in the '70s,





Given this 60+ year discrepancy between each key's appearance, I think I can come to a logical conclusion:


The 0 was placed next to the 9 either because of the proximity to the O (it would be easy for people already used to typing an O to type a 0 instead) or because it could be seen as 8-9-10 (and 0-2-3 doesn't make sense). Later, when the 1 was introduced, the only logical place for it was next to the 2, since it would make no sense to have 8-9-0-1 at the end of the row. And by that time, the 0 was fully established, so it couldn't be moved next to the new 1.


Tuesday, May 23, 2017

design patterns - Best Web UI for Large Amounts of Data Input


I'm looking for a good solution when users need to enter large amounts of data into a web application.


Example



  • A store owner wants to enter 30-40 new products into the system every month. The store owner has a spreadsheet of all the products, their quanities, prices, manufactures, contact information, serial codes, etc (probably about 10 different fields).


Right now I'm thinking some sort of grid view that allows the user to copy and paste data from say Excel or whatever spreadsheet applicaton they use.


What is the best web solution to allow the user to enter this much data (without having to enter each item individually)?



Answer




How about a UI to upload the spreadsheet file to be automatically processed by a database importing routine?


controls - Do spinner-based date pickers on iOS & Android detract from the user's experience?


Generally speaking, the rule of thumb on mobile devices is to follow the platform conventions, and that native controls are almost always better than custom UIs. However, I'm at a loss as to whether the spinner-based date pickets which are core UI elements on iOS and Android are really the best experience for the user in most cases.


iOS Date Picker Android Date Picker


As a user myself, I find these interfaces to be helpful when they're replacing plain text input -- e.g., if I know the date that I want to set. For instance, if asked for my birthday, this is the easiest interface to pick it. However, in cases where context matters -- like when I want to set a bill to pay 'next Friday' in my mobile banking app -- I don't believe this is an appropriate interface. In my opinion, this sort of exploratory/contextual situation typifies most date-based inputs that I encounter on my mobile device, so I do question the appropriateness of the native UI elements overall.


Here's a custom interface example from the Kayak app which is more effective than the native date picker, given the context:


Kayak Date Picker


Has there been any user research into the effectiveness these UI elements? Is there an argument for using these controls (even if they're not perfect in a given situation) due to platform consistency?



Answer



Your question assumes that



a) date pickers (they aren't called spinners) aren't appropriate everywhere,
b) date pickers can't be modified,
and c) the design guidelines must be followed to the tee.


Thus, I think the proper answer would be a review of SDK manuals & UX guidelines not in any kind of research.


First of all, guidelines are called that way instead of "rules" or "laws" because they're suggestions that cover most situations to ensure consistent experience across multiple apps in one platform. Even Apple's HIG contain rather mild language when it comes to telling developers what to do and what not to do:



If you need to provide a large set of choices that aren’t well known to your users, a picker might not be the appropriate control.



or




If it makes sense in your app, change the interval in the minutes wheel.



So if a native control doesn't provide the UX appropriate for the situation, you absolutely must put the user above the guidelines.


Secondly, both Android and iOS have native options of displaying either a full calendar or at least the day of the week.


In iOS, it's a property of UIDatePicker called UIDatePickerModeDateAndTime, which displays the day of the week in the spinner (screenshot of the native calendar app's new event, courtesy of my friend):


enter image description here


Android has something called android.widget.CalendarView, which displays the full calendar (screenshot of my CM9's native calendar app):


enter image description here


So, in summary, you absolutely can create your own controls that are appropriate to your application but it's best to research all of the native controls & their properties.


quant trading strategies - From a high frequency point of view, with a price prediction and assuming infinite leverage, how do you determine optimal trade size?



I have read about something like Kelly criterion for long term expectation maximization assuming a fixed starting bankroll. But if one can assume unlimited leverage, and one has a signal for a price movement..how could one go about deciding optimal trading sizes? It would seem to me like there are a lot of factors involved (things like transaction costs, inventories, etc..) - in practice would one come up with some intuitive model for this and run historical simulations for it? Or how would one tackle this? Is there any literature which I can read up on to understand this problem better?



Answer



There are few things to consider.




  1. Trading moves the price, to minimize market impact and maximize return it is generally optimal to split an order in several child orders. See the Kyle model.




  2. Splitting optimally dependents on specific assumptions that you make. The simplest (and first) approach is that of Berstsimas and Lo (Optimal Control of Execution Costs). Almagren improves on it considering more realistic price impact fuctions. You can find much of his work at his homepage. More recently, the focus has shifted to optimal submission strategies in the limit order book (e.g.: Obizhaeva and Wang) and to latency cost (for example see here).





  3. From a consistency perspective, the work of Jim Gatheral (No dynamic arbitrage and market costs) details some price impact functions that don't allow dynamic arbitrage (for example, "pump and dump" strategies). The high brow approach to these ideas is contained in the Econometrica paper by Stanzl and Huberman (Quasi-arbitrage and Price Manipulation). This area is expanding rapidly as several groups are working on expanding these results to limit order book markets.




Monday, May 22, 2017

derivatives - Why don't we take the differential to the Delta in the Delta hedge-portfolio


For option $V(S,t)$ with underlying asset $S$, we have a hedge portfolio $$\Pi = V(S,t) - \Delta(S,t)S$$ I always confuse here, when we take the differential of $\Pi$ $$d\Pi = dV -\Delta dS$$ why needn't we take the differential for $\Delta(S,t),$ I think it should be $$d\Pi = dV -d(\Delta S).$$ We call the delta-hedge self-financing, can any one show me a clearly reason?



Answer



Note: I have edited the answer so as to give a clearer interpretation of the self-financing condition.


Let us specify the notation: $C_t$ is the derivative price; $S_t$ the stock's; $B_t$ the bond's; $w_C(t)$, $w_S(t)$ and $w_B(t)$ the option's, stock's and bond's holdings respectively; $C_T=h(S_T)$ the option's payoff, which we assume is European, hence $T$ is the derivative's maturity.


First, the equation you wrote is not exactly correct, because as it has been explained a few times in this site you cannot get a self-financing portfolio by holding an option and simply adjusting the stock's holding: indeed, you cannot dynamically hedge one option only with $w_S(t)$ stock shares, because when time passes and $w_S(t)$ changes, the only way you can change your allocation $-$ your holding $w_S(t)$ $-$ is to inject or withdraw cash from your portfolio, hence you need more degrees of freedom $-$ more weights $-$ in your equation to avoid cash injections/withdrawals. Now, there are a few ways to view the situation:




  • You can form a self-financing portfolio made up of options and stocks, where the weights are selected so as to cancel all random terms. Because the portfolio is self-financing and also riskless, it must earn the risk-free rate, hence:


$$ B_t = w_C(t)C_t+w_S(t)S_t $$



  • You can form a portfolio with a holding of stocks and bonds which replicate the option. Hence your portfolio value must be equal to the option value at any time:


$$ C_t = w_S(t)S_t+w_B(t)B_t $$


Let us consider the second perspective, namely let us form a portfolio consisting of stocks and bonds that replicate the option:


$$ C_t = w_S(t)S_t+w_B(t)B_t $$


Now, why must the portfolio be self-financing? Think of yourself as the option writer $-$ i.e. seller $-$ and assume the option is sold at $t=0$ and that you are charging its fair value: your client is then paying you the option's premium $\pi$ today in exchange for which he is expecting you to settle the liability $h(S_T)$ at maturity $T$. Because you are charging the fair value of the option $-$ you can rationalize this assumption by considering that, in a liquid, competitive market environment, market participants will force option premiums to converge to their fair value, i.e. no arbitrage $-$ it implies that somehow you should be able to meet your financial obligation at $T$ by appropriately allocating the cash $\pi$ and only that sum: you shouldn't add or retrieve any cash throughout the life of the contract. In other words, the premium $\pi$ should be the required quantity to finance your liability $h(S_T)$ at $T$, hence it must be the case that this sum can be allocated dynamically to stocks and bonds throughout the period $[0,T]$ so as to have the value $C_T=h(S_T)$ at $T$ at your disposal to pay your client. Consider the alternatives to this situation:




  • You need to add cash to your position at some time $t \in [0,T]$: this would be a loss to you, something you want to avoid so you wouldn't do it. You will set $\pi$ so as to avoid this;

  • You can retrieve cash from your position at some time $t \in [0,T]$: you would be extracting value from your client. Because we have assumed we are in a competitive market environment, other option writers will charge lower prices and hence you will lose your client. You will be forced to set $\pi$ so as to avoid this $-$ if you don't want to lose your clients.


We have established that there shouldn't be neither injections nor retrievals of cash throughout the life of the trade. Therefore, this implies that the net impact of rebalancing the portfolio on the portfolio value must be null. Applying Ito's Lemma on $dC_t$, this is equivalent to verifying the following self-financing condition:


$$ S_tdw_S(t) + dw_S(t)dS_t + B_tdw_B(t) + dw_B(t)dB_t = 0 \qquad (1) $$


$(1)$ implies that the replicating portfolio evolves according to:


$$ dC_t = w_S(t)dS_t+w_B(t)dB(t) \qquad (2) $$


Namely, the portfolio value should only change due to fluctuations in the option's, stocks' and bonds' prices.


Now, this does not mean that $w_S$ and $w_B$ cannot change throughout the life of the trade: these are functions that tell us how many stocks and bonds we must hold at $t$ to be able to pay for $h(S_T)$ at $T$, and because $S_t$ and $B_t$ evolve through time so must their holdings. Therefore we should be continuously rebalancing our holding of stocks and bonds but the purchase of additional stocks (bonds) must always be financed by the sale of bonds (stocks), without any injection or subtraction of cash.



Finally, please note that equation $(2)$ defines a replicating, self-financing portfolio, but we always need to ensure condition $(1)$ is fulfilled: in other words, not only should we posit equation $(2)$, but we also have to make sure that $w_S(t)$ and $w_B(t)$ are chosen in such a way that $(1)$ is verified.


I recommend taking a look at exercise 4.10, "Self-financing trading", in Shreve's Stochastic Calculus for Finance II, where discrete time and continuous time cases are discussed and connected.


layers - How to reference a sublayer by name in an Illustrator script?



How can one reference a sublayer in functions like setLayerVisibility, that accept layer names as arguments?


I tried


setLayerVisibility("MyLayerName.MySublayerName", true)

, but that was ineffective.



Answer



the function may not be set up to look for sublayers, even if you pass the correct sublayer name. If it is, you can do something like...


var myLayer = app.activeDocument.layers["myLayerName"];
var mySublayer = myLayer.layers["mySublayerName"];


alert(mySublayer.name);

branding - What to ask client before designing a logo?


What questions do you ask a client before designing their logo? (preferred colour, font, references, etc) And how do you do it exactly? Do you use a template PDF questionnaire/Word doc/Google doc which you send to them? If you work for an agency, how would your agency handle this?





carousel - How many photos should be in a slideshow for mobile on page load?


We have a slideshow which displays one photo at a time. The user can click or swipe through back and forth. Right now we're loading in 10 to start, but there is no actual research behind the decision.


Given our site is not even in beta at this point, we have no real users to study. Is there a general user behavior that suggests X number of photos is best to load initially? Keep in mind we do have ajax pagination. If the average user looks at 20 photos and then stops, would it be best to just load 20 and avoid the extra server calls?




Sunday, May 21, 2017

print design - An error in printed book is my fault: what do I do?




I designed a kids' activity book for my client. She handwrote all the text correctly and I typed a sentence out incorrectly. She approved the proof before print but that was the 6th draft so I guess both of us were too tired by that stage to spot this error.


If it was her provided text, I wouldn't see it as entirely my fault. But I typed it myself from her correct notes so it is. Should I give a discount? A full refund? She's printing labels to put over the incorrect text. Should I at least pay for that?




usability - Tasks State Colors with Icons


I am currently trying to implement a task system that can have 5 "states". I've been playing with icons to differentiate between each, but also speculated that colors would be beneficial to include. Currently, I have what is displayed within the image below for icons and colors. Curious if these work or may be something more reflective of each?


enter image description here



Answer



This is kind of a loose fit for UX (and SE). But there is some general value here ...


Pending, in progress, and completed all look spot on for the message you're trying to convey. My concern would be open and cancelled in the context of task management.


Concerns with your system


Open in task terms is often thought of as "incomplete". I'm not sure how this compares with "pending" in the workflow you've designed, but it still feels like an important thing for the user.



Cancelled in task management often means "deleted because it's unnecessary". In that sense, it's not a particularly important thing. In fact, the user may not even want to see it again after cancelling.


If those two translations are correct, the visual prominence seems reversed.


Visual hierarchy and workflows


In any workflow-oriented system, you want to provide the user with visual reinforcement of the process. IOW, there should be a sense of value and hierarchy embedded in things like the icons.


In the case of task management, when a user looks at the task list they should immediately understand a few key things in a particular order (unless you've intentionally designed something new):



  1. Is anything behind?

  2. What do I need to do right now?

  3. Is there anything coming up that I need to be thinking about?

  4. What has been achieved recently?



Icons are used as a quick visual cue to get the user through those considerations quickly and effortlessly. Be certain that you're drawing attention to the right things in the right order to make the user's job as easy as possible.


How to use complex objects as clipping masks in Illustrator?


I am trying to make a clipping mask using a gold foil background and a mandala. When I try to make the clipping mask it says "The top object is very complex, and may fail the document to print or preview if used as a mask. Do you want to make it a mask anyway?". I click yes, and both objects dissappear. Could you help me on how to create clipping masks with complex objects?


Thank you!




black scholes - Log-normal Volatility Approximation


In a comment to this question, it is mentioned that, under the log-normal distribution, \begin{align*} vol(k) \approx vol(atm) \times \sqrt{\frac{atm}{k}}. \end{align*} Here, $k$ is the strike, $atm$ is the at-the-money strike, and $vol(k)$ is the implied volatility corresponding to strike $k$. I have difficulty to derive this approximation. Any suggestion is appreciated.



Answer




Page 3 of this document ad-co.com/analytics_docs/ALevin_QP_2012.pdf shows the result, originally given in Risk Magazine by Blyth and Uglum.


The intuition for the formula is given in my comment above. The original motivation for such a formula was for interest rate options in the 1990s. Everyone had a lognormal pricing model, but traders understood that the distribution of interest rates may be closer to normal. Hence we needed a formula to plug in the right lognormal vol into our models.


theme - is thematic character naming off putting?


Is naming a character to go with a theme or setting of a novel off putting for the reader? Does this pull them out of the story?



For example: A character named digit in a cyberpunk future or one named Alaster on a novel about Demons and the Devil?


or a whole slew of characters named after animals that live above or below ground in a dystopian future where people underground are at war with people above?


Are naming conventions like this too on the nose and make you as a reader roll your eyes? Or do they work for you and make the world/story more believable?


thoughts?



Answer



It's all about immersion. You need to make things realistic from an internal logic point of view. I agree with both mwo and Sara Costa, but the point they both miss is immersion.


Let me give you an example. Your story is set in Feudal Japan, your main character is Japanese. Her name is Jane Doe. Do you see something wrong with this?


The name must make sense in the context of what the parents of the character would want to name their child. It's a wish of sorts for their child. Sometimes it's about letting them stand out; "I'll call you Mahlahkhai! So no one can read your name and confuse you with someone else." Sometimes they want the child to carry on the family legacy; "John Baptiste VIII, it's a family name." Sometimes it's cultural; a French boy named Jacques, and his sister Fleur. Sometimes it's time related; Dale being a girl's or boy's name dependant entirely on when the name is given (as an example, because I have a male cousin named Dion, and a female cousin, his sister, named Dale).


Figure out what the common thread would be of the time, and either consciously go with it, or consciously go against it. Even if the reasons for either are not readily apparent.


As another example, from my own story I'm working on. Fraternal twins, brother and sister, are named Ina Miyo (Ina being the family name, given their mother is Japanese), and James Tessier (Tessier being the family name, given their father is French/Arabic). There's so much being revealed about them via their name, for so many reasons. But these aren't reasons that are readily apparent, they are delved into one step at a time.



So what do the fictional parents want this child's name to say about them? That they fit in with their peers? That they were destined to stand out? And to build on Sara Costa's point, their handle name (or nickname) is also very important. That is a conscious choice by someone to see this person in this light.


Saturday, May 20, 2017

gimp - put partly transpared photo on top of panorama


What is it nessesary to do if I want to see just black edges from background image in image placed on top?


Here are links to source images <a href=panorama
"> <a href=photo">


This is what I want to create:


<a href=Here">



You can see there are edges from background panorama mountains in picture on top.
Any ideas, please?




interaction design - App interface for changing relational percentages


Has anyone ever seen or used a good app interface (web or mobile) for changing relational percentages? E.g I need to change 3 amounts to make up £100 and I need to be able to use any permutation to do it.


Only approach I can think of is sort of slider, where you could click and drag dividing lines between pots of money to adjust the amount in each pot. Labels inside the lines would need to update dynamically to show the updated amount in each pot:


enter image description here



I'm not massively happy with this solution though, and I also need to be confident it would be usable if the number of moneypots changed to 10, for example (I don't know the maximum number of pots at the moment but am assuming it wouldn't go beyond 10).


Any suggestions gratefully received!




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