PWA - Fetch GET URL when online

Question: I am a bit confused about approaching deferred fetch requests.
I have a button in my app. when clicked, I want it to perform a fetch using the GET method. If the device is offline, I want that fetch deferred until the the device is online again. The fetch can complete successfully now or anytime in the future.
What approach should I be taking?
Can you also clarify where the deferment should be take place? i.e. app script or service worker
Answer: What you describe sounds like a user case for the Background Fetch API. It is not widely supported yet, but it is currently being tested in Chrome 71.
You can learn more from articles like this one.
You can't keep your service worker alive indefinitely, which would be necessary to accomplish this in the service worker without that API. (You could try putting this logic into your web app code via a retry-with-backoff timer, if you want.)

PWA - Fetch GET URL when online


How to optimize a slow query?

Question: I work as an administrator and software developer for a company that provides services to the car selling business. In essence we develop the software that they use when selling cars and such. This means that we have an ever growing database. With regular intervals our customers do searches for different things, for example a certain material used in a car. These queries have started to take really long time to execute and we dont really know how to fix them. So my question is there anything we can do to optimize this query? I'll provide the EXPLAIN and then the query itself.
Comment: When trying to end on a date, instead of `< "2015-02-19 23:59:59"` you could more accurately use `< "2015-02-20"` and this will include that last second of the day.
Answer: You have three potential areas you could address: LIKE operators, subqueries, and OR operators.
Regarding LIKE operators:
See https://stackoverflow.com/questions/6142235/sql-like-vs-performance and http://myitforum.com/cs2/blogs/jnelson/archive/2007/11/16/108354.aspx

If your filter criteria uses equals = and the field is indexed, then
  most likely it will use an INDEX/CLUSTERED INDEX SEEK
If your filter criteria uses LIKE, with no wildcards (like if you had
  a parameter in a web report that COULD have a % but you instead use
  the full string), it is about as likely as #1 to use the index. The
  increased cost is almost nothing.
If your filter criteria uses LIKE, but with a wildcard at the
  beginning (as in Name0 LIKE '%UTER') it's much less likely to use the
  index, but it still may at least perform an INDEX SCAN on a full or
  partial range of the index.
HOWEVER, if your filter criteria uses LIKE, but starts with a STRING
  FIRST and has wildcards somewhere AFTER that (as in Name0 LIKE
  'COMP%ER'), then SQL may just use an INDEX SEEK to quickly find rows
  that have the same first starting characters, and then look through
  those rows for an exact match.

Regarding Subqueries
I would recommend inserting all of your subquery data into a temporary table first. Then, join the temporary table to your main select query.
See https://stackoverflow.com/questions/921931/why-is-inserting-into-and-joining-temp-tables-faster
Regarding OR operators:
Regarding performance, a question you should ask yourself is if you should use the OR operator or UNION operator as they both can have the same result.
See http://www.sql-server-performance.com/2011/union-or-sql-server-queries/

Selecting all columns: OR is faster than UNION
Non-Clustered and Clustered Index Columns only: no difference
Selecting all columns for different fields: no difference
Selecting Clustered index columns for different fields: UNION is faster than OR
Comment: You realize al your links are about SQL-Server while the question is tagged with MySQL. Many of the recommendations are valid for MySQL as well (but just saying).
Comment: About the likes, this query is used when searching for something in a table of materials. Our customers can search for anything and everything. Unless we can do the like in another way I cant see that part changing. Is there maybe a better way to do it? I've never done subqueries as temporary tables, are there any drawbacks to that approach? Aren't temporary tables written to disk, which is a lot slower than RAM?
Comment: My point about the temporary table is that you have 10+ subqueries from the same two tables. If you could grab all that data in one pass, manipulate the data, and then throw it in your SELECT statement, it would be more efficient because your DB is currently forced to go back and forth to the same two tables over 10 times. You could also join one subquery and use that data in your SELECT statement if you wish, but regardless, attempting to cut back on the subqueries should be a performance objective for you.

How to optimize a slow query?


Existence of a uniquely determined linear transformation

Question: Let $X,Y,Z$ be vector spaces and let $S:X\to Y,T:X\to Z$ be linear transformations. I have got in a book that if ker$S\subset $ ker$T$, then there exists a linear transformation $R:Y\to Z$ uniquely determined over $S(X)$ such that $R\circ S=T$. I couold not prove this. Can anyone please suggest me anything?
Answer: We want $R\circ S=T$, so let's define
$R:Y\rightarrow Z$ by $R(y)=T(x)$, if $\exists x\in S$ such that $S(x)=y\in Y$, else define $R(y)=0$.
This map obviously satisfies the condition that $R\circ S=T$, but firstly we need to check that it is $well-defined$. So if $y=S(x_1)=S(x_2)\implies S(x_1-x_2)=0\implies (x_1-x_2)\in ker(S)\subset ker(T)$. Thus $R$ is well-defined.
You can check that $R$ is linear too.


Can a decision tree automatically detect the effect on the dependent variable from the product/quotient of two independent variables?

Question: For example, when I use the xgboost algorithm, there are two continuous variables X1 and X2, do I need to specify the product X1*X2 explicitly at the beginning? Or the algorithm can automatically pick up the effect of the X1*X2?
Comment: Welcome to the site! Trees can consider high-order interactions automatically.
Comment: Just make sure your `max_depth` is at least 2 to find 2-way interactions.
Answer: Yes and no. By having a sufficiently deep tree (at least two splits deep) and splitting on both $x_1$ and $x_2$, tree based model like xgboost (or LightGBM or catboost) can eventually approximate (given enough data) any relationship between $x_1\times x_2$ and your prediction target of interest. Of course, if you know that some function $f(x_1\times x_2)$ is a predictor of your outcome of interest, then specifying a feature that is that exact  transformation of $x_1$ and $x_2$ is what you should do.
What to do in practice? If you have a lot of data and are not that sure that the interaction matters, perhaps don't specify it as a feature. If you don't have a lot of data and suspect it's an important feature, you probably want to put this feature into xgboost. If you are inbetween - try it out using an appropriate cross-validation scheme.
Answer: The answer to your question depends on what class of split rules you allow in the fitting of a decision tree. If the only class of allowable splits are on a single variable you will never be able to capture the interaction behavior described in the post. In fact what you will see that allows you to diagnose something like this has occurred is a repetition of splits in the decision tree on the two interacting variables and the repeated splits may occur several times. If you allow classes of splitting rules that allow for polynomials up to the order of the interaction you think may occur in your data (here 2nd order) then you will be able to capture the behavior in the decision tree that is fit to the data.


I want my name to be removed from a patent

Question: In contrast to common public questions on this website, this time I myself want my name to be removed from a patent because I had zero contribution to the patent. If the company doesn't agree to remove my name, I can take legal action, right? Because long story short, the company is already trying to troll me via this patent. I can give you more details (1) if you are interested.
Thank you.
(1) Unfortunately, in my work contract, it reads "The employee undertakes to assist the Company, if the Company wishes so, on enabling the Company to protect, register, maintain and fully utilize the materials, results and intellectual property rights described in Section 10.1"
Based on this clause, the Company wants to extend the borders of the patent beyond imaginable by pushing me to sign a new agreement. I already left the company by the way.
Comment: Are others listed as inventors and  do you agree that they are inventors ?  By trolling you do you just mean they are pestering you to sign things ?
Answer: I am not a lawyer. I believe that listing a non-inventor as an inventor on a patent application risks the validity of the resultant patent. You can inform your previous company that you will inform the USPTO that a non-inventor is being listed on the application. There are other mechanisms for someone to challenge the grant of a patent but I won't get into those.
I'm not sure what "troll me via this patent" means. However you are not now an employee so I don't see how a document that requires employees to do something applies. I also don't see why you should be required to sign anything new. However, I'm not a lawyer and I don't have access to the documents you've signed.
I would, respectfully, remind the company that you did not contribute conceptionally to the invention and thus should not be listed as an inventor. If you know who should be listed as an inventor suggest them. This is one of those situations where a letter from a lawyer might have more impact. The main point is to stay civil and professional. Let them know you are helping them achieve their goal of obtaining a patent by not having a non-inventor improperly listed. You may want to remind them it is within you power to make the USPTO aware of a discrepancy in the listed inventors.
If, however, you are just mad at the company and you did actually contribute something that is reflected in a claim on the patent application, I would simply sign the documents and allow them to list you. I don't see how this hurts you. Most people are happy to have themselves listed as an inventor on a patent. As for whether the patent is extended beyond the borders of the imaginable, it is the patent examiners job, not yours, to keep this from happening. Many patent applications shoot for the moon with their initial claims and end up with narrower ones in the end.


How to change a sentence from passive to active voice?

Question: I have the following sentence in the passive voice, and I wonder how I can reformulate it to the same sentence in the active voice.
The sentence is:

We can see those times jurors were first appointed by the state.
Answer: Sentences can't be passive or active.  Clauses can.
When you just have one clause in a sentence, the distinction isn't really important, but in this case we have both a main clause and a subordinate clause, and we'll have to consider each of them separately.

We can see those times jurors were first appointed by the state.

In this sentence, the main clause is active already.  If we wanted to make it passive, we'd have to swap things around and add a passive auxiliary:

Those times jurors were first appointed by the state can be seen by us.

So we can see that the main clause in your original sentence isn't passive.  But the original sentence also contains a subordinate clause, and this clause is passive:

jurors were first appointed by the state

How do we know this clause is passive?  Because we have the passive auxiliary be with the main verb as a past participle, because the actor (the state) is the complement of by rather than the subject, and because the theme (jurors) is the subject rather than than the object.
We can rewrite this as an active clause by undoing those three things:

Remove the passive auxiliary be.
Move the state out of the by-phrase, back into subject position.
Move jurors out of subject position, back into object position.

We end up with the following:

the state first appointed jurors

We can put this back in the original sentence:

We can see those times the state first appointed jurors.

Now the main clause and subordinate clause are both active.
Answer: Passive voice is {form of to be} + {past participle form of verb}
Active voice is just normal form of the verb.
When converting from passive to active you might have to select a logical subject.
One of the reasons passive voice is used is to avoid expressing a real subject in a sentence, or add a level of indirection by tacking the subject on with a "by ..." prepositional phrase.

