How can you play the same game with different accounts from the same folder?

Question: I'd like to keep all my games on a different computer and the folder with the games then just gets mounted on Windows via iSCS or NFS.  This certainly works for one PC using the folder.
But I'd like to use more than one PC to e.g. play the same game with friends at the same time. Everyone would use his own account but I don't know if there will be any issues when reading and in particular writing to the same drive.
Most important stuff seems to get synced into the cloud anyways for common and recent games. I don't if games generally do a lot of writing to the program folder beyond saving the files.
I mostly have games from Steam, UPlay, Origin and EpicGames in mind.
Comment: I'm going to assume good faith and that this is not an attempt at piracy, but this sounds like a lot of effort and investment to achieve very little. What are you trying to accomplish that installing on every device would not?
Comment: I don't know how this is related to piracy. Everone uses his own account so everyone would need to buy the game. The setup is easier to manage for me. Most stuff runs diskless at my homelab anyways. Of course there has to be some "master" disk somewhere.
Comment: But have all of the accounts bought their own copy of the game?
Comment: @Studoku-ReinstateMonica use case: me and my kids. Each has its own computer and accounts, the intersection of the set of games that we play is non-empty. Having a centralized library would allow us to download games and updates only once reducing network congestion and optimizing storage usage.
Answer: If the game is designed to support multiple players with only one copy of the game (and this does occasionally happen - Spawn Mode from the Starcraft games springs to mind), then there should be documentation to tell you how it's done.  Either in a menu option or somewhere on the game's official website.
If the game is not specifically designed to support this style of play, then trying to do it on your own is probably verging on piracy, and thus off-topic for discussion around here.
If the game in question is an online multiplayer game (something like Fortnite) then the developer's servers may also have means of detecting that multiple users are all running the same copy of the game (assuming you can make it work) and that might lead to bans, account suspensions and goodness knows what else.  Not judging or anything, just FYI.
Comment: @pr0pofol I'm not trying to accuse you of anything.  My point is mainly that if playing this way is supported, there should be documentation about how to do it.  If it's not supported, it may or may not lead to consequences from the developers, so you may want to check their terms & conditions before you do it.
Comment: I see. I was not aware of that issue. I don't have piracy in mind since everyone one would use his own account. Since I can login with my Steam, Uplay ... credentials on any PC I guess  I also could play games on a different PC. I'm not sure but afaik the games are not tied to the PC but to the account. Consider this: Person 1 locks into Steam on PC1 and starts RocketLeague. Person2 does the same on PC2 with his own credentials.  They use the same installation as base but this would not be much different when Person2 logs into steam on PC1.


Case Owner Update

Question: Kind of stuck, anyone have any input. When I create a new case for Internal Appeals and set the functional area to Benefits- Ops and status to Functional Area Review, the Case Owner is updated automatically. But when I have an already existing Case and update the functional area to Benefits-Ops and status to FAR, the case owner does NOT update and stays as my name. It should update automatically like it did when I created a new case.  What can I do?
Answer: It depends on how the case object is configured. If it's a trigger, it might require an update in the code. If it's from Assignment Rules, checking the "Assign record using Assignment Rules" checkbox on the page should assign the owner correctly; if this option does not appear on the edit page, it can be added by a system administrator. If it's from a Flow update, it may require changing the value away from the criteria, saving, then switching the data back. In summary, there are a number of ways this could be assigned, so you'll need to check several different settings. You can also check the Debug Logs if you have sufficient access to determine how the owner is being changed.

Case Owner Update


A potentially dangerous Request.Form value was detected from the client

Question: When I try to post any thing that contains <whatever> I get

A potentially dangerous Request.Form
  value was detected from the client
  Description: Request Validation has
  detected a potentially dangerous
  client input value, and processing of
  the request has been aborted. This
  value may indicate an attempt to
  compromise the security of your
  application, such as a cross-site
  scripting attack. To allow pages to
  override application request
  validation settings, set the
  requestValidationMode attribute in the
  httpRuntime configuration section to
  requestValidationMode="2.0". Example:
  . After
  setting this value, you can then
  disable request validation by setting
  validateRequest="false" in the Page
  directive or in the
  configuration section. However, it is
  strongly recommended that your
  application explicitly check all
  inputs in this case. For more
  information, see
  http://go.microsoft.com/fwlink/?LinkId=153133.
Exception Details:
  System.Web.HttpRequestValidationException:
  A potentially dangerous Request.Form
  value was detected from the client

I have following asp.net code
 <asp:DetailsView ID="newsDetail" runat="server" DataSourceID="SqlDataSourceNews"
                AutoGenerateRows="False" DataKeyNames="id"
                OnItemUpdating="NewsDetailItemUpdating" OnItemCreated="NewsDetailItemCreated"
                OnItemDeleted="NewsDetailItemDeleted" OnItemInserted="NewsDetailItemInserted"
                OnItemInserting="NewsDetailItemInserting" OnItemUpdated="NewsDetailItemUpdated"
                DefaultMode="Insert">

                <Fields>
                    <asp:TemplateField FooterText="show at statpage" HeaderText="view" SortExpression="view">
                       ...
                    </asp:TemplateField>
                    <asp:BoundField DataField="headline" HeaderText="Headline" SortExpression="headline">
                    </asp:BoundField>
                    <asp:TemplateField HeaderText="Text">
                        <ItemTemplate>
                            <asp:Label ID="post" runat="Server" Text='<%# Eval("post") %>' OnPreRender="PostLabelPreRender" />
                        </ItemTemplate>
                        <InsertItemTemplate>
                            <asp:TextBox ID="postTextBox" runat="server" Text='<%# Bind("post") %>' TextMode="MultiLine"
                                Width="500px" Height="300px" />
                        </InsertItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="postTextBox" runat="server" Text='<%# Bind("post") %>' TextMode="MultiLine"
                                Width="500px" Height="300px" />
                        </EditItemTemplate>
                    </asp:TemplateField>

And the code
    protected void NewsDetailItemUpdating(object sender, DetailsViewUpdateEventArgs e)
    {
        // Iterate though the values entered by the user and HTML encode
        // the values. This helps prevent malicious values from being
        // stored in the data source.
        for (int i = 0; i < e.NewValues.Count; i++)
            if (e.NewValues[i] != null)
                e.NewValues[i] = Server.HtmlEncode(e.NewValues[i].ToString());
    }

    protected void NewsDetailItemInserting(object sender, DetailsViewInsertEventArgs e)
    {
        for (int i = 0; i < e.Values.Count; i++)
            if (e.Values[i] != null)
                e.Values[i] = Server.HtmlEncode(e.Values[i].ToString());
    }

    protected void NewsDetailItemUpdated(object sender, DetailsViewUpdatedEventArgs e)
    {
        newsList.DataBind();
    }

    protected void NewsDetailItemInserted(object sender, DetailsViewInsertedEventArgs e)
    {
        newsList.DataBind();
    }

    protected void NewsDetailItemDeleted(object sender, DetailsViewDeletedEventArgs e)
    {
        newsList.DataBind();
    }

    protected void NewsDetailItemCreated(object sender, EventArgs e)
    {
        newsList.DataBind();
    }

Comment: I was going to tag this as a duplicate, but then I wasn't sure which of the 15 duplicates to pick...
Comment: Are you trying to post HTML / Javascript as the content of one of your text boxes?
Answer: The problem you're having is that in one of your text boxes you have put html tags or just the < > symbols and the .net framework tracks that as a potential dangerous script.  This is to prevent people from putting malicious script tags in the input fields.
You can work around this by putting in your page directive ValidateRequest="false" you will also have to put in your web.config <httpRuntime requestValidationMode="2.0" ... />
Comment: There's also the option of encoding pre-submission, to help ensure that none of the content passed back to the server is malicious.
Comment: I'm use the Server.HtmlEncode, so I do not think I should get this error. Am I using it wrong?
Comment: Unfortunately, you'll still be posting back the potentially dangerous content before the server is able to encode it.  And, thinking through my previous comment, you'll never to guarantee that the content coming back has actually been encoded (disabling JS, etc.).  So the right way probably is disabling validation for this page specifically, and making sure you encode everything entered on this page on output.
Comment: @IanPugsley could you elaborate on why you cant guarantee the encoding? Is there any other safe workaround for this error that you know of?
Answer: Try this web.config file In
add or set httpRuntime requestValidationMode as
<httpRuntime requestValidationMode="2.0"/>


Is the idea that there is always at least one illness with an unknown cure - a Jewish idea?

Question: I have heard many times that there will always be at least one illness that is uncurable. Is this a Jewish idea? What is its source?
Comment: This is not an answer, which is why I'm not posting it as such, but there's a story (the veracity of which I can in no way vouch for) that the _Chazon Ish_ claimed that he could cure cancer (presumably through his genius, by discovering the cure, though I've seen some interpret it as meaning that he could divine the cure through _ruach hakodesh_; in any event) but he did not do so because God would simply send along another illness as bad. This story is mentioned (in one of its variants) at http://parsha.blogspot.com/2009/07/did-chazon-ish-violate-did-chazal.html for example.
Answer: I'm thinking no because in Sefer Nishmat Avraham- Orach Chaim Siman 1 it is written: "Indeed, Chazal stated: The Holy One, Blessed be He, said: There is no illness for which a complete cure is not already present.
The footnote says(I'm translating from Hebrew) Tanchumah Yitro Chet


How can I read the color of a specific pixel in XNA?

Question: I want a way to find out if, for example, the pixel at Vector2(2, 5) on the game window is color Color.Red, or some other color or set of coordinates. How can I do this?
Answer: I would imagine render all your going to draw to a texture, and then ask the texture for it's color data. I've never tried it myself, but that's where  I'd start. I would rather have left this as a comment.
Answer: Render your scene to a texture render target (RenderTarget2D) by creating one, setting it active via SetRenderTarget and then drawing your scene. Since a RenderTarget2D is also a Texture2D, you can use the GetData method to copy the texture data to an array of the appropriate type, which you can index to acquire the appropriate color data using linearized 2D indexing (that is, compute the index as index = (y * width) + x, where width is the width of the texture).
Note that the "appropriate type" of the array will depend on the format of the render target you have created.
Generally, this is an inefficient collection of operations relative to other possible ways to achieve the overall end-result you are looking to achieve. However, since your question doesn't provide further details about why you want to read the color data at a specific pixel, it's difficult to provide further guidance. Consider asking another question with more details about your end goal.
Comment: This was what I found to work best for me. In the end, I didn't end up using it, but thanks for leaving an answer!


Functions of Random Variables

Question: In what cases would I want to know $\operatorname{E}\left[e^X\right]$?  I'm in an introductory probability course and I'm presented with exercises like this often, but I'm wondering when someone would want to know, say the probability density function of a random variable $Y$ for $Y=2X$.  When is it important to explore functions of random variables instead of just the random variable itself?
Comment: It's important to evaluate expectations of functions of random variables whenever you're interested in knowing either the expectation of that function of the random variable, or the expectation of the distribution of a random variable transformed in that way (the law of the unconscious statistician makes those two things equivalent). This happens pretty much *all the time*. For example, people often analyze data on the log-scale (that is transform data by taking logs in order to analyze it). They might then want to discuss what it means on the original scale. ...(ctd)
Comment: (ctd)... So if $X$ is the log-scale variable, but they want to talk about the mean of the original variable, they're interested in estimating $\text{E}[e^X]$.
Answer: 1) $MGF_X(t)=E(e^{Xt})$ is the definition of the moment generating function of a random variable, which is a very convenient tool to work with.
2) The statistical estimators, like OLS, MLE, etc, are by construction functions of random variables.
3) Apart from the above, we consider functions of random variables whenever a theoretical model leads us there, or whenever a non-linear transformation induces (or is thought to induce) desirable properties at the technical estimation level.
Two examples:

You want to estimate the parameters of a "Cobb-Douglas" production function, $Q = A K^aL^{1-a}$. ($Q$= quantity, $K$=capital, $L$=labor). You take the logs to transform the problem into a linear one

$$\ln Q = \ln A + a\ln K + (1-a)\ln L + u$$
Now you are dealing with functions of random variables. If you want to consider the estimated error term back in levels you will have to consider $E(e^u)$.

You want to estimate a binary-choice model, using the logit specification. $Y$ is the 0/1 binary dependent variable, $X$ is a matrix containing the variables that are thought to affect the probability of $Y$ acquiring the value $1$. Your model is

$$P(Y=1\mid X) = \Lambda(X) = \Big( 1+ \exp\{-a-X\beta\}\Big)^{-1} $$
and it contains functions of random variables.

Functions of Random Variables


Where do the scriptures mention Ashtvinayak temples?

Question: Ashtvinayak are eight holy self made (Swayambhu) idols of Lord Ganesh. All of them are in Maharashtra, namely Chintamani, Siddhivinayak, Vigneshwar, Ballaleshwar, Varad vinayaq, Mahaganpati, Mayureshwar and Girijatmaj. I want to know which scriptures describe them and how.
Answer: Girjatamaj in Lenyadri (Shree Girjatmaj Vinayaka-Lenyadri) refers to the first of the eight Ganesha temples part of the Ashtavinayak pilgrimage.—In Maharashtra (a state in central India) there are eight revered temples dedicated to Vinayaka (eight images of Ganapati). [...] The names of the eight kshetras (shrines) [viz., Girjatamaj] are listed in the mangalashtaka-sloka. This sloka is always recited during a religious ceremony. [...] The Ashtavinayak pilgrimage (visiting the eight shrines of Ganapati) is believed to guarantee eternal bliss. That is why many want to do it at least once in their life.
Ashtavinayaka temples [viz., Girjatamaj] are ancient, they are mentioned in the texts of Ganesha Purana and Mudgal Purana. However, most of the kshetras (shrines) were rebuilt and restored during the reign of the Peshvas (supreme rulers of Marathi).


Class with static members vs singleton

Question: Isn't a class with only static members a kind of singleton design pattern? Is there any disadvantage of having such a class? A detailed explanation would help.
Answer: This kind of class is known as a monostate - it is somewhat different from a singleton.
Why use a monostate rather than a singleton? In their original paper on the pattern, Bell & Crawford suggest three reasonns (paraphrased by me):

More natural access syntax
singleton lacks a name
easier to inherit from

I must admit, I don't find any of these particularly compelling. On the other hand, the monostate is definitely no worse than the singleton.
Comment: There is the difference that space will not be allocated for a singleton unless it is used, but in practice a singleton object that is never used seems like a rare case. Does anyone have a common use-case where this would be important?
Comment: Different yes, but doesn't it achieve exactly the same thing?  I can't see how this has any advantages or disadvantages over the "traditional" singleton, in C++ at least.
Comment: I also tend to think that the lazy-construction feature of typical singletons is useless in most cases -- those where we just need a global variable. However, in library case, we may need an on-the-fly construction in order to simplify the end-user's (developer actually) code.
Comment: First link is broken. Perhaps update with this one? http://wiki.c2.com/?MonostatePattern
Answer: Robert C. Martin wrote an article some times ago about the differences between the mono state pattern and the singleton pattern.
Comment: Based on the article, the only material differences that I could see were that in Java, destruction of a Monostate is guaranteed but it cannot be passed between JVMs -- are there any differences relevant to C++?
Comment: It's exactly the same as with other variables. If it is dynamically allocated, it should be deallocated with a compatible deallocator. If it is in the static storage (see GOTW/XC++, IIRC), it will be destroyed and the end of the program, but there is no way to implement dependencies.
Comment: Regarding the dependencies aspect, A.Alexandrescu's loki (from MC++D) singletons, and ACE singletons permit to specify dependencies. BTW, they are both non intrusive singletons.
Answer: Consider a family of Logging classes.  They all implement "LogMessage(message, file, line_number).  Some send messages to stderr, some send email to a set of developers, some increment the count of the particular message in a message-frequency table, some route to /dev/null.  At runtime, the program checks its argument vector, registry, or environment variables for which Logging technique to use and instantiates the Logging Singleton with an object from a suitable class, possibly loading an end-user-supplied DLL to do so.  That functionality is tough to duplicate with a pure static Singleton.
Answer: For a singleton all constructors have to be private, so that you can access only through a function. But you're pretty close to it.
Comment: If this answer is so wrong that it deserves 5 downvotes, could you leave a comment why? Something like 'wrong wrong wrong' is not helpful and I'm still not convinced that I'm wrong.
Comment: If you really think that you should read about singletons again. Private constructors and one or more static members only accessilbe through a public member function is the very definition of a singleton
Answer:
class with all static members/methods
  a kind of singleton design pattern

Class - not pattern. When we talk about classes we can say class implements pattern.

Static functions - is not member functions, they are similar on global functions. Maybe you don't need any class?
Quote from wikipedia:

In software engineering, the singleton
  pattern is a design pattern that is
  used to restrict instantiation of a
  class to one object.

By this definition your implementation is not singleton implementation - you don't use common idea One (or several in extended definition) instance of class.
But sometimes (not always) usage of class with all static functions and singleton pattern - not have meaningful difference.

Class with static members vs singleton


How can I maximize the number of troops recruited from Visiting Monarchs?

Question: When I defeat another country, I always recruit 10% of the their troops to join my army. But when I defeat a visiting monarch, the number of troops that I recruit seems to vary quite a bit. Naturally, I must recruit as many troops as possible, so what strategy can I use to recruit the most troops from a visiting monarch?
Answer: Unfortunately, the number of troops you can receive from a battle is completely random. You will usually, if not always, receive more troops by fighting than by greeting peacefully, but aside from that, the number you receive is random.


Abstract published but no link to full paper

Question: I just came across this publication (link below) in the AHA journal. it has a summary/abstract of the research but no link to the full research paper. Would anyone be able to explain the reasoning behind this.
https://www.ahajournals.org/doi/10.1161/str.49.suppl_1.180
Answer: There's no full paper associated to that abstract, because it's a conference abstract, not a paper abstract. If you go up one level from that link you'll find:
International Stroke Conference Oral Abstracts
That is a collection of the abstracts of the works presented at that conference. This is common in some conferences: authors submit only a short description of their work, typically half or one page long. In the past, these submission were typically collected in a book of abstracts which was given to the participants at the beginning of the conference. Nowadays, abstracts are more commonly distributed in electronic form.
Comment: Note that the presentation may well have covered material from one or more recent papers by the author.  One can search for those papers.


What is the difference between simple histogram and histogram LBP?

Question: What is the difference between a simple histogram and a histogram LBP (local binary pattern)? Can someone provide the intuition behind histogram LBP?
Answer: I have read the wikipedia article for LBP and decided that they are using the word "histogram" incorrectly. They should really be referring to "binning". The former does "binning" as a pre-processing step, but the etymology of histogram suggests that it is only appropriate to call a graph which depicts frequencies using vertical columns a histogram.
The LBP is a rudimentary unsupervised classifier. It uses quadrants to bin and calculates local frequency maxima using nearest neighbor. All of these processes could be modified using other more sophisticated ML techniques.
EDIT: It looks like images can be further processed and indeed represented with some kind of histogram like here. It basically serves to graphically represent the features of an image, presumably if it's adequately normalized the bars should represent the intensity/darkness of various cells in the binned graphic. Each 2-D grid member is mapped (in a serpentine fashion) to the 1-D "feature" axis and the corresponding frequency is displayed. I haven't worked with this much, but I imagine the steps necessary to adequately normalize pictures "in the wild" would be impossible.
Comment: +1 that binning alone does not define a histogram. And you're right about the etymology. But in many subjects there is no problem about histograms being presented as _horizontal_ columns (bars, if you will). Whenever the variable is altitude or depth below surface, as is common in the Earth and environmental sciences, that widely appeals as a natural and congenial display.
Comment: @NickCox you're right. I would never disagree with conventions that make sense in a particular discipline. For instance, in marine sciences aquatic depth (usually an independent variable) is often depicted as a Y axis variable is presented in the negative... appearing like you're diving underwater.


Muslim Girl Commit sins

Question: I am A Muslim Girl.  I never did sexual things in life, I am single. Once my colleague (Muslim Boy) offered me a coffee, In the car, he forced me to suck his dick and threaten me. I was afraid if he will do something wrong with me, I sucked his dick for a few minutes and he sucked my breasts. I am very tensed. Kindly tell me if Toba can purify me? my intentions were never bad? I am very worried and I left doing Ibadah, plz guide me.
Comment: @Sassir Perhaps she is in a society where women would get blamed for losing their "purity" even if they were forced. Sadly, it is very common.
Comment: You should have told this your parents and the authorities this is a crime and you didn't commit any sin if you were forced to do it.
Comment: Why were you doing hanging with a pervert boy and alone with him in the car, you should know better.
Answer: "In the name of God, the Most Gracious, the Most Merciful."
Assalamu Alaikum,
My Dear Sister, Allah S.W.T is merciful and forgiving. First of all don't be in contact with non mahram. When a boy and girl is alone then the third one is Shaytan.
it is said that when a person feels unhappy about the sin, it is the sign of a believer. You can see, there is true repentance at the end of verse.True repentance means that you should use that unhappiness in your heart a sign of repentance.
Secondly, It's a Crime he did Try talking about to your parents and police(Only if you are fine with it). And stay away from that molester. Please Do Recitation daily, Do Namaz of 5 times, and Do Astagfar. Ask for sincere repentance and Inshallah You'll Be Forgiven. Form next time onwards please don't be alone with a non mahram and avoid bad friend circle. Also,
May Allah Forgive You.
Allah Hafiz

Muslim Girl Commit sins


Does it matter what level of Prison of Elders I use my treasure key?

Question: A treasure key can be used on any level of Prison of Elders after finishing it.  28, 32, 34, 35.  I know that completing higher levels gives additional completion rewards, cores, etheric light, etc.
Does it matter if I use a key on 28 vs. 35 for the chances to get better equipment?  I'm looking for something like the VoG and CE loot tables that explained which legendary and exotics dropped where.  Or, ideally, that it doesn't matter so I can turn them in on 28.
Comment: I'd like to know exactly this as well.
Comment: Also, [this page](http://destinytracker.com/destiny/wolvesloot) doesn't answer the question, but does show some things that you can get
Answer: I don't know this for a fact, but to the best of my knowledge it doesn't matter, with one exception.
The loot table of the big chest is the same regardless of difficulty. The items you can get include Queen's weapons, and Fallen weapons (like what Variks sells in the Reef). The only exceptions to this are the following:

The first time you open the big chest with a character, you will get an exotic item
After Prison of Elders level 35, it can drop (this might be guaranteed, I'm not sure) a ship, shader, and/or emblem

I am saving 1 key for when I finish Prison of Elders on level 35. In addition, there is a chance that the Elder Cipher will drop when defeating the final boss on Prison of Elders level 34 or 35. One of the steps of this bounty requires the Queen's Cipher, which only drops from the big chest in the challenge modes (level 32, 34, and 35), so it is a good idea to keep a few keys around for that as well.
Comment: Also good to note, the Queen's Cipher - which you need for the Elder Cipher bounties - only drops from the treasure chest in challenge modes, so 32, 34, and 35.
Comment: @VanBuzzKill thanks for that info - I've added it to my answer.
Comment: I have downed Skolas 8 times now. I have opened the large chest each time. I have gotten two ships, one emblem, and one shader from all of those rolls. I do not believe that it drops all three at the same time though (as *and* seems to indicate). Perhaps it can be edited to say "or"?
Comment: @TravisJ I edited it to say "and/or". The first time I did PoE 35, all 3 dropped. Since then it has either given me none of them, or some combination of them.
Answer: From what I have read and seen from experience, the big chest is the same in all PoE instances. The differences are in the smaller chests, as guaranteed items will drop even if you don't have a key in levels 32, 34 and 35.
Also, the first time you open the big chest, the exotic is not guaranteed but the chance of getting one is increased. I know for a fact since I did witness a friend not getting an exotic on his first opening.
Answer: It doesn't matter if you use the key on the 28 compared to Skolas (35). The only difference that will occur is that chance of exotics. The lvl 28 prison has a lower chance for exotics where the 35 has a higher chances for exotics.
I hope this helped. Good luck Guardian.


Laravel: Set asset without protocol

Question: Use asset helper function like below:

will get

Is there any laravel build-in solutions can let it be

and properly display with http and https protocols?
[EDIT]
I know that Laravel normally detects the protocol correctly, but when behind a load balancer, it does not. So I'm still looking for a solution to this.
Comment: Did you find a solution to this?
Comment: You realize the `asset` helper has a second argument `$secure`? That means `{{ asset('/assets/js/jquery-2.1.1.min.js', true) }}` should give you want you want, if you know the protocol needs to be https.
Answer: Laravel create secured link only if the request is considered as secured.
Laravel has already a way to treat non httpS traffic as "secured" if it's comming from a "trusted proxies".
You can declare such trusted proxies in your application service provider like that:
 Request::setTrustedProxies(array( '188.8.131.52/21', 'some other range'));

Also, make sure your loadbalancer set the following headers correctly:
Host, X-Forwarded-Host, X-Forwarded-Port, X-Real-IP, X-Forwarded-For and X-Forwarded-Proto

"Public" proxies such as cloudflare already does this btw.
Basically the point here is that client connection is terminated at one of the frontend servers (acting as a proxy), thus we have to declare communication from that server as trusted so that laravel use headers from the proxy server instead of the values readed localy.
Doing this enable functions such as Request::isSecure() or Request::ip() to return a consistent result.
Answer: Laravel will automaticly change the url of the asset to the protocol used to load the site.
If your site is loaded over a secure connection, the asset links will automaticly use https.
Update:
If you do want to display the assets with only //, you could write your own HTML macro.
Comment: The problem is that if a site is behind a load balancer, it shows http links where it should be https links.
Answer: I had the same issue, then I discovered that the asset() method has an optional second variable, true or false for SSL requests.
The solution that I use is the following:
<link rel="stylesheet" href="{{ asset('assets/bootstrap/3.3.7/css/bootstrap.min.css', !App::isLocal()) }}" />

Notice:
!App::islocal()

If my application environment is local, SSL isn't chosen, however in the production environment the assets will be called over SSL.
Comment: Thats not the same as `//`
Comment: Yup, true. However it will properly allow make a request over SSL, as the asset method is being told to provide it.
Answer: The code that generates asset URLs is in illuminate/Routing/UrlGenerator.php
There is a forceSchema() method which could be easily modified to do what you require, though to be honest this functionality should probably be in Laravel and it may be worth submitting a pull request on their github.
Answer: You should check this article http://ankitpokhrel.com/explore/overriding-base-url-in-laravel-5/. basically you can override url() function in your AppServiceProvider to generate urls like /assets/something.js instead of http://example.com/assets/something.js
Answer: asset() generate a URL for an asset using the current scheme of the request (HTTP or HTTPS):
And if you want to provide an external URL for which you don't know about http or https like cdn URL you can write like below

However you can write like

OR

Answer: I normally use

without calling the asset() function
dirty I know, but in 90% of the sites I worked, it is a perfect solution
Answer: This might help someone.
Helper function way :
function schemalessAsset($path)
{
    if (url()->isValidUrl($path)) {
        return str_replace(['http:','https:'], '', $path);
    }

    return url()->assetFrom(url()->formatRoot('//'), $path);
}

Macroable way :
URL::macro('schemalessAsset', function ($path) {
    if (URL::isValidUrl($path)) {
        return str_replace(['http:','https:'], '', $path);
    }

    return URL::assetFrom(URL::formatRoot('//'), $path);
});

Tested in Laravel 5.6. It should work in other versions as well.

Laravel: Set asset without protocol


Inanimate Possession

Question: I have been doing a lot of reading on possession and there still seems to be a lot of confusion amongst people.
For example, two weeks' notice requires the apostrophe because it is two weeks of notice. So using that principle, wouldn't it be finals' week rather than finals week? It is the week of finals.
Even more complicated, Christmas tree would never be seen to have an apostrophe, yet it is the tree of Christmas. Can anyone care to explain?
Comment: Do you have a linked reference to *final's week*? Without the apostrophe, *finals* and *Christmas* would function as adjectives, describing *week* and *tree* respectively.
Answer: Finals is a noun referring to a series of examinations at the end of a degree course, making finals week short for "a week of final examinations" (final as in the last exams the students will take that year).

final (n.) - A series of examinations at the end of a degree course: An examination at the end of a term, school year, or particular class.

The Christmas in Christmas tree is an adjective, and it is used to indicate that it is a Christmas-themed tree. The tree does not belong to Christmas.

Christmas tree (n.) - An evergreen or artificial tree decorated with lights, tinsel, and other ornaments at Christmas.
Comment: I see, but then how is two weeks' notice justified as possession?
Comment: @user155925 - it's not possessive. http://english.stackexchange.com/questions/103849/should-two-weeks-vacation-be-two-weeks-vacation-possessive
Answer: Two weeks' notice is the notice of two weeks, just as old time's sake is the sake of old time. When the apostrophe is omitted, the words "two weeks" in "two weeks notice" seem to function no different than the words "one week" or "three day" would in their place, since the "s" in "two weeks" indicates plurality and not possession as it would, e.g., after a name, and the phrase "three day notice" is ugly and demands either an added "s" for possession or a hyphen.
On the other hand, "finals week", though it's also "the week of finals", is the week on which finals occur, and not the week of the finals. (I know I am using the italicization arbitrarily and the semantics about "of" are a little hazy, but I think it makes the point.) I think it's from the letter "s" that confusion arises. Finals are just a thing, and "finals week" is the week associated with that thing, the same way "Christmas" is a thing and "Christmas day" the day associated with it, not "Christmas's day".
Answer: A case could be made for finals and Christmas being used as adjectives, but not a very strong one.
Stuff of this kind is idiomatic. I'm beginning to hate that word, but what can I do?
Why is it ice tea but iced coffee? Go figure.
Comment: It's *ice tea* because it used to be *iced tea*, but the /t/ at the end of *iced* and the /t/ at the beginning of *tea* got smushed together into a single /t/.
Comment: Many people do still write "iced tea" actually, although "iced cream" seems to be completely dead. @PeterShor: elision of the /t/ or /d/ can also occur before a different consonant, though, so I think a complete explanation will relate to the age of the compounds: older compounds are more likely to have lost the dental consonant

Inanimate Possession


Store SSH command history on local machine

Question: I often use SSH to connect to ARM machine which reboots regularly and doesn't have any persistent memory to store sh command history. Is there a way to store such history on my local machine so it could be accessible by ^R and up/down when connected to the remote? Or is there another workaround to such problem besides storing most useful commands in a notepad? :)
Comment: What shell do you use on the ARM machine? It probably can be configured to store a history file to the ramfs or whatever non-persistent filesystem the machine is using. Then, replace your remote `exit` comannd by an alias, which copies that history file to your host before exiting and replace your `ssh` call by a copying of the saved file back to the machine before actually connecting.
Comment: @Philippos pure `sh` (not `bash`) wrapped into `BusyBox 1.20.2`
Answer: A possible solution is the rlwrap program, dating from 1999,  which should be available on your home machine in a package of the same name. It uses the GNU readline library to front-end any command with a re-usable history that is saved by default in a file ~/.command_history, so in your case it should end up in ~/.ssh_history if you do:
rlwrap ssh remote

(If you want to test this to a remote running an application or shell that already has readline built-in, you will need to disable the remote readline. For example with a remote bash do: rlwrap ssh remote bash --noediting to see it working.)
Comment: This looks like a great solution with a single downside: if I use `rlwrap ssh user@ip sh --noediting` I do not get the shell "prefix" (`~/dir $ _` one), just an empty line. Is there a way to fix this?
Comment: I was hoping you wouldn't need this option. I was using it because I don't have a remote that runs a busybox sh so was pretending with a remote bash. The problem seems to be a conflict between the remote using readline and so putting the terminal in raw mode, and rlwrap trying to do the same. What might work is to ask ssh to not provide a pty (use `-T`), but then you will lose job control on the remote.
Comment: `-T` in pure `ssh` causes the same prompt loss, and in `rlwrap ssh` it doesn't change anything. Also autompletion doesn't work and `^C` and `^Z` are sent to host machine. Apparently this tool causes more problems than it solves :(
Comment: It seems `rlwrap -a ssh remote` should allow rlwrap to handle the problem you have, without resorting to `--noediting` in your shell.
Comment: Yes, the `-a` option fixes prompt. The autocompletion seems unfixable without direct specifying of completion file, from what I've googled. It is nice to know that there is atleast formal solution to my problem, even with its downsides.


How to bootstrap caching in dependency module in Springboot?

Question: I have a module that defines caches as per similar to this blog, which is being brought in as a dependency in another module.
However the caching isn't being bootstrapped in the main application.
How do I configure springboot app to bootstrap the cache(s) defined in the dependency?
Answer: Caching happens on two possible scenario

On Method Invocation
Manually Put the object in the cache

going by the example in your question, let's understand the method below
<code>@Service
public class NumberService {

    // ...
    @Cacheable(
      value = "squareCache",
      key = "#number",
      condition = "#number>10")
    public BigDecimal square(Long number) {
        BigDecimal square = BigDecimal.valueOf(number)
          .multiply(BigDecimal.valueOf(number));
        log.info("square of {} is {}", number, square);
        return square;
    }
}
</code>
The method square   will cache the result for all inputs(let's say 1 to 10 ) if you want it to cache square of all possible input values, all you need to do call the method with all possible value. You can do this at startup.
This URL How to load @Cache on startup in spring? will help you
Below is one sample
<code>@Service
public class NumberCacheScheduler {
    @Autowired
    NumberService numberService;

    @PostConstruct
    public void init() {
        update();

    }

    public void update() {
        for (long l=1l; i <=10,l++) {
            numberService.square(l);
        }
    }
}
</code>
Comment: Thanks but I am asking how can I configure springboot to bootstrap caching defined in a **dependency module**. I don't want to have to redefine the caching in the application since the dependency module has already taken care of everything.
Comment: without knowing the dependency type The moment your application's initialization is complete the scheduler in your application can call the caching method in dependency and caching of dependency should serve the cached data (unless you are required to set up caching too)


What could be the reason of an HP Proliant ML110 G6 server to restart automatically?

Question: We have a HP Proliant ML110 G6 server running (Windows 2012 Server R2) which is giving problem since last few days. The problem is that it restarts automatically and randomly. By restart I mean to say, it reboots automatically while running. We are unable to figure out the cause. There is no fixed time for reboot. Sometimes, it works for a few hours before reboot and sometimes it lasts only a few minutes. Could it be an issue with power-supply that stops giving power after some time? Do you have any directions that we need to look into?
Comment: What do the OS and iLO logs say?
Answer: Does the system have an iLO meta computer?  Look in all iLO event logs, there should be a message indicating that iLO thought the Operating System had "locked up" and so the hardware needed to be reset.
In the BIOS settings turn off all WatchDog timer features, otherwise known as Automatic Server Recovery or ASR.  A WatchDog timer in the baseboard management controller monitors a timer reset by the operating system every so many seconds.  If the operating system allows the timer to expire, ASR kicks in and electronically resets the system.
Answer: In Event Viewer, look for Event ID 100 under Microsoft-Windows-Diagnostics-Performance to identify when the server started. Then look the events preceding that in System/Application logs to maybe find out why it rebooted.
If you can't find anything, try to run a complete system diagnostic from the BIOS (memory, CPU, etc) and check the iLO logs (as suggested by Chopper3).


theory question: Key of D, the 2, 3, and 6 chords are shifting to major chords?

Question: I am playing a song in the key of D (or B minor actually, which is D), but inside of the song, the 2,3 and 6 chords are changing to major chords instead of minor chords.  Bm becomes B. E minor becomes E. F#minor becomes F#.  Whats happening here? Have i shifted to another key? Is it chord substitutions in some way? is it a mode or something? i'm confused.
"Once Upon a December" is the name of the song.
Comment: Both. The only rule for changing keys or modes is what one finds aesthetically pleasing. There are some general tendencies for when making a switch works better or worse, but it can be done at any time of one's choosing, and it is extremely common.
Comment: Given your description, it sounds like the song switches from B minor to B major. In that case, the song is changing mode (minor to major), but not key (B).
Comment: thank you! that helps. Can you just switch back and forth like that whenever you want to when composing? Is that common? or is there a rhyme or reason to it?
Answer: I had a listen to Anastasia and it's very much in the minor.  It starts in Bm then modulates up a semitone to Cm, and ends up in another shift to C#m.  Adding accidentals within a key adds flavour and interest, but the song is still based in the minor.
By the way, Bm is not D.  They simply share the same key signature - two sharps.
Answer: Here are the chord changes for the first half of the verse in "Once Upon a December":

Bm F# B7 E
Em Bm Em F#

The song as a whole is in B minor, which is clear just in these chord changes. However, the presence of both major and minor chords can lead to some confusion. Here's what's happening:

Bm: this is the i chord -- the "home base" chord at which the song most feels at rest.
F#: this is the V chord -- were the song to follow the B minor key signature strictly, this would be a minor chord; however, it is customary to make the V chord into a major chord. Even with the alteration, it is still considered part of the key of B minor. (As to why that is, I leave for another question.)
B7: this is clearly not part of B minor, but it's also not part of B major, even though it has a major sound within it. This chord actually comes from the key of E, where it is the V (dominant) chord. (Note that the next chord is E). The B7 chord is what is known as a "secondary dominant" (What is a secondary dominant chord?).
E: There are two ways to consider this chord. We could look at the B7 E and a (very) brief visit to ("tonicization of") the key of E major, and that would be perfectly correct. But the better analysis, IMO, is that E major is "borrowed" from B major, making it closely related to B minor. This technique is called "modal mixture". In either case, the previous B7 chord serves to intensify feeling of movement toward the arrival on the E chord.
Em: This is the iv chord of B minor. It's an easy-to-hear shift from E major and helps our ears adjust back to B minor.

As a final point, it's important to understand the B, E, and F# chords as the I, IV, and V chords of B minor. The Roman numeral designations have meaning about how the chords function within the (key of the) song. To consider the song in the key of D major would mean that D is the "home base" sound, and the chords would operate in different ways as II, III, and VI chords.
Answer: Basically, whenever you encounter a non-diatonic chord, it's safe to assume that something happens with the harmonic feeling at least at that point. The same goes with non-diatonic notes in the melody, i.e. if there are accidentals, unless it's a very short embellishment. Here is a very basic example, where the non-diatonic D chord is used in a C major key context.

The melody doesn't always reflect the modal change, but backing chords usually do. The example above - a "secondary dominant" D major in the key of C major - is so common that many people don't even think about it as any sort of "modal" anything, but the F note being temporarily changed to F# is a small temporary change to the intervals around the tonic. In other words, the 4th scale degree is temporarily raised to an F#, which makes the set of notes the same as in the G major or C Lydian scales. But that change only lasts for the first half of the second bar in the example. It doesn't have to mean any kind of key change, it's just a temporary change in the intervals around the tonic.
Here is the same example transposed to D. The key signature, two sharps, sets the default diatonic scale, and whenever changes are needed, they are denoted with temporary accidentals. The temporary change is canceled out by either the next barline, or an explicit natural accidental.

But the melody or other notes don't necessarily have to utilize the temporarily modified scale degrees, so you might not see any accidentals.
In your example, when there's a B, E and F# major chords when you used to have the D major scale as your set of expected intervals, there's just a temporary change of modal feeling. Depending on how widely and for how long the different modal feeling stays, you might classify it as a modulation or modal interchange or modal mixture. But the term and classification between different theoretical categories doesn't really matter. It can be a subjective gray area, and argueing over what is the "correct" categorization doesn't make you understand it any better. What matters is that you can identify the possible sets of intervals you feel there is in the harmonic context around the tonic at each point.
Comment: thank you. that was helpful.  i have just started to learn about modes, so i was wondering if that had anything to do with it, but i see what you mean about people fighting over what mode changes it actually is, etc.  The theoretial categories are starting to interest me.
Comment: @michele Theoretical categories can be useful in exercises when learning, but in actual music, nobody really cares about the classifications. :) The only thing that matters is that you're able to use notes and chords which serve the piece.
Answer: There is really no way to know exactly what is happening without the melody.  If there are accidentls in the melody then clearly there is a key change, even if momentarily.  However it could also be an example of a cycle extension.  This is very common and also happens the other way, i.e. major changing to minor.  As an example the 3 chord is the V of the 6 chord (relative minor), so making the 3 major provides the right harmony to create a resolution to the 6 chord. In All Of Me the changes are C, E7, A7, D-7, in the key of C major.  The entire string of chords hints at landing on D minor.  The melody also has the G# over the E7 chord, but even if it didn't the E7 would be a nice extension before moving to A (maj or min).  Think of all the places the 2, 3, and 6 chord can move to.  2 goes to the V chord, so a 2 Maj would act as the V or V in the original key.  The 3 chord is the V of 6, and the 6 chord is the V of 2.  You have a circle of 4ths moving from iii --> vi --> ii --> V --> I, and one commonly encounters, III7 --> VI7 --> II7 --> V7 --> I in Jazz rhythm changes.  You can even slip them in right before the change,
iii --> (III7, vi) --> (VI7, ii) --> (II7, V)... etc
Even is there are no accidentals in the melody this device can create a lot more harmonic texture to the arrangement of a song.
Going the other way one frequently encounters the Amen cadence IV --> I modified with a iv chord creating a chromatic walk down, IV --> iv --> I.
So the presence of the majors on a minor, or minor on a major can be there for different reasons.
Comment: In All of Me, I don't hear the E7 leading towards Dm. Maybe we've played it so oftenthat's what we expect, but E7 only leads to A(7). It could be considered V/V/i, but the relationship between E7 and Dm will only work with the stepping stone of A7 to bridge the gap. Could have gone to Am and stayed there.
Comment: I didn't mean to imply that.  It leads to A which leads to D.  I tend to take wide angle view of progressions when listening.  D7 to A7 does not sound resolved to me but the entire sequence lands nicely on Dm
Comment: It could have gone to... but didn't and that's important.
Comment: I guess you meant E7 (not D7) to A7. If you did, it wouldn't sound resolved - two reasons - dominant chords, and moving I>V. A7>Dm  of cousre works - V>i.


What is the most recommeded Gif creation plugin for sketch

Question: I am new to sketch and I am looking to make animated gif's like I do in photoshop, Is there a plugin that can do this probably with a timeline too?
Comment: What have you looked into thus far?
Answer: I don't think it is possible to have a timeline in Sketch for creating GIF's but please correct me if I'm wrong.
There is a good plugin, which allows you to view images in a art board and in key frames and piece them together in order to create a GIF, so this is probably the sort of plugin you are looking for.
It is known as Generate GIF and I have posted the download link below.
https://github.com/nathco/Generate-GIF
I'm sure there is plenty of videos on YouTube demostrating the use of this plugin.
Please let me know how you get on.
Answer: There's none with a timeline that I know of at the moment. Besides generate gif mentioned by miotik (which works well with the Frame Sequencer Plugin), there's AnimateMate, which does automatic tweening and easing.
In my experience none of these are enough for more complex animations where you have to move several objects, but will do fine for more simple ones. I ended using Fireworks for more intricate work.


Could anyone point me in the direction of some resources on conversational writing?

Question: I'm looking to improve my writing. I would love to know if anyone has any tips on developing an engaging conversational writing style.
Comment: Herr, I find this question very broad. Consider: what's "an engaging conversational writing style"? All writing tries to be engaging; how is "conversational" writing different than regular writing? So, what I think would be very helpful would be if you explained what it is you're writing, and where you're having trouble being conversational. Even if these were only there as examples, the question would be much clearer and we could give more thorough answers. :)
Answer: The best advice I can give you is to study the works of writers who have mastered the lively, conversational style. There are many to recommend in this regard, such as Robert Parker, Elmore Leonard, Charlie Huston - the list is long.
Answer: +1 to Elmore Leonard, esp. his 10 Rules for Writing.  (Read the reviews or get it from the library before you buy new; some people think it's a waste of money.  I think it's priceless.)
Mostly?  Listen to what people say.  Take notes.  You don't need to write in dialect, but chances are, you need more periods.  My written sentences are way longer than my oral ones.  Hardly anybody ever speaks a semi-colon in conversation.


What Are the Way of Repentance and the Way of Eternal Life?

Question: Gaining eternal life through faith in the Lord is the longing of many Christians. But is it true that we can attain the way of eternal life by accepting the Lord's salvation, repenting and confessing our sins to Him? What is the difference between the way of repentance and the way of eternal life?
Answer: I confess I've never heard the expression "the way of repentance" but the Bible has plenty to say about the way of salvation that leads to eternal life.  However, eternal life is a free and undeserved gift from God and cannot be earned:
Ephesians 2:8-9

For it is by grace you have been saved, through faith—and this is not from yourselves, it is the gift of God—not by works, so that no one can boast.

Jesus is "the way" of salvation that leads to eternal life:
John 14:6

I am the way and the truth and the life. No one comes to the Father except through me.

Before salvation, we were slaves to sin and destined for death. But through faith in Jesus Christ, we receive the gift of God, which is the salvation of souls unto eternal life:
John 3:16–17

For God so loved the world that he gave his one and only Son, that whoever believes in him shall not perish but have eternal life.  For God did not send his Son into the world to condemn the world, but to save the world through him.

Before any person can receive this free and undeserved gift from God, they must acknowledge that they are unrighteous sinners, ask forgiveness, and confess they have placed their faith in Jesus:
Romans 6:20-23

20 When you were slaves to sin, you were free from the control of righteousness. 21 What benefit did you reap at that time from the things you are now ashamed of?  Those things result in death! 22 But now that you have been set free from sin and have become slaves to God, the benefit you reap leads to holiness, and the result is eternal life. 23 For the wages of sin is death, but the gift of God is eternal life in Christ Jesus our Lord.

Jesus issued this dire warning to those who are spiritually dead and who reject Him:
John 8:24

I told you that you would die in your sins; if you do not believe that I am the one I claim to be, you will indeed die in your sins.

Repentance is the first step on the way to salvation that leads to eternal life and is absolutely essential.  In the Bible, the word "repent" means to change one's mind and turn around.  The Bible also tells us that true repentance will result in a change of actions:
Acts 3:19

Repent therefore, and turn back, that your sins may be blotted out...

This article explores the connection between repentance and salvation, part of which says this:

Repentance and faith can be understood as two sides of the same coin. It is impossible to place your faith in Jesus Christ as the Savior without first changing your mind about your sin and about who Jesus is and what He has done. Whether it is repentance from willful rejection or repentance from ignorance or disinterest, it is a change of mind. Biblical repentance, in relation to salvation, is changing your mind from rejection of Christ to faith in Christ.
Repentance is not a work we do to earn salvation. No one can repent and come to God unless God pulls that person to Himself (John 6:44). Repentance is something God gives—it is only possible because of His grace (Acts 5:31; 11:18). No one can repent unless God grants repentance. All of salvation, including repentance and faith, is a result of God drawing us, opening our eyes, and changing our hearts. God's longsuffering leads us to repentance (2 Peter 3:9), as does His kindness (Romans 2:4).  Source: What is repentance and is it necessary for salvation?

Basically, you can't be saved and receive God's gift of eternal life until you first repent, and even then, it is God who draws us to Him and to the point where we recognise our great need:
Romans 2:4

Or do you show contempt for the riches of his kindness, tolerance and patience, not realising that God's kindness leads you towards repentance?

Salvation is entirely the work of God, from start to finish.
Answer: This answer tries to represent the position of most major Christian denominations by using undisputed interpretation of select Bible verses.

The general idea is that Jesus is the Way [of Eternal Life]:

Jesus told him, "I am the way, the truth, and the life.  No one comes to the Father except through me." - John 14:6 (CSB)

Our responsibility is to come to Jesus, and this coming (which is a kind of turning from the Way of the World, like choosing a different route) is the Way of Repentance:

From then on Jesus began to preach, "Repent, because the kingdom of heaven has come near." - Matt 4:17 (CSB)

Prior to Jesus's own ministry, John the Baptist already preached the Way of Repentance (Matthew 3:1-12):

In those days John the Baptist came, preaching in the wilderness of Judea and saying, "Repent, because the kingdom of heaven has come near!" ... 11 "I baptize you with water for repentance, but the one who is coming after me is more powerful than I. I am not worthy to remove his sandals. He himself will baptize you with the Holy Spirit and fire. ... "

The passage above makes it clear that the Way of Repentance is only the first half the journey.  The second half, the Way of Eternal Life, we cannot do on our own.  We need to be united with Jesus (who is the way), and with him we journey together back to God.  The first step of this second-half-journey is by receiving God's life ("born again") and keeping this life in the innermost of our being so that we start living a new life AS adopted sons/daughters of God, which is the "good pleasure of his will" (Eph 1:5).
But even receiving this gift of life, not to mention keeping this life until we die, we need Jesus's assistance (grace) by trusting Jesus as our savior, similar to how when we hop on a bus / plane / taxi we trust the driver to get us there.  Faith is simply trusting the driver (Jesus) and willing to undergo the journey (without getting off the vehicle) that involves God's life purifying our sinful nature so we can be made "holy and unblemished in love before him" (Eph 1:4).  Without faith we don't hop on the second half of the journey.  That's why the "way of eternal life" is tightly associated with "faith", i.e. our conscious state of mind that we ARE on this journey back to God.


How do I backup the followers of a user on Twitter?

Question: I need to download all the followers of a user on Twitter, then download all the followers of each follower (second level network).
I need the data in any format.
Is it possibile? What would you use?
Comment: I would use the [Twitter API reference](https://dev.twitter.com/docs/api) and a programming language which has libraries that can do HTTP-requests and OAuth.
Answer: There is a twitter module for python for example. You will need to register an appliction and to use oAuth. Bad news: also if you prefere something else than python, you will have to use OAuth. Good news: to use the twitter module in order to get information is quite simple afterwards.
Update: You can also use supertweet.net if you don't want to mess around with OAuth!
Answer: You can use www.TWEXLIST.com. A a recent solution to export any  Twitter list (public or  private), followers list, followings list of  any Twitter account (yours  or any others) in an Excel spreadsheet.
Answer: Some years ago I used Tweetake website to backup my Twitter data but it was closed (https://twitter.com/NikkiPilkington/status/270080732582522880). Since then I realized that it is not good to rely on a third party website and it is better to have a "do it yourself" solution. So I created a script that everybody will be able to use in their browser.
The script allows you to backup Twitter favorites, following and followers: https://gist.github.com/baptx/1525f338d93fa01db4e0
It is written in JavaScript and will create a textarea element with your backup data that you can copy/paste in a file.
You can run it in a browser console on a local web page like Firefox's about: or a web page like https://duckduckgo.com/html (in the past I used it directly on https://api.twitter.com/1.1 web page but it's not working any more because they added Content Security Policy).
Before using the script, you need to get your access keys to use Twitter API 1.1: https://dev.twitter.com/oauth/overview/application-owner-access-tokens
Answer: You can use https://www.followers-backup.com/web to download the list of followers/following (first level network) of any profile you want and it's free. Give it a try


How can I log into a commandline session, without having to launch any desktop environment?

Question: In an effort to preserve battery, I'd like to have a session type of just the commandline at login.

I do not want root.
I do not want to login to gnome and then switch to a ttyl, as I would still be running a DE in the background.

I just want to boot my computer to the login prompt, select from the session types a commandline option, and then login to that where no desktop environment is running.
Is this possible?
Answer: sudo systemctl set-default multi-user.target
To go back to graphical boot:
sudo systemctl set-default graphical.target
Answer: Are search something like this?
create a grub-skript in /etc/grub.d (example name) /etc/grub.d/70_text-mode
To long for answerblock paste
I coppied  /etc/grub.d/10_linux
and make some changes for me.
you can set other variable irrespective of /etc/default/grub
Make the skript executable and run
sudo update-grub

Oh I forget this part
export GRUB_CMDLINE_LINUX_DEFAULT='systemd.unit=multi-user.target'

boots in multi-user.target (earlier named text-mode) all services are starting besides display-manger and gui.


Chunk generation version

Question: I have been playing in my world for several versions now. Is there any way for me to figure out in which version, the chunk I stand in, is created?
Comment: haha good question, but I doubt there is a way
Comment: At best, you're probably looking at a min and max range, and that's assuming it's basically undisturbed.
Answer: Not directly, no. You might be able to figure it out with some detective work:

Know what version you first generated the world with.

Know what versions you have played it with between now and then.

Know the version numbers in which various world generation details or large-scale algorithm changes occurred. A non-exhaustive list is:

Beta 1.2 added sandstone under sand blocks in deserts
Beta 1.7 didn't generate very much clay
Beta 1.8 drastically changed the terrain generator, which can show as straight lines of mis-matched blocks and biomes, where one chunk was generated with the pre-1.8 algorithm and one was generated after

Structures (strongholds, villages, abandoned mines, and ravines) were added
New biomes are rivers, oceans, swamp
Ocean/swamp floor is now a mix of sand, dirt, and clay

1.0.0 added mushroom biomes
1.2.1 added wooden bridges in abandoned mineshafts where the cave, mineshaft, or ravine generator created a gap
1.3.1 added emerald ore, desert-themed villages, temples, taller hills in sub-biomes (such as desert hills or ice mountains)

Use your knowledge of (1) and (2) to narrow down the useful clues from (3), then use the clues from (3) as forensic markers to investigate the heritage of a given chunk.

Develop a taste for digital archaeology. You may wish to install a mod that gives you a dashing hat and bullwhip.

Chunk generation version


How to make Quanta plus editor as a default editor?

Question: When I click on any file eg php file it open by default in gedit I want that it will open by default in quanta plus
Answer: Right click on the file -> select 'Properties' -> go to the 'Open With' tab -> select the text editor of your choice from the list.
I believe that will make the text editor you choose the default for that particular file type. You'll have to repeat those steps for every file type though (e.g. plain text file, .log, .txt, etc.)
Just saw, but this question was already answered in a general form here: How do I change the default text editor?
Comment: I think this issue with opening multiple instances of the text editor instead of tabs (which it sounds like you want) is an issue with your text editor's settings, not with it being a default editor or not - so it's a different question. If this answer solved the question you ask please mark it as the accepted answer. If you have a new issue with your text editor please check your text editor's documentation and/or ask a new question.
Comment: Hmmm its great its doing work successfully but having bit issue  when i open two file then there two editor open.if i open 10 file than it will open one editor for each file mean open 10 editor.
Answer: The easiest way I found to change mine to gvim (I think it should work the same for your editor) was to add text/plain=quanta.desktop to ~/.local/share/applications/defaults.list and restart nautilus.
Comment: ~/.local/share/applications/defaults.list not found this location
Comment: I m not found the defaults.list.Please reply its very urgent
Comment: If you don't have one but still have the ~/.local/share/applications, I'm pretty sure you can just create it.


Fundamental group of quotient of subspace of $\mathbb{R}^3\times\mathbb{R}^3$

Question: This is exercise 12-6 from J. Lee's Introduction to Topological Manifolds.
Let $E=\{(x,y)\in\mathbb{R}^3\times\mathbb{R}^3:x\neq y\}$, and define an equivalence relation by $(x,y)\sim(y,x)$ for all $(x,y)\in E$. Compute the fundamental group of $E/\sim$.
This is the first time I'm asked to compute the fundamental group of something that I can't seem to visualise, and I am not sure how to approach it. Seifert-van Kampen does not seem useful for such a space. What I think I want to do is find a group $G$ such that $q:F\to F/G=E/\sim$ is a covering map for a simply connected $F$, so that the fundamental group is isomorphic to $Aut_q(F)=G$. But even then, I am not quite sure how to do this. Can this space be visualised somehow? If not, how would one generally approach such a problem where one's visualisation is insufficient, as I guess it is in most worthwhile problems?
I would appreciate some advice on this.
Comment: Maybe, not sure $\Bbb Z_2$-action on the simply-connected space $E$.
Comment: @0-thUser As in, the automorphism group would just be flipping the decks, and $E$ is a double covering of $E/\sim$?
Answer: Consider the map $$L : E\rightarrow \mathbb R^3\times \mathbb R^3-\{ 0\}$$ $$(x,y)\rightarrow \left (x+y,y-x\right )$$
This is clearly a homeomorphism. So your space $E$ is homotopy equivalent to $\mathbb R^3-\{ 0\}\simeq \mathbb S^2$ which is simply connected.
This already gives you the fundamental group to be $\mathbb Z_2$ but I shall attempt to identify the homotopy type of this space.
$E/_\sim $ is harder to see.  Using the isomorphism $L$ we see that $E/_\sim$ is homeomorphic to $X=\mathbb R^3\times \mathbb R^3-\{ 0\}/_{(v,x)\sim (v,-x)}$
[This should remind you of the tangent bundle of $\mathbb {RP}^2$ upto a homotopy which I shall try to make precise]
$\mathbb R^3\times \mathbb R^3-\{ 0\}\xrightarrow{\text{projection }} 0\times \mathbb R^3-\{0 \}$ is a strong deformatrion retract. Let $A= 0\times \mathbb R^3-\{0 \} /_{(0,x)\sim (0,-x)}$
We have the weak retract $$r: X\rightarrow A$$ $$[(v,x)]\mapsto [(0,x)]$$
Consider the homotopy $$H_t : X\rightarrow X$$ $$[(v,x)]\mapsto [(tv,x)]$$ This clearly shows $r$ is a strong deformation retract and hence a homotopy equivalnce. So $E/_\sim \simeq \mathbb {RP}^2$ and once again we can see that $\pi_1(\mathbb {RP}^2)=\mathbb Z_2$
Comment: Very nice solution, thank you!


Using $0*\infty=0$ in Griffiths instead of indeterminate?

Question: In all such derivations, Griffiths suggests assuming the constants zero (in this case A) to eliminate the $f(x)$ when it goes to infinity, but zero * infinity is undetermined instead of zero, so how are these derivations valid? Is my understanding wrong here? (I have assumed "blows up" also means infinity)
Comment: Honestly, if this is tripping you up, I strongly suggest (re)learning calculus before studying quantum mechanics. There's already too many confusing things in QM, basic calculus should not be one of them.
Comment: Note that we very strongly discourage the use of images of text and equations on the site.  You should instead use a combination of text and [Mathjax](https://math.meta.stackexchange.com/questions/5020/mathjax-basic-tutorial-and-quick-reference).  Apart from readability, mathjax and text can be searched using the site engine, whereas miages cannot.
Answer: What you don't understand is Griffiths is not evaluating $0 \cdot x$ when $x$ is infinite, but rather $0 \cdot x$ as $x$ approaches infinity. There is a big difference between the two (in fact, this very difference makes Calculus work). As $x$ tends to infinity, the product $0 \cdot x$ tends to $0$.
Comment: Thanks for the answer, can you elaborate some more on that difference?
Answer: I think the clearest way to explain it is this. You are thinking of the indeterminate form
$$\lim_{x\to \infty}f(x)g(x) $$
where $$ \lim_{x\to \infty}f(x)=0\\\lim_{x\to \infty}g(x)=\infty$$
this is indeed indeterminate.
But in this case you don't only have $\lim_{x\to \infty}f(x)=0$, you just set $f(x)=0$ for all $x$ (in the notation of your question, $f(x)=A$ and $g(x)=e^{kx}). $
It is obvious that $0\cdot e^{kx}=0$ for any $x$, so $\lim_{x\to \infty}0\cdot e^{kx}=\lim_{x\to \infty}0=0$, or in more simple terms, by just setting $A=0$ you merely remove the term from the solution.
Comment: But what would you say if there was an expression like $0.\infty$ and the expressions do not tend to 0 or infinity but are exactly 0 and infinity. Or even a better example- take the indeterminate form $0/0$ where the numerator and denominator tend to 0. But what about an expression $0\0$ where the numerators and denominators are exactly 0 and do not tend to it. What will you say in that case. Are these 2expressions that I wrote undefined ones. First one is undefined because the reals is open set at infinity and second one is undefined because of division by 0. Or is there anything else to add
Comment: @Shashaank There is no such thing as "the expression is exactly $\infty$" in standard analysis, $\infty$ is not a number, but just a notation we use to say that a function is unbounded. The expression $0/0$ is not defined, so what you said at the end of your comment is correct. The expression $0\cdot f(x)$ is defined and it simply equals $0$, so of course its limit is $0$.
Comment: Yeah I was thinking that. So the thing is that expressions like $0/0$ or even $1/0$ are undefined if the numerators and denominators are exactly 1 or 0. But when the numerator and denominator tend to 0 or 1, then they are indeterminate forms ($1/0$ is not indeterminate as it will tend to infty anyways). So what happens when these values tend to 0 or 1  is what makes them indeterminate. If the the values are exact they are undefined. Is that all correct
Comment: The point I wanted to highlight is that $0\0$ or other indeterminate forms are undefined expressions if the values are exact and not tending to ( this should hold true for all the indeterminate forms). But when value are not exactly 0 or whatever but tending to it the th expression is not undefined but can take any value and that's is it is said indeterminate form. We can calculate their limits to know what they tend to in the given expression. Is that all ok
Answer: In the fragment cited it is not claimed that $0*\infty\rightarrow 0$ - rather it is claimed that the corresponding term is not present in the solution, since it would diverge. Saying $A=0$ is an unrigorous "physicist" way os stating this.
In some more complicated problems a need may arise of actually considering non-zero coefficient $A$, e.g., if instead of a square potential, one considers a smoother one, going to zero at infinity. In this case one would have to assure that function $A(x)$ is such that $$\lim_{x\rightarrow -\infty} A(x)e^{-\kappa x}\rightarrow 0.$$
Quantum mechanics book by Landau & Livshits contains solutions for many smooth potentials of inetrest, in the chapter devoted to one-dimensional Schrödinger equation, which are worth working through for deeper understanding (although this involves a lot of tedious math with hypergeometric and other special fucntions.)
Answer: You can define this with more mathematical rigor, but to say $e^{\kappa x}$ goes to infinity for $x\to\infty$ actually asks what the limit of $e^{\kappa x_n}$ is, if you choose $x_n$ to be a series with limit $\infty$, for example $x_n=n$, which itself means that, while all the $x_n$ actually never go to infinity, there is still no real number $y$ large enough to NOT find a special $n$, lets call it $N$, such that $x_n>y$ for all $n>N$.
So if the limit of $x_n$ is $\infty$, the limit of $e^{\kappa x_n}$ is also $\infty$, while again, no actual value ever is. While the single values never actually would be infinity, a problem arises, if you want to integrate over the whole expontential function (with boundary $\infty$), because this integral would diverge, hence would not yield a physical useful wavefunction. But, if you multiply this series by 0, you get a series that is just 0 everywhere, and the integral converges (being 0 in this region).


How can I use my domain name to map into my Amazon EC2's public IP?

Question: How to put my registered domain name into DNS server?
Is there any DNS server available in this world?
Answer: I use Route 53 from Amazon and create A records pointing to my IP. From Route 53 it'll give you the name servers to setup with your registrar so that DNS is handled by Route 53. Now when people go to your website it'll route to Amazon for DNS and ec2 for hosting.
Answer: I would assume that you will have to set up your own dns server (as part of an EC2 server ?) and have the IP address of that dns server put in as your domain's main DNS.
I obviously don't know how your setup looks like, but you should be able to set up BIND and then change the entries of your domain wherever it's registered to point to that.
Comment: so it is possible to set up BIND in my own EC2 server and also act as web server?
Comment: according to http://serverfault.com/questions/252298/link-a-domain-to-a-amazon-ec2-instance you can just add an A or CNAME entry at your registrar's website and it should be ok. There are quite a few questions concerning this on serverfault.


User Acceptance Tests with mouse/keyboard capture and picture compare

Question: We have several Angular applications (Micro UIs) and they are all 100% covered by our UATs (User Acceptance Tests) written with Protractor (Angular Test Framework based on Selenium).
There are several problems with this approach, although this is probably the best and suggested way for Angular Testing:

Time consuming... Do not understand me wrong. These tests are super handy, whenever we make a change, we let these run (these are actually integrated in our CI/CD Pipelines) and be sure that the app works still as we want. But still, even if we test a use case at least 1 time manually anyway, this has to be also written in Protractor/Jasmine. And takes time..
These Tests are very dependant on HTML Structure. Some locators find the html elements with xpaths (very bad), some with id etc. but at the end, any change in HTML, would somehow cause a change in our tests.. although the change does not change anything on UI for the end user.
The whole CSS is ignored. Like the typical Selenium Tests, all tests run against the DOM, and except tests which checks the hidden/shown fields, over 90% of our CSS is ignored.. if one day, a single line which never supposed to be shown in 2 lines shown, really is shown in 2 lines, we will not know that automatically.

I imagine a test framework like this: you open your app on browser, and start the keyboard/mouse capture tool of your test framework. Then you start testing a scenario on your app in your browser, for example you move your mouse on a specific location, you click on a button, you choose a value from a dropdown, a redirect occurs, and at the end you look on your screen and see if the desired X text is shown on the right side.
The only thing which the capture tool cannot know is what you really checked (X text on the right side). For this you take a screenshot of this area, and put in your test framework.
These mouse/keyboard captures will then be replayed while testing on the Pipeline and the checks/asserts are done against these screenshots.. even with some pixel offset maybe, if you do not want your tests fail in case of tiny css changes.
Would it be usefull at all? Do you know some frameworks like this? Specially which we may use for our Angular apps? Do you think this approch is better regarding time and quality?
The benefits would be:

Since you just let your capturing tool run while you are manually testing your app just after you finish your implementation, and make some screenshots and put them in framework somehow, tests would not consume so much time like writing code for UATs.
They would mostly run independent of HTML Structure. So as long as our button is located on its location and on its behaviour, it would not bother us if it now has a one more div parent in the DOM.
Our Css would also be tested since we compare pictures.

And at the end, this is just what we want, to look on the app and see if it looks right, click and enter some keyboard events and check again if we see what we want. Not like protractor or selenium tests, which just blindly communicate with the DOM.
Answer: The mouse capture tool you've mentioned is known as Record & Playback. There are a manifold of tools created for such approach, and most were deprecated in favor of coding based tools.
However, nowadays, Selenium IDE (starting from Selenium 4) will focus on Record & Playback, with an approach of detecting multiple possible locators, to create less fragile tests. You can read more about it here and on this presentation by the Selenium creator.
The image comparison you've mentioned is known as Visual Testing. Some good tools exist for it, such as Percy and Applitools Eyes.
Answer: There are few more commercial tools for visual testing. Gartner recommends Eggplant as the market leader in their 2018 report. You can also see user reviews for different software test automation tools here (not limited only on visual testing tools).


Why is brand new plumbers putty keep breaking of in pieces around brand new kitchen drain basket with a paper gasket and rubber sealtin the sink

Question:
rebought new plumbers putty and and kitchen drain basket 2 times
Cleaned surfaces with alcohol and let completely dry
Installed basket according to basket manufacturers directions
Used more putty the 2nd time initially according to multiple videos etc
Pieces of putty are breaking off around the basket rim in the top of the sink leaving gaps causing water to seep through and leak
Comment: Putty is not meant to stick to surfaces.
Answer: The plumbers putty is put around the underside of the drain flange, usually a roll of putty about 1/2" diameter. This is pressed into the underside of the drain flange. The paper gasket and nut go under the sink (gasket against he sink and then the nut). This needs to be tightened fairly tightly with either a spanner type wrench made just for these basket strainers or some large  "channel lock" pliers (channel lock is a brand name and this same wrench is made by other manufacturers). Tightening this will force the putty to ooze out on top of the sink around the edges of the drain flange. this is usually cleaned up by hand and what you are left with is a visible thin layer (maybe 1/16") of the putty between the edge of the drain flange and the sink recess.
I say this because I cannot imagine that you are having this kind of trouble unless there is something wrong with the installation. Otherwise, there is the possibility that you have the wrong basket strainer for your sink even though these are all fairly standard.
Answer: Plumber Putty is a compression sealant.
It works great between two compressed surfaces. Remove excess after compressing.
Does not gives an adhesive strength, you can form and roll it with your fingers.
Don't apply on exposed areas
Not for plastic pipes
Doesn't seal the space between wall and sink
It is not recommended for metal threaded pipes or joints.
Its closest relative would be rubber seal.


Do the automatically generated ship designs update themselves as you discover new techs?

Question: I'm new to GalCiv2 and the ship design stuff wasn't well explained in the tutorial. The game provides a number of basic ship designs as you discover new basic techs, but will those designs be automatically upgraded to the highest quality parts of each type as you discover new parts?
Answer: Nope. You have to go and upgrade these manually through the shipyard.
Usually the prebuilt ship designs are just helpers to get you started.
Some designs are unlocked if you research certain tech levels.
Once you get familiar with the game you should be constantly updating your ship designs with the latest components as you progress through the tech tree.
It is mostly advisable to build your own designs instead of relying on the prebuilt ones.
Comment: Actually Galciv 2 became popular cause it gave that much control over what goes on your ships. Colony ships that can zip through sectors. A fleet with 3 murderously deadly behemoths ships with one fast ship with fleet speed module for that killer fleet! There are things you can create with such flexibility that will be impossible with normal prebuilt ships.
Comment: Yeah, I've played a lot of MoO2, I'm familiar with the idea of custom specialized fleets being better than generic ones. However, one of the parts I love most about MoO2 is that you can turn off the part where you need to design your ships and just have generic ships that go up as your tech goes up and you don't have to fiddle with it.
Comment: That's... unfortunate.
Comment: It's a rather common feature of the 4X genre, requiring you to keep closer tabs on your fleets and providing a check on rampant expansion.
Answer: I've played many times, and I can certainly say that my warship designs get upgraded along with the availability of better weapons.
However, the upgrade didn't happen on every weapon upgrade, and it seems to consider only upgrades to weapons and defenses. No automatic implementation of better engines, for instance.
Plus, the newer designs seem to favor single-weapon-type warships.
So, it's always better to design one yourself.
And don't forget to use the "Obsolete" button on the older design after upgrading your ship design. It helps reducing the clutter in the shipbuilding dialog box. DO NOT use the same name; it will only confuse you horribly.


How charge custom Li-ion pack 36v 10s6p

Question: I have 10x 6p 18650 batteries. 13AH.
I found a protection circuit.
My issue is that I don't know how to charge the batteries. I could use a power source but I got it from my school and it isn't mine.
They sell for 500+$ so it's out of my budget.
I couldn't find much information for 2s+ battery pack.
Answer: I am guessing that you mean a 10s6p, not 10X?  The lithium ion BMS board that you linked to is for a 10s battery.
Are you building your battery or have you bought it?  If you are building it, then you need to add a balance cable with a JST-XH female connector.
With this, you should be able to charge your battery with its BMS using a number of chargers. One example that comes to mind is the imax 1010B+ charger. You can go to the Imax web site and look at their chargers. They are not cheap, but certainly less than the $300 you quoted above for a power supply. With the imax charger you will get a proper balance charge of your battery using the proper CCCV charge algorithm which you won't get with a straight power supply.
Comment: Thank you very much! In the link provided for the protection circuit, it says voltage limits can be adjusted (per upgrade it says). I asked the seller but he said he didn't know and he needs to get information about it. But it's been a week since that and I doubt I will get my answer. Do you know how the limits can normally be changed? I would like to have 3v min and 4.2v max...
Comment: The battery was at my job, the charger wouldn't charge it. The charger applies 42v then none, 42v then non, etc (even if the voltage is above the minimal limit of 28v for charging)... I decided to scavenge the cells. They were sitting at home for several months and the voltage was sub 2v. I know it's bad but I've had great result charging 6p packs at 0.01A to 28+v and then charging it normally. I made some discharge test and was able to get 90% capacity rating.
Comment: Do you have other charger in mind? The one listed isn't available in US. I live in Canada so even US will end up being quite pricier due to shipping & duty.
Comment: @Lion - I live in Canada too and I bought that exact charger from Hobbyking.  I believe you have to buy it off their international wharehouse, not the U.S. site.  Too bad about the value of the dollar, maybe Trudeau will help.  Hobbyking sells other chargers that would work also, the main problem is that most of them, including the imax, don't usually come with their own power supply, so you have to buy a power supply as well.  I bought a power supply from Hobbyking as well that can run 4 chargers at once for about 50 dollars.
Comment: I have bought a number of those ebay BMS and a lot of them advertise the ability to adjust the max and min voltages through some sort of upgrade, but I have never been able to make that happen.  The seller never seems to be able to help.  I have only have success when the BMS is very expensive and costs more than the battery - not an ebay deal.  This is why a good charger like the imax is so important because you can set max charge voltage per cell on the imax and then the BMS is more of a backup protection in case the charger malfunctions and your not depending solely on an inexpensive BMS.

How charge custom Li-ion pack 36v 10s6p


ND Convolution Backprogation

Question: For my education, I am trying to implement an N-dimensional convolutional layer in a convolutional neural network.
I would like to implement a backpropagation function. However, I am not sure of the most efficient way of doing so.
At present, I am using signal.fftconvolve to:

In the forwards step, convolve the filter and kernel forwards over all filters;
In the Backpropagation step, convolve the derivatives (reversed in all dimensions with the FlipAllAxes function) with the array (https://jefkine.com/general/2016/09/05/backpropagation-in-convolutional-neural-networks/) over all filters and sum them. The output I take to be the sum of each image convolved with each derivative for each filter.

I am particularly confused about how to convolve the derivatives. Using the class below to backpropagate results in an explosion in the size of the weights.
What is the correct way to program the convolution of the derivative with the output and filters?
EDIT:
According to this paper (Fast Training of Convolutional Networks through FFTs), which seeks to do exactly what I wish to do:

The derivatives for the previous layer are given by the convolution of the derivatives of the current layer with the weights:
dL/dy_f = dL/dx * w_f^T
The derivative for the weights are the piecewise sum of the convolution of the derivatives with the original input:
dL/dy = dL/dx * x

I have implemented, as best as I know how, this below. However, this does not seem to give the intended result, as the network I have written using this layer exhibits wild fluctuations during training.
    import numpy as np
    from scipy import signal

    class ConvNDLayer:
        def __init__(self,channels, kernel_size, dim):

            self.channels = channels
            self.kernel_size = kernel_size;
            self.dim = dim

            self.last_input = None

            self.filt_dims = np.ones(dim+1).astype(int)
            self.filt_dims[1:] =  self.filt_dims[1:]*kernel_size
            self.filt_dims[0]= self.filt_dims[0]*channels
            self.filters = np.random.randn(*self.filt_dims)/(kernel_size)**dim

        def FlipAllAxes(self, array):

            sl = slice(None,None,-1)
            return array[tuple([sl]*array.ndim)]

        def ViewAsWindows(self, array, window_shape, step=1):
             # -- basic checks on arguments
             if not isinstance(array, cp.ndarray):
                 raise TypeError("`array` must be a Cupy ndarray")
             ndim = array.ndim
             if isinstance(window_shape, numbers.Number):
                  window_shape = (window_shape,) * ndim
             if not (len(window_shape) == ndim):
                   raise ValueError("`window_shape` is incompatible with `arr_in.shape`")

             if isinstance(step, numbers.Number):
                  if step < 1:
                  raise ValueError("`step` must be >= 1")
                  step = (step,) * ndim
             if len(step) != ndim:
                   raise ValueError("`step` is incompatible with `arr_in.shape`")

              arr_shape = array.shape
              window_shape = np.asarray(window_shape, dtype=arr_shape.dtype))

              if ((arr_shape - window_shape) < 0).any():
                   raise ValueError("`window_shape` is too large")

              if ((window_shape - 1) < 0).any():
                    raise ValueError("`window_shape` is too small")

               # -- build rolling window view
                    slices = tuple(slice(None, None, st) for st in step)
                    window_strides = array.strides
                    indexing_strides = array[slices].strides
                    win_indices_shape = (((array.shape -window_shape)
                    // step) + 1)

                 new_shape = tuple(list(win_indices_shape) + list(window_shape))
                 strides = tuple(list(indexing_strides) + list(window_strides))

                  arr_out = as_strided(array, shape=new_shape, strides=strides)

                  return arr_out

        def UnrollAxis(self, array, axis):
             # This so it works with a single dimension or a sequence of them
             axis = cp.asnumpy(cp.atleast_1d(axis))
             axis2 = cp.asnumpy(range(len(axis)))

             # Put unrolled axes at the beginning
             array = cp.moveaxis(array, axis,axis2)
             # Unroll
             return array.reshape((-1,) + array.shape[len(axis):])

        def Forward(self, array):

             output_shape =cp.zeros(array.ndim + 1)
             output_shape[1:] =  cp.asarray(array.shape)
             output_shape[0]= self.channels
             output_shape = output_shape.astype(int)
             output = cp.zeros(cp.asnumpy(output_shape))

             self.last_input = array

             for i, kernel in enumerate(self.filters):
                    conv = self.Convolve(array, kernel)
                    output[i] = conv

             return output

        def Backprop(self, d_L_d_out, learn_rate):

            d_A= cp.zeros_like(self.last_input)
            d_W = cp.zeros_like(self.filters)

           for i, (kernel, d_L_d_out_f) in enumerate(zip(self.filters, d_L_d_out)):

                d_A += signal.fftconvolve(d_L_d_out_f, kernel.T, "same")
                conv = signal.fftconvolve(d_L_d_out_f, self.last_input, "same")
                conv = self.ViewAsWindows(conv, kernel.shape)
                axes = np.arange(kernel.ndim)
                conv = self.UnrollAxis(conv, axes)
                d_W[i] = np.sum(conv, axis=0)

           output = d_A*learn_rate
           self.filters =  self.filters - d_W*learn_rate
           return output

Answer: Multiplying gradients with learn_rate is not usually enough.
For better performance and reducing heavy fluctuations, the gradients are scaled using optimizers by methods such as dividing by past few gradients(RMSprop).
The updates also depend on error, if you pass error for every sample individually, that usually creates noise, so it is considered better to average over multiple samples(mini-batches).

ND Convolution Backprogation


Magento 2.3 - The correct way to get custom attribute

Question: I have added the custom attribute referral_code of type static to the customer entity. The attribute showing up correctly, and I can get/set it in easy way with $customer->getReferralCode() and with $customer->setReferralCode(value). But these methods, of course, don't really exist inside the Customer Model (I think that behind the scene there is some magic method). The problem is that in this way I don't have any hint/intellisense by IDE. The others developer, if they don't know the existence about the attribute,don't receive any suggestion by theirs IDE. So, it's "normal" that this happen or I can extend the Customer Base Model and add the get/set methods of my custom attributes? If it's possible to do this, what are the steps to reach it?
Comment: You have raised a good point. +1 for that
Answer: This is not the issue, you are doing it correctly, as you already know these are magic function and it has no definitions of their own. But you can add a description of these function on class-level in comment like this:
/**
 * @method static someClass setReferralCode(int $ref) Description here
 * @method static someClass getReferralCode() Description here
 */
abstract class a {
...

Description here
Reference: https://stackoverflow.com/questions/15634021/how-to-document-magic-call-and-callstatic-methods-for-ides
Comment: uhm so this is the best way? It's very "ugly" ahaha. Now another question is: where should I add that comment? Because the Customer model is inside the vendor `magento/module-customer`, so I can't edit it. If I have a Block class and I need to call the method `getReferralCode()` I must specify that comment inside my Block class? I have tried it, but it doesn't work (I'm using PHPStorm as IDE).


Do object reflect radio waves?

Question: Do object reflect radio waves just like light waves? I don't know much about their use but can anyone explain how we use this reflection?
Comment: This is far too broad as it stands, and comes dangerously close to [insufficient effort](http://meta.physics.stackexchange.com/questions/5778/what-counts-as-sufficient-prior-research-when-asking-a-question). Start with the [Wikipedia article](http://en.wikipedia.org/wiki/Radio_propagation) and Google as appropriate if you want more technical information.
Answer: When the radio waves from the transmitting antenna reach the receiving antenna after reflection in the ionosphere, the wave propagation is called sky wave propagation.
The upper part of the atmosphere absorbs large amounts of radiant energy from the sun. The intensive heating of the atmosphere during day time causes ionisation, resulting in free electrons, positive ions and negative ions. However, due to different chemical compositions and physical properties of the atmosphere at different heights, the ionisation in the atmosphere is not uniform.  The electron concentration in a layer extending from 90 km to 140 km from the surface of earth, called Kennelly Heaviside layer (or E-layer) and then in a layer extending from 250 km to 400 km, called Appletion layer (or F-layer). Most of the reflection takes place in these two layers.

The electromagnetic waves of frequency up to 30 MHz get reflected by the ionosphere. However, when the frequency of electromagnetic waves is above 40 MHz, they are no longer reflected by the ionosphere but undergo refraction.
The angle above which the radio waves are no longer reflected by the ionosphere is called critical angle of radiation. Its value depends on the density of ionisation and on the frequency of the radio waves.
So, considering the above example, whether the objects reflects radio waves or not depends on many factors, like absorbing power, critical angle of radiation, frequency, etc. For your question, radio waves can be reflected by objects, but not always.
Answer: Yes, and you can use it for science.
Reflecting them into a receiver is an important step in making a radio telescope.

Do object reflect radio waves?