What makes a system topological?

Question: As I understand, if the Chern number which is obtained by integrating Berry curvature over a surface with a boundary is an integer, then the Chern number is a topological invariant. So when does Chern number become integer? If the berry phase is well defined along the closed curve will that be enough for the system to be topological?
Comment: When you integrate the Berry curvature over the Brillouin zone (which is a torus topologically, so it is closed), you always get an integer.
Answer: Any system is topological. The question is, rather, whether it has non-trivial topology.
When considering translation invariant systems, we make a Bloch decomposition and so a system is specified by maps from the Brillouin zone into some space of Hamiltonians. Via the Bloch decomposition, this space of Hamiltonians will simply be the space of Hermitian $n\times n$ matrices which have a gap.
For simplicity let's assume we have no extra symmetries, and we are in two dimensions, and we are only considering two level systems. Then the Brillion zone is the $2$-torus, the space of Hamiltonians is $\mathbb{R}^3-{0}\cong S^2$ (think of the set of Hermitian invertible $2\times 2$ matrices, this space is spanned by the three Pauli matrices, with real coefficients, and such that not all three coefficients are zero), and a system is specified as a continuous map between these two spaces.
Then it turns out (after some study of topology) that these maps $$ \mathbb{T}^2\to S^2 $$ fall into classes indexed by $\mathbb{Z}$, where classes are defined by continuous deformations of the maps (i.e., homotopy).
For general $d$-dimensions and general $N$-level systems, the $2$-torus is replaced by a $d$-torus and the $2$-sphere is replaced by the Grassmannian manifold. Taking symmetries into account one have to then classify $G$-equivariant maps, rather than all continuous maps, which leads to a finer classification.
In this sense, a system (i.e. a map $\mathbb{T}^2\to S^2$) is topological when it is not a map homotopic to a constant map (the constant is irrelevant if your target space is path-connected).
Next, for non-translation invariant systems, one does not have a Brillouin zone anymore. So a Hamiltonian is just an operator in Hilbert space (with some conditions to make physical sense). One then classifies not a set of maps as before, but the set of possible Hamiltonians. The equivalence classes is now not homotopy as before, but path-connectedness.

What makes a system topological?


Flex Warning: Unable to bind to property 'foo' on class 'Object' (class is not an IEventDispatcher)

Question: I've got an object that contains a dozen or so fields I want to bind to form elements, so that I can use that object to send the data back to the server to be saved.
Definition of my container object:
private static const emptyLink:Object = {
    id: -1, title:'',
    trigger1:'',trigger2:'',trigger3:'',trigger4:'',trigger5:'',
    linkTitle:'', linkBody:'',
    answer1:'',answer2:'',answer3:'',answer4:'',answer5:''
};

[Bindable] public var currentLink:Object = emptyLink;

currentLink is assigned at runtime to a specific index from an ArrayCollection, I'm just using the emptyLink object for initialization purposes, mostly.
<mx:Panel id="triggerPanel" title="Trigger" width="33%">
    <mx:VBox id="tpBoxes" width="100%" paddingBottom="5" paddingLeft="5" paddingRight="5" paddingTop="5">
        <mx:TextInput id="trigger1" width="100%" textAlign="left" text="{currentLink.trigger1}" />
        <mx:TextInput id="trigger2" width="100%" textAlign="left" text="{currentLink.trigger2}" />
        <mx:TextInput id="trigger3" width="100%" textAlign="left" text="{currentLink.trigger3}" />
        <mx:TextInput id="trigger4" width="100%" textAlign="left" text="{currentLink.trigger4}" />
        <mx:TextInput id="trigger5" width="100%" textAlign="left" text="{currentLink.trigger5}" />
    </mx:VBox>
</mx:Panel>

Of course, this compiles and displays just fine, but there are runtime warnings for each instance:

warning: unable to bind to property 'trigger1' on class 'Object' (class is not an IEventDispatcher)
  warning: unable to bind to property 'trigger2' on class 'Object' (class is not an IEventDispatcher)
  warning: unable to bind to property 'trigger3' on class 'Object' (class is not an IEventDispatcher)
  warning: unable to bind to property 'trigger4' on class 'Object' (class is not an IEventDispatcher)
  warning: unable to bind to property 'trigger5' on class 'Object' (class is not an IEventDispatcher)

And the currentLink object is not updated when the TextInput fields are changed.
The obvious answer is that my object needs to be an instance of a class that implements IEventDispatcher. What that answer doesn't tell me is the particulars of implementing that interface (what's required? what's not?), and if there is a simpler way to do this -- like a built in class that will gladly accept my custom properties and allow for binding, without me having to worry about the particulars of implementing the interface.
Does such a class exist? If not, what's the bare minimum and/or accepted standard for accomplishing this task?
Answer: You need to use ObjectProxy (as Chetan mentions) - but you also need to use valueCommit to get the text you enter in the input BACK into your object:
<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
    <mx:Script>
        <![CDATA[
            import mx.utils.ObjectProxy;
              private static const emptyLink:Object = {
    id: -1, title:'',
    trigger1:'',trigger2:'',trigger3:'',trigger4:'',trigger5:'',
    linkTitle:'', linkBody:'',
    answer1:'',answer2:'',answer3:'',answer4:'',answer5:''
};

[Bindable] public var currentLink:ObjectProxy = new ObjectProxy(emptyLink);

private function handleClick():void
{
    trace(currentLink.trigger1);
}
]]>
</mx:Script>

<mx:Panel id="triggerPanel" title="Trigger" width="33%">
        <mx:VBox id="tpBoxes" width="100%" paddingBottom="5" paddingLeft="5" paddingRight="5" paddingTop="5">
                <mx:TextInput  id="trigger1" width="100%" textAlign="left" text="{currentLink.trigger1}" valueCommit="{currentLink.trigger1 = trigger1.text;}"/>

                <mx:Button label="Click" click="handleClick()"/>
        </mx:VBox>
</mx:Panel>

</mx:WindowedApplication>

Answer: Object doesn't dispatch events. Although you have made the variable Bindable, the properties of the object referenced by the variable currentLink can not be bound.
Use ObjectProxy instead.
[Bindable] public var currentLink:ObjectProxy = new ObjectProxy(emptyLink);

Answer: The first thing you'll want to know is that binding in Flex 3 is not bidirectional. The binding expression will ensure that if the source of the binding expression (currentLink.trigger1) changes that the target (TextInput) will receive notification of the change and update accordingly. If you want the binding to go in the other direction, there are at least two ways to do this:

Use the mx:Binding tag to direct TextInput.text back to the object
Use BindingUtils to do this programmatically instead.

In Flex 4 they are introducing a new syntax for bidirectional binding @{some.binding.expression} but it's not available in Flex 3.
On the 2nd part: the error that you're receiving is because you are binding to a "generic" prototype Object. When you apply the [Bindable] metadata tag to a property or class, the MXMLC compiler generates AS code that includes use of binding utilities and property change watchers to do make the binding happen. However you can't make the prototype Object do this since it's a built-in.  You can create a custom ActionScript class which is bindable (or has certain properties bindable). The MXMLC compiler will generate a class which implements IEventDispatcher and therefore supports binding.  This has the advantage of being faster than prototype objects and also gives you compile-time checking, i.e. you will receive a compiler error if you reference an invalid property.
The other alternative is to wrap your prototype in ObjectProxy as one of the other SO members has suggested.
Comment: If I could accept 2 answers, this one would be #2. I picked Gabriel's because it was the simplest solution to do what I'm attempting to do. Thanks for all of the information, though!
Answer: Just a tip on how to find out the offending code in a larger project - put a breakpoint on the two
trace("warning: unable to bind to property '"

lines in the SDK's PropertyWatcher class (Navigate > Open Type > ...).  Stacktrace will then help you find the ui component that holds the broken binding.
Answer: In general, the reason why you get "unable to bind to property foo on a class, is because you are either missing a getter or setter for foo. You could also make foo scoped to a public variable, (although this breaks encapsulation)
So you need Both of these to make it go away:
public function set foo (o:FooObject) : void {
...
}

or
public function get foo() : FooObject {
...
}

Answer: Here's the livedocs reference for the interface. It's pretty much what would be obvious.
To quote:

In general, the easiest way for a user-defined class to gain event dispatching capabilities is to extend EventDispatcher.

Hence,

private static const emptyLink:EventDispatcher = {
Comment: your link doesn't go to the page within the livedocs that you thought it does. Each livedocs reference page has a "Current Link:..." in its footer, with the URL for directly-linking the page you're viewing. Use that. :)
Answer: I haven't been using Flex for very long, and this might not fit your requirements, but why not use XML?  I believe you can set the TextInput text value to attributes in the XML.
I'm using pseudo-code, but something like this makes sense to me:
[Bindable] private static const currentLink:XML = <root>
                                                    <trigger1 value=""/>
                                                    <trigger2 value="" />
                                                  </root>;
...
<mx:TextInput id="trigger1" width ... text="{currentLink.trigger1.@value}" />

Something like this, perhaps?


Post TFS 2012 upgrade project fails to compile

Question: I just updated TFS from 2012 RC to 2012 RTM. The instal went just fine and everything is setup as it was. However now when I check-in files and the build process kicks off I keep getting an error relating to a missing System.EnterpriseServices.dll.  Here is the full error:
<code>CSC: Metadata file 'c:\Builds\1\MySite\bin\System.EnterpriseServices.dll' could not be opened -- 'Error importing module 'System.EnterpriseServices.Wrapper.dll' of assembly 'c:\Builds\1\MySite\bin\System.EnterpriseServices.dll' -- The system cannot find the file specified. '
</code>
Yes I have verified the file is in the bin, as as well I have removed then re-added it. One thing I suspect here is that I see the new TFS install added .NET 4.5 to the server, where before it did not exist... maybe that's a possible cause?? The application is a C# MVC4 website set to .NET 4.0.
I have also ran the 'Repair' on the TFS install and re-installed .NET 4.5. The project compiles and runs perfectly locally.
Any help is greatly appreciated!
Answer: Most of custom dlls problems comes from they are not in the right place, so try to put any custom dlls on the build server on the right place, see my answer there.
Upgraded TFS 2008 build definitions to TFS 2012 build defs using Upgrade Template, errors when queueing builds


STM32 HAL driver for register value update

Question: I am new to HAL drivers and STM32 MCUs. Can anyone tell me how to use HAL drivers to update register values of STM32F407 MCU? I have to programatically update the values of ARR and CCR registers of TIM1 to generate PWM waveforms.
Comment: If you're using the HAL drivers, then you typically don't want to directly change the values of these peripheral config registers - that's a big part of what the HAL drivers do for you. You figure what high-level configuration you want and then tell the HAL drivers ' hey, gimme that config', and the driver code takes are of the actual register values.
Comment: In ST's documentation for the HAL drivers, and in the `.h` files of the drivers themselves.
Comment: where can i find that config function?
Answer: While it would be tempting to think that if you are going to use the HAL libraries, you should maintain that abstraction and not pierce it, in fact it is often necessary to bypass them.
If you look at the source of stm32f4xx_hal_tim.c (for example in mbed's github, since ST prefers zip files) you will see that the only functions which set the CCRx registers directly (vs via DMA) are the kitchen-sink calls of the TIM_OCx_SetConfig() family.  As these are about 60 lines each and pull and manipulate values from a struct, they're a horribly inefficient way to so something ordinary like update the output of a PID control loop over and over.
Instead, either reading through the code or by reading the relevant Programmers Manual, you can learn that after getting the peripheral setup (with the aid of the HAL or by hand), what you likely want to do is directly write to the register, for example here is relevant line buried in one of those kitchen-sink functions:
/* Set the Capture Compare Register value */
TIMx->CCR3 = OC_Config->Pulse;

Given the HAL just does not offer a practical way to update this register frequently, basically your only choices are to:
1) Modify the HAL to add a function that does the above, possibly trying to set it up to be inlined, this can work but you then get to maintain a private fork of the vendor hal, though in a large enough project you may be doing that for bugfix or code format reasons anyway.
2) Write your own meta-HAL that adds this while wrapping the vendor one
3) Just put the relevant register right in the code, either directly, or via an application-oriented abstraction like:
board.h
#define RIGHT_FRONT_PWM TIM3->CCR2

