How can a Word writer write a manuscript with a LaTeX writer?

Question: What software or tutorials are there that allow Word writers to write with LaTeX writers without Word writers having to learn LaTeX
Comment: If the document has to 'work' in Word, use Word: the LaTeX user will just have to get on with it.
Comment: The `LaTeX` author should find a more talented coauthor. ;-)
Comment: Welcome. Word writers don't have to do anything, but then somebody else will have to do the LaTeX work. Adds quite a tension to collaborative work. Better all use the same program, hich one is a group decision.
Comment: [LaTeX for complete novices](http://www.dickimaw-books.com/latex/novices/index.html)
Comment: If the issue is that one co-author doesn't wish to learn LaTeX, then perhaps Lyx (https://www.lyx.org/) could be a usfeul compromise?
Comment: We've discussed this a few timesbefore; searching on "[msword]" may prove instructive, also at academia.se.
Comment: @BenK-G I strongly suspect that the co-author in question doesn't want to learn new software just to humour someone junior to them.
Answer: Apparently I've only said this in comments and never as an answer, so despite flagging as a duplicate, here's what's worked for me
I'm assuming here that there's a decent reason for the final version to use LaTeX, and that the Word-using co-author (a) is sufficiently important that you can't say "tough luck, we're doing it my way", and (b) needs to edit and not just comment on the paper.
Maintaining a Word file with LaTeX commands (\ref{} and \cite{} are probably the most important) has worked well for me in the past.  Images can be imported into Word, even equations can be compiled using standalone and pasted in from a parallel LaTeX document.  The body text can be converted using something like pandoc, which can deal with ordinary text quite happily including things like font formatting - though I suggest running it over a stripped down copy of your file. Word's "track changes" feature is useful and requires only switching on, not learning.
Comment: +1 This is a good suggestion although it will mainly work best for documents that don't depend too much on the LaTeX markup for substantial parts of the formatting. In my own field, (linguistics) for example, this won't really work since all the linguistic examples depend on markup and it would be impractical to insert each one as a standalone image. Of course you can leave that markup in but non-LaTeX users' tolerance for markup in their Word documents tends to be low.
Comment: @Alan that's true assuming that pandoc (et al.) can't handle the markup in word format. I suspect that's a good assumption. For going the other way I found custom word macros helpful, but I've had whole jobs writing ms office macros.
Answer: I had the same question before too. Some of my colleagues were much more fluent in LaTeX than I was so we tried AUTHOREA. They wrote in LaTeX and I wrote in WYSIWYG. It is web-based, like Google Docs, and you can live-collaborate with others. Offline functions are limited though. Still, it's my favorite research writing tool, you should give it a try.


Webview browser in Kindle Fire

Question: Is the webview browser used in Kindle Fire the same as in ordinary Android webview? If not, what are the differences? Specifically, I'm interested in performance issues or quirks you have to be aware of when adapting web apps for Kindle Fire. Amazon won't send any Kindle Fires to Sweden, so I can't test it myself - yet.
Comment: Don't they have an emulator in the SDK? So That you can do your tests...
Comment: Maybe here you can find more info https://developer.amazon.com/sdk/fire/emulator-guide.html
Comment: Sure, I will try the emulator, but I don't trust emulators 100%, especially not for performance issues.
Comment: Yes usually Android emulators are just super-slow, so not to be trusted when it comes to measure performance.
Answer: Although Kindle Fire uses Amazon Silk as its web browser for normal web browsing, the WebView control on Kindle Fire is the regular WebView control on generic android.
In fact, the UserAgent strings on a Kindle Fire 7" HD device, Kindle Fire 7" HD emulator and a generic Android device (all running Android 4.0.3) should all match and read:

Mozilla/5.0 (Linux; U; Android 4.0.3; LOCALE; MODEL) AppleWebKit/534.30 (KHTML, Like Gecko) Version/4.0 Safari/534.30

LOCALE and MODEL will vary for different devices and user settings. The different device ids should correspond to the android.os.Build.MODEL android system property; The list for Kindle Fire model ids can be found here: https://developer.amazon.com/sdk/fire/specifications.html
So there should be no difference in that regard between testing your app on a Kindle Fire device and the Kindle Fire emulator.
Comment: Do you know if javascript alert() and console.log() work in the webview?
Answer: There does seem to be a difference in the way the Kindle Fire and iPad Kindle app handle websites accessed through apps versus through links in ebooks. On the iPad Kindle reader, links in Kindle books all go through webkit. The browser address line and other typical browser functions are absent. On a Kindle Fire, websites accessed through apps use webview--no browser URL address window, etc. However, links in ebooks appear to activate Silk, the default browser. You get the full browser experience: URL,etc. Not sure if there is a way to change that. I prefer the webkit/webview method, which gives more continuity with the ebook. It's also easier to get back to the book, whereas with Silk on the KF, you must find the back button.

Webview browser in Kindle Fire


Why does a vortex last so long?

Question: Yesterday I saw vortex shed from a kayak paddle around 40 yards behind the person paddling so it had been rotating for over a minute.  Why isn't the energy in this vortex dissipated quickly, e.g. why does it remain so long?
Comment: As an interesting aside, when doing modeling of fluid flows, some methods leverage the fact that vortexes are so long lasting and predictable.  They detect them, "pull them out" of the underlying grid, and treat them as an entity, with a fixed amount of "vortex energy" which is dissipated over time due to viscosity, or through interaction with another vortex.
Comment: @CortAmmon I'm interested in reading more about those methods -- do you recall the name so I can pull up some papers?
Comment: Seems to me I left a comment, but it's not here now.
Answer: The smaller the fluid's viscosity, the longer the vortex will last.
Viscosity is a measure of friction effects within a fluid. As with other forms of friction, viscosity transfers energy from macroscopic motion into complicated microscopic molecular motion (thermal energy). Intuitively, this gradual transfer of energy from visible macroscopic motion into invisible thermal energy should eventually cause a vortex to dissipate.
(By the way, an ideal superfluid has zero viscosity. In an ideal superfluid, a vortex can last forever.)
The rest of this answer is an attempt to deduce a quantitative estimate of how long a vortex can last, using a simple model that treats water as an incompressible fluid. Disclaimer: I'm not an expert in fluid mechanics! To write this answer, I had to review some of the basics. For the general theory, I used these sources:

Chapter 14 ("Vorticity") in the 2012-2013 version of Blandford and Thorne, Applications of Classical Physics, http://www.pmaweb.caltech.edu/Courses/ph136/yr2012
"Proof of Kelvin's Theorem," http://web.mit.edu/fluids-modules/www/potential_flows/LecturesHTML/lec07/kelvintheoproof/kelvintheoproof.html

For numerical info about the viscosity of water, I used these sources:

Page 6 in https://resources.saylor.org/wwwresources/archived/site/wp-content/uploads/2011/04/Viscosity.pdf
https://www.engineeringtoolbox.com/water-dynamic-kinematic-viscosity-d_596.html

 The key equation
Let $\mathbf{u}$ denote the velocity of the fluid. This varies with the location $\mathbf{x}$ in the fluid, and it may change with time $t$. Let $C$ be any closed loop in the fluid, and consider the integral of $\mathbf{u}$ around the loop:
$$
 \Gamma = \int_C d\mathbf{x}\cdot \mathbf{u}.
\tag{1}
$$
The quantity $\Gamma$ is called the circulation around $C$. It is non-zero only if there is a net circulation (in the colloquial sense) of fluid around the loop. In particular, it is non-zero if we take $C$ to be a small circle centered on a vortex. The goal is to understand why $\Gamma$ might remain essentially constant for a long time, and what eventually causes it to dwindle to zero.
To answer this, we need an equation that describes the time-dependence of the velocity field $\mathbf{u}$. Assuming that the fluid is incompressible (which is a good enough approximation for this question), we can use the Navier–Stokes equation
$$
 \frac{d \mathbf{u}}{d t}
   = \nu\nabla^2 \mathbf{u} -\nabla h
\tag{2}
$$
where
$$
 \frac{d \mathbf{u}}{d t}
 :=
 \frac{\partial \mathbf{u}}{\partial t}
  +(\mathbf{u}\cdot\nabla)\mathbf{u}
\tag{3}
$$
is the convective derivative of $\mathbf{u}$, which says how quickly the velocity $\mathbf{u}$ changes in time at a point that moves with the fluid. The coefficient $\nu$ is the kinematic viscosity of the fluid, and the $\nabla h$ term accounts for gravity. To relate (2) to (1), take the integral of (2) around the contour $C$. The integral of the $\nabla h$ term around a closed contour is zero because the integrand is a gradient, so we are left with
$$
 \frac{d }{d t}\Gamma
   = \nu\int_C d\mathbf{x}\cdot (\nabla^2 \mathbf{u}).
\tag{4}
$$
This is a special case of Kelvin's theorem. Equation (4) is what we want: it tells us how the circulation $\Gamma$ changes with time, with the understanding that the contour $C$ moves with the fluid. This last qualification is important, because it says that if we take $C$ to be a loop around the center of the vortex, then $C$ remains centered on the vortex as the vortex is carried along by whatever overall current might be present.
 Viscosity and stability
The intuition mentioned at the top of this answer is consistent with equation (4), which says that if the viscosity $\nu$ were zero, then $\Gamma$ would remain constant in time (insofar as the other approximations implicit in equation (2) are valid). In other words, if the viscosity were zero, a vortex could last forever.
 Determining the relative sign
The viscosity term in (4) should cause the strength of the vortex to decrease with time, so the sign of the viscosity term should be the opposite of the sign of $\Gamma$. Let's check this using a simple model of the velocity field around a vortex. Outside the core of the vortex, suppose that the velocity field has the form
$$
 u_j = \frac{\sum_k\Omega_{jk} x_k}{\mathbf{x}^2}
\tag{5}
$$
for some antisymmetric matrix $\Omega_{jk}$, where $u_j$ is the $j$th component of $\mathbf{u}$. The model (5) ensures that the velocity is tangent to the radius from the center (as appropriate for a vortex), and it also ensures that the velocity increases toward the center. Equation (5) implies
$$
 \nabla^2 u_j = -2D\frac{u_j}{\mathbf{x}^2}
\tag{6}
$$
where $D=3$ is the number of dimensions of space. (Usually $D=3$, but sometimes pretending $D=2$ is useful for building intuition.) The minus sign in equation (6) confirms that the relative signs in equation (4) are correct: the strength of the vortex will decrease with time, as expected.
 Rough numerical estimate
Now that we have the key equation (4), let's plug in some numbers. Under ordinary conditions, the kinematic viscosity of water is roughly
$$
 \nu \approx 10^{-6} \ \frac{\text{m}^2}{\text{s}}.
\tag{7}
$$
Getting numbers for the other quantities in equation (4) will involve some guesswork, because we don't have any measurements of the vortex that was observed. Take the loop $C$ to be a circle around the vortex with a radius of $10$ centimeters, and suppose that at that radius, the water is circulating at a rate of $5$ cycles per second. (I'm just guessing.) Since we're only estimating, we can say it like this: $\Delta r\sim 10$ cm is the typical spatial scale of the vortex, and $\Delta t\sim 1/5$ second is the typical time scale.
The quantity $\Gamma$ is the circumference $|C|$ of the circle times the velocity of the water at that radius (I mean the component of the velocity tangent to the circle), so we can think of $d\Gamma/dt$ as $|C|$ times the rate at which the water's velocity is changing. Since we're just estimating, we can use the model (5) to get
$$
 \int_C d\mathbf{x}\cdot (\nabla^2 \mathbf{u})
  \sim -\frac{12\pi}{\Delta t}.
