Install vulkan driver for fglrx AMD graphics

Question: Does anyone know how to install vulkan for fglrx or Radeon (open source) driver in Ubuntu 14.04?
Answer: Fglrx is no more maintained, this driver is abandoned, so it never (I think) get any update.
AMD only maintaining FirePro driver and embedded device but not for desktop/mobile.
For desktop/mobile GPU they preparing new closed source driver called AMD GPU-PRO with Vulkan support.
They also developing open source amdgpu but for they not add Vulkan support for it (but should coming in some time).
Also other open drivers like radeon or radeonSI not get Vulkan support. So only solution if you want have Vulkan is change driver to amd gpu-pro. Ofc if you have supported GPU. Here you have supported gpu list:
http://support.amd.com/en-us/kb-articles/Pages/AMD-Radeon-GPU-PRO-Linux-Beta-Driver%e2%80%93Release-Notes.aspx
Answer: one of options is to go with open source drivers for ur card, as fglrx is previous closed source driver for amd, just de-install it,and go with open source drivers , then i recommend to add padoka repo.. so u will be on appropriate radeon,or  gallium or amd-gpu driver or and then to go what will depends of card model u have to install amd -gpu pro on top of those..
sure u can install vulkan in separate folder to build applications with it.
first read this as even with newest vulkan SDK ubuntu 14.04 is supported!(and newer,16.04 and so on...) https://vulkan.lunarg.com/doc/sdk/126.96.36.199/linux/getting_started.html
then download from same page..
just one note if you download and install amd gpu driver from amd page it will install newest vulkan too..
so,basically it depends for what you need vulkan,to build apps,or to play ...and yes you do not need to de-install open source driver for your card if u plan to add on top of it =install amd gpu pro..as is just addition!
i was on gallium driver ,and i add on top of it amd gpu pro..
Its worth to clarify!
So even something not go by plan you will not be left without driver and with black screen in front of you,what is nice.
That means that amd closed source drivers are based on open source driver..and development of one will improve other,at least i see things like that..and maybe this will you need
http://support.amd.com/en-us/kb-articles/Pages/Install-LunarG-Vulkan-SDK.aspx


Fisher information in a hierarchical model

Question: Given the following hierarchical model,
$$
X \sim {\mathcal N}(\mu,1),
$$
and,
$$
\mu \sim {\rm Laplace}(0, c)
$$
where $\mathcal{N}(\cdot,\cdot)$ is a normal distribution. Is there a way to get an exact expression for the Fisher information of the marginal distribution of $X$ given $c$. That is, what is the Fisher information of:
$$
p(x | c) = \int p(x|\mu) p(\mu|c) d\mu
$$
I can get an expression for the marginal distribution of $X$ given $c$, but differentiating w.r.t. $c$ and then taking expectations seems very difficult. Am I missing something obvious? Any help would be appreciated.
Comment: @probability You can obtain an expression for the integrand simply by splitting the integral into regions $\mu \ge 0$ and $\mu \lt 0$; no absolute values are needed.  But the result is a messy rational function of $x$, $exp(-x^2)$, and error functions, and so is unlikely to be integrable in closed form.
Comment: @whuber - that is what I meant by "hopeless".  Not that the integral is impossible, but the fisher information is impossible.  Because you have to take the expected value over $X$ of a ratio of two of these types of integral
Comment: A lower bound for the Fisher information in this case is $1/(1+2c^2)$. Is it possible to get a tighter uppper bound on the Fisher information than the general $1 + 1/c^2$?
Comment: I had a try at it myself, but it is beyond my abilities.  Absolute value functions ruin everything!  You are basically stuck with numerical methods.
Comment: @whuber agree, the integral is easy by splitting the domain of $\mu$. I am reading the question but honestly not clear. Can somebody clarify that to me?
Comment: While an analytic solution would be a challenge in terms of human tractability (outside of a mathematician discipline), is there receptivity to an approximate computational solution?  One could make a stochastic simulation and then look at approximations for the fit.
Answer: There is no closed-form analytic expression for the Fisher information for the hierarchical model you give. In practice, Fisher information can only be computed analytically for exponential family distributions. For exponential families, the log-likelihood is linear in the sufficient statistics, and the sufficient statistics have known expectations. For other distributions, the log-likelihood does not simplify in this way. Neither the Laplace distribution nor the hierarchical model are exponential family distributions, so an analytic solution will be impossible.
Answer: The two of the Normal and Laplace are from the exponential family. If you can write the distribution in the exponential form then the fisher information matrix is the second gradient of the log-normalizer of the exponential family.
Comment: I don't think the usual two-parameter Laplace is in the exponential family. If the location parameter is known then it will be in the exponential family, but I believe that $\frac12 \exp(-|x-\mu|)$ cannot be written in exponential family form.


Google Search results - old style

Question: Recently, I have noticed Google changed the search layout on mobiles. One example is that the links are now smaller than before. Is it possible to revert to the old style? Finding this a bit jarring.
Comment: I'm voting to close this question as off-topic because it is related to mobile.
Comment: Are you using a web browser or the Google mobile app?
Comment: This is from the Chrome browser.
Answer: Generally, what happens is that Google does A/B testing (where some users get a new design while the rest get the old). If they decide to update the design as a result of that testing, the old design will be replaced entirely. For the changes you're talking about, there's no going back to the old design, especially not with the limited customization available nearly across the board with mobile browsers (for example, no userscript support). The only alternate design that exists is the desktop version of the site, which is overall harder to use on mobile (though you can switch to it if your browser allows you to "request desktop site").
However, with text size, either your device or your mobile browser will allow you to change that. Here's Google Chrome iOS with normal text (top) and bigger text (bottom), applied using the "zoom text" feature:

Because I made this change in the browser itself, it only affects Google.com, not other sites or apps.
Answer: Unfortunately no. This change is irreversible by standard means.
Further complains can be sent to: https://www.google.com/tools/feedback/

Google Search results - old style


Do housekeeping genes vary between tissues

Question: I am working on an RNA-Seq project, and I am aware that some researchers use housekeeping genes as a method of normalization.  My project has several different tissues, and I was wondering if housekeeping gene expression is generally invariant across tissue type?
Comment: There is no such thing as a universal housekeeping gene.
Answer: My experience is: Yes they can vary quite a lot (according to differences in the genetic profile of the cells) and you have to test this. As a primer I can recommend reading the articles listed below. These are mostly looking into this in the context of realtime PCR, but this should be valid for RNAseq as well. For some applications it is also a good idea to use more than one gene for normalization.
References:

Accurate normalization of real-time quantitative RT-PCR data by
geometric averaging of multiple internal control genes.
Selection of housekeeping genes for gene expression studies in human
reticulocytes using real-time PCR
Reference Genes / Housekeeping Genes
Gene Ontology Based Housekeeping Gene Selection for RNA-seq
Normalization
Answer: It depends on the definition of housekeeping genes.
ENCODE recently released RNA-seq of 17 tissues at 8 developmental stages.
A list of housekeeping genes was also provided.
They are not exactly constant. They just are less variable than other genes.
Comment: Your answer sounds as if it may be correct, however in order for the reader to find out he needs to go to an external site. It would be more useful, and more in keeping with our model if you could flesh out your statement "They are not exactly constant" with some representative examples, which would enable us to upvote your answer. The interested reader (the poster has presumably finished his project now) can follow your link for full details.


"perldoc -f" for Perl6/Rakudo

Question: Does for Perl6/Rakudo already exist something like perl5's "perldoc -f function_name" for build-in-functions which gives me a short and quick usage instruction?
Answer: Here is the tool you are looking for:

p6doc tool contains -f option
Online version
perl6 --doc option

If you don't have it installed, install it with zef:
zef install p6doc

If you don't have zef installed, install it from zef's github repo.
Answer: Hmm... This may not be exactly what you want, but:
Perl6::Doc - all useful Perl 6 Docs in your command line
This includes p6doc command line utility, which can be used to read Synopses thusly:
p6doc s05    # Browse Synopsis 05

The full list of synopsis is available here: http://perlcabal.org/syn/ ; Perl 6's built-in functions is s29: http://perlcabal.org/syn/S29.html
I never saw an individual per-function documentation like perldoc -f fname, though.

Also, on a related note there's a Periodic Table of Perl 6 operators
Comment: I tried this, but I get only an error-message: "If 'p6doc' is not a typo you can use command-not-found to lookup the package that contains it, like this:
    cnf p6doc". There is not much in my Doc.pm.
Comment: @sid - they may have removed the program from the latest (0.47) distribution - it was there in 0.36 one.
Comment: The Synopses don't look as bad as I thought they would be.
Answer: The perl --doc is actually a red herring.
The command is "p6doc"
% p6doc
What documentation do you want to read?
Examples: p6doc Type::Str
          p6doc Type::Str.split

You can also look up specific method/routine definitions:
          p6doc -f push

Answer: Unfortunately, Perl6 doesn't come with a perldoc command. (Like Perl 5 in fact, even though most of Linux distributions, except Debian, come with a functional perldoc).
So you have to install it.
Following Perl6 documentation (https://docs.perl6.org/programs/02-reading-docs), you have to zef it.
zef install p6doc

... and on my Centos, it didn't work, because p6doc is installed in rakudo folder, not in a bin directory, groumpf.
So I ln it also :)
ln -s /opt/rakudo-pkg/share/perl6/site/bin/p6doc /usr/bin

Enjoy now, life in Perl world is always better with a perldoc at hand.

"perldoc -f" for Perl6/Rakudo


How to fix or freeze a column in lightning data table

Question: I have a lightning data table with lot of columns specified. First column in the table is called Product and there are other columns. In order to update other columns user has to scroll the table for it but the problem is when they scroll right user is not able to understand for which Product they are updating the other columns. Product column being the key column.. Is there a way we can make it fixed or is there anyway to show for which product they are making changes when updating other columns.. Any pointers are appreciated
Answer: No. You'll have to make a custom data table from the blueprints. It's not too bad, it only took me a few hours to scrape together what I needed the last time I made such a table from the blueprints (but it also wasn't feature complete). Or, you can try customizing the one from lightning-base-components, as it is open source.
Comment: Thank you for your input. Instead of redesigning the whole component.. Is there any workaround like showing Product Value dynamically for each of the rows somewhere in the table like a tool tip or on a hover or showing it as another column outside the table.


Chances of getting approved for B2 US VISA

Question: I was hoping someone can help me here and let me know what my chances are to get approved a US Tourist Visa to visit my two sisters, nephews and nieces.

I am 42 years old (female)
I am married (20 years of marriage to the same person)
I have three kids 1. 6 year old, 1. 12 year old and one 14 year old.
I received my bachelors in education 15+ years ago and have always kept each job I had for at least 7 years.
I worked for 12 years as a teacher with special education students
5 years ago, I received a new offer job for teaching special education kids for the blind and deaf and have been employee with them since then. I am one of the three teachers only as they do not hire anyone else since this is my expertise, I excel at it and truly enjoy my job.
As many know, during the summer we have a summer break since the school is closed and I want to visit two of my sisters, nephews and nieces for one month since my sister wants to sponsor my trip (she is purchasing the airline tickets for me and my daughter and we are staying at her house and she is expensing our whole trip).
Me and my kids (including my daughter who is coming with) have traveled to Turkey, Cyrpus and Greece twice within the last 3 years. We have received the schengan visa twice with no problem and we have always entered back within our time frame.
My job has given my a paper for how long I have been employed, and how I will return back as this is a summer trip and the school is closed so I am not taking a leave. I don't make a lot of money but average for my position and it's been a stable job all my life.
My daughter 6 years old will be traveling with me but my two boys will be staying here with their dad since they have a summer camp trip and they want to attend it and my husband can not leave work for that long.
We fully own and paid off our property which is in a very nice area and has a nice/big value
I have two vehicle's; one, that I have paid off and one I am currently paying and 70% almost done paying.
I have a mother who lives in my country, my 6 brothers and 3 sisters. My mother had a green card to the USA but she ended up coming back after a few months of visiting (6 years ago) as she didn't like the USA.
I only have two sisters in the USA and 3 nephew and nieces that I have not seen in 10+ years. My whole family is here in my country including my other two kids and husband who I will be leaving for less than a month to just visit my sister.
My sister and her husband work for the government and has wrote me a sponsorship letter with multiple details and including a higher president in her government field to also vouch for me.
Me and my daughter are only looking to go for about 30 days as I have to return and a week after returning I have to set up my class room for two weeks before the new school year starts.

I am just trying to go to visit my two sisters and nephew and nieces with my youngest daughter. I will be coming back a month before the school year starts to prepare my class room. I am leaving my husband, property, two children, 6 brothers, 3 sisters, my degree, vehicle, and etc. to show how much I have here to come back to. I have no intentions to stay as you can see all my family is in my home country including the love of my life (husband) and two other kids (from same husband).
What do you think my approval odds are? My sister is completely sponsoring this whole trip from booking our flights, every dollar to accommodation. I have never applied for a US visa and I am very worried and want to know what you think? I have prepared multiple documents to bring with me to the interview, so please let me know what you recommend me bringing. (I'm bringing sponsor paper, employment paper, my children's birth certificates (even the two that aren't coming with), my degree, bank statement and official ties to my country.
Comment: We could only guess, but sounds like you have plenty of ties to your home country.
Answer: As a Lebanese citizen, your adjusted refusal rate is 25.22%.
This crudely means the chances of approval are about 75% for the average Lebanese citizen applicant. We cannot conclude anything about you specifically.
Comment: Just looking for a guess on approval odds. Not taking words for granted :)


Why is one of my pineapple plants thriving and the other isn't?

Question: I planted two pineapples a few months ago. One is thriving and the other is barely surviving. Should I wait and see if it rebounds or just mulch it?
Answer: The second photo looks like a healthy plant that got eaten by an animal or run over with a lawn mower, not like a plant with a disease: purely mechanical damage of an otherwise healthy plant.
I'd just let it be and see if it has enough energy stored in the roots and enough remaining leaf mass to grow back - the worst thing to happen is that it doesn't.
If, on the other hand, you had some kind of infection (which you don't), I'd recommend removing it to protect the other plant.
Comment: That's what is puzzling me. The two plants are 6 feet apart. If it's an animal eating it, why one and not the other.
Comment: @MenachemEliyahu: wait for an other day. Also animal get full
Comment: @MenachemEliyahu the first one also has leaves that look nibbled at. Just less damage.
Comment: @Stephie both were from store bought pineapples and their leaves were clipped. The damaged one seemed to be growing, but not really producing new leaves. I noticed some time ago that the leaves seemed shorter than before.


Is stellarpool.net safe?

Question: Is stellarpool.net safe enough so that the BLACKWALLET disaster will not happen to this inflation pool? As we know what happened before about people losing a lot of their coins during online transactions.
Answer: The blackwallet hack happened due to a hacker changing the script in the site to automatically send their wallet all the lumens in the wallet entered, since one had to insert a private key to access their wallet.
Source
Stellarpool.net is an inflation pool. The worst that can happen when you put their address in as your inflation destination is not recieving payment.
Don't put your private key ANYWHERE but stellar.org.

Is stellarpool.net safe?


Table Design - User Management

Question: I have designed a database design for a simple User Management System, this system consist of the following things,

User - A user may be a Vendor / Employee / Buyer.
User - A user may have more than one Address - /delivery/ Billing / Profile / Company Address.
User - A user can have more than one role- Sales Executive/Manager/CEO.
User - A user can access all his roles / needs by using a single login credential (Username / Email address).

keeping in this, I have designed this system. This is my first application, I need to know whether the designed application will meet all requirements and is this good to go in this design?
Any suggestions and ideas regarding this and some tips for best practise. Thanks in advance.
Comment: Many countries do not contain states.  Even if your direct users are all within your political system their suppliers may not be.
Answer: The "Data Model Resource Book", Volume 1, has complete and validated structures for all that. I suggest you grab a coffee - it also discusses these details in great length.
You have a problem - User and UserRole - a User may be in multiple roles and roles should be time limited so they can change over time without invalidating your audit trail. What you do if a Vendor turns into a Buyer? You fall into the typical trap of assuming a User (entity / table) contains a role - it should not. A user is an ID - much like you passport does not contain your job.
Roles are attached to users (UserRole) table, but a user does not contain a role.
Same with AddressType - what if I want to use the same address for both invoicing and shipping? Types should be tags added. Or in the Role you have a pointer to a specific address (ShippingAddressId etc.).
You code the address very detailed - that is nice, but also totally bad if you ever run into addresses that are non-standard. There is a good sense to have fields like postal code, city, country - but even state is something irrelevant (never give it on an address) for shipping but what is worse are all the address fields. Street? What about countries not using this? Not having proper house  numbers? Where your shipping address is 15 lines long? Those DO exist. Read http://online.wsj.com/news/articles/SB10001424052702304870304577489094121477570 for a reference. There is a good point to have a free text field for stuff like that - as well as additional routing details you are not aware of at the moment.
Phone numbers- same thing. Please. ContactItem is a good table - can be email, phone, etc.- Allows people to have multiple phone numbers.
PinCode? You want to store a readable pin code in there? Programming for beginners: NEVER EVER STORE A PASSWORD OR PIN CODE IN A DATABASE. Store a Hash, salted, by standard security approach. Something a hacker can not easily use to pretend to be the user. Storing a pin code was legally gross neglect 20 years ago. It still is today.
So, looks like a non-enterprise model made by someone now aware of the complexities of the real world. I can really only recommend a copy of the Data Model Resource Book for a good description of all those cases.

Table Design - User Management


Rpi GPIO Push Button Circuit Grounding Problem

Question: I have a little project where I power my Raspberry Pi Zero using a 12v Battery, via a small 12v to 5v regulator I bought from eBay.
I am going to connect a push button to the Pi as in the following link. (pin 18 goes to push button and to ground; pin 18 is pulled up via software)
http://razzpisampler.oreilly.com/ch07.html
My question is can I connect the ground wire coming out from the push button directly to the ground of the 12v Battery? instead of the ground out from the regulator.
My guess is the -ve out from the regulator is the same as the battery -ve of the battery
Comment: Surely the output of the regulator is connected to a Pi 5V pin as well as a Pi ground pin.  Why not just connect the button ground to a Pi ground pin?  A diagram or photo of your proposal may help.
Comment: Thank you for the reply. My project turns on a motor bike via bluetooth. Now I want to know the status of the side stand of the bike. Actually I am trying to connect wire from GPIO pin to the side stand so that it connects to the ground when the side stand is lifted. (I will not be using a push button). so I am thinking to make it so that the wire from the GPIO touches the body of the bike when I lift the side stand. As you know the body of the bike is connected to the -ve of the battery, this way I can use just one wire.
Comment: @Mohamed Rilwan, I am making an answer.  Please look at my schematic and confirm if I understand your setup correctly.
Answer: This question is unanswerable without more information. Most switch mode regulators have a common -ve between input and output, but not all.
However, even if the connection is common, it is bad practice. Connections to GPIO pins
should have the shortest most direct connection with no ground loops.
In addition motor vehicles are a hostile environment for for electronics, and you should take additional measures to prevent interference, such as low impedance circuitry, shielding and/or twisted pairs.
Answer: Question
The Setup

Power to RpiZero = 12V Battery >  12V to 5V volgage regulator
Push button with one end connected to Rpi GPIO.

The Question

Is it OK to connect the other end of the button to the 12V battery ground?

Answer
Short answer

Yes, no problem.

Long Answer
Let us first look at Oreilly tutorial's push button circuit.

Then compare Oreilly circuit (green part) with the above circuit (pink part). The OP's question now boils down to

Should Button Ground 5 connected Rpi Ground 3 or Voltage Regulator
  Ground 1?

/ to continue, ...

References
(1) Rpi Push button tutorial - Oreilly
(2) Electrial Circuit and Audio Equipment Ground Loop Problems And Howq to Get Rid of Them - Tomi Engdahl 2013
(3) Why 220V AC Mains Grounding Is Used? Tomi Engdahl 2013
/ to continue, ...

Appendices
Appendix A - Ground Loop Reading Notes
Electrial Circuit and Audio Equipment Ground Loop Problems And Howq to Get Rid of Them - Tomi Engdahl 2013
What is "Ground Loop"?

Ground loop is a condition where an unintended connection to ground is
  made through an interfering electrical conductor.
Generally ground loop connection exists when an electrical system is
  connected through more than one way to the electrical ground. When two
  or more devices are connected to a common ground through different
  paths, a ground loop occurs.
Currents flow through these multiple paths and develop voltages which
  can cause damage, noise or 50Hz/60Hz hum in audio or video equipment.
To prevent ground loops, all signal grounds need to go to one common
point and when two grounding points cannot be avoided, one side must
isolate the signal and grounds from the other.

What is "Ground"?

The NEC, National Electrical Code defines a ground as: "a conducting
  connection, whether intentional or accidental between an electrical
  circuit or equipment and the earth, or to some conducting body that
  serves in place of the earth."

What is the difference between Equipment Grounding and Earth Grounding?

When talking about grounding it is actually two different subjects,
  earth grounding and equipment grounding.
Earth grounding is an intentional connection from a circuit conductor
  usually the neutral to a ground electrode placed in the earth.
Equipment grounding is to ensure that operating equipment within a
  structure is properly grounded.
These two grounding systems are required to be kept separate except
  for a connection between the two systems to prevent differences in
  potential from a possible flashover from a lightning strike.
The purpose of a ground besides the protection of people plants and
  equipment is to provide a safe path for the dissipation of Fault
  Currents, Lightning Strikes, Static Discharges, EMI and RFI signals
  and Interference.
Improper grounding can create a lethal hazard. Correct grounding is
  essential for correct operation and safety of electrical equipments.
  Grounding can solve many problems, but it can also cause new ones. One
  of the most common problem is called "ground loop".

What is the difference between "Ground" and "Common"?

Audio and video systems need a reference point for their voltages.
Generally referred to as common or ground, although it may not be
  actually connected with the earth, this reference remains at "zero
  volts" while other signal voltages "swing" positive (above) and
  negative (below) it.
Physically, the common may be a wire, a trace on a printed-circuit
  board, a metal chassis, virtually anything that conducts electricity.
Ideally it should be a perfect conductor, but in any practical system
  it is not. As the complexity and size of the system is increased, the
  imperfect conductivity of the common (ground) conductor inevitably
  causes problems.

Why ground loop is a problem ?

Ground loops are a mystery to many people. Even college-trained
  electronic engineers may not know what ground loops actually are.
Engineers have either concentrated on power distribution (for the
  electric company) or on equipment that happens to plug in to the power
  distribution system.
Not much thought has been given to power distribution and equipment as
  a single entity where ground loops arise. Ground loops are the most
  common cause of AC line frequency hum in sound systems.
Ground loops can be generally identified by a low hum (60Hz in the US,
  50Hz in Europe) through the sound system. A ground loop in the power
  or video signal occurs when some components in the same system are
  receiving its power from a different ground than other components, or
  the ground potential between two pieces of equipment is not identical.
Ground loop is a common problem when connecting multiple audio-visual
  system components together, there is a good change of making a nasty
  ground loops.
Ground loops commonly cause humming noise to audio signals and
  interference bars to picture. Ground loop makes the system sensitive
  to pick up interference from mains wiring which can lead to erratic
  operation of the equipments or even damages to the equipments. Some
  articles claim that wiring and grounding problems account for up to 80
  percent of all power quality related problems related with sensitive
  electronic equipments like audio/video systems.

End of answer


Effective low energy actions in string cosmology

Question: I wonder why can SUGRA actions be used in string cosmology, since in some cases they are used to model big bang scenarios (for example the pre big bang scenario in chapter 4 of Gasperini's "Elements of string cosmology"). Shouldn't the energy scale be so high that actual superstring theory needs to be used, instead of its low energy description?
Answer: If the energy scale is much less than the string energy scale, which is supposedly around the Planck mass, then SUGRA is a good approximation.
For instance inflationary energy scale (by which I mean mass of an inflaton) is around $M_I\sim 10^{14}$ GeV, give or take depending on the model. Clearly $M_I\ll M_P$.
Unfortunately I don't have that book, so cannot comment on that model you mention.


On what planet within the Asteroid Belt would solar panels work the best?

Question: I was researching for a project and came across this question. Maybe this is a bit too broad? How might solar energy work on Mars? Would it be sufficient to sustain a colony?
Comment: NASA about design considerations for solar panels on Mars https://ntrs.nasa.gov/archive/nasa/casi.ntrs.nasa.gov/20040191326.pdf
Answer: Mercury: Temperature ranges from -300F to 800F. Either you will get too much or too little sunlight.
Venus: The hottest planet in our solar system. More than 850F. And the pressure in 90 times. And full of dense clouds, not sure if sunlight reaches the surface. Maybe over the clouds somewhere if we manage to hold our drones/satellites with solar panels there... it might work. But a lot of other complications will be on the way.
Mars: Low atmospheric pressure. Extremely cold and gets around 2.25 percent less sunlight than earth. Maybe the only other planet where solar panels are possible but probably work with 40-45% efficiency (please do your own calculation). Imagine putting solar panels in Antarctica, I think the scenario would be somewhat comparable but it would be worse on Mars.
Earth: Some people say that solar panels are tailor-made for this planet.
P.S. Maybe look into solar panels on Mars vs on Earth?
Comment: "Extremely cold" should be good, though. Part of the inefficiency of solar cells is due to high temperatures. And Antarctica would suck for a number of reasons that wouldn't apply to Mars. Do you have any justification for your "40-45%" figure?
Comment: It is just a back of an envelope calculation: it receives like 44% of the sunlight than what earth receives. So I just extended that (I know its not as simple because of other parameters). Mars rover uses Solar Panels so yeah definitely possible. Now that I am thinking, maybe for the project, they should just look into Mars vs Earth scenario. That would be cool.


How to send an automatic email after payment ("Processing" status)

Question: Does magento send automatic emails to confirm payments? (I'm using v1.6.2)
This field is only for manual emails?
Answer: Yes Magento does send an email once an order reaches the 'processing' state. If you 'invoice' the order manually in Magento admin, you need to check the 'send email' checkbox to ensure the email is sent.
If the order is automatically sent into processing, then Magento will automatically send an email to the relevant email address.
If emails are not being sent or received then you will need to investigate whether the mailing service on the server is working. You can try the forgot password functionality as a test, make sure you check the spam folder.


asp.net windows authentication to sql server

Question: I can not seem to get sql server to recognize my credentials.
Asp.net recognizes me when I login but when I execute a sql command I get a login failed message.
The IIS server and SQL server are on different machines.
There are other applications the IIS server which are able to authenticate to the sql server.  I believe the Active Directory settings are correct.  I am investigating what I am doing differently.
I must be missing something.

I check the IIS settings
The web config is set to impersonate.

Below is the relevant information.  If anyone has any idea as to what I missed or am doing wrong I would appreciate some help.
IIS Settings:

'Integrated Windows authentication' is checked
'Enable anonymous access" is not checked

Web Config
<authentication mode="Windows"/>
<identity impersonate="true"/>
<authorization>
   <deny users="?" />
</authorization>

Page_Load Code:
Dim winId As IIdentity = HttpContext.Current.User.Identity
TextBoxMessage.Text = winId.Name + Environment.NewLine
Dim cnn As SqlClient.SqlConnection

Try
   Dim sql As String = "*****"

   cnn = New SqlClient.SqlConnection("Data Source=*****;Initial Catalog=****;Integrated Security=True")
   cnn.Open()

   Dim cmd As New SqlClient.SqlCommand(sql, cnn)
   cmd.ExecuteNonQuery()
   cnn.Close()

Catch ex As Exception
   TextBoxMessage.Text += ex.Message
   cnn.Close()
End Try

Output:
Domain\UserName
Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.
Answer: This is key = The IIS server and SQL server are on different machines. You're facing the classic double hop issue. Think of it in this way:

You access the web application under your credentials
IIS in this case has to present who you say you are to the SQL Server
IIS says, "Why hello SQL Server, I'm passing on Tony's kerberos creds, they are legit"
SQL Server says, "Hmmm, IIS I'm not sure I trust you, I need proof that you are trusted to present these credentials to me".

Thus once you enable delegation as mentioned by Remus, your SQL Server will trust the credentials your IIS server is presenting on your behalf.
In terms of security, under delegation, it would be wise to choose:
Trust this computer for delegation for specified services only | Use Kerberos only | and then underneath the "Services to which this account can present delegated credentials" make sure you explicitly set only the server/port you need.
Answer: You also need to enable constrained delegation:

Enabling Constrained Delegation
How To: Use Protocol Transition and Constrained Delegation in ASP.NET 2.0
Windows Server 2003 Constrained Delegation (IIS 6.0)
Answer: Are your ISS server and SQL Server running on the same machine?
If not, Active Directory has to be configured to allow your IIS server to impersonate your accout towards the SQL Server.  See How To: Use Protocol Transition and Constrained Delegation in ASP.NET 2.0.
Comment: no they are not on the same server, though everything works as expected on my dev machine.  Thanks for the link I will check it out.
Answer: Long story short: IIS server should have "trusted for delegation" checkbox checked in Active Directory.
Answer: You need to set you credentials in Application Pool.
- Open IIS
- Select Application Pools
- Enter the name, select .Net framework version and click OK
- Select the new added application pool and click on Advanced Settings..
- In the Process Model section click on Identity - choose custom account and enter the AD username, password, confirm password and click OK
- Select your application and in the Basic settings choose your application pool just created.
Hope this helps


How do I handle a PC trying to assassinate another?

Question: I have a situation in which one PC is sitting on top of a roof with a rifle (which I've house ruled as having stats of a repeating crossbow) and there is another PC approaching the building. He wants to literally snipe the other guy in the head as he approaches. Assuming the attack roll hits, is there any way this could be ruled as a 1-hit kill? The player is completely concealed and hidden and all that.
Any advice would be greatly appreciated, I know 4th edition isn't super pvp friendly.
Comment: Surely your biggest problem here is any non-RAW ruling that favours one PC is going to be contested by the other in such a tense situation? Not only is PvP hard in 4E, you are going to make it doubly hard by ad-libbing rules into the game that have a large impact on the result at a critical point. Honestly, if you want to make a house rule at this point, you may as well just toss a coin!
Answer: Probably not. Hit points are too abstract to illustrate death from damage to a sensitive spot, so unless his rifle deals enough damage to completely lower the hit points of the target below zero it's unlikely that he'd die from such a hit. And being that 4e Lacks any called-shots mechanic it'd have to be something that would be house-ruled into the game, which changes the scope of the question entirely.
There have been a few instances of people who have been shot in the head in real life that haven't died, so its just as likely that a fantasy character with access to magic and healing spells would be just as capable of surviving such grievous injuries.
In the event that the Rifleman did fire at the PC, rolled a critical hit, and exceeded the hit points of the PC he would die like any other player.
Comment: In real life you are more likely to survive being shot in the head than die from it. Movies like to exaggerate these kinds of things for dramatic effect.
Comment: Even if you are correct, the difference with the headshot example is that surviving a headshot seems  to be the exception, while as you explain it, killing one character on one hit is the improbable thing. That changes the perspective on assassination.
Comment: If you want to be a fair and impartial judge you can't favor either the assassin or his PC target, so its highly unlikely that one would be able to deal enough damage to kill the other in a single round. If you really wanted to kill someone a disintegrate spell or a save or suck followed by a save or die spell would be the best way, but that doesn't fit the context of the question.
Answer: You should have decided this earlier
One of your players seems to have already committed to this, by setting themself up in a sniping position in order to attempt this manuever.  In doing so, that player is acting on the belief (for some reason, probably verisimilitude based off real life) that shooting someone in the head at close range with their sniper rifle has at least very good odds of killing or otherwise incapacitating the target.
The other of your players probably is operating under the assumption that, having a very high number of hitpoints and not being in an encounter and furthermore being 'in town', in which case a one-hit kill from a weapon that normally does fairly low damage and should have a good chance of not 1-hit-killing the target even on a crit will seem completely unfair.
No matter who wins this conflict, both players will be unsatisfied, because the mechanism of resolving the conflict will seem unreasonable/arbitrary, and tacitly negate long-running actions/plans the players are undertaking.  When the sniper first expressed this plan to you, you should have informed them that the plan will probably not work and is not something their character would think of as reasonable because (hp, no such thing as a vital area, etc), and instead (shooting him after he thinks a tough encounter is over, abandoning him to monsters in combat, etc) is the normal approach in this world.  They're still free to try, but now they at least have been warned that this might be difficult and also isn't working the way they thought it would work.
You could have informed the other players, instead, that you are adding called shot rules and also sneak attack rules for people without access to the relevant powers and the bonuses include 'target is instantly killed regardless of hp, no save', and remind them that PvP is allowed in this campaign.  However, doing so will remove the sniper's stealth advantage if you do it when the issue comes up, since it's pretty clear that the rules changes exclusively benefit their character, and that something PvP-y is coming up.
At this point, it is best to allow a retcon
Let the sniper know that the plan doesn't work the way they want because X reasons, and offer them the chance to not have done this in the first place.
Comment: I would also add to this that you should address the fact that one player character wants to kill the other player character.


Is it possible for a hash table's load factor to exceed 100%?

Question: Using probing, is it possible for for a hash table's load factor to exceed 100%? I don't too much about Hash Tables. Is this possible?
Answer: The load factor of a hash table is defined as:
$$\lambda = \frac{n}{k}$$
where $n$ is the number of items stored in the table and $k$ is the number of buckets. So the load factor is greater than 1 if there are more entries than buckets.
Storing more than one entry in a bucket is very common. The most familiar example is separate chaining (e.g. a linked list of entries in the bucket), used for in-memory hash tables.
For disk-based hash tables (as found in database servers or some file systems or file management systems), a "bucket" is typically a page (possibly a disk page or a virtual memory page) in size, so for typical use cases, you can easily fit more than one item into it. A scheme such as extendible hashing is typically used to manage buckets in a way that minimises disk traffic.
Answer: In theory, yes. As far as were told in practice, no (SHORT ANSWER AT BOTTOM).
A hash table's load factor is defined, as Pseudonym states, as:
$LF = \frac{elements}{array.length}$.
That is, $LF$ is the number of elements present in the array by the length of the array itself.
But for any person who may stumble across this and have no idea what Hash Tables are, perhaps we should be clear exactly what a Hash Table entails...
Hash Tables are nothing more than arrays that store elements.
We usually have an array of length $n$. Each array index will usually hold elements of some type. When we add elements to the array, we determine where they will go based on the hashCode() of that element. We take the hashCode() and mod it by the length of the array. Whatever this number is will be the index we store our element in.
Now one of the major problems of hash codes is that there are a finite amount of hash codes, so we're bound to have two objects "collide" - that is, both objects will have the same hash code and end up at the same array index. In this case, we develop "collision resolution" strategies to counteract this. These strategies are, but not limited to:
COLLISION RESOLUTION STRATEGIES -

External/separate chaining : Every array slot can hold a List, traditionally a Linked List of elements of some given type. This allows us to store/add multiple elements with the same hash code in the same index by adding to the List present in that index. You can imagine each List of elements as a chain of elements, hence the terminology.
Probing (Linear) : In this strategy, we restrict our Hash Tables to hold only one element at any given index. If we find that the initial index provided by element.hashCode % array.length is full, we iterate through the array (modding the number by array.length each time, to restrict us to the array indices only) until we find an empty spot and place our element there.
Probing (Quadratic) : Similar to linear probing, except instead of iterating linearly over the array until we find an empty spot, we add exponentially to the initial given index (1, 4, 9, etc...) and mod the number by array.length, and find an empty spot that way.

Now, how does this affect Load Factor? Every time we add an element successfully, we increase the load factor because the number of elements goes up by one.
Now, according to a resource by University of Texas from one of their Data Structure classes, one can have the Load Factor exceed 1 (exceed one hundred percent). Imagine an array of length 5 where each index holds a list of five elements. Clearly:
$LF = \frac{25}{5} = 5$
I only just found out it's okay to have the load factor exceed one in this case as performance apparently does not decrease. You learn something new everyday!
However, as we were taught in our data structures course, we focused
on the implications of load factor as it pertains to probing collision resolution strategies.
It makes sense that the more we tend towards 1 with LF, the slower our retrieval, addition, and removal times may be. Consider that for any given element we're trying to remove, we are not guaranteed that that element is in the spot we've initially calculated - if not, we need to potentially iterate through the entire array to find/remove the element, which is of course O(n).
In order to counteract this, we traditionally institute some bound on how large the Load Factor can be. I've seen it be .75, but it can be lower. It's mostly always above 1/2, at least.
If the load factor increases past a certain bound, this triggers an immediate resizing of the array (usually doubling the size), and all elements in the array are then re-added to the new array.
NOTE: Resizing involves recalculating the initial indexes for all elements all over again! Remember our formula for calculating initial index is:
$initIndex = element.hashCode() % array.length$.
If the array length as doubled, you can best be assured the initIndex will be changed.
You can convince yourself that adding (which is the only way to increase LF, and therefore trigger resizing) is in the worst case $O(n^{2})$, as you will need to potentially recalculate locations of all elements and then go through the process of trying to add one element.
One edge case I did see when I had to implement a HashMap for a homework assignment (where the resolution strategy was linear probing) was that it is indeed possible to have every array index be filled, yet have the LF be within the bounds? How is this possible?
One nuance of linear probing involves our removal process. When we remove an element, we don't actually remove it from the hash table. What we do is we mark it as removed, and then move on. If we add to the same index later on and we find a removed element, we overwrite it.
Removing an element decreases size by one, and decreases LF appropriately. But what you can do is you can have a mixture of removed elements and regular elements in your array, such that no index is TRULY empty, and still have the LF be less than the bound you've established. I myself didn't even think it was possible, but lo and behold, after writing the diagrams down on paper, I realized this was an edge case I had not foreseen.

SHORT ANSWER (THANKS FOR READING)
It's not really possible with a probing strategy to exceed LF = 1 given that you'll have only one element in every spot at the absolute maximum.
If you implement the Hash Table at any point, you'll probably be told to institute some bound where if LF = .75 or greater, you need to trigger resizing. This necessarily implies that some array indices will be empty or have removed elements. With this in mind, it is clear to see that unless you implement the Hash Table incorrectly, you'll never really reach an LF of 1.
The reason we do this is to keep the Hash Table's super-fast retrieval/search times (usually O(1) in the best case). Having an LF that continuously increases decreases the effectiveness of searching processes, and forces us to increase our search time to an O(n) process.
Hopefully this helps! Sorry for the long answer. If you want, I can cut out portions of it deemed unnecessary to the answer, but I wanted to make sure Hash Tables were explained (somewhat) well.


Probability of a user participating in a thread

Question: If I am given the count of users participating in a forum thread on a continuous number of days, how can I can find the probability that a number of users will participate in the same thread on another given day in the future?
Comment: Possibly relevant: http://www.msi.org/publications/publication.cfm?pub=1974 "authors Rooderkerk and Pauwels investigate what features and characteristics determine the number of comments that a post receives on an online discussion forum. The study is the first in-depth statistical analysis of the behavior of members of the focal discussion group."
Answer: The OP is asking how to calculate the probability of someone participating another day in the future. A simple possible solution here is to use a Markov Chain. Define the daily transition matrix to be the probability that a person is active on a forum on day $t$ given they were active on day $t-1$. The posting mentions there is data on users active on threads. Count the number of active people on the thread in successive days. These probabilities are what you need. You matrix is a $2\times2$ matrix where you go from either active on day $t$ to one of either active or inactive on day $t+1$. To make a prediction you can use the most recent set of transitions to predict for a person, or you could assume stationarity and use the steady state matrix of the Markov Chain.
If you have additional information about the users, say a covariate or two you could try modeling the observed transitions as binary variables (whether the person moved states or not) an estimate the probabilities using logistic regression, put those into a Markov Chain and do a similar analysis as the case with no covariates I mentioned above. The case here with covariates is probably easiest with only 1 or 2 dichotomous covariates.


How to stop/terminate a python script from running?

Question: I wrote a program in IDLE to tokenize text files and it starts to tokeniza 349 text files! How can I stop it? How can I stop a running Python program?
Comment: `ctrl+c` should kill it. Alternatively, `kill -9` it
Comment: Many answers here are platform-specific. Search for your platform (Windows, Linux, Mac, something else?)
Comment: So many friends spent effort to write answers, but none got accepted, yet :-(
Answer: You can also do it if you use the exit() function in your code. More ideally, you can do sys.exit(). sys.exit() which might terminate Python even if you are running things in parallel through the multiprocessing package.
Note: In order to use the sys.exit(), you must import it: import sys
Comment: Note: I could find examples in which `sys.exit(1)` doesn't stop the process. I basically have multiple threads and each of them blocks on external processes started by `Popen`. I need a nuclear option to kill all sub-processes created by the Python process as well as the Python process itself. Didn't find so far.
Comment: sys.exit() doesn't kill the process but raise SystemExit Exception which doesn't stop execution by closing the programm
Answer: To stop your program, just press Control  + C.
Comment: This method worked on my windows laptop, but on my linux desktop, it showed `^C` in the terminal and the system monitor showed python is still using a lot of CPU...
Comment: @Gathide If you want to pause the process and put it in the background, press `Ctrl + Z` (at least on Linux). Then, if you want to kill it, run `kill %n` where "n" is the number you got next to "Stopped" when you pressed `Ctrl + Z`. If you want to resume it, run `fg`.
Comment: Is it possible to resume the script after stopping it?
Comment: Does not work if you have a general except: clause in the program.  The except: catches the interrupt, does something (or not), and then the program merrily continues.
Comment: @DragonLord Your general except should have an special except for the error trown by Ctrl+C. Anyway, general excepts are usually discouraged.
Answer: If your program is running at an interactive console, pressing CTRL + C will raise a KeyboardInterrupt exception on the main thread.
If your Python program doesn't catch it, the KeyboardInterrupt will cause Python to exit. However, an except KeyboardInterrupt: block, or something like a bare except:, will prevent this mechanism from actually stopping the script from running.
Sometimes if KeyboardInterrupt is not working you can send a SIGBREAK signal instead; on Windows, CTRL + Pause/Break may be handled by the interpreter without generating a catchable KeyboardInterrupt exception.
However, these mechanisms mainly only work if the Python interpreter is running and responding to operating system events. If the Python interpreter is not responding for some reason, the most effective way is to terminate the entire operating system process that is running the interpreter. The mechanism for this varies by operating system.
In a Unix-style shell environment, you can press CTRL + Z to suspend whatever process is currently controlling the console. Once you get the shell prompt back, you can use jobs to list suspended jobs, and you can kill the first suspended job with kill %1. (If you want to start it running again, you can continue the job in the foreground by using fg %1; read your shell's manual on job control for more information.)
Alternatively, in a Unix or Unix-like environment, you can find the Python process's PID (process identifier) and kill it by PID. Use something like ps aux | grep python to find which Python processes are running, and then use kill <pid> to send a SIGTERM signal.
The kill command on Unix sends SIGTERM by default, and a Python program can install a signal handler for SIGTERM using the signal module. In theory, any signal handler for SIGTERM should shut down the process gracefully. But sometimes if the process is stuck (for example, blocked in an uninterruptable IO sleep state), a SIGTERM signal has no effect because the process can't even wake up to handle it.
To forcibly kill a process that isn't responding to signals, you need to send the SIGKILL signal, sometimes referred to as kill -9 because 9 is the numeric value of the SIGKILL constant. From the command line, you can use kill -KILL <pid> (or kill -9 <pid> for short) to send a SIGKILL and stop the process running immediately.
On Windows, you don't have the Unix system of process signals, but you can forcibly terminate a running process by using the TerminateProcess function. Interactively, the easiest way to do this is to open Task Manager, find the python.exe process that corresponds to your program, and click the "End Process" button. You can also use the taskkill command for similar purposes.
Answer:
To stop a python script just press Ctrl + C.
Inside a script with exit(), you can do it.
You can do it in an interactive script with just exit.
You can use pkill -f name-of-the-python-script.
Comment: The last option is especially useful when you run the script in a detached mode, e.g. ```python script.py&```
Comment: @AEM WOW! what a good answer!
I searched for a way to kill the python program outside the script and your answer was exactly the answer! Thanks!
Answer: To stop a python script using the keyboard: Ctrl + C
To stop it using code (This has worked for me on Python 3) :
import os
os._exit(0)

you can also use:
import sys
sys.exit()

or:
exit()

or:
raise SystemExit

Comment: only os._exit(0) worked for me but for some reason all the others didnt, glad i found os one out, Thank you!
Comment: Thanks. SystemExit is the way to go.
Comment: `raise SystemExit` is especially useful if you have never-ending threads (using the multithreading package). The process won't stop if you terminate it using any other method, unless you do ctrl+c twice - but I need an automated restarter :)
Comment: For me also os._exit(0) only worked. Thanks
Answer: To stop a running program, use Ctrl+C to terminate the process.
To handle it programmatically in python, import the sys module and use sys.exit() where you want to terminate the program.
import sys
sys.exit()

Comment: This won't work if called from a subprocess.
Answer: Ctrl-Break it is more powerful than Ctrl-C
Comment: Like Daniel Pryden clarifies in his answer, the Break key on the keyboard could also be labelled Pause, for those who were confused like me. :)
Answer: When I have a python script running on a linux terminal, CTRL+\ works. (not CRTL + C or D)
Comment: This is far better than `Ctrl` + `Z` as that only suspends the process
Answer: Ctrl+Z should do it, if you're caught in the python shell. Keep in mind that instances of the script could continue running in background, so under linux you have to kill the corresponding process.
Comment: this is useful when running (many) parallel processes and CTRL-C just won't kill them all. After CTRL-Z, you may check `jobs` or `ps` to then `kill 8923754` or whatever jobid/process id you need to kill
Answer: exit() will kill the Kernel if you're in Jupyter Notebook so it's not a good idea. raise command will stop the program.
Answer: To stop your program, just press CTRL + D
or exit().
Answer: If you are working with Spyder, use CTRL+.  and you will restart the kernel, also you will stop the program.
Comment: FINALLY.  A solution that works in Spyder on Windows.
Answer: you can also use the Activity Monitor to stop the py process
Answer: Control+D works for me on Windows 10. Also, putting exit() at the end also works.
Answer: Windows solution: Control  + C.
Macbook solution: Control (^)  + C.
Another way is to open a terminal, type top, write down the PID of the process that you would like to kill and then type on the terminal: kill -9 <pid>
Answer: Try using:

Ctrl + Fn + S

or

Ctrl + Fn + B
Comment: What exactly these shortcuts do??
Comment: @rhoitjadhav, sometimes in windows a python application doesn't stop by pressing "ctrl+c" only, and a lot of keyboards don't have an explicit "break" key either. So, these shortcuts help you to stop your python application in the terminal if and when required.
Answer: Press Ctrl+Alt+Delete and Task Manager will pop up. Find the Python command running, right click on it and and click Stop or Kill.
Answer: I might be a little too late to respond but if you're finding it hard to use sys.exit() or exit() and want to kill the python script from within, this might be helpful
import os
import sys
os.system(F"pkill -f {sys.argv[0]}")

Sometimes, in a really long script with many simultaneous threads, it is difficult to kill just with sys.exit but this works like a charm.
Answer: If you are writing a script to process 349 files, but want to test with fewer, just write a nonexisting word like 'stop' in your list, which will cause a stop in the form of an exception. This avoids dialogs like do you want to kill your process if you use exit() or quit()


Is dandelion a sporophyte or gametophyte?

Question: My text book claims all land plants undergo alternation of generation. However, I don't see how it could be with dandelion. The flower head gets pollinated and then turn back on itself. After a while it opens back as a seed head ready to blow seed in the wind. What would be the spores then? And the gametophyte organism? All seeds are a result of sperm and ovula so it would mean the dandelion flower is a sporophyte?
Comment: See [Alternation of generations - Life cycles of different plant groups](https://en.wikipedia.org/wiki/Alternation_of_generations#Life_cycles_of_different_plant_groups)
Answer: Dandelions are sporothytes. In Wikipedia you can read (Alternation of generations):

"In the spermatophytes, the seed plants, the sporophyte is the
  dominant multicellular phase; the gametophytes are strongly reduced in
  size and very different in morphology. The entire gametophyte
  generation, with the sole exception of pollen grains
  (microgametophytes), is contained within the sporophyte. The life
  cycle of a dioecious flowering plant (angiosperm), the willow, has
  been outlined in some detail in an earlier section (A complex life
  cycle). The life cycle of a gymnosperm is similar. However, flowering
  plants have in addition a phenomenon called 'double fertilization'.
  Two sperm nuclei from a pollen grain (the microgametophyte), rather
  than a single sperm, enter the archegonium of the megagametophyte; one
  fuses with the egg nucleus to form the zygote, the other fuses with
  two other nuclei of the gametophyte to form 'endosperm', which
  nourishes the developing embryo. For further information, see Double
  fertilization"
Comment: Hi @Olga. Welcome, and thanks for contributing to Bio.SE! Generally, we ask that answers don't simply include large quoted blocks of text, and instead we hope that those that answer expand upon the resources (quotes, pictures, links) that they provide with additional context, backround, etc. Your post will likely garner more positive attention if you expand upon it further. Additionally, if you reference or quote something specifically, please provide a direct link to where the quote arises so interested users may explore the topic further. Thanks!
Comment: Hey! Thank you for constructive comments (my English is not very well and that's why I decided to take such a long quote). For the future I will try to try harder :-). Have a nice day..


How to generate an import library (LIB-file) from a DLL?

Question: Is it possible to autogenerate a MSVC import library (LIB-file) from a DLL? How?
Comment: May I ask about the downvotes? And why without comment?
Comment: looks like a good question to me -- helpful
Comment: I mean, this is a very basic thing that people often run into. There *should be* a canonical answer for this question on SO. It's a good question, at most it could be a duplicate, but since it was the first one that google gave me, I think this counts for something :)
Comment: @Lyn: It was closed as a consequence from a flamewar from people who wanted to point out that they disagree with me: http://meta.stackexchange.com/questions/127567/why-are-we-limited-to-six-questions-per-day
Comment: It is really beyond me why would anyone think this question is not constructive. That someone with moderator privileges would think so - well, I'm at a loss for words. Sigh.
Comment: possible duplicate of [How to make a .lib file when have a .dll file and a header file](http://stackoverflow.com/questions/9360280/how-to-make-a-lib-file-when-have-a-dll-file-and-a-header-file)
Answer: You can generate a DEF file using dumpbin /exports:
echo LIBRARY SQLITE3 > sqlite3.def
echo EXPORTS >> sqlite3.def
for /f "skip=19 tokens=4" %A in ('dumpbin /exports sqlite3.dll') do echo %A >> sqlite3.def

The librarian can use this DEF file to generate the LIB:
lib /def:sqlite3.def /out:sqlite3.lib /machine:x86

All of the filenames (sqlite3.dll, sqlite3.def, etc.) should be prepended with full paths.
Comment: this works perfectly. if your DLL is 64 bit, you may use `/machine:x64` or `/machine:x86-64` depending on your environment setup.
Comment: @Rotem You need `%%A` instead of `%A` if you put it in a batch file instead of invoking directly from the command line.
Comment: Had to change `%A` in the last line to `%%A` (in both places)
Comment: To be safe, check the contents of the exports.txt file before running the loop. On an old dll the function names were the 3rd token, not the 4th.
Answer: I know the topic is old, but I still couldn't find a script or batch file anywhere on the Internet to do this. So based on Dark Falcon's answer, I've made this script, which you can save as dll2lib.bat and run:
REM Usage: dll2lib [32|64] some-file.dll
REM
REM Generates some-file.lib from some-file.dll, making an intermediate
REM some-file.def from the results of dumpbin /exports some-file.dll.
REM Currently must run without path on DLL.
REM (Fix by removing path when of lib_name for LIBRARY line below?)
REM
REM Requires 'dumpbin' and 'lib' in PATH - run from VS developer prompt.
REM
REM Script inspired by http://stackoverflow.com/questions/9946322/how-to-generate-an-import-library-lib-file-from-a-dll
SETLOCAL
if "%1"=="32" (set machine=x86) else (set machine=x64)
set dll_file=%2
set dll_file_no_ext=%dll_file:~0,-4%
set exports_file=%dll_file_no_ext%-exports.txt
set def_file=%dll_file_no_ext%.def
set lib_file=%dll_file_no_ext%.lib
set lib_name=%dll_file_no_ext%

dumpbin /exports %dll_file% > %exports_file%

echo LIBRARY %lib_name% > %def_file%
echo EXPORTS >> %def_file%
for /f "skip=19 tokens=1,4" %%A in (%exports_file%) do if NOT "%%B" == "" (echo %%B @%%A >> %def_file%)

lib /def:%def_file% /out:%lib_file% /machine:%machine%

REM Clean up temporary intermediate files
del %exports_file% %def_file% %dll_file_no_ext%.exp

I'm sure the script can use improvement, but I hope it's useful.
Comment: Made some small [improvements](https://gist.github.com/Trass3r/8d0232a66b098530d07b0e48df6ad5ef) to allow passing a dll path.
Answer: This script creates *.lib from *.dll passed in %1:
@echo off

setlocal enabledelayedexpansion
for /f "tokens=1-4" %%1 in ('dumpbin /exports %1') do (
    set /a ordinal=%%1 2>nul
    set /a hint=0x%%2 2>nul
    set /a rva=0x%%3 2>nul
    if !ordinal! equ %%1 if !hint! equ 0x%%2 if !rva! equ 0x%%3 set exports=!exports! /export:%%4
)

for /f %%i in ("%1") do set dllpath=%%~dpni
start lib /out:%dllpath%.lib /machine:x86 /def: %exports%

You could name it implib.bat and run: implib.bat C:\folder\mydll.dll which produces C:\folder\mydll.lib
Answer: For those who are on Linux and would like to create an appropriate import library (.lib) for a .dll produced by MinGW, there are again two steps involved:

Create .def file from .dll
Create .lib file from .def

Using MSVC, one could process the output of dumpbin /exports foo.dll. On Linux, you have to process the output of objdump -p (from binutils). The generated module definition file should look like:
LIBRARY foo.dll
EXPORTS
    your_symbol @1
     another_symbol @2
     ; ... et cetera

To convert the .def file to a .lib file, use llvm-dlltool (MinGW (binutils) dlltool is not suitable). Example invocation for a 64-bit library:
llvm-dlltool -m i386:x86-64 -d foo.def -l foo.lib

Explanation:

-m i386:x86-64: generate a 64-bit library. Use -m i386 if you need a 32-bit library instead.
-d foo.def: read exported symbols from file foo.def
-l foo.lib: write an import library to foo.lib
If a .def file does not contain a LIBRARY line, you have to append the -D foo.dll option (with just the filename and no directory prefix).

And here is a script to automate it:
# Given libxyz-1.dll, create import library libxyz-1.lib
make_implib() {
    local machine=$1 dll="$2" dllname deffile libfile

    dllname="${dll##*/}"
    deffile="${dll%.dll}.def"
    libfile="${dll%.dll}.lib"

    # Extract exports from the .edata section, writing results to the .def file.
    LC_ALL=C objdump -p "$dll" | awk -vdllname="$dllname" '
    /^\[Ordinal\/Name Pointer\] Table$/ {
        print "LIBRARY " dllname
        print "EXPORTS"
        p = 1; next
    }
    p && /^\t\[ *[0-9]+\] [a-zA-Z0-9_]+$/ {
        gsub("\\[|\\]", "");
        print "    " $2 " @" $1;
        ++p; next
    }
    p > 1 && /^$/ { exit }
    p { print "; unexpected objdump output:", $0; exit 1 }
    END { if (p < 2) { print "; cannot find export data section"; exit 1 } }
    ' > "$deffile"

    # Create .lib suitable for MSVC. Cannot use binutils dlltool as that creates
    # an import library (like the one found in lib/*.dll.a) that results in
    # broken executables. For example, assume executable foo.exe that uses fnA
    # (from liba.dll) and fnB (from libb.dll). Using link.exe (14.00.24215.1)
    # with these broken .lib files results in an import table that lists both
    # fnA and fnB under both liba.dll and libb.dll. Use of llvm-dlltool creates
    # the correct archive that uses Import Headers (like official MS tools).
    llvm-dlltool -m "$machine" -d "$deffile" -l "$libfile"
    rm -f "$deffile"
}

# Example invocations:
make_implib i386:x86_64 usr/x86_64-w64-mingw32/sys-root/mingw/bin/libgnutls-30.dll
make_implib i386 usr/i686-w64-mingw32/sys-root/mingw/bin/libgnutls-30.dll

(Note that there is a bug in llvm-dlltool that produces a larger .lib file than necessary if the library name is longer than 15 characters. Aside from the size, it is fully functional though. This is fixed by https://reviews.llvm.org/D55860)
Tested with:

llvm-dlltool from LLVM 7.0.0-1 (Arch Linux)
objdump from binutils 2.31.1-3 (Arch Linux)
dlltool from binutils-mingw-w64-x86 64_2.30-7ubuntu1+8ubuntu1 (Ubuntu 18.04)
link.exe from Visual Studio 2015 14.00.24215.1 (Windows 7)
Comment: I use "gendef foo.dll" to generate the .def file and "llvm-dlltool -m i386:x86-64 -d foo.def -D foo.dll -l foo.lib". Working fine for my linux-cross-build rust libraries.
Answer:
Is it possible to autogenerate a MSVC import library (LIB-file) from a DLL? How?

In addition to Dark Falcon's answer, Microsoft has published procedures at How To Create Import Libraries Without .OBJs or Source.
Microsoft's first procedure is the same as Dark Falcon's. The second procedure is a little more cumbersome, but it shows how to do it with an object file using stubs. It works with different calling convention and classes.
Here's the second procedure from the KB:

When "__declspec(dllimport)" is used in a prototype or declaration, change it to "__declspec(dllexport)."
For functions that do not return a value, for C functions in C source, and for C functions in C++ source code (used with the 'extern "C"' construct), replace the semicolon that terminates the function prototype with a matched pair of curly braces ("{}").
For C++ functions (global or member) that return a value, you must create a dummy body for the function, and return a dummy value of the proper type. (Not having a return statement in the function is illegal.) This goes for class member functions, as well. Keep in mind that the purpose of this procedure is to trick the LIB utility into generating the correct import library, so these dummy bodies have no effect.
For C++ classes, you can stub out the member functions by using the prototypes in the class declaration, as long as you disable function inlining when you compile.
Function arguments are usually just specified by type in a header file. For example, Geta(int). A dummy argument identifier must be specified when adding the dummy function body Geta(int x). Otherwise the error C2055 is generated.
Comment: could you pls throw some lights here, what does the page mean by "For `_cdecl` functions, the symbol appears just as it would when used in the calling program. Just place this symbol in the `EXPORTS` section of the .DEF file."?


rasterio mask method

Question: I am using a simple ASCII raster file to test the rasterio.mask module
ncols 4
nrows 4
xllcorner 0
yllcorner 0
cellsize 0.5
nodata_value -9999
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16

I generated the following script which should extract all the diagonals
import rasterio
import shapely
from rasterio import mask

def extract_by_mask(raster_dataset, geometry):
    #outputs a numpy masked array with values within polygon geometry
    geometry = [shapely.geometry.mapping(geometry)]
    m = mask.mask(raster = raster_dataset, shapes = geometry)
    return m
r = rasterio.open('raster.asc')
p = shapely.geometry.Polygon([[0,0],[0.3,0.1],[1.58,1.5],[2,2],[1.56,1.8],[0.1,0.4]])
m = extract_by_mask(r, p)
print m

It does extract the diagonals, but I'm not comfortable with the resulting mask array:
(masked_array(
  data=[[[-9999, -9999, -9999, 4],
         [-9999, -9999, 7, -9999],
         [-9999, 10, -9999, -9999],
         [13, -9999, -9999, -9999]]],
  mask=[[[False, False, False, False],
         [False, False, False, False],
         [False, False, False, False],
         [False, False, False, False]]],
  fill_value=-9999), Affine(0.5, 0.0, 0.0,
       0.0, -0.5, 2.0))

It seems to consider that all the values are valid, such that when I take a mean it considers all the values including nodata:
>>> m[0].mean()
-7497.125

I have been playing around with some of the parameters in the mask method but no luck. I think the one I'm looking for in the docs is filled = False but when I do this I get an error:
Traceback (most recent call last):
  File "D:/Basis/common.py", line 114, in <module>
    m = extract_by_mask(r, p)
  File "D:/Basis/common.py", line 109, in extract_by_mask
    m = mask.mask(raster = raster_dataset, shapes = geometry, filled = False)
TypeError: mask() got an unexpected keyword argument 'filled'

It doesn't seem to recognize filled as a valid argument. I am using rasterio version 0.36.0 by anaconda.
I need that mask array to show True for the diagonal values so I can only consider those for calculations.
Could anyone help?
Comment: I'd start by updating rasterio.   Current version looks to be 1.0.10 while you're on a pre-1.0 version meaning it was considered unstable (or at least that the APIs weren't finalized).
Answer: Explicitly passing nodata=9999 to rasterio.mask.mask may help output masked array with True at desired locations.
Answer: You could try rioxarray. An example of clipping/masking raster is here.
rds = rioxarray.open_rasterio('raster.asc')
geometries = [
    {
        'type': 'Polygon',
        'coordinates': [[[0,0],[0.3,0.1],[1.58,1.5],[2,2],[1.56,1.8],[0.1,0.4]]]
    }
]
geometry_crs = "???"  # not sure what projection the geometries are in
rds_clipped = rds.rio.clip(geometries, geometry_crs, drop=False)
rds_clipped.rio.to_raster("clipped_raster.asc")

rasterio mask method


Recommendation of actuator

Question: I had posted about my project earlier in this forum:
PID algorithm implementation using computer vision
Now I am currently stuck in a stage whether I am concerned whether I chose the wrong actuator.
The stepper motor controller needs input in terms of number of steps and time duration of rotation. I find it very difficult to estimate a base scale to do the calculations as my angle of tilt varies according to both the parameters. I had been discussing this with someone and he suggested that I use a servo motor because I was planning to use the OpenCV Kalman filter algorithm. According to him, if I plug in my motor commands into my input vector matrix, I can actually get a value between 0 and 255 that could be used to operate my servos. I am looking forward to hear your thoughts whether I should switch to a servo or try using a stepper.
My main concern is that my maze's ball keeps spinning back and forth even for a small tilt in the maze and I am not following a standard approach in determining the tilt required for my maze to go to a point
Answer: Unpredictable exciter from input to output must be as frustrating as its self-excited slip or step advance. Suggest you use a reliable servo controller or get rid of the stray noise triggered step.
Try to characterize

the position error under different conditions, noise and level
velocity error from circuit, noise & level
acceleration error, noise and level.

Did you consider effects of noise from 1.8deg steps ?

Recommendation of actuator


MVC and ORM as designing for asp.net web application

Question:  I have a asp.net project and Its in designing phase. Its about products and shops navigation system. Users can browse/search products. I want my web application to be extendable and flexible. What I initially planned was to make it an MVC and for database I propose ORM (Object Relational Mapping). Is that right? what could be the problems I face with this proposal. I am learning asp.net so I don't know much about the problems.What design do you people suggest?
Answer: It's great that you've decided to learn ASP.NET.
Regarding design approach, it sounds like your question is 2 part:  a) MVC or traditional web forms ASP.NET, and b) ORM or no ORM.
a) Generally speaking, if you have a good programming background, I would recommend MVC over web forms for any consumer facing Internet product.  It promotes testability, clear separation of concerns, and gives the developer finer grained control over the UI.
b) Regarding ORM or no ORM - first, its important to note that you still need to choose a database.  ORM is merely a means of abstracting the data access logic away from the developer - but there still needs to be a database to store the data.  If you're going with an all Microsoft stack, you'll probably choose SQL Server.
ORM is great for developer productivity - and generally speaking, there's no reason not to choose it for new projects unless you can identify up front that its not going to provide a productivity boost.  An example reason why you would choose not to adopt ORM - you need to persist the data in a pre-defined format - or in an already existing database - and the persisted entities are not consistent with how your application is representing them (i.e. over-normalized).  In this case, you may want to write your own data access logic, and not rely on an ORM.
Finally, if all you are looking to accomplish is putting a product catalog online, rather than building an application from scratch to do this - you may want to consider utilizing an existing CMS of some sort, or even use Wordpress with some plugins.  Would save hours of time and still accomplish your stated goal.
Best of luck!
Answer: If you want a really good reference on how to build application using MVC and ORM, then read the following book : Professional ASP.NET Design Patterns
It explains in details as how to build application using MVC. It also covers other interesting topics like dependency injection, repository pattern(very important expecially if you have decided to go for ORM), TDD etc. I hope you will enjoy reading this text.


If SIP(Session Initiation protocol) can get the user IP then why need STUN or TURN?

Question: As said that SIP can locate the user IP with the user's SIP address, then why we need STUN or TURN?
Comment: Did any answer help you? if so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you could provide and accept your own answer.
Answer: STUN or TURN can be used when your SIP device is behind NAT and the device doing the NAT doesn't have an ALG (Application Layer Gateway) that translates your internal IP to your external IP in the SIP messages.
The problem is as follows, let's say by example:

phone1: IP 192.168.0.88 (a private network)
router1: LAN: 192.168.0.1, WAN: 198.51.100.43
sipserver1: 198.51.100.1

Keep in mind that SIP messages are carried by layer 4 protocol UDP.
The SIP registration packet passes through router1, which will translate the source address of the UDP packet from 192.168.0.88 to 198.51.100.43. Thus, sipserver1 will see 198.51.100.43 as source IP. However, the SIP registration message contains the IP address of phone1 in its headers and sipserver1 will use that information, and not the layer 4 (UDP) source address. So the information in the SIP header has precedence. In other words, the registration database of sipserver1 will list 192.168.0.88 as the address of phone1, which is unreachable from sipserver1.
A router equipped with a SIP ALG, will recognize that a SIP message is being carried in a UDP packet, and will also translate the information inside the SIP headers, thus alleviating the need for STUN or TURN. phone1 will then correctly register as 198.51.100.43. Any traffic coming back from sipserver1 destined for phone1 will again be translated by router1 (this is how NAT works).
Comment: I appreciate your including information about layers.
Answer: I've made a short memo on how SIP and NAT interacts, where I've tried to define problens with SIP over NAT and possibe solutions such as TURN and STUN.
https://profcollab.wordpress.com/2015/08/27/nat-and-firewall-traversal-for-sip-and-h-323/
Also you can refer to a book Voice and Video Conferencing Fundamentals (http://www.ciscopress.com/store/voice-and-video-conferencing-fundamentals-9781587052682) which provides a thorough explanation of this question


"Entity not found" teleporting my lost dog

Question: I tried teleporting my lost dog using the /tp @e[name=NAME] @p command and it simply says "entity not found". How do I fix this?
Answer: If the game says "entity not found", it means that it either

Does not exist (was killed or deleted somehow).
Is outside of loaded chunks.
Alternatively, the entity selector might not be working.

If 1 is the case, there's nothing you can do: your dog is lost forever :(
If 2 is the case, you should go around to different areas that your dog might be and try the command there.
3 is not the case, because the name= selector is used for nametag applied names.
Essentially, you need to go around into different locations and try the command, in the hope that the dog is somewhere in loaded chunks.
Comment: Thanks, I tried it and it worked. It was a tedious journey back to base but it was worth it. Thank you.


Getting url helpers to have correct domain for staging app on Heroku

Question: I have a domain, www.example.com, and an app hosted on heroku.  I use url helpers in e-mails which link back to pages on the app.  For production, that is www.example.com/etc.
I have set up staging deployment on heroku as well, at adjective-noun-xxxx.  When using the app in staging, I want the url helpers to link to the staging app at adjective-noun-xxxx.herokuapp.com/etc, but when used in staging they are still pointing to www.example.com/etc, and therefor my staging app does not work correctly.
How can I get the url helpers in the staging app to include the staging app domain, and not the production app domain?
Answer: In this railscast this is covered.
http://railscasts.com/episodes/312-sending-html-email


Multiselect products to add directly to shopping cart

Question: Would anyone have a recommendation on an extension that would allow the customer to add several products to their cart using one click.
My client sells paints and dyes and would like color swatches with editable quantities and sizes for each product that the customer can easily check off or input and drop into their shopping cart using 1 click. The ultimate goal is to display color and ordering options much like they are seen in the image below:
Answer: You don't need extensions for this, use the Grouped Product product type.
Find documentation for grouped products here: http://merch.docs.magento.com/ce/user_guide/catalog/product-grouped.html


Jitterbit time format issue

Question: I am using Jitter bit to load the data into SFDC. I have the separate fields for date(Field1) and time(Field2) in my text file. I have the upsert query and I did the mapping for salesforce like this, Dateandtime= Field 1+''+Field 2. All the data uploaded successfully except the time format. Time incorrect, showing as 10hour ahead (eg: file is 8am, system shows 6pm). Can anyone help me to solve this issue?
Answer: Time is subject time zones. By default, all times are in GMT. You must either convert your source times to GMT, or specify the time zone in the source file. I'm not familiar with Jitterbit specifically, but they may have a setting to use your local time zone as a conversion.

Jitterbit time format issue


Generic debugging / logging / tracing filesystem directory & file access?

Question: This is my particular problem: I'm trying to set up git on a server, for which I'm doing a test on a locally installed apache on Ubuntu 14.04; for instance, I can do git clone fine over HTTP, but  git push fails with insufficient permission for adding an object to repository database ./objects.
Now, in principle, I might have used strace for debugging this, but this kind of action goes through both git and apache, and as such I don't really know which process to strace. Furthermore, I cannot even tell what user does the end operation try to run as. The only thing that I know for sure is that it is the git repo ./objects directory which is being accessed, probably with the intent of creating a file there.
So I thought, probably the easiest for me would be if there was a program, that could be set to "listen" to accesses to a directory, and print out/log every such access to say stdout; in example as in this pseudocode:
$ ./traceDirectoryAccess --path /path/to/mygitrepo/objects
Listening for accesses on /path/to/mygitrepo/objects ...
Sat Apr  9 17:53:42 CEST 2016 - pid 1234, user myName (uid 1002) did:
 > create file /path/to/mygitrepo/objects/somefile
 > result: permission DENIED
...

Is there something like this out there? If there isn't a program per se, maybe there is some kernel facility (e.g. through a file in /sys/kernel/debug/ or similar?)
Answer: Ok, found an answer on this very site: List the files accessed by a program explains that one can use LoggedFS or the Linux audit subsystem.


Workflow email not sending to secondary domain users

Question: I have two types of domain users in my sharepoint 2013 site. My problem is: Only one type of domain users get the workflow generated emails but the other type doesn't. Both domain users are configured correctly from SMTP server end. Any suggestion/help will be highly appreciated.
Answer: Take a reference to this thread: SharePoint 2016 - workflow is not sending emails to SharePoint users/ groups. In this case, the issue was caused by user profile synchronization and was solved by running stsadm -o sync couple of times in SharePoint Management Shell.
Hope this may help.


Fetching lookup field in apex class?

Question: How can I fetch the value of staff lookup field of incident object in an apex class? In an incident object, staff lookup field has a value as 'xyz'. How can I get this field in an apex class?
Comment: Please provide more details, what have you tried and where you're stuck
Answer: Output Field will output the value of the lookup field but it will display a link to the object that the field references in the lookup relationship. If you want to show a more specific value on the referenced object you can use relationship chaining from the standard or custom controller Object that your VF page uses to the value on the related object like so:
{!Incident__c.Staff__r.staff_name__c}

Fetching lookup field in apex class?


How to make matplotlib Density Map

Question: Let's say I have two lists, x and y of same length. This length is not fixed, but always nonzero. They are x and y values of  non-negative points.
I want to create a a color density map much like http://www.mathworks.com/matlabcentral/fx_files/31726/1/datadensitymap.jpg .
Here's my attempt borrowing from a few places I've found on the internet:
density = stats.gaussian_kde([x,y])
color = density([x,y])
x1 = np.array(x)
y1 = np.array(y)
xmin = x1.min()
xmax = x1.max()
ymin = y1.min()
ymax = y1.max()
xscale = (xmax-xmin)/100
yscale = (ymax-ymin)/100
X, Y = np.mgrid[xmin:xmax:xscale, ymin:ymax:yscale]
positions = np.vstack([X.ravel(), Y.ravel()])
Z = np.reshape(density(positions).T, X.shape)
cmap = plt.get_cmap("hot")
plt.imshow(np.rot90(Z), cmap=cmap, extent=[xmin, xmax, ymin, ymax])
plt.scatter(x, y, c=color, cmap=cmap)

When I run this code the plot doesn't render; the title and labels are mashed together.
When I take out the call to imshow, the scatterplot shows perfectly with the density colors on the points showing correctly.
Answer: As it turns out, the plot was rendering, but because x had values much larger than y the rendered graph had no height. Setting aspect="auto" fixed it:
plt.imshow(np.rot90(Z), cmap=cmap, extent=[xmin, xmax, ymin, ymax], aspect="auto")

How to make matplotlib Density Map


SQL Server upgrade

Question: Can we upgrade SQL server 2014  Enterprise Core edition to SQL server 2017 Enterprise edition ?
I saw some documentation but don't see anything with regard to upgrade from enterprise core to enterprise edition.
Answer: Yes you can practically.
But is it a better option ? You need to figure the answer out for current core edition used which uses core based licensing based on number of CPUs. You can read the MS doc on this because you might have say 64 logical processors available but you might not be able to use more than 32 or 40 not sure on that number. I will update answer once I am in front of my desktop.
But to wrap in short , to utilize the available CPUs you would want to upgrade to core based model but again check in current version how it's being used.

SQL Server upgrade


Behold System V; what about systems I-IV?

Question: System V (by AT&T) is the ancestral Unix, and I have used it. But I have never read or heard anything about systems I-IV, other than they existed once upon a time in the dim past. How effective were they, and were they widespread? Is it possible to get one's hand on the code and/or install it? Does anyone here have any experience with these earlier systems?
Comment: System III source is [at TUHS](http://www.tuhs.org/cgi-bin/utree.pl?file=SysIII).
Answer: According to wikipedia System V was preceded by System III, a release of UNIX/TS 3. Since there were no official release of UNIX/TS 4, System III was superseded directly by System V.
Answer: Earlier versions of Unix were either AT&T internal versions or saw very limited outside use (other than e.g. base for BSD versions, used and mangled under academic licenses; or bases for commercial systems distributed under other names like Microsoft's Xenix).
Comment: In the context of this question, "earlier versions" would be System III, and that did see quite a lot of use outside of AT&T.


Do retired researchers keep a personal web site?

Question: A retired researcher may still like to keep some unfinished work, maybe as a good hobby. Therefore, I am wondering if it's better to keep a personal web site to keep those previous works such as publications, projects, etc. listed. Isn't it important? Or simply just retired and won't do any old trick?
Comment: It is not clear what you mean by old trick. Also it is not clear whether you are talking about a retired researcher who still carries on work as a hobby, or a more general case
Comment: As a general observation - many current professors have a university web site that has been set up at some time in the past. Few are kept particularly up to date. I suspect that the few that do update them have some plan for what happens later.
Comment: @toby544 What I mean the old trick is the hobby of keeping on researching the unfinished work.
Answer: If you're retired and want to have a site with all your work, go ahead. If you don't want to ever deal with work again, then don't.
It's a 100% personal choice.
Answer: My university web pages have some still useful material and they get hits. So, the university has decided to keep them up, even though I maintain the content. This is ten years or so after retirement.
But, I also have personal site(s) for various projects. Most of them don't get much traffic, though. The best sites are those that have a stream of useful material, not just old stuff. So, if you keep active in retirement then it is useful both to yourself and others to share that. But to be useful, a website needs to be somehow visible to those who might want it. That might be difficult to arrange. A web search on my true-name turns up the university site (and obits of folks that share that name).
If the university won't keep a person's pages then a personal site might be a useful place just to keep in contact with those you interacted with over the years. But that assumes, I'd guess, that you have new things to offer. I read some blogs of others, for example.
Comment: Yes, it would have some new to update for one's site. However, the site should be visible and my university wouldn't keep the link to my web site (I use google site). So I am thinking of how to share new to other researchers.
Answer: I'm not sure I understand the question, but if you're concerned about keeping your work accessible after retirement, there are good options for doing so without having to actively maintain your own website.  Here are a few that come to me off the top of my head.

Zenodo
This is your one-stop-shop for archiving pretty much anything academics do or produce, including

Datasets
Publications
Posters
Presentations
Images
Video/Audio
Software
Lessons

I want to emphasize the datasets, because you really can upload very large datasets on there.  They've now partnered with Dryad, which is similar.  There's also Figshare, which is also similar, but I don't get the feeling that it's as sustainable as Zenodo.
It's also very good for archiving software.  I've linked it to my github account, so that every release of every package I maintain gets a permanent DOI, and is stored on Zenodo.

arXiv, bioRxiv
You can also post manuscripts or class notes here.  If it's a published paper, you'll need to check that your publisher will allow a copy to be posted.  In certain fields, these are actively used, and so would be more readily searchable than Zenodo.

Github, Gitlab, etc.
These are great ways to host code, and increase visibility.  It's not clear how long these will be around and hosting your code for free.  But for now, these are the de facto sources of open-source code.

Nowadays, people mostly just google for a person's name and some relevant keyword, which would readily take them to any of these sites.  If you want a personal site that's just a static page that links to all these things on other sites, that's reasonable, and such a low-cost easy-to-maintain option for your department that they'll generally just leave your site up by default.  But honestly, I've almost never gone to someone's site for anything like these things.
Comment: Thank you very much. These are very useful.


Current in an AC circuit with only an inductor

Question: In an AC circuit with only an inductor, we have a current that lags behind the EMF. So, at time 0 we have zero emf and max current. But in realty, how is this possible? How can we have a current without an EMF?
Comment: The only way you can have current without EMF is if all of your circuit elements are _superconductors_.   When we talk about circuit design, we often are talking about theoretical, _ideal_ components.  An ideal inductor and ideal wires have zero resistance.  Real, non-superconducting wires have resistance, and real, non-superconducting inductors can have substantial resistance.  You have to build that resistance in to your model if you want to accurately predict the behavior of the circuit.
Answer: This is equivalent to asking how can something have a velocity as it passes through the origin.
Because EMF is related to current through a derivative ($V = L \frac{dI}{dt}$ in circuits), it is possible for one to be zero and the other not since the derivative relating the two is nonzero.
Note that in a resistor, which has no time derivatives or integrals in its $I-V$ relation ($V=IR$), it is not possible to have a nonzero current with zero voltage/EMF, or vice-versa. However, because a derivative relates current and voltage in inductors (and capacitors) the value of current or voltage doesn't alter the other variable. However, the change of current or voltage WILL alter the other variable.
Answer:
How can we have a current without an emf?

In the absence of resistance, there can be electric current without an associated emf.  For example, a superconducting ring has zero resistance and can have a constant current circulating without any emf to 'drive' the current.
An ideal inductor has zero resistance and so there can be a constant inductor current without any emf.  If there is an emf, the inductor current must be changing with time.
In the AC (sinusoidal) case, note that when the inductor emf is (instantaneously) zero, the inductor current isn't (instantaneously) changing, i.e., the inductor current is either a maximum or minimum where the 1st time derivative vanishes.
Answer:
In an AC circuit with only an inductor, we have a current that lags behind the EMF.

This statement implies to me that the emf you are talking about is the emf of a voltage source connected to the inductor.
The variation of the emf (voltage) of the supply and the current are shown below with the voltage of the source being $90^{\circ}$ ahead of the current.

The inductance $L$ of inductor is defined as $L = \dfrac {\Phi}{I}$ where $\Phi$ is the magnetic flux linked with the inductor and $I$ is the current passing through the inductor.
If the flux thorough the inductor changes as a result of the current through the inductor changing Faraday says that there is an induced (back) emf, $\mathcal E_{\rm b}$, produced which is in opposition to the change producing it.
$\mathcal E_{\rm b}= - L \dfrac{dI}{dt}$
So if there is no change in current then there is no back emf which means that a steady (dc) current can flow through an inductor and no back emf is induced.
If an alternating voltage source is connected across an inductor the voltage source will try and change the current through the inductor and the inductor will oppose that change by inducing a (back) emf.
Now when the voltage of the source is momentarily zero it is not trying to change the current in the circuit and so momentarily the change in the current is zero and consequently the back emf produced by the inductor is zero.
This is your zero emf with a current flowing condition.
Note that if the graph is completed it shows that the back emf produced by the inductor is always equal and opposite to that of the voltage source and so the total emf in the circuit is always zero assuming an ideal circuit having no resistance or capacitance.

This is to be expected because over a quarter of a cycle the voltage source is delivering electrical energy and the inductor is storing it as its magnetic field increases and in the next quarter cycle the magnetic field of the inductor is getting smaller and the inductor is delivering electrical energy to the voltage source.
Overall the net energy dissipated as heat by the circuit is zero.


How do I get leather in Agrarian Skies?

Question: Leather is needed to spawn cows that would give me leather to spawn cows that would...
Answer: several options:

start fishing and breed Mariculture Cod to smelt in the crucible smeltery to give 11% chance of leather per fish
build a grass pasture and hope for cows. remember to account for biomes. you can build the pasture in a mushroom biome and shear the mooschrooms that spawn as well.
build a Bloodmagic alchemy set and use 3 rotten flesh, 1 flint and a bucket of water. for 3 leather
Head to the nether and kill imps for their skins. Not recommended due to difficulty of the nether in AS.
Comment: Along the same line as the mushroom biome bit, it might be worth mentioning that animals don't spawn in Ocean, Desert, Beach, or River biomes. Any other biome should be good.
Answer: For me personally the best solution was to go kill imps in the nether, they don't fight back and I believe 4 imp leather make 2 and they tend to drop 2-3 imp leather, so it's pretty easy to do.
Answer: Build a drying rack (3 wooden slabs in a line I believe) and hang rotten flesh from zombies there, after a while it will turn into Jerky for food. Do what the people above said.
Comment: actually it will turn into jerky

How do I get leather in Agrarian Skies?