Wednesday, October 16, 2019

How can I reduce the file size of a JPEG keeping the same image width and height?


I have a 700Kb JPEG file (white cardboard texture) that I'm using as a background on a website.


A file this large takes too long to load for snappy page hits. I don't need the full resolution, a reduction in image quality is fine, but I do need to keep the JPEG the same size (to fill the entire screen).


What would be a good free PC or web utility that would allow me to modify a JPEG as described? I'd rather not use Photoshop or other professional software.




quant trading strategies - The Definition(s) of Momentum


I am currently studying the Momentum strategy and its differences in results (returns) when we change the formula describing momentum. There are indeed no accurate formulas for implementing the momentum strategy in an investment fund.


For example, you can use the last close price minus the first close price of the last 6 months (or 1 month); but you can also use the average of the last 6 months prices minus the average of the last 7 days prices.


There are a few examples of definitions/formulas like that.


So I have the purpose of testing a lot of those formulas using a MATLAB code, but I can't find those definitions, especially recent and creative ones.


So if any of you has a link or a list with all those different formulas/definitions, or even any thoughts regarding a recent and decent momentum formula, that would be great.


EDIT: I would like to add more explanation regarding my request.



--> I am looking for more "unofficial" definition of momentum (exactly the opposite of those I gave as an example see above). In other words, definitions that are different from the classic definition of Jegadeesh & Titman




  • An example of a creative, and unexpected definitions would be the "physical price momentum" found in the article "Physical Approach to Price Momentum and Its Application to Momentum Strategy" (Jaehyung Choi, 2014). In this article, they use the momentum definition from physics litterature, and compute the momentum returns in S&P500, by using it... and receive larger return than with the "traditional" momentum definition.




  • Another example is from the article "Eureka! A Momentum Strategy that Also Works in Japan" (Denis B. Chaves, 2012) that uses the idiosyncratic returns from market regressions for his own definition of momentum.





Answer




Kenetic Component Analysis


If I am to summarize the work of the authors from a broader view than that which is taken in the abstract, essentially the price process is decomposed into position, velocity and acceleration reminiscent of projectile motion in classical mechanics.


I added this as an answer so that if @Pierre wants to accept it he may.


Tuesday, October 15, 2019

creative writing - Is it true that a great cover is enough to sell many copies of your book


I've come across podcasts and internet articles about self-publishing in which they basically say that books with fantastic covers and interesting blurbs tend to sell lots of copies even if the actual writing is substandard.


And there is also this article I recently stumbled upon that blatantly outlines in the quoted text that some people buy books based on the cover alone (and perhaps a quick cursory glance at the blurb):



The general evaluation process goes something like this:


Click on book because of cool, relevant cover.

Scroll down and read the tagline/first few words of the blurb.

Leave, click buy, or read a few reviews.


OR

Leave, click buy, or read the sample.

OR

Leave or click buy.

In other words, a strong cover and blurb can sell your book.




My question is: Is it really true that many ebook buyers are silly enough to purchase a book simply because of its cover (and blurb) without first sampling the actual writing inside the book? I find this hard to believe.But yet this is the impression or outright assertion that is often made when I hear people talk about the enormous importance of great covers for selling books.




fiction - How to refer to clothes without modern words ? (e.g: t-shirt)


This is a constant struggling point of mine. Most of my settings take place in fictional worlds often inspired by various parts of human history.


For instance, one of my stories is located in an Ancient Egypt inspired world. (EDIT : My setting is only based on Ancient Egypt and the clothing is not accurate to what it really was like back then. My characters wear anachronistic clothes.)


In these worlds I am creating, people, well, obviously, wear clothes. Although description is far from being one of my writing strengths (I avoid this weakness by making it part of my style that I don't describe much), I almost always picture very clearly in my head the characters and the way they dress up. In fact, as I am not so bad at drawing, I even use to draw them and their outfits.


The thing is, well, I can't — and it would be stupid to try — ever avoid describing things. Sometimes, it really is important to explain the reader some details he cannot invent by himself. While just writing descriptions is a little problem in itself for me, the worst part of it is describing outfits.


Words like t-shirt, for instance seem really out of place in fictional and not futuristic worlds, like the Egyptian one I mentioned above. But when what my character wears is basically a t-shirt, how do I describe it?


Also I have to mention that I write in French and we use the English words t-shirt, shorts, sneakers or pullover as is, which seems even wronger when used in fictional worlds. But not only English words cause me problems: scarf, for example, for which we have a French word, seems out of place when describing a long piece of cloth the character is wearing around his neck, but not to keep him warm (when in the Egyptian setting it is even worse). Even trousers is weird in some settings.



A trick I often use for lack of a better way is to blandly refer to clothes with very generic words like haut (French for top):



He was wearing a white top and a long piece of cloth around his neck.



See the above example. It is really generic and doesn't tell me much about, for instance, the length of the sleeves of the said top. Or basically anything about it. Moreover, if I have to describe several characters' outfits at once, it quickly becomes boring and makes it harder for the reader to see the characters in their mind.



[Character1] was wearing a dark blue top and a long bottom1. [Character2], however, had a long piece of cloth around his neck and a red top with long sleeves. His bottom1 was short and stopped just above his knees.




1 Not sure this word can be used in this context in English. Sorry if not.




Where I could have just said:



[Character1] was wearing a dark blue t-shirt and and a pair of trousers. [Character2], however, had a scarf around his neck, a red pullover and was wearing shorts.




(Dumb example with dumb clothing)



Well, this is it. I'm sure there is no best way but I'd like to know what techniques you employ to describe clothes similar to ours in fictional words where the modern words we use seem out of place.


I'm writing in French but I believe the problem is quite the same, although even worse in my case.




forms - Are we stuck with the "Forgot password" link?


The convention for forgotten passwords seems to have stranded on the following:




  1. Click a link under the Password input field saying "Forgot password"

  2. Enter your email address and click "Send password"

  3. Click the link in the email to create a new password.


I'm trying to think of a way to lose the "Forgot password" link. My ideas so far are:



  • A) If the user logs in with the incorrect password, send him the reset password link.

  • B) If the user logs in with no password, send him the reset password link.