The show was seen by my mother.

Technically the subject in this sentence is show.  However, this is the active version and what the sentence really means:

My mother saw the show.

The subject of the passive voice sentence becomes the active voice's object.
Something like this though:

Four people were found in the cave still alive.

If you don't know who found the four people, you can't convert it precisely without at least making a small assumption.  You could try something like this:

Someone found four people in the cave still alive.

This assumes a single person found the four people.
In situations where making assumptions is dangerous or you have no idea, then leave it passive voice.
Answer: Active voice:

We can see those times the state first appointed jurors.

The word "appointed" is the verb -- the action.
Ask yourself who is doing the action ("the state" is doing the action).
Say the name of that person or group first ("the state"), Then say what they did ("appointed"). Putting those two pieces in that order makes it active voice.
The first part of the sentence already has active voice: "(we) (can see)."
Comment: Please [edit] to include an explanation of *why* this is correct; answers without explanation do not teach the patterns of the language well. See the [Submitting Answers that merely answer the question](http://meta.ell.stackexchange.com/q/1117) discussion on meta.


How to find age of kelp in minecraft bedrock

Question: I'm playing minecraft bedrock in mobile. I'm gonna make a kelp farm. I need to find the age of kelp in bedrock edition. It will be in debug screen for java, but how can I do it in bedrock? Please help me.
Comment: I'm not sure how finding the age of individual plants would help you. Kelp will grow the same random 2 to 26 blocks as on Java, which gets re-randomized after each harvest. That means your farm should be able to deal with every possible value and in case you have uneven sea bottom to deal with, you can just build up any plants (by placing kelp manually on top of the plant) to get them within reach of the harvester if that's your farm design.
Comment: Thanks I thought it won't change after harvesting
Answer: Sorry, but you can't find out the age of kelp in bedrock because bedrock doesn't have the debug screen.
Comment: I do not play Bedrock edition, but I do think this answer is correct. Debug screens in mobile are very rare, mostly because there is not a lot of inputs that can be put in. So except if someone can show this answer wrong by giving a way to open a debug screen on mobile, this answer is, IMO, valid.


Complexity of high-order differentiation

Question: Let $g(x) = \exp(f(x))$. Assuming numerical (or symbolic) values of $f(x), f'(x), f''(x), \ldots, f^{(n)}(x)$ are known, is there a way to compute $g'(x), g''(x), \ldots g^{(n)}(x)$ (or even the single value $g^{(n)}(x)$) for large $n$ that is faster than explicitly generating and evaluating the expanded symbolic derivative, a polynomial which has $p(n)$ (partition function) terms?
Comment: For a particular n the relevant polynomial is essentially the cycle index polynomial of S_n: http://qchu.wordpress.com/2009/06/24/gila-vi-the-cycle-index-polynomials-of-the-symmetric-groups/ .  So knowing how to do this computation for arbitrary f is essentially equivalent to knowing the cycle index polynomial, which encodes a lot of information.
Comment: http://en.wikipedia.org/wiki/Fa%C3%A0_di_Bruno%27s_formula#A_special_case
Comment: Thanks, this is the terminology I'm looking for. So I guess the question is: is there a better way than the naive one to evaluate this polynomial (the naive method being to generate the expanded polynomial and evaluate it term by term)?
Answer: Yes, you can.  For example, the normal evaluation for $n=6$ requires 33 multiplications and 10 additions.  But by using an optimized straight-line program which takes care of common subexpression elimination, you can reduce that to 17 multiplications, 10 additions and 4 assignments.  For $n=8$, the reduction in multiplications goes from 84 down to 37, and at $n=12$, it goes from 397 down to 114.
Note that multiplication by constants (like $10f'(x)$) counts as a multiplication too.
You can experiment with these things by using the codegen package in Maple (especially the functions codegen[optimize] with the tryhard option, as well as codegen[cost]).  If there is interest, I can post the details of the computation here.
Unfortunately, at this point, I do not immediately see a pattern in the results, so I am not sure how to automate this and produce optimized versions directly.  But the answer to your original question is definitely 'yes'.
Comment: Excellent! This doesn't really solve the problem for arbitrary n, though.
Comment: Indeed - and I did mention that in my answer.  But I believe that at this point, you're all set for a bit of "experimental mathematics" where you stare at the results for sufficiently many n, see patterns, make conjectures, prove them, repeat.  I would even be interested in helping such a project along - I just can't lead it, I've got too many other things already on the go.
Answer: I feel that I should post an answer, for the benefit of any potential readers from the future...
For simultaneous computation of the first $n$ derivatives, the problem is really computing the exponential of a power series, and it is a classical result that this can be done in $O(M(n))$ arithmetic operations (which most likely is optimal).
See: Brent and Kung, Fast algorithms for manipulating formal power series, Journal of the ACM, 1978. There are more recent papers reducing the implied constant factors.
I'm still not aware of any result to the effect that the $n$th derivative alone can be computed faster than $O(M(n))$.
Answer: Try automatic differentiation, which is exact but not symbolic. See also The Arithmetic of Differentiation by L. B. Rall.
Comment: I don't see how AD helps here. Rather, AD of nth order requires that the symbolic nth derivatives of atomic functions are already known.


Is there a way to see created by , last modified by in feild definition using tooling api, metadata api or other ways in Apex?

Question: Is there a way to see created by , last modified by in feild definition using tooling api, metadata api or other ways in Apex?
Comment: https://salesforce.stackexchange.com/questions/319559/retrieving-audit-fields-of-a-custom-metadata-type-object - this will work for any custom object. (The example uses custom metadata type)
Comment: What is your higher-level goal that you're trying to accomplish? Please edit your question.
Comment: The goal is to provide a consolidated view by custom page for admins , so that they can see a list of the fields ,who created them, and who modified them and when.  this opens up great opportunity for admins to better manage their orgs. e.g. one can run a report and show how many fields are created or modified in the past month, and who did that. ..
Comment: Thanks, I had also checked this link
Answer: it is possible and the fields are available via tooling api in the link below:
https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/tooling_system_fields.htm
These fields are system fields and their information is not in the documentation of the FieldDefinition table, which was why I raised this question.
Answer: SELECT Label,LastModifiedById,LastModifiedDate FROM FieldDefinition WHERE PublisherId != 'System' AND EntityDefinitionId = 'Opportunity'


What happens if my PhD interest has changed after a year?

Question: I have had an admission for Spring semester (2019) with funding for PhD in Physics at a USA university. In my application, I mentioned that my area of interest is biophysics and experimental condensed matter physics. However, if my area of interest got changed (Assume for high energy physics or Astrophysics etc.), what happens then? Do the first two years for all PhD Physics students are the same in USA universities?
Comment: And your funding is from...?
Comment: Did you get admitted into a standard PhD program, or did you make further arrangements, such as skipping courses, or working with a specific advisor, etc.?
If you have an offer for a standard US program (which is usually 5 years), you're probably not bound to what you mentioned as your area of interest.
Comment: @anucex I'd guess from the university, as it's the norm (at least in Sciences) for most all US PhDs at the entry level
Comment: I'm not from this discipline nor did I study in the US, but I'm only imagine that if the funding is not from a project that requires work on a predefined area, change wouldn't  be impossible. Though, I concur with Buffy that it's highly advisable to check directly with the Department.
Answer: Since you've been admitted to what's presumably either a single institution, or a small number of institutions, it's probably more useful to try to figure out how things are handled there than what is typical. I would suggest scouring department websites, and maybe contacting your graduate coordinator, or graduate student representatives first.
That said, if you care for generalities, here are a couple. First thing to note is that the stated research interest is unlikely to be binding. If you can find an advisor to work with, that's all that matters, regardless of field. Changing interests is fairly common, but perhaps not between two extremes. However, the selection of admitted students tends to depend on the available funding, which varies with field. Thus, being able to switch to e.g. astrophysics isn't necessarily easy in practice, particularly if it's a small department. (Now, if you come in with your own funding you can do whatever you want, at least as far as the department is concerned. Of course, whoever granted you that funding might think differently...)
Second, there tends to be a number of mandatory courses for all students, and also field-dependent mandatory courses, and elective ones. (Obviously, biophysics and high energy require very different courses.) Due to these electives, and being able to take classes in different orders, the first two years would not be the same for everyone, but time isn't necessarily wasted if you change interests either. Further, a lot of students find their advisor during/after the first year, and would start their research during the summer semester and second year.
Yet, as I said, that's just a quick rundown of the typical situation. You'd most likely be better served looking up the rules and options for your specific situation.
Answer: In Math or CS this would probably be no problem at all as you haven't yet chosen an advisor. In Physics or Chemistry, however, in fields that require a lot of lab work, you may possibly already be assigned to a lab. If that is the case you might have some difficulty switching after you start.
I think your best course of action is to raise this issue with the institution to see where you are precisely and what your options are.
While I think it likely that without an MS you have some flexibility at entry, only the specific department can give you the proper advice. Talk to them.
Comment: I know of exactly one chemistry or physics department (out of hundreds) in the US in which entering graduate students are already assigned to a lab, and even that one I'm not sure of. I can't imagine what you're basing your answer on.
Comment: @RaghuParthasarathy, other questions here seem to indicate that it happens elsewhere in the world. I though it best to recommend checking rather than making an assumption.


Is there generally a high amount of variability in the number of hours grad students put to work each week?

Question: As in, it's certainly not a standard 8-5 job of 40-50 hours per week. Is it common (and expected) for them to sometimes put in 80 hours a week, and to occasionally put in 10 hours? (say, during times of personal crisis or of particularly intense coursework?)
Answer: I believe that most of the students are event-driven. That is, if they have an important deadline, meeting, exam, TA section (agghh...), then they spend more time to prepare and be ready for that event. Whereas after an important deadline, (or finals week, etc.) they allow themselves to be more relaxed and spend less time "working".
However it is quite strange to define how much time one spends on "research". Many people get very nice ideas just before the go to sleep, or while taking a shower... The mind is running 24/7..  Even though those people are not "in office" they do work on their research.
I agree also with the answer of Lars that it really depends on the student's personality and preferences. I've known students who really need their schedule to be well defined. They showed up to office daily at 9:00 and left at a fixed time (I guess that being married with kids kind of forces you to have a fixed schedule). So there are no fixed rules.
Answer: It depends on you. If you really want to, you could probably have quite regular working hours (except for the odd deadline). I would say that 80 hours a week is excessive and if your advisor expects you to do that, then you should think about changing your advisor/course.
Comment: unless of course the student wants to work that much, or work that much some of the time (not that I think this would be necessary or required)
Comment: +1 to Abe, I know of many advisors who put it out very clearly that they want workaholic students. One particular professor from Cornell comes to mind. He has created a PDF for students interested working with him. He expects workaholic geniuses willing to work weekends. In return, he guarantees an excellent thesis and a good post-doc/professorship.


Visa requirements for Chinese national visiting Italy

Question: I am a USA citizen.  My wife is a Chinese National with USA Permanent Residence status.  We wish to travel to Italy for vacation.  What do we need to do?
Answer: Here's the relevant requirements from Timatic:

Passport required.
  - Passports and other documents accepted for entry must be   valid for a minimum of 3 months beyond the period of   intended stay.
Visa required, except for Passengers with a Hong Kong (SAR China)
  passport for a maximum stay of 90 days. (SEE NOTE 56322)
      NOTE 56322: The max. stay is granted within 180 days. Visa required, except for Passengers with a Macao (SAR China) passport for
  a maximum stay of 90 days. (SEE NOTE 56322)
      NOTE 56322: The max. stay is granted within 180 days.

Unless she holds a Hong Kong or Macao passport, she will need a valid Chinese passport and must apply for a visa from the Italian Consulate serving the area where you live (see "jurisdiction" under each entry).
This page, once you have answered a few simple questions, will give you a list of the forms and requirements for a visa application. You should also check the website of the Italian Consulate serving your area, as different consulates may have slightly different requirements. The Consulate's website will tell you how to make an appointment.
Comment: Thanks @Dorothy. I replaced the link since it seemed more useful than the international one
Answer: According to USA Today:

If you stay in the U.S. on the basis of a United States Permanent Resident Card -- or USCIS Form I-551, popularly known as the Green Card -- your ability to travel to Europe without a visa will depend on the country that has issued your passport. Your permanent residency status in the U.S. doesn't influence your need for visas, while your actual citizenship does.

And according to this map (I assume you can locate Italy on a world map), your wife requires Italy visa prior to visit Italy and the EU.
Depends on where you live, find an Italian consulate/consulate general/embassy and ask them whether they handle visa affairs.


Identify this spotted plant

Question:
This is the culprit. What kind of plant is it, and what's the best way to care for it?
Answer: It's a succulent, similar to Aloe, called Haworthia - this one is most likely Haworthia margaritifera, or possibly H. attenuata. The most common one is Haworthia fasciata, common name Zebra plant, where the white warts are arranged in bands which resemble zebra stripes - the different varieties are often confused, but the care instructions are the same anyway.
Relatively easy to care for, needs a light, free draining soil, will not tolerate sunlight nor deep shade, requires average temperatures, preferably cooler at night and in winter, but not below around 5 degrees C. Watering isn't required very often, they'll survive with some water once a month, but grow better if it's a bit more often. Reduce watering in winter, and don't overwater; in common with other succulents, too much water causes rotting. Further info here http://www.ourhouseplants.com/plants/haworthia
Looking at your photograph, though, I'm not seeing any roots on the bottom of the plant, and I'm not sure what the soggy brown stuff is at the bottom, has it started rotting off already? These plants do produce offsets, but when they're removed from the parent plant, some root needs to be present in order to pot them up separately, so if there's no root material at all on this one, I'm not sure its viable.
Comment: I am surprised there aren't roots, this little guy is healthy and would have been a great start.  Did you wash the roots off?  I would still try to propagate  by breaking (not cutting) a few of the lower, smaller leaves off this plant to reroot in clean cactus potting soil.  Thin soil bed, not deep.
Comment: @stormy not sure, I made this post on behalf of a friend. I'll forward all of your advice!

Identify this spotted plant


Disable the Apex Trigger for Perticular user login

Question: Is it possible to disable the Apex trigger when a particular user logged in?
Or Is any possibility to restrict the Apex trigger execution depends on user.
Ex. My trigger should execute with User 1 and shouldn't execute with user 2 login (both users meets the criteria to execute trigger)
Answer: UserInfo.getUserName() give current logged in uesr name. Refer here.
You can put a check on trigger and verify with user name:
trigger MyTrigger  on MyObject (after insert,after update,before insert,before update) {
    if( UserInfo.getUserName() != '<User Name with which you don't want to run the trigger>'){
        //Do something
    }
}

Comment: +1 The only downside to this is that users can change their user name. A more elegant solution might use Custom Settings, Custom Metadata, or Custom Permissions to determine if the user should execute the trigger. These options allow for changes to whom the trigger executes for without code deployments.
Answer: We can implement this scenario by using custom setting as below :
trigger CustTrigger  on Custom_Object__c (after insert,after update,before insert,before update) {

    //Fetch custom setting containing restricted user ids
    MySettings__c restrictedUserIds = MySettings__c.getValues('Restricted_User_IDs');

    Set<String> restrictedUsers = new Set<String>();

    if(restrictedUserIds != null && String.isNotBlank(restrictedUserIds.value__c) && restrictedUserIds.value__c.contains(';')){
        //Ids can be seperated by semi-colon
        restrictedUsers = restrictedUserIds.value__c.split(';');
    }

    //Allow trigger execution if custom setting is not maintained or user id not found in custom setting.
    if(restrictedUsers.size() == 0 || (restrictedUsers.size() > 0 && !restrictedUsers.contains(UserInfo.getUserId()))){

        //Trigger execution

    }
}

This approach has just one drawback of maintaining user ids in custom settings but since user ids will remain constant , any other changes to user object will not affect this logic.
Hope it helps.
Edit : As suggested by @DavidReed , we can maintain hierarchy custom setting for each user and allow execution of trigger only if it exists.
Comment: If you're going to use a Custom Setting, it's probably more maintainable just to use a Hierarchy Custom Setting that can be set at the level of the individual user.
Comment: @DavidReed , Yes , i agree with your point.Hierarchy Custom setting will be more maintainable. Thank you for the suggestion.


Showing the amount of search results when using exp:low_search:popular

Question: Can I show the amount of search results when using exp:low_search:popular?
And I would like to sort by the amount of search results if that is possible.
Answer: You mean the actual amount of search results if you were to search your site with those keywords at that moment? If so, no, that's not possible. Performance would take a nosedive (as you're performing X searches in one go, where X is the amount of popular keywords) and you'd have to take other filters into account too, which could differ in countless ways.


catch exception in managed bean and show message on screen in jsf2

Question: I'm using JSF 2 and I'm getting some exception while I'm using some web service and I want to catch that exception and display the message on my .xhtml page.
How can I do that?
Answer: You can use the try-catch block to catch and handle the exception. You can use FacesContext#addMessage() to add a faces message to the faces context. You can use <h:messages> to display faces messages.
So, something like this in the bean:
try {
    data = yourWebService.retrieve();
} catch (YourWebServiceException e) {
    String message = "Failed to retrieve data from webservice: " + e.getMessage());
    FacesContext.getCurrentInstance().addMessage(null,
        new FacesMessage(FacesMessage.SEVERITY_INFO, message, null));
    e.printStackTrace(); // Or use a logger.
}

