How to "open interfaces to expansion" without breaking existing implementations?

Question: For example, I have an interface Requests that basically lists all the requests a client can make to a server program. Now an obvious problem arises where I have to add a new request to the program i.e. the interface. Existing implementing classes would then have to implement the newly added method in order to compile and that can't be any good. How then can interfaces be made to comply with the Open-Closed Principle?
Comment: Interfaces don't comply with OC principle, implementations do.
Answer: What you have there is a wrong abstraction. The idea with abstractions is to arrange the code so that less stable components (code that changes more often over time) depend on components that are comparatively more stable. This is not something that you are necessarily going to get right from the start, as initially you probably do not understand the domain and codebase change patterns enough - so you'll have to course-correct until you get it roughly right, in the sense that the structure supports business needs well. There are other types and levels of abstraction in programming, but these that are closely related to the domain have to be based on business needs - you can't just come up with some "armchair philosophy" idealization and hope it will all work out.
So if you have other code depend on the Requests interface (callers via reference, implementers via realization), and this interface is not relatively stable, then the abstraction of "here's a list of specific requests that I support" is not going to work for you. You have to look closer at the domain and find a better abstraction.
Now, I realize that the example you've given may be contrived, just to illustrate the issue, but let's suppose it's not.
The fact that you keep adding requests means that the calling code cannot depend on the concrete request type. One way to approach that is to use the Command pattern - if it is possible to come up with a generalized request concept that is useful, then you can have your client code depend on a list of these generalized requests (and not know about their concrete types). Note that that means that you'll have to rethink how your code fits together conceptually. Maybe you'll have to move some logic from the client into each concrete request. Maybe some of the requests will have to be parameterized by injected behavior. Maybe you'll have to somehow separate out the logic that picks and coordinates these requests. But if you can pull it off, then you have a relatively stable abstraction where adding new requests doesn't affect client code (Open-Closed Principle), and where the degree of separate evolvability has increased.
That's just some food for thought; since none of us here has enough knowledge about your domain (simply because we're not on your project), don't take this as a recommendation - you (and your team) will have to take a closer look and figure out what works based on your knowledge of the domain (and on the ability to expand that knowledge).
P.S. In our fast-paced culture, ideas spread easily, but some of the substance becomes lost in the process. Here's Robert C. Martin's discussion of OCP published in C++ Report back in 1996: (waybackmachine link). The thing about OCP is that it has to be strategic:

It should be clear that no significant program can be 100% closed.
  [...] In general, no matter how "closed" a module is, there will
  always be some kind of change against which it is not closed.
Since closure cannot be complete, it must be strategic. That  is, the
  designer must choose the kinds of changes against which to close his
  design. This takes a certain amount of prescience derived from
  experience. The experienced designer knows the users and the industry
  well enough to judge the probability of different kinds of changes. He
  then makes sure that the open-closed principle is invoked for the most
  probable changes.