The problem with A is that the user will get some unnecessary emails, if he just needs a few attempts at remembering his password by heart.



The problem with B is that you have to tell the user to leave out the password. And that quickly takes up more space than the "Forgot password" link.


(You could say after the first login failure: "Leave password field blank to create a new password". But would most people make at least one attempt at logging in before realizing they don't remember their password, or are their minds just blank from the start so they won't even have a go at it?)


Are we stuck with the "Forgot password" link, or can anyone come up with a better solution?


EDIT: The original post actually said "send password", whereas I obviously meant "send reset password link". How embarrassing :)




What's the best way to show form labels that are longer than the corresponding fields (which require a short input)?


I'm having trouble with labeling of short input fields. Some labels have standard 280px width approximately, but others are quite small in order to offer clues on the expected input (characters).


I'm working with top-of-field labels, aligned vertically.


Users are very familiar with the different input fields, though, the form is prone to human errors, since the users fill them while talking on the phone, in a hurry, etc., so I want to show precise labels, and tooltips only to clear some additional info, but not to complete the text in the labels.


Problems I'm facing:




  1. There are lots of similar labels, so I cannot cut the text in the labels (amount spent in USD is different from amount received in EUR...)

  2. I'm not sure to change placement of the fields to the right of the labels, precisely because there are going to be very long labels. And I believe top-of-field labeling could be the best approach.

  3. Two lines of text for a label could be suitable for some fields, but not for a shorter field (say, three-character input field)

  4. Tooltips are necessary in several cases, and even if the label is short, the tooltip will increase the label's length.


Here is the example of the form


and the possible solutions, with the respective problems I see


Thanks for your advice!


EDITS on POSSIBLE SOLUTIONS: I've considered some suggestions, but still not convinced on the best solution to offer readable alignment, clear labels, realistic field length for visual clues. First round of attempts





Monday, October 14, 2019

fiction - How/When to include twists when developing plot.


Disclaimer: This is a new question, not an extension of my other questions concerning twists.


When I develop fiction, I start with a premise and a theme. I have a general idea of where I'm headed, and the events that get me there. I add in character and stakes, which help flesh out the story until I have a fairly detailed outline of the book. And then I arrive at the plot, and the twists/complications.



Unless I plan on it from the beginning, my plots at this point have no twists in them, and very few complications, none of which are intentional. And of course since the events are already detailed and sorted, inserting a twist - which turns the plot in a different direction - will mean I will have to completely redo most of the events (I generally know what the climax and resolution will be already). And if I want more than one twist, I will have to redo them several times. I would prefer to be able to have twists without rewriting the outline several times.


The obvious answer to this problem would seem to be to incorporate twists first, before any other development. The problem is that the other development is what makes most of the story - the thing that gets twisted, in other words. Hence my question:


At what point during development do I add in twists/complications? And how can I do so when I already know how I want things to end?


Note: This question is based on my understanding of a twist as something unexpected, which affects the current situation and may change the outcome, possibly of the entire story.



Answer



Try plotting backwards.


The writers of House, MD often worked this way. They figured out some esoteric disease or ailment (or perhaps something not so esoteric but easy to confuse with other problems) and then worked backwards to lay red herrings and misdirection.


So you have the ending you want (heroine gets macguffin). Work backwards from there. Each branch point offers you some places to put twists and complications.



  • How does she get into the building with the macguffin?


  • How does she reach the building?

  • How does she find which building it's in to begin with?

  • How does she know it's in a building? (As opposed to a ship, a temple, a bank, a house, on the road, etc.)

  • Who told her about the macguffin?

  • How did the macguffin get lost?

  • Why is the macguffin important?


You get the idea. You may have to rough out your (non-complicated) plot forwards first to figure out where the branch parts are backwards, but it's a lot easier to put in a misdirection when you've already gotten to the ending.


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