And this in the JSF page:
<h:messages globalOnly="true" />

(the globalOnly="true" will force the <h:messages> to only show messages with a null client ID)
Comment: Its not working for me or may be im doing something wrong. I have a method where im passing URL and thats a asynchronous call so i dont get any response back. But when im sending the wrong URL then its throwing the WebApplicationException. And im not sure either im using that  tab properly or not. Im trying to use that in where my tabview is started. Please let me know is there anything im doing wrong. Thank you
Comment: It'd be helpful if you show an SSCCE. There's too much ambiguity here. If you use JSF the right way, then it'd just be matter of referencing the messages component in the `` as well.
Answer: To give you an example to what BalusC has explained, you could write a simple method that gets called in a catch statement.
private void addErrorMessage(String msg, String clientId) {
        String codingErrorMsgKey = "coding_error_msg";
        FacesMessage fm;
        FacesContext facesContext = FacesContext.getCurrentInstance();
        if (StringUtils.isEmpty(msg)) {
            ResourceBundle bundle = facesContext.getApplication().getResourceBundle(facesContext, "bundle");
            fm = new FacesMessage(FacesMessage.SEVERITY_ERROR, bundle.getString(codingErrorMsgKey), bundle.getString(codingErrorMsgKey));
        }
        else {
            fm = new FacesMessage(FacesMessage.SEVERITY_ERROR, msg, msg);
        }
        facesContext.addMessage(clientId, fm);
    }

What the method does is really simple : you give it a message that you may have resolved earlier form your application's resource bundle, then a global (only if clientId is null) error (because of FacesMessage.SEVERITY_ERROR) FacesMessage is created. The created error message is then added to the facesContext using a default string as the message if you didn't provide any.
Since this method is able to create global and clientId-related error messages, you won't have to use globalOnly property. Simply specify <h:messages/> to have the tag display all of your messages (global or not).
Again, this only is sample code. You may have to adjust/improve to make it your own. Also, you could almost duplicate this method to handle information messages.
As a generic way of dealing with error messages, you could make this method available in a super class that every controller would then extend.


How long do I have before the battery status changes from service recommended to replace now?

Question: I have an early-2015 MacBook Pro 13" whose battery status has changed from normal to 'service recommended' state. The cycle count is around 367 and the battery backup runs strong at around 4-5 hours. My understanding of the service recommended status is that the cells in the battery have begun deteriorating, resulting in less than optimal battery capacity and therefore charge backup. Is it possible to predict how long, if I were to keep going about my business, the battery has before it completely runs out?
We have authorized Apple resellers only here so options to get the battery officially serviced are limited. Last year, the battery on my personal early 2015 MacBook Pro 13", with half the cycle count of the battery on this work machine, suddenly changed to "change battery" status from normal, and stopped giving me any backup. I had to get the battery replaced with a non-Apple/OEM battery which didn't cost much, but only gave a two-hour charge backup.
Comment: An indeterminate amount of time.
Answer: It depends on how much you use it and even there is no way of really knowing.