\tag{8}
$$
Using these numbers in equation (4) gives the estimate
$$
 |C|\frac{d }{d t}|\mathbf{u}|
  \sim -60\pi \times 10^{-6} \ \frac{\text{m}^2}{\text{s}^2}.
\tag{9}
$$
Divide both sides by $|C|\sim 2\pi \Delta r\sim 0.5$ meter to get
$$
 \frac{d }{d t}|\mathbf{u}|
  \sim -120\pi\times  10^{-6} \ \frac{\text{m}}{\text{s}^2}
  \sim
  -2\ \frac{\text{cm/s}}{\text{minute}}.
\tag{10}
$$
This estimate says that the circulation decreases slowly, loosing only a couple of centimeters-per-second of speed every minute.
(We could improve this estimate by going back to the original equations to see that the curve $C$, which is carried along with the fluid, can grow with time. In other words, the vortex can expand, which we perceive visually as the vortex weakening and disappearing into the noise of the ambient waves.)
This is only a rough estimate, and I'm not an expert in fluid mechanics, but it seems to confirm that a well-formed vortex can last a surprisingly long time in open water.
Comment: Great stuff...thx for your response

Why does a vortex last so long?


How do I know how many SCVs I have created?

Question: In Starcraft 2, how do I easily know how many SCVs I have created while playing? All I see total population on top right side of game.
Answer: It is now possible to see how many workers you have created thanks to an update in 2018.
You just need to hover your cursor of your total army supply number in the top right of your screen.
When you hover over a detailed breakdown will be visible allowing you to see how many of the total supply is made up by workers specifically.
Answer: See another answer for an update.
There was no way to see how many SCVs you have created in a given match back in 2015. What you could see is:

Total supply of your units, including workers - top right of the screen.
Number of workers currently returning resources to a given Command Center - shown on top of Command Center.
Number of your idle workers, not currently harvesting or building anything - on top of the minimap. You can also select those with F1.

Now, you never told why do you need to know this. If you need to know if you have enough workers and should cut their production, a rule of thumb is to have 2 to 3 saturated bases. Terrans, thanks to MULEs, can get away with closer to 2. Just pick a rule - say, 2 saturated bases and some activity to grab the third - and go ahead. You'll see your mistakes later when you analyse your replays.


I can't paint the texture

Question: I can't paint the texture.
Although I can't draw, I can fill it all at once with fill icon.
I have no idea what that means.
I do not understand the relationship between the property panel on the right and the paint screen on the left.
Comment: Thank you for your(R-800) advice!
It worked!
It's difficult for me to understand the relations between the  MATERIAL and TEXTURE. But I have to practice every minutes.
Thank you for your corporations!
Answer: While in Texture Paint mode, with the Active Tool tab open (this is the case in your image), look under the Texture Slot Section for Mode. There are two options. Material and Single Image. Your pic shows Material selected currently. Try Single Image.

Some other links on this topic that might help:
What does this step do in Texture Paint?
No painting strokes showing when Texture painting

I can't paint the texture


How can the man in the back see?

Question: In the back of this screenshot from Naruto episode 80 (during the Third Hokage's funeral), circled, is a man with his face entirely covered by bandages. Is it known how he can see?
Comment: You may want to mention which episode this is from to provide some context.
Comment: He is more than likely a sensory nin, he uses his chakra to "feel" his surroundings
Answer: That ninja was shown, earlier, in the Chunin-exam.

Because he takes care that nobody cheats in the exam, he must have an ability to sense things without using his eyes. It's most likely a special jutsu or Kekkai Genkai.

How can the man in the back see?


Ubuntu 14.04 Install alongside Windows

Question: Okay, I was wondering what file Ubuntu sees in windows to know to do the option of install alongside windows? For some reason, when you update Windows 7 to Windows 10. Ubuntu still sees Windows 7 as the alongside install. But, when you do a clean install of 10. Ubuntu does not see Windows 10 at all. I want to do a clean install of Windows 10 and Ubuntu 14.04, but would like to drop the file it sees on C: Drive after windows install before I install Ubuntu. So, what file do I need to pluck from Windows now and move to the clean install to do this?
Answer: You just need to update grub so it will show windows 10 in its boot menu
open up a terminal by pressing ctrl + alt + t
Type in

sudo update-grub

I Haven't done a dual boot with Windows 10 yet but thats how its done with all other Operating systems i know about.
Comment: So, run Ubuntu off the flash drive or cd open terminal and run the grub update? Then it will see Windows 10 on the install? If you talking about updating the grub now? I have already done that with grub customizer. I want to do a clean install, because Windows 10 is giving me problems. Microsoft suggested I do a clean install, something about MBR needed to be 500mbs instead of 100mbs.
Comment: Are you saying its windows 10 it not coming up when your going though the install process.
Comment: Yes, I want to do my computer. But, I discovered this working on friends laptop. Ubuntu will not see Windows 10 and if choose the option (Do something else). It won't do the partitions on the unpartitioned space for the Ubuntu install. When I installed windows in the past. I would set the Windows partition in the Windows install and leave a unpartitioned space for Ubuntu. Ubuntu saw the space and Windows for the install.
Comment: I guess what I'm saying is, I want to trick Ubuntu into thinking its installing alongside Windows 7 and then I will do the grub update or just change it with grub customizer. I have read a lot of threads and there is really no fix for this yet, but if there is a way to trick Ubuntu. Then we might have something.
Comment: Flow thought this video  i know is says Manually Setup A Ubuntu-Windows 7 Dual Boot  but it will work with any version of Windows https://www.youtube.com/watch?v=0W7XYAB4cLc Skip to 9 mints if you have done partitioning
Comment: Thank You, I never really knew how to setup partitions in Ubuntu. This is perfect, I will do this this weekend and let you know how it went. Thanks again.

Ubuntu 14.04 Install alongside Windows


power factor correction and switched power supply efficiency

Question: When it comes to switched power supplies, is the power supply efficiency affected by the presence of a power factor correction circuit? In my understanding power supply efficiency is estimated by measuring the ratio of power drawn from the electrical outlet when the power supply works under several loads, for instance 20,50 and 100% loads are analyzed in computer PSUs to give the 80 plus certificate, but is the presence of a power factor correction (PFC) circuit improving the efficiency? Do they take under account the reactive power drawn from the outlet to estimate the ratio to compute the efficiency or just real part and then the PFC circuit has no influence?
Comment: In my opinion they only take real power into account
Answer: In the field of engineering, efficiency means thermodynamic efficiency, real output power divided by real input power. A power factor correction circuit reduces the efficiency of the equipment that contains the circuit but improves the overall system efficiency by reducing the RMS current required to transmit a given amount of real power.
In the case of switched power supplies, the power factor correction circuit improves the total power factor by reducing the harmonic distortion of the input power waveform. The benefit is partly reducing the current required, but perhaps more importantly, preventing the power supply from contributing to distortion of the voltage of the source power system.
Comment: What do you mean by "reduces the efficiency of the equipment", that after introducing the PFC circuit the amout of real power consumed is higher? How is this related to the efficiency when working under several loads, i.e the efficiency of the switched power supply? From what you're saying can I imply that it decreases as now the denominator of the efficiency ratio is higher?
Comment: Some power is lost (converted to heat) in the power factor correction circuit. That means that the total input power to the power supply is increased by the addition of power factor correction. Power losses are reduced in the power distribution wires, transformers etc. all the way to the power generating station. The user of the power supply gains mostly a "cleaner" AC source and lower AC circuit current allowing.
Comment: Thanks, I understand what PFC is. My question is, how it is related to the switched power supply efficiency?
Comment: And I'm talking about this efficiency [http://www.hardwaresecrets.com/understanding-the-80-plus-certification/](http://www.hardwaresecrets.com/understanding-the-80-plus-certification/)
Comment: I understand. That is the efficiency of the power supply. Adding a PFC circuit inside the power supply adds to the losses inside the power supply and reduces its efficiency. In a SMPS, the PFC is not simply a capacitor, but even if it was it would use some power because it has internal resistance it is not an "ideal" capacitor.


VBA ontime cancel scheduling

Question: I have written a macro that runs at 15:30pm every workday when a workbook is first opened.
When the workbook is closed it tries to open itself the next time the macro is scheduled to run. I have tried to turn the scheduler to false and am getting an error. Code below.
Has anyone any ideas why this isn't working?
Private Sub Workbook_Open()
    Application.OnTime TimeValue("15:30:00"), "MacroTimeTest"
End Sub

public dtime as date

Sub MacroTimeTest()

    dtime = (Format(Application.Evaluate("workday(today(), 1)"), "DD/MM/YY") & " " & TimeValue("15:30:00"))

    'other code has been deleted doesn't affect dtime variable
End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)

    'I have tried replacing false with 0 etc but it didn't make a difference
    Application.OnTime earliesttime:=dtime, procedure:="MacroTimeTest", schedule:=False

End Sub

