How to create my own autocomplete function?

Question: How do I create my own list of auto-completion for certain filetypes?
For example I would like css and html to autocomplete from the list of css classes in FontAwesome.
Answer: Dictionary completion would be a cheap and non-intrusive solution:

save fontawesome.txt somewhere on your machine,
put this in after/ftplugin/css.vim (create the file if it doesn't exist):
setlocal complete+=k
setlocal dictionary+=/path/to/fontawesome.txt
setlocal iskeyword+=-

start a new session or do :e in a CSS buffer to forcefully source the file above,
press <C-n> or <C-p> in insert mode,
enjoy!

Reference:
:help ins-completion
:help 'complete'
:help 'dictionary'
:help 'iskeyword'

Answer: EDIT Thanks to romainl's comment I've edited my answer to show how to create a user-defined completion function. In the previous version I was overriding the buil-in omni-completion which wasn't good because the user would have loose the default completion which is pretty powerful.

A vimscript solution
One solution is to use vimscript and the fact that vim let's you create a customized completion function.
The advantage of this solution is that you don't need an additional plugin you can simply create a user-defined completion function and use the built-in completion feature.
I'll use your example of the fontAwesome classes in css files:
Create the file ~/.vim/autoload/csscomplete.vim and put the following lines in it:
let s:matches=".fa-lg .fa-2x .fa-3x .fa-4x .fa-5x .fa-fw .fa-ul .fa-ul .fa-li .fa-li.fa-lg .fa-border .fa-pull-left .fa-pull-right .fa.fa-pull-left"

function! csscomplete#CompleteFA(findstart, base)
    if a:findstart
        " locate the start of the word
        let line = getline('.')
        let start = col('.') - 1
        while start > 0 && (line[start - 1] =~ '\a' || line[start - 1] =~ '.' || line[start - 1] =~ '-')
            let start -= 1
        endwhile
        return start
    else
        " find classes matching "a:base"
        let res = []
        for m in split(s:matches)
            if m =~ '^' . a:base
                call add(res, m)
            endif
        endfor
        return res
    endif
endfun

Then create the file ~/.vim/after/ftplugin/css.vim and put in it the following line:
setlocal completefunc=csscomplete#CompleteFA

Then you can trigger your user-defined completion function with <C-x><C-u>. It will try to find a match to the last typed word.
In the screenshot I typed .fa-l and then triggered the function with <C-x><C-u>:

How does it work?
First here are some relevant documentation topics:

:h complete-functions
:h 'completefunc'
:h i_CTRL-X_CTRL-U
A great answer about the organization of files.

If you want to create a custom completion for a particular filetype you have to put it in the file $HOME/.vim/autoload/{FILETYPE}complete.vim.
Then in this file you have to create your completion function which is called twice:

On first call its first argument is the current position of the cursor and the function will determine the word to complete. In my function I used 3 comparisons to get the word to complete because the class can be composed of letters, . and - (I think it is possible to improve this matching but I'm really bad with regex)
On second call the second argument is the word to match and then the function compares it to the list of possible classes to match 1. Here you see that I return a dictionary which will populate the completion menu but when you'll read the documentation you'll see that you can create a much more complex dictionary to customize even more the behavior of your function.

You also have to tell to Vim "for this kind of file, use this complete function I created". To do so you have to set completefunc to the name of the function you created (here csscomplete#CompleteFA) and this setting must be done in the file $HOME/.vim/after/ftplugin/{FILETYPE}.vim.
1 In my function the variable s:matches contains all the possible matches. Here I only put some suggestions for readability but you can put all the classes offered by FontAwesome (You can find the complete list in this file created by romainl).

What if I don't like Vimscript?
One possibility is to use the plugin YoucompleteMe which offers an API to play with the completion menu. You can create python function which will do the matching job and will use the API to populate Vim interface. More details here.
Comment: The default omni completion for CSS and HTML is already quite useful and you can only have one at a time so I would suggest using "user-defined completion" instead. See `:help i_ctrl-x_ctrl-u`.
Comment: @romainl: You're absolutely right, I'll see how to adapt my answer.
Answer: Sometimes you want a custom auto-completion that doesn't interfere with any of
the built-in or user-defined autocompletions at all. This is especially useful
for scripts or plugins that are intended to work for a wide range of filetypes.
This can be done fairly easy with the
complete()
function and a simple wrapper; most of the procedure is the same as described in
:help complete-functions
and Statox's answer, except that you need to define your own mappings and have
to call complete() yourself instead of returning a value.
Here is a basic example, the comments should explain how it works.
" Map <C-x><C-m> for our custom completion
inoremap <C-x><C-m> <C-r>=MyComplete()<CR>

" Make subsequent <C-m> presses after <C-x><C-m> go to the next entry (just like
" other <C-x>* mappings)
inoremap <expr> <C-m> pumvisible() ?  "\<C-n>" : "\<C-m>"

" Complete function for addresses; we match the name & address
fun! MyComplete()
    " The data. In this example it's static, but you could read it from a file,
    " get it from a command, etc.
    let l:data = [
        \ ["Elmo the Elk", "email@example.com"],
        \ ["Eek the Cat", "email@example.com"]
    \ ]

    " Locate the start of the word and store the text we want to match in l:base
    let l:line = getline('.')
    let l:start = col('.') - 1
    while l:start > 0 && l:line[l:start - 1] =~ '\a'
        let l:start -= 1
    endwhile
    let l:base = l:line[l:start : col('.')-1]

    " Record what matches − we pass this to complete() later
    let l:res = []

    " Find matches
    for m in l:data
        " Check if it matches what we're trying to complete; in this case we
        " want to match against the start of both the first and second list
        " entries (i.e. the name and email address)
        if l:m[0] !~? '^' . l:base && l:m[1] !~? '^' . l:base
            " Doesn't match
            continue
        endif

        " It matches! See :help complete() for the full docs on the key names
        " for this dict.
        call add(l:res, {
            \ 'icase': 1,
            \ 'word': l:m[0] . ' <' . l:m[1] . '>, ',
            \ 'abbr': l:m[0],
            \ 'menu': l:m[1],
            \ 'info': len(l:m) > 2 ? join(l:m[2:], "\n") : '',
        \ })
    endfor

    " Now call the complete() function
    call complete(l:start + 1, l:res)
    return ''
endfun

Comment: A small but important correction: `let l:base = l:line[l:start : col('.')-1]` should be `let l:base = l:line[l:start : col('.')-2]`. If I understand correctly, the `-2` is due to two things: (1) 1- to 0-based indexing, and (2) the cursor being to the right of the text to be completed. If only `-1` was used, completion would not work as expected if there are characters to the right of the cursor.... In any case, a helpful answer that allowed me to create my own custom completion on two occassions :)


What does this "Forfeiture of the right of withdrawal" section mean in a Terms of Service agreement?

Question: My client has asked me to sign up for toggl.com so they can do their taxes. However, I saw this alarming section in the Terms of Service and am now unsure as to whether it is a good idea to sign up:

Forfeiture of the right of withdrawal

4.1 The User hereby requests that the Supplier's performance of the Agreement commence immediately and that the benefits to which the User is entitled hereunder, including, where applicable, the Features authorised under his Service Plan(s), be made available to him immediately. The User acknowledges and agrees that by making the above requests he loses the right (if any) to withdraw from the Agreement and, where applicable, the right to withdraw from the Service Plan(s) in question.
The User further requests that the Features to be authorised under any future Service Plan he may obtain be made available to him immediately upon the Service Plan's commencement. The User acknowledges and agrees that by requesting this (and the respective Features becoming available to him) he loses the right, if any, to withdraw from the Service Plan.

It sounds like they are saying that if I sign up for the service then I am agreeing to never end it. However, there is also a section about Termination that apparently says I can end it:

Termination
19.1. In this article, the term "Agreement" means the Agreement referenced in subsection 2.1(a) and words such as "herein", "hereto", "hereof" and "hereunder" refer to that Agreement, unless otherwise specified.

19.2. The Agreement between the Supplier and a Customer can only be terminated by closing the Customer's User Account. For the avoidance of doubt, where the Customer has more than one User Account, closing an account will only terminate the Agreement pertaining to that account.
19.3. The Agreement between the Supplier and a User other than a Customer can be terminated by notice to the other Party or, if giving notice to the User is impracticable or would result in unreasonable delay or expense, then by the Supplier's ceasing all activities hereunder, except those which are necessary for providing the Service to another User, the protection or enforcement of the Supplier's or other parties' rights, freedoms or legitimate interests, the exercise of the Supplier's statutory rights or freedoms, or to comply with a legal obligation.
19.4. To close his User Account, the Customer must log in to the account, choose "close account" under "profile settings" and confirm that he wishes the account to be closed. However, it should be appreciated that Features (including the appearance, titles and location of menus, tabs, fields, buttons, icons and other objects displayed on the Service) are subject to change, meaning that the steps required of the Customer to close his User Account may vary from time to time. The Supplier will endeavour to keep this procedure as straightforward as possible and will update the Documentation if any changes are made thereto. If the Customer has difficulties closing his User Account, he should contact the Supplier and follow its instructions.
19.5. Either Party may close the Customer's User Account and shall by so doing be deemed to have terminated the Agreement (which, in the civil law context, means 'cancellation', not 'withdrawal'), effective upon the closure of the account, provided that: (a) if the User Account is closed by the Supplier, the Customer must be given at least a month's notice thereof (unless section 19.6 or 20.5 applies or the User Account is closed at the Customer's request); and (b) where the User Account is closed by a Party entitled to withdraw from the Agreement, such Party has failed to notify the other that by closing the User Account he is exercising his right to withdraw (which notice must be served prior to or concurrently with closing the User Account and shall result in the Agreement being deemed to have been terminated by withdrawal).
19.6. Upon a Party's material breach of Agreement the other Party may terminate the Agreement forthwith. Without prejudice to any statutory provision as to what constitutes a material breach, such a breach hereof shall be deemed to have occurred if a Party, having breached any of his principal obligations hereunder or under the Agreement referenced in subsection 2.1(b), fails to discontinue or remedy such breach within 14 days (or, where exceptional circumstances render this period unreasonably short, such longer time as reasonably required) after notice from the other Party specifying the breach and requiring it to be discontinued or remedied.
19.7. Any termination hereof will terminate all Agreements that the User may have under subsection 2.1(b), except that, if the User is a Customer with more than one User Account, the termination will not affect his Agreements under subsection 2.1(b) in relation to Service Plans whose benefits he is entitled to enjoy by reason of a User Account other than the one being closed.
19.8. The termination of a Service Plan terminates the related Agreement under subsection 2.1(b).
19.9. The Agreement under subsection 2.1(c) will only terminate as described in subsection 2.3(c) (with automatic re-establishment of contract) or upon the relevant Organization being closed, and is incapable of being terminated otherwise. Instructions on how to close an Organization are provided in the Documentation.

With this context, what is the plain English meaning of the Forfeiture of the right to withdrawal section?
Answer: Section 20 - Consumer withdrawal has more information.
The 'right to withdraw' refers to a consumers ability to ask for their money to be returned, for say faulty goods, and there is usually a time limit.
The toggl clause 4 states that if the customer requests that the features of a product are activated immediately, then the right to withdraw is forfeited, as the customer has already received the benefits from the product.


Android Sync Adapter Intervals

Question: I require a data sync once per day for an Android application. I've been using Sync Adapter which has been very useful. I want to sync the data only once per day (at no specific time). I'm using the addPeriodicSync() method.
My problem is that users are only likely to enter an area with internet access for very short periods at different times of the day (sometimes not in internet access areas for days at a time). I have the sync interval at 1 day, will the sync process be run as soon as the internet becomes available? or will it only attempt to sync when the period sync timer is triggered?
Additionally, are there any options to enable/disable 3G/Mobile internet syncs?
Answer: Yes by design sync adapters will queue all sync request in absence of network , also if user asks for manual sync when auto sync is already in queue then it will handle it . That's the beauty of sync adapter design

Android Sync Adapter Intervals


Is there a way to Use Windows 2008 Backup to FTP

Question: Is there a way to use windows backup in Windows 2008 to store to an external FTP server?
Answer: Not by itself.  You can automate uploading the file to an FTP server by calling ftp.exe and giving it the -s switch with a file which includes the commands to upload the backup file.
Answer: Normally Windows Backup does not have direct FTP support. Novell has a now inactive application/driver by the name of Netdrive which will connect to a FTP server and present a drive letter to that connection.
http://www.novell.com/documentation/oes/pdfdoc/netdrive/netdrive.pdf
The FTP drive letter can then be used as a backup location for Windows Backup.
Netdrive itself is a little bit hard to find on the Novell site and its licensing is not necessarily clear these days.


When is it good to use embedded script language like Lua

Question: I'm playing WoW for about 2 years and I was quite curious about Lua which is used to write addons. Since what I've read so far about Lua was "fast", "light" and "this is great", I was wondering how and when to use it.
What is the typical situation where you will need to embed a script language like Lua in a system ?
Answer: When you need end users to be able to define/change the system without requiring the system to rewritten. It's used in games to allow extensions or to allow the main game engine to remain unchanged, while allow content to be changed.
Answer: Embedded scripting languages work well for storing configuration information as well. Last I checked, the Mozilla family all use JavaScript for their config information.
Next up, they are great for developing plugins. You can create a custom API to expose to the plugin developers, and the plugin developers gain a lot of freedom from having an entire language to work with.
Another is when flat files aren't expressive enough. If you want to write data driven apps where behavior is parameterized, you'll get really tired of long strings of conditionals testing for config combinations. When this happens, you're better off writing the rules AND their evaluation into your config.
This topic gets some coverage in the book Pragramtic Programmer.
Answer: Lua is:

Lightweight
Easy to integrate, even in an asynchronized environment such as a game
Easy to learn for non-programmer staff such as integrators, designers and artists

Since games usually require all those qualities, Lua is mostly used there. Other sitation could be any application that needs some scripting functionality, but developers often opt for a little more heavy weight solution such as .Net or python.
Answer: In addition to the scripting and configurability cases mentioned, I would simply state that Lua+C (or Lua+C++) is a perfect match for any software development. It allows one to make an engine/usage interface where engine is done in C/C++ and the behaviour or customization done in Lua.
OS X Cocoa has Objective-C (C and Smalltalk amalgam, where language changes by the line). I find Lua+C similar, only the language changes by a source file, which to me is a better abstraction.
The reasons why you would not want to use Lua are also noteworthy. Because it hardly has a good debugger. Then again, people hardly seem to need one either. :)
Answer: a scripting language like Lua can also be used if you have to change code (with immediate effect) while the application is running. one may not see this in wow, because as far as i remember the code is loaded at the start (and not rechecked and reloaded while running).
but think of another example: webserver and scripting language - (thankfully) you can change your php code without having to recompile apache or restart apache.
steve yegge did that thing for his own mmorpg engine powering wyvern, using jython or rhino and javascript (can't remember). he wrote the core engine in java, but the program logic in python/javascript.
the effect of this is:

he doesn't have to restart the core engine when changing the scripts, because that would disconnect all the players
he can let others do the simpler programming like defining new items and monsters without exposing all the critical code to them
sandboxing: if an error happens inside the script, you may be able to handle it gracefully without endangering the surrounding application
Answer: Rapid development for application with real-time constraints. Computer games are one of these ;-)
Comment: other non-game apps using Lua both for extensibility and for making it easy to develop/refactor: apt, nmap, monotone, Adobe LightRoom, love2d, wildpockets
Answer: It's a valid solution if you want to allow third parties to develop plug-ins or mods for your software.
You could implement an API in whatever language you are using, but a script language like LUA tends to be more simple and accessible for casual developers.
Answer: In addition to all the excellent reasons mentioned by others, Embedding Lua in C is very helpful when you need to manipulate text, work with files, or just need a higher level language. Lua has lots of nifty feature (Tables, functions are first class values, lots of other good stuff). Also, while lua isn't as fast as C or C++, it's pretty quick for an interpreted language.


Why my following question was closed?

Question: This question of mine has been closed. Can I know the reason?
Answer: You can see the reason for closure by clinking on the link you provided: What is an art? When an act becomes an art? what is it's length & breadth?
It was believed by those voting to close as "off-topic".
Here are more details: "While this question may be related to philosophy or occur in a philosophical context, the question itself doesn't seem to be about philosophy, and is therefore not a good fit for our site."
If you want to pursue this, you might edit the question and try to get it reopened or write a new question.

Why my following question was closed?


Is "behind" the correct use

Question: When I spell my name, I usually say it's "Marie" with "ke" behind it. (My name is Marieke, I'm from Holland). Is this correct? I just think of it as the first letter of a word is in front so the following letters are "behind", however my husband disagrees. I could well be wrong as English is not my first language. Can you help?
Comment: It certainly is about English language and usage.
In English one usually says _after_ when referring to spelling letters out. _Behind `X`_ is reserved for referring to `X`'s that have a front and a back (_behind the painting_), or which are blocking one's view (_behind the tree_), or both or either (_behind the house_). This is at least two-dimensional, while letters in a row are one-dimensional and use a motion metaphor, so _after_ is preferred.
Comment: This question appears to be off-topic because it is not about English language or usage.
Comment: _after_ or _at the end_.
Comment: If it works, and they spell it correctly after these instructions, then you are doing it correctly. There's no right or wrong way to tell someone how to spell your name, just effective or ineffective ways.
Answer: I'd prefer followed by rather than behind:

It's Marie followed by K E.

The suggestion by outrightmental of then is reasonable, but there's a chance that then might be misheard as enn (i.e. the letter N).
Answer: Behind is about visibility. In your case, use followed by ke or ke at the end would be better.
Answer: From a native Chicagoan living in Brooklyn, NY, I recommend addressing an English speaker with:

It starts with Marie, M - A - R - I - E then K- E.

Note how I used the word "then" in my delivery.  So you can rely on the listener to know how to spell "Marie" as you mention in your question.  Nice name, btw!
Answer: I would say, "My name is Marieke.  It is spelled like Marie and then a K and E at the end."
I am assuming two things.  That in your culture the name Marie is common and it is pretty much always spelled M A R I E (and it is pronounced the same).  And that you give them your full name first so that they have context.

Is "behind" the correct use


Is there a point to set up passwords for services like MySQL, Redis etc. if we disable their related ports?

Question: Redis' default port is 6379 and MySQL's default port is 3306. Let's say we disable these ports to outside of the world with ufw. And let's say only I have access to the servers. Is there still a point to set up passwords for services like that? Personally I can't see any. Thanks!
Comment: Perhaps, if you have web server which is connected with your mysql server and web server gets compromised, the security of mysql server could be compromised too if they are on the same server
Answer: Security is all about defense in depth. Most breaches happen not because someone left a door open, but because a number of small vulnerabilities can stack up to make an unexpected and much larger problem. What if you accidentally make a mistake in your firewall configuration? What if someone gains physical access to your network? There are a lot of "what-ifs" that can happen that can make your assumption - "no one else is on my network" very questionable.
I can't find the article at the minute but I remember reading about some ATM attacks that allowed hackers to withdraw hundreds of thousands of dollars from ATMs in southeast Asia. The attacks started with the attackers hacking into the London offices of the bank, and from there to move laterally through the network and eventually access the ATMs in southeast Asia due to lack internal Network security on the part of the bank. Better security In just one more place might have stopped the whole thing, but the bank assumed that they only had to worry about external security.
The point here should be obvious. If you only have one line of defense you are fine up until that line of defense is breached. With multiple layers of defense you improve the odds that even if there is a sscurity failure in one place your systems may stay secure.
Of course, security is not an absolute concept. Perhaps there is not anything of any real value in your MySQL server. Perhaps you have regular and reliable backups in place so that even if a hacker maliciously drops your data just because they can, you can be back up and running in no time. Maybe this is just a personal project so there is nothing at stake anyway. I don't know what your systems do, and if it is nothing important and you are willing to risk intrusion to make managing your systems easier, then that is certainly a choice e you can make.
Answer: To add up on Conor previous answer, even if the mysql port isn't open, it might be vulnerable at some point as a privilege escalation vector. Meaning that if an attacker has found a way into your system, he might use a known (or zero day) vulnerability to compromised your mysql server potentially leading to a privilege escalation (i.e gaining root).
There are a lot of exploit/PoC available publicly that are exploiting MySQL or other SQL/NoSQL servers..


Is interval always related to a scale?

Question: Is music interval always a concept in terms of scales and do we always have to take the first note as tonic? What would be the interval between D note and E note in C major scale?
Answer: No. Intervals can be used whenever talking about the distance between two notes. They come up a lot when talking about scales, chords, and melody.
The first note described an interval is not always the tonic in fact I would say in most cases it's not how it would be described. It's just a point of reference and your last question shows why this is not the case. D to E is always a Major 2nd regardless of context. Whether you are looking at it in the C Major scale, a Dsus2 chord, or just encountering a D up to an E in a melody.
Comment: @LaurencePayne it addresses each of the questions asked.
Comment: I think you're addressing a different question. This is just about NAMING intervals.   See my answer in this thread.
Answer: The confusing part with intervals is how they're named. It gives the impression that they could be related to major or minor scale notes. However, with intervals, major means bigger, and minor means smaller.
C>D is called M2, and so is D>E. They just happen to also be in C major scale. E>F, though, is only one semitone difference, so it's called m2.
Intervals always use the lower note as the starting point, and count up letter names initially. Then the number of semitones is taken into consideration. Thus - C>A. CDEFGA - 6 letter names, so it's a 6th. With 9 semitones between, it's called a major 6th (M6) If the note is Ab, the gap is smaller, so it's called minor 6th (m6). Make it Abb (that's not G) it's called diminished 6th. Make it A# (not Bb) and it's an even bigger gap, of 10 semitones, and it becomes augmented 6th (+6).
Note that 4ths and 5ths are generally perfect, and making the gap smaller gets them the title diminished; making the gap bigger, augmented.
It stands to reason then, that two same-sounding intervals can have two different names. C>Eb is a m3, but the same sounding C>D# (in 12tet) will be aug2.
We don't have to take the first/lower note as tonic, but I find it easier to calculate that way, regardless of what key the interval may be written in. That way, I know pretty quickly if it's major, minor or perfect. If not, then what's happened to put it 'out of key', imagining that the bottom note is the root of the key I'm thinking in. But others either just 'know', or calculate cold.
Answer: I think you're just asking about the NAMING of intervals?  Yes, the name of a musical interval is absolute.  It is derived from the number of letter names encompassed, and the relationship of the upper note to the major scale starting on the lower.  D to E is a major 2nd - and the easiest way of confirming this is to think of a D major scale.  And that's it, no matter whether the interval occurs as 1 to 2 in D major, 2 to 3 in C major or 7 to #1 in Eb major, it's still a major 2nd.
A similar question is sometimes asked about chords.  "What notes are in D major chord when the tune's in the key of Bb minor?"   Same answer.  D major is D, F#, A - whatever key the piece is in.  (It would be a pretty outside chromatic chord in Bb minor, but that's another matter!)
Answer: It appears to me that you're confusing two notions: internvals and degrees. This is a very common mistake.
Intervals
An interval is the distance between 2 notes. It is not related to any scale. For example:
The distance between D and E is a tone. It is also refered to as a major second.
The distance between B and C is a semitone. It is also refered to as a mminor second.
The distance between F and B is a tritone. It is also refered to as an augmented fourth.
Degrees
Degrees are, on the other hand completely related to a scale! It is the relative position of the notes in the same scale.
For example, in a diatonic scale, we have:
I: tonic
II: super tonic
III: mediant
IV: sub-domninant
V: dominant
VI: sub mediant
VII: leading tone (in french: sensible)