Graph API and SharePoint on-premise

Question: Is the microsoft graph API available with on-premise installations? If yes 2013, 2016?
Answer: I don't think Microsoft Graph API will be available for on-premises. Microsoft graph is part of Azure infrastructure and does not know anything about your local environment. To use Graph API you need to register an App in Azure AD. With an on-premises environment you can't perform this step since you are not connected to Azure AD in any way.
Answer: Microsoft Graph exposes multiple APIs from Office 365 and other Microsoft cloud services through a single endpoint: https://graph.microsoft.com.
Access data from multiple Microsoft cloud services, including Azure Active Directory, Exchange Online as part of Office 365, SharePoint, OneDrive, OneNote, Planner and Microsoft Teams.
Go through below article for complete details.
Microsoft GRAPH API Documentation

Graph API and SharePoint on-premise


unconfirmed transaction for over 2 days what to do?

Question: sent from exchange to wallet  2 days ago still not confirmed ?
https://blockchain.info/tx-index/277169110
Answer: The recommended fee for a transaction is of 450 satoshis ber byte.
Your transaction is 226 byte long.
450 x 226 = 101700 shatishi
101700 shatoshi = 0.00101700 Bitcoin
The transaction fee you included is of 0.0003842 Bitcoin which is 0.0006328 BTC lower than the recommended.
I wouldn't be surprised if you had to wait even more.
Data source: bitcoinfees
Answer: All you can do now is that You need to wait!!!!! For a looooooong time. Probably will never get through, then your wallet should refund you For a looooooong time. As for now, 170 sat/B is not high enough a fee to get process, 450 sat/B is recommended. 170 sat/B give you the processing time from 60-Infinite minutes. If you have paid 450 sat/B, then processing time would be about 60 minutes. so basically you are fked if the seller need to get pay soon.


How to detect an event horizon?

Question: Event horizons are (relativistic) classical predictions of general relativity and theories of gravity. How can, in principle, to detect an event horizon and elucidate to what kind of black hole it belongs to? Or are event horizons undetectable with astronomical tools?
Comment: Maybe that's interessting for you. The scientists from the EHT work on such measurmenst: https://eventhorizontelescope.org/
Answer: In a Schwarzschild (static and spherically symmetric) black hole a stationary observer measures the frequency of a photon depending on the radial coordinate $r$. For a photon emitted radially at $r_1$ and observed at $r_2$ we have:
$$\dfrac{\omega_2}{\omega_1} =\left(\frac{1 - 2M/r_1}{1 - 2M/r_2}\right)^{1/2}$$
where:

$c = G = 1$ natural units
$\omega$ photon frequency
$M$ black hole mass

If you are in a spacecraft at radial distance $r_2$ and you drop a beamer, you may detect the frequency emitted by the beamer approaching the black hole. You will measure a progressive redshifting of the frequency and a progressive dilation of the time interval between a pulse and the next one. A plot of $r_1$ vs. the measured frequency and the dilated time interval allows to estimate the radial coordinate of the horizon. As the beamer is moving you have also to consider a superimposing relativistic Doppler effet.

How to detect an event horizon?


Is it wise to process all forms on a single url?

Question: is it ok to simply point all forms action to a single url and seprate them with a input_hidden for example form_id?
for example we create a url like: /process
and point all forms on that url , and there we seprate forms by a hidden counter
Answer: Actually there is no harm in doing that, but if you make different files than it will make a lot easier for anyone to understand.Making different files and calling them will make your code look cleaner.
Answer: No, it's not wise. Separate unrelated functionality to different files, and call those, it makes it easier to see where is what. Lots of small files > One huge file.
Answer: A few is typically OK, but only if you have lots of different forms on the same page and you aren't using Ajax to submit them.  The way you keep it tidy is by giving the forms names, and namespacing each field with that name so you know which form has been submitted.
This is often necessary in this case to reduce the work needed to load form validation errors, whereas you would normally need to keep the errors in the session to reload after a redirect from the processing page.
Example:
-> contact.php
    -> Submit to contact.php
        -> If errors, re-render the form without redirect on contact.php
        -> Else, process the form, then redirect.

In the event of errors, the second showing of the form would be part of the POST request, meaning you still have easy access to the previously submitted data.
If it was valid, you no longer need the posted data as you have already persisted it elsewhere.
This is highly contextual however.  It is not a reason to use a single script to process "all" of your forms.  Only the ones on the active page.
Answer: Generally no.
But there are use cases where it's desirable to do it, at least for some forms. But these forms must implement the same interface, their behaviour is the same.
For example I have one use case where buttons are placed on page, each loads a different form in a modal. Each is posted to the same controller, but all the controller needs to know is that it calls validate(), save(), and render() methods on the form.
I'm sure there are other cases, but your general stand should be "no", unles you have a good reason for it.


Most significant Congressional Leaders in US History?