Comment: You need to let people know what the error was!
Comment: I'm guessing it would be `Method OnTime of object _application' failed`. But the OP should edit their question to confirm.
Comment: Yes, I apologise for not putting enough detail, thanks for the tips. Will be useful when I have to ask more questions, also thanks to Raj for formatting the code
Answer: I think that you should keep a reference to the time so that you can cancel the action. You can only cancel an action if it hasn't already executed.
In ThisWorkbook enter the following to run the macro at 15:59 until the sheet is closed
Option Explicit

Private Sub Workbook_BeforeClose(Cancel As Boolean)

    On Error GoTo CouldNotCancel

    Application.OnTime dTime, "MacroTimeTest", , False
    Debug.Print "Cancelled task to run at " & dTime

    Debug.Print "Workbook close"

    Exit Sub

CouldNotCancel:
    Debug.Print "No task to cancel"

End Sub

Private Sub Workbook_Open()
    Debug.Print "Workbook open"

    dTime = TimeValue("15:59:00")

    Debug.Print "Next run time " & dTime
    Application.OnTime dTime, "MacroTimeTest"

End Sub

Then add your macro to a Module
Option Explicit
Public dTime As Date
Public Sub MacroTimeTest()

    'schedule next run
    dTime = TimeValue("15:59:00")

    'schedule next run
    Debug.Print "Scheduling next run at " & dTime

    Application.OnTime dTime, "MacroTimeTest"

    Debug.Print "Running macro"

End Sub

This way the same value of dTime will be used to cancel the scheduled task as was used to create it.
If no further task has been scheduled i.e. by an error in MacroTimeTest then the Workbook close event will handle the error.
To see the debug output look at the immediate window in the VBA Editor (Ctrl+G)

VBA ontime cancel scheduling


Understand this Kmer plot from Merqury?

Question: The attached figure is generated based on Illumina reads from multiple individuals compared to genome assembly. Looks like there are a lot of kmers are reads only (grey colored). Also, a blue peak (2x kmers), does it represents high heterozygosity? GenomeScope gives 1.5% of heterozygosity result. But it seems the blue peak normally should be near the 70x on the x-axis. Thanks.
Answer: Assuming a diploid genome, usually, we aim to build a monoploid reference, representing a single haplotype.
Practically speaking, we need to include only one of the two k-mers that are representing heterozygous sites, however, we would desire all the homozygous k-mers to be included exactly once.
Looking at your plot, I would guess 1n coverage is somewhere around 18x, and 2n about 36x. If that's right, your plot is suggesting that your assembly contains lots of uncollapsed haplotypes, which is quite understandable given very high heterozygosity you estimated with genomescope. This is also supported by many homozygous k-mers are there twice (the blue bump). These are probably regions in between heterozygous sites, or flanking them.
Anyway, I would recommend something like purge haplotigs to collapse haplotypes into single monoploid reference and redo the plot. The blue bump should disappear and the black and red distributions should have about the same height around 18x, while nearly all the 36x k-mers should be red (once).
Also, if the interpretation of the plot still would not be clear, you can check this part of a lecture by Lucía Campos-Dominguez on the topic (it's a different software called KAT she talks about, but it is using the same principle as Mercury).
Comment: Hi Kamil, thank you for your informative reply. You are exactly right about the 1n = 18, although not sure how you get that so accurate ;-). I do have another Merqury kmer plot with a very low blue peak near the 4n location rather than the 2n location, while the red peak at the same 2n. And this happens for another species genome assembly. Is that normal? Because that makes the blue peak at 2n look weired.
Comment: I will post another question. Thank you!

Understand this Kmer plot from Merqury?


How to create performance point service reports or (BI) from a sharepoint list as datasource?

Question: I need to create a report using performance point service or BI. While creating the datasource it should be from a sharepoint list and same datasource i need to use to create the report. Any suggestions?
Comment: The suite of BI tools available through sharepoint provide multiple ways to expose and manipulate data. The best solution will depend on data complexity, data sources and UI functionality.
Comment: For example, you can create a simple PowerPivot spreadsheet to use (assuming PP is configured).
Answer: if you mean, you want to develop cube for BI datasource..
i think you need to do ETL first (using SQL Server Integration services) from SharePoint list to SQL server regular table,
then you can develop cube with sql server as datasource..
IMHO, you might consider change you app datasource from sharepoint list to regular sql server table, for performance wise


Is there any intuitive explanation as to why is entropy is a state function?

Question: In my textbook there is a proof that entropy is a state function but there is no intuition given there.
What is the intuition behind entropy(∫dQ/T) being a state function.
Why would we have suspected that entropy will be a state function in the  first place?
Comment: May be duplicate of https://physics.stackexchange.com/q/319235/
Comment: @Sam That question is regarding a specific example and mine is regarding the intuition behind entropy being a state function.
Comment: But the answers there are relevant to your question too.
Comment: this may help https://physics.stackexchange.com/questions/131170/what-is-entropy-really/131189#131189
Comment: What are you taking as your definition of entropy? $\int dQ/T$, or the statistical definition?
Comment: the former one, i.e  ∫dQ/T
Comment: What proof was given? Perhaps a good answer here could frame the intuition around the proof? Also, which book, page, etc.?
Comment: @AaronStevens the name of the book is "Physics" by Resnick,Haliday,Krane.Page 547.The proof was writing the first law of thermodynamics in differential form and
integrating to get the difference in entropy.
Comment: Perhaps your question(s) could be a bit clearer. For the intuition, the proof and text seem to address this. We can express the differential in terms of state variables and arrive at $\Delta S$ without specifying a specific path. So it makes sense that $\Delta S$ is a state variable. Your second question is a bit vague, and I am not sure about how you would get a subjective answer. I don't think the point is that we would suspect entropy to be (or not to be) a state function, but it is nice that it turns out to be one (and why it has stuck around). What more specifically are you looking for?
Answer: Entropy is proportional to the number of microstates available to a system, $S=k_Bln\Omega$. The number of microstates is determined by the number of particles (of course) and the number of energy levels available to these particles. The number of available energy levels is determined by quantities like temperature, which is also influenced by pressure and other thermodynamic parameters.
Intuitively, you can think of the number of accessible energy states by particles in a system being influenced by the state of the system (e.g. temperature and pressure). Therefore $\Omega=\Omega(N,P,T,...)$ is a state function. Now, since $S=k_Bln\Omega$, entropy is also a state function.
EDIT: I've given some intuition behind the statistical mechanical definition of entropy being a state function, but what about the thermodynamic definition?
We know that the entropy transferred to a system undergoing a reversible cycle is zero, and if you have intuition behind this, then you have intuition behind why entropy is a state function. In fact, the Clausius statement of the 2nd law says this:
$$ \oint\frac{\delta Q_{rev}}{T} = 0$$
where $\delta Q_{rev}$ is a tiny increment of reversible heat flow in a reversible process (i.e., no entropy generation).
We have expected that this statement is true in general because it was shown to be true for simple cases like ideal gases. Why not assume it's true for all reversible cases?
Anyways, you can visualize this statement like this (probably in your textbook):

Consider only the blue paths for now, these represent any general process between states 1 and 2. At a given pressure, state 1 is defined by $(T_1, s_1)$. We reversibly transfer heat (entropy) to the system, and arrive at state 2 defined by $(T_2,s_2)$ along the blue path. The amount of entropy we transferred is $\left(\int_1^2\frac{\delta Q_{rev}}{T}\right)_{1}$, where the subscript $1$ declares that this is path Number 1. Now to get back to state 1, go along the blue path again. we must remove entropy from the system, an amount equal to $\left(\int_2^1\frac{\delta Q_{rev}}{T}\right)_2$, again the subscript says I'm calling this path Number 2. The Clausius statement says
$$ \left(\int_1^2\frac{\delta Q_{rev}}{T}\right)_1 - \left(\int_2^1\frac{\delta Q_{rev}}{T}\right)_2 = 0$$
Which obviously says
$$ \left(\int_1^2\frac{\delta Q_{rev}}{T}\right)_1 = \left(\int_2^1\frac{\delta Q_{rev}}{T}\right)_2$$
Now consider the grey paths. By a similar argument, you can see that
$$ \left(\int_1^2\frac{\delta Q_{rev}}{T}\right)_1 = \left(\int_1^2\frac{\delta Q_{rev}}{T}\right)_3 = \left(\int_1^2\frac{\delta Q_{rev}}{T}\right)_4 = \left(\int_2^1\frac{\delta Q_{rev}}{T}\right)_2$$
So, paths 1, 3, and 4 all take you to from state $(T_1,s_1)$ to state $(T_2,s_2)$.
This says that $\int_1^2\frac{\delta Q_{rev}}{T}$ is the same regardless of what path you state to get from 1 to 2. In other words, there are infinitely many ways to add heat (entropy) to your system, and arrive at state 2. This is why entropy is a state function - its value does not depend on the processes required to reach that value.
You can intuitively realize this by the following thought experiment: consider a crystal of atoms, which are vibrating at room temperature. Call this "state 1".

How can I increase the amount of messiness (disorder, entropy, etc.) in this system (i.e., bring it to state 2 on the $T-s$ diagram below)? Well, one way is to perform a process that adds heat (entropy) at constant volume, to increase its temperature. So the atoms now look like this:

You can easily see that this system has higher entropy, it's more messy and disordered (vibrational entropy is a type of entropy).
I added heat at constant volume, and the $T-s$ diagram for this process looks like the blue path here:

But you can see, according to our investigation of the Clausius theorem, that all the grey processes (they might not be constant volume) would take us to the same high temperature state. In other words, there are infinitely many ways to go from a system with low entropy (less jiggling of atoms) to high entropy (more jiggling of atoms) and vice versa.
Note the connection to the statistical mechanical definition of entropy, $S=k_Bln\Omega$. A higher entropy system, obtained by somehow adding more entropy, is simply messier (e.g., those vibrating atoms), and has more microscopic configurations it can access. The number of possible microscopic configurations is of course determined by things like temperature/pressure, not how you reached that particular temperature/pressure.
That is why entropy is a state function - its a quantity that only depends on the state of a system, not how you got to that state.
Comment: @AndrewSteane Agreed. Hopefully the new explanation clears this up and makes the connection.
Comment: The essence of this is, I think, to prove Clausius' theorem rather than to quote it.
Comment: @AndrewSteane yes, lots of proofs are everywhere (e.g. Wikipedia), but none answer the question *intuitively* of why entropy is a state function. I guess an intuitive proof of the Clausius statement would answer the question.
Comment: This is one of the most beautiful answers I've read. Thank you.
Answer: If your textbook is trying to derive entropy by any sort of simple integral then it has only shown a proof of very limited applicability, for example to systems with a two-dimensional state space. There are subtleties here. Any "proof" which assumes that a reversible process without heat exchange moves the system along a region of reduced dimension in state space (i.e. does not access the whole state space) has in fact already assumed that entropy is a state function, so is not a derivation or a proof.
To prove that $dQ_{\rm rev}/T$ is a change in a function of state, one can use the argument behind Clausius' theorem. This involves taking a system around a general cycle, using a reversible heat engine to supply and extract whatever heat may be required. The proof is presented in the textbook by Adkins for example, and also in my own book.  One can then give a name to this state function, and the agreed name is entropy.
A related approach is to prove from the Kelvin statement of the 2nd law that processes that are reversible and without exchange of heat cannot access the whole state space, but only a "surface" (i.e. region of dimension one less than the total) in state space.
Answer:
Clausius theorem states that,
(1.1)  For any cyclic process $\text{P}$, we have
$$\oint_{\text{Process P}} \frac{\delta Q}{T}\leq0 \tag{1}$$
(1.2) The equality holds when the cyclic process is reversible.
Let's say there are two states, $\text{A}$ and $\text{B}$, that can be connected by at least one reversible process. Then, Statement (1.2) implies $(2)$.
$$\int_{\text{A | Reversible process P$_r$}}^{\text{B}} \frac{\delta Q}{T} \text{ is independent of the reversible process P$_r$ connecting the two states.} \tag{2}$$
The proof is as follows:
Let $\text{P}_{r1}$ and $\text{P}_{r2}$ be two arbitrary reversible processes that connect state $\text{A}$ to $\text{B}$ and let $\text{P'}_{r2}$ be the reverse of  $\text{P}_{r2}$ (connects state $\text{B}$ to  state $\text{A}$).
$$\stackrel{\text{Statement (1.2)}}\Rightarrow \int_{\text{A | Process P$_{r1}$}}^\text{B}  \frac{\delta Q}{T} + \int_{\text{B | Process P'$_{r2}$}}^\text{A}  \frac{\delta Q}{T}=0$$
$$ \int_{\text{A | Process P$_{r1}$}}^\text{B}  \frac{\delta Q}{T} = - \int_{\text{B | Process P'$_{r2}$}}^\text{A}  \frac{\delta Q}{T} $$
$$\int_{\text{A | Process P$_{r1}$}}^\text{B}  \frac{\delta Q}{T} = \int_{\text{A | Process P$_{r2}$}}^\text{B}  \frac{\delta Q}{T} \tag{3}$$
Now, we can pick a reference state $\text{O}$ and define a state function $S$ as follows:
$$S(\text{A}):=\int_{\text{O | any reversible process connecting O to A}}^A \frac{\delta Q}{T} \tag{4}$$
This is a state function because once we pick a reference state $\text{O}$ (for which we assign $S(\text{O})=0$), we can determine the entropy of any state $\text{A}$ that can be connected to state $\text{O}$ by a reversible process1.

If we closely follow this line of reasoning, we observe that it is Clausius theorem (Second law of thermodynamics) that guarantees that the integral in $(4)$ depends only on the final state $\text{A}$, and not on the reversible process connecting $\text{O}$ to $\text{A}$. That's what makes the integral a state function.

Why would we have suspected that entropy will be a state function in the first place?

To summarize, it is Clausius theorem (through statement $(2)$) that prompted us to identify the integral in $(4)$ as a state function, which was subsequently named "Entropy."
A Related Remark
What I've shown you is nothing new for we have already identified a well-known state function in a similar manner. The First law of thermodynamics states $(5)$.
$$\int_{\text{A | Process P}}^{\text{B}} (\delta Q - \delta W) \text{ is independent of the process $P$ connecting the states A and B.} \tag{5}$$
And this led us to define a state function called the "Internal Energy" in the following manner (again, taking a reference state $\text{O}$):
$$U(A):=\int_{\text{O | any thermodynamic process connecting O to A}}^{\text{A}} (\delta Q - \delta W) \tag{6}$$
To hit the nail one last time, it is the First law of thermodynamics that guarantees that the integral in $(6)$ depends only on the state $A$, and not on the process connecting state $\text{O}$ to state $\text{P}$.
References: Statistical Mechanics, Kerson Huang : Page 16 in particular.

1 With the emphasis comes the caveat: It is not necessary for all the possible thermodynamic states of a given system to be connected to the reference state $\text{O}$ by a reversible process. This subtlety is discussed in a bit more detail in a footnote in Kerson Huang's book in page 16.
Answer: Entropy change is given by $\int{dq/T}$ only for a reversible path.  It is easy to show that, for an ideal gas, all reversible paths between two end states lead to the exact same analytic expression for the integral.  This led early researchers such as Clausius to realize that the concept could probably be extrapolated to all materials.  History has shown that this was correct.
Answer: The most basic underlying idea is that heat flows from hotter to coolest bodies. The first approximation of entropy is:
$$\Delta S_{app} = \frac{q}{T_{av}}$$
where $q$ is the heat flow and $T_{av}$ is the average temperature between bodies.
The approximation improves if the process is composed by many steps, each one with a smaller temperature difference between bodies:
$$\Delta S_{app} = \frac{q_1}{T_{1av}} + \frac{q_2}{T_{2av}} + ... + \frac{q_N}{T_{Nav}} $$
$\Delta S$ is the sum of the series as $N->\infty$.
According to this definition, $\Delta S$ doesn't depends on the path, so it is a function of state.
Comment: You have not shown that the $\Delta S$ so defined doesn't depend on the path.
Comment: The definition defines the path to calculate $\Delta S$. That makes it independent of it.


In what circumstances, can exchange interaction acquire temperature dependence?

Question: Heisenberg exchange interaction (sometimes called as magnetic stiffness?), originating from the Coulomb interaction and the Fermion statistics, is widely used in theories of magnetism. Conventionally, we don't consider its temperature dependence. I was just wondering if we could find any mechanism to incorporate the temperature effect.
Comment: @Wildcat Exchange interaction arises from an interplay of Coulomb interaction and fermion statistics in some situations, such as in [ferromagnetic](https://en.wikipedia.org/wiki/Ferromagnetism#Origin_of_magnetism) materials.
Comment: Hmmm... Where did you read that the exchange interaction originates from the Coulomb interaction?
Answer: I would say that "exchange interaction" is a loose term which does not make a proper definite answer to the question very easy. We can talk about Coulomb exchange, kinetic exchange, direct or double exchange etc... This being said, in all these mechanisms, the temperature dependence is driven by the statistics of the fermions, while the associated interactions (Coulomb interaction) or the Pauli exclusion principle, are temperature independent. For interesting insights into the intricacies of the exchange interactions, I would highly recommend the book chapter by Erik Koch, freely available here.


Which directories contain system files?

Question: When installing Ubuntu, I don't want to format the partition that is going to be /. Installation wizard prompts me that Directories containing system files (/etc, /lib, /usr, /var...) that already exist will be deleted. Can somebody list all of them? Does it include /home?
Comment: Why don't you want to format the root partition?  It is highly recommended when installing the OS and will prevent many possible issues.
Comment: I tried to reinstall Ubuntu and installation froze(and it  already had removed some files). And I had my /home in the same partition. I don't have anywhere to put my home folder as it is huge, so  just want to get my system to boot normally until I can fix this mess.
Answer: Most directories contain 'system files', except those in <code>/home/</code>.  However, since you say your home directory is on the same partition, you would lose that data if you were to proceed.
When installing Ubuntu, you are given the option of having one partition for all directories, or mounting different partitions for specific directories.
One setup may have /, /bin, /home, etc on one partition, while another setup may have /, /bin, etc on a partition, with /home on another partition.  The benefit of the second setup is that you can re-install linux root (/) without touching your home directory (/home).
However, since you have the first setup, in this situation, you would be deleting all of the data on that partition, which includes your home directory.
If you have a LiveCD, you can mount your drive and move any data onto another HDD.  When installing Ubuntu, be sure to use the second setup to prevent this in the future.  Another option would be to place your HDD into another Linux machine, mount the HDD, and pull off the data.
Example:
I have an SSD (/dev/sda) and HDD (/dev/sdb).  When I install Ubuntu, I select to create an ext4 partition on all of the SDD.  I also create an ext4 partition on the HDD.  I then tell Ubuntu to use the SSD as the root (/) partition, and tell it to use the HDD as the home (/home) partition.
Tomorrow I accidentally run a bad command that I will not place here (let's say I just removed all the files in /bin/).  I can then load up an Ubuntu CD, format the SSD (/dev/sda1) partition, point to my HDD for home (without formatting).  After it installs, I will be on a fresh Ubuntu install with all of my home data.
Comment: so, if I understand this correctly, even if I copy my home folder and temporarily place it in /, it will be deleted, because, well, it's in /, and / directory contains these "system files", so it gets wiped?
Comment: Exactly.  It's misleading you into thinking it will be selective of it's destruction.  It's going to destroy and re-create that partition, and all of it's contents.  Again, you can prevent this in the future by creating separate partitions for root (/) and home (/home).  *From then on* you would be able to destroy the root partition without losing your home data.

Which directories contain system files?


signpost_notificationd is flooding error log with błąd "0 is not a valid connection ID"

Question: I recently noticed that my error log is being literally flooded with "0 is not a valid connection ID" generated by signpost_notificationd process. The message is being logged few times per second.
How can I check what is causing this?
Comment: Are you seeing high CPU usage or other issues other than logging a lot of messages to the database?
Comment: It's difficult to tell. I do see kernel_task occupying 15-25% CPU basically most of the time. That's another issue I'm trying to crack :(
Answer: MacBookPro 2017 / MacBookPro14,3
I was getting this issue on reboot along with the high kernal_task usage. I went through the console killing of the noisiest processes and sure enough, signpost was one of them. Soon as I did, my kernal_task process dropped back to normal. It has been running at > 600%.
sudo ps aux | grep -E '^root.*signpost_notificationd' | awk '{system("sudo kill -9 " $2)}'

Answer: so this seems to be a bug in 10.13.3 or 4 - if you force-quit the signpost_notificationd process in Activity Monitor it will fix the issue until the next reboot. Note that since this is a system process, it will immediately restart, but it seems to fix the logging problem (and whatever the underlying issue is).
A lot of discussion about it here: https://discussions.apple.com/thread/8291112
Answer: This is part of signpost_reporter system which sends telemetry to Apple if you opt in to sharing crash reports and other diagnostic / usage information.
On the vast majority of our Macs - this error does get logged quite often and is harmless in that we get 0.0% CPU time even after the Macs are running for 20 to 40 days without a restart.
Unless you want to change your opt in for crash data or are seeing high CPU usage, you can probably safely ignore these errors and filter them out. Yes it's an "error" but it's not one that seems to be problematic for anyone using the system - just for processing them out of the console app or log files if you want to see other messages.
Comment: It's difficult to tell if it's affecting CPU. I do see kernel_task occupying 15-25% CPU basically most of the time. That's another issue I'm trying to crack :( but if those two are related then I'll be the first one to opt out from telemetry!
Answer: As a note for everyone interested or experiencing this issue - updating to 11.13.5 resolved the problem for me.  You can read through a long Apple forums thread here:  https://discussions.apple.com/thread/8291112?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa


Potential risks of a single codebase for multiple CMSes

Question: We are currently in the process of converting our multiple codebases (which are exactly the same, except for a configuration file and 2 stylesheets).
We have been thinking about this for a while, and the idea for now is to determine the domain the user is accessing and loading the stylesheets and configuration file depending on the domain.
For example:
User 'A' goes to the website 'www.my.example.com' and the configuration (which includes database, SMTP and other options) and the stylesheets get used. We determine everything depending on their domain.
So if user 'B' goes to the other CMS 'my.exampler.com' it will load the configuration and stylesheets for 'my.exampler.com' instead of 'my.example.com'.

Are there any security risks as to doing it this way? We currently do not know of any possible security risks which could occur. The configuration file is not accessible for users without having FTP or direct access to the server itself.
Is this a bad idea? Is there possibly a more secure way to do this? Or is this an acceptable way to create a single codebase for every CMS?
Comment: You mean single copy of source code for multiple websites? What about database, is there only one database? In case one website is breached, and all configuration is stolen, access to all databases is then granted to attacker.
Comment: @Aria Database related data is stored separately and passwords differ between each of them, we load a configuration file depending on the domain. So if a website gets breached, they only have access to the subfolder of that domain due to root restrictions
Comment: It seems you want something similar to wordpress multisite: https://codex.wordpress.org/Create_A_Network
Answer: In the abstract, serving multiple domains from a single codebase is far better than serving multiple domains from multiple codebases. Less code much better than more code.
That said, there are reasons NOT to do this- most notably if the different domains have different risk profiles (like one is a CMS and another is ecommerce).
And when doing this, it has to be done with care. One common mistake is to implicitly trust the incoming Host header and reuse it in templates and so forth, which opens all of the sites hosted in this way to compromise.


When learning a second language, should one choose a program focusing on grammar and structure or one that focuses on conversation?

Question: I have a friend who wants to learn English and is debating between two different programs. One is more focused on conversations while the other is more focused on grammar, reading, and writing. Any advice is welcome.
Comment: Hi and welcome to Language Learning Stack Exchange. I think it is impossible to answer your question due to a lack of information. (1) What is you friend's main learning goal? What does he want to do with his knowledge of English? (2) The description of the programs is much too vague; we would need more details about thei content, the number of classroom hours and the number of students in a group.
Comment: Thanks. Those are good calls. The medium-term goal is to study abroad. The long term goal would be to work and study in an English speaking country. About the program description, I don't have much information. Sorry about that. Thanks for your feedback
Answer: I would suggest you to choose the one that your friend finds the most interesting one out of the two. Obviously, the best option would be to have a mix of them as both aspects are important when learning a language. However, considering the fact that he has to choose only one, it is better to pick the one that he thinks he would enjoy the most and from which he could benefit the most depending on his actual skills.
For example, if his speaking and listening skills are more lacking than the ones related to grammar, reading and writing I would suggest going for the program that focuses on conversation. Conversely, if he thinks that he needs to improve his grammar, reading and writing skills, the program that focuses on grammar and structure may prove to be more beneficial to him than the other one.
Answer: Paul Nation suggests that a language course should have a balance of meaning focused input, meaning focused output, language focused learning, and fluency development. Your friend should see how each curriculum balances those four strands.
Comment: Hi and welcome to Language Learning Stack Exchange. Paul Nation is a wellknown researcher in this area, but could you please add one or more specific references to improve your answer? Thanks in advance.
Comment: Nation has covered his 4 Strands framework in several places but the book where I became familiar with it is called "What Should Every EFL Teacher Know?"
Answer: I always like to preface my answers by asking what's the goal for learning a new language. If the goal is to be able to hold general conversations in your chosen language then by all means chose the program that focuses of conversation. I see no reason to focus heavily on grammar and memorizing vocabulary. I know of no one who ever learned a language by memorizing its grammar rules.


How do I speed up load times on roaming profiles with Active Directory?

Question: I've done some reading and apparently the main obstacle to fast remote profile syncing is that Samba takes a long time to transfer lots of little files like cookies. After reading Roaming Profiles: Best Practices , I plan to use Folder Redirection, but I want my users to be able to login as rapidly as possible, even if it means that their data is still coming in when they reach their desktop. Is there a way to do this with GPO or a third party add-on that can load user profile data faster/speed up the login process for users?
Comment: The first obstacle is keeping the size of the roaming profiles under control. No matter what you do if you have big profiles they will take time to come down. - I would check the size of the profiles before doing anything else.
Comment: Is linux involved?  If not then it is not Samba, it is smb or cifs.  Whether you are asking for windows or linux tools is going to make a huge difference to the answer.
Comment: Nope, no Linux. Mixed XP/Win7 machines.
Answer:
...even if it means that their data is
  still coming in when they reach their
  desktop

This is referred to as profile streaming. It is implemented in third-party profile management products only, namely Citrix Profile Management, RTO Virtual Profiles (bought by VMware and currently not available) and Appsense Environment Manager. The only one of these products that is available independent of other products comes from Appsense, but be warned, it is not inexpensive.
If buying into a third-party product is not a possibility for you, I recommend you carefully analyze and optimize your roaming profiles. Here are some articles from my blog that may be helpful:
User Profile Design: A Primer
How to Reduce the Size of Roaming Profiles
Should AppData be Redirected or Left in the User Profile?


Log sql statments/queries executed by HugSQL

Question: I want to log all SQL strings executed by HugSQL. I looked through the docs, but couldn't find anything. Whats the recommended way?
Answer: I solved it myself by digging around the hugsql source. It works similar to converting the result set of a generated function (https://github.com/layerware/hugsql/issues/21):
(defn log-sqlvec [sqlvec]
  (log/info (->> sqlvec
              (map #(clojure.string/replace (or % "") #"\n" ""))
              (clojure.string/join " ; "))))

(defn log-command-fn [this db sqlvec options]
  (log-sqlvec sqlvec)
  (condp contains? (:command options)
    #{:!} (hugsql.adapter/execute this db sqlvec options)
    #{:? :<!} (hugsql.adapter/query this db sqlvec options)))

(defmethod hugsql.core/hugsql-command-fn :! [sym] `log-command-fn)
(defmethod hugsql.core/hugsql-command-fn :<! [sym] `log-command-fn)
(defmethod hugsql.core/hugsql-command-fn :? [sym] `log-command-fn)