Design is all about trade-offs: you get something, but you also pay some price - you have to weigh out the pros and cons.
Comment: All the answers below are really great (particularly amon's exposition of the expression problem), but what really nailed it for me here was the emphasis on aiming for a "stable" abstraction
Answer: If you seriously want to follow the O/C principle, then you shouldn't add methods to a published interface. You could create a new interface which inherits from the existing but adds the new method.
Adding a new method to an interface is a modification, which should be avoided. Creating a new interface which extends the existing is an extension.
Comment: Understood, though I don't see it as a solution that would scale in the long run. Perhaps interfaces are just not suitable for the use case I gave but I just don't see any other reasonable alternative (besides maybe an abstract class--which I just have uncomfortable vibes about)
Answer: Changing an interface or base class violates the Open/Closed principle, and there is no way how that can be made compatible.
If you design a system in a way that satisfies the Open/Closed principle, then you can make some changes to the system without having to change the source code all over the place. Note:

This doesn't mean arbitrary changes are possible.
You still need to create suitable extension points up front. You can't generally retrofit the OCP without changing things first.
The OCP is most useful when you have clear API boundaries in your system, for example for the API of a library. The OCP has dubious value within a system, in particular within an application where you can just edit the code to accommodate your changes.

In your case there are two distinct interfaces:

the interface offered by some server. Adding new operations that the server supports  is fine.
the interface in your source code that requires implementing classes to provide certain functionality. Requiring new functionality to be offered is not fine.

Sometimes, the latter aspect can be solved by not having an interface with all provided operations, but by having a separate object for each operation.
Compare this solution which allows new API providers to be implemented, but not new operations to be added:
interface API {
  void operation1();
  void operation2();
  void operation3();
}

class ImplementationA implements API { ... }
class ImplementationB implements API { ... }
class ImplementationC implements API { ... }

Compare with this solution which allows new operations to be implemented, but not new API providers:
// The API implementations are entirely separate.
class ProviderA { ... }
class ProviderB { ... }
class ProviderC { ... }

// Each operation must know how to execute itself on each API implementation.
interface Operation {
  void executeOnA(ProviderA a);
  void executeOnB(ProviderB b);
  void executeOnC(ProviderC c);
}

class Operation1 implements Operation { ... }
class Operation2 implements Operation { ... }
class Operation3 implements Operation { ... }

In practice, you cannot have both operations and API implementations extensible at the same time. This extensibility problem is also know as the expression problem, and attempted solutions are a really hairy and typically require advanced generics.
So in practice you have to pick one direction in which you want to keep your design extensible, with the understanding that extensions in other directions require your design to be modified.


ESP 8266 web server using arduino

Question: I have built a system using arduino and Ethernet shield. It gets rgb values through URL and changes an rgb led's value. Today I bought an ESP 8266 12E. I want to change to wifi but I cannot find an arduino library that uses spi to connect the arduino to the ESP. I do not want to use only the ESP. Do you know any libraries to do the job or any tutorials.
Comment: *"I do not want to use only the ESP"* -- you know you can [use the Arduino tooling and all with it](http://www.esp8266.com/arduino)? Also, *"It gets rgb values through URL and changes an rgb led's value"* sounds like it's not a web server, but a client?
Comment: Yes but I want a lot of pins like an arduino mega
Answer: The ESP communicates using the UART, not SPI. It uses modem-like AT commands. Unless you write your own ESP firmware, in which case how it communicates is up to you - and so is the accompanying Arduino library.
Comment: So, the spi pins on the ESP are for master? And what libraries are there to use with serial?
Comment: Yes, the SPI pins are for use when you write your own firmware for the ESP. There are a number of libraries around for serial - google is your friend. Or you can just do it manually without a library, the protocol is simple enough.
Answer: The following link is a great resource for learning how to use the WiFi module.  It has all the commands you are likely to need.  The guide is written with the intent that the user will use the module as a standalone device without the Arduino, but at the end of the guide the commands given are all the same.  This is the reference I use for projects like this.  ESP8622 Quick Start Guide

ESP 8266 web server using arduino


Financial markets predictions

Question: How do economists/investors predict supply and demand in financial markets such as indices, currencies, etc?
Answer: There's a lot of techniques used, but it is extremely rare that forecasts are on "supply and demand", rather prices. To go from supply and demand to prices (which is what investors are interested in), you need supply and demand functions, which nobody can really estimate well.
I will first comment on supply and demand analysis for the bond market (the market I am familiar with), then have a few quick comments on price forecasts.
One does see attempts to match up the supply of government bonds (based on projected deficits) to what end investors want to buy, but such analysis is only of a niche interest. For example, governmental debt agencies try to gauge what maturity structure of issuance will match investor needs.
Meanwhile, on the demand side, people look at the effects of regulatory changes, and how much demand that will create for long-term bonds. The UK gilt curve was greatly affected by pension demand for long-term gilts.
There's a wide range of techniques used in practice to forecast prices (rates in fixed income). If one looks at the debate about market efficiency, most do not work very well (bulk of investors underperform the market average). Some analysts use methods like story-telling or technical analysis, which are generally looked down on by academic studies. However, the bulk of the analysis is fair value analysis.
For example, if I a wanted to gauge fair value for a 2-year bond, I am just going to look at the outlook for central bank policy. This is because the fair value of a bond is the expected cost of financing over the life of the bond (the short rate), which is set by the central bank. If one is interested in corporate bonds, one estimates the probability of default, to get an idea what spread is fair. Equity investors attempt to forecast future dividends and earnings. All of these analyses can be done in a wide variety of ways.
Comment: Related question: how are forecasts done on prices ( I thought prices were caused by supply and demand changes)?
Comment: Added more comments. As I discuss, "how price forecasts are done" is open-ended. You could go to an investing website that has a lot of differnt analysts, and see what they are doing.

Financial markets predictions


What other databases have a feature similar to Oracle's Flashback Query?

Question: I am interested to know what other databases have features similar to Oracle's Flashback Query. It would seem that any database that supports MVCC could have the feature, but which do?  SO has this question for SQL Server, but it seems more appropriate here.
Comment: IBM DB2's Time Travel Query is somewhat similar. http://www-01.ibm.com/software/data/db2/linux-unix-windows/time-travel-query.html
Answer: PostgreSQL does not currently have it.  But you are right, with MVCC it should theoretically be possible.  In fact, the old university Postgres had an equivalent feature called time travel, but it was later removed because it caused too much overhead and the practical use was limited.  While it would probably be possible to resurrect it, since then there have been many optimizations to the MVCC setup that would make it much harder.
Answer: The same functionality of Flashback Query can be achieved in SQL server by using database snapshots. The catch? This feature is only available in the Enterprise edition. You can read more about it here.
Comment: I'll accept "same" in the sense that a bicycle and an automobile both provide transportation.  Based on my limited understanding of SQL Server's database snapshots, the feature seems more like Oracle's flashback database except that the latter does continuous snapshoting and includes the data dictionary.
Comment: The primary feature of flashback query is being able to query the data as of a point in time in the past by simply modifying the query itself.  Data from the present and the past can be used in the same query and you can even query for for all versions of data in a particular time range.
Comment: Thank you for your input.  It is good to know the closest functionality match. (+1)
Comment: Here is a situation in which Oracle's flashback query would be useful: http://dba.stackexchange.com/questions/995/get-back-deleted-record
Answer: It's a pity that flashback feature is an addon in Oracle and only available in Enterprise Edition. DB2 10.1 has time travel query which is integrated into its database engine and available in all editions. You can download its free version from IBM and start using it right away!
Comment: Not true.  Oracle uses the word Flashback with several different features, some of which require Enterprise Edition, but Flashback Query is not one of them.  Flashback Query is integrated in the database and available in all editions, even the free version.  See http://www.oracle.com/us/products/database/product-editions-066501.html
Comment: On the surface these DB2's time travel query does appear similar to Oracle's flashback query, but in the details they are quite different.  It doesn't use MVCC and in some ways looks more like Oracle's Change Data Capture - http://docs.oracle.com/cd/E11882_01/server.112/e25554/cdc.htm#DWHSG8392.


Automatically add a link to multiple PDFs in Adobe Acrobat Pro (Batch process?)

Question: I would like to add a link to an external website to a set of PDF files - Ultimately each file would have this link in the upper left hand corner. Is there a way to automate this, much like the automation Photoshop offers? I looked through the batch processing and I didn't have any luck finding what I am trying to do. Has anyone ever tried doing this?
Comment: I deleted my answer about putting the link into Header or Footer. It turns out you cant put link in there.. Not easily on multiple pages as far as I know anyhow.
Comment: You used to be able to "select all pages" after creating a link or button in adobe acrobat. that automatically put on all pages. I can't find this feature in the recent PDFs.
Answer: Acrobat pro doesn't have a lot of manual or interface based batch operations for links, other than scanning a document's text and making text based URLs, or at least whatever it thinks are URLs, and making them into live links.
So if you have a typed URL of editable text in your PDF, you can go that route and check it, save, done...
OR... if you have a graphic in your doc and want to make it a "button", you may want to try this :

If you build your doc in InDesign you can create links for PDF export.
If you create a template or "Master page" layout in indesign with this, this template can be applied to all pages immediately.
This template can be a transparent rectangle and overlay your existing design.

It's possible to import an entire PDF into InDesign and apply this template to the whole doc and then resave as a PDF.

to do this in inDesign make an object, like a rectangle and right click or CTRL+click the item.
Choose interactive, and choose the type of interaction, like convert to button, new hyperlink etc. - many of these options are IDENTICAL to the Adobe acrobat pro dialogues...

You can then set this up as a master page, and apply it easily and quickly.
I'm sorry I don't have as elegant a solution in Acrobat, but this will hopefully help you more than just a simple "no" to your question.
you can use acrobat to make a link and copy and paste the invisible rectangle on each page, while tedious, it's another option.
Answer: I think Acrobat does this by default by just writing the URL. If you write your URL like :
http://www.myurl.com , or just www.myurl.com. After you save and open the PDF the link is there, you will notice the cursor turning into the pointing hand thingy and you can click it.
But the downside to links in PDF files is that people are not quite used with them, to make it more noticeable I would underline the text and maybe make it Bold or something to suggest that it is a link, not just normal text.
And another issue is that, usually when you click a link in a PDF file, you(the user) get some kind of security warning that you must "Allow" before the link actually works.
So if you are trying to add a link in the upper left hand corner, maybe just look for something that writes text in a batch process for PDF files(I dont know of any such thing...) but there must be one,
Or...another way, not to easy I must say, is to use this plug-in for InDesign, that allows you to import PDF into InDesign. Then within InDesign create a Master Page with your link in the upper hand left corner and apply the Master Page to all of your pages in the PDF. But you might run into problems when importing the pdf into InDesign, depending on how complex is the PDF design.
Hope this helps, its all I could think of... good luck!
Answer: If all you need is a simple text URL in each PDF, you can run this as an Action directly within Acrobat.
Open the Action Wizard: File > Action Wizard > Create New Action
Start With should be set to "A Folder on My Computer", and Save To should be set to "Ask When Action is Started".
The only Step is "Header and Footer (Add)" under the Pages section. Enter the URL in the Left Header field, click OK, and save the action with a suitable name. You can run it immediately, or access it later under More Actions from File > Action Wizard.
When you run the action, specify the source and and output folders when prompted, then just let it rip.
For versions earlier than Acrobat X, see this link for the steps involved. Adobe moved stuff around between 9 and 10, driving many people to sit rocking back and forth in dark corners, weeping quietly as they stuck pins in voodoo dolls.
Comment: This is exactly what I was looking for, thanks! Is Action Wizard something Adobe added to its latest version of Acrobat? I am using 9 and I don't see Action Wizard anywhere.
Comment: Umm... I'm running CS5.5 and Acrobat X, so yes. By the nature of things, Acrobat 9 no longer exists here. See my addition to the answer.


What is the effect of the mass of object on its acceleration? On its velocity?

Question: A short answer will do, thankyou!
Comment: That depends on more details. This is too broad.
Answer: If I understand your question, you are asking about applications of Newton's Second Law:  $F=ma$.
In the case of acceleration, you have
$$
a=\frac{F}{m} \qquad(1)
$$
which shows a greater mass, $m$, results in a smaller acceleration, $a$, for a given constant force, $F$.
In the case of velocity, the expression is:
$$
v=at
$$
Using $a$ from (1) above, this can be written as:
$$
v=\frac{F}{m}t
$$
From this, one can see that a greater mass will require more time, $t$, to reach a given velocity, again assuming a constant force, $F$.
I hope this helps.
Answer: I am assuming one-directional motion for simplicity.

Suppose you apply a Force $F$ on objects with different masses.
Then using Newton's Second Law:
$$a=F/m$$
Meaning that if mass becomes greater, acceleration becomes smaller.

Further $a=dv/dt$. Therefore
$$dv = a dt = \frac Fmdt $$
$$\int{dv}=\Delta v= \int\frac Fm dt$$
Clearly for the same force F, for greater mass, change in velocity is smaller.

In case of free fall, Force on body is $mg$ , i.e., different for different masses.
Here acceleration for any mass is then
$$a=mg/m=g$$
This does not depend on mass as different amount of forces are acting on the body during free fall.
Answer: Short answer : Depends on the magnitude of force acting since two bodies of different mass can have same acceleration and thus same velocity after sometime if both were initially at rest or moving with same velocity.
Explanation :
Case 1 : Take two bodies , say of mass $m_1$ and $m_2$ ($m_1 < m_2$)  and suppose both of them experience the same amount of force $F$.  Then from Newton's second law
$F = ma$
So,
$a= \frac{F}{m}$
You can notice that if you keep $F$ constant and change the denominator $m$ (either increase or decrease) , you will get different values of acceleration (i.e. $a_1 > a_2$) .
So acceleration is inversely proportional to mass when $F$ is constant.
Case 2 : But if you apply different forces on the two bodies , i.e. if $m_1$ is half of $m_2$ then $F_1$ is also half of $F_2$ then the two bodies of different mass will have the same acceleration . This is what happens with the force of gravity , it increases proportionally with mass and thus all bodies of different mass have the same acceleration ($g$).
Now , since acceleration may be same or different, same is with velocity of the bodies after time $t$ (taking the initial state of the masses same).
Hope it helps ☺.


Does "Run as administator" really do anything if UAC is off?

Question: I know that User Account Control should not be turned off, but let's just say it's off for the sake of argument.  With UAC off, I still have the option to "Run as administrator" on executable files, even though I have an Administrator account type.  Additionally, there is a checkbox under the Compatability tab (via Properties) labeled Run this program as an administrator.  Do either of these options actually do anything if UAC is off?
Answer: Yes.  When you use the slider to set UAC to "Never notify", it's not really turning UAC off - it's just turning the UAC notification level down to zero.  UAC is still on and UAC events still appear in the Windows event log.  If you have the slider all the way down so that you get no UAC notifications and then do a "Run this program as an administrator", UAC will still elevate the user's privileges in order to perform the action.  It will just be done silently.
Comment: According to Microsoft, that **really** turns off UAC. http://technet.microsoft.com/en-us/library/ee679793(v=ws.10).aspx
Comment: This is almost a perfect answer.  I updated the question stating that I am using an Administrator account.  Even with this setting, am I essentially using a Standard User account all the time except those situations where UAC elevates my permissions?  Please update your answer to differentiate between an Administrator versus a Standard User account.  With that extra bit of info, I will more than likely mark this answer as accepted.
Answer: By default, UAC removes certain abilities from a administrator. These include the ability to write to restricted paths amongst other things. Run as administrator gives the process the additional security privileges needed to accomplish theses tasks.
Turning of UAC basically does the same job as running as administrator (when using an account with administrator privileges) and the reason for it being on the menu is probably the same reason as having Paste always visible but sometimes disabled - it is more trouble to remove it...
The reason for it being there in properties is so the setting gets saved - if you ever turn UAC back on, it will remember that setting.
Comment: "Turning of UAC basically does the same job as running as administrator" c'mon, that is totally wrong. turning off UAC does not give you admin rights on a restricted account!
Comment: but of course ... that's the whole idea of a restricted account, isn't it? so you can run a program as admin if necessary. however, UAC, if disabled, will not warn you about the dangers of doing so. :)
Comment: @Molly - I have edited my answer slightly, but your understanding of UAC in your answer is wrong. (someone just posted an answer, and this question got bumped, so taking this time to correct it!)
Answer: Running as Administrator with UAC turned off is useful for those situations when you log to Windows on a non administrator account. As you might expect certain applications or certain actions require administrator privileges.
With UAC turned off, user level permissions at the file and directory level are still in effect and Run As Administrator becomes a useful tool in order to gain access.
Comment: imho it is better to create an additional admin account and use it instead of the built-in one, if need be.
Answer: I would just add that no one here really hit on the Admin Approval Mode settings, which is the actual answer to the specific question being asked.
This setting is something the built-in Administrator has turned off by default, and what sets it apart from a standard user-created Administrator account unless that setting is changed.
Here's the complete description of the policy for "User Account Control: Use Admin Approval Mode for the built-in Administrator account" in Local Security Policy editor (Windows OS Build 19042.746) found at [Security Settings>Local Policies>Security Options] :

User Account Control: Use Admin Approval Mode for the built-in
Administrator account
This policy setting controls the behavior of Admin Approval Mode for
the built-in Administrator account.
The options are:
• Enabled: The built-in Administrator account uses Admin Approval
Mode. By default, any operation that requires elevation of privilege
will prompt the user to approve the operation.
• Disabled: (Default) The built-in Administrator account runs all
applications with full administrative privilege.

This setting can also be changed via the registry by making a REG_DWORD entry at [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System] named "FilterAdministratorToken" with the value 1.
The other, related setting found in the same location is "User Account Control: Turn on Admin Approval Mode", which is Enabled by default. For completeness sake, here's the description of that as well:

User Account Control: Turn on Admin Approval Mode
This policy setting controls the behavior of all User Account Control
(UAC) policy settings for the computer. If you change this policy
setting, you must restart your computer.
The options are:
• Enabled: (Default) Admin Approval Mode is enabled. This policy must
be enabled and related UAC policy settings must also be set
appropriately to allow the built-in Administrator account and all
other users who are members of the Administrators group to run in
Admin Approval Mode.
• Disabled: Admin Approval Mode and all related UAC policy settings
are disabled. Note: If this policy setting is disabled, the Security
Center notifies you that the overall security of the operating system
has been reduced.

That setting can also be changed via the registry by setting the REG_DWORD entry at [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System] with the name "EnableLUA" to the value 0.
Using default settings, what this means is that the built-in Administrator account essentially runs everything as Administrator, while a user-created Administrator account still runs programs as a standard user unless instructed to run them as Administrator.
I believe this gets at the heart of what the question is asking. When you create a new "Administrator" user, if Admin Approval Mode is enabled, you still need to "Run as administrator" the programs you want to run as administrator. On Windows 7, setting the User Account Control slider to the most permissive, "Never Notify" also disables Admin Approval Mode; this is not the case in Windows 10, where Admin Approval Mode stays enabled unless turned off via Local Security Policy.
If that setting (the second one shown above) is disabled, then every Administrator account works like the built-in Administrator account does by default, running everything with full privileges. By the way, this is incredibly insecure and almost never something you want to disable, even on a personal computer.
Answer:
I still have the option to "Run as
  administrator" on executable files,
  even though I have an Administrator
  account type.

To clarify this: "Run as administrator" is not the same as running a program from an account with administrator rights - it means to execute a program from the built-in Administrator account which in Windows Vista/7 is disabled by default (not visible).
You really shouldn't use this account for anything other than troubleshooting. In fact, you probably shouldn't use it at all.
For some reason, good old "Run as ..." is now hidden; to access this option, press Shift and right click the shortcut/executable to get this:

UAC is in no way related to "Run as administrator" except you will not receive a warning when using the built-in Administrator account, if UAC is disabled or set to "Never notify".
Comment: @Molly - this is incorrect (and edited my answer slightly). It does not run as the administrator account. UAC by default removes certain rights from an user (such as ability to write to restricted directories). When you "run as administrator" it basically gives these rights back to an user. At no point do you actually use another account through UAC.


Do I need transit visa for Malaysia

Question: I'm Sri Lankan passport holder. I'm planning to travel from Japan to Sri Lanka via Malaysia by March 2020. Still I have valid Japan student visa until July 2020. Do I need transit visa for Malaysia when I travel with AirAsia.
Comment: Did you book your flights as a single ticket? And if not, are you planning to bring hold luggage?
Answer: Transit Visa:
The Transit Visa is issued to foreign nationals who require a visa to enter Malaysia on transit to other countries. Foreign nationals on transit without leaving the airport premises and who continue their journey to the next destination with the same flight do not require a transit visa.
TWoV (Transit without Visa)
The Transit Without Visa (TWOV) is only applicable after clearing Malaysian Immigration – for a maximum of 120 hours stop-over in Malaysia. However, granting Transit Without Visa (TWOV) is solely at the discretion of the Malaysian Immigration; even if guest(s) meet all the required criteria.
Countries eligible for Transit Without Visa
Indian Subcontinent

Sri Lanka
India
Pakistan
Bangladesh

Diplomatic & Official Passports only
Eligibility

Onward ticket must be within 120 hours.
Must arrive and depart only via the same airport. (E.g. Arrive in KLIA2, Depart from KLIA2)
Posses a valid onward ticket and carry a Single Entry Visa (SEV) or Multiple Entry Visa (MEV) issued from/and are heading to any one (1) of the seven (7) countries listed below (*TWOV will not be issued if next country of destination is not listed as above):

Australia,New Zealand,United States of America (USA),Japan,China,Taiwan,South Korea
Passport MUST have a minimum validity of 6 months.
A PRINTED copy of itinerary and original tickets MUST be produced. Producing only a PNR/booking number will be denied access.
Hold a valid long-term pass* of a 3rd country.
Note: The definition of a long-term pass of a 3rd country is employment/work permit, expatriate card, student pass or permanent resident card. It is worth noting that a permanent multiple entry visa (MEV) above does not fall under this category and as such, NOT PERMITTED.
Other Countries

Bhutan
China
Myanmar
Nepal
Vietnam

Eligibility

Onward ticket must be within 120 hours.
Guest(s) may arrive & depart via AirAsia / other airline and connect/depart via said airlines; as long as flights departing the country depart from the same entry point.
Must hold confirmed onward ticket to a 3rd / next country.
Passport MUST have a minimum validity of 6 months.
A PRINTED copy of itinerary and original tickets MUST be produced. Producing only a PNR / booking number will be denied access.

Do I need transit visa for Malaysia


Fix for ugly fonts in programs like KeePassXC or Nextcloud on Antergos with Gnome3

Question: Using Antergos, I see ugly font rendering issues in some applications I installed like KeePassXC or also the Nextcloud client (both from AUR) as you can see on the following screenshot:

I like a smooth font rendering like in the default apps. Thought that they may use Windows fonts, so I copied the entire Fonts folder from a Windows 10 ISO to /usr/share/fonts. This has an effect, but as you can see on the following screenshots, it looks a bit wired/big. With some touch of Courier new or a similar font.

On the official screenshots from the KeePassXC homepage it looks way smoother:

I know that this is KDE and I'm using Gnome. How can I realize a similar look to the KDE screenshots? I don't know which fonts are used and which I need to install. And I also can't understand why copying the fonts from a Windows system doesn't fix this issue. Since the look changed after doing this, it seems that my idea of missing Windows fonts is basically right.
Update 1: Font resolution
In gui/Font.cpp we can see that KeePassXC uses consolas font, but only on Windows. So I took a look in the Gnome optimization settings and found an entry:

The last one seems similar to my second screenshot. But it has no effect on KeePassXC. Only the font in my terminal changes. I don't understand why the second font for the interface is not used in KeePassXC. When I change this font, all entrys of e.g. Firefox were displayed as I set it.
Update 2
I installed adwaita-qt5 and set the style on startup like this:
keepassxc -style adwaita

Doesn't have any affect. Altough it seems that he uses the style, since before installing the adwaita-qt5 package, I got an error

QApplication: invalid style override passed, ignoring it

This error was gone after installing the package.
Answer: I had a similar issue with KeePassX. My understanding is that it's due to the QT theme, which is configured in .config/Trolltech.conf for QT4. If you set it to GTK+, the application will be themed as a GTK application:
[Qt]
style=GTK+

This is for QT4 thought, if KeePassXC is using QT5 the theme configuration is done differently it seems. There's some info here and here
Comment: I can confirm that this doesnt help in current versions with qt5. In these documentation linked in the answer i cant find the relevant information or the exact/right thing to do to solve it.


How to update node js in Laravel homestead on Mac OS?

Question: I have tried several answers to other questions about updating node.js. However, none has worked for me inside the Laravel Homestead in MacOS.
I currently have the 5.12.0 version.
I have tried the following commands:

sudo npm install update
sudo npm install -g npm
sudo npm install -g npm@latest

And after restarting (with --provision) the machine, node -v still shows the same version.
Any ideas to update it in Homestead?
Solved
I have followed this answer:

sudo npm cache clean -f
sudo npm install -g n
sudo n stable

Then I exited
exit
And then I restarted the machine like so:
vagrant reload --provision
I typed node -v and now it outputs v6.2.2 and that did the trick.
However, these steps did not work in the mac terminal!
Answer: Try this command:

apt-get install npm


How to display the content of  tag inside a canvas?

Question: The page has an  tag and a canvas element.
The image inside the  is cropped and is manipulated using the loupe.
How can the cropped content of the image be displayed inside the canvas.
Answer: Suppose you have an  tag with id of image. You can obtain the image reference by using the getElementById method. Something like the following:

var img = document.getElementById("image");

Then using the HTML5 drawImage method you can draw the image content into the canvas.
The code should look like this:
var canvas = document.getElementById('canvas') // reference to canvas element
var ctx = canvas.getContext('2d'); // get the canvas context;
ctx.drawImage(img, 0, 0); //draw image into canvas;

Comment: Image willn't be cross-origin. You can't fetch it if its from another site
Answer: You'd be better off with this (over the original answer by easimov), which waits until the image has loaded first. If the image hasn't loaded, it won't be drawn on the canvas. It assumes that img is your image tag:
var canvas = document.getElementById('canvas') // reference to canvas element
var ctx = canvas.getContext('2d'); // get the canvas context;

img.onload = function ()
{
    ctx.drawImage(img, 0, 0); //draw image into canvas;
}

Comment: Whether the image is loading or is already loaded does not matter. What matters is transferring the content of image tag to a canvas, which is what the most important part "drawImage(...)" does.
Comment: If the image hasn't loaded yet (eg you have a slow connection) it won't be drawn if you call drawImage(). By using the images onload event you can be sure that it has loaded.


When asking about a health condition which tense do you use?

Question: If a person got injured, in their legs, for example, yesterday and you want to ask that person the next day how are their legs doing. Do you say "how were your legs?" or "how are your legs?" and why?
Answer: The answer has nothing to do with whether you're asking about a health condition.
If you want to ask how they are now, use the present tense:

How are your legs?

If you want to ask about how they were yesterday, use the past tense:

How were your legs [after the accident]?


How can I find the past flight number of Qatar Airlines?

Question: I have book the flight tickets from San Francisco to Kathmandu International Airport through Qatar airlines but due to lock down in Nepal I canceled the tickets and they send me the money voucher for future use unfortunately I have deleted it from my email I have temporary member ID number I have try to call to resend my voucher but they need the reference number or flight no which I don't have.So how can I find the flight number?
Answer: Depending on when your original flight was booked the flight numbers could be the same as they were today i.e. QR 0738 and QR 0648.
If that doesn't work and you still remember the dates, there are websites that track historical flights based on route. See for example: https://www.flightradar24.com/data/flights/qr738 Most of those will require a paid subscription.
However, the flight number is not likely to help and I assume that Qatar will require either the booking reference and/or the ticket number. Both of those were included with the original booking confirmation and probably in the voucher as well. This is not publicly available data since it's specific to your booking and no one else business.
If you don't have any of these any more, you may out of luck. If Qatar can't find your booking by name & date or membership number, they will not give you another voucher. You need to proof somehow that you are indeed had an original booking and paid for it.


Layout Update XML for Category in Magento 2.3.4

Question: Can anyone help me how to change number of products per page for a SPECIFIC category. I am on magento 2.3.4 and noticed that Layout Update XML does not exist anymore.
Comment: Chech my answer
Answer: You should be able to use the following question and it's answer to help you out.
How to add/update custom layout update on magento 2.3.4
Answer: Add your set number of products in Admin->Store->Configuration->Catalog->Storefront->Products per Page on Grid Allowed Values and Products per Page on List Allowed Values,
For example, if you want to set 6 for any category add the value like the below screenshot:

Then go to a particular category in which you want to change the number of products per page and add below code in Design->Layout Update XML
<referenceContainer name="content">
    <referenceBlock name="product_list_toolbar">
            <action method="setDefaultListPerPage">
                <argument name="limit" xsi:type="string">6</argument>
            </action>
            <action method="setDefaultGridPerPage">
                <argument name="limit" xsi:type="string">6</argument>
            </action>
    </referenceBlock>
</referenceContainer>

Hope this will work for you.
Comment: `Design->Layout Update XML` is not possible after 2.3.4.


Can you automate visiting the site consecutive for X days?

Question: Does it count towards the consecutive visited days, if you setup a cron job that opens (e.g. CURL) your stackoverflow profile with a formed HTTP request and a valid login cookie?
Comment: You'd have to be pretty fanatical to do this...
Comment: @KenWhite When you ask a climber why they felt the need to climb up to the top of a mountain, you might get the answer "because it was there". We're programmers, (good) programmers are inquisitive by nature. Gaming that badge might just be about finding out if you can beat the system and not so much about the actual badge. I wouldn't assume that if someone did that, they did it just for the badge. I've hacked websites before just to see if I could do it, so I could totally see why someone would attempt such a script.
Comment: If you were bored or fancied learning something new about HTTP requests, stackoverflow login/cookies, a new networking framework, networking in a new programming language, cron or just really wanted stackoverflow badges?
Comment: Try it out. Show us you have the guts to do it.
Comment: @KenWhite For some people (hackers, and I mean that in the original meaning of that word) beating the system **is** the reward. Not the badge. You're projecting what you think is important onto others. Just because **you** think the badge is the goal doesn't mean **I** think that. Beating that particular system might just be another challenge to other people, and lots of people (hackers) love challenges. Don't blindly assume that everyone who would consider scripting it would do it for some silly badge.
Comment: Did you miss that comment from the OP just two spots under the one you cling to? Anyway, this is pointless. Have a good day :)
Comment: Just why should/would you do that?
Comment: Someone did years ago, earning Fanatic on all the SE sites in existence at the time. I can't remember who and sorta can't be bothered to go and try to fish it out of the network-wide meta site.
Comment: Consecutive days where you haven't actually visited yourself is absolutely meaningless, and if the only way someone can feel good about themselves is to lie and cheat to earn things they haven't actually earned, I'm sad for them. It's the equivalence of getting a medal for bravery because you didn't get caught trampling an elderly person on the way out of a burning building but managed not to drop the puppy you were holding. If that makes a person feel good about themselves, what kind of person are they really?
Comment: @ivarni: And when you ask that climber if "climbing to the top of the mountain" feels as good when they know they actually didn't climb, but took a helicopter up the back side of the mountain just so they could lie to everyone about climbing it, they'll tell you "No, I would never do that, because then it's not an accomplishment. It's a fraud, a lie, and it would make me feel really really bad about myself." There is no accomplishment if you're not doing the work to earn it, and while you may get away with lying to others, you'll know inside you're a fraud. (It also damages your credibility.)
Comment: @KenWhite I'm sorry, but you completely missed my point.
Comment: Those badges really matter to some people!
Comment: Probably yes. (to the question in the title) but I think you would need something more elaborate than just making a single request for it to count as activity contributing to the badge.
Comment: There are some existing posts about this, way back in the day when the badge was first added. [For example.](http://meta.stackexchange.com/questions/21414/design-a-rube-goldberg-machine-to-achieve-the-fanatic-badge)
Comment: @ivami: No, I'm afraid you missed mine. The only challenge to be overcome with this question is to earn a badge that the poster isn't entitled to, which is simply gaming the system to fraudulently look better here than that person actually is; see his comment to the question ("Those badges really matter to some people!'). The entire point of badges here is to represent the actual effort you've put into the site, and if you feel the need to lie about that effort it's a slap in the face to the people who honestly earn them by working to get them.
Comment: Q: *"Why did you break that website's security"* A: *"Because it was there"*. That's what I meant with my analogy. I didn't miss your point, I rejected it.
Comment: @ivarni: *The poster himself* admitted the badge was the goal, in the comment I quoted. This is not "hacking" for the challenge. It's trying to game the system to earn rewards or privileges that haven't been earned. I rejected yours, because you're trying to represent this as some sort of honorable "hacker" goal while it's not.
Answer:
Can you automate visiting the site consecutive for X days?

Yes.
Although whether it's ethical or within site rules to do so is something you'll have to make sure of.

Does it count towards the consecutive visited days

The exact requirements are not publicly known, so only Stack could answer this (and they won't) or your testing it, and I believe automating such tasks are against the rules.
So if you do, remember you've just provided public evidence it was you, AND how you are going to do it...
"Hey, Mr Policeman, if I went into that bank tomorrow at 2pm with a shotgun..."
"Yeeesss....?"

If you were bored or fancied learning something new about HTTP requests, stackoverflow login/cookies, a new networking framework, networking in a new programming language, cron or just really wanted stackoverflow badges?

Surely the time spent doing all that is gazillions of time more than just logging in and using the site a bit?
Comment: Just to be clear:
1.) I said "Those badges really matter to some people". I did not say that I was included.

2.) I am not advocating doing this just by raising the question.

3.) It could bring to light faults of the badge or Stackoverflow verification methods as the point @ivarni raises.