Question: In all of US history, which Congressional marjority/minority leaders and speakers are considered historically important?  For example, FDR and Lincoln are, for better or worse, considered historically important Presidents.
Comment: This is a [list question](http://meta.history.stackexchange.com/q/667/1401)  and it strikes me as an opinion question.
Comment: Asking for the "why" were they powerful seems to invite a list which isn't really what we aim for in questions.
Comment: Since the last try didn't take, I've taken a simpler crack at improving the question.
Comment: Ok, well it seems you know where I am going, but you don't like where I am going.  I'd just like to ask about Congressional leaders in a way that narrows them down to a few.  Back later.
Comment: @Mr.A I think if you restructured the question to be focused on the WHY leadership positions in the House or Senate are powerful that might help your question out. I like the spirit of the question, but it's wording is a little problematic.
Comment: I'm sorry @SamuelRussell, I rolled back. I think I know what you are trying to do, but I could not understand your question or what was asked. Mr. A's question was understandable.
Comment: You should/could read [Robert Caro](http://www.robertcaro.com/)'s *Master Of The Senate*.
Answer: Probably the most famous and historically significant US Congressional leader was Henry Clay, who was a dominant, if not the dominant leader of the early 19th Century Congress. He was the founder and leader of the Whig party (one of the two main parties of the era), and was the driving force behind The Missouri Compromise and (as a Senator) The Compromise of 1850, both of which for a time defused major pre-Civil war Slavery crises.
The role of Speaker regained a lot of power in the mid 20'th Century under Sam Rayburn, but never really the same stature. During part of his tenure, his protege Lyndon Johnson asumed similar control of the Senate, producing a fairly imposing legislative partnership.


up voting should be closed after accepted answer

Question: Up voting should be closed (should not be allowed further) after accepting the answer. It can be allowed to star (make it as favourite question) even after making the accepting the answer.
Comment: And what is your **reasoning** for requesting such a feature? A feature request is largely meaningless if there isn't any reason behind it or discussion about its benefits.
Comment: Downvotes on meta can in very many cases mean that people are disagreeing with your proposal.
Comment: Up votes do no such thing. Upvotes on the question simply mean *Good question, well researched, I had this problem too but you asked it already*, etc. If accepting means no more voting is allowed on the question, ***no one will accept answers anymore***.
Comment: No. Accepting an answer means the questioner has found their solution. It doesn't mean the question cannot have other solutions, or better solutions.
Comment: What's the benefit that such a feature would bring?
Comment: Your proposal is very radical. Maybe you have some serious arguments to this. If so then share with us and give as a chance to upvote you.
Comment: Do you think a question on SO is only for the person who asked it? What about all the other people who might find the quesiton relevant and might want to vote for it and the answers? What about all the cases where the answer chosen by OP is by far not the best one? Your proposal is complete nonsense and you don't seem to understand SO or the SE network at all. Furthermore, it's even unclear _what_ should be restricted - question votes, answer votes, all of them?
Comment: After accepting answer, it shows the question is completed with answer. downvote can be enabled but no upvote.
Comment: up vote encourages to find the answer, hence i think no need to encourage further to find answer more because user might have accepted   the same
Comment: @MartijnPieters Your point is correct. While reviewing triage the system sometime automatically make us to vote by saying "upvote encourages to find the answer".
Comment: @Exhausted: yes, by increasing visibility. But where does it say that you then should **stop** finding answers? If someone builds a better mousetrap, won't you want to know?
Comment: some one has made my quesion to downvote in SO.
Comment: how do you suggest things to work in case if asker unaccepts? would you expect upvotes to become allowed again or remain forbidden?
Comment: Its just a suggestion i made, might be unclear of something i had.
Answer: I disagree. Users should have the ability to vote on posts, no matter whether it has an accepted answer or not. Why? Because if the question has an accepted answer and is helpful, I'd like to upvote the question because it's helpful. That's a positive sign towards the original poster. And I also want to be able to downvote questions with an accepted answer. Having an accepted answer does not mean "this question is high-quality"; votes are a better indicator for that.


Getting to know related search queries from google

Question: Are there any tools out there, that I can use to know popularly searched queries through google ? Say, if I want queries pertaining to iPhone battery or ios performance that people might have searched over time, is there anything similar to google trends that can lists related queries ?
Answer: If you mean "Related Searches" that appear at the bottom of most google searches, you could try a pre-built library such as a web scraper setup to specifically scrape these results.
You could also write your own scraper to pull these results, though you'll have to maintain the scraper as most likely Google will change it's markup over time.
Comment: I've been using google since god knows when, and it didn't strike me that I can use related search on google. This will work for the time being but it'd be extremely useful to know about other tools if they exist.
Comment: What better way to understand what people also search for then to consult the source of searches. There are a myriad of SEO related tools out there that will do this on an automated basis, and much more, for you - at a cost. If you can't afford their asking subscription prices then your other option is to write your own program to scrape related searches for you.
Comment: Yes I understand that. I'm wondering if there are related search queries based on frequency of search. Any idea which criteria google uses to suggest related queries ?


Saved form when submitted creates duplicate

Question: Is there an easy way to prevent a form from creating a duplicate when submitting a saved form?
Comment: By only clicking the submit-button once? ;-) Sorry, about that, but what actually happens to the form on submit?
Comment: Can you elaborate please?  Are you attempting to edit the existing entry?  How are you choosing to name your form?  Is it using the now() function? Sorry for all the questions but this will allow the community to hone in on the nature of the question.
Comment: A customer goes in begins the form and would like to save it because they do not have all the information to complete the form at the time they save the form and come back to it later. The save has created an original record of the document for them to access, however when they submit the form it creates an additional record. Is there a way to prevent the second copy from being made?
Answer: Well, if you were managing documents instead of Forms you would use 'Require Check-in'.  However, this post suggests using versioning to manage the issue instead.
You also have to think about how each Form (item) is named - a 'naming convention'.  If each item is named you can prevent duplicates from being saved.  Go in list settings>select one a column (e.g. Title)>Enforce Unique Values. This will prevent a new item being saved using the same value.  The Value 'format' can be defined by site admin e.g. 2017-11-24-A, the next item is saved as 2017-11-24-B and so on.


Can I launch my goat into space in Goat Simulator?

Question: I recently overheard my friend claiming he could launch his goat into space(or a very high point whatsoever) , but he didn't tell me how, and told me to "do it myself". I'm intrigued by this challenge, so I decided to test it out, but it seemed impossible to launch myself that high. Is it even possible, or is my friend making a false claim?
Answer: Not quite launching, but it's possible your friend was describing being taken into space by a UFO.
Bring the B(e)acon from the Starter House garage to the Crop Circles and place it on the empty pedestal. This isn't possible on the Mobile edition.
(Source)


Relations between Bochner spaces $L^p(0,T;L^q)$

Question: Let $(X,\|\cdot\|_X)$ be a Banach space. The function $u=u(t,x)$ belongs to Bochner space $L^p(0,T;X)$ if the norm
$$ \|u\|_{L^p(0,T;X)} = \left(\int_0^T \|u(t,\cdot)\|_X^p \mathrm{d}t\right)^{1/p} \text{ for } p<\infty, $$
$$ \|u\|_{L^\infty(0,T;X)} = \mathrm{ess}\sup_{t\in[0,T]} \|u(t,\cdot)\|_X $$
is finite.
Now let $X=L^q(\Omega)$ for bounded $\Omega\subset\mathbb{R}^n$. I was wondering, if there are some embeddings between spaces $L^{p_1}(0,T;L^{q_1}(\Omega))$ and $L^{p_2}(0,T;L^{q_2}(\Omega))$, depending on $p_i$ and $q_i$.
From the interpolation in Lebesgue spaces we have this result, moreover from the boundedness of $[0,T]$ and $\Omega$ we obviously have
$$L^p(0,T;L^{q_1}(\Omega)) \subset L^p(0,T;L^{q_2}(\Omega)) \text{ for } q_1>q_2$$
and
$$ L^{p_1}(0,T;L^q(\Omega)) \subset L^{p_2}(0,T;L^q(\Omega)) \textrm{ for } p_1>p_2. $$
However, is it possible that
$$ L^{p_1}(0,T;L^{q_1}(\Omega))\subset L^{p_2}(0,T;L^{q_2}(\Omega)) $$
for some $p_1>p_2$ and $q_1<q_2$?
In other words, can we compensate the integrability over one variable by the higher integrability of the other? In particular I am interested in the inclusion of $L^2(0,T;L^2(\Omega))$ and $L^1(0,T;L^\infty(\Omega))$.
EDIT: it seems that there's no relation whatsoever. In particular if $\Omega=[0,T]=[0,1]$ there are simple examples for no such relation between $L^2(0,T;L^2(\Omega))$ and $L^1(0,T;L^\infty(\Omega))$: take $f(t,x)=\frac{x}{\sqrt{t}}$ and $g(t,x)=\frac{t}{x^{1/4}}$ - one of them is in $L^1(0,T;L^\infty)$ but not in $L^2$ and the second one vice versa. I believe these examples can be easily modified to other cases.
I'm not deleting this post in case somebody would have a similar problem in the future.
Answer: No, this is not true, as long as $L^{q_1}(\Omega)\setminus L^{q_2}(\Omega)\neq\emptyset$.
You can see it considering a function $f\in L^{q_1}(\Omega)\setminus L^{q_2}(\Omega)$ and setting $u(t,x)=f(x)$.


Easiest way to create static HTML file with sortable and filterable table?

Question: I want to create a static HTML file I can email to someone with a lot of data, and have that data sortable and filterable.  What is the easiest to use library or package I can use to get this off the ground?
Comment: If it's static (an "off-line" page), I'm not sure you'll be looking at AJAX, since AJAX is usually used to communicate with servers.
Comment: I am amazed that With all the technology that keep popping every hour, your simple requirement can't be fulfilled! Consider using ZOHO or Google Docs instead.
Comment: This needs to be static, I'm just going to roll my own.
Comment: What's wrong with a good old fashioned spreadsheet file?
Answer: You can't. You need one of three things to change HTML structure semantically

JavaScript, event handlers and dom manipulation
Forms, servers and postbacks to change the page and send a new one
CSS hackery, things like remodelling the CSS based on the :active state or manipulate checkboxes :checked state.

In theory it's possible to implement this with HTML and CSS alone but that's going to a be a nightmare.
Why don't you just add a link to a google document with a sortable table in it, in your email.
Of course using JavaScript to implement a sortable table isn't hard.
table.addEventListener("click", function (ev) {
  if (ev.target.tagName === "th") {
    sortTable(ev.target);
  }
});

form.addEventListener("change", function (ev) {
  applyFilters(ev);
});

Just implement sortTable and applyFilters
Answer: Check this one at Matt Kruse's Javascript Toolbox.
Also you can find DHX DHTMLX very useful.
Comment: Be warned that "generic filterable/sortable table" structures copy pasted from the internet are high fragile and likely to be full of unmaintainable spaghetti code. If it breaks your out of luck
Comment: @Raynos, good call, I'm going to roll my own, this actually isn't that hard... :)
Comment: Certainly it is as you say but the question here was

"What is the easiest to use library or package I can use to get this off the ground". So was the answer.
Answer: Use XML not HTML, XML is meant to hold data, HTML is meant to create a webpage. Using XML also allows you to use XSLT to manipulate the stored data. Though depending on your definition of large amount of data it may be best to allow access to a database with the information, or import the information to database on their end.
Answer: You Can achieve this easily by using the following,
   HTML & CSS - Presentation,
   Java Script / jQuery - Logic,
   XML - You Raw Data,

Since you have asked for the open sources, so i would suggest you this one Click Here Which has documentation and source for both filter and sort functionality.
Happy coding,
Cheers,
Arun


How to get author developer link on plugin page

Question: When I upload my plugin to Wordpress's repository it currently shows my full name as the author. It doesn't link to my profile though. I've tried changing the author name to my username, but it still doesn't link. How do I link my plugin to my profile on wordpress.org?
Answer: You need to put your Wordpress.org username in Contributors section in the readme.txt file. Then your plugin will be associated with your account.


vmfs partition size

Question: After attaching a ISCSI target to ESXi 4.1 U1, we saw that ESXi created a 740,25 GB partition onto the LUN, even though the device has 2,7 TB capacity. Why did ESXi not create a bigger vmfs partition? How to fix it?
Comment: We tried deleting the partition from storage server with cfdisk and letting ESXi recreate the partition using a different blocksize but this resulted the partition size to still be 740 GB.
Comment: Updated the question with new information about ESX LUN limits.
Comment: Relocated the information from question to answer part.
Answer: The "Why?" part:
According to http://www.delltechcenter.com/page/3TB+drives%3A+OS+Behavior+Matrix, the maximum LUN size for VMFS is 2TB.
According to http://www.delltechcenter.com/page/3TB+drives%3A+OS+Behavior+Matrix what ESX will do if the LUN size is bigger is it makes a 740GB partition and the rest is inaccessible.
The "How to fix it" part:
Present a smaller than 2TB LUN to ESX. That can be done by creating partitions on the disk (/dev/sdb1 /dev/sdb2) and exporting those partitions as separate LUNs to ESX.
Answer: Max size LUN in ESXi is 2TB -512 Bytes. The LUN can be no bigger. The information can be found in the VMware configurations maximums document.

vmfs partition size


Drive with Final Cut Pro video files on it is dying, need to point FCP to the backup drive

Question: We have a 45 minute feature in Final Cut Pro. We've kept the video files on an external drive which is evidently dying -- like totally dying. Let's call this dying drive OldDrive. Fortunately we have a backup drive that has all the same files in exactly the same file structure -- it's an exact copy of the folders and files on the original drive. Let's call this NewDrive. Unfortunately, NewDrive is a different drive with a different manufacturer and different name in the finder. Since OldDrive is dying/dead, we cannot use any of the Final Cut Pro library functions to move the library from within. Is there any way in Final Cut Pro to just tell it to link all the video files on NewDrive instead? It would be a real chore to try and relink every file one by one.
Comment: If you're not using OldDrive anymore, just rename NewDrive to OldDrive in the Finder. The manufacturer is irrelevant.
Comment: @benwiggy so if the file contents of the two drives are the same and the names are the same, FCP can't tell the difference?
Comment: It may depend on which it thinks are in `myLib.fcpbundle` & which are external resources. [I'm not qualified well enough with FPC's structure  to truly distinguish]. It's definitely worth a 'try it & see'.
Answer: Reconnecting the original and even proxy media is very easy in Final Cut Pro.

Disconnect your oldDrive
Connect your newDrive
Open the Final Cut Pro X library and open the media tab. All media which can't be found will look something like this:
In your top menu bar go to file, next reconnect media and then select original media.
Search for the files on the newDrive.

This Apple support article covers this also very well.
Comment: @x-841 This is helpful information, and I have upvoted your answer. I had read that apple support article, and am aware that FCP will indicate broken media, and that one can reconnect media. What I'd like to know is whether it's possible to simply point every media link in the entire project to a new location without having to address each file individually.
Comment: @S.Imp usually when you point the first file it will find the other ones. In fact if the project (library) is in the root folder of the media it will normally find everything by itself when you load it. There is good change you dont have to do anything but copy the project to the newDrive.