Comment: I put it in my `db.clj`. I believe you can put this anywhere you like as long as it gets executed (for example by requiring a ns).
Comment: Where should I put that code? I'm clojure newbie using Luminus, so I'm not sure.
Answer: Per the HugSQL doc:

HugSQL generates a format internally known as sqlvec. The sqlvec format is a vector with an SQL string in the first position containing any ? placeholders, followed by any number of parameter values to be applied to the SQL in positional order.
...
HugSQL provides the hugsql.core/def-sqlvec-fns macro to create functions returning the sqlvec format. The created functions have an -sqlvec suffix by default, though this is configurable with the :fn-suffix option. These functions are helpful during development/debugging and for the purpose of using the parameter-replacing functionality of HugSQL without using the built-in adapter database functions to execute queries.

So you could use the sqlvec version of the functions colocated with where you call your HugSQL functions to log out the SQL that would be executed.
The doc actually provides the following example.  Given that you've loaded HugSQL queries like so:
(ns princess-bride.db.characters
  (:require [hugsql.core :as hugsql]))

(hugsql/def-db-fns "princess_bride/db/sql/characters.sql")
(hugsql/def-sqlvec-fns "princess_bride/db/sql/characters.sql")

And given the following function call:
(characters/characters-by-ids-specify-cols db
  {:ids [1 2], :cols ["name" "specialty"]})

You can get at the generated sqlvec with the following:
(characters/characters-by-ids-specify-cols-sqlvec
  {:ids [1 2], :cols ["name" "specialty"]})

Which would return something like:
["select name, specialty from characters
  where id in (?,?)",1,2]

Comment: This is does not log executed SQL strings.


Show Website Switcher on Header in Magento 2

Question: I need to add website selector on my Magento 2 site header. I am using Magento 2.0.9. How can I implement this?
Answer: You can get website name and url using this snippet.
<code>public function __construct(
        \Magento\Store\Model\StoreManagerInterface $storeManager,
) {
    $this->_storeManager = $storeManager;
}

public function getWebsites()
{
    $_websites = $this->_storeManager->getWebsites();
    $_websiteData = array();
    foreach($_websites as $website){
        foreach($website->getStores() as $store){
            $wedsiteId = $website->getId();
            $storeObj = $this->_storeManager->getStore($store);
            $name = $website->getName();
            $url = $storeObj->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_WEB);
            array_push($_websiteData, array('name' => $name,'url' => $url));
        }
    }

    return $_websiteData;
}
</code>
Comment: I also want website switcher on my header. In which should I put this code? In switch/stores.phtml ?
Comment: ok, how can I make block file for Magento2? where can I find an instruction?
Comment: Thank you, Patel. I have tried this method, it worked fine. One change that I have made is, here you are fetching store name I changed it to `$name = $website->getName();` .
Comment: Ok, Sure. I need one more help. I have created a block to list this. Could you please suggest me a way to display it in the header. I want to know the XML format.
Comment: Above code is for Block file.


Arch Linux unexpected shutdown

Question: I've installed Arch Linux on an Acer laptop with Intel Graphics (GM965/GL960).
I installed Xorg, xf86-video-intel, and the XFCE4 desktop enviroment with lightdm. I can login and do stuff, but when I'm trying to move windows quickly or run some programs that use GUI, such as Eclipse, the computer suddenly shuts down and restarts without any messages. Is this a problem with the video driver or some other hardware?
Answer: Hard shutdowns sound a lot like overheating. Are your laptop CPU's fan and heatsink clean and without dust? Perhaps it would be worth running some compressed air through to clean them up.
Another test you could do would be to use another distribution's Live CD, without installing it on the hard drive. This would allow you to rule out (or confirm) problems with the hardware.

Arch Linux unexpected shutdown


Postgres deadlock in INSERT VALUES concurrent with ON DELETE CASCADE

Question: I create tables like this:
CREATE TABLE tgroups (
    group_id text PRIMARY KEY,
    vacancy_id text
);
CREATE INDEX tgroups_vacancy_id_idx ON tgroups (vacancy_id);

CREATE TABLE tscores (
    application_id text NOT NULL,
    group_id text NOT NULL,
    CONSTRAINT tscores_pkey PRIMARY KEY (application_id, group_id),
    CONSTRAINT tscores_group_id_fkey FOREIGN KEY (group_id) REFERENCES tgroups(group_id) ON DELETE CASCADE
);
CREATE INDEX tscores_group_id_idx ON tscores(group_id);

I then have two processes executing SQL transactions in very rapid succession. Both have the standard READ COMMITTED isolation level. The first process is running this, except the values in the INSERT...VALUES are in a random order (I've done it in Python):
BEGIN;
    DELETE FROM tgroups WHERE vacancy_id = 'vacancy1';

    INSERT INTO tgroups (group_id, vacancy_id) VALUES
    ('group1', 'vacancy1'),
    ('group2', 'vacancy1'),
    ...
    ('group10', 'vacancy1');
COMMIT;

The second process runs the following SQL. Again, the values in INSERT...VALUES are in a random order. The variable :application_id is chosen from the set ["application1"..."application10"], which I've done with Python (I guess you could achieve the same in pgsql):
BEGIN;
    DELETE FROM tscores WHERE application_id = :application_id;

    INSERT INTO tscores (application_id, group_id) VALUES
    (:application_id, 'group1'),
    (:application_id, 'group2'),
    ...
    (:application_id, 'group10');
COMMIT;

This sometimes deadlocks:
sqlalchemy.exc.OperationalError: (psycopg2.extensions.TransactionRollbackError) deadlock detected
DETAIL:  Process 527 waits for ShareLock on transaction 391860; blocked by process 526.
Process 526 waits for ShareLock on transaction 391861; blocked by process 527.
HINT:  See server log for query details.
CONTEXT:  while deleting tuple (2,218) in relation "tgroups"
 [SQL: "DELETE FROM tgroups WHERE vacancy_id = 'vacancy1';"]

I can only reproduce the deadlock if both of the following are true:

The deletes in tscores from the first transaction are carried out behind the scenes by ON DELETE CASCADE. If I remove the constraint and manually delete the rows in question at the beginning of the transaction there is no deadlock
The values inside the insert statement are in a random order

I was under the impression that both DELETE and INSERT...VALUES were atomic, and that ON DELETE CASCADE happened at the same time as the DELETE it is related to. Therefore I'd have thought that if one transaction was already in process, the blocked transaction would block on DELETE until the other transaction finished, and then continue, and indeed this is what seems to happen if I manually run the two transactions line-by-line in separate psql sessions.
Somehow I clearly misunderstand the way that locks, inserts, foreign keys and cascades interact.
NB I am aware sometimes the INSERT into tscores will sometimes fail because the group that is referenced has just been deleted, but this isn't my problem (though I guess it could be related).
Answer: I would not worry about the behavior, just retry the transaction if terminated by the deadlock.
The first transaction tries to delete A and B, and acquires sequentially a lock on them, and the second deletes B and A, with the same approach. Upon locking A and B, none of the two transactions can progress, hence one of them is terminated by a deadlock.


How do I choose between a Canon 1100D or 700D when I'm overwhelmed by info?

Question: I am keen to take pictures of food in natural light and now seeking an SLR. I have narrowed it down Canon's 1100D or 700d. There so much info out there, it has made it more difficult to choose. What's actually important and how should I weigh various factors in making my choice?
Comment: Would it be possible for you to rephrase your question to make it less specific to right now? Any answers you get probably aren't going to be very useful to readers of the site in a few years, when neither the 1100D nor the 700D are available any more.
Comment: I'm still inclined to see this question as either a duplicate of a more general one or way too localized, even in its current form.
Answer: When in doubt, buy the cheaper one. Both of those will take excellent pictures. The true quality comes from what you capture with them.
Answer: These cameras are in different Canon ranges, with the 1100D being very much 'entry level' and the 700D being on the upper end of the 'enthusiast' line (before you get into the larger cameras such as 60D and 7D).  Both are fine and capable cameras, however it may be difficult to get the answer you require with relatively little information.
You say you want to take pictures of food in natural light, but in what situations? Static, on a plate, by a window, or in a restaurant, or outdoors, bright or dim natural light?  Or the cooking of the food itself?
Also - are you likely to want to shoot other things too? Holiday, sports, events, people?
On a personal level I would not go with the 1100D simply because I think you would enjoy it for a month or two then as your photography improves, you might find it limited - the low-light capabilities, etc.  I think the 700D would serve you better in respect of the ability to expand your creativity later on.
That said is there a reason you're going for the 700D over the 650D or 600D?  They are both still available I think and still very very good.  The differences between the 650D and 700D are very minor and you might save money with the 650D.
Other than that -- for product photography such as food, I'd invest in a good lens.  A fixed 50mm f/1.8 (or f/1.4), or maybe even the 85mm f/1.8 would serve as good lenses for food photos.
Comment: The amount you can save with the 650D gets you a very nice lens for what I understand to be, in a large sense, trivial differences. Unless one waits, of course. I'd definitely pick the 650D over 600D though.


Trying to replicate Identity in a different column for x number of rows. SQL server Stored procedure

Question: I want to add my identity to another column, in x number of rows.  I can get this to repeat for two rows using this code in my stored procedure.
ALTER PROCEDURE [dbo].[InsertReport3] @incdate INT,
                                      @inctime VARCHAR(7),
                                      @inv1    VARCHAR(30),
                                      @inv2    VARCHAR(30),
                                      @inv3    VARCHAR(30),
                                      @inctype VARCHAR(20),
                                      @incnar  TEXT,
                                      @incloc  TEXT,
                                      @no      INT
AS
    INSERT INTO IncidentReport
                (I_Date_Incident,
                 I_Time,
                 IncidentType,
                 I_Narrative,
                 I_Location,
                 I_ID,
                 U_no_fk)
    VALUES     (@incdate,
                @inctime,
                @inctype,
                @incnar,
                @incloc,
                @inv1,
                @no);

    UPDATE Incidentreport
    SET    I_reportno = @@IDENTITY
    WHERE  I_no = @@IDENTITY;

    INSERT INTO IncidentReport
                (I_reportno,
                 I_Date_Incident,
                 I_Time,
                 IncidentType,
                 I_Narrative,
                 I_Location,
                 I_ID,
                 U_no_fk)
    VALUES     (@@IDENTITY,
                @incdate,
                @inctime,
                @inctype,
                @incnar,
                @incloc,
                @inv2,
                @no);

Once I get up to three with that code It increments by one, only pulling the previous identity, thoughts?
Answer: Assuming that you are using MS SQL Server you should be using SCOPE_IDENTITY() instead of @@identity. Justification can be found here. I think this will fix the problem you are experiencing.


Laser Cutter Power/Wavelength to Cut Paper

Question: I've been reading up on laser cutting and it seems that 808nm at around 2 watts is typical to cut paper. How would one calculate the wavelength and power required to cut an arbitrary material?
Answer: Here are some of the relevant bits of physics/questions to ask:

To cut a material, it needs to absorb heat faster than it can lose it.
heat is conducted away: this is typically linear with temperature gradient
heat can be radiated away: this is more important at higher temperatures (follows $T^4$ relationship)
laser power may be reflected or absorbed: the right wavelength will be the one that is "mostly absorbed" and will depend on the material.
the mechanism for "cutting" matters: is it melting, burning, or enhancing a chemical reaction (etching, oxidation)
does the cut have to be very small (narrow)?
does the surrounding material deform if it gets hot?
how many meters of material do you want to cut per unit time?

Based on the above considerations it is hard to give a general "formula" for the power and wavelength. I would say that higher power means you can cut faster - which in turn means that you can make a narrower cut without heating up the surrounding material (it didn't have time to heat up). This is also a cleaner cut. As for the wavelength - typically you will use a laser that can efficiently generate a lot of power (CO2 laser can have efficiency up to 20% but a longer wavelength, around 10 µm), and that is well absorbed by the material. You also want to be able to focus it to a small spot - both to increase the power density and to make a fine cut. The longer the wavelength, the harder it is to focus something because of diffraction...
Comment: Another relevant physics question to ask is, "what are the quantum mechanical properties of the material I'm trying to cut?" Some materials like metals adsorb the light by exciting their conduction electrons, others like semi conductors promote valence electrons to conduction electrons, still others adsorb the heat more directly as lattice vibrations. What ever the case, the qm causes a given material will be opaque to a given range of wavelengths that can cause a delta E that is associated with the result.
Comment: Yet another variable is the surface geometry. A single flat surface is just the degenerate case. Something like paper which has many surfaces can bounce the light around a bunch and give more opportunities for the light to adsorb.
Answer: Aside from the "it's complicated answer," there's also the "check for prior experimental research" answer. Without digging into it very far I used one trick. I found this Wikipedia article on Laser cutting and clicked ctrl+f to search the document for 'paper' and came up with this hit:

CO2 lasers are used for industrial cutting of many materials including
  mild steel, aluminium, stainless steel, titanium, Taskboard, paper, wax,
  plastics, wood, and fabrics.

So if I were building a paper laser cutting apparatus of some kind I'd search further to see what co2 lasers were capable of, and perhaps experiment with building one.
Comment: But the question was "how do you find the right parameters for a given material", not "how do I cut paper" .
Comment: But for any given material the more pragmatic answer is to experiment or find others experimental results.. I'd like to find an engineering table for this, but I didn't find one right away.


kitchen hot water faucet has low pressure, rest of house faucets have normal pressure

Question: last two weeks the hot water side of the single lever faucet in kitchen has reduced pressure.  Rest of the hot water side of faucets in house have normal pressure.  Cold water side have normal pressure.  on/off valves are turned on normally.  where do I look for the problem?
Answer: Aerator blockage sometimes happens, but because the cold water pressure (flow) at this faucet is fine, that must not be the problem.
Something could happen to reduce flow through or before the water heater, but because other hot faucets in the house work normally, that must not be the problem either.
All that's left to cause trouble are the valve inside the faucet itself, the hot shutoff valve under the sink, the connector hose, and whatever piping serves only that one faucet.
Decide which of those two valves is easiest to disassemble, do so, inspect for debris, re-install. (The passages inside the faucet valve are probably smaller than those in the shutoff valve and so might get debris lodged in them more easily.) If the problem persists then check the other valve too. If it still persists.. you might be looking at some pipe repair/replacement.


Self Transfer guide

Question: I am Pakistani citizen and resident of UK. I am travelling from London to Pakistan through aeroporti di Roma-Fiumicino(Italy).My question is while travelling from T1 to T3 of airport do I have to apply for a transit visa?
Comment: Can you confirm that, as the title implies, you have two separate tickets? If that's the case you need a full visa, not just a transit visa.
Answer: If as the title of the question implies, this is a self-transfer, which means that the two flights are on separate tickets, then you most likely need a full visa.
Since the tickets are separate, the first airline considers that Italy is your final destination, and they want to be sure you can enter that country. They don't care you are only staying there for a few hours, this is not their concern: they sold you a flight from A to B, you need to be able to enter B.
If you have any checked bags, this is 100% certain as you will need to enter Italy to retrieve your bags and go to check-in/bag drop.
Even if you don't have any checked bags, it's extremely likely. Some airlines or individual agents may accept that you will stay airside and accept just an airport transit visa, but it is extremely difficult to be sure they will, so it's a very risky proposition.

Self Transfer guide


Probability of set partition

Question: Let $A = \{1\dots n\}$. Do partition of set $A$ on pairwise disjoint two- and three-element subsets randomly. For each n determine probability that number of two-element subsets is equal to three-element subsets.
I don't clearly understand with what i can start to solve it. I only know about Bell's numbers and I guess there are some formula only for $n$ witch could be determine in term of integers $3a + 5b = n$. Can you help me to solve this problem or give me advice how to to do this?
Answer: Use the binomial coefficient to calculate the number of subset made from A, in particular $\binom{n-1}{k-1}$. Then it's easy to compute the probability.

Probability of set partition


Is there any way to recover a deleted Minecraft save file?

Question: I accidentally deleted my Minecraft save file and I want to get it back.
I have heard that if you right click on the saves, and click properties you can get your save folder back but I don't see any way of getting my save back from that. I have got to this stage but can't find the recover option for the file. Can someone help?
Comment: I'm voting to close this question as off-topic because it is a computer-related question not specific to video games. It is better suited at [Super User](http://superuser.com/).
Comment: "How do I recover deleted files" is not a game-specific question. Therefore, this question is off-topic on Arqade.
Comment: Well, depending on the OS, filesystem and partition-scheme...there's a very good chance that it is already lost. Otherwise you should ask this on SuperUser...but beware, there are already *many* duplicates there which handle recovering deleted files.
Comment: The right-click thing sounds like a way to access backups. Unless you already had backups being made automatically, there's nothing to recover.
Answer: Check out this website which gives you instructions on programs that can help you find deleted files. When you delete a file, it isn't deleted, it is still on the disk until another file is placed where it used to be, so try not to create many new files before you try to restore the deleted ones.
Edit 1:
Also Check out this question on SuperUser which is related to your question.
Comment: `When you delete a file, it isn't deleted, it is still on the disk until another file is placed where it used to be...` That's not completely true for all filesystems, just saying.
Comment: Do you have any examples? All of the file systems that come to mind just delete the file from its index instead of replacing its location on the disk with zeros.
Comment: [ext3 (and I'd also assume ext4) f.e. does not only mark the space as free, but overwrites all pointers to the file with zeros](http://batleth.sapienti-sat.org/projects/FAQs/ext3-faq.html#undelete). So you lose all information on the whereabout of the file, and if the file was fragmented, you have no clue where on the disk the rest of the file is even if you find the header information. I also thought that ext3 would overwrite the file header, but can't find any reference for that. On second thought, my claim might be a little bit bold, but I don't know that ext4 does with discard enabled.
Answer: Actually, just click properties and click restore previous versions and choose the date it was deleted. Or, if that does not work, go to Start and search system restore,
Answer: You can use System Restore(Windows) or Time Machine(mac) to recover your files.


Cinnamon: Titlebar in panel?

Question: One thing I really liked about Unity is that the titlebar and buttons for windows were in the top panel, I was wondering if I could have that same effect in Cinnamon?
Answer: No, this cannot be done with Cinnamon, at least not without a great amount of coding.
Cinnamon is a completely different desktop manager than Unity. A feature of Unity is that the application menu is included into the Panel. Cinnamon does not provide this feature. In Cinnamon, the Panel acts like the Panel in e.g. Windows 7.
Comment: Shucks, that may be a deal breaker! Thank you so much!
Answer: As you know now there is difficult create in cinnamon, the same as the ubuntu devs do on unity. Thats is really true, but not impossible on free software. Anyone can reuse the code and put it on another language or platform. And this are actually done, but is increible that the most difficult thing is not write the code and functionalities. The difficult part is found how be compatible with other sessions and programs, when you try to do a similar things or/and functionality. The Appmenu (global menu) is an example of what occurs. Duplicate the modules, could cause conflict and will be for do the same. Reuse the current code is the most sane thing, because on my opinion is also a contribution to the same distro (in that case ubuntu), but well. The Appmenu need a patch for some subset of applications and this patch is private to the session (unity).
As another example, recently was renamed a package that was developed by ubuntu, but also was used on other ubuntu sessions and also on others distros. Now is called unity-gtk-module and have a patch to only be active on unity session, because it may cause problems with other sessions. The appmenu also need patch the gnome settings daemon to call dinamically some gtk properties. Again this ofcourse only occurs for unity session and can not be modify without create a duplication of the patch, and again with conflicts. Is possible and is the best, share ways to turn on/off the things. There are also mechanisms to do that actually but apparently not for all people and things... This is the history of the appmenu, but this not begin with unity or ubuntu (It was ubuntu, who put order into the gtk chaos). This occurs on several things and on several places and in my opinion is a shame.
https://github.com/lestcape/Global-AppMenu

Cinnamon: Titlebar in panel?


publish red5 web project in linux

Question: I have created a dynamic web project  in eclipse and published it via red5-eclipse plugin in Windows.
I need to publish the same application in red 5 server installed in Linux machine.
In case of Windows just copying the application folder under webapps and restarting the red5 server works.
But when i try the same in Linux its not working.
Any inputs would be greatly appreciated.
Answer: Even on windows you shouldn't be doing the work of copy/paste into the webapps folder.
Thats the very reason to use the Red5 plugin in eclipse, i.e to make your life easier.
I assume you are using the JAVA EE version of eclipse. Just follow this old tutorial, which is still very much valid:
http://trac.red5.org/wiki/Red5Plugin
Once configured properly, you will see the Red5 Server in the bottom panel under the "Servers" tab. There you can directly publish your app to the server, debug, start/stop etc.
For your Linux specific issue, in most probability, you have to set the correct permissions for the Red5 webapps directory in order to put new projects in there. There is no reason otherwise for it to work differently than Windows.
Answer: Solution Using Netbeans and Glassfish Server:
Red5 can be installed as stand alone server or as a war deployment.
The procedure is to create war deployment of red5 version 0.8(old version). (Lengthy, please bear with me).
Download and install jdk1.6, glassfish2.1 and netbeans 6.5 on linux.
Download "Red5War_0.8.0.war".
I am sharing in the hope that the following may help the community to create a deployable war red5 version 0.8 on glassfish2.1 by following the steps using in Netbeans 6.5:
Step 1: Un-zip the Red5War_0.8.0.war
Step 2: Create a web project named "red5" in Netbeans
Step 3: Copy the content of "/WEB-INF/classes" of inflated war folder and paste it in "Source Packages" of Netbeans Project.
Step 4: Right Click "Libraries", add "JAR/Folder", navigate to "/WEB-INF/lib" of inflated war folder, select all the dependency jars and Click On "Open" of Netbeans Project.
Step 5: Delete WEB-INF of Netbeans Project (Note : Ignore Warning/Error).
Step 6: Delete META-INF of the inflated folder.
Step 7: Copy the remaining content ("/WEB-INF/classes" and "/WEB-INF/lib") of the inflated folder to "Web Pages" of Netbeans Project.
Step 8: Open the following ports in the firewall TCP/843,TCP/1935,TCP/5229,TCP/5080
Step 9: Run the project
Step 10: Deployable war file "red.war" is created in the Netbeans Project Folder(../NetBeansProjects/red5/dist/)
Please share your findings in creating new version(1.0, 1.0.1, 1.02) war deployments using new version netbeans, jdk on new version glassfish server(3.x).
Best wishes!
Arumugam A.V

publish red5 web project in linux


How to estimate number of Laue Spot

Question: Why are "Laue Spots" spots instead of rings? Or is there an effective way to estimate the number of Laue spots?  I can't find any formulas or theory concerning this issue. Thanks for your attention!
Answer: Laue spots / rings are just the transmission mode analogue of Bragg diffraction spots / rings. A crystalline sample will show a spot pattern while a powdered sample (lots of small randomly oriented crystallites) will show rings.
See any entry level solid-state textbook (e.g. First chapters of Kittell) for a derivation of the "Laue condition" that determines where these spots appear.
Comment: It will depend on how finely the powder is ground. Assuming random orientation of the crystals, each crystal illuminated by the X-rays will generate a pattern of spots. If the crystals are large there will be few of them and you'll get a pattern of discrete spots. If the crystals are small there will be so many of them that the spots merge to create the rings.
Comment: Thank you very much! I need some efficient way to estimate the magnitude of order of the number of spots, is there some effective way to estimate?

How to estimate number of Laue Spot


Create a grid with combo box in cells

Question: In the UI wireframe designer, is it possible to create a data grid with combo boxes inside the cells?
Comment: You're talking about the Balsamiq wireframes tool you can use when asking/answering questions on this site, right?
Comment: Yes, I am.  Didn't realize it had a name.
Answer: As a feature this appears to be planned but low-priority for Balsamiq (Balsamiq makes the software, we just have a plugin to let us use it). You can click the +1 to like the suggestion to show support for the feature.
As a quick and dirty solution, you can just layer comboboxes on top of a datagrid:

Use the "bring to top" layering item to make sure the combos are on top (they should automatically appear as the top item as you add them though) and you can sit them over table cells. Since ultimately what people on the site see are images of the wireframe anyway, the end result isn't that different from a more proper implimentation.

Create a grid with combo box in cells


Is the $n$ in the single slit diffraction equation for dark fringes any integer or specifically odd integers?

Question: The equation for angular positions of dark fringes due to single slit diffraction is $a \sin(x) = n \lambda$ correct? My question is on that $n$. I read that it takes integer values which give the order of the dark fringe. But in deriving that equation they said the path difference is given by $0.5 a \sin(x)$ and that it should equal a whole number of HALF wavelengths for there to be destructive interference resulting in a dark fringe. But if the $n$ in the final equation takes an even value, e.g 2 or 4, won't the path difference be a whole number of EVEN wavelengths instead? Causing a bright fringe?
Comment: You can write different expressions for this, with the constraints on $n$ depending on how you write it. I usually use one in which $n \in \mathbb{Z}$.
Comment: So in that form where "asin(x) = n*lambda" what are the constraints on n? Can it take an even value?
Comment: You should edit that into your question, but you should also be able to answer it yourself.
Answer: Finally found the answer. The argument of splitting the slit width into 2 halves is used when the "n" in "n * lambda" is odd. In this case, the rays from the top half interfere destructively with their counterparts in the bottom half with path differences of half a wavelength. When n is even, however, instead of splitting the slit width into 2 halves, we argue by splitting it into four regions instead. Rays in the first quarter now interfere destructively with their counterparts in the 2nd quarter, while those in the third interfere with those in the 4th. A dark fringe ergo arises. We can use these arguments for all integers both odd and even and therefore dark fringes occur at all integral values of "n", odd and even.
Found the solution here: http://www.math.ubc.ca/~cass/courses/m309-03a/m309-projects/krzak/


Where on Stackexchange could i post work on new factoring methods

Question: What board can i post work showing original framework for factoring methods, so that i can get insight from others with more expertise on why such a framework functions?  I have some understanding now, but could use more.  Where will it be on topic?
Since factoring methods, which is all I'm willing to share right now, is directly related to many forms of online encryption, is it related enough for cryptography boards?  There is a direct relation to many public-private key generation methods, so would it qualify?
Comment: You did not show any, just wrote your paper and published it.
Comment: "normal factoring is just comparing a set of numbers against a product with unknown factors" - that doesn't sound right.  The best algorithms strive to construct two values $a, b$ with $a^2 \equiv b^2 \pmod n$ (and if $a \not\equiv b, -b$, this immediately yields a factorization).  That doesn't sound like "comparing a set of numbers..."
Comment: *TL;DR* all the best known factoring methods for large moduli are randomized algorithms.
Comment: What mean?  I haven't posted any work yet on stack exchange, since that is what gets my questions closed for making people upset.  I want to know what board to post to that won't get taken down where people can study the framework and try to answer why using known factors of one number leads to factors of compared number.
Comment: In reality, normal factoring is just comparing a set of numbers against a product with unknown factors.  I'm discussing a method that needs to be done with only one compared number (as a starting point) and leads quickly to the unknown factors.
Comment: If I'm willing to share my starting discovery,  and allow others to possibly end up at answers i wish to sell, isn't that somewhere in the range of ethical behavior?  One method leads to the others, as long as prior education doesn't keep you from outside-the-box thinking.
Comment: Sure, how long does that method take?  How many values of a and b are possible to use to get to correct answer?  A lot.
Comment: If a method requires a lot of trial and error, it is not the best way, and will take an unknown amount of computaion for any given number.  If you can start at ONE easily found point, and run an operation that devolves to the correct answer (or its multiple, giving a common factor number), is that not much more efficient?
Comment: I am still hoping for an answer of where to post original work for scrutiny.  I will even give a detailed description of what i understand of it, so long as it won't be censored in some fashion.
Comment: your techniques sound very unusual, but your observations about the other comments show that you are pretty much a beginner; so follow the suggestions in the answers (e.g., eprint.iacr.org) and see what transpires. If you think you can avoid trial and error in factorization you will most likely be disappointed since the distribution of primes has features of randomness and you are looking at massive intervals when considering RSA type moduli
Answer: Your best bet is to publish it on the iacr eprint archive. Here's the link to submit papers. https://eprint.iacr.org/submit.
Why is this the best avenue? The eprint archive contains a large portion of the published literature on cryptography. It's arguably the main reference; most people in this field check it very often.
Any new publication on their targeted topic quickly gets the community's attention, especially if you have interesting insights on factoring (see Schnorr's paper for a recent occurrence).
Ethics. It's fair to say that one would not expect any catastrophic outcome from what will be shared. The way the question is formulated doesn't lead to thinking there's any disastrous outcome to be expected. Nonetheless, share your insights with the community and get feedback. There have been tons of public papers on factoring that weren't unethical or broke the internet.
Comment: Regarding censoring: again, that's an advantage of the archive. This forum has a policy which we must follow. The archive is designed so that anything related to cryptography can freely be published (also, not matter how wrong/correct it is). So there's nothing left to do than just write it up in a paper and publish. You're guaranteed to have tons of feedback very soon.
Comment: I was speaking of the ethics of selling refined methods on ebay.  Previous work i posted was taken down or closed.  I mentioned in a previous post that a partial description with worksheets is available on ebay, since it can't be taken down.  My question was closed because the mods thought i was making a sales pitch of some sort.
Comment: As far as breaking the internet, i have been told everything from it is armageddon to it can be easily fixed.  This in relation to factoring AND discrete log discoveries.  I only know what I've been told, since i am not an expert in online cryptography schemes,  but i am learning.
Answer: StackExchange consists of a set of Q/A sites, trying to build a knowledge base. As such it is a knowledge base of known information, supported by a community of experts and enthusiasts.
Stack Exchange is not the best place to have research published. You won't become famous here, nor is it allowed to advertise your algorithms and schemes without reason (the reason being that it is directly related to a question that somebody asks).
As indicated, the best way forward is to publish your findings in a paper. If your scheme has merit then it can be a base for finding work within the field of study (math or cryptography in this case). That will ultimately provide you much more value than selling information on eBay or similar.
Comment: Thanks to mods for email explaining that i comment too much.  I am working on adding all information in body of questions,  rather than adding info through comments.
Comment: Okay.  Thanks much
Comment: If the question is help understanding a discovery, is that not a valid question for a forum of experts?  Known experts are already stumped, and of no use, except to show these discoveries (correct or not) are new and different.
Comment: Also, not looking to get famous.  Just to make an income on my hobby.  Some people mine bitcoins; i mine for answers to unsolved math questions.  I even tried my hand at squaring a circle since its impossible.  The result was a new variation of the standard model for finding the sqrt of pi.  I wasn't successful, but came as close as is possible, to date.  At least someone at a university looked at it and told me about the standard model, which i didn't know.  I learned something, even though i didn't have an eduction in the subject previously.  It was fun trying.
Comment: Well, help can be performed in different ways. If it means "help" in answering a question that wasn't already covered then yes, most people are willing to help. If it means evaluating a scheme or system or asking for more generic help then this is off topic on most of stack exchange. Now if you have any *specific* questions on e.g. an analysis technique then you're free to ask.
Comment: Ok.  Thank you.  I'm starting to get what's expected of me, albeit slowly.
Comment: That's great. Take your time to digest all of it and don't try to over-extend or over-ask and everything will be fine. Beware that answerers are *not* obliged to answer any follow up questions or go into discussion. Asking for clarification is more likely to result in a comment or update of an answer.
Answer:
What board can i post work

What make you think there is such board?
Before asking "What board" you should have asked if you can post any work.
The answer would be: No, you can't. Stackexchange is not the place to post any works and to ask for feedback.


How do I get my S2 to communicate with the bluetooth keyboard again

Question: I purchased the Samsung keyboard case when I bought my 9.7 inch S2 at Best Buy. After a short while, the bluetooth connection was lost and I was unable to get it back, so back to the store. They could not get it to work either, and replaced the keyboard with a new one, which paired up and worked fine for awhile... then after a few days, it stopped working. Both devices are fully charged. I have tried rebooting several times. The keyboard shows up on the bluetooth screen, but when I select it, it briefly pops up a message saying something like "unable to communicate with S2 keyboard". I plan to take the tablet to Thailand in a couple of months and would like the keyboard to function as more than just extra weight. Maybe I got two lemons, but I don't have much faith in just trading it in again for another keyboard... and other than this issue, I love the tablet. I am a touch typer, so using the onscreen keyboard is a big leap backward.
Comment: did you ever get a solution to this? This same thing has happened to me and im stuck on vacation in Japan with no keyboard now. Any advice would help!
Answer: Turn on the keyboard and go into blue tooth settings.  Hold down on the selected device and it will pair.  Mine prompted me to enter a code on the keyboard then it was paired! It just came to me all of the sudden after searching for answers so i figured I'd post what worked.
Answer: switch the keyboard off. on the top right center you will see a key that has the blue Bluetooth logo on it. hold that key down and switch on the keyboard. keep holding until the light turns blue, yellow, red. now you can pair the bluetooth keyboard to the tablet
Answer: keyboard was paired but wouldnt connect. tried in a different rooom from where my wifi router was andd it connected right away


GAP and Free group

Question: Let $H$ and $K$ be finitely generated subgroups of the free group $F(n)$ such that $H\subseteq K$. We Know that $K$ is a free group. Now we choose  basis for $K$ and $H$ and I want to rewrite the basis of $H$ in the choosen basis of $K$. I can do this calculation with hand by using automaton of $K$ but it take a long time. How can I do this with GAP?
Answer: You can do this using the FGA package which you will have if you installed GAP as suggested by its instructions, but which unfortunately is not included in the debian (or ubuntu) package archive. By the way, it also works by using automata.
Let's first ignore $H$ and see how to write a word in the generators of $K$.
First set up the stage:
gap> f:=FreeGroup("a","b");
<free group on the generators [ a, b ]>
gap> AssignGeneratorVariables(f);
#I  Assigned the global variables [ a, b ]
gap> k:=Group(a^2,a*b);
Group([ a^2, a*b ])
gap> word:=a^-1*b;
a^-1*b

Now the idiomatic way to express what we want is to define a homomorphism from another free group to $K$ and then ask for a preimage. We can do exactly that:
hom:=GroupHomomorphismByImages(FreeGroup(2),k);
[ f1, f2 ] -> [ a^2, a*b ]
gap> PreImagesRepresentative(hom,word);
f1^-1*f2

So we see that to get our word, we have to multiply the inverse of the first generator of $K$ with the second.
Note that this works no matter whether or not the generators of $K$ are free, we can use the same method to find a way how to write $a^2$ as a word in $a^{16}$ and $a^{42}$.
In this case, $K$ is given by a free generating set, so we could also use a homomorphism in the other direction:
gap> hom2:=GroupHomomorphismByImages(k,FreeGroup(2));
[ a^2, a*b ] -> [ f1, f2 ]
gap> word^hom2;
f1^-1*f2

Depending on what you want to do with the result, you might prefer to avoid using homomorphisms and just get a list of numbers representing generators, with negative sign indicating inverse:
gap> AsWordLetterRepInGenerators(word,k);
[ -1, 2 ]

Now if we have a subgroup $H$, we just iterate over its generators and use any of the above methods, for example:
gap> h:=Group(a^-1*b,a^4);
Group([ a^-1*b, a^4 ])
gap> List(GeneratorsOfGroup(h),w->PreImagesRepresentative(hom,w));
[ f1^-1*f2, f1^2 ]

(See also section 2.3 of the FGA manual.)
Comment: Great! Surprised to hear that it is missing in Debian package (moreover, a copy of GPL is included in FGA archive). On full GAP installation made from http://www.gap-system.org/Releases/ the FGA package is loaded by default. Hence, the user experience may essentially differ - that's why I always install GAP and packages from source. Perhaps one could tweak Debian installation placing FGA in `~/.gap/pkg/fga` directory, but then still there may be other packages missing....

GAP and Free group