Should homemade lasagna be frozen cooked or uncooked?

Question: My wife and I are prepping some meals ahead of time before Baby #2 arrives early next month.
She just made 3 small lasagnas (8"x8" pans) this afternoon and we are debating whether to bake them first and then freeze them down, or freezing them uncooked and bake when we are ready to eat.
What is the proper method to maintain the quality of the food as much as possible?  Cooking and thawing times when we decide to serve it are less of a factor.
We used standard noodles (not the no-boil type) and it has canned sauce, pork sausage, ground beef, ricotta, and fresh mozzarella in case the ingredients impact is the best option.
Comment: Bake and when cooked, freeze smaller portions into individual servings.
Comment: I wonder if uncooked would be more prone to freezer burn since the cooked lasagna may have less air pockets---where I assume freezer burn will take place (I could be wrong).  I still vote for uncooked for similar reasons as MandoMando.
Comment: @dolan interesting idea, I hadn't considered that.  For my purposes, we don't plan on keeping them in the fridge that long to test the theory, but it is a good point for the general question.  Thanks.
Comment: so from reading all these responses.......I am going to prepare my lasagna putting together the cooked meat and the cooked sauce with the cooked pasta....I am not going to put it in the oven for the completed cooking ...instead I will wrap and make air tight and put in freezer.
when I am ready to cook it in the oven the day I am going to serve it.....I will take it out of the freezer and leave in frig for overnight and well into the next day so it is defrosted and then proceed to put in oven for the final step of cooking and serving....
so did I get it right based on these responses?
Answer: I'd say freeze nearly all of them uncooked and bake when ready.  That way they go through only one cooking and maintain the fresh lasagna taste/feel.
The sauce and and the cheese will freeze ok.  Mozzarella is a pretty sensitive cheese and once it's been baked, it's not going to hold as well when thawed and re-warmed. In my experience it gets gummy and the fat runs off.  You have much better chance of enjoying a good meal with the cheese frozen raw.
Unfortunately, your noodles will likely take the hardest hit, but will likely fare better than going through two heat cycles.
The ground beef and sausage will also fare better that way.
The reason I suggested freezing MOST and not all, is that there are times when you're behind the 8-ball, hungry, and don't have the time to bake the sucker, and even ponder settling for dog-food.  At that point having a silver bullet in the freezer is a bonus ;) and you'll be ok with inferior lasagna.
Comment: Thanks. Btw, in general, not just for lasagna,, is it better to freeze and than cook/bake ?
Answer: I have cooked Lasagna, cooled it overnight in the refrigerator, cut the Lasagna in portions, vacuum sealed and froze the portions. I have received all positive feedback on the Lasagna.
Answer: In my personal opinion, lasagna is one of those rare dishes that only gets better after being cooked and then re-heated. But on the other hand my lasagna use regular cheese (like Gouda or similar hard cheese) and not mozzarella so it might not apply to you.
Answer: When I make lasagne to put in the freezer, I do not bake it first.
For me, the best way to freeze it is using a sheet of Glad's Press-N-Seal over the top of the lasagna, pressing down to get all the air out if you can, between the top layer (sauce/cheese) and your press-n-seal. You want more or less a vacuum seal (the cheap way). I seal my press-n-seal to the top and then up the sides of the tin pan, all the way to the top. Now when you foil your pan, the gap that was 1-2" between the lasagna and your pan won't freezer burn your expensive and time consuming meal!
I use 2 layers of heavy duty foil to encompass the entire pan and label the lasagna:
Lasagna, 02-04-14
Press-N-Seal on top layer,
Remove before Baking!
This way I remember to take it off before tossing the frozen meal into the oven.
I then lay it flat in freezer just until it's frozen, a day or so, then you can move it because it's then a hard solid block!
Hope this helps!
Mel
Comment: Hi Babyduck115 and welcome to the site! Thanks for your input here! As you can see, I edited your answer a bit. This was mainly because the wall of text was not easily readable and there was a lot of information not directly answering the question. But do not worry, it's normal for other users to edit each other's questions/answers. I hope you have a great time here!
Answer: I use the recipe on the Barilla no-boil lasagne package.  I have successfully assembled extra pans of lasagne and frozen them prior to cooking.  To cook, I put the pan in the oven then set the temp to the instructed temp 375degF (so the lasagne preheats with the oven), and bake until peeking under the foil reveals the lasagne is bubbly (i.e., at the same stage as the freshly prepared pan would be after the standard 25?50? min), then uncover and finish per the box instructions.
For our lasagne size and oven conditions, the total time it takes to cook from frozen in a cold oven is about 100 minutes (1 hour 40 min) covered with foil plus 5 uncovered.  This may seem like a long time but I am pleased to report that it turned out just as perfect as the freshly prepared batch.
FYI, Regarding freezer burn on uncooked noodles: we did not see any freezer burn - but the longest one remained frozen was about 2 months.
I have not tried thawing the lasagne before cooking.
Answer: When I make a big pan of lasagna, I do cook first. After an overnight chill, I slice it into single serving portions. Then I lay those out on a sheet pan covered with parchment. Then I freeze them for half a day. Mr Foodsaver is called to action and it's a done deal. When I'm ready for a nice meal, I just pull one from the freezer the day before and either nuke but prefer to bake for 20-30 min with a little extra sauce in the bottom of the dish!!!!
Comment: PS.....I never use Barilla pasta (company is against equal rights) I used Delverde pasta sheets. If your meat sauce is pretty juicy, you can use dry lasagna noodles!!! Turns out great