What is the best tips to use while soldering?

Question: Is a silver tip better to use rather than a copper tip?
Comment: James, do you mean a tip that's actually silver? or just silver colored? If the latter then it's copper that's been tinned. It has a very thin layer of tin (or maybe an alloy) that keeps the copper from oxidizing and helps solder stick to it.
Comment: An uncoated copper tip corrodes pretty fast, hence why you don't see uncoated copper tips too often. Not sure if silver is much different in this respect (it is a precious metal).
Comment: I'm curious if you're thinking about making such a tip yourself or did you actually find one for sale somewhere... I'm asking because I can't seem to find such a [rara avis](https://en.wiktionary.org/wiki/rara_avis) advertised for sale (in this century).
Answer: There is no reason to get a silver tip.
Get yourself a good standard tip that has been primed with the proper coating, such as tips from the major brands (that usually only fit the major brands of soldering gear well, tbh). My Weller tips last me years, especially if you have a small € 5,- can of activator to re-activate the tip once in a while when it doesn't have the solder stick well enough any more.
Fun fact for all you tip-material-geeks: Some very cheap cast iron tips or similar can actually be activated to work for a couple weeks with Cooper Tools / Weller tip activator. Tried it for a friend once, who had a €7,- plug in iron that had no wetting action. Because the tip was garbage. After activator it worked for a couple of weeks. I do not doubt other brands will work too, but I got stuck to this brand in the 90's :-)
The causation for silver tips is/was maybe a bit of lore around the whopping 2% higher thermal conductivity, but probably the higher inertness of silver compared to copper, but first of all: Most major brands don't use pure copper any more and second of all they are coated to protect. So as long as you don't bend or actively scratch cheaper tips you will probably not notice the difference. And if you do, in 6 to 12 months it will corrode away and you spend €4 on a new tip, rather than having a €50 tip for the 3 to 5 years you'll be happy with this model of soldering iron.
Answer: Silver has slightly better thermal conductivity than copper. So on those terms alone it would be better, but only marginally so.
I don't know about other things like lifespan of the tip, etc.
A bit of googling found a 1924 Popular Science article praising such a silver tip.
Whether it's worth the significantly higher cost is a different matter though.
There is one other issue to consider: whether a silver tip will have good wetting action with the solder normally used in electronics. Wetting action increases the surface area used for thermal contact between the tip and target material[s]. I don't do silver brazing (or use silver wires), so I'm not entirely sure about this, but a bit of searching suggests that the alloys used to optimally solder silver are different than for copper. So wetting action of a silver tip with tin-based solder might not be so good, possibly negating the slight advantage silver has in thermal conductivity through the tip alone.
Comment: Bit of a problem there: the Popular Science article refers to "German silver", which is an alloy of about 60% Cu, 20% Ni and 20% Zn. There is no Ag in it.
Answer: Have you seen this video ?
If anyone, Dave knows what he's talking about.
Soldering isn't only about what tip you use but many other things as well.
You can use the most fancy-schmancy silver tip ever but if you set the
temperature incorrectly or use the wrong solder, it's a waste of money.
As far as I know for general soldering no-one uses silver tips.
A copper tip is good enough but you need to use it properly and maintain it so that it will last a long time. An oxidized tip will not be able to transfer the heat properly so you need to keep your tip in good shape.
In paractice the heat conductivity of copper is sufficient and I don't see why silver would improve on that. What is important is thermal capacity, a small tip cannot transfer as much heat in a given time compared to a larger tip. So choose the right tip for the job !
Answer: Most modern soldering tips are plated with Iron over the entire area of the tip, with another material plated on top of the Iron at the front part of the tip where the solder is melted.
The Iron prevents the copper from oxidizing and corroding, while the additional plating layer used for soldering presents a surface that wets well with solder.  These plating materials allow the tip to have a MUCH longer lifetime than an unplated copper tip.
The combination of these plating materials will give the tip a silver appearance, especially in the area of the tip where the solder melts.
Both Weller and Metcal have great descriptions of the plating materials used on their tips.
Answer: Just buy a tip from a good brand and you will be good to go. You really do not need to worry about the coating or metal. One important thing would be to have a welding tip cleaner (steel wire ball) ready at hand so that the oxide can be removed when needed.
As a bonus I have pointed out some general good advice below:

Soldering station

Soldering tip (one small and one big)

Soldering wire (60/40 Rosin Core). According to me, the diameter does not matter much. If soldering tiny SMD parts the flux will keep the solder from bridging over pins and will dispense the solder evenly.

Rosin/Resin flux (gel)

A high quality soldering wick (a pump could be handy as well if large amount of solder should be removed)

Keep the soldering iron at the temperature you need to be at, given the situation at hand. I usually have mine at approx. 350C and that works fine most of the time for smd work. Don't be shy when it comes to crank up the temperature if needed.
This does not cost much and you will solder like a god.
Comment: Hum, my bad. It is a language thing with the wording of "tips" in Swedish :)
Comment: While this may be good advice, it does not answer the question.
Comment: The word "tip" is ambiguous here. When I first read it, I thought that Bettencourt was using the word "tip" as in "suggestion" or "advice".  But it was clarified to ask about the metallurgy of the working end of the iron.  staringlizard's advice is excellent. The question seems odd as there appears to be no advantage to using a metal that is both soft and expensive.
Answer: The best tip I have ever used, was made of copper-silver alloy (I don't know the ratio). It never got corroded or wasted for a long time, and it was always clean and wetted.
Answer: Silver has more thermal conductivity than Copper. And even Silver is at the bottom of the reactivity chart. And life span of Silver tip is certainly better. Therefore Silver is better.

(source: tutorvista.com)
Comment: Could you expand this to provide more details or links to references?  Try to add to the other answer if possible.
Comment: Obviously Sathyaram, you don't do a lot of soldering yourself. The heat conductivity is not the only property of importance. Also that heat conductivity of silver is only 2% higher.
Comment: The reactivity of Silver is low compared to Copper. It means the tip also lasts longer. What else one wants?


ERROR: currval of sequence "rss_sub_source_id_seq" is not yet defined in this session

Question: When I used this query to see the current primary key seed of my PostgreSQL 13 table:
select CURRVAL(pg_get_serial_sequence('rss_sub_source', 'id'))

it told me:

SQL Error [55000]:
ERROR: currval of sequence "rss_sub_source_id_seq" is not yet defined in this session

The id column is defined like this:
ALTER TABLE rss_sub_source
    ALTER id SET NOT NULL,  -- optional
    ALTER id ADD GENERATED ALWAYS AS IDENTITY
        (START WITH 1233);

Table definition:
CREATE TABLE public.rss_sub_source (
    id int8 NOT NULL GENERATED ALWAYS AS IDENTITY,
    sub_url varchar NOT NULL,
    created_time int8 NOT NULL DEFAULT date_part('epoch'::text, now()),
    --  ... many more columns
    CONSTRAINT rss_sub_source_pkey PRIMARY KEY (id),
    CONSTRAINT unique_sub_url UNIQUE (sub_url)
);

How to see the current auto-increment seed for the primary key?
Answer: The functions currval(regclass) and lastval() only make sense after nextval() has been used in the same session (not transaction!). Concurrency control in PostgreSQL is reason behind this behavior.
If you are just curious about the current state of the sequence (not the last serial ID actually used in the session), you can always just call nextval():
SELECT nextval(pg_get_serial_sequence('foo', 'id'));

Returns the next serial ID, which had not been used, yet. This carries the flaw of actually consuming the returned ID (which should not matter in a proper relational design). But that side effect can be avoided. In Postgres, serial and IDENTITY columns are implemented using a SEQUENCE internally, which happens to be a table-like object that can be queried like a table. If you are curious about the current state of a SEQUENCE, just use SELECT:
SELECT * FROM public.rss_sub_source_id_seq;

(Requires the SELECT privilege on the sequence, while the above mentioned sequence functions require the USAGE privilege.)
You need to know the name of the sequence for this, and you already know how to get it: pg_get_serial_sequence('rss_sub_source', 'id'). It's easy enough to guess, too. See:

PostgreSQL next value of the sequences?

For ad-hoc use, just compile the query by hand. Or you can use \gexec in psql:
SELECT 'SELECT last_value - CASE WHEN is_called THEN 0 ELSE 1 END FROM ' || pg_get_serial_sequence('b2', 'big_id')\gexec

See:

Simulate CREATE DATABASE IF NOT EXISTS for PostgreSQL?

For automated (or regular) use, you need dynamic SQL to use the text value returned by the function as SQL identifier. Here is a simple custom function to do that. Also factored in is_called:
CREATE OR REPLACE FUNCTION sequence_currval(_tbl text, _col text, OUT currval bigint)
  LANGUAGE plpgsql AS
$func$
BEGIN
  EXECUTE 'SELECT last_value - CASE WHEN is_called THEN 0 ELSE 1 END FROM ' || pg_get_serial_sequence(_tbl, _col)
  INTO currval;
END
$func$;

Call:
SELECT sequence_currval('foo', 'id');

This is safe against SQLi because pg_get_serial_sequence() returns the identifier safely double-quoted as needed.
The function returns the last value that has been consumed from this sequence. (Does not mean it made its way into the table.) The next one will be greater. (Assumes a default sequence with INCREMENT 1!)
It does not consume a serial ID and does not require that nextval() has been called in the same session.
Consider this demo:
db<>fiddle here
Answer: Normally you want the value sequence value you just generated, or cause to be generated,
and then using lastval is the right way to get it, but you need to have provoked a nextval call to provide a value for lastval.
If for some reason you don't need to know that value. but just want some recent value, possibly from another session or even a transaction that was rolled back.
select * from rss_sub_source_id_seq;
Will give you some information about the current state of the sequence without advancing it.
data=> select * rss_sub_source_id_seq;
 last_value | log_cnt | is_called
------------+---------+-----------
     676535 |      32 | t

Answer: invoke nextval first:
select nextval('rss_sub_source_id_seq')

then can using this comamnd:
select CURRVAL(pg_get_serial_sequence('rss_sub_source', 'id'))


What changes on Easy Mode?

Question: The options for Undertale Yellow includes an Easy Mode setting. What changes when Easy Mode is enabled?
Answer: According to Game Jolt's patch notes:

Easy mode: When enabled, the Hats now provide DEF values for an easier experience (can be changed mid-playthrough)

The Wiki says it increases your defense by 3:

Can be turned on or off, gives you 3 extra Defense.

What changes on Easy Mode?


jodconverter can't find officeHome, Using docsplit in centOS 5

Question: I'm trying to set up a server that will do document conversions using docsplit.  The machine I'm setting it up on is running centOS 5.  When I try to do a basic conversion from the command line I get this error message.
<code>Exception in thread "main" java.lang.IllegalStateException: officeHome doesn't exist  or is not a directory:
    at org.artofsolving.jodconverter.office.DefaultOfficeManagerConfiguration.buildOfficeManager(DefaultOfficeManagerConfiguration.java:165)
    at org.artofsolving.jodconverter.cli.Convert.main(Convert.java:111)
</code>
I've tried setting office.home system property in java but that doesn't work.  Since I'm using docsplit is there any way I can manual tell jodconverter what the office home directory is?
Answer: make a symbolic link
<code>[root@sakura opt]# pwd
/opt
[root@sakura opt]# ln -s /opt/libreoffice3.4 libreoffice
</code>


How to Programm A Dialog box with a typewriter effect in Java?

Question: Im am very new to java and programming so I might be a bit annoying to work with but please bear with me :D So As the title says I'm trying to figure out how to properly program a working dialog box with typing text animation for a game I'm working on. I've seen some posts about swing timers but Im having trouble properly understanding them. If anybody has an idea please share it!
Comment: What GUI technology are you using?
Comment: Welcome BaconDevil Gamming, this site is using a question and answer format and is not intended for long discussions or help sessions. Please, either consider asking at e.g. www.gamedev.net or reformat your question so it can be answered more easily within a single answer.
Answer: First of all if you don't already know the basics of Java, you should learn them first. :)
When you have, you will need some kind of graphics library.

I know that LWJGL is a good graphics library.
LWJGL Link :)
According to some people over at stack overflow, Minecraft was made with this.