pilot.c
RIGHT_FRONT_PWM = pid_out[1];

... or you can throw the whole thing out in favor of a 3rd party HAL or write an original HAL that meets your preferences and needs.
Comment: For anyone interested in this topic, part of the above comment from *scico111* has now been asked as a separate question (and therefore should be answered *there* and not *here*): "[CubeMX HAL Libraries state or stateless](https://electronics.stackexchange.com/questions/419174/cubemx-hal-libraries-state-or-stateless)".
Comment: @samgibson the general form of that question is unanswerable as I pointed out there.  In *this* case it is reasonably safe provided one doesn't call the kitchen sink function again with a stale struct, but in others it is not.
Comment: So does it mean that its safe to mix the use of HAL drivers and the use of direct register access? And that the HAL calls are stateless?
Answer: There is a HAL manual on ST website. It explains how the timer HAL works, but sometimes it is just easier to read the actual source code. Specifically, you are looking for CubeF4 manual, and the HAL section for timer functions have a TIM prefix.
Answer: You can configure PWM signals and generate this codes by using prgram interface of CubeMX.

I used Tim4 for generate 1 Hz frequency PWM. My clock Speed on this project 168MHz. it is imported for calculate PWM frequency.

Tim4 depend APB1 Peripheral clock. APB1 Clock frequency is System Clock Frequency / 2. So my clock frequency is 84MHz. I changed presceler value to 42000 and changed my counter periyod to 2000 to set PWM frequency to 1Hz. Because 84MHz/(42k*2k) = 1. Tim1 depend APB2 peripheral clock and this clock frequency is System clock. So when use same values for timer1 its end up 2Hz PWM.
As a result you dont need to change register for generate pwm. You can use cubemx for this. I also share my project main code and github link in order to examine. In my project i use 4 channel of tim4 because i generate 4 different duty cycle values (%25, %50, %75, %100).
  /* USER CODE BEGIN 2 */
/*TIM2 PWM gönderimi için channellar ayarlanir */
HAL_TIM_PWM_Start(&htim4,TIM_CHANNEL_1);
HAL_TIM_PWM_Start(&htim4,TIM_CHANNEL_2);
HAL_TIM_PWM_Start(&htim4,TIM_CHANNEL_3);
HAL_TIM_PWM_Start(&htim4,TIM_CHANNEL_4);

/*
Ayarlanmis channellarin duty cycle ayarlari yapilir.
CH1 (D12) için %25
CH2 (D12) için %50
CH3 (D12) için %75
CH4 (D12) için %100
Prescaler = 42000, Counter Period = 2000 toplam çarpimi 84Mhz  dolayisiyla sinyal 1 Hz
Periyot degerinin duty cyclea göre istedigimiz gibi dagitabiliriz. %25 için 2000*25/100 = 500
*/
__HAL_TIM_SetCompare(&htim4, TIM_CHANNEL_1, 500  - 1);
__HAL_TIM_SetCompare(&htim4, TIM_CHANNEL_2, 1000 - 1);
__HAL_TIM_SetCompare(&htim4, TIM_CHANNEL_3, 1500 - 1);
__HAL_TIM_SetCompare(&htim4, TIM_CHANNEL_4, 2000 - 1);

/* USER CODE END 2 */

https://github.com/Bisbiliroglu/STM32F4_CubeMX_HAL/tree/master/PWM


How does a magnet spinning around a coil of wire generate can electric current?