Line smoothing in Cocoa Touch

Question: How would I smooth a line (UIBeizerPath) or a set of points? Right now it draws it jagged. I read about spline interpolation, could anyone point me to an implementation of this in cocoa or C or give me an alternate line smoothing algorithm.
Answer: I don't think you need to do Bezier paths with curves. You can keep drawing straight line segments but add more data points with interpolation. This is especially important because I'm assuming you want to smooth only on one axis so you don't end up with odd things like loops in your graph.
So you want to add more points to your source data, between the existing points, and use an interpolation algorithm that's more sophisticated than a linear interpolation. There are many to choose from. Quadratic? Sine-based? Many, and it depends on what kind of data you're using.
Answer: Quartz (which UIKit uses for drawing, and in many places makes you use directly for drawing) has anti-aliasing support built-in. Most contexts have it turned on already, so you should not have aliased (jagged) drawing unless you're turning anti-aliasing off. So, stop doing that. :-)
The contexts that don't have it turned on by default are mostly those where it isn't appropriate, such as PDF contexts and CGLayer contexts. The documentation implies that those contexts don't even support anti-aliasing, which makes some amount of sense.
CGContext provides a couple of functions for turning anti-aliasing on and off, but you should never need to call them except when you want aliasing, which you don't. You could try turning it on using those functions; if that works, then you should investigate why it was ever off in the first place.
Are you drawing the path from within a CALayer? That may be why it's off; there's an Info.plist key you have to turn on to get anti-aliasing turned on by default in such contexts.
Comment: Not that kind of jaggy. Anti-aliasing is working but I need just general line smoothing from some sort of algorithm.
Answer: I've found that if you draw a line or an image on the edge of your frame that it will appear jagged.   Move the line in a few (or grow your frame) and it should appear nice and crisp.   Again, not sure if that's your question or not but it has bit me a few times.
For instance if you are displaying an image inside a CALayer, make sure there is space between the image and the frame if you are doing anything but 90 degree angles.