The link between the two
Now that you make a clear distinction between these two notions, you can connect them super easily in terms of intervals between two degrees. For example:
The interval between the tonic and the mediant is a third.
The interval between the dominant and the sus-dominant is a second
And so on...
Comment: Rather a lot of errors in this answer I'm afraid.  Both in naming the degrees of the scale and in calling the tritone B-F an augmented 4th.   B,C,D,E,F.  Five letters.  It's GOTTA be some kind of a 5th!  And don't forget 2nds, 3rds 6ths and 7ths can be diminished and augmented as well as major or minor.
Comment: Possibly lost in translation, but tonic, super tonic, mediant, sub-dominant, dominant, sub mediant, leading note/tone. B>F = dim. 5th. (B>E# = aug. 4th). All maj. and min. intervals will also have aug. or dim. attatched should they be bigger or smaller, respectively, by a semitone. Interval between tonic and mediant is a third, but there are **4** different kinds. Not too helpful.
Comment: @LaurencePayne, you're absolutely right!!! I'm rectifying this asap!!
Answer: As has been pointed out an interval is the distance between two tones. It is hopefully clear that the interval between two tones is the same whether you start with the lower one going up or you start from the upper one going down.
There seems to be a confusion whether it is related to scales. The reason for that is probably because when you start learning about intervals and their names you usually start with a scale, C major, and then learn the intervals and their names in relation to the distance from C.
Later on you learn to recognize the intervals on their own completely independent of any scale. Music without scales, like atonal music, definitely has intervals.
An additional note:
At the same time you are learning to use the term "interval" on its own as mentioned above you are also continuing to use it in connection with scales and chords. Like a G7 chord. So that might be why some people could think that an interval starts from the lower note since in that case it does, but in principle it is just a distance between two notes.

Is interval always related to a scale?


Use server's certificate instead of HAProxy managing for its backend servers

Question: I am trying to create an environment using HAProxy to allow websites hosted on a local servers (having a private IP) be accessed through SSL connection using HAProxy Server (having a public IP and local private IP). I do not want HAProxy server to manage SSL certificate for its backend servers, instead backend servers (ie local private servers) manage the certificates themself and HAProxy just use backend server's certificate to create connection. Is this possible using HAProxy ?
Answer: Here is the solution:
With TPROXY, we can pass-through clients IP to the actual server without need for forwarded-for header and it works for TCP connections.
Requirements:

Linux with kernel 2.6.28 and above
iptables and HAProxy with TPROXY support
Backend servers must use the node where HAPRoxy is installed as a default gateway
You already have a working HAProxy configuration

Procedure:

Run below command to mark and route packets

iptables -t mangle -N DIVERT
iptables -t mangle -A PREROUTING -p tcp -m socket -j DIVERT
iptables -t mangle -A DIVERT -j MARK --set-mark 111
iptables -t mangle -A DIVERT -j ACCEPT
ip rule add fwmark 111 lookup 100
ip route add local 0.0.0.0/0 dev lo table 100

Set the node in forwarding mode:

echo 1 > /proc/sys/net/ipv4/conf/all/forwarding
echo 1 > /proc/sys/net/ipv4/conf/all/send_redirects
echo 1 > /proc/sys/net/ipv4/conf/eth0/send_redirects

In HAProxy backend proxy configuration section add:

source 0.0.0.0 usesrc clientip

Restart HAProxy service.
Done

I found the solution for this by following steps provided in guide mentioned in below link:
http://www.loadbalancer.org/blog/configure-haproxy-with-tproxy-kernel-for-full-transparent-proxy
Comment: Although your answer is 100% correct, it might also become 100% useless
if that link is moved, changed, merged into another one or the main site
just disappears... **:-(** Therefore, please [edit] your answer, and copy
the relevant steps from the link into your answer, thereby guaranteeing
your answer for 100% of the lifetime of this site! **;-)** You can always
leave the link in at the bottom of your answer as a source for your
material...


Exponent rules with negative numbers

Question: Hello if you could answer this please what is the difference between  -2^2 and (-2)^2
Answer: $$-2^2=(-1)2^2=-4$$  and $$(-2)^2=(-1)^2(2)^2=(-1)(-1)(4)=4$$
Answer: Just an extra here, Derrick. Please do NOT resort to the scientific calculator. The TI30 will show -2 to the power 2 as 4 without brackets, whereas Ti84 for example will show -4. I deal with this issue in class every semester. Calculators mean it well, but their order of operations is not always the "same" as what we have in our minds. Learn the rules of exponents without the calculator. It's better.
Answer: In view of the other answers here: the difference between -2^2 and (-2)^2 is 8. :-)
Answer: It is assumed that
$$-2^2=-(2^2)=-4\;,\;\;\text{whereas}\;\;(-2)^2=4$$