Question: I know that the phenomenon of a magnetic field being generated by a current running through a wore is because of relativistic effects in the electric field that creates magnetic effects.
But how exactly does a magnet relatively spinning around a coil of wire generate an electric current?
(Sorry if it's a stupid question)
Comment: The symmetry of Maxwell's equations guarantees that moving charges generate magnetic fields and likewise moving magnets generate electric fields.
Answer: Faraday's law of induction tells us that a changing magnetic field induces an electric field (a voltage), and this electric field will cause a current in a conductor, if the conductor forms a circuit. Chapter 5 of Electricity and Magnetism by Purcell and Morin explains these relations in terms of special relativity.
Comment: This is a rather weak answer because it doesn't actually *answer* the question. Instead it just give the name of the principle that answers the question and a couple of references to books. We generally prefer answer to be self contained: links to outside references and resources are good for supporting and expanding on an answer posted here, but the answer should be *here*.
Comment: Write the answer then if you want to.
Answer: Magnetic fields push and pull electrons inside the wire. When the electrons move a current is created. Metals do this very well because the atoms are missing valence electrons making it easier for electrons to move.
Comment: Magnetic fields DO NOT push or pull electrons. CHANGING magnetic fields induce an electric field, and the electric field acts on charged particles.
Comment: @SuzuHirose magnetic fields do move electrons when the magnetic field is spinning like you stated in your question. You can choose whatever words you want but you're still going to need electrons. But you don't need to capital letters


Computer shutdown while downloading mojave, and now there is not enough space to download

Question: I was downloading MacOS Mojave and most of the way through, my computer shut down. Before I started downloading I had about 10GB of space on my hard disk. Now I about 6GB. How do I get rid of whatever temporary files are using all the space?
Comment: you are pushing the limits. First keep 10% of SSD free. Second, move or remove some stuff, install mojave then clean disk.
Comment: You have a Time Machine backup, right?  *Right??*
Comment: What version OS are you running?  Was it the full installer/install assistant of 6 GB you were trying to download, or some combo update? PS. 10 GB is not enough for either, an update (ca. 14.5 GB), or full installer (ca. 19 GB).
Comment: I am running High Sierra. What I want is the installer to update to Mojave. I was downloading it from the app store. I would assume that an update wouldn't use too much more space than the system files already take up (about 36GB out of 50GB).
Comment: Partial installer file is probably in your Applications folder, sporting the most recent "date added" or "modified" value. Trash it, and begin the install from the start. It would not hurt at all to first offload a bunch of whatever docs are eating all the space on your SSD. You are running far too close to the limit for my comfort.
Answer: First empty your trash (just in case). Then open Finder and hit Command + F. You should now get an empty Finder window with the option to add search parameters:

The first one, Kind is Any is already there for you. At the right side of this row click the "+" icon to add a parameter. You can see the ones I chose are:

File Size is greater than 4 GB
System files are included
Content modified is today

You may have to go into the "other" section of the dropdown menu to find "System files". In sum, this Finder search locates all files, including system files, that are greater than four gigabytes in size and modified today. Tweak the parameters if you don't believe you've found what you are looking for, and carefully review any matches so you don't delete crucial system files.
Comment: Nothing is returned when I put that in, even without the modified bit. Trash is definitely empty.


Hide products category disabled

Question: I have disabled a category of products that are only for Christmas, but if I use the search engine, the products appear although the category is disabled. How can I do so that the products are also hidden? Do I have to disable the products one by one?
Comment: disabling a category does not disables associated product. You will have to disable them one by one or you can write a small script to do this or you can simply select those products using mass action in order grid and change the status to disabled
Answer: Make an observer on the catalog_category_save_after event for the adminhtml. In the observer you can retrieve the category object and write your logic there. In general;

Create Event
Retrieve category that is saved in observer.
Retrieve all products from this category and based on the status of the category you can loop through these products to set them enabled/disabled.

If you don't know how to create an event:
https://www.mageplaza.com/magento-2-module-development/magento-2-create-events.html

Hide products category disabled


Figure out location of city direction sign in image - friday fun project

Question: So I came across this image and wondered where it could be located given the directions and distances.  But I started to realise that the sign is all wrong.  I'm guessing the Greek alphabet one is Cyprus, so 1000km from there would be maybe Bulgaria but then Cuba and New York are pointing the wrong way, and why is Athens somehow between those two.  Looking at Zambia and Ethiopia and imagining them pointing south then New York cant be further south than Cuba.  I tried a quick QGIS analysis putting distance buffers on New York, Cuba and Cyprus but it doesn't work. Can anyone figure it out?
Comment: White Tower of Thessaloniki https://selfpropelled.life/2015/09/14/10-11-september-2015-rest-day-and-thessaloniki/img_5813/
Comment: Looking at distances, Cuba, Venezuela, Bora Bora, New York, Cyprus, would suggest Southern Greece
Answer: I am the author of this picture. So I can tell for sure the sign post is located in Thessaloniki, Greece.
Answer: Just eyeballing this on a globe view with a measure tool like: https://map.terria.io/
Makes me think the location is in Southern Greece.
Using an online app like https://www.distancefromto.net  we can see that:
from-greece-to-french-polynesia (Bora Bora) is 17488 km
from-greece-to-venezuela is 9429 km
from-greece-to-cuba is 9316 km
from-greece-to-cyprus is 1120 km
Greece to New York is circa 7790 km

I also found:
Answer: If you want to measure (real world)- distance, don't draw circles / create buffers on a flat map canvas. Using EPSG:3857 / Web Mercator is especially a bad choice for measuring distances or areas, as the closer you get to the poles, the higher distorted the proejction gets.
This is especially true for large distances as in this case here. See what can happen if you don't respect that here: https://www.esri.com/news/arcuser/0111/geodesic.html
So you should use geodesic buffers. There are many ways to do that, between else:

If you want to do it yourself in QGIS, see this tutorial.

One of the most intuitive and easiest ways to create geodesic buffers or measure geodesic distances is use interactive interactive tools - for example one of the following:

World Map Projections: https://schweizerweltatlas.ch/swatools/MapProjector/MapProjector.en.html - see here a geodesic buffer centered in Caracas/Venezuela with a distance of 9500 km. As you can easily see, projected to a map, the buffer is everything else than a circle:

FreeMapTools: Radius Around Point: https://www.freemaptools.com/radius-around-point.htm - see screenshot with a point centered near the northern part of the East coast of the US (more or less NYC) and a radius reaching to Northern Greece, ca. 7729 km - quite close to what you have on the picture.

Use the measurement tool in Google Earth. As you can see, the distance from Thessaloniki to Cuba is indeed 9387 km:


How to assign annotations to polylines

Question: I imported polylines and annotations from DGN file. Polylines are pipelines. Annotation layer contains pipe diameters. There is no common ID's. The goal is to assign diameters from annotation to nearest pipe. Anybody knows how to do that?
Comment: what GIS software are you using to do this? The method may depend on what you are using.
Answer: Your best bet to solve this will be to use some version of a spatial join.
There are a couple of ways to make it work, and the best method will depend on your existing data.  In both cases, the lines need to have a unique ID.  This will enable joining of annotation attributes back to line attributes after spatial join is completed.

Spatial Join from Lines to Annotation:  Perform a spatial join operation from the lines to the annotation layer.  This should add the attributes of the lines to the closest annotation.

Note, this will only work if you have lines that are relatively separated and don't get close to overlapping annotation.  If lines are too close together, and thus the annotation is close, it may be have the attributes of the wrong line joined to it.

Spatial join from midpoint of line to annotation:  Generate a point layer with the midpoints of the lines in question and their attributes.  Do spatial join to annotation using this point layer.  This will reduce the likelihood of annotation being assigned incorrect line attributes because one end of the line is too close to the annotation of another line.

The Spatial Join using the midpoint will work best if the annotation is located near the midpoint of the line.  This is a common labeling area from CAD systems, so is likely to work.  Another common label point is to the midpoint of the first segment of the line.  This is something else that can be pulled out with a bit of python wizardry on the line.
As with anything, your mileage may vary.  There will need to be an error checking process, especially in areas with a large concentration of lines, like through pump stations or at congested intersections.  In general though, this method should give you pretty solid results.  This should be a pretty easy operation that may be performed using any of the common GIS packages out there, so no need to specify commands, etc.

How to assign annotations to polylines


Is there a way to bulk convert aspx pages to pdf?

Question: Adobe Acrobat doesn't support converting aspx files (only html), and the SPFx solution (react-command-convert-to-pdf) doesn't either. The tools I can use are Adobe CC, power automate but don't have a paid converter.
Comment: For anyone else who comes here to find an answer, the Muhimbi connector in one of the comments 'works' but it is limited. (I can't reply to that post due to my 'reputation score'). I worked with a Muhimbi Tech and found if the converted PDF spans multiple pages, it won't automatically convert them. You have to play with a property within the connector (Viewport Size) and it's VERY specific to the individual aspx page. That means you 'may' have to set that property for **each page** you want to convert. That doesn't allow for for much flexibility or automation unless your ASPX pages are consist
Answer: Here is a article about Converting Modern SharePoint Online Pages (ASPX pages) to PDF with Muhimbi PDF Converter Services Online and Power Automate flow.
For Reference: Converting Modern SharePoint Online Pages (ASPX pages) to PDF
Comment: Is there any update on this thread? Comment here if you still need any help.


Is there a way to allow commenting on a document?

Question: Is it possible to allow users to leave comments to a document that lives in Sharepoint? I've seen document ratings, but is there a way to allow comments?
Comment: There is also a free tool available on CodePlex named [SP Tool Basket](http://sptoolbasket.codeplex.com/).. This has rating and commenting on a document.. Never used it, but I think it should work good..
Comment: Looking at the 3 answers so far offering 3 completely different directions (social comments, document review comments, metadata / check-in comments), methinks you should elaborate a bit more on what kind of commenting you are looking for
Answer: If you are using SP2013/2010, there is a feature for what exactly you are looking for.
1) Go to the document library.
2) Select a document(by clicking the check-box).
3) Open the Library tab from the ribbon on the top.
4) Click on the "Tags and Notes" link on the ribbon.
5) Click on the "Note Board" tab on the Popup.
6) Write your comment and click Post.
Yey....you are done.
Answer: Word lets people edit files simultaneously (if you don't force a check-out for editing - works on office 2010 and 2013 (haven't tested earlier versions)), and add Comments to specific areas of text using the review tools (and edit the text as well) all linked to the account editing the document.
If you want it all in browser, you can try installing Office Web Apps on another server. The setup is quite simple...
Reference links:
How it looks (mac word, but it's very similar to windows word)
Office Web Apps Collaboration


Issue updating PHP version to 8.1 from 7.2 for Wordpress (MySQL extension missing)

Question: I have set up a LAMP server on AWS EC2 using Amazon Linux 2 AMI for WordPress hosting. The system was working fine already, but the WordPress dashboard prompted me to update the PHP version, since I was running the outdated 7.2.34. WordPress recommended I update to 7.4. I started the process following this guide (https://greggborodaty.com/amazon-linux-2-upgrading-from-php-7-2-to-php-7-4/)
When I checked the versions available in Amazon using
sudo amazon-linux-extras | grep php
The only newer versions available were 8.0 and 8.1. Upon doing some research, I figured 8.1 is the best choice to go (it is a stable release).
What was supposed to be a 15 min update turned out to be a 4-hour debacle and I somehow got PHP 8.1 installed, but the Apache server was still using 7.2, which I checked using php -v and accessing the test.php page via a browser. I made sure to do all the necessary service restarts/reboots, but I figured the configuration file of Apache is somehow still pointing to the 7.2 version. I dropped it for the night and decided to continue the next day.
After SSH-ing to my instance this morning, the PHP version was 8.1.15 on the php test site, but the php -v command still shows 7.2.
WordPress is no longer accessible saying: "Your PHP installation appears to be missing the MySQL extension which is required by WordPress." and there are 6 updates available on my instance. When I run sudo yum update I get the following output:
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
amzn2-core                                                                                | 3.7 kB  00:00:00
281 packages excluded due to repository priority protections
Resolving Dependencies
--> Running transaction check
---> Package php-cli.x86_64 0:7.2.34-1.amzn2 will be updated
---> Package php-cli.x86_64 0:8.1.12-1.amzn2 will be an update
---> Package php-common.x86_64 0:7.2.34-1.amzn2 will be updated
--> Processing Dependency: php-common(x86-64) = 7.2.34-1.amzn2 for package: php-json-7.2.34-1.amzn2.x86_64
---> Package php-common.x86_64 0:8.1.12-1.amzn2 will be an update
---> Package php-fpm.x86_64 0:7.2.34-1.amzn2 will be updated
---> Package php-fpm.x86_64 0:8.1.12-1.amzn2 will be an update
---> Package php-gd.x86_64 0:7.2.34-1.amzn2 will be updated
---> Package php-gd.x86_64 0:8.1.12-1.amzn2 will be an update
---> Package php-mysqlnd.x86_64 0:7.2.34-1.amzn2 will be updated
---> Package php-mysqlnd.x86_64 0:8.1.12-1.amzn2 will be an update
---> Package php-pdo.x86_64 0:7.2.34-1.amzn2 will be updated
---> Package php-pdo.x86_64 0:8.1.12-1.amzn2 will be an update
--> Finished Dependency Resolution
Error: Package: php-json-7.2.34-1.amzn2.x86_64 (@amzn2extra-php7.2)
           Requires: php-common(x86-64) = 7.2.34-1.amzn2
           Removing: php-common-7.2.34-1.amzn2.x86_64 (@amzn2extra-php7.2)
               php-common(x86-64) = 7.2.34-1.amzn2
           Updated By: php-common-8.1.12-1.amzn2.x86_64 (amzn2extra-php8.1)
               php-common(x86-64) = 8.1.12-1.amzn2
           Available: php-common-5.4.16-43.amzn2.x86_64 (amzn2-core)
               php-common(x86-64) = 5.4.16-43.amzn2
           Available: php-common-5.4.16-43.amzn2.0.1.x86_64 (amzn2-core)
               php-common(x86-64) = 5.4.16-43.amzn2.0.1
           Available: php-common-5.4.16-43.amzn2.0.2.x86_64 (amzn2-core)
               php-common(x86-64) = 5.4.16-43.amzn2.0.2
           Available: php-common-5.4.16-43.amzn2.0.3.x86_64 (amzn2-core)
               php-common(x86-64) = 5.4.16-43.amzn2.0.3
           Available: php-common-5.4.16-43.amzn2.0.4.x86_64 (amzn2-core)
               php-common(x86-64) = 5.4.16-43.amzn2.0.4
           Available: php-common-5.4.16-45.amzn2.0.5.x86_64 (amzn2-core)
               php-common(x86-64) = 5.4.16-45.amzn2.0.5
           Available: php-common-5.4.16-45.amzn2.0.6.x86_64 (amzn2-core)
               php-common(x86-64) = 5.4.16-45.amzn2.0.6
           Available: php-common-5.4.16-46.amzn2.0.2.x86_64 (amzn2-core)
               php-common(x86-64) = 5.4.16-46.amzn2.0.2
           Available: php-common-8.1.11-1.amzn2.x86_64 (amzn2extra-php8.1)
               php-common(x86-64) = 8.1.11-1.amzn2
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

I'm obviously a newbie and could be missing something obvious. Any help is greatly appreciated <3
I tried the --skip-broken addition, which skipped the vital updates and did not fix the issue.
I made sure that the php.ini file, which shows up in the test.php site is correctly configured as per this guide:
https://wpbuffs.com/php-installation-missing-mysql-extension-required-by-wordpress/
Answer: Try manually removing the package.
sudo yum remove php-json-7.2.34-1.amzn2.x86_64


motif application crashes while calling XtDestroyWidget

Question: We have a 32bit Motif Gui application. Now we ported the application from Solaris to Linux and the system is crashing very frequently. On our analysis we could find that this issue happened when we are closing the forms in our application. When the forms are closed we will delete the forms and will call the function XtDestroyWidget() to remove the widgets. We ran a purify for the application and we could found that the Stack Array Bounds Read (SBR) is happening when we close the form.
I had downloaded a sample motif program from the internet which is using XtDestroyWidget() to destroy the object. When i ran purify for this sample program also, i could found the same SBR.
SBR: Stack array bounds read (54 times):
  * This is occurring while in:
 XtDispatchEvent [libXt.so.4]
 RemoveAllPMgr  [libXm.so.3]
 XtCallCallbackList [libXt.so.4]
 XtPhase2Destroy [libXt.so.4]
 _XtDoPhase2Destroy [libXt.so.4]
 XtDispatchEvent [libXt.so.4]
 XtAppMainLoop  [libXt.so.4]
 main           [popup.cc:49]
 _start         [crt1.o]
  * Reading 4 bytes from 0xffbfe4f0.
  * Frame pointer 0xffbfe4d0
  * Address 0xffbfe4f0 is       32 bytes above stack pointer in function XtCallCallbackList.
This SBR is happening in the XtAppMainLoop(). From these facts i assume that this SBR is a common one and related to motif rather than to our application.
Can you please add some thoughts to the following questions.
1) Why SBR is happening when we use XtDestroyWidget(). Is this SBR a severe one.
2) I had removed the XtDestroyWidget and used XtUnrealizeWidget(). This will help me to remove the SBR and hence crash is not happening. Also all normal forms will be removed normally. But the problem i am facing in this approach is the POP_UP forms are NOT removed in this method. Can any one please suggest a work around for removing POP_UP forms also other than the HIDE option.
It will be very helpful for me if anyone can answer or add some thoughts for this issue.
Thanks in advance,
Sanush Chacko
-----Adding Sample Program..
Hi
Please find the sample program from where i got the SBR.
include X11/StringDefs.h
include Xm/Xm.h
include Xm/PushB.h
Widget toplevel;
void close_window(Widget w, XtPointer client_data, XtPointer event_data)
{
    Widget popup = (Widget)client_data;
    XtDestroyWidget(popup);
}
void pop(Widget w, XtPointer client_data, XtPointer event_data)
{
Widget a, button, popup;
popup = XtVaCreatePopupShell("Popup", transientShellWidgetClass, toplevel, NULL);
button = XtVaCreateManagedWidget("Close", xmPushButtonWidgetClass, popup,
    NULL);

XtAddCallback(button, XmNactivateCallback, close_window, (XtPointer)popup);

XtPopup(popup, XtGrabNone);

}
main(int argc, char *argv[])
{
    Widget button;
    XtAppContext  app;
    XmString label;
toplevel = XtVaAppInitialize(&app, "Popup", NULL, 0,
    &argc, argv, NULL, NULL);

label = XmStringCreateSimple("Make popup");
button = XtVaCreateManagedWidget("pushme", xmPushButtonWidgetClass, toplevel,
    XmNlabelString, label,
    NULL);

XmStringFree(label);
XtAddCallback(button, XmNactivateCallback, pop, NULL);

XtRealizeWidget(toplevel);
XtAppMainLoop(app);

}
Comment: Show your code, or the sample you got from the internet. Do you think anyone can figure this out from hex #'s from a debugger?
Comment: Please find the Orginal Post including sample program
Answer: You should not destroy the widget within a callback called by the widget.
Instead of creating a new popup every time you click a button, create a popup at the start of the program when you create the button, show and hide the popup as required, and then destroy it after XtAppMainLoop() returns.
This is more efficient in terms of performance (but slightly less efficient in terms of memory).
I'm a bit rusty, but I believe you can also manage/unmanage the widget rather than just hide/show it.