Line smoothing in Cocoa Touch


Can "unbiased" be called as one of the synonyms of "apathy"?

Question: Consider the sentence: "He is apathetic of whoever wins the elections", can't we say that he is not biased towards any of the election parties?
Comment: I'd say " he is apathetic about the election results" or "he doesn't care about who wins the elections". Unbiased suggests he expresses no preference for any candidate because he probably thinks they all deserve to win.
Comment: A person who doesn't care about the outcome might still have an opinion over who will win.  Also, a person's biases could be the very thing that leads to a feeling of apathy about the choices in an election.
Answer: The word bias has a negative connotation, its meaning what I could find from google :-
inclination or prejudice for or against one person or group, especially in a way considered to be unfair
Someone's inclination towards something can't necessarily be called as a bias unless it is for some unfair reasons. While apathy means showing lack of interest especially emotions.
Media's apathy towards victims of bomb blast.
So, whether you should use them interchangeably in your sentence would depend on what you want to connotate.


MITM on program with no proxy settings

Question: I'm trying to inspect the traffic of a program (which is running on my computer) that uses SSL over TCP to a non-standard port.  The traffic may or may not be HTTP traffic, likely isn't.  Neither Charles nor Fiddler2 are able to detect the connection.  How can I view the unencrypted traffic?  Solution needs to work on windows 7.
Answer: Wireshark should be able to do it. However, the process is not as straightforward as you would have to scan the memory for the master secret.
Here is a tutorial on how to decrypt SSL without access to the master private key.

Identify the master secret and corresponding session key. This can be found in the "Server Hello" portion of the SSL handshake.
Configure Wireshark to use the master secret. Save the master key to a text file and configure wireshark to use the master secret file.
Decrypt the encrypted malware SSL session. Open the pcap file, right click on the session and select "Follow SSL Stream".
Comment: Excellent tutorial, it would be nice if you outlined the procedure for doing it in the answer. Eventually, links to third party sites will be affected by Link Rot (https://en.wikipedia.org/wiki/Link_rot)
Comment: Turns out the traffic isn't run through SSL but I tried this out anyway and was able to find the master key using this tutorial, which is very cool.  I'll mark this as the answer anyway since it does answer the question I asked.
Comment: The tutorial link was defunct when I checked but an archived wayback version is [available](https://web.archive.org/web/20150625132211/http://www.cloudshield.com/blog/advanced-malware/how-to-decrypt-openssl-sessions-using-wireshark-and-ssl-session-identifiers/)
Answer: If the software is using a fixed port and an hostname rather than IP to connect you could redirect the traffic to your local computer and use, e.g. ncat to remove and readd ssl, then inspect the traffic in between.
Comment if you need more details.
Answer: Burp Suite can do this to MITM HTTP and HTTPS traffic.
This is very easy via Invisible proxy mode:

Normally, web proxies need to receive the full URL in the first line
  of the request in order to determine which destination host to forward
  the request to (they do not look at the Host header to determine the
  destination). If invisible proxying is enabled, when Burp receives any
  non-proxy-style requests, it will by parse out the contents of the
  Host header, and use that as the destination host for that request.
When using HTTPS with a proxy, clients send a CONNECT request
  identifying the destination host they wish to connect to, and then
  perform SSL negotiation. However, non-proxy-aware clients will proceed
  directly to SSL negotiation, believing they are communicating directly
  with the destination host. If invisible proxying is enabled, Burp will
  tolerate direct negotiation of SSL by the client, and again will parse
  out the contents of the Host header from the decrypted request.

Of course the application would need to trust Burp's root CA, and the certificate that is automatically generated by it (i.e. the application is not using pinning and it is using trusted roots from the OS level, not its own).

MITM on program with no proxy settings


Integer outputs of $y=x^2$ , do their last digits form an irrational?

Question: Let the domain of $y=x^2$ be the positive integers. I input consecutive positive integers from $[1, \infty)$ their last digits are $a, b, c, ...$ respectively. If I then make the number $z=\frac {a}{10}+\frac{b}{100} +\frac {c}{1000}+\cdot \cdot \cdot$ , is this number irrational? If not, is there any other combination (such as $\frac {c}{10}+\frac{f}{100} +\frac {q}{1000}+\cdot \cdot \cdot$, but still using all of $a, b, c, \cdot \cdot \cdot$) that could result in an irrational number? I have no idea how to solve this problem, it is just something I have wondered about for a long time.
Comment: Hint: a number is irrational if and only if the digits never form a repeating pattern.  Try finding the first say 20 digits.
Answer: The result is rational, because the last digit of $x^2$ depends only on the last digit of $x$, which repeats with period $10$. Therefore your $a, b, c \ldots$ also repeat with period 10 (or with a period that's a divisor of 10).
If you consider rearrangments of the digits, it's easy enough to produce an irrational. Your sequence $a,b,c,\ldots$ contains infinitely many of each of the digits 1, 4, 5, 6, 9 and 0 (and no other digits), so any decimal fraction that's also made of only these digits, and infinitely many of each, can be viewed as a rearrangement of your sequence. For example,
$$ 0.14569014569001456900014569000014\ldots $$
where each sequence of zeroes is one digit longer than the previous one.
Comment: Hah I can't believe it was so easy
Answer: I will elaborate on Henning Makholm's answer.  The last digit of $x^2$ depends only on the last digit of $x$, and so must repeat with period 10.  In fact:
$$\begin{array}{r|cccccccccc}
ld(x)  & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 \\ \hline
ld(x^2)& 0 & 1 & 4 & 9 & 6 & 5 & 6 & 9 & 4 & 1
\end{array}$$
so your number $z$ is exactly $$z = 0.\overline{1496569410}$$
which is equal to $$\frac{1496569410}{9999999999} = \frac{166285490}{1111111111}.$$
To answer your second question is easy.  To generate an irrational number, we need only avoid repeating the digits. Just just choose two sequences of $1496569410$ in different orders, say $ x= 0114456699$ and $y = 5449911660$, and append them in a non-periodic way, say $xyxxyxxxyxxxxy\ldots$ giving $$.\overbrace{0114456699}^x\ \overbrace{5449911660}^y\ \overbrace{0114456699}^x\ \overbrace{0114456699}^x\ \overbrace{5449911660}^y\ \overbrace{0114456699}^x\ldots .$$


Is there a lower limit in which question will appear sorted by votes?

Question: Specificly this question is quite low (worst I ever seen on any SE site).  So I was curious as to how it stacked against other bad questions.  When I sorted the questions by votes and went to the last possible page, the lowest voted question was at -8 where the question in question (no pun inteded) does not even show.  So, I just wondering if there's a lower limit in which questions are allowed to be shown?
Comment: I'd expect that page to filter out closed and deleted questions, but am not sure it does.
Comment: This one was closed but still shows http://scifi.stackexchange.com/questions/10515/im-trying-to-track-down-a-novel-with-the-protagonist-visiting-a-reptilian-cro
Comment: Wait you said closed **AND** deleted..
Comment: As in, it would filter the set of closed questions.  It would also filter the set of deleted questions.
Answer: On the front page, questions with a score of -4 and lower are not shown (the threshold is -8 on the meta site). All other question lists and search results show all posts regardless of score or closed status (unless your search takes these criteria into account). Deleted questions are never shown in any question list (only ♦moderators can see lists of deleted questions, and only by explicit request).
I see the imaginary animals question (+1/-20) as the 50th item on the list of questions by vote, which is strange: even if caching is going on, it should never have ranked that high. It should definitely be on the last page of that list. This may be a bug.


Are rational representations of an (affine) algebraic group the same as modules over some ring?

Question: Given an algebraic group $G$, are the rational representations of $G$ in natural correspondence with modules (of some type?) of a ring associated to the group? Certainly rational representations give rise to representations of $U(\mathfrak g)$, the universal enveloping algebra of the Lie algebra, but my intuition from Lie groups and also the fact that $G\times \mathbb{Z_2}$ has the same Lie algebra as $G$ mean that this shouldn't be the "right" ring.
Answer: When $G$ is an affine group scheme, its coordinate ring $k[G]$ is naturally a Hopf algebra. The group unit gives the bialgebra counit, the group multiplication gives the bialgebra comultiplication, and the group inversion gives the Hopf antipode.
Rational representations of $G$ are precisely comodules over the Hopf algebra $k[G]$.

Added after Tobias' comment
It is true that in characteristic zero, the distribution algebra of $G$ is the same as the universal enveloping algebra $U(\mathfrak{g})$ where $\mathfrak{g} = \operatorname{Lie}(G)$, and hence every $G$-module $V$ becomes a $\mathfrak{g}$-module in a canonical way. However, there are many more $\mathfrak{g}$-modules than $G$-modules.
Take for example $G = \operatorname{SL}_2$, with Lie algebra $\mathfrak{sl}_2$.

The first problem is that $\mathfrak{sl}_2 \cong \mathfrak{pgl}_2$ as Lie algebras, while $\operatorname{SL}_2 \not\cong \operatorname{PGL}_2$ as algebraic groups, and so since not every $\operatorname{PGL}_2$-module lifts back to an $\operatorname{SL}_2$-module, we should expect that there are more $U(\mathfrak{sl}_2)$-modules than $\operatorname{SL}_2$ modules. This is the same kind of difference you're seeing between $G$ versus $G \times \mathbb{Z}_2$.

There are infinite-dimensional irreducible $\mathfrak{sl}_2$-modules, such as the Verma modules $M(\lambda)$ for any non-integral weight $\lambda$. These are clearly not $\operatorname{SL}_2$-modules, which are unions of finite-dimensional modules.

Since $\operatorname{SL}_2$ is a semisimple group, over a field of characteristic zero its representations are all semisimple. However, $U(\mathfrak{sl}_2)$-modules are not semisimple in general, for instance take the Verma modules $M(\lambda)$ for $\lambda$ a dominant integral weight.
Comment: I am a bit rusty in this, but I think the algebra of distributions might be closer to what the OP is after (since then the representations really are modules). But I don't recall precisely how good the connection is (whether it suffices to require the modules to be locally finite to get representations, or if more is needed).
Comment: Another thing of note here (I really ought to write something more detailed myself, but I feel like it has been too long since I worked with it, so I would end up leaving out some too important details due to forgetting them). In some sense, there is no way the representations of an algebraic group can be (just) the modules over some algebra, since the category of rationals reps of a reductive group has either no projective modules or nothing but projective modules.
Comment: @TobiasKildetoft You're right, that's probably closer. I've added some thoughts there to my answer
Comment: This is exactly the sort of thing I was looking for. Do you mind elaborating on this? Also, every object being projective is fine for the module category over a ring - does this happen for any groups that are not finite? Are there examples where this is still not the module category over a ring?


Can you calculate Hubbard U parameter for unit cell and then use it value for supercell/slab?

Question: I'm calculating the vacancy formation energy of a 3x3x2 supercell of cerium oxide and need to include a Hubbard parameter for the Ce 4f state. However, computing this parameter separately for the large supercell would be very time-consuming due to its size (around 200 atoms). Therefore, I'm wondering if it's feasible to calculate the Hubbard U parameter for the smaller unit cell and use it for the supercell instead. Is this a valid approach or are there any drawbacks to this method?
Comment: Are you calculating the Hubbard U self-consistently (e.g. through a linear-response formalism) or emperically through fitting of some known experimental proxy?
Comment: I am calculating it through linear-response, with hp.x code if Quantum Espresso.
Answer: The linear-response formalism implemented in hp.x code does not require the use of computationally expensive supercells of the traditional linear-response approach to compute the Hubbard U. Actually one of the main advantages of hp.x code in Quantum ESPRESSO is the ability to determine the Hubbard U using a primitive unit cell instead of a supercell.
So in short, not just you can use a unit cell for calculating the Hubbard U but better you can use the primitive unit cell!Then use this U value for your supercell calculations.
I suggest you read the hp.x paper by Timrov, Marzari and Cococcioni (2022), which beautifully explains all this and more.
The paper is open access: https://doi.org/10.1016/j.cpc.2022.108455
Comment: The short answer is NO. Have you read the paper? Please have a look at section 5 of the paper. The  developers of the HP code themselves have authored several papers on its use and application, please try to learn from them. Nothing is better than learning from a firsthand account. I myself did not use the HP code, but I admire the work and research of professor Marzari and his colleagues. One will learn a lot deal from them regardless of the used DFT code. Here is another paper of them that may answer your questions: https://pubs.acs.org/doi/abs/10.1021/acs.jpcc.2c04767
Comment: As I said I did not use HP code and do not know the computational settings and details of using Quantum ESPRESSO. Please have a look at the provided papers for the computational methodology. Try to reproduce their results. The second paper includes calculating Hubbard parameters for a pristine and doped system (which is similar to your case of a defected supercell, a dopant instead of a vacancy).
Comment: Thank you for your answer. Does this holds if I create vacancy in supercell? Can a Hubbard parameter calculated  with hp.x for primitive unit cell be used for a supercell, even when there is a vacancy in the supercell?
Comment: Thank you for you references.I understand that the Hubbard parameter is not transferable and is sensitive to the chemical environment. My question is about the calculation of the Hubbard U for vacancy formation energy. Can it be calculated for a smaller cell with a vacancy and then used for the supercell, or it has to be calculated directly for the supercell? Since Hubbard U will be different for systems with and without vacancies, is it legitimate to calculate the vacancy energy as the difference between these two values, considering that they were calculated using different parameters?
Answer: The various methods to calculate the Hubbard U value in a first principles way don't always give such good agreement with experimental values anyway. If it would be too expensive to calculate it with a first principles way, then you might want to just use a U value from literature, try a range of U values yourself to see the impact on the binding energy, or try a hybrid functional (although there you have to pick the fraction of exact exchange anyway).
Using a first principles method to calculate it in the unit cell is a reasonable way to try to do it, but if the supercell has a vacancy that changes the local environment, then in theory the appropriate U value could change.
Comment: So, if I want to calculate the Hubbard U parameter for a supercell, would the procedure be the same as for the unit cell - self-consistent calculation, Hubbard parameter calculation, variable cell relaxation calculation, and repeating until convergence?
Comment: Yes, although I think you probably should investigate the typical accuracy of calculated Hubbard U parameters for similar systems. For one, different methods of calculating it can lead to different results, and second for some quantities the calculated ones are not good.
Answer: Normally this famous U parameter is a correction to reach the localized states  due to the correlations which a one electron system cannot integrate. As a corrective parameter it is very variable and nobody could give the order of magnitude of its variation in a precise way because even your calculation method can affect the order of magnitude converging towards a satisfactory correction. Normally it should not vary so much, but our simulation tools are not perfect.
Concerning your question, intuitively by increasing the size of the system there is some delocalization more significant of d states than f and thus the correction is theoretically different. As stated before, nobody will be able to give the deviation rate correctly. Normally you should recalculate the parameter regardless of the size. In some cases using the same parameter can be theoretically a good approximation especially for the 4f states but I guess even more for Lutetium than for Cerium.
Comment: Please what do you mean by : "...... by increasing the size of the system there is some delocalization more significant of d states than f...... "?
Comment: This argument is relevant mainly for systems whose size varies without necessarily having periodic boundary conditions so the local electronic distribution changes and so does U as a function of size. Since you are working on periodic systems, the size of your  supercell will not affect much the local electronic distribution, although the program will tend to give slightly different results compared to the unit cell. So your approximation is correct if the atomic environment in the supercell is not modified as specified in the other answer.
Comment: Thank you for your clarification. Yes, for periodic systems, the *physics* (including a Hubbard potential) is independent of the size of the simulated supercell. Delocalization and more generally correlation effects are not dependent on the size of the simulated supercell in the case of periodic/lightly doped systems.


Is the dark matter just regular matter out of the observable universe?

Question: Could it be that darkmatter is actually the gravitational influence of regular matter that is situated out of the observable universe?
Comment: Do you really mean dark matter, or in fact dark energy?
Comment: Dark matter is not situated outside the 'observable universe', it is mainly expected to be found clumped together surrounding most of the galaxies in our universe as dark matter halos. Dark energy instead is spread evenly through the universe and causes the accelerated expansion of the universe. Both of these have not been observed experimentally and we don't have much idea about them.
Answer: Scientists do not know what dark matter is. It is a placeholder name. It is called "dark" for two reason:

If it exists, it interacts at most very weakly with electromagnetic radiation. It is "dark" in this sense.
If it exists, we do not yet know what it is. Science is "in the dark" regarding dark matter in this sense.

Dark matter, whatever it is, and if it exists, is not "regular matter that is situated out of the observable universe". It acts at the galactic scale. A more descriptive name is perhaps "a mystery substance that makes galaxies rotate at rates contrary to the rate suggested by luminous matter". "Dark matter", for short.
I am not denigrating the concept of dark matter. Despite not being able to find candidates for what constitutes dark matter, the alternative attempted explanations for these galactic scale disparities between galactic rotation rates as suggested by luminous (i.e., non-dark) matter are that much worse than dark matter. A more descriptive name for these conjectures is "a mysterious non-substance and non-uniform variation to gravity that makes galaxies rotate at rates contrary to the rate suggested by luminous matter".

Could it be that dark matter is actually the gravitational influence of regular matter that is situated out of the observable universe?

You are perhaps thinking of dark energy, the need for which was only discovered recently. Science is even more "in the dark" regarding the nature of dark energy than it is regarding dark matter. Dark matter was first conjectured to exist in the 1930s to explain the galaxy rotation curve problem. Dark energy was first conjectured to exist in the 1998 to explain the accelerating expanding universe problem.
Just as there are contrarians who dispute the existence of dark matter, there are also contrarians who dispute the existence of dark energy. In both cases (dark matter and dark energy), the contrarians are in the minority. These contrarians do not however fall into the realm of crackpotism, at least not yet. The galaxy rotation curve problem and the accelerating expanding universe problem remain unsolved problems in science at the present time, with the leading candidates having the placeholder names "dark matter" and "dark energy".
Comment: @PM2Ring Gravitational lensing is one of many things that show that something that is local, that is not visible, but that does have a gravitational effect does indeed exist. We don't know what it is, but it is there. Let's call it "dark matter" for short.
Comment: I think you could argue that dark energy, in the form of the cosmological constant in GR, was first postulated in 1917 to solve a different problem (which it didn't solve, and which was not in fact a problem).  (Note, I'm not disagreeing with your answer!)
Comment: As well as galaxy rotation curves, dark matter is also important in gravitational lensing.
Answer: If dark matter exists (rather than some strange rewrite of physical laws), then it is required to be all around us. It could not be simulated by the effects of normal matter at great distances.
There are two other things to bear in mind.
(1) If you postulate there is stuff beyond the observable universe then, by definition, it can have no effect on us or our locality. Otherwise it would be observable, since the effects of gravity, like light, travel at the speed of light.
(2) There is other evidence found by combining what we know about the geometry of the universe (e.g., from the cosmic microwave background) and observations from which the primordial big-bang-produced chemical abundances of helium and deuterium are inferred, that most of the gravitating matter in the universe is not "normal matter" made of neutrons and protons.
If, as I suspect, you are actually trying to replace dark energy with matter beyond the observable universe then firstly, the caveat about things beyond the observable universe not affecting us locally still applies.
Secondly, in cosmology you need to use General Relativity to describe the dynamics of the universe as a whole. But, even if we were to adopt Newtonian gravity and consider some "shell" of material around the observable universe; that would not cause a stretching effect, because Newton's shell theorem tells us that the gravitational field inside a uniform shell is zero.
Comment: @sir_pi Sure, but that can't explain the dark matter required locally and also take note of what I said about the gravitational influence inside a shell being zero.
Comment: So, what happens if we consider the observable universe of objects(stars, galaxies...), that are near the limit of earth's observable universe?  Would they be affected by gravitational influence of objects outside earth's observable universe?  A say that because it seems that the observable universe of such objects would extend beyond earth's, allowing them to be causally connected. Or am i just saying nonsense?
Answer: Luminous matter outside the observable universe has been considered as a candidate for Dark Flow, i.e. the unexpected motion in distant galaxy clusters independent of the overall increasing expansion rate of the universe. In my personal model, the increasing expansion is due to the stage of explosion the universe is still in. Using an explosion as a model for motion of the universe as we've observed it, you have various states for any given explosion to consider in order to figure out which one we're in. Roughly, you have the initial rest state, before the explosion has started, you have the peak, before which the rate of expansion of the explosive bubble is still increasing, and after which the rate of expansion of the explosive bubble is no longer still increasing. Simply put, our universe hasn't peaked, and we can't be certain it will. It might just asymptotically approach peak expansion acceleration, so it will always seem like the expansion rate is increasing. As for dark matter being something that makes galaxies rotate faster than expected, my model holds that this too could be due to legacy momentum derived from gravitational interactions with luminous matter outside the observable universe. Think of it as an infinite billiard ball table, and our observable universe as just the circle around us that we can see by standing on it. All the collisions matter to being able to predict the motion of the balls we can see, including those outside our observable circle of balls. Dark matter is only required locally if your model fails to account for the extrapolation of our observable universe as observable from all points in our observable universe, which suggests an infinite universe that is like our observable universe everywhere. Simply consider the causes of the rotational speed of an object, and rather than invent a new cause, use Occam's Razor and infer a cause that occurred significantly far in the past such that while its light could never reach us, its effects are still observable as inputs to the motions of things reflecting light that can.


Regular Expressions in Cognito Forms

Question: Do the Cognito Forms support Regular Expressions to validate fields?
Answer: Cognito Forms can support custom regular expressions in a Text field. We also have some default regular expressions set up that can be selected. In Cognito Forms this is called Format Validation, and this allows you to validate (and potentially reformat) user input. For example: a Textbox field with format validation set to Numeric will require users to enter only numbers. You can choose from a variety of standard formats, or specify your own custom format.

Regular Expressions in Cognito Forms


Is the Mesh deform modifier supported in BGE?

Question: I'm trying to make a cube squish (like a slime) when pressing a key but Lattice is not supported in BGE, so I've used the Mesh Deform modifier using another cube as the deforming object, then I've created a shape key for the squishing animation.
But when I start the game and press the key that should start the animation, only the deforming object squishes. If the Mesh deform  is not supported as well, how can I make the cube squish?
Answer: The Mesh Deform modifier is not supported by the BGE.
You can play deforming via armature actions or shapekey actions.


load particular .icns size

Question: In my cocoa app, how can I load/scale my .icns file?  In this case, I want to load up my 16x16 image.
Answer: Load it as an NSImage (+imageNamed:), grab one of its NSImageReps (-representations), then call setSize:NSMakeSize(16,16) on it.
Answer: With 'file' being a NSString with the icns file path, use this to load the image:
NSImage* img = [[NSImage alloc] initWithContentsOfFile:file]

Then, the NSImage 'img' will contain the icns image. To resize it to 16x16, use this:
[img setSize: NSMakeSize(16,16)];

load particular .icns size


Python 2.7, using packages from another location

Question: I've tried searching for this but can't understand the answers that I've seen.
I'm relatively new to Python (2.7) and am the only person at my org who uses it. They're sunsetting one of our virtual environments, and the one which will remain doesn't have any of the necessary third party packages to basically do anything. I need to copy all of the package folders (from 'Python27\Lib\site-packages') to a shared network drive so they're not lost. I've copied the entire Python27 folder over to a shared drive (T:) and want to run them using the copy of Python27 on the new virtual environment (C:)
I want to modify my scripts to import these packages from the networked drive.
The answers I'm seeing for this are similar to:
from application.app.folder.file import func_name

However, this isn't helpful to me, I guess I'm just too stupid to understand it. Lets say I want to import the babel package from the copy I made on T:. The above has me thinking I need to enter something like
from 'T:\foo\Python27\Lib\site-packages' import babel

or
from 'T:\foo\Python2y7\Lib\site-packages\babel' import babel

but every variation of this I try gives syntax errors. Additionally I'm confused, because the examples I see show people pointing to literal '.py' files, but none of these packages have an actual '.py' file of the same name as the package (they all have init files within their individual folders, and lots of other randomly named .py files).
Can someone, in plain english, using filepath examples, show me how to do this? I'm very confused by the long answers and fake example paths, I would love a literal absolute path starting with 'T:\', as answers like
from packA.subA.sa1 import helloWorld

confuse the crap out of me (what is packA? what is subA? is helloWorld the name of the actual package, the name of the folder within site-packages, or the name of a .py file within a folder?)
Unfortunately I'm unable to use PIP or any other third party libs that might make this easier, as the new VDE doesn't have anything but stock 2.7 packages.
I'm sorry for being so dumb, I stayed late and created a StackOverflow account just for this, would really appreciate a hand holding.
Answer: You need to set your PYTHONPATH environment variable to include the path to the folder where application resides.  Check that you have a blank or properly coded __init__.py file in each folder in the sequence of inclusion.
Answer: The simplest way to do this is:
import sys
sys.path.append(r'T:\foo\Python27\Lib\site-packages')
import babel

Hard-coding a path like this is usually not the best way to do your work, but it's certainly easy to understand and will work in a pinch.
Comment: Late response, but this worked! Sorry for the duplicate question, and thanks so much for entertaining my ignorance. I know hard-coding is usually the wrong way to do things, this is a temporary solution
Comment: @SamWarren glad to hear it helped :)


Are researchers for big digital companies experienced researchers/scientists or just experienced industry programmers?

Question: Are people doing research for Microsoft, Apple, Intel experienced researchers/scientists or just experienced programmers using other people's research? Do they hire full time researchers for their research or do they take experienced/skilled professionals who are familiar working with java, C++ and other commercial technologies?
Answer: Microsoft has a prominent research arm, Microsoft Research.  Intel has Intel Labs.  Both organizations hire research-focused PhDs from both industry and academia, and both employ researchers that have joint appointments on research university faculty.  Employees at both organizations also routinely publish fundamental research at peer-reviewed conferences and workshops, and in journals.
Apple is a tougher nut to crack -- they spend truckloads of money on R&D, but rarely publish in peer-reviewed venues.  However, they do hire plenty of PhDs who do focused research on products that sometimes turn into the next iPhone.
All three companies file many patents, as well.
Many other big companies also have research labs, and openly hire researches specifically working on fundamental research.  However, as with any company, research tends to be focused in the direction that could eventually produce profitable products -- if you are considering a research job at a company, you should take this into consideration.  For what it's worth, Microsoft Research seems to be closer to the "research for the sake of science" than some other labs, although there are others (notably, labs such as (formerly) Xerox PARC and Bell Labs are famous for groundbreaking fundamental research).
Comment: I should add that getting a job at Microsoft Research is comparable to and as rigorous as getting a job as a professor at a top university.
Comment: This answer is excellent. Do note that this is really just a sampling; there are literally countless other examples from other fields.
Comment: It's worth noting that Microsoft Research also hires staff programmers in addition to research scientists.
Comment: @ChrisGregg I don't think getting a job as a professor is as hard as getting a job as a programmer.see this discussion http://programmers.stackexchange.com/questions/47778/why-are-sw-engineering-interviews-disproportionately-difficult-vs-research-int
Comment: @iOsBoy The link you posted did not mention professors at all (research scientist ≠ professor).
Comment: @iOsBoy, you should find a person who interviewed at both Microsoft and UC Berkeley or U Washington nearby. Or even SJSU in Bay area. Or better yet a person who worked in both. Like [Hal Varian](http://people.ischool.berkeley.edu/~hal/).
Comment: @ChrisGregg sorry my mistake.But are'nt they almost the same thing? One of the most important things when hiring a professor is what research he has done
Comment: @iOsBoy: The linked question about job interviews isn't in any way about the difficulty of getting hired, but rather about how much they hassle you during the interview (brain teasers, details about programming languages, etc.).
Answer: This is a discipline-specific question. Computer science may have Google, Microsoft, Bell labs -- what do other disciplines have?
I work in survey statistics, and while there are about four or five Ph.D. programs in the world producing survey statisticians and methodologists (Univ of Maryland, Univ of Michigan and Univ of Nebraska, Lincoln in the US; Southampton in UK; Iowa State has a statistics program that is traditionally strong on the survey side; other Ph.Ds come from scattered academic survey statisticians, about another 10 or so people in North America), the papers published in academic journals in the discipline split about evenly between government, industry, and academia-proper. I've heard from friends in chemistry that most of good chemistry research is being done in industry these days, rather than in academia. Don't quote me on this though. National Institutes of Health (US) have a tenure-like system for their researchers, as they are expected to produce top-quality research.
Comment: I have tagged this question as Computer science


Find out what is mounting my external HD and change ownership?

Question: OS: Linux Mint 18.3.
I have an NTFS-formatted external HD which just gets automounted when I boot up. I'm just trying to find out what actually does that, and whether it's possible to set the ownership to root instead of the logged-in user.
(NB my understanding is that the ownership for an entire NTFS partition, all folders and all files, is set when you mount it and can't be changed using chown).
There is no mention of this partition in /etc/fstab. After doing a bit of searching I tried sudo ntfs-config and sudo autofs. Neither of these packages is as yet installed.
The reason for wishing to change to root is to help prevent inadvertent deletion of the files on this HD. The Trash/Rubbish Bin functionality is in fact working sometimes (sometimes pressing Delete actually causes a folder to disappear irretievably!). I just would prefer to mount it with root:root ownership if possible.
I also just want to know what mechanism in Linux is responsible for mounting.
Answer: Anyone interested, I posted the same question on the Linux Mint forum and received some answers: https://forums.linuxmint.com/viewtopic.php?f=50&t=310519&p=1751219#p1751219


Is database migration script covered by GPL?

Question: I am using a product whose code is covered by GPL2. All fine except that when a major update is released, it relies on database changes which are effected by a script (sometimes hundreds of lines long) which is not included in the GitHub repository. The authors are only willing to provide this script to those who subscribe to their extended support/partnership package. Are they entitled to apply this restriction?
Comment: The GPL is designed so that anyone can modify and redistribute the code. It is *not* designed so that you get free labour from the developer for the rest of time. If the scripts operate like a magic key that unlocks a proprietary database backend, and the software cannot function without the database, then that code *might* be covered by the GPL. But if the script *could in principle* be written by you, using public information, then you have no right to it (GPL or no GPL).
Answer: That's fine.
You receive the binary and the code under GPL. So you have the source code for the software you use and are allowed to make whatever modifications you desire. The license does not make any comment on updates whatsoever; in particular there is no reference that you are entitled for easy upgrades from one version to the next.
A script to faciliate upgrade from one version to another, working on a database, is in principle just an external tool to allow you to upgrade your data structure for digestion from one version of your software to another. It's nothing special. It could also just be a migration script from one software to another completely unrelated.
Writing such migration tool only needs knowledge of the public API for the database - so it's usually fine to consider it not a derivative of the code.
Yet, even if that were not true, one would have to look at the copyright ownership: If the company or person releasing the programme is the sole copyright holder, they are not bound by the license themselves and can choose to release any part under whatever license they choose (or not at all). If they are not - the previous paragraphs apply.
Comment: The software doesn't need to do anything, not even work properly or at all. It also needs no documentation. The license only requires that you can get the full corresponding source code for the binary. It is 100% free and you can do with it whatever you like. However, if you want guaranteed support, pay someone for it. Whether treating users like this is a good idea, is an entirely different question
Comment: I don't think we know whether the code is released under GPLv2 because the sole rightsholder wishes it to be, or because (s)he used one or more GPLv2 components in its construction, and is thus obliged so to release it.  I agree with your last paragraph in the former case, but note that we have no reason to think it so.
Comment: Agreed, we do not know that. I rephrased the last paragraph slightly in an attempt to make this distinction clearer. Do you have a suggestion how to rephrase the last paragraph to make that clear(er)?
Comment: "*you have the source code for the software you use*" - would that include the database schema? Or is the database not considered to be part of the software? I get your point regarding easement of upgrades (migrations), but would GPL require documentation or a script for a fresh installation?
Comment: @planetmaker I think I'd have ducked any discussion of the issue until we had some reason to suspect that particular truth might be relevant.  But it's your answer and you should write it the way you want to!
Comment: re. the above comments, the company is certainly using the "open source" label as a selling point. Yes, we have access to, and host, the database, and database setup is built into fresh installs. So as long as you just deploy the latest version each time, and never apply upstream updates, no problem. There was no documentation re database upgrades - we simply updated from GitHub source, found the application no longer worked, contacted support, and they said "oh, you need this update script".
Comment: Before you get mad at them, consider this: 'selling point' is probably quite accurate. If they cannot sell anything: why should they provide, how * could* they provide without any funding? Compare what they ask to how much you pay for other software, and what proprietary solution would cost you, including baring you from the possibility to customize to your individual needs, should they arise
Answer: The approach you describe in your question very much looks like the 'freemium' business case. You get something for free, but if you want to use all features (in your case: migration of data from one version to the next) you need to pay a fee.
This business model is usually OK, and if it is the case (an assumption, you seem to indicate this) that the authors of the free database and of the script are the same individuals (copyright holders), then there is not even the question about code overlaps.
So yes, the authors are OK to do this, I cannot see any GPL violation.
Comment: Arguably, yes, it's sneaky. But not illegal, and it's some (reasonable) means to get money from those people who use this software regularily and long-term
Comment: @tglare Note there's nothing stopping you from writing the migration scripts yourself and then either publishing them for the benefit of all the other users (undercutting the business model that you seem to disagree with) or selling them.
Comment: Thankyou all for helpful answers. I can see the place for "add-on" scripts, although in this case, I think it is sneaky: it seems easier to include migration scripts within the open-source repository than to deliberately exclude them, and with the product in question, we are not talking about implementing optional extras, but rather essential bugfixes. Legal or not, it effectively means that if we want to develop and customize this software long-term (which could be for the benefit of the original authors), we are tied to their "support package".
Comment: I don't want to protract this debate, as the essential question has already been answered satisfactorily. Yes, I could try writing a migration script, but , as I said, the last one was thousands of lines long, and I just do not have the time. Add to this the fact that product documentation is inadequate, requiring use of paid support service to get vital information, and if it was left to me (it is not), I would weigh up the pros and cons and say "thanks but no thanks". As a contrast, SuiteCrm, for one, has an excellent attitude, and encourages productive cooperation.