But, as I said it's  probably best (if you don't already know this) to learn the basics of Java first.


What are the hidden digits in this long division puzzle?

Question: The following problem was given in the Eureka journal (April 1978/University of Cambridge). This problem can be solved by hand without computers.  There is a unique solution.  The phrase, "exact long division", means the remainder is 0.  Have fun solving!

EDIT:  I have found an earlier source of this puzzle in the book, "536 PUZZLES & CURIOUS PROBLEMS" by Henry Ernest Dudeney.  This book credits this puzzle to Mr. A. Corrigan.  In the book the puzzle is worded differently but it the same mathematically.
Answer: Here is how I reached the solution with my elementary knowledge :P
First,

 we can find that the red coloured digits must be zero as they are brought down from the top row.

 The red digit in the quotient is zero because when $***×\color{red}*=**$, where the first digit is non-zero (clearly, in this case), the red digit must be a zero, otherwise the result will be a three digit number.

Now consider,

Clearly $d\neq0$ and so is $c$. As $a\cdot b=..c\neq0$, none of $a$ and $b$ is equal to zero. Thus in order to get the product $a\cdot e=...0$, one of them must be $5$ with other being an even number.

Now...

 ... assume $e=5$. In order to get $**a×e=d000$, '$a$' has to be zero. (Eg:- consider $200×5=1000$, $400×5=2000,$ etc.), but then it's a contradiction. Therefore from the previous argument, $a$ must be $5$. Also then, $e$ is an even number  but we can reduce the possiblity to $\{4,8\}$, because when multiplied, there should be a number with last two (three, actually) digits being $0$.

Then...

 ... since $c\neq0$, it should be $5$. So $d$ also becomes $5$. Then we have $**5×e=5000$. We see that $5000=2^3×5^4$. We need to fill the numbers in $\text{_ _} 5 × \text_ =5000$, where the one digit number is confirmed to be $4$ or $8$. If it is $4$ the other number in the product should be a 4-digit number, which leads to a contradiction. Thus we can easily find that it is $8$ as in $625×8=5000$.

Now we can easily deduce that..

... the other digits in the quotient are $1$s because the every product remaining (i.e. $625×*$) results in a 3-digit number. So we can see that $b$ should be a $1$, giving $625$ (where the last digit was $c$ previously) and the prior number $630$. From there working backwards we can find all the missing numbers.

Hope I made it clear.
Comment: Excellent work. One comment: You used the fact that if a product of an even and odd number ends in "00" then the even number is a multiple of 4. You could skip a bit using instead that if a product of an even and odd number ends in "000" then the even number is a multiple of 8. (This continues for any number of zeroes and matching power of two, since divisibility by $10^n = 2^n 5^n$ implies divisibility by $2^n$.)
Answer: Solution:

Reasoning:

 Since the result has four decimal places, the divisor must be divisible by either $2^4$ or $5^4$. Trying $5^4$ first: the only multiple of $625$ with three digits is $625$, so the first four nonzero digits of the result are 1. The final digit is somewhere between $2$ and $9$, and trying them all out shows that only a final digit of $8$ yields an integer numerator. So if the result is $1011.1008$ and the denominator is $625$, the numerator must be $1011.1008 \cdot 625 = 631938$.
Comment: Could you please give more detail about how you solved this.  Thanks!
Comment: Your edit explains your solution well except one part.  Why must the divisor be divisible by either $2^4$ or $5^4$?
Comment: @WillOctagonGibson Well, one way is: Multiply numerator and result by 10k. How do you remove those 4 zeros at the end of numerator (last digit of result cannot be 0 - otherwise it wouldn't be there)? You need to divide by 2^4 or 5^4 (N*2^4 and whatnot is also an option).

Also, if your denominator is 5^4, result (if it was multiplied by 10^4 to remove decimal places) needs to be N*2^4. Noticing that last 2 digits before the end are 0 (see other answer) immediately gives 8 as the last digit (1000/16 = 62.5; so we need 8/16 to make it integer)


Issues with Craft Commerce

Question: We have a dutch website build with Craft CMS and for the webshop Craft CMS Commerce. This has been done by a design company. We don't receive any orders and I am wondering if the whole process is okay. Translate version in English will be launched in September. Als the search filter is not working properly. Can someone have a look at it and could give me some reply? I can do the standard items in the backend from Craft but no codes. The webshop is: www.hulshofbusinesscases.com. Thanks for listening and maybe you help. Greetings Marina
Comment: Welcome to craftcms.SE! Unfortunately, this question is far too broad to be able to provide a useful answer. I'd recommend following Clive's suggestion, and get in touch with your developer.
Answer: Sounds like you need to get in touch with the developers or find some new developers. But run a test purchase for peace of mind anyway.
Answer: As far as I can see it everything is working fine.
I obviously did not buy the product, but until the final checkout, everything worked as expected.

Issues with Craft Commerce


Why do we need Anaconda when we have pip?

Question: Anaconda has become very popular in scientific computing, because it bundles together over 125 of the most widely used Python data analysis libraries. My question is, since we already have pip (which is a very widely used Python package manager), why do we need Anaconda? Couldn't we all simply type pip install for each of the 125+ libraries and they'd all work together nicely? Or would they not work together nicely, meaning that Anaconda has done us all a big favour by sorting out the issues that arise when trying to get 125+ libraries to interact nicely?
Comment: I guess `pip install` for 125+ packages is too much hassle for you to try it out yourself? Having a community using the same versions of libraries is much better for collaboration than everyone having just the latest version of each library that was out on the day they installed.
Comment: It's actually a bit of a hassle to install some packages on Windows. For example, if I want to install numpy via pip on Windows, I need a C++ compiler, a fortran compiler, etc. If I just do "pip install numpy", it won't actually work by default on Windows and will require me to do additional setup and installation. There's no general "windows" package manager, so now I need to hunt down what I need to install, muck with my path and configuration files, etc. Same thing with a lot of the more "hefty" libraries.
Comment: because it simplifies the installation, and therefore also distribution. And it lowers the entry level of scientific computing considerably. Especially on windows.
Comment: I don't think this is opinion based, there are objective reasons, as I exposed. Another thing would be Anaconda vs Canopy vs Python(x,y)...
Comment: "We" don't need Anaconda. But if you are on windows, and don't have a compiler, Anaconda may be one of many solutions
Answer: Three fundamental reasons:

Most of these libraries require linking to system installed libraries (like, say, HDF5 for PyTables or ATLAS for Numpy), that the user may or may not be aware of. Note that Matplotlib requires a bunch of different graphical libraries, and if they are missing, it will crash on certain backends.
pip compiles libraries (with wheels you can avoid this step, though). This requires a C compiler (difficult in Windows) and a FORTRAN compiler (difficult in Mac and Windows). It also takes time for big libraries like Scipy.
Anaconda's metapackage anaconda is a minimum set of libraries that Continuum has made sure they play along together well. In an ideal world, we should always be using the last and most improved version of everything, but that may lead to incompatibilities.

And a complement:

It is easy to use conda to create set of packages for distribution. So you can easily share your package including all its dependencies.
Answer: The problem is that a lot of these scientific packages have dependencies on a lot of external C libraries and with one another which pip cannot handle.
For example, see my question: How to Bootstrap numpy installation in setup.py
That was for my own library, but I think a lot of other packages face a similar problem.
Also, compiling libraries takes a long time. Just typing pip install numpy on my machine takes over a minute. It's the same reason people use pre-compiled binaries with apt-get or yum instead of compiling programs from source.


How do photons travel? Do they have a specific shape?

Question: Generally photons are EM waves (2-axis i.e, 2 dimensions); from that we can imagine a photon basically travels in a cyclic wave pattern. If we go into higher dimensions, will they trace a spiral path to travel? Do they have a specific shape? I don't have an idea what photons are actually comprised of.
Comment: *Generally photons are EM waves* Photons are *not* EM waves, but neither do they have a classical trajectory like a classical particle does. They are not comprised of anything simpler. They are the quanta of the quantum EM field.
Comment: Also, why do you think they would travel in spirals in higher dimensions? As far as I know, plane waves moving linearly are solutions even in higher dimensional Maxwell equations.
Answer: Photons are elementary particles, as per the Standard Model, they are point like and do not have any substructure or spatial extent. You are asking what photons comprise of, but as they are elementary, they are not comprised of anything simpler.
As photons are QM objects, the very quanta of light, they do not have specific trajectories as they travel, they are delocalized. When the photon interacts (is absorbed for example), only then is it localized.

When we look at light in the quantum regime then the whole concept of a trajectory is meaningless because the trajectory is a classical limit. At quantum scales no particle, including light, has a perfectly defined trajectory.

How do single photons travel from here to there
Now the connection between the classical EM waves and photons is a beautiful example how this classical EM wave emerges from the herd of photons, individually being QM objects.

the classical electromagnetic field emerges from a large confluence of photons. It needs the mathematics of quantum field theory. The electric and magnetic fields are present in the photon wave function, which is a complex number function and is not measurable, except its complex conjugate squared, a real number gives the probability density of finding the photon in (x,y,z,t).
  It is the superposition of the innumerable photons wave functions which builds up the classical EM wave.

What exactly is a photon?
You are asking about the shape of classical EM waves, and it can be very confusing because you see these images of oscillating wave forms displayed as EM waves. In reality what oscillates is the E and M field values.

In light propagation, oscillation does not mean any movement in space. It is the value of the electromagnetic field, at one given point in space, that oscillates. For electromagnetic waves, there is no matter or photons that go up and down. Instead, you have to imagine that there is a little arrow associated to each point in space: this little arrow is the electric field direction. Another arrow, at the same point, is the magnetic field. These two arrows change size and direction with time, and in fact they oscillate.

How does light oscillate?
When you are asking about the cyclic wave pattern, maybe you think of the polarization of the EM wave, which can have different types mainly linear and circular.

An electromagnetic wave such as light consists of a coupled oscillating electric field and magnetic field which are always perpendicular; by convention, the "polarization" of electromagnetic waves refers to the direction of the electric field. In linear polarization, the fields oscillate in a single direction. In circular or elliptical polarization, the fields rotate at a constant rate in a plane as the wave travels.

https://en.wikipedia.org/wiki/Polarization_(waves)
Comment: @BillAlsept If you ever try and calculate anything at the fundamental level you will soon realise that a field/wave is a much better description for any fundamental element of the standard model.
Comment: Why the downvote?
Comment: @fielder With a particle you can calculate and have a physical description, something to explain what's really going on. At the very least A particle can be used as a constructor theory. A light wave or field cannot be physically explained or described. No one can and no one even tries.
Comment: @ÁrpádSzendrei I didn't down vote, I just disagreed and do not mind discussing such things.
Comment: @fielder I don't care about the shut up and calculate approach. I care about what's really going on and don't understand those who aren't even curious about it. Of course you can calculate how particles interact with  something. Bell's inequality is an example of that. You cannot describe physically what a light wave is but your  not the only one who cannot do this. Usually what you get is photons or excitations of the electromagnetic field, Fields are made of waves and waves collapse into photons, and photons are excitations of the field, etc. etc. you never get a real description


Did George Lucas consider Star Wars to be science fiction?

Question: Given all the classic sci-fi trappings found in the Star Wars films (spaceships, laser weapons, giant insects, aliens, etc.) did George Lucas in fact consider Star Wars to be science fiction?
Comment: Two Words. Space. Opera.
Comment: Hmmm, in the absence of any evidence that there is any justification for not regarding Star Wars as SF, I don't think the question can be redeemed in this way.  Why on earth would Lucas *not* think it's SF?
Comment: "As a kid, I read a lot of science fiction. But instead of reading technical, hard-science writers like Isaac Asimov, I was interested in Harry Harrison and a fantastic, surreal approach to the genre. I grew up on it. Star Wars is a sort of compilation of this stuff, but it's never been put in one story before, never put down on film. There is a lot taken from Westerns, mythology, and samurai movies. It's all the things that are great put together. It's not like one kind of ice cream but rather a very big sundae." - SW:ANH novelization introduction interview
Comment: It always seemed to me that Lucas considered Star Wars a gold mine.
Comment: @Christi It's just the old question of "Is it sci-fi (spaceships and aliens) or fantasy (magical Force)?" reframed.  In the absence of evidence we don't know.
Comment: I actually have found a quote where Lucas acknowledges that it's not "hard sci-fi" and that it's more of a fantastic and surreal take on the genre.
Comment: I think of it as a martial arts movie.
Comment: "Giant insects"?
Comment: @PaulD.Waite - Probably the things in the big battle between Jedi and Clones in the colosseum.
Comment: I know that George Lucas has described *Star Wars* as a space opera, which is a sub genre of Science fiction, so I can't imagine he would deny that it is also straight up sci fi.
Comment: @WadCheber: aha! [Gotcha.](http://img3.wikia.nocookie.net/__cb20101224201604/starwars/images/a/a5/Acklay3.jpg)
Comment: It's science fiction the way St. James Infirmary is a blues. It's got a lot of science fiction flavor packets sprinkled on it, but it's basic swords-and-sorcery fantasy underneath that.
Answer: George Lucas has gone on the record to describe it as a sort of combination of genres - including science-fiction, versus some of the "harder" science-fiction that he grew up with.
From an interview included as part of the introduction of the Star Wars: A New Hope novelization:

"As a kid, I read a lot of science fiction. But instead of reading technical, hard-science writers like Isaac Asimov, I was interested in Harry Harrison and a fantastic, surreal approach to the genre. I grew up on it. Star Wars is a sort of compilation of this stuff, but it's never been put in one story before, never put down on film. There is a lot taken from Westerns, mythology, and samurai movies. It's all the things that are great put together. It's not like one kind of ice cream but rather a very big sundae."

However, in the annotated screenplays, he acknowledges that what he has created was never really "science fiction", per se.

I knew from the beginning that I was not doing science fiction. I was doing a space opera, a fantasy film, a mythological piece, a fairy tale. I really thought I needed to establish from the start that this was a completely made up world so that I could do anything I wanted."
Answer: No.  Lucas often used the term Science Fantasy.  He never referred to it as only science fiction.  Star Wars doesn't hold itself to use science: space craft bank in a vacuum like airplanes do in air, there's the Force (a type of magic or at least metaphysics), ....  Star Wars is about epic story telling and not one to get caught up in details such as physics and using the scientific process to solve a problem.  This is also why it's felt that JJ Abrams is a great choice for directing Star Wars movies, much more so than Star Trek which spent much effort on not violating laws of physics or at least having a really good technical explanation why something works.  Star Wars doesn't attempt to use science to solve problems where as science fiction series such as Star Trek expose science to the audience in an attempt to engage them as to the difficulty of the problem, some possible solutions, and how to conduct experiments to decide upon a solution.
Comment: This answer would be better if (a) it included some quotes from Lucas calling *Star Wars* "science fantasy" and (b) spent less time talking about *Star Trek*
Comment: Regarding (b), it's nice to have contrasting examples. :-)
Comment: Regarding (a), I agree. But unfortunately my source is a documentary film  about Star Wars and I can't find an online reference to a manuscript.
Comment: Star Wars is set "a long time ago, and in a galaxy far away" - plainly a fantasy setting, giving Lucas his license to handwave all the technology in his space opera. Star Trek is depicted as Earth's future. It is also very much space opera, but is somewhat obligated to anchor some of the science and technology in reality. While there are attempts in Trek to explain sciency and techy things, the explanations often bog down or expose the flights of fantasy more than anything else and don't really add to the stories. All it really does is attempt to make the world the characters inhabit feel real
Answer: It combines elements of both and I have heard it referred to as Science Fantasy.
Lucas seemed to view it as having Sci-Fi and Fantasy and even tried to remove some of the ambiguity with his, disastrous IMHO, attempt to qualify the force as a symbiotic relationship pushing it more towards Sci-Fi.
Answer: When I was watching a making of Star Wars video George Lucas said; "It's more of space fantasy." He took lots of fantasy things but put them in space. There's the hero, Luke; the smooth serious guy cool guy, Han; the old man that guides the hero, Obi-Wan; and the damsel in distress, Princes Leia.
Comment: This is not a very good answer. For one thing, a space fantasy is not necessarily separate from science fiction. Secondly, none of the character tropes you mention are exclusive to any genre.
Comment: Sci-Fi tends to try to build a much more reasoned approach to its stories, where as fantasy would be of a more magical approach.
Just because the setting is futuristic, rather than medieval, does not make it a sci-fi.
Comment: Princess Leia wasn't really a damsel in distress.
Comment: She was definitely a damsel in distress in the eyes of the crew of the Millennium Falcon. Little did they know her combat training, yet she still needed help. So in this respect, she falls well within the Mario/Zelda "Princess in distress" category in my opinion (even if these plotlines superceded SW, it's still a category).
Comment: In fact, she's even mentioned on this page: https://en.wikipedia.org/wiki/Damsel_in_distress


I am looking for STL files of my Prusa i3 printer?

Question: This is my 3D-printer, and I am looking for it's <code>.stl</code> parts to print. Also I don't know which kind of Prusa is it?
Comment: There are a thousand-and-one Prusa i3 variations. Without some more information, it is impossible to identify this specific part.
Comment: @TomvanderZanden: The problem is here that I don't know what name do my model have?
Comment: So, add a photo of your printer so that we can identify it.
Comment: @MickL I added some photos
Answer: I would try Googling your specific make of the i3. For example if you have a Geeetech Prusa i3. I would type in Google "Geeetech prusa i3 stl parts" and I'm sure you should fine plenty of things.
If that is unsuccessfull. I guess try this one. It looks similar but it lacks that hole on the bottom middle to the right of the motor holes. So if its not important, I would look at this. https://www.thingiverse.com/thing:1103976. Might be a good idea to replace the entire X axis system with a new printed one to make sure it all fits and works.
@Tom van der Zanden is correct that without your specific version it is impossible to find the same part since small variations such as the distance between the two X axis smooth rods may differ between parts. While it is almost standard for the i3 design, you will find minor changes between variations.
I would also try scrolling through here. https://www.thingiverse.com/groups/prusa-i3/things