Does a TAP adapter queue packets?

Question: Does a Linux or OpenBSD TAP adapter queue up packets, or will it miss packets if I try to process them on a single thread as they come in? I'm not worried about not being able to process all the packets that come in, but if multiple packets come in right as processing starts on one then it might miss some if the adapter doesn't have an internal queue.
Comment: I don't know the answer, but I can't think of a situation where that would be an issue, because one should start the application that is "the other end" of the tun/tap interface and does the processing well before anything interesting happens. Starting it at just the moment when the packets you want to process arrive would be very tricky. And in general, all network software should expect that packets get dropped (possibly far before they even reach the tun/tap interface).
Answer: After reading through Linux' drivers/net/tun.c and OpenBSD's sys/net/if_tun.c I have come to the conclusion that they both use queues for the packets.
Specifically, Linux uses a queue within the tun/tap driver and OpenBSD uses the preexisting network stack's queue.
I have not manually tested the queue functionality.

Does a TAP adapter queue packets?


Addresses of dlls in Kernel Space

Question: I wrote a code that hooks the SSDT. Currently I can hook functions exported only from ntdll: NtCreateFile, NtClose etc. since they are the only ones that have entries in SSDT. I wanna know if there is a table or some kind of place where the other dll functions reside. Let's say I wanna hook Advapi32!CryptEncrypt function in Kernel Mode. How can this be done?
Comment: can you be more specific - do you want to hook user-mode functions from within kernel-mode?  Or do you want to hook kernel-mode functions (in which case, there is no Advapi32!CryptEncrypt, for example - it's a purely user-mode function)?
Comment: then you're out of luck.  As I said, CryptEncrypt is purely user-mode.  It does not rely on kernel code for its work.
Comment: I wanna hook CryptEncrypt from kernel-mode. Or a kernel-mode function which CryptEncrypt calls in itself like CreateFile does for NtCreateFile.
Answer: It feels like there are two questions here. 1) Finding addresses of system DLLs and 2) Hooking a specific function in the discovered DLL. I'll answer the first question, since it is the title of this post.
To find the address of all DLLs, call one of the following functions from your own custom application:
EnumProcessModules:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms682631(v=vs.85).aspx
EnumProcessModulesEx: https://msdn.microsoft.com/en-us/library/windows/desktop/ms682633(v=vs.85).aspx
The tradeoff here is that EnumProcessModules only fetches modules of the same bit-ness (ie if calling from a 64-bit program, only 64-bit modules are fetched)
EnumProcessModulesEx gives more control and allows fetching all modules, but is a bit trickier to use.
You can then check the module base address to see if is in user mode space or kernel mode space. Unfortunately this can vary depending on how the target program was compiled. 32-bit programs are generally kernel mode from 0x80000000 to 0xFFFFFFFF, and 64-bit programs are generally kernel mode from 0xFFFF0800'00000000 to 0xFFFFFFFF'FFFFFFFF. Additional information can be found below:
https://msdn.microsoft.com/en-us/library/windows/desktop/aa366912(v=vs.85).aspx and https://msdn.microsoft.com/en-us/library/windows/desktop/aa366778(v=vs.85).aspx
Comment: imho op wants to muck with usermode from kernelmode and wants to do it on arbitrary functions  i dont think he can use usermoode function like enumxxx
Comment: more than that, I got the impression that he wants to hook kernel-mode functions, not user-mode ones, and that he means drivers rather than DLLs.
Comment: no I mean functions which other dlls export like `MessageBox` which is exported by `user32.dll` , `CryptEncrypt` which is exported by `advapi32.dll`. I wanna know the offsets to these functions like we have for `NtCreateFile`, `NtQuerySystemInformation` in SSDT.

Addresses of dlls in Kernel Space


Waterproofing the iPhone 7 Plus for use in sea water

Question: I use an iPhone 7 Plus with an Overboard waterproof bag.
I take a lot of photos and the waterproof bag is very cumbersome.
I've noticed the only holes in the iPhone are the charging port and the speakers. The rest of the iPhone looks sealed. If I put tape over the speakers and charging port, will that be enough waterproof my iPhone 7 Plus? Are there any other "holes" in the iPhone?
Comment: No, don't do that. Ever seen a submarine that just looked sealed and had tape on the holes for diving? ;)
Answer: The iPhone 7 Plus is splash, water, and dust resistant and has a IP67 rating under IEC standard 60529. Which means up to 30 minutes under water at up to 3 feet deep.
If you are not submersing your iPhone 7 in more than 3 feet of water for more than 30 minutes you shouldn't need to do any additional waterproofing. However even though the iPhone 7 Plus is has a water resistant rating, water damage is not covered under warranty. You should also note that Apple has specific instructions for drying out a wet phone. See this Apple Support page for all of the details.
Personally, I would invest in a waterproof case to protect a device that costs at least $869, especially if I was planning on exposing it to salt water.
Many "field" tests have been done and the iPhone appears to exceed this rating when new. If you google around a bit you can find videos of iPhone 7 immersion test videos.
Here's a quote from Apple's official iPhone 7 page:

iPhone 7 and iPhone 7 Plus are splash, water, and dust resistant and were tested under controlled laboratory conditions with a rating of IP67 under IEC standard 60529. Splash, water, and dust resistance are not permanent conditions and resistance might decrease as a result of normal wear. Do not attempt to charge a wet iPhone; refer to the user guide for cleaning and drying instructions. Liquid damage not covered under warranty.


What alternatives are there for hosting shapefiles too large for GeoCommons?

Question: I've got a ~500M shapefile I'd like to place where it is publicly accessible and can be found via search. Specifically this dataset is the Bernalillo County, NM assessor parcel and tax database, which would be of some interest to others, but it way too large for GeoCommons. I'd prefer a geo-data repository site rather than a generic file repository (eg, RapidShare and the like).
Answer: You can use NextGIS cloud (nextgis.com) for publishing your files. After publishing the file can be shared as:

GeoJSON
REST API
WFS-T service

And also you can create a numerous web maps using this shape file and different styles.
Read the docs or watch the videos about nextgis.com features.
Answer: I would just use the free services like Google Drive or Amazon with a front end webpage on one of the free website services. Next option if it was part of a project would be on the dataverse (it is somewhat geoenabled). Finally, I think this is within the ArcGIS online free level allowable size (but truthfully I never really know with AGOL).
Answer: QGIS Cloud is a powerful platform for publishing maps, data, and services on the internet. With QGIS Cloud Free, all maps published on the internet are freely accessible by anyone, at zero cost.


Is there a editor for MIPS Assembly .s files?

Question: At the moment I use different text editors, but none of them highlight any code or help in any other way to simplify the code writing. Are there any good text editors out there for MIPS?
Answer: CudaText editor (open source, cross platform) supports this. You need to install lexer "Assembly MIPS" from Addon Manager.

call menu item "Plugins/ Addon Manager/ Install"
enter there MIPS to find the needed lexer
confirm to install it