Exponent rules with negative numbers


what does 24 vac secondary mean

Question: I need a 120 to 24 volt transformer.  The one I bought says 24 Vac secondary
Just below that it say 40VA output.
Is this a 24 volt transformer or a 40 volt output
Comment: A 24V 1.6A RMS  (40VA/24V) transformer. 24V is at full load- you will measure somewhat more voltage open-circuit.
Answer: With transformers, you have Primary and Secondary voltages.  You can think of them as Input and Output, although it actually works in either direction.
So, you are looking for a transformer with a 120V Primary and a 24V Secondary.
The primary-to-secondary ratio is a fixed property of the transformer.  In this case, 120V:24V is a 5:1 transformer.  If you hook up 240V to the primary, you'll get 48 on the secondary, and so on.
(There are practical reasons not to do this.  One example: perhaps the windings were only specified to handle 120V, and would fail at a higher voltage.)
As far as the 40VA, that is a power rating, not a voltage rating.  In a DC circuit, this would be given as 40W (Watts).  However, with AC, the voltage and current waveforms can be shifted in relation to each other.  This causes a difference between the "real power" and the "apparent power".  It is customary to give the apparent power rating of a transformer in VA (Volt-Amps)
Here is a Wikipedia article on the VA.
Even better, here is a good question/answer on EE.SE :)
Answer: It is a 24Vac (rms) output transformer.
It has a power capability of 40VA (volt-amps)
Answer: The 40VA means "volt-amps" and is a measure of power handling. It means that you can draw 40VA / 24V = 1.67A from the secondary. Why don't they just put 24V at 1.67A? Not sure. I guess even though a transformer is listed to have a 120V primary and 24V secondary, it could actually take other voltages. For example, you could probably put 240V into it and it would work just fine and the secondary would put out 48V. But the power would stay the same so you could only draw 40VA / 48V = 0.83A. If you draw more power than that, it would get too hot and maybe start to melt or maybe even burst into flames (seriously).
Note that the 24V secondary means RMS. Meaning if you used an oscilloscope to look at the peak-to-peak swing it would be more like 30-something volts. But if this transformer is for a power supply, after the AC is rectified and filtered, it will be a little above 24V such that it is a good voltage to be regulated down to 24V. The point is that if you need a DC power supply that puts out 24V regulated, you actually need a 24V transformer and not 26V or whatever.

what does 24 vac secondary mean


How to make this type of logo?

Question:
this logo looks so clean. is this created manually by adjusting path or there is a trick?
thx.
Comment: Your question is a bit broad. I can't say how this logo was made, but I'm sure it's possible to create something like this manually only using 3 circles and 5 separate paths. The 5 individual paths seems to be smooth (no split handles) and each go through each of the 3 circles. It's simpler than you think. Try drawing 3 circles and then draw just one of the 5 smooth paths with the pen tool. When it looks good, duplicate it and adjust a little bit here and there.
Comment: Welcome to **GD.SE** - Please look through [tour] to get a sense of our community – who we are and what we're about. Then look over [ask] and [answer] a question to see what makes a good query here, and how best to frame it. As initially posted your query is very broad, and thus hard to answer - can you be more specific in what you're trying to find out?  Please read [ask] and [edit]  your question to better fit our guidelines. Thanks!
Answer: Make a closed path which has a few, say 3 or 4 nodes. Make a copy and edit its handles with the direct selection tool, beware moving the nodes!
Make a few step blend between these 2 versions, expand and ungroup the blend to get free objects. Move the objects so that the nodes fit.
Color with a gradient. Draw and insert the black dots if they really are needed.
The geometry part without colors is shown in the next example:

You can easily explore variations without sacrificing the smooth transitions between the curves if you put the 2 versions to the same place before making the blend. The blend adapts if you edit a handle or move the nodes.
You can also apply envelope distortion to the result. Here's an example of applying warp to the same shape: https://www.dropbox.com/s/n5l6jcwpqwzp44x/2Hunt1862.jpg?dl=0
Comment: Thank youuuu so muchhhhhhhhh for thisss, the idea of using circle never crossed in my mindddd thank you so muchhhhhhhhhhhhh again

How to make this type of logo?


Dealing with writer's block

Question: Although I'm not that convinced with this idea but I'd like to take your advise.
Can it be a good idea to skip a chapter when having writer's block?
Comment: Change "Is it a good idea" to "Can it be a good idea" and the answer is definitely "Yes". It all depends on so many factors you aren't sharing, and may not be aware of yourself, yet.
Comment: If this is an approach that you, while doing other writing, have not tried before, try it now!  This may be just what you need.  (It's a very good sign that you are _aware_ of this possibility -- don't be afraid to explore it!)
Comment: A bi more info would be nice, like what writing style do you follow. For example do you have a main thread or are you writing as you go?
Comment: I'm writing a short story from the perspective of a child about his life journey. I have the idea in itself but when I reached chapter 6, I didn't know what to write, I need to write more details about an event because it's gonna be very short if I jump to the other event
Answer: Skipping a scene, section or chapter that I'm struggling with is one I've used in the past and had some success with - it's better to be writing something than sat there not getting anywhere and getting frustrated. Sketch down some brief notes about what the "missing" section is intended to contain and move on.
Sometimes if you write the section that follows the one you are struggling with it can actually help you write that connecting section as you now have a hole to fit it in to - "what is missing between these two chapters?" is a subtly different question to "what does my next chapter say?" and that difference can be enough of a re-framing of the problem to let you proceed.
I can't guarantee that it will work for you - everyone is going to have their own preferred methods for dealing with writer's block so it's a matter of finding a technique that works for you.
Answer: That's not a question that can be answered in the abstract.
Sometimes it's so exactly the right thing to do that you look back and realize that your writer's block was your boredom with a superfluous passage, and you never do write it.
Sometimes writer's block turns out to be reluctance to tackle a passage requiring technical skills that you haven't got yet, but the passage is necessary, and in that case, skipping will achieve nothing.
Sometimes you just need to let something jell a little more.  I do this by skipping to another work and circling back.  Skipping ahead might also work, but I'm too afraid that vital things in that scene might affect the future scenes too much.
An additional important point with letting it jell -- you may realize that something you had thought will not work.  You may need to seriously change elements of the scene to get through it.  That may invalidate what you write if you skip ahead.
Answer: Skipping chapters in your books when writing is a good idea if you think it's a good idea... No one else knows your writer mentality...  It's usually pretty easy to start out on a book and try to write it chapter by chapter until the end... But when I had writers block writing my short stories... I found that looking at how I wanted my story to playout in the ending, paved my way to write on from where I left off and fill in the gaps in-between...
Answer: The best way is to plan your book before writing and not try to pants it because, like many amateurs claim, "Stephen King writes that way".
The Stephen King method does not work for everyone.
For most people, failing to plan is planning to fail.
You really must know the scenes from start to finish and ensure that they fall like dominoes when you check the sequence of them, and also look for holes, detours, or other problems.
Comment: I'm not sure this really answers the question. Also, do you have any evidence to support the claim that planning is the best method for most people?
Comment: I'm really not sure it's helpful or accurate to say that one of the two most common methods of writing is just worse for the majority of people. A bit of evidence could go a long way with this answer. Or, failing that, perhaps a restructuring to say that the writer in question should explore both methods?

Dealing with writer's block


A linear operator that sends strongly convergent sequences to weakly convergent sequences

Question: So I'm having trouble showing this. Its an old prelim problem. Suppose you have a linear operator $A$ on a Banach space which sends strongly convergent sequences to weakly convergent ones. Show that this operator is continuous. Now my first thought was to use closed graph theorem or hahn banach somehow, but I honestly have no clue what to do here.
Answer:
Now my first thought was to use closed graph theorem

This!
Hence suppose we have a sequence $(x_n)$ such that $x_n \to x$ and $Ax_n \to y$. Since $A$ maps norm-convergent sequences to weakly convergent sequences, it follows that $Ax_n$ converges weakly to $Ax$ - if that is not clear, consider the sequence $(z_n)$ where $z_{2m} = x_m$ and $z_{2m+1} = x$; then $z_n \to x$, and since $Ax$ occurs infinitely often in the image sequence $(Az_n)$, if that converges weakly to anything, its weak limit must be $Ax$. And since norm-convergence implies weak convergence, $Ax_n$ converges weakly to $y$. Since weak limits are unique - the weak topology is Hausdorff - it follows that $y = Ax$. Hence the graph is closed, and consequently $A$ continuous.
Comment: Ahh so simple. Thanks Daniel!
Comment: @Fisher Why $lim_nA(x_n)=y$ exists here ?
Comment: @TsemoAristide By assumption. We check that the graph is closed, so we look at a sequence $(x_n, Ax_n)$ in the graph, which converges to some point $(x,y)$. If $(x,y)$ necessarily lies in the graph, it follows that the graph is closed.
Comment: The business with $(z_n)$ seems unnecessary. If $x_n\to x$, then $Ax_n\rightharpoonup Ax$ weakly by our assumption on $A$. Since $Ax_n\to y$, also $Ax_n\rightharpoonup y$ weakly. Then continue from "Since weak limits are..."
Comment: @Jason The assumption is only that $Ax_n$ converges weakly to something. A priori, that something could be different from $Ax$. At some point, one has to prove that this cannot happen. If that has been proven before, the business with $(z_n)$ is indeed unnecessary.
Answer: Recall, that
(1) linear operator is continious iff it is bounded.
(2) if $x_n \rightharpoonup x$ then sequence $\left\Vert x_n \right\Vert$ is bounded.
Suppose $A$ is not bounded and $\left\Vert Ax \right\Vert = \infty$. Then we can find sequence $x_n$ on a unit spere, such that $\left \Vert Ax_n \right\Vert \to \infty$. Now we construct another sequence $$y_n = \frac{x_n}{\sqrt{\left\Vert Ax_n\right\Vert}}.$$
We have now $y_n \to 0$ and $\left\Vert Ay_n\right\Vert \to \infty$ thus $Ay_n$ cannot converge weakly to anything.


Best Layout for Bathroom

Question: Im just wondering what the best layout would be for a shared apartment bathroom with 5 people in terms of allowing the most people to use the bathroom at the same time taking into account the people using the bathroom don't want to see each other naked.
Layout A or Layout B
Comment: Just a matter of opinion, (and/or how comfortable the 5 people are with sharing personal space) and that makes it a poor fit for this site. For me, "neither" - put the sink and toilet in a (completely, by my preference, not pass-through) separate room from the shower (the shower room could also have a sink of it's own.) No fun having the toilet blocked by someone taking a long shower. That could be A for some folks, others would find people walking through while they shower quite unacceptable...
Comment: Totally and completely opinion based.
Comment: Would think a lot would depend on the secludes of the people.  All five with the same seclude, and one bathroom not enough, unless very friendly.
Comment: Make 2 half-baths, one with sink & toilet, one with sink & shower. See, lots of options, which one is best is... who knows
Comment: There's very little point in splitting the bathroom in either of the ways you propose. Having a separate toilet is only useful if someone can get to it while someone else is in the shower. Having the sink all alone serves no useful purpose as it's typically used by whoever just came out of the toilet, and almost never just used by itself by someone walking past...
Answer: Assuming your entrance must remain where your layouts show it:
Comment: If your walls are 4 pixels thick, this could work. If, however, they're made out of studs and drywall, that probably becomes way too cramped. Of course, the OP gives us no dimensions whatsoever and asks for opinions, so there is no possibility of providing a "correct" answer.
Answer: For that many people, the sink, shower and toilet should be separated. Sink access is very useful on its own. Someone using the toilet shouldn't block another person from washing their hands or brushing teeth.
Layout B is better with the sink close to the entrance. Split the shower and toilet. The toilet should exit directly to the sink.
This version is the most functional, though admittedly not the most elegant. You'd see 2 doors (shower and toilet) upon walking into the bathroom. Whether the doors open outward or inward from the shower and toilet rooms depends on your preference and available space. Opening the doors outward allows the shower & toilet rooms to be smaller, but the doors will block the sink area when open.
If space is at a premium, another option is to use curtains instead of doors. The only interior wall would be separating the toilet and shower areas. Now that I mention that, you could install a tiled standing shower with an opaque shower curtain to avoid a door for it. A little less privacy, but a door isn't going to stop a determined snooper. You could have one or both with curtains (see C' with a shower curtain and toilet door). A toilet curtain would allow for a single vent to pull out both the stink and moisture. With a toilet door, you may need a separate vent in the toilet room.
Comment: If your walls are 4 pixels thick, this could work. If, however, they're made out of studs and drywall, that probably becomes way too cramped. Of course, the OP gives us no dimensions whatsoever and asks for opinions, so there is no possibility of providing a "correct" answer
Comment: Exactly, we don't know the dimensions, only what the OP provided in their original pics. It's up to the OP what option they like best. Doesn't matter if the walls are 4 pixels or 4 feet deep, the only thing that matters is the interior dimensions.
Comment: This is, essentially, how public restrooms are laid out with one of the toilet stalls replaced by a shower stall. So it's got that going for it.
Answer: For 5 people, you need:

Separate access to the toilet in case of "emergency".
Sink independent from shower, or they'll be a traffic jam in the morning

And:

Toilet door should always be able to open if someone passes out inside. So if the toilet is tiny, it should open to the outside.

In addition, bathrooms also need:

heating
places to hang towels (esp. for 5 people)
ventilation
storage
enough space on both sides of the sink to brush teeth without smashing elbow into wall

Proposal:

#1 toilet door, opens to outside. Toilet can have a tiny sink #9 for washing hands.
#2 main door, can open to inside, using corridor.
#3 sink with space on both sides.
#4 storage, towels hanging, second choice spot for heating, shelves (five people = tons of hygiene products, razors, toothbrushes, etc, you need a cupboard for that)
#5 first choice spot for heating, closest to shower
#6 clothes and towel hanging for person in the shower, next to or above heating, to dry the towel
#8 shower door, can be a sliding door
Air extraction above shower and in the toilet.
This fulfills all conditions: in the space next to the shower, someone can undress, shower and dress while someone else is using the sink and someone else is using the toilet. Also several people can brush their teeth at the same time if they're late, because there is enough space around the sink. This type of shower allows a simple curtain instead of a door, which means much less problems with leaky doors, tenants breaking the glass door, etc.
If the bathroom is too small to be usable, make it larger.
If you need to sacrifice space, make the corridor and the main door narrower. You spend 3 seconds going through the door and five minutes in front of the sink, so it's more important to have room around the sink.
Comment: The correct answer is that the bathroom has to be as large as it should be to avoid creating conflict between the users when they're all late for work in the morning ;) Besides that, as you say OP didn't give any dimensions besides general room proportions... so the dimensions are OP's problem. We don't even know if there's a window.
Comment: If your walls are 4 pixels thick, this could work. If, however, they're made out of studs and drywall, that probably becomes way too cramped. Of course, the OP gives us no dimensions whatsoever and asks for opinions, so there is no possibility of providing a "correct" answer

Best Layout for Bathroom


What is an "Eber rule?" (Ruler to measure type)

Question: I heard someone mention a tool that was used for specifying type in the pre-computer days, called an "Eber rule."
What was it and how was it used?
Is it the same thing as a font ruler? And did I spell Eber correctly?
Answer: Generally, manual type measurement is done via an E Scale. Sometimes referred to as a Type Scale.

These can be purchased at any art supply store.
They are customarily see through plastic. In fact one company making them is called C-Thru. You would place it on top of a printed piece and move the scale to line it up with an uppercase E on the printed sample. This would tell you what type size that E was, and subsequently the rest of the type.

I don't know that I've ever heard the term "Eber rule". But it's been a while since I've needed one. Maybe I'm forgetting. You may have also overheard someone using a brand name for a ruler. The same way everyone refers to tissue as "Kleenex".
Haber Rule maybe.
In the back of my mind, far in a deep, dark, corner, I kind of recall "Haber Rule". However, Haber was a brand name I believe. A comment here at Before & After's web site seems to confirm that name.
Comment: As a professional graphic designer since about 1978 till about 2002, I remember it as Haber too... I still have my 18" metal Haber Ruler : )
Answer: I never heard of "Eber". What I encountered was called Typo Ruler, Typographic Gauge, Typometer.
It usually look something like this
For specific type printhouses printed their own typo books when you could see what type is available, what glyphs they have and ornaments. From 5pt to 150pt I think.
In USA you also had pica-point-inch line rulers.
You also don't need to buy it. Ask your local printer or CTF if they could prepare one for you.
On a funny note. Maybe somebody was talking about "Ebert Rule" as a funny name for rule of a thumb?


Can a Continuous Descent Final Approach (CDFA) be carried out if there is no final approach fix?

Question: Is it possible to carry out a CDFA approach if there is no defined final approach fix mentioned on the instrument approach chart?
Comment: Just to add some extra context to this question, internationally the FAF, FAP, CDFA, CDA may differ from how they are recognised by the FAA. A good few paragraphs on this are found in the wikipedia page "Final Approach" - Section "Final Approach Fix and Final Approach Point" https://en.wikipedia.org/wiki/Final_approach#Final_approach_fix_(FAF)_and_final_approach_point_(FAP)
Answer: Your Question: Can a CDFA approach be carried out if there is no final approach fix?
The answer is yes, a CDFA approach can be conducted without a depicted FAF.  I encourage you to read the FAA's AC 120-108A, linked below, for a full explanation of CDFA techniques (which can vary depending on the equipment in your aircraft, navaids, fixes, dme, etc. available and shown on the approach chart, etc.).

From the FAA's AC 120-108A - Subject: Continuous Descent Final Approach:

paragraph 3-1:
Equipment Requirements. A CDFA does not require specific aircraft equipment;
however, the aircraft must be equipped to accomplish the NPA procedure. Pilots can
safely fly NPAs with a CDFA using basic piloting techniques, aircraft flight management
systems (FMS), or RNAV systems. Pilots can use points defined by a DME fix, crossing
radial, GPS distance from the runway, etc., on the approach plate to track their progress
along both the lateral and vertical approach paths to the MAP.

And

paragraph 3-2 (pertinent excerpt) Approach Requirements. A CDFA may be flown on any NPA. There are no specific
approach requirements nor any requirement for a vertical descent angle (VDA), glide
path (GP), or visual descent point (VDP) to be published on an IAP in order to fly a
CDFA.
[...]

Lastly, from the FAA's Pilot/Controller Glossary::

FINAL APPROACH POINT- The point, applicable only to a nonprecision approach with no depicted FAF (such as an on airport VOR), where the aircraft is established inbound on the final approach course from the procedure turn and where the final approach descent may be commenced. The FAP serves as the FAF and identifies the beginning of the final approach segment.

(emphasis is mine)
Comment: Yep totally agree and you are right in doing so of course, just wanted to add a little extra :)
Comment: To add to the discussion, the definition of the FAP varies. As far as I am aware, in Europe, The FAP is only typically used in reference to ILS approaches. There is a good description of this on wikipedia, using the case of Alicante airport, Spain https://en.wikipedia.org/wiki/Final_approach#Final_approach_fix_(FAF)_and_final_approach_point_(FAP)
Comment: @tedioustortoise Yup, I totally agree.  My response was only directed to U.S. CDFA (which are very similar to the rest of the world), and linked to the approach plate the OP was asking about.  That is why I referenced FAA in my response.
Answer: CDFA is possible. The VDA is published after the fix from which it applies. In this case, that is AMBAZ. The VDA calculation has nothing to do with the MAP location or the MDA.
See the FAA's AC 120-108A that was just released in March '23.
Answer: For the KLAL VOR 27 approach, it is possible to perform a CDFA type approach.  On these types of approaches with a procedure turn, the FAF is defined as alignment with the final approach course after the procedure turn.
There is a DME distance available and a descent angle on the chart. The descent angle suggests approximately 300 FT/NM descent.  The TDZE is 142 and the TCH is 45 or a threshold crossing altitude of 187.
If you were at 2,000 FT MSL just finishing up the procedure turn a descent should be made at (2000 - 187) / 300 = 6.0DME is where you start the descent.
But notice, that puts you on a descent path to the MAP after the runway begins and you may need to circle if you complete the CDFA and can see the runway.
It is best to dive and drive this type of approach so you can be in a position to land when you break out of the clouds.  Especially since the runway will be to your right and not directly in front of you.
Comment: You're not flying a CDFA if you're using 6 DME to begin your descent. That is not at all how you are supposed to use the information on the chart.


Prove $S_{m}^{m}(\Delta)$={$s:s\in C^{m}[a,b]$ and $s$ is a polynomial of order $m$ in each $[x_{i},x_{i+1}]$}=$P_{m}$

Question: Basically, I don't understand clearly. The point is to prove that these two spaces are equal or that the polynomial $s \in S_{m}^{m}(\Delta)$ is unique/the same in each $[x_{i},x_{i+1}]$? where $(\Delta)$ is  a  segmentation of [a,b]
Answer: So here is my answer:
Let $s_{i-1}$ be the polynomial in the $[x_{i-1},x_{i}]$ region of $[a,b]$ and $s_{i}$ the polynomial in the $[x_{i},x_{i+1}]$. Then by the continuity of all the $m$ derivatives of $s$ in the internal nodes of $[a,b]$ we have that:
$s_{i-1}^{(m)}(x_{i}) = c_{i-1}$$\quad$ and$\quad$ $s_{i} ^{(m)}(x_{i}) = c_{i}$ $\quad$ $\rightarrow$ $\quad$$c_{i-1}= c_{i}$
$s_{i-1}^{(m-1)}(x_{i}) =a_{i-1}x_{i}+c_{i}$$\quad$ and$\quad$ $s_{i} ^{(m-1)}(x_{i}) = a_{i}x_{i}+c_{i}$$\quad$$\rightarrow$$\quad$ $a_{i-1}=a_{i}$
etc.
So we have that $s_{i-1}=s_{i}$ i.e. we have that $s$ is the same polynomial in each $[x_{i},x_{i+1}]$.
p.s These self answers in StackEchange are kinda creepy.


Change iPhone language from Chinese to English

Question: I bought a second hand iPhone 4, and I cannot create an Apple ID since the language appearing is Chinese. How do I change it to English?
Comment: here is a video how to https://www.youtube.com/watch?time_continue=76&v=1BU4KmXRJqA
Answer: 设置(Setting) -> 通用(General) -> 语言与地区 (Language and Region) -> iPhone 语言(iPhone Language)  , Choose English.
Answer:
Change iPhone language from Chinese to English

I do not know if you can read Chinese so here is a video to help you with the process of changing language.
https://www.youtube.com/watch?time_continue=76&v=1BU4KmXRJqA
Answer: Since the text is not recognizable, you can follow along in the Setting app with the help of this Apple Support article, Change the language on your iPhone, iPad, or iPod touch.
Take the help of icons and count of items in a section in the Settings app to navigate through the Settings app. Specifically, you need to go to General → Language & Region → iPhone Language.
As it's a second hand iPhone, it's also advisable to erase it and set it up afresh. This will also reset the device language back to English.


Comparing rates of cooling

Question: There are 2 metallic spheres A and B. Mass of A is thrice the mass of B. Both the spheres are heated to the same high temperature from same initial temperature. The spheres are thermally insulated from each other.
I have to find the rate of cooling, so I tried Newton's Law of Cooling, but that doesn't seem to take in consideration the relation between the masses, and yields the wrong answer (is NLC valid for high temperatures?). I thought of the formula u = eAσT^4, but I'm not sure how to use this. Please suggest an approach.
Comment: 'u = eAσT^4' doesn't have much to do with NLC (which is valid for high temperatures with *caveats*) Revisit NLC here: https://en.wikipedia.org/wiki/Newton%27s_law_of_cooling#Temperature_function-of-time_solution_in_terms_of_object_heat_capacity and get inspired again.
Answer: Newton's law of cooling is a corollary of Fourier's law of heat conduction:
$$q=-\kappa \nabla T,$$
where $q$ is the heat flux, $\kappa$ the heat conductivity and $\nabla T$ the temperature gradient (in a single dimension $\nabla T=\frac{dT}{dx}$). In essence this law tells us that heat flows from hot to cold and that the heat flow is proportional to the spatial temperature gradient.
Reworked for a body at temperature $T(t)$, cooling in a colder environment at constant temperature $T_0$ we get Newton's law of cooling:
$$\frac{dQ}{dt}=-hA[T(t)-T_0],$$
with $Q$ the heat energy of the object, $h$ the heat transfer coefficient and $A$ the total surface area of the object.
When the object loses an infinitesimal amount of heat energy $dQ$ it also drops in temperature a bit:
$$dQ=mc_pdT,$$
where $m$ is the mass of the object and $c_p$ the specific heat capacity of the object.
Substituting into the first equation we get:
$$mc_p\frac{dT}{dt}=-hA[T(t)-T_0],$$
Integrated between $0,T_1$ and $t,T_2$ we get:
$$\ln\frac{T_2-T_0}{T_1-T_0}=-\frac{hA}{mc_p}t,$$
$$\frac{T_2-T_0}{T_1-T_0}=e^{-\alpha t},$$
with:
$$\alpha=\frac{hA}{mc_p}$$

There are 2 metallic spheres A and B. Mass of A is thrice the mass of B.

Your task is now to work out the influence of $m$ on $\alpha$, bearing in mind that $m$ also has an effect on $A$. In the case of two spheres with $m_A=3m_B$ it should be easy to work out the ration of $\alpha_A$ and $\alpha_B$, which gives you the ratio  of the cooling rate of the two spheres.
Answer: Thermally insulated tells you go for Stefan. Newton's law of cooling is for convection transfer. Don't confuse stuff.
Maybe you missed the term "made of the same material", you should conclude the relation in their surface area.

Comparing rates of cooling


Web Service vs Web Application

Question: I know this is an old question and must have been answered hundred times already, but I am not able to find a satisfactory response as yet.
I am creating an application which will be used by other applications (mobile/ web) to fetch the data. Now I have 2 options:

Create my application as a simple web application.
Create a web service.

A web service looks more sophisticated where any client will provide the data in a specified format (SOAP/ REST) and my app will parse the request and return the data asked by client. How the data will be used is not my app's problem.
My question is that same can be achieved by a simple web app accepting the request in XML format and responding with an XML response. Gut feeling is that a web service will be a better way to go for this kind of service where we are not sure who all will be using it. But are there any specific advantages of using a web service over a simple web app?
Comment: My point is, a web app will work for most of the conditions, why use a service at all then.
Comment: Keep it simple (so if a WebApp works for you, build a it; not a service. But that is my opinion) :)
Answer: If we think the terminology, which I think is the main question here.
Web service refers to software, that serves data in any format (XML/JSON etc.) through some kind of web interface. That interface can be called API (Application Programming Interface). REST and SOAP are ways to design the API.
Application is the software that is using this API provided by the web service.
In the other words, web service is "server" and application is "client". Usually server serves machines and clients serve the user.
So in any way you choose to build your system, I would call the part that serves the data as "Web service" and the part that utilizes the data as "application" (or "web application" if such).
Sounds like in your case, you are building a web service that provides XML-formatted data for multiple applications. So my answer is: build the thing you are already building and call it web service.
Comment: No sure if I quite understood the question, but do you always need at least 2 servers to build a website, definitely not. Websites often have just one server that serves HTML for browsers. Or you can also have just one server that serves e.g. JSON via e.g REST API.
Comment: So, if we are building a website, do we *always* need (at least) two machines/servers? One for taking the user requests from the UI (typical MVC) and the other REST service (deployed elsewhere) that is accessed by the former (MVC's controller)?
Comment: If a single server returns HTML (a view) then is the data retrieval logic also part of the MVC's controller here? If I don't want that to be there (don't want business logic in the controller), then I must have a REST API endpoints for getting it. In that case, the controller must hit that API. Am I right?
Comment: `Or you can also have just one server that serves e.g. JSON via e.g REST API` -> It won't be renderable in HTML. So the MVC controller has to consume it and pass the model to the view. Again, are there two things involved here?
Answer: If your application doesn't need a user interface, then make it a web service. If it needs a user interface, then use a web application.
Comment: You don't "need" it. You can certainly do as you suggest - I'd recommend doing it based on an ASP.NET MVC application if it's that simple. A web service (WCF Service) gives you flexibility of having the same code work to expose the service to many clients, with great power. Among other things, a SOAP client in Java or .NET will not have to manipulate XML. For that matter, with WCF, your service won't need to touch XML either - WCF will do that for you.
Comment: @muneeb: I'm saying that if no human will ever interact with the application, then make it a web service. Then the same functionality will be available to a different web application (through JavaScript), or to ETL processes, or to other web services.
Comment: Is it that simple? Can't I simply create a web app which returns an XML as output (like we do in most of AJAX apps). Why do I need Web Service?
Comment: So you are saying that if data comes from other server u don' t need application(client-side or browser side)?. did i get correct?
Answer: At a low level web applications and web services are kinda the same thing.  They both operatate over http(s). SOAP is just a well defined version of XML.  REST is kinda just HTTP.  If you wanted to, you could make a web application look like web services and visa versa.
The main difference would be internal development options based on the platform you are using.  If, for example, you are using Visual Studio then adding a WCF Service Application will give you a project which is by default geared towards WCF.  But choosing any other application type won't stop you from adding Web Services.
Using SOAP is generally a better option than plain old xml for these reasons:

Your users will be expecting it, and are likely to know how to read it already.
Your users' development environments will likely know all about SOAP and be able to interpret it out of the box.  (If you provide a WSDL file then many users will be able to use a script to generate your classes in seconds.)
Your messages are more likely to be well defined.  I am working on a project at the moment where the other side have defined their own random XML structure and it is a nightmare to work with.  I never really know what to expect, and there is little consistency between their different message types.  At least if they had agreed to conform to SOAP then I might have had a much easier time interpreting their messages.
Answer:
My question is that same can be achieved by a simple web app accepting
  the request in XML format and responding with an XML response.

That is a web service. I think this is an issue of terminology. You have no way of solving this other than to use a web service, whether it is restful or SOAP based is up to you but if you are passing data to clients in XML format, in response to XML requests, that is a web service.
I suspect what you mean to ask is whether or not you should be using a RESTful webservice or a complicated SOAP based approach. For me the answer depends on how many functions are needed in your 'Service'.
SOAP
If your service has lots of functions than users of java and/or visual studio would prefer to import your WSDL file and use your service as an object with all of the XML parsing done for them, so SOAP would be the answer.
REST
If you only have a few functions, with very basic input parameters and response data, then SOAP might be overkill.
MySite.com/Add/5/3

or
MySite.com/GetStockSymbol/Facebook

or
MySite.com/GetWeather/Paris/France

Answer: I think this might help you in resolving your confusion
There are two main use cases of WEB in the industry

Business to Consumer(B2C) : Whenever there is consumer directly
interacting with the business for its needs we always uses a
Web-Application to provide a communication between two parties.
Business to Business(B2B) : It means one part of the business need
some input/services from another part of the business. Always a
Web-Service is used to meet the business to business requirements.
Usually a consumer never interact with the Web-Services directly we
only interacts with a Web-Application and a Web-Application interact
with a Web-Services for information/data or processing.

Taken from http://coder2design.com/java-interview-questions/
Answer: I asked this question more than 3 yeas back and a lot of water has flowed under the bridge since then. I have worked on tens of web applications and created hundreds of web services. So I guess it makes sense to answer my own question here.
The challenge which I faced when I asked this question was that I got confused between the terms application and service (note that web is common element in web application and web service). As the name would suggest, application is an application in itself, whereas a service is meant to serve others. A service probably has no meaning unless someone is going to use it. It can serve one or more applications or services.
Now if I look at my question

I am creating an application which will be used by other applications
  (mobile/ web) to fetch the data. Now I have 2 options, 1. to create my
  application as a simple web application 2. To create a web service.

I would like to tell myself that "Dude! if there is an entity which takes a request and returns data, you are talking about a service." Because I am not worried about what is going to happen with that data? Who will use it? How will that be displayed?
I am taking a request and returning data. Now how am I doing that is part of implementation. I might use SOAP or REST. I might use Jersey or Spring MVC/ REST or may be a simple servlet which takes a request and returns data in JSON or XML or String or any other required format.
Answer: From RESTful Web Services by Leonard Richardson and Sam Ruby, ISBN: 978-0-596-52926-0:

Web services are indeed very similar to web applications, but resource creation is one of the places where they differ. The main difference here is that HTML forms currently support only GET and POST. This means web applications must use overloaded POST to convey any unsafe operation.
Answer: Web services dont always have a UI.  They are normally API's using JSON, can also be SOA type using SOAP and XML primarily, can also be sockets, and servers and other micro web services, etc..
Web applications can be put together many ways.  There are several ways to create your application by orchestration of multiple web services, and a separate gui to control them which ties into these services.  The other way which does not use services is to procedurally embed code into your UI interface app, or even better, make an Object Oriented application which has its own services separed in the Model later, which the controller access, and has its own view as a GUI which access the services in the back end, or even more complicated apps that pass A2B, B2B, B2C services from some GUI.
Services dont always have a GUI, they can have a CRUD to maintain the data, but once you start to have these types of features, it becomes an application in its own right.  The services are applied to something greater than themselves.  this applying creates your application.  It has to have a purpose.  Normally it takes more than one blind service to complete your applicatoin, and there is some kind of interface.
If you just blindly send a uri request to your service, and it blindly sends back json, that's a service. Whats blindly sending this?  If you, then not an application.  If some sort of crud, then its becoming an application, the crud is  a GUI for accessing the services, and as a whole, its a data management application system.  Now if you put a layer on the front to demonstrate this data in website fashion, you now have a product to display this data, a product to manage it, and the data which is the real product, and which is accessible via the web service, its now a full on application.  Your endeavour at creating this becomes your application.
Answer: I know its too late to replay, but still i want
Web Services approach is good if
a. enterprise integration with only webservices, like integrating distributed modules /applications.
b. suited for distributed applications
c. more than one consumer for same service
  - like Banks consuming data from Credit Reporting Agency
d. consumers want data in different formats
  - like one consumer(customer) wants in XML format, other would be in JASON ..etc
Answer: I guess the web application vs web service is the fact that the deployment factor ratio vary meaning the deployment of a web application would be limited (locally ) to what as in case of a web service (globally).
Plus, When we think of UI perspective better option is the Web application but when we think of programming and data transfer perspective mainly go for a web service.
Web application requires use of servlets with frameworks like Spring mvc etc. On the other hand, if you want to deploy the same application to multiple platforms make it a web service via Rest/Soap implementations so that the web applications behaviour gets changed to rather a service.
In short,
   WebService   =

                 (RestApi/Soap)    # added
             /         |         \
(client1)---(Web Application)---(clientN)

Answer: This is a simple way to know about it:
Web Application means for human beign can read.
it is accessed through browsers.
Whereas
Web Services means for computers can read.
it is accessed from any languages or platform.
For example:
Yatra.com(Java based services) application communicate Paypal.com(Python based services) application

Web Service vs Web Application


How much fuel remains in a booster such as the one used for Jason-3

Question: Building off of this question, I am curious as to how much (just a simple magnitude of order) propellant remains inside a booster to cause such an explosion?  Considering cost, I would expect very little would have remained after main engine cutoff on the barge, preventing such a hollywood-style explosion.
Comment: The explosion on Jason 3 was actually very small — compare it to the CRS 6 barging attempt. Also, having excess fuel actually makes landing _simpler_ as the landing velocity/deceleration is smaller
Comment: Fuel is cheap, relative to the value of the rocket stage. They want to have a margin to make sure they don't run out of propellant just before the landing. And don't underestimate the explosive power of fuel. 100 litres of RP-1 plus the same in LOX is in the same ballpark as a 250-lb air-launched bomb.
Comment: The explosion doesn't come from the liquid propellant. That would just burn - really fiercely in the presence of liquid oxygen, but it doesn't explode. The fuel vapor (of which there is probably a lot) on the other hand, will go bang if it's mixed with oxygen.
Answer: I do not have a quote to source it, but recall Elon Musk saying it was on the order of a 100 lbs of fuel and oxidizer left. Almost dry, but clearly enough to burn.


Extra venue charges on photographer

Question: I photographed a wedding with a second shooter (her first time) 2 months ago. At 7pm at the end of the reception my assistant vomited all over the lobby. I received an email this morning that the venue charged the bride and groom a $75.00 bio-hazard cleanup fee. So I guess my question is should I be responsible for that fee?
There was absolutely no alcohol involved. The bride literally gave us 10 minutes to eat before wanting something else. So it could have been a food allergy, it could have been eating too fast. I'm not looking for a debate, just opinions on what would be the best to resolve this issue.
Tia
Comment: I'm voting to close this question as off-topic because it about social mores and ethics, and event contract law. This is more appropriate for [law.se], perhaps?
Comment: This really has absolutely nothing to do with photography. It's a social mores/legality question.
Comment: I agree that this is not a photography-related question. Your company did some on-site work and did something that required a cleanup fee.
Comment: i think thats better question for http://workplace.stackexchange.com
Comment: Your employee vomited. Probably from eating too fast, nervousness, not staying properly hydrated all day, etc. Unless you have solid documentation that the actions of the venue, caterer (if applicable - you haven't said if the venue or a caterer provided the food), or wedding party caused your employee to vomit you are responsible for your employee's actions when they are working for you. That's why you should always carry liability insurance when working professionally. In this case the amount would not be enough to warrant a claim, but next time you might not be so lucky.
Answer: So, your employee acted in a completely unprofessional manner and caused the venue to charge the couple extra. Of course you should pay it, along with an apology to the couple for the inconvenience caused.
Comment: It's probably not worth it in this case because of the small actual cost, but this is what your business liability insurance is for [& if you don't have any, you shouldn't be trading].
Comment: I've read the question multiple times and can't see any mention of alcohol or unprofessionalism (though you may, of course, be right).  Would your answer be the same if the assistant had an allergic reaction to food provided by the bride/venue?
Comment: Seems to me that a legitimate case of food poisoning (assuming it was okay for an employee/sub of the photographer to partake in the food/desserts/etc.) would completely change the answer. That would be a tort _against_ the venue by the wedding party. If it were a food allergy, it depends on who knew what (did the venue use/include an in ingredient that they knew they weren't supposed to, or did not disclose its presence? Or did the affected individual not disclose a known allergy?) These specifics are very germane to the correctness of the answer(s).
Comment: @scottbb It seems to me that if it was a legitimate case of food poisoning then the 2nd shooter would not have been the only person vomiting all over the place. The guests likely ate much more of the same food over a much longer time period. Well, unless the photo team brought their own food...

Extra venue charges on photographer


Rapid tanning in humans as a reaction to radiation

Question: Is it reasonably possible for a type of human to exist that rapidly tans in the presence of large amounts of sun/radiation and loses it again afterwards, in a matter of minutes? Also, how might such a mechanism exist and how could this affect the body in other ways?
Comment: When I was a kid/teenager people used to go to places called "tanning salon" where they got radiated to look like idiots. They worked just fine and in a matter of minutes I think, never tried them though. They have died out as far as I know, but that was pretty common practice for some time.
Comment: You mean existing tanning method, just faster? Or any kind of biochemical darkening?
Comment: Oh, and does "reasonably possible" include natural evolution?
Comment: @Mołot Genetic engineering would be involved. I was just wondering if this would be a fairly realistic situation or if it would be something more like superpowers where there's not really any solid explanation.
Comment: @Raditz_35 tanning salon worked in minutes but full effect was visible only after a day or so.
Comment: So the question is actually : During the presence of radiation the skin gets darker immediately and lighter as soon as it stops, how is that possible? I do not think this is 100% clear. But even that technology is very well known from glasses for example.
Comment: @JimLockers You should add genetic engineering or impregnating the skin with material to your question because it opens up a whole other world of possibilities!
Comment: One important question is the reason for the pigment's disappearing - in the case of UV protection, it's because the skin needs to let a certain amount of UV through to produce Vitamin D (which is also why we have white people and black people). Given that other forms of radiation aren't beneficial, it's hard to see why the pigment wouldn't just remain permanently.
Answer: Rapid tanning is beneficial
My skin darkens really fast. One sunny day, I get reddish brown. Next day I have a good tan. I can go with sunscreen filters as low as 6 and don't get burnt. In an early history of our species it would mean that I'm not incapacitated by sunburns at the first really sunny day. I would eat, and my children would eat.
My friend needs sunscreen as high as 50 and he still has blisters anyway. He needs a few weeks to develop tan and even when he reaches his max, his protection isn't nearly as good as mine. Without technology, it would be a huge evolutionary drawback. On a sunny day he would struggle to feed his family.
It is fast enough now
In people who are tanning the fastest, sunburns are next to nonexistent. There is no evolutionary pressure to go even faster. And there wasn't. You would need some in your world for this to happen. A bright UV source that turns on or off suddenly would do. Or unavoidable radiation if you want other pigments, to absorb other wavelengths, to evolve.
Rapid loss of pigments is not useful
It is costly for organisms to create (and replenish) pigments. That's why only people who originated near the equator have dark skin all the time. Decomposition of these pigments serves no purpose. They decompose naturally and are not replenished if not needed, but making this faster means that the body wound need to redo the same work the next day. That's a waste, when pigments may last for weeks. Thus, there is an evolutionary pressure against speeding up this process, and more pressure to speed up tanning, the more pressure to slow down brightening.
Answer: There are creatures which are able to rapidly change the pigmentation of their skin cells, in order to adjust to the environment. Examples are octopusses and cuttlefishes.
Since tanning is yet another pigmentation of the skin, in principle it could be possible to have dedicated cells tuning the melanine content of the skin outer layers according to radiation intensity.
The only problem I see with such mechanism is that it doesn't bring a clear evolutionary advantage.
In a shaded enviroment the skin would turn pale and the individual would appear whitish, thus more visible than a dark skinned individual. On the other side in a fully sunny place the individual would appear dark brown, again more clearly visible than a pale one on a light colored background. Therefore a predator would have higher chances of spotting the pray and kill him/her. On the other hand, skin cancer as consequence of UV radiation kills in few years, way longer after the human would have been mauled.
Answer: What you are talking about isn't actually tanning (though it may look like it to the casual observer), but a rapid pigmentation change in response to light and/or radiation.
Take a look at the Photochromic Lens. Basically these are the lenses in glasses that darken and lighten depending on the light level.

Typically, photochromic lenses darken substantially in response to UV light in less than one minute, and continue to darken a little more over the next fifteen minutes.1 The lenses begin to clear in the absence of UV light, and will be noticeably lighter within two minutes, mostly clear within five minutes, and fully back to their non-exposed state in about fifteen minutes.

There are two different versions of photochromic material used in these lenses. You would likely want to go with the more biologic version oxyzines or Naphthopyran.
There are animals that change color but this is for camouflage. Those mechanisms are caused by

xanthophores, which contain yellow-red pigments iridophores containing
  colourless stacks of crystals or platelets that reflect and scatter
  light to generate hues such as blues, white and ultra-violet
melanophores, which contain black melanin pigment
Rapid colour change may occur due to various "triggers" including
  temperature or light (a reflexive response via light-sensitive
  receptors in skin). source

You'd want to look at these more than you'd want to look at what ordinary humans have for such a mechanism in your species.
As such, I would say that you'd have to make a new species. You can use human as the template, but the genetics of such a species will be different than ordinary humans.
I am with L.Dutch when it comes to it being an evolutionary disadvantage, however,

chameleons are very pale at night when asleep but darken as soon as a torch is shone on them (and only on the side with the light shining on it).

If your humans worked this way, they would also have to have an advantage. And there advantages to color changes in the wild. Cold blooded animals turn darker in the sun to absorb heat and when they are too hot, they can turn pale to reflect heat. It's also used for camo and communication.
If your planet had more radiation or a different kind where this protection is more of an advantage than constant melanin, of course it would be helpful evolutionarily. But if the cost of the change is not as simple or advantageous as melanin, then of course, it would not happen.
As to

Also, how might such a mechanism exist and how could this affect the body in other ways?

Well, take a look at the advantages that color change affords other species, and specifically what they are. Mammals don't generally, and if they do, it's in response to a season and happens over time, and mostly it's fur and has a lot to do with temperature. Like a Siamese cat--their pattern of fur color is dependant on their body temperature over time! As older cats have less circulation and are less warm, they get darker as they age. So, depending on what track you go, this can impact the genes of your interesting humans. You're talking about a far more rapid change in color, which might lead to something more...reptilian, but it's worth looking at these nifty cats.


Atmel AT91RM9200 compilers on Windows

Question: I have an embedded Linux device based on the AT91RM9200. Its manual say that it is based on the ARM9TDMI architecture. Are there any compilers available for this CPU on windows ? (Note: I'm already developing application for this CPU on Linux but I want to try the Windows environment).
Answer: You should be able to cross compile with the GCC tool-chain a good place to start looking is https://launchpad.net/gcc-arm-embedded or hhps://gcc.org or you can add the GNU/ARM tools to MinGW Studio but if you are looking for a pre-built, ready to go solution & are prepared to pay for it the it could be worth looking at CodeSourcery.

Atmel AT91RM9200 compilers on Windows


Protect house from mould

Question: I regularly have a problem with mould in my flat. It appears on the frames of windows or above the windows. I clean it when it appears but I would like it not to appear at all. What can I do besides opening the window more often (which I don't want to because it's too cold)?
Answer: Mold requires lots of humidity in the air to grow. The quickest way to decrease mold growth in a house is to decrease the humidity inside the house.
This usually is done by 1) circulating the air in the room with a fan and 2) pulling excess moisture out of the air with a dehumidifier.
If you are in a climate where it gets cold in the winter, you can also accomplish this by turning the heat up slightly in the room while allowing fresh outside air to enter the room and stale inside air to leave it. Cold outside air contains little moisture, and heating that air greatly decreases its "effective humidity" (a.k.a. relative humidity) which will dry out the inside of the room. This will slow down mold growth.
Comment: I already referenced your answer in mine - because you have a good point. However, it is not the vapors in the air which allow the mold to grow, but the environment created by the water being condensated on colder surfaces - the windows in this case, and around them.
Answer: The answer from @nielsnielsen is a good start. I would add that in some extreme cases, a de-humidifier might also help. Read about the topic on the net.

However, the air humidity itself is not the biggest issue. The biggest issue is that the humidity in the air (the vapors) condensate on cold surfaces, and that condensated water is the ideal environment for the mold to grow.
Especially taking into account that the mold is on / near the windows, the problem tends to be quite obvious. Either you need some adjustments to your windows, or you need new windows entirely.
Why? Because the low temperature from the outside penetrates "completely" into the room, allowing the vapors to condensate. Either:

the surfaces of the windows do not match properly, and air can travel freely between them,
or the lifetime of the windows reached an end and they need to be replaced.

Either way, a specialist should be consulted, for the best advice on the topic of windows.

One extra note: make sure that the air can circulate freely in the affected areas. In this way, the condensated water has a chance to evaporate again, before mold will appear. Try any (all) of the following:

remove any furniture which is too close to / around / above the windows;
remove any curtains / drapes / anything which separates the room from the windows;
remove live plants from near / around / in front of the window.

One extra help in thermal insulating your apartment is to add external window blinds. They will create an extra layer of air (insulation), which will keep the cold outside. Of course, they will have to stay open during the day, but the biggest trouble is during the night, when the temperatures are lower.

Other hints (brainstorming, you need to decide depending on your exact details):

do not dry clothes in the affected rooms;
do not have too many plants; they evaporate the water that they not need;
install a kitchen hood; make sure that the vapors go outside, instead of being recirculated inside;
install proper air exhausts (ventilators) in the bathrooms; the air with vapors must be moved outside, instead of pushed inside the rest of the apartment;
refresh the air inside the apartment more when it is dry outside;
refresh the air inside the apartment less when it is wet (rainy) outside;
Answer: This isn't a hack but you do need to ventilate rooms, to reduce the water that mould needs to grow, even if you think you are "throwing money away" by letting heat out.
One source of moisture (apart from breathing) is from cooking pots – always use lids on pots and pans to reduce it.
Another is from drying clothes indoors.
Another is from gas cookers, free-standing gas heaters, and paraffin heaters, all of which produce large amounts of water vapour. My understanding is that 1 litre of paraffin produces 1.25 litres of water when burned.
Answer: Similarly to you, I know someone that got fed up with mold. Their situation was a bay window in the kitchen that moisture would collect and mold would grow.
Their hack was a small fan that would cycle on and off which created the required air movement to keep it dry and thus prevent mold.
Comment: How was the air from the ventilator moving? What was it directed at? Maybe you should add a few details to the answer, to make it more clear, and therefore more useful.

Protect house from mould


Is queues or rest apis a better approach to handle user requests?

Question: I have a requirement when multiple apps want to send notification out in the form of email.I want to have a central app where users send notification too and that central app converts to email and sends it. Should i use REST API's in between my central app to get notifications from other apps or use MQ where other apps can write and my app listens to it? which is a better approach and why?
Comment: Hi and welcome to SO! This question is likely to be closed due to it being a very broad question, as well as one where it is primarily opinion based. To that vain, here's some advice: Review the specifications for the functionality. Ask things like: What is the expected throughput? What are the acceptable parameters I have to operate in (are emails needing to be sent immediately, is a delay acceptable? If so, by how long and so forth) Do research on both options. Learn about MQ vs REST for request processing. Pick your solution based on that, and then ask a specific question here if you need.
Answer: REST API <-> REST API are tightly coupled at runtime, and when you have multiple layers of services it can lead to cascading failures and complicated error handling scenarios. Additionally, one service can overrun another, causing a denial of service.
Whereas app -> q -> app connectivity is loosely coupled at runtime. When one system is down, the queue just fills up. Messaging systems also act as a natural buffer in the one-system-produces-too-fast scenario, b/c the second system is consuming data at the rate the second system can handle vs the rate at which the producer sends data.
That being said, sending query requests over messaging adds needless latency, as an API 'query' is effectively a polling-consume and the produce-to-fast and the cascading-failures problem are generally mitigated.
TLDR: You'll want both. API's for queries and messaging for commands. CQRS can be applied here:
C - command.. (create, save, delete, do some action, etc) send over messaging
Q - query.. (search, list, get, etc) send over API


Can't run XMP profile on asus Z97-A

Question: I have trident X F3-2400C10D-16GTX (2x8GB). When i open my pc, the auto-mode is on 1066 MHz.
I change it from bios (also the latency) but it doesn't boot after it and the Dram Led is red.
So to boot I press the MemOK button and everything is back to default.
I also tried the XMP profile but it had the same result.
(The CPU is Intel 4790K)
Comment: First Step;  Update the UEFI firmware to the current revision.
Comment: Try each RAM stick by itself, one at a time.  Any difference?  Did this RAM ever work right in this machine?
Comment: If i try one at a time it runs XMP without a problem, at 2400MHz. So the memory isn't broken. But when I try them together the pc doesn't boot. No the pc is new, and the memory only have worked on 1066 MHz.
Comment: @jim_f - If its already updated to the latest version, then, **you already did it**
Comment: OK, so what is the next step?
Answer:
If i try one at a time it runs XMP without a problem, at 2400MHz. But when I try them together the pc doesn't boot

This tells me that there is a timing issue between the RAM sticks then.  Either one/both or the RAM sticks are faulty, or you board has timing issues or is incompatible with the RAM form some reason.
If updating it to the newest BIOS/EFI doesn't help, then you'll need to try new RAM sticks (to rule out faulty RAM), and if they behave the same way, you need to try a new motherboard (to rule out faulty motherboard). If it still happens, then you need to try a different brand of RAM (to rule out compatibility issues).
I had a similar problem back in the day with Kinston's HyperX RAM.  One at a time was fine, but two or more couldn't keep timing between the sticks properly.  Went thru two sets of 4 sticks and a couple new motherboards, in lots of different combinations.  Then tried 4 sticks of Kinston's "Value RAM" instead and they ran perfect, and have for the last 6+ years.
Anyhow, yeah, welcome to building PCs, you need spare parts for testing and troubleshooting.
Comment: Thanks for helping. I have tried my ram at another motherboard and it runs fine at 2400. Probably the motherboard is faulty because another memory I tried it ran at 1066,and also didn't boot when I tried to change it to 1600. But it seems to me very strange because the motherboard is new. I bought it a month ago.
Comment: Trust me, after well over a decade of building computers - new hardware is often broken/faulty. :)
Comment: Hmm that's not good news. So you suggest me to try something with the warranty..
Comment: Yup, take it back where you got it and get them to exchange it. If they won't warranty it from some reason, then you'll have to contact the manufacturer and request an RMA ([Return Merchandise Authorization](http://en.wikipedia.org/wiki/Return_merchandise_authorization)) to start the in-warranty replacement processes.

Can't run XMP profile on asus Z97-A