Lexer handles .s and .asm extensions, but you can change this in the Lexer Properties dialog. Example screenshot:


Word-formation process - which one?

Question: I would like to ask if anyone knows what word-formation process takes place when we join two separate words (for instance 360 + flip) and create a word '360 flip' written separately, but used as a single noun (He did a beautiful 360 flip trick). I know that compounding means the joining of two separate words to produce a single form, but this is different because in my example we do not have one single form.
Comment: Why so you say that _360 flip_ is not "one single form"? Because there is a space character? That's just spelling, not language. If it works like a single word, it **is** a single word, nomatter how its spelled. Spelling is arbitrary and doesn't represent the real language; only a few parts of it.
Comment: Possible duplicate of [Compound noun or adjective + noun?](http://english.stackexchange.com/questions/146828/compound-noun-or-adjective-noun)
Comment: Rather than saying **360 flip** is two words *added* together, you could say it's a shortening of **360° flip** (i.e. - *subtracting* from the original spoken form **three-hundred and sixty *degree* flip**).
Comment: Thank you very much for your help! Now everything is clear to me.
Comment: Note that it is *use*, not spelling which defines such collocations as "single forms". Spelling  usually flops around for a while before settling on a standard; see, for instance, ‹base ball› and ‹base-ball› before ‹baseball› was universally adopted.
Answer: As far as I know, compound nouns can be spelled as one word (toothpaste), two words (vacuum cleaner) or with a hyphen (radio-controlled). Often there is more than one option. Therefore your example is in my opinion also a compound noun.
Comment: 'radio-controlled' is a compound adjective.
Comment: Thank you for pointing this out. You are right, of course.
Answer: Someone had to compose an answer, so I'll just give myself the honours. As all the commentators have said before, it is indeed compounding, spelling has nothing to do with it being treated as one lexical item. But if you pronounce it three sixty flip, that is also a shortening of three-hundred-sixty degrees flip.

Word-formation process - which one?


SSH client not found on cygwin64?

Question: I startup the cygwin bash prompt using the batch script but there is no ssh command. How do I setup an SSH client in cygwin64?
Comment: It's there just not by default. You run the cygwin setup installation file and search for the package you want, in this case ssh and openssh will come up there. e.g. see pics here  http://docs.oracle.com/cd/E24628_01/install.121/e22624/preinstall_req_cygwin_ssh.htm#EMBSC281
Comment: and this is not even specific to cygwin64 just cygwin
Comment: and I would add that the instructions on that oracle link are needlessly complex. But as mentioned, see the pics there. it's just a question of running the installation file clicking next checking ssh clicking next and finish. Then ssh will be there
Answer: The openssh package (containing both the OpenSSH server and client software) is not part of Cygwin's minimal base packages.  The same setup-x86_64.exe for installing and updating Cygwin itself is used for installing individual packages such as openssh.
Answer: Click on the setup-x86_64.exe and then click next till you reach to the Select packages menu.
In the search do the following:

Type openssh in the search box
It will search for openssh > click on Net package > click on skip > check the two boxes that pop up.
Click on next till you finish the install
Search for cygwin and then right click it and "Run as Administrator"
Type ssh command in the command line of cygwin
You will see something similar to the following:

SSH client not found on cygwin64?


Get the number of SOQL calls in manage package

Question: My org has a manage package installed. Is there any way to detect how many SOQL calls it has done in apex? I have code that fires because of it. Once a certain number of SOQL calls have been attempted by the manage package, I'd like my code to do something else.
Comment: Why do you care where the SOQL is coming from? Just check `Limits.getQueries()`.
Comment: doesn't that query only apply to my namespace?
Comment: No, it checks against all the governors that count against the current transaction. It wouldn't include certified managed package code, but if it is a query run from any package that counts against you, it will show.
Comment: Darn, I want to check the certified manage package's SOQL usage. That is what is throwing the error.
Answer: Limits Class will always run in the same namespace it is being run from. So, the limits it returns will be of the same namespace limits and does not include any other namespace limits.
However, you can go to Salesforce developer console > Debug > Change log levels > Add/Change for General trace and set all levels to none but profiling to INFO or more. This will give detailed info on how the managed package limits have increased at each level in whole transaction. Debug log will look something like below (Notice the Pandadoc namespace limits). Using this info, it can be atleast be starting point for implementing something.
Answer: Unless the managed package exposed a method that let you examine this data, there's no way you would be able to tell in Apex. You might ask the vendor if they would add such a method. For example, they might add a Debug class, like this:
global class Debug {
  global static Integer getLimitsQueries() {
    return Limits.getQueries();
  }
}

They could do the same for other statements as well. This could give you insight via Apex. Aside from this technique, there's no way to know without reading debug logs, which would not be readable inside the same Apex transaction.
Comment: I wanted to propose this but I was somewhat skeptical whether this will even work - because - 1. this has to be separate class/method to get the limits. 2. Within 1 dml (by calling getLimits before and after dml), the difference in limits may shoot up (like, from 10 soqls to 50 soqls). 3. Because of that, @TylerZika cannot really do something when soqls hit 30. Am I thinking correctly?


Primitive Fertility Treatments?

Question: We're all aware of modern-day fertility treatments, like artificial insemination and hormones, but are there less advanced ways to trigger ovulation and/or otherwise boost fertility? What methods might a medieval-level society use that actually work in making women more fertile?
Comment: I've never heard of a population of which the development was limited by the fertility of women. Can you give an example of a medieval society which suffered of having too few children? Which is to say, what problem are you *really* trying to solve?
Comment: I was thinking more of a scenario when a women, especially a wealthy one if the method was expensive, was having trouble conceiving, not a society-wide thing.
Comment: How is this about building a fictional world? Depending on how you read this it's about either our modern understanding of medicinal herbs, or how "medicine" was practiced in the middle ages.
Comment: @sphennings How is this different from all our other how could I do X in the middle ages questions?
Comment: @Bellerophon "Could you build a space laser in the middle ages?" is asking about the possibility of a space laser in an alternate middle ages. This question isn't asking about an alternative middle ages but about the middle ages as they were.
Comment: @AlexP while there was no problem on the population level, some men and women were barren  (of course, most of the time it was considered to be a female problem). These people were seeking fertility treatments because they needed to produce heirs. There were also plenty of rituals and traditional remedies to get pregnant faster.
Comment: @Preg-Fan perhaps if you narrow the scope to known working traditional fertility treatments (e.g. herb medicine) people will be kinder to your question.
Comment: @Olga: The question literally asks for a medieval method to *"make women more fertile"*. It's only in the comments that the inquirer clarified that they wanted to ask about how to make *one* woman fertile.
Answer: Lots of plants were believed to assist with this and other issues. Some have been found to actually increase the requisite hormones or other things that are needed. Here is a link to some modern ideas, but more primitive outfits may have had others learnt through trial and error.
Fertility Herbs
My own society utilised (still does) several plants for many things which in the absence of scientific study are still pretty convincing in practice. As a personal example my daughter just recovered from dengue fever which is a very painful and sometimes dangerous disease spread by mosquito's. The hospital provided painkillers to alleviate the symptoms which didn't do much, but an infusion made from a native recipe took away all symptoms within a day.
We also have recipes that abort a fetus and others for fertility, but I have no personal experience with them. Most stuff is absolute crap and charlatans abound, and we jail people for witchcraft, but there are families of specialists who have a knowledge of native medicine that goes back hundreds of years and seems to work.
Answer: If you want to go the HCG way...

Human chorionic gonadotropin interacts with the LHCG receptor of the ovary and promotes the maintenance of the corpus luteum during the beginning of pregnancy. This allows the corpus luteum to secrete the hormone progesterone during the first trimester. Progesterone enriches the uterus with a thick lining of blood vessels and capillaries so that it can sustain the growing fetus

and

Naturally, it is produced in the human placenta by the syncytiotrophoblast. Like other gonadotropins, it can be extracted from the urine of pregnant women or produced from cultures of genetically modified cells using recombinant DNA technology.

Just drink it without distillation.
Answer:
Lots of sex.
Of course it increases your odds.  But maybe aside from the sperm being around sex changes the situation in other ways?

http://www.futurity.org/sex-fertility-pregnancy-1020932/

"It's a common recommendation that partners trying to have a baby
  should engage in regular intercourse to increase the woman's changes
  of getting pregnant—even during so-called 'non-fertile'
  periods—although it's unclear how this works," says Tierney Lorenz, a
  visiting research scientist at the Kinsey Institute at Indiana
  University. "This research is the first to show that the sexual
  activity may cause the body to promote types of immunity that support
  conception.

I am suspicious that the lots of sex might not need to be with the eventual father, or even with a man.  But if it is some sort of social mid / body thing you probably would need a partner.
2.  Spend the night with the Rude Man.

An anatomically correct, club-wielding chalk figure carved into the
  hillside near a village in Dorset, the "Cerne Abbas Giant" (also known
  as the "Rude Man of Cerne") has become a figure of local folklore, and
  legend has it that women who want to get pregnant will find their
  wishes fulfilled after spending the night sleeping atop the figure.
  Curiously, figures from the UK's Office of National Statistics show
  that local women are significantly more fertile than average—they have
  twice the number of babies as Britons nationwide.
  http://mentalfloss.com/article/64179/8-unusual-places-people-visit-when-hoping-conceive

L.Dutch don't you own a club like that?  In any case, in this category falls supplication for divine intervention of all sorts: fertility gods, goddesses, saints, and so on,
3.  Crawl through the magic stone.

These standing stones in Cornwall, which may date to the Bronze Age,
  look like they spell out "101." They've given rise to a variety of
  legends: changeling babies passed through the "O" will revert to human
  form, children with rickets will be cured, and a woman who passes
  through the stone seven times on a full moon will become pregnant.

http://mentalfloss.com/article/64179/8-unusual-places-people-visit-when-hoping-conceive
Not exactly the same as the deities - this is more animist.  Items have fertility power.  There are loads of magic phalluses all over the world that serve this role. Not sure how to categorize statues but there are statues that supposedly have pro-conception power also.
4.  Supernatural dad shows up.
Genesis 19: 9-14, Genesis 21:2-3

9And they said unto him, Where is Sarah thy wife? And he said, Behold,
  in the tent. 10And he said, I will certainly return unto thee
  according to the time of life; and, lo, Sarah thy wife shall have a
  son. And Sarah heard it in the tent door, which was behind him. 11Now
  Abraham and Sarah were old and well stricken in age; and it ceased to
  be with Sarah after the manner of women. 12Therefore Sarah laughed
  within herself, saying, After I am waxed old shall I have pleasure, my
  lord being old also? 13And the LORD said unto Abraham, Wherefore did
  Sarah laugh, saying, Shall I of a surety bear a child, which am old?
  14Is any thing too hard for the LORD?
  1And the LORD visited Sarah as he had said, and the LORD did unto
  Sarah as he had spoken. 2For Sarah conceived, and bare Abraham a son
  in his old age, at the set time of which God had spoken to him.

Swapping out one or the other partner is a time tested way to get a baby, and in fact one used by the aforementioned Sarah who sent her handmaid to have babies with Abramam when Sarah could not get pregnant.  If your intended mother is 99 years old it helps to have the new partner be the LORD.
5.  Weight loss..  For medievals, you can't go wrong with Aristotle.  And Aristotle noted that being fat tended to impair fertility.
https://en.wikisource.org/wiki/On_the_Generation_of_Animals/Book_I

Some have much semen, others little, others again none at all, not
  through weakness but the contrary, at any rate in some cases. This is
  because the nutriment is used up to form the body, as with some human
  beings, who, being in good condition and developing much flesh or
  getting rather too fat, produce less semen and are less desirous of
  intercourse. Like this is what happens with those vines which 'play
  the goat', that is, luxuriate wantonly through too much nutrition, for
  he-goats when fat are less inclined to mount the female; for which
  reason they thin them before breeding from them, and say that the
  vines 'play the goat', so calling it from the condition of the goats.
  And fat people, women as well as men, appear to be less fertile than
  others from the fact that the secretion when in process of concoction
  turns to fat with those who are too well-nourished.

The view that obesity opposed fertility was later echoed by various medieval physicians.  It is actually a pretty good idea.  Certainly estrogen excess from adiposity can compromise fertility especially in women.
6.  Potions.  There are any number of wild potions containing animal elements or vegetable elements thought to promote fertility.

Primitive Fertility Treatments?


Sentence pattern for asking "should I do A or B?"

Question: We commonly encounter situations when there are a number of options and we would like to ask for instructions as to which option to choose. Here is a real example from my recent experience. I was trying to fill in a form but was not sure what to write in a box. I then asked

この欄に、携帯番号を記入しますか?それとも、空白にしますか?

In English, the direct translation would be

In this box, will I write my mobile number? Or, will I leave it blank?

But what I really wanted ask was

In this box, should I write my mobile number? Or, should I leave it blank?

In situations like the above, what sentence pattern in Japanese should I use?
Perhaps sentence patterns are not exactly the right thing to ask for. I think I might be digging into modality here, and would be grateful if someone could elaborate on this.
Answer: verb(plain form) + "べき"
In your example, "この欄に携帯番号を記入するべきですか?それとも、空白にするべきですか?".
Example
記入する + べき = 記入するべき(I should write)
食べる + べき = 食べるべき(I should eat)


Rummikub Joker Rule Question

Question: Can you use a rummikub joker tile in an existing run?  Or must a joker always be replaced in order to use it?
Answer: While a joker is on the table it retains the number and colour set when it was initially placed.
This means it can be used as part of a players manipulation, as long as the number and colour needed are the same, and all sets are valid at the end of the manipulation.
The joker only needs to be retrieved if it's wildcard abilities are required for placing a set.

Rummikub Joker Rule Question


Does LIGO insulate against radio waves?

Question: I haven't actually been able to find any information about this, I know LIGO insulates against certain types of EM radiation but I was wondering about radio waves in particular. Can anyone help?
Comment: I am sure you have seen  this ambiguous line on the LIGO website: **In fact, electromagnetic radiation from space is so unimportant to LIGO that it is completely isolated and sheltered from the outside world. LIGO cannot (nor does it need to) see anything. Rather, it 'feels' for invisible gravitational waves.** This could mean yes or no, or just from space, but if you concentrate on the details of the detector, you might see something that you think would be sensitive to long wavelengths. But I **think** it's not affected.
Comment: And how would radio waves affect the operation of LIGO? Start there, and then figure out if you should be worried.
Comment: Ligo searchs for a specific patterns set. Any perturbation that hasn't a good pattern or which cannot hide the targets is allmost ignored
Comment: I had the idea that, if the idea of spacetime were incorrect, that the waves could propagate in a background of radio waves from space.
Answer: I think it is likely there was not much to worry about from space or other radio waves. I have not found anything, but have not done the calculation. You can start by comparing what it might do compared to noise sources they needed to deal with.
Because it had to detect distance changes of 1/10 the size of the proton even small perturbations had to be dealt with.
The electromagnetic perturbations were mostly from the laser light imparting momentum to the detectors, and the scattered light adding random phase fluctuations. I saw something also about 'radiation' noise, and not sure that involved radio noise. See a summary of the effects in the advanced LIGO summary page at https://advancedligo.mit.edu/summary.html. More on the effects from electromagnetism (the laser) below, but first a bit of the physics of why. See also the main site at http://ligo.org/.
I'm sure you know the basics, but to be semi-complete on the why. The detections are based on very small deformations of space where orthogonal directions from the waves are alternately compressed and expanded, what is called a quadrupole mode. The two orthogonal legs of the interferometer will then involve light which travels less or more in one leg that the other, and will add vectorially at the detector, and due to the phase changes the resulting amplitude and intensity will change. These are converted into electrical signals and processed. Thus, anything that could possibly also move the detectors or mirrors along the two legs can cause a false a alarm (nothing else can change enough the distance along the two legs, only gravitation can), and any un-correlated movement in just one leg still represents noise. The signal processing is pretty interesting but that's not the question. And they needed to eliminate random fluctuations as well as non-random signals that are not due to gravitational waves e.g., they ran them in a vacuum so air or thermal fluctuations moving the air would not happen. Also they needed to isolate out the tidal effects from the sun and moon (even though different frequencies, just too loud).
The main source of competing inputs into the detectors is of course from seismic motion, i.e., ground movement. Trucks, other vehicles, and a myriad sources such as machinery and ground effects or vibrations can be stronger than the gravitational waves, and need to be suppressed. The team spent a lot of time and energy doing all this, including hydraulic isolators, a 4 pendulum suspension system as well as active cancellation (detect and counter or subtract). Of course, any changing mass variations near the detectors also needed to be suppressed. There were plenty of other noise issues.
Electromagnetic signals could also transfer momentum to the mirrors and detectors, though much smaller than the seismic noise. The laser light itself used for the interferometer transfer momentum to the mirrors and detectors, and scattered light causes random fluctuations (it is basically random scattering and the resulting random noise). The lasers themselves also have phase, freq and amplitude noise fluctuations. All of those were minimized through design. Part of the design was to have the largest baseline they could get consistent with the gravitational wave wavelength -- the longer the arms the larger the signals, but noise tends to stay the same. [eLISA, a space based interferometer, planned for the mid 2020's, will have 1 million km legs, and be looking for larger wavelengths, that is larger sources of gravitational waves]. In LIGO they also used massive mirrors and detectors to minimize motion from the extraneous momentum imparted to them.
Figure out the momentum from the laser 4 kms away, or the incident energy, and see how some estimates of radio sources powers compare. For reference, radio waves from wireless antennas typically will arrive at about -100 dBm (plus or minus depending) if you're a mile or two in normal terrain. Of course after all the scattering they probably will be random, weaker, and not directional. Inside a building mainly if they used metal in the tunnels it would be infinitely or so less. Space based radio waves will be much weaker, from anywhere anytime.
Answer: I've seen a couple of talks where they specifically talk about this.  My understanding is that they don't particularly "insulate" against radio waves (although the metal structures likely do a good job regardless), but they certainly monitor for them.  They have a huge number of different EM sensors along the beams at each site --- so that if there is any large EM signal they can simply exclude that section of data.
Especially with only 2-dominant detector sites (the 2 US LIGO sites), Atmospheric sources of correlated interference are a big concern (along with geological effects).  Apparently one of the things they've explicitly worried about is types of atmospheric or orbital military tests that could produce significant correlated interference between detector sites --- which is part of why they include EM sensors across the spectrum.  Additional detector sites (e.g. VIRGO and INDIGO) will significantly help alleviate both seismic and EM concerns.
While I really like @BobBee's answer above---it's a good one, it does neglect the effects of EM interference on the electronics, i.e. producing a signal without physically moving the test-masses.

Does LIGO insulate against radio waves?


How to create forwarder wallet in Ethereum?

Question: I have more than one ETH wallet. I want to automatically combine these wallets into one wallet. For example, when I get an ETH in wallet 0x1, I want it to automatically transfer it to wallet 0x2. Can I do this with a smart contract? Or how can I do it?  Can you help me?
Answer: You can use a simple contract with a payable fallback function for this. For example:
pragma solidity 0.7.0;

contract Forwarder {
  address payable owner;

  constructor (address payable _owner)  {
    owner = _owner;
  }

  fallback () external payable {
    owner.transfer(msg.value);
  }
}

Every time ETH is sent to the contract, the fallback function is called, which forwards the ETH (msg.value) to owner.
Comment: Thank you but that's not what I want.  I want it transferred when ETH comes to my A wallet, not a contract.
Comment: You asked "Can I do this with a smart contract?", if you don't want to use a smart contract, you'll have to set up some kind of system that checks for incoming transactions, and automatically sends a new transaction. You can't pull ETH from an address with a smart contract.
Answer: You can do it using a forwarder wallet, you instruct your user to transfer to an address which will automatically transfer inbound funds to a parent/central wallet.
Here's a project i created doing the same: https://github.com/farirat/solidity-forwarder-wallet
Run the tests and you will get the complete workflow.


Is Belief in the Historical Accuracy of Gospels a prerequisite to Christianity?

Question: Is it a requirement of the faith that all adherents must believe in the literal flow of events as conveyed by the Bible surrounding the life of Jesus Christ?  Is it possible for someone to accept his teachings as presented, while still doubting or even disbelieving entirely some or all of the events presented therein?  Is it necessary to be fully convinced in the events of the Passion, the betrayal of Judas, and all of the events contained therein to be a Christian?  If not, were is the line drawn?  Is it necessary to believe that Jesus actually walked on water, or can that tale be accepted as a morality tale without accepting that it literally happened?
Answer: Personally, I do believe all events portrayed actually happened.
However I do not think there is any requirement in Christianity that you understand or even believe everything just perfectly so -- cross your t's and dot your i's -- in order to be saved. You can not be convinced of the exact details in the gospel accounts and still believe in Jesus as savior. Do you or do you not believe that He is Lord, the only way to the Father, the one who secured God's forgiveness for your sins? If so then there is lots of grace for our doubts and confusions.
My question in return would be: Why? What is the point? Also, how did you get there? Let's take the walk-on-water example. If you believe Jesus is who he said he is, something had to convince you of that. If the accounts we have of His miracles are to be distrusted and discarded, how are we to trust the accounts of His teachings about being the only savior of men? If his disciples fabricated the story of His walking on water, what business have we to trust the teachings they spread throughout the area in the years following?
There is room in Christianity for all manner of mis-directed beliefs. Our salvation depends on the person and works of someone else, not our own. We would all be damned if we had to get every detail right. However, if we HAVE been saved, I think it is part of our calling to learn as much about Him as we can as rightly as we can. There is no excuse for deliberate disbelief or being picky-choosy just because you don't LIKE something that He taught.
Comment: @GWLlosa: 2000 years is irrelevant, the part that's a concern is the first 80 years or so. After that we have a large corpus of copied texts that all indicate the same thing. However, this is actually one of the best explanations for "why are there 4 gospel accounts"? The assorted witnesses we have to the events of Christ's life and teachings -- all in different words and styles -- point us in EXACTLY the same theological direction. The lack of doctrinal conflict between them in spite of the varied viewpoints is one thing that helps us trust their historical as well as doctrinal accuracy.
Comment: @GWLlosa: The number of manuscripts and their the lack of deviation between them for the NT record is actually in a league of it's own as far as textual criticism goes. Here is one [link I just found on the subject](http://carm.org/manuscript-evidence).
Comment: @GWLlosa: Actually there are dozens of them. About every other year National Geographic does some special on a new one. The thing is, none of them are relevant to Christianity. They all trace to sources or secs outside Christianity, often several hundred years later after the reliable original texts that we have. They almost almost all have agendas other than representing who Christ was and what he taught. They are not first-hand reports. If you have questions about a specific one of these that would probably be an appropriate question to ask here.
Comment: I think much doubt can be found/encountered in the fact that even if you completely believe in the divinity of Jesus Christ, the stories of his life and times have been passed down to us via your everyday fallible human being.  It seems natural to assume that things could be lost/distorted/misinterpreted over 2000 years of history;  the fear is that some of those mistakes/errors may affect some fundamental tenet of the faith.
Comment: Weren't there other texts from that era?  I hear about gospels of everyone from Judas to Mary Magdalene from time to time.  So isn't it possible that the 4 gospels agree so well because some later fallible humans picked the 4 that agreed and discarded the rest?
Answer: I guess you can take the bible on blind faith. It is not the most potent witnessing tool though (Blind faith that is).
The historical basis should be the starting point for any talks with non believers as the take a logical stance on these matters of facts. Something that usually garners respect from the naturalist in the crowd.
We are lucky that we have a religion that intersects with the physical world in a very real way. It does give it a great deal of credibility. So it should be every Christians ace up his sleeve.
Answer: I once had a deacon say to me "Everything in the Bible is true. And some of it actually happened."
Basically I believe most of what is in the New Testament happened, or something close to it.
In the Old Testament, I believe some of the historical stuff like where they are talking about which kings did this and that (it seems as believable as any other history), but in the earlier books like Genesis where they talk about Noah and the Ark and Jonah and the whale and those stories, not so much.
Comment: Jesus believed in the "stories" of Jonah and Noah


how to embed exe file to pdf?

Question: Im trying to embed exe file to pdf for case study.
I try using metasploit exploits for this but i can only embed shellcodes with this method.
I know there is a way to embed exe file but i cant find one
Suggestions?
Thanks.
Comment: Define what you mean by 'embedding'. If you want to just hide an exe, that is different than making the exe run when the pdf is opened.
Comment: First off, are you sure that embedding an exe in a PDF is possible? Do you have a source for wanting to go in this direction?
Comment: i know there is binders that can make it work but i cant find good one
Comment: embedding its better but if i cant do it so bind exe to pdf its ok too
Comment: @kobiperetzz, just so we are clear, you want to just add the exe file to the pdf right?
Comment: Embed exe can only work with Adobe Reader 9.x and 8.x (noted in the module source as well). If you bind the executable with the PDF, the resultant file will be an executable.
Answer: If all you are wanting to do is add an exe (or any file) to a pdf (or any file) then you can simply add your file to what is called 'slack space'. There are tools out there that do this and add many features but you can also do this by hand using a hex editor (like HxD).
To do this by hand:

open a hex editor.
open your pdf in the editor.
open the exe in the editor (in another window).
copy the exe hex values into the pdf hex values (after pdf file end).
save your new 'pdf', it will still open and operate as a pdf but your exe file will be there as well and you (or anyone) can extract the exe.

also, you may be interested in embedding javascript in a pdf. This alone is nothing new, but this can be used maliciously...
Comment: Embedding the executable code after the PDF EOF can only hide the code in the PDF file and it won't be executed. I am not sure how it will benefit the OP since he is asking about it for attacking (assuming because of Metasploit).
Comment: That is what I was trying to verify with the OP. You do not simply `embed` exe's so I assumed the OP is asking for just how to hide the data... [hehe](https://imgflip.com/i/de7md)
Comment: Hence my very first question in the comments. The OP is very unclear about what he wants to do.
Answer: My quick research suggests that with the metasploit framework, you can use the download+exec shellcode to download and execute your code.
I wouldn't doubt that you could "download" the executable from the embedded code in the PDF (from Matthew Peters's answer), and execute it once it has been extracted.

how to embed exe file to pdf?


Definition of the domain of a partial function

Question: I have seen various places define the domain of a partial function $f$ on $S$ to be the set $S'\subseteq S$ of elements that $f$ is defined on.  So then what do you call $S$ in terms of $f$?  You can't call it the domain of $f$ because that word is taken already.
Answer: You call it... $S$. There's no name for it in terms of $f$, because there's always a still larger set $T\supsetneq S$, and then what would that be called in terms of $f$? Typically, $S$ is fixed in context -- it's, for example, the reals $\Bbb R$, or the positive reals $\Bbb R^+$, and so on. $f$ simply doesn't carry information about possible supersets of its domain; the context does.
Comment: Well people talk about the codomain of a function.  By an analogous argument to what you said, this is ill-formed, as the function $f: A\rightarrow B$ carries no information about $B$.
Comment: It's not ill-formed, but you're right it's symmetric with what I said about "partial functions". What you observe about codomains is *usually* true. To address that problem, Bourbaki uses a different definition: in their volumes, a function is a *triple* $(G_f, A, B)$, where $G_f$ is the graph of the function [which we typically consider the function itself], $A = domain(G_f)$ and $B\supseteq image(G_f)$ is the codomain. This makes it possible to be more precise about some things, while making other things awkward that hadn't been. There are tradeoffs :)
Comment: Right. In the case of functions, the condition $\textrm{im}f=B$ is important (surjectivity).  I think the condition $S=S'$ is important for similar reasons so it would be nice to have a way to talk about it.
Comment: Well, in context there always is: "$f$ is a *total function* [on $S$]". E.g. in computability theory, partial functions are in a sense the main objects of study, and in practice no confusion arises.
Answer: Maybe it's wise first to establish a definition of a partial function that we can all accept, and then address your question from there. This definition is motivated by a wikipedia article about "Partial Functions":
A partial function $f$ on $S$ is a function whose domain is contained in $S$.
From this, and, relative to your question, the only way to relate $f$ back to $S$ is simply by saying $\text{dom}(f) \subseteq S$.
That is, a function $f$ is a partial function on a set $S$ iff $\text{dom}(f) \subseteq S$.
Answer: In "Mathematical Analysis I" by V.A. Zorich (section 1.3.1) the author uses the term domain of departure of $f$ for your set $S$ (he also uses the term "domain of arrival of $f$" as a synonym for the codomain of $f$):

We see that it is sometimes necessary to consider a function $\varphi: A \to Y$ defined on a subset $A$ of some set $X$ while the range $\varphi(A)$ of $\varphi$ may also turn out be a subset of $Y$ that is different from $Y$. In this connection, we sometimes use the term domain of departure of the function to denote any set $X$ containing the domain of a function, and domain of arrival to denote any subset of $Y$ containing its range.


Two cards are drawn from a deck of 52. Let event A be that two cards have the same value and event B be the same suit. Are these independent?

Question: I'm not sure that I totally understand independent events. If the cards are the same suit or rank, then they have a 13/52 and 4/52 probability, respectively. However, I'm not totally sure how these two events relate to one another. I believe that they are independent.
Comment: The are not independent, since they cannot both happen at the same time.
Answer: Mathematically, two events $A$ and $B$ with probabilities $P(A)$ and $P(B)$ are independent if
$$P(A \mid B) = P(A);$$ that is, if the probability of event $A$ happening, given that $B$ happened, is the same as the probability of $A$ happening with no other information.
We don't even need any computations for your problem. If we pick up two cards and they're the same suit, could they possibly have the same value?
Comment: They are independent if $P(A\cap B) = P(A)P(B)$
Comment: They are also independent if $\: P(B) = 0 \;$. $\;\;\;\;$
Answer: Mutual Exclusion and Independence seem to cause beginners a lot of unnecessary confusion.   They are more or less on the opposite ends of a spectrum.
Events are independent if they have no influence on each others' occurrence.    The measured probability of one event happening is not affected by knowledge that the other event happened.   The conditional probability is $P(A\mid B) = P(A)$, which leads to the joint probability being $P(A\cap B) = P(A)P(B)$.  (This is the Product Rule for Independent Events.)
Events are mutually exclusive if they influence each other to such an extent that they cannot occur simultaneously.   The knowledge that one event happens completely affects the measure of the probability that the other event happened; it could not.   The conditional probability is $P(A\mid B)=0$, which leads to the joint probability being $P(A\cap B)=0$.
For mutually exclusive events, the Additive Rule is $P(A\cup B) = P(A)+P(B)$.
For independent events the probability of the union is $P(A\cup B) = P(A)+P(B)-P(A)P(B)$.
In this case, since two cards drawn from a standard deck cannot simultaneously have both the same value and the same suit, the events are mutually exclusive.
Comment: @r.e.s. Acknowledged and corrected.  Thank you.
Answer: The definition of independence for two events is $P(A\cap B) = P(A)P(B)$. Regardless of what something seems, if you can achieve the probability of the two events this way, they are independent.  Having said that, does knowing one give you any information regarding the other?  If not, then they are likely independent. This is shown using conditional probability: $P(A \mid B) = P(A)$.
What you are dealing with here is slightly different.  The two events are mutually exclusive. Like the commenter said, they cannot occur at the same time. Mutually exclusive events are described by $P(A\cap B) = 0$, which is a little different.
That is discussed here What is the difference between independent and mutually exclusive events?
Answer: As is so often the case in stats, the formal definitions and equations get in the way of meaningful and intuitive understanding for beginners.  So here's a simple explanation without equations that should make intuitive sense.

We say that two events are "independent" of each other if the occurrence of one has no impact on the occurrence of the other.
We say that two events are "mutually exclusive" of each other (also called "disjoint") if they can't both occur at the same time.

If you think about it, you can see that mutual exclusivity is a special type of non-independence.  That is, we have mutual exclusivity when the occurrence of one event impacts the other event in such a way as to reduce the likelihood of the other event to zero.
Here, let's say we've picked two cards from a deck. Event A is those cards having the same value, and Event B is those cards having the same suit. The two events are not independent, since the occurrence of Event A will have an impact on the occurrence of Event B.  In fact, since Event B can't happen if Event A does (and vice versa), the occurrence of one reduces the likelihood of the other to zero, so we have an example of our special case of non-independence that we call mutual exclusivity.


Google Authenticator Error on Reboot

Question: I have set up an SSH server to accept only login using codes generated by Google Authenticator (I have disabled all other forms of authentication on that port). After having rebooted my remote machine, it keeps giving me the Access Denied error after having entered the code on the authenticator app. It has been working flawlessly up till now (i.e. before the reboot).
So far, I've logged in using a scratch code (which it accepts), and have tried generating a new secret and scanning this new QR code with the Google Authenticator app and testing it using another terminal, all to no avail. I have also tried deleting the libpam-google-authenticator module and reinstalling it, generating another code and trying to login again from another terminal. This also didn't work. What could possibly be going wrong?
Comment: Is the server's time correct?
Comment: Public key authentication want enough eh? :P
Comment: @Nick: PubKeys force me to stick to 1 computer, but I have to be more mobile (I sometimes use computers at work). Keys are great, as long as you're happy to carry around a key-holder :-)
Comment: @user2313067: Good point...I checked and it was waaaay off. After correcting that using `ntpd -qg`, it worked again like a charm!!
Answer: Like @user2313067 pointed, this problem is happening probably because the clock of your server is with wrong time.
Google Authenticator is an implementation of OTP (One-time password) and it is based on a private seed and on time to check if the code you are entering is correct.
Comment: This is the correct answer, however, it was posted in a comment to the question almost 6 months ago by @user2313067.  You could have at least given him/her credit for the correct answer.
Comment: @ChrisMurray I am sorry, I am new here and I am trying to help, so I answered a lot of questions yesterday and I didn't see the user2313067 answer. Updating my answer right now. Thanks and sorry again.
Comment: @ChrisMurray Done!

Google Authenticator Error on Reboot


My matrices are non-negative,stochastic, irreducible and aperiodic, I want to know whether they always converge in power iteration.

Question: I am working on a problem of SCC graph. The matrix representation of graph will be a square non-negative matrix that is column stochastic, irreducible. I will make it aperiodic by adding a self-loop on each node so that I can use the power method.
I will write a program of power method. Now I want to know whether my matrix always converges.
I know that diagonalizable matrix always converges. But if my matrix is not diagonalizable for some graph then will it converge? So what should I do if I want my matrix to converge always? Or my matrix's property(non-negative, stochastic, irreducible, aperiodic) is enough to converge always?
(My program will take input any SCC graph, I will add self-loop on each node.  And write a program of power method. )
Comment: what does it mean for a matrix to converge?
Comment: We can get the dominant eigenvalue of a square matrix if it is Diagonalizable and has s dominant eigenvalue by power method. If the matrix has a dominant eigenvalue then in power method the initial vector converges to a dominant eigenvector value. @DanRust
Answer: Your matrices are primitive which means that every entry is a positive real number. In particular, it means that we may apply the Perron-Frobenius theorem, one consequence of which is that if $M$ is a primitive matrix with (dominant) PF-eigenvalue $\lambda$, and associated left- and right-PF eigenvectors $\textbf{l},\textbf{r}$, respectively (normalised so that $\mathbf{l}^T\mathbf{r} = 1$), and we have $$\lim_{n \to \infty}M^n/\lambda^n = \mathbf{r}\mathbf{l}^T.$$
Is that the kind of thing you were looking for?
Comment: Sorry yes, I forgot to mention you can be primitive also if some power is positive. The result that I mentioned is true in general, without assuming diagonalisability.
Comment: Sir,my matrices are primitive but not positive,but some power of it is positive. I know my matrix is primitive and the Perron-Frobenius theorem is applicable here. I am working here with only the right eigenvector. I know that dominant eigenvalue is 1 and all other absolute value of eigenvalue is strictly less than 1 according to PF theorem. But I have seen in some blogs/books that a matrix should be diagonalizable for power method to work.  I want to know whether it is true that only diagonalizable matrix converges? What about my matrix? @DanRust


What does the rewiring probability for a small-world network indicate?

Question: A large rewiring probability for a small-world network means the network has more randomness. Does this mean anything deeper, and can it be determined for a real (i.e., empirical) network?
Comment: Question is too vague.
Answer: The Watts–Strogatz model is, well, a model. It allows you to investigate how order and randomness affect phenomena happening on the network in simulation.
For example, Watts and Strogatz (and many others) investigated how the rewiring probability affects synchronisation phenomena of oscillators coupled as per the respective network. This happens in simulation studies, where you first construct an artificial network, instead of starting with a real one. The strength of the WS model is that it allows you to tune the randomness (via the rewiring probability) while leaving the other properties of the network mostly unchanged.
Of course any insights gained by such a study are limited to the WS model and you might find other network where the effect of randomness is inverted. Thus one needs to take care before generalising claims and study other network models or understand the mechanisms underlying the observed effect.
More generally, the WS model only describes a narrow subspace of all networks¹. For example, Barabási–Albert networks are not included and there is no reason to expect that any real network is perfectly described as a WS network¹.

The rewiring probability describes a technical aspect of the algorithm that generates a model. Therefore it cannot be deduced from a real network just like that. Real networks do not form via rewiring and you usually cannot observe their formation. A reasonable for the rewiring probability is the number of long-ranged connections and you might approximate the latter if the underlying geometry of a network is clear and you can separate short-range and long-range connections. For example, you might consider a social network and define every edge between people living more than 100 km apart a long-range connection. But that already makes the bold assumption that your network lies in the Watts–Strogatz subspace¹.
What some people did (and probably still do) instead is to deduce a "randomness" from the normalised clustering coefficient ($C$) and mean shortest path length ($L$) of a network. A lower $C$ and $L$ are considered to indicate a more random network. This is similar to looking at the so-called small-world-ness of a network and has similar problems. Most importantly, the mean shortest path has severe robustness problems.
But even if you can somehow overcome those, it is still based on the assumption that you are in the narrow WS subspace of networks¹. In the very likely case that you are not, a network may just have a lower $C$ and $L$ because it is objectively more random but because due to differences unrelated to randomness.
For a blatant example, a perfect chequerboard lattice with a few added long range connections can have a small $L$ and $C=0$ (since no long-range connections) and thus would be considered very random by this approach. Yet it is certainly not what any reasonable person would call random.
I therefore consider it not possible to deduce a "randomness" via clustering coefficient and mean shortest path length from empirical networks.

¹ Strictly speaking, the Watts–Strogatz model includes every network since a completely random network can be every network with equal probability. For example, a completely random network might turn out to be a perfect chequerboard lattice (which is not included in the usual WS model) as likely as any given objectively random network. However, a random network is much more likely to be objectively random than resembling a lattice in any way. So, to be precise: When I say something that a network is not included by the WS model, I mean that the WS model is very unlikely to produce a network with similar properties.


Fast Private Set Intersection from Homomorphic Encryption

Question: I encountered a question while reading an article. My understanding is that fully homomorphic encryption supports ciphertext addition and multiplication. Why does the basic protocol given in this article include ciphertext subtracted by plaintext?
Answer: In FHE schemes, an operation between a plaintext and a ciphertext can be performed by first encrypting the plaintext using the scheme's public key and then evaluating the corresponding operations (e.g., ADD or MULT) over ciphertexts.
However, because the plaintext is "known" (in this case it is known to the sender), in many cases it is not necessary to compute a random ciphertext, which can be more efficient in practice.


How does Phrases in Gensim work?

Question: I am using Gensim Phrases to detct n-grams in my text. Thus, I am interested in knowing the mechanism that Phrases uses to detect these n-grams in the text. Can someone please explain the mechanism used in Phrases in simple terms?
Answer: As the gensim tool cites the very famous paper by Mikolov - "Distributed Representations of Words and Phrases..." using which it is implemented. In the paper if you look at the section "4 Learning Phrases" they give a nice explanation of how n-grams are calculated (Equation 6).

So, if want to count bigrams this formula is straight-forward; score(wi, wj) is the score between any two words occuring together. But when counting trigrams, 'wi' will be a bigram and 'wj' will be a word. And same follows for any number of grams.
Answer: Gensim detects a bigram if a scoring function for two words exceeds a threshold (which is a parameter for Phrases).
The default scoring function is what is in the answer by flyingDope, but multiplied by vocabulary size (use help(Phraser) or see the gensim's Github repository (gensim/models/phrases.py)):
def original_scorer(worda_count, wordb_count, bigram_count, len_vocab, min_count, corpus_word_count):
   #...
   """
    worda_count : int
        Number of occurrences for first word.
    wordb_count : int
        Number of occurrences for second word.
    bigram_count : int
        Number of co-occurrences for phrase "worda_wordb".
    len_vocab : int
        Size of vocabulary.
    min_count: int
        Minimum collocation count threshold.
    corpus_word_count : int
        Not used in this particular scoring technique.
    """
    #...

    return (bigram_count - min_count) / worda_count / wordb_count * len_vocab

Another implemented score function is npmi_scorer based on a paper by G. Bouma.
I think n-grams for n>2 are done by applying bigram detection n-1 times.
If min_count (i.e. $delta$) was zero and if instead len_vocab we multiplied by corpus_word_count, then the result of original_scorer would be essentially the ratio of the probability to see wordb following worda and the unconditional probability to see wordb at a random position, that is how many times the presence of worda increases the probability to see wordb in the next position.
I cannot understand why gensim chose to use len_vocab here, but perhaps they had some reason to. You can pass your own scoring function as well.

How does Phrases in Gensim work?