Q: Is there a way to include both WICTextureLoader and DDSTextureLoader without 'redefinition' errors? I'm trying to load a DDS texture. For that, I'm using DDSTextureLoader11 provided by DirectXTex. I already am using another texture loader from the same library - WICTextureLoader11.
The problem is, I don't get errors with WICTextureLoader11, however I do get errors either when including only DDSTextureLoader11, or when I use both of them.
This is some of the errors I get when I include both or only DDSTextureLoader11:
/WICTextureLoader11.cpp:51:17: error: redefinition of 'SetDebugObjectName'
/WICTextureLoader11.cpp:273:17: error: redefinition of 'MakeSRGB'
/WICTextureLoader11.cpp:747:17: error: no matching function for call to 'SetDebugObjectName'
/DDSTextureLoader.h:156:35: error: redefinition of default argument
I first thought that it was because both WICTextureLoader and DDSTextureLoader contain same functions, so when including both they "overlap" (i.e. compiler detects redefinition).
I'm using a batchfile to compile my project, where I link against both DirectXTex and DirectXTK. I also tried to include DDSTextureLoader, but without success: I've read the GitHub page of the DirectXTK's DDSTextureLoader, where I include <DDSTextureLoader.h> that gives me a link error, which I guess is related to the incorrect call of the function CreateDDSTextureFromFile, so right now I'm trying to find a way to make the right call to the function.
Edit: no, it seems like I'm making the right function call. The wrong thing is that I'm trying to include DDSTextureLoader.h, but it also wants DDSTextureLoader.cpp. However, the errors occur when I include DDSTextureLoader.cpp, such as:
'DDSTextureLoader.cpp': call to 'BitsPerPixel' is ambiguous -> 'DirectXTex.h' or 'DDSTextureLoader' error: redefinition of 'SetDebugTextureInfo', previous definition in 'WICTextureLoader'.
I think, what I need is to include the .cpp file, but somehow get rid of the errors.
Edit2: So far, I tried to get rid of DirectXTex (I don't remember why I even needed it), and I've included WICTextureLoader.cpp and DDSTextureLoader.cpp. I downloaded and built the DirectXTK library, then included #pragma comment(lib, "directxtk.lib"). Now, the weird thing is: when I compile with Clang++, it doesn't throw any errors (but the program crashes after a second-long gray screen), however when I compile with cl (through vcvars64), I get fatal error LNK1104: cannot open file 'directxtk.lib'.
Edit3: Wait, I don't even know why I even need the directxtk.lib. So I removed it, and it compiles, but nothing works. I thought I needed that static library to resolve external symbol errors when trying to include the header (XXXTextureLoader.h), instead of the source (XXXTextureLoader.cpp).
Edit4: Wait,wait,wait. I think, I'm going crazy. Now, if I include only WICTextureLoader.cpp (and remove DDSTextureLoader.cpp), it gives me this error: (directxtk.lib) mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease'. I don't know why I did that, but I'm crazy now, I blindly brute-force my way through resolving this cursed issue. Why can't I just throw both headers in my directory and just simply include them? Is there a way to do so? What should I do? Why doesn't DirectXTK/Tex pages on GitHub give a step-by-step guide to how to use these things? The examples drive me crazy!
Please, help me resolve this what seems to be a simple issue.
Edit5: The last thing that I tried is to include DDSTextureLoader.h and WICTextureLoader.h, and use directxtk.lib, but it gives me these errors:
directxtk.lib(DDSTextureLoader.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in main-3dacd8.o
directxtk.lib(pch.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in main-3dacd8.o
LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
I don't use VS, so I don't know how to use /NODEFAULTLIB.

A: You have three choices for loading DDS and other image files with WIC:

*

*Use DirectXTex (the library)

*Use DDSTextureLoader/WICTextureLoader (the standalone versions)

*or use DirectX Tool Kit (the library).
There's no reason to use more than one of them in the same program, and it's going to conflict if you try. See this post.
Unless you are writing a texture processing tool, or need support for the plethora of legacy DDS pixel formats, using DirectX Tool Kit is usually the simplest. The tutorials for DirectX Tool Kit covers this pretty well.
The error you are getting indicates something much more basic to using Visual C++. The DirectXTex, DirectXTK libraries build using the recommended "Multithreaded DLL" version of the C/C++ Runtime (i.e. /MDd and /MD).
The error indicates your program is building with "Statically linked" version of the C/C++ Runtime.
See Microsoft Docs
You didn't mention what compiler toolset you are using other than "not VS".
See directx-vs-templates for a bunch of 'basic device and present loop' samples. If you don't use VS, there are 'CMakeLists.txt' available on that site.

A: I was confused once again with DirectXTex and DirectXTK.
I resolved the issue by:

*

*Removing DirectXTex

*Downloading DirectXTK

*Running the DirectXTK_Desktop_2019_Win10 solution

*Changing the Build to Release and x64

*Opening the properties

*Finding the option Runtime Library

*Choosing Multi-threaded /MT

*Building the solution

In my source file, I include:
#include <WICTextureLoader.h> and #include <DDSTextureLoader.h>
I can now link to the generated static library directxtk.lib, without getting errors.
Plus. If there are people who want to use things like /NODEFAULTLIB:library, but you don't use cl or Visual Studio, you can use the #pragma directive in your source file like this:
#pragma comment(linker, "/NODEFAULTLIB:MSVCRT")


Q: WSO2IS - Disable Embedded LDAP - deployment.toml How can I disable Embedded Ldap on Identity Server 5.10.0 version? I'm checking conf/identity/embedded-ldap.xml and enable property is true.
  <EmbeddedLDAP>
    <Property name="enable">true</Property>
    <Property name="port">${Ports.EmbeddedLDAP.LDAPServerPort}</Property>
    <Property name="instanceId">default</Property>
     .....

I couldn't find how I can disable. If I overwrite this file when docker starts it came back to true.

A: *

*If you have <wso2is-5.10.0-home>/repository/resources/conf/templates/repository/conf/identity/embedded-ldap.xml.j2 file and it's enable property value under <EmbeddedLDAP> is templated as {{embedded_ldap.enable}} (shown below),

<EmbeddedLDAP>
    <Property name="enable">{{embedded_ldap.enable}}</Property>
    <Property name="port">${Ports.EmbeddedLDAP.LDAPServerPort}</Property>
    <Property name="instanceId">default</Property>
.....
</EmbeddedLDAP>

you can use the following deployment.toml config
[embedded_ldap]
enable = false

*If the <wso2is-5.10.0-home>/repository/resources/conf/templates/repository/conf/identity/embedded-ldap.xml.j2 file contains the EmbeddedLDAP config's enable property value as hardcoded to "true", you can change it to false and restat the server to change the config in embedded-ldap.xml.

<EmbeddedLDAP>
    <Property name="enable">true</Property>
    <Property name="port">${Ports.EmbeddedLDAP.LDAPServerPort}</Property>
    <Property name="instanceId">default</Property>
.....
</EmbeddedLDAP>

*If you don't have <wso2is-5.10.0-home>/repository/resources/conf/templates/repository/conf/identity/embedded-ldap.xml.j2 file, the property value changes in embedded-ldap.xml won't be replaced once the server is restarted.

A: In WSO2 Identity Server 5.10.0 the configurations are managed by a centralized toml file which is called as deployment.toml. We can add the following configuration to the deployment.toml file which is located in <IS_HOME>/repository/conf directory.
[embedded_ldap]
enable = false

A: In WSO2 Identity Server 5.10.0 version the file embedded-ldap.xml.j2 doesn't come inside
wso2is-5.10.0/repository/resources/conf/templates/repository/conf/identity so I needed to copy the file from this link: embedded-ldap.xml.j2 and put inside my configuration for docker container conf/is-as-km/repository/resources/conf/templates/repository/conf/identity
docker-compose.yml
...
volumes:
 - ./conf/is-as-km:/home/wso2carbon/wso2-config-volume
 ports:
  - "9444:9443"
...

After that I put the property in deployment.toml:
[embedded_ldap]
enable = false

And everything worked as shown in docker log:
cup-is-as-km ... NFO {org.wso2.carbon.identity.oauth.uma...} - UMA Grant component activated successfully.
cup-is-as-km ... INFO {org.wso2.carbon.ldap.server.DirectoryActivator} - Embedded LDAP is disabled.
cup-is-as-km ... INFO {org.wso2.carbon.mex.internal.Of...} - Office365Support MexServiceComponent bundle activated successfully..

Based on the last answers and comments I reached the solution ;).


Q: Why my picture resolution are very bad with UIImage in swift I use the following function to make picture photoOutput?.capturePhoto(with: AVCapturePhotoSettings(), delegate: self).
When I save the picture his weight is only about 200Ko however the size with the AVCaptureSession.presset is .hight so it's make 1920x1080.
there is m'y prepare function to change view where all "image" var are UIImage :
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
    if segue.identifier == "showPhoto_Segue"{
        let previewVC = segue.destination as! PreviewViewController
        previewVC.image = self.image

    }
}

in my photoOutput function I have :
func photoOutput(_ output: AVCapturePhotoOutput, didFinishProcessingPhoto photo: AVCapturePhoto, error: Error?) {

    if let imageData = photo.fileDataRepresentation(){
        image = UIImage(data: imageData)
        Arrayimages.append(image!)
        Arraytimes.append(Float64(CMTimeGetSeconds(currentCamera!.exposureDuration)))
    }
    if pictureNumber < 11 {
        pictureNumber += 1
        DispatchQueue.main.asyncAfter(deadline: .now() + newDurationSeconds + 0.3, execute: {
            self.photoOutput?.capturePhoto(with: AVCapturePhotoSettings(), delegate: self)
        })
    }
    else{
        image = OpenCVWrapper.hdrImaging(Arrayimages, Arraytimes)
        performSegue(withIdentifier: "showPhoto_Segue", sender: nil)
    }
}

In my OpenCVWrapper.mm I have :
+(UIImage *) hdrImaging:(NSArray *)images :(NSArray *)times{
    std::vector<cv::Mat> imagesVector;
    std::vector<float> timesVector;
    for (int i = 0; i < images.count; i++) {
        UIImage * imageToUse = images[i];

        UIImageWriteToSavedPhotosAlbum(imageToUse, nil, nil, nil);
    }

    //some traitment
    return response;
}

when I use UIImageWriteToSavedPhotosAlbum function my pictures are already compressed but I don't know why and the weight of the file is to small to get good quality !
what can I do to get full resolution of my piture in 1920x1080 ?
maybe with AVCapturePhotoSettings ??
thanks!


Q: 'It ~ that' for emphasis In It-cleft sentences, can which  replace that?
For example,

It was ancient history which attracted me.

A: Yes
The text that you copy specifically says that the relative clause may start with who, whom,. which, that, or have no introductory word at all. Not all oif these will be appropriate in every example. However both of:

*

*

It was ancient history which attracted me.

*

It was ancient history that attracted me.

are correct and idiomatic.  (A use of "who" would not be in this case.)


Q: Update information is outdated
Possible Duplicate:
How can I fix a 404 Error using a PPA?

I can't remove the red triangle in the right upper corner of my desktop. When I type
sudo apt-get update && sudo apt-get upgrade
I get the error message below:
W: Failed to fetch http://ppa.launchpad.net/michael-gruz/canon/ubuntu/dists/precise/main/source/Sources  404  Not Found

W: Failed to fetch http://ppa.launchpad.net/michael-gruz/canon/ubuntu/dists/precise/main/binary-i386/Packages  404  Not Found

E: Some index files failed to download. They have been ignored, or old ones used instead.

How to fix my problem?

A: Have a look at your /etc/apt/sources.list and remove (or fix) those two lines that cause the error 404. After removing the update process can be started again and it will continue updating.

*

*Canon precise page.

Canon printer driver precise
This PPA does not contain any packages yet. Find more information about how to upload packages in the PPA help page.

This is probably the cause for the error 404 (non existing URL).
There is also:

*

*Canon printer driver daily.
deb http://ppa.launchpad.net/michael-gruz/canon-trunk/ubuntu precise main
deb-src http://ppa.launchpad.net/michael-gruz/canon-trunk/ubuntu precise main

But I am not sure if this is what you need.
It could also be this that you need:

*

*Canon printer drivers 2012
Though these only seem valid for Oneiric.


Q: How to pronounce "s" at end of word when next word starts with "s" How do we pronounce "s" at the end of the word when the next word also starts with "s"? For example,

She has some apples: Do we need to add "s" after has and before
  some like "she has s some apples"?
He is single: Do we need to add "s" after is and before single
  like "he is s single"?

A: Has and is are pronounced with a terminal /z/ when they stand alone. In your example sentences, the /z/ disappears and there is only one /s/ sound joining both words.

A: There is no need for an unnecessary s. Some people tend to hold the s on the first word into the last:

He issingle.

Not said quickly, the s is simply held. Others will enunciate clearly, making sure to pause in between the two words for clarity. Personally, I think it is better to enunciate clearly, as you will be better understood by those not familiar with English.

A: There is no change in pronunciation when the next word starts with an "s". There is no additional "s" sound". For your two examples, just say:
She has some apples.
He is single.


Q: Am I correct in my understanding of selectors?

.top-menu {
  margin: 50px auto;
  padding: 0;
  list-style: none;
  width: 610px;
  height: 35px;
  box-shadow: 0 3px 4px #8b8b8b;
  background-color: #dadada;
}

.top-menu li {
  float: left;
  border-right: 1px solid #929292;
}

.top-menu li a:link {
  color: black;
  text-decoration: none;
  text-align: center;
  display: block;
  width: 100px;
  height: 35px;
  line-height: 35px;
}

.top-menu li a:visited {
  color: black;
}

ul li a:hover {
  background-color: #555;
  color: #fff;
}

  <meta charset="UTF-8">
  <title>pseudo selecotor</title>

menu1

menu2

menu3

menu4

menu5

menu6

i run this page,
if hover on menu, text color is black.
but in css, hover's text color is white.
if i change hover's selector
from ul -> to .top-menu
text color is white.
Is this because I gave black as class selector and white as tag selector?
Is it because the class is applied after applying the tag?

A: It's because classes have higher specificity value than Elements and Pseudo Elements. In your case .top-menu have higher specificity than the element ul, therefore its style is followed/used. Refer to this table for specificity:

More on specificity here.


Q: How to rearrange data frame so that values in one column are row names? I have a data frame containing 450K methylation beta-values for approx. 450 probes for two samples. This data is displayed in three columns, and looks like this:
>head(ICGC)
 submitted_sample_id    probe_id    methylation_value
1  X932-01-4D          cg00000029         0.6
2  X932-01-6D          cg00000029         0.4
3  X932-01-4D          cg00000108         0.3
4  X932-01-6D          cg00000108         0.7
5  X932-01-4D          cg00000109         0.9
6  X932-01-6D          cg00000109         0.1

I would like to rearrange this data.frame so that the probe IDs are the rownames and the sample IDs are the column names, so that it looks like this:
>head(ICGC_2)
           X932-01-4D    X932-01-6D
cg00000029    0.6           0.4
cg00000108    0.3           0.7
cg00000109    0.9           0.1

I have tried:
>library(tidyverse)
ICGC_2 <- ICGC %>% remove_rownames %>% column_to_rownames(var = "probe_id")

But this didn't work as each probe ID in ICGC appears twice in the column (as there are two samples). I also tried:
hello <- data.frame(ICGC[,-2], row.names = ICGC[,2])

But this had the same problem. The reason I want to rearrange this data in this way is because I would like to convert the beta values to M-values and use this data as the object in cpg.annotate (available through Bioconductor package DMRcate) - cpg.annotate requires the object to have unique Illumina probe IDs as rownames and unique sample IDs as column names.
Thank you!

A: You are very close. spread funciton from the tidyr package is what you need.
library(tidyverse)

ICGC_2 <- ICGC %>%
  spread(submitted_sample_id, methylation_value) %>%
  remove_rownames() %>%
  column_to_rownames(var = "probe_id")
ICGC_2
           X932-01-4D X932-01-6D
cg00000029        0.6        0.4
cg00000108        0.3        0.7
cg00000109        0.9        0.1

Data:
ICGC <- read.table(text = "submitted_sample_id    probe_id    methylation_value
1  'X932-01-4D'          cg00000029         0.6
2  'X932-01-6D'          cg00000029         0.4
3  'X932-01-4D'          cg00000108         0.3
4  'X932-01-6D'          cg00000108         0.7
5  'X932-01-4D'          cg00000109         0.9
6  'X932-01-6D'          cg00000109         0.1",
                   header = TRUE, stringsAsFactors = FALSE)

A: In base R you can do this:
wICGC <- reshape(ICGC, idvar = "probe_id",
                       timevar = "submitted_sample_id", direction = "wide")
wICGC <- data.frame(wICGC[,-1], row.names=wICGC[,1])

wICGC

#            methylation_value.X932.01.4D methylation_value.X932.01.6D
# cg00000029                          0.6                          0.4
# cg00000108                          0.3                          0.7
# cg00000109                          0.9                          0.1

A: For a different perspective, you can also use melt in reshape.
library(reshape)
m <- melt(IGC, id=c("submitted_sample_id", "probe_id"))
cast(m, probe_id~submitted_sample_id)

> cast(m, probe_id~submitted_sample_id)
    probe_id X932-01-4D X932-01-6D
1 cg00000029        0.6        0.4
2 cg00000108        0.3        0.7
3 cg00000109        0.9        0.1


Q: Tilting sine function to get countably infinite nonregular values? Let $f: \mathbb R \to \mathbb R$. A nonregular value $y$ of $f$ is any value such that not all $x \in f^{-1}(y)$ are regular. A point is regular if the Jacobian at it is surjective, in this case, has rank one.
If we tilt the map $f(x) = \sin x$ by some angle about the origin then the resulting map has countably infinitely many nonregular values.
My problem is: I don't understand why this is the case.

Please could someone give me some geometric insight into why tilting
  the sine functions yields nonregular values?

It seems to me that the untilted sine function has just as many nonregular values: The Jacobian is the derivative $J(x) = \cos x$ which vanishes infinitely many times...?
I am thinking about this because of the following text I read:

A: Note that without the tilting, all of the zeros of the derivative satisfy $\sin(x) = \pm 1$.  Thus, even though there are infinite points $x$ with $f'(x) = 0$, the only nonregular values (referring to elements of the codomain rather than elements of the domain) of $\sin x$ are $\pm 1$.


Q: Distance in the Poincare Disk model of hyperbolic geometry I am trying to understand the Poincare Disk model of a hyperbolic geometry and how to measure distances. I found the equation for the distance between two points on the disk as:
$d^2 = (dx^2 + dy^2) / (1-x^2-y^2)^2$
Given two points on the disk, I am assuming that $dx$ is the difference in the euclidean $x$ coordinate of the points, and similar for $dy$. So, what are $x$ and $y$ in the formula? Also, I see some formulas online as:
$d^2 = 4(dx^2 + dy^2) / (1-x^2-y^2)^2$
I am not sure which one is correct.
Assuming that $X$ and $Y$ are coordinates of one of the points, I have tried a few examples, but can't get the math to work out. For instance, if $A = (0,0)$, $B = (0,.5)$, $C = (0,.75)$, then what are $d(A,B)$, $d(B,C)$, and $d(A,C)$? The value $d(A,B) + d(B,C)$ should equal $d(A,C)$, since they are on the same line, but I can't get this to work out. I get distances of $.666$, $.571$, and $1.714$ respectively.
MathWorld - Hyperbolic Metric

A: The correct formula that is possible to memorize is for the upper half plane in $\mathbb C.$ The unit speed geodesics there are of just two kinds, parametrized by a letter $t,$ with real constant $B > 0$ and any $A,$ vertical
$$    A + i e^t,$$ semicircular
$$   A + B \tanh t + i B \; \mbox{sech} \; t.$$
The latter may seem unfamiliar, note
$$ \cosh^2 t - \sinh^2 t = 1,    $$
$$ \cosh^2 t = \sinh^2 t + 1,    $$ divide through by $\cosh^2 t$ to get
$$ 1 =   \tanh^2 t +  \mbox{sech}^2  t.   $$
Two points in the upper half plane are either in a vertical line or not. In the latter case, it is necessary to draw the perpendicular bisector of the ordinary segment between them and find out where that hits the real axis to find $A,$ then $B$ next.
Meanwhile, an isometry taking the unit disk to the upper half plane is the Moebius transformation
$$   f(z) = \frac{z + i}{i z + 1}   .$$ The points you gave were along the imaginary axis, and for real $v$
$$  f(iv) = i \; \left( \frac{1+v}{1-v} \right). $$ Your three specific points gave
$$  f(0) = i, \; f(i/2) = 3 i, \; f(3i/4) = 7i.   $$
These are all along the vertical geodesic $i e^t,$ so their pairwise distances are just the absolute values of the differences in the necessary values of $t,$ those being $0, \; \log 3, \; \log 7. $
So your $$ d(A,B) = \log 3 \approx 1.0986, $$
$$ d(B,C) = \log 7 - \log 3 \approx 0.8473, $$
$$ d(A,C) = \log 7  \approx 1.9459. $$
Furthermore, rotation of the unit disk is an isometry there, so as long as you have points along a radius of the disk, the distances to the origin (and to each other by subtraction) are quite specific: if a point in the unit disk is at "ordinary" distance $v$ from the origin, with the required $0 \leq v < 1,$ then the ``hyperbolic'' distance from the origin is
$$ \log \left( \frac{1+v}{1-v}  \right).  $$ However, if your two points of interest are not along a radius, you must either find a Moebius transformation of the disk to itself that takes them to a common radius (there are such) or map directly to $\mathbb C$ with my $f(z)$ and work with $\tanh t.$  This latter method is probably less work, and less likely to produce errors, than the former method.

A: There are 2 related but different ideas which both go by the name "metric".  The first is a "metric" as in "metric space".  That is it's a function $d:X\times X\rightarrow\mathbb{R}$ satisfying a few axioms (such as the triangle inequality).
On the other hand, a smooth manifold can be equipped with what is called a "Riemannian metric" or, confusingly, just a "metric" for short.  Recall that on a manifold, each point has an associated vector space, called the tangent space at that point.  A Riemanian metric, then, is a smoothly varying choice of inner product on each tangent space.  A Riemannian metric allows us to determine lengths (and angles) of tangent vectors.  The notation $$ds^2 = \frac{dx^2 + dy^2}{(1-x^2-y^2)^2}$$ is that of a Riemannian metric.  It tells you that the tangent vector $\vec{v} = (v_1, v_2)$ with tail at the point $(x,y)$ has length $\frac{v_1^2 + v_2^2}{(1-x^2-y^2)^2}$.
Now, a Riemannian metric allows us to measure the length of (nice enough) curves.  Given a differentiable curve $\gamma$, the length of $\gamma$ is defined as $\int_\gamma |\gamma'(t)|dt$.  This, then, leads back to the usual (topological) notion of a metric:  We can define the distance between two points to be the infimum distance of all curves between them.

A: As others have indicated one has to distinguish a metric $(x,y)\mapsto d(x,y)$ which measures distances between points $x$, $y$ in a space $X$ and a Riemannian metric which tells us how lengths of curves $\gamma$ in a manifold $X$ should be computed.
In the complex plane we have the usual euclidean metric $d(z_1,z_2):=|z_2-z_1|$ and at the infinitesimal scale the Riemannian metric
$$ds^2:=|dz|^2=dx^2+dy^2\ .$$
The latter formula says that the length of an arbitrary curve
$$\gamma: \quad t\mapsto\bigl(x(t),y(t)\bigr)\qquad(a\leq t\leq b)$$
should be computed as
$$L(\gamma)=\int_\gamma ds=\int_a^b\sqrt{x'^2(t)+y'^2(t)}\ dt = \int_a^b|z'(t)|\ dt\ .$$
This formula implies that the length of a segment $\sigma$ connecting two points $z_1$ and $z_2$ is just $|z_2-z_1|$.
On the "Poincare disc" $P$ we are given a priori only a Riemannian metric
$$ds:= {|dz|\over 1-|z|^2}$$
(resp., $ds^2=\ldots$). This metric allows us to compute the lengths of arbitrary curves in $P$:
$$L(\gamma)=\int_a^b{|z'(t)|\over1-|z(t)|^2}\ dt\ .$$ The particular definition of $ds$ is chosen such that this hyperbolic length is invariant under arbitrary conformal movements of $P$ and the curves therein.
A posteriori one can define a metric $d(\cdot,\cdot)$ on $P$ by letting the distance $d(z_1,z_2)$ between two points $z_1$, $z_2\in P$ be the hyperbolic length of the shortest curve $\gamma$ connecting $z_1$ and $z_2$. The actual carrying out of this idea shows that $d(z_1,z_2)$ can be written as an elementary function (using ${\rm artanh}$, etc.) in terms of  $z_1$ and $z_2$.

A: The point is $dx$ and $dy$ in the formula (the one with the 4 in is right btw) don't represent the difference in the $x$ and $y$ co-ordinates, but rather the 'infinitesimal' distance at the point $(x,y)$, so to actually find the distance between two points we have to do some integration.
So the idea is that at the point $(x,y)$ in Euclidean co-ordinates, the length squared, $ds^2$, of an infinitesimally small line is the sum of the infinitesimally small projections of that line onto the $x$ and $y$ axes ($dx^2$ and $dy^2$) multiplied by a scaling factor which depends on $x$ and $y$ ($\frac{4}{(1-x^2-y^2)^2}$).


Q: Is it possible to subclass the immutable date class and override the __str__ method? I am trying to subclass the immutable date class in Python, but I also need to override the __str__ method. So far, I have the following:
from datetime import date

class Year(date):
    def __new__(cls, year):
        return super(Year, cls).__new__(cls, year, 1, 1)
    def __str__(self):
        return self.strftime('%Y')

Constructor works fine, but the __str__ method is completely ignored when I try to print the object. I have seen a few samples subclassing other immutable classes such as int and float. All of them were using the same convention. Am I missing something? Is there anything special for the date object?
UPDATE:
It seems that there is nothing wrong with the code. I was trying to print a Year object inside a Django template and since Django formats date objects using a localizable format __str__ method was being ignored.

A: Add a return to the __str__ method.

UPDATE:
I ran your updated code on my machine, and it works fine:
aj@localhost:~/so/python# cat date2.py
from datetime import date

class Year(date):
    def __new__(cls, year):
        return super(Year, cls).__new__(cls, year, 1, 1)
    def __str__(self):
        return self.strftime('%Y')

y=Year(2011)
print str(y)
aj@localhost:~/so/python# python date2.py
2011

A: If this is your complete code you are missing the return statement:
def __str__(self):
    return self.strftime('%Y')


Q: OpenAPI definition not generating Scala properties I'm using the springdoc-openapi-ui plugin with spring-boot to generate an OpenAPI definition. It doens't seem to detect properties from Scala based objects. Java defined objects are working fine. Is there a way to fix this?
<dependency>
    <groupId>org.springdoc</groupId>
    <artifactId>springdoc-openapi-ui</artifactId>
    <version>1.6.9</version>
</dependency>

Controller:
case class OpenApiTest(a: String, b: String)

@RestController
class TestController {
  @GetMapping(path=Array("/open-api-test"))
  def openApiTest = OpenApiTest("a", "b")
}

Result of /v3/api-docs. Source is a Java class, OpenApiTest Scala:
"components": {
    "schemas": {
        "Source": {
            "type": "object",
            "properties": {
                "path": {
                    "type": "string"
                }
            }
        },
        "OpenApiTest": {
            "type": "object"
        }
    }
}


Q: Change AppBar back icon size in Flutter Here's the current AppBar code:
AppBar(
  iconTheme: IconThemeData(
    color: Colors.black,
    size: 100 // This isn't performing any changes
  ),
  centerTitle: false,
  backgroundColor: Colors.white,
  title: Text(
    title,
    style: TextStyle(color: Colors.black87,

  ),
  elevation: 1.0,
);

Current size attribute from IconThemeData not making any change.

A: Try this you need to use leading

*

*A widget to display before the title.

SAMPLE CODE
 AppBar(
      title: new Text("Your Title"),
      leading: new IconButton(
        icon: new Icon(Icons.arrow_back,size: 50.0,),
        onPressed: () => {
          // Perform Your action here
        },
      ),
    );

OUTPUT

A: You can use Transform.scale widget and wrap IconButton with it. This widget has scale property which you can set based on your need. Working sample code below:
appBar: AppBar(
        leading: Transform.scale(
          scale: 2,
          child: IconButton(
          icon: Icon(Icons.arrow_back, color: Colors.black),
          onPressed: () {}
          )
        ),

  centerTitle: false,
  backgroundColor: Colors.white,
  title: Text(
    'test',
    style: TextStyle(color: Colors.black87,

  ),
//  elevation: 1.0,
)),

Hope this answers your question.


Q: How to fetch both IPv4 and IPv6 on dual stack OS I have dual stack machine .
My problem is i am getting only IPv4 using
InetAddress address = InetAddress.getLocalHost();

and If i use Network Interface API then i get all the IP address in which includes my MAC addrres as well in the form of IP address.
why-do-i-get-multiple-global-ipv6-addresses-listed-in-ifconfig
Now is there any way i can get both IPv4 and IPv6 of my machine.

A: In Linux,
InetAddress.getLocalHost() will look for the hostname and then return the first IP address assigned to that hostname by DNS. If you have that hostname in the file /etc/hosts, it will get the first IP address in that file for that hostname.
If you pay attention this method returns only one InetAddress.
If you haven't assigned a hostname, most probably it will be localhost.localdomain. You can set the hostname with command line:
hostname [name]

or by setting it in file /etc/sysconfig/network
If you want to get all ip addresses, including IPv6, assigned to a hostname you can use:
InetAddress.getAllByName(InetAddress.getLocalHost().getHostName());

If you want to get all ip addresses, including IPv6, assigned to a host's network interfaces, you must use class NetworkInterface.
Here I'm pasting some example code:
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.net.SocketException;
import java.net.NetworkInterface;
import java.util.*;

public class Test
{
    public static void main(String[] args)
    {
        try
        {
            System.out.println("getLocalHost: " + InetAddress.getLocalHost().toString());

            System.out.println("All addresses for local host:");
            InetAddress[] addr = InetAddress.getAllByName(InetAddress.getLocalHost().getHostName());
            for(InetAddress a : addr)
            {
              System.out.println(a.toString());
            }
        }
        catch(UnknownHostException _e)
        {
            _e.printStackTrace();
        }

        try
        {
            Enumeration nicEnum = NetworkInterface.getNetworkInterfaces();
            while(nicEnum.hasMoreElements())
            {
                NetworkInterface ni=(NetworkInterface) nicEnum.nextElement();
                System.out.println("Name: " + ni.getDisplayName());
                System.out.println("Name: " + ni.getName());
                Enumeration addrEnum = ni.getInetAddresses();
                while(addrEnum.hasMoreElements())
                {
                    InetAddress ia= (InetAddress) addrEnum.nextElement();
                    System.out.println(ia.getHostAddress());
                }
            }
        }
        catch(SocketException _e)
        {
            _e.printStackTrace();
        }
    }
}

For this example, I got code from one of the responses in InetAddress.getLocalHost().getHostAddress() is returning 127.0.1.1


Q: Why swift compiler doesn't find Alamofire? I try to install Alamofire. I really haven't possibility to use cocoaPods, so I try to install it manually.
The steps I took:

*

*I download Alamofire from GitHub.

*In folder drag Alamofire.xcodeproj and drop into my projects

*In my projects in "generals" in "Embedded Binaries" add framework for iOs

*import Alamofire in code

When I want to make a request I enter "Alamofire" and swift offers me "AlamofireExtended", "AlamofireNotifications", "AlamofireExtension" and "AlamofireVersionNumber".
I try to enter request manually, but nothing happen

A: Did you follow their guidelines for manual installation?
You should run
$ git init

(if your project is not initialized as a git repository)
and then
$ git submodule add https://github.com/Alamofire/Alamofire.git

(so that you can add it as a submodule)
I would also suggest you to delete the derived data, clean the project and then build it again.


Q: On orientation change button touchlistener not working I have two layouts table.xml(port) and table.xml(land) which from there names one of the landscape and other for the protrait.

I have included this layout in another layout called fragment_test.xml like this:
    <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
         >

   <include layout="@layout/table"/>

    </RelativeLayout>

And this is my fragment code of the above layout fragment_test:
public class Fragment_test extends Fragment  implements View.OnTouchListener{
     @Override
        public void onActivityCreated(Bundle savedInstanceState) {
            super.onActivityCreated(savedInstanceState);

         mytable= (LinearLayout) getActivity().findViewById(R.id.mytableid);
        typeface = Typeface.createFromAsset(getActivity().getAssets(),   "fonts/font.ttf");

                  for (int i = 0; i < table1.getChildCount(); i++) {
                    LinearLayout mychild = (LinearLayout) mytable.getChildAt(i);
                    for (int j = 0; j < mychild.getChildCount(); j++) {
                        Button b = (Button) child.getChildAt(j);
                        b.setTypeface(typeface);
                         b.setOnTouchListener(this);
                   }

                }
            }

         }

        //this is called when a button is touched
        @Override
        public boolean onTouch(View view, MotionEvent motionEvent) {
    return true;
    }

}

So basically I have several buttons in the table layout I am looping through to setontouchlistener for each one of them.
So my problem is when I switch from protrait to landscape or the opposite the touchlistener of the button does not work anymore and even the typeface doesn't work anymore when changing the layout.
> Edit: this is the activity code
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);
        getSupportActionBar().setTitle("Home");

       FragmentManager manager = getFragmentManager();
       manager.beginTransaction().add(R.id.container, new Fragment_test(), "mytag").commit();

    }

A: Try calling setRetainInstance(true) after super.onActivityCreated(savedInstanceState);
here is the documentation of setRetainInstance(boolean)
Activity :
public class MainActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main2);

    FragmentManager manager = getSupportFragmentManager();
    Fragment myFragment = manager.findFragmentByTag("myFragment");
    if (myFragment == null) {
        myFragment = new ParentFragment();
    }

    manager.beginTransaction().add(R.id.fragmentHolder, myFragment, "myFragment").commit();
}
}

Fragment:
public class ParentFragment extends Fragment{

@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    setRetainInstance(true);
}
}

A: I am just give you the information.
you can check the Orientataion of device this way and set it layout.
@Override
public void onConfigurationChanged(Configuration newConfig) {
    super.onConfigurationChanged(newConfig);
    if (newConfig.orientation==Configuration.ORIENTATION_LANDSCAPE){
        setContentView(R.layout.table_horizontal);
        button1 = (Button)findViewById(R.id.button1);
        button1.setOnClickListener(this);
    }else if (newConfig.orientation==Configuration.ORIENTATION_PORTRAIT){
        setContentView(R.layout.table_vertical);
        button1 = (Button)findViewById(R.id.button1);
        button1.setOnClickListener(this);
    }
}


Q: HTML Code to display UIAlertView on iOS I've gone to different websites on my iPhone that will pop up a UIAlertView when it loads.  How is this accomplished?  I want to put some code on my page to pop up a UIAlertView when viewed on an iPhone.

A: You can make use of bridecall from the js to native code to trigger the UIAlertView..


Q: SQL Server compare two tables rows with identical columns and return changed columns I want to compare two tables with the same columns:

*

*product - Id, Name, Description

*Temp_Product - Id, Name, Description
Now update done by user will be saved into Temp_Product. When admin will see the details of that product I need to show the changes done by user. I want to compare both tables with a query and return columns that have changed from Product to Temp_Product.
Please suggest me better way to do this?

A: Select p.id,p.name as orgn,t.name as altn,p.descripion as orgd,t.description as altd
from product p
join tmp_product t
on t.id=p.id and (t.name<>p.name or t.description <> p.description)

A:
I want to compare both tables with a query and return columns that
  have changed from Product to Temp_Product

Since the two tables have the same structure, you can use the EXCEPT  set oeprator for this:
SELECT * FROM Temp_Product
EXCEPT
SELECT * FROM Product;

SQL Fiddle Demo


Q: Applescript Copy All File from USB to Folder Could you help me to make this script working ?
property ignoredVolumes : {"DD APPLE", "MobileBackups"}
tell application "System Events"

set Destination_Folder to folder "/Users/Joseph/Downloads/Test" of startup disk
set rootVolume to disk item (POSIX file "/Volumes" as text)
set allVolumes to name of every disk item of rootVolume

repeat with aVolume in allVolumes
    if aVolume is not in ignoredVolumes then
        copy every item of folder (aVolume) to Destination_Folder
    end if
end repeat
end tell

The problem is in the line copy every item of folder (aVolume) to Destination_Folder - the error message I get is Can’t get every file of "NO NAME". (No Name is my USB key.)
Thank you very much for your help.

A: System Events doesn't have a "copy" command. Where did you get that? You might try "move" instead. Plus "aVolume" is not a folder, it's a disk. You probably want to change "folder aVolume" to "disk aVolume". And you might even need to use "disk (contents of aVolume)"
EDIT: Try the following script. I didn't test it but it should work. Good luck.
property ignoredVolumes : {"DD APPLE", "MobileBackups", "home", "net"} -- leave home and net in this list
set Destination_Folder to ((path to downloads folder as text) & "Test:") as alias

set mountedVolumes to list disks

repeat with i from 1 to count of mountedVolumes
    set thisVolume to item i of mountedVolumes
    if thisVolume is not in ignoredVolumes then
        tell application "Finder"
            set theItems to items of disk thisVolume
            move theItems to Destination_Folder
        end tell
    end if
end repeat


Q: How can I run a Task Scheduler job without being on administrator account? I have read that the Windows account logged onto the computer that is running tasks from the Windows Task Scheduler needs to have administrator rights. I used the administrator account to create the task, but the problem is I cannot leave the computer with the admin account logged on. I have to switch to the non-admin account, but I want that task to still be run based on the criteria I have set up within Task Scheduler.
Is there any way where I can setup a task in Task Scheduler and have it run on an account that doesn't have administrator rights?
PS: The task is a very simple one. Moving files from one place to another, that's all.

A: You can definitely create a service account with Administrator privileges and set it to run the job when Windows start up.

*

*Create New Task

*General --> Security Options:

*

*Run whether user is logged on or not

*Run with highest privileges.

*When running the task, use the following user account --> Set to service account.

*Define Actions and triggers and condition, the click OK

*Password requested for account, please key in password.

*Setup is completed.

A: There is no way to create a scheduled task without admin rights,
or this would be a serious security bug in Windows.
The Task Scheduler can only be used by an administrator, so you should look for some
other solution for a standard user, by using a third-party product.
Here is a list of scheduling products that do not use the Task Scheduler,
in no particular order. Some are pretty basic and some are more complex.
I haven't used them, so cannot recommend one in particular.

*

*Z-Cron Scheduler

*System Scheduler Free

*Task Till Dawn

*RoboIntern

*Solway’s Task Scheduler

*Kana Reminder

A: @xenon if you have admin access, created a scheduled task, & only works while admin is logged in sounds like the task and/or script needs to be fixed. Ideas:

*

*Check that task is setup to run when admin user logged out:

*Does the task/script require some kind of interaction, if so remove or automate it

*If task doesn't require admin access follow steps below to put in non-admin user startup

*Worst method: if task requires admin & you can't automate it for some reason (requires user interaction): create shortcut of batch script, modify shortcut to open as admin (will prompt for password every time its opened), place shortcut in non-admin user startup location seen below

@turmuka run automated task for non-admin user: don't use Task Scheduler, write batch script, put in user startup so it runs automatically.

*

*Write a batch script (.BAT or .CMD)

*Test it

*Put in User Startup: run, shell:startup, paste batch script or shortcut to batch script here

C:\Users\InsertUsernameHere\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

A: Which steps are you taking when you create a task using Windows Task Scheduler? In the very first window, General tab, you can change the user the task should run for, and check the "Run with highest privileges" box.
Create the task with your admin account and it should work just fine for the other account.


Q: Discordbot javascript react to mentions I'm completely new to Javascript and i would like to make a discord bot.
I have a bot already running with a few commands, now i would like to add something that posts a reaction whenever someone specific is tagged.
client.on('message', message => {
  var user = "123456479879541";
  if(message.mentions.users.id === user) {
    message.channel.send('ok');
  }
});

What do i have to do to make it work?

A: Message.mentions.users is a collection.  You need to determine if your ID is in the collection.  You are comparing equality, which since user is not a collection will always be false.  Replace this with a .has  You can then add a react to the message.  For that, there is a guide here describing how to get a unicode reaction as shown below.
  var user = "123456479879541";
  if(message.mentions.users.has(user)) {
    message.channel.reply('ok');
    message.react('');
  }

A: You should use Message#react()
So basically for example you could do:
client.on('message', message => {
var user = "123456479879541";
const reaction = message.guild.emojis.find(emoji => emoji.name === 'EMOJI NAME')
    if(message.mentions.users.has(user)) {
        message.channel.reply('ok');
        message.react(reaction)
}});


Q: Given two lines find the four circles that have the lines as tangents Given two lines, each defined by two points, and a radius find the four circles that have the lines as tangents. I give my attempt below but there ought to be a nice mathematica way of doing this.
ClearAll[tangetsAndCircles];
tangetsAndCircles[{p1_, p2_}, {p3_, p4_}, r_] :=
 Module[{L1, L2, intersection, λ1, λ2, s1,
   s2, θ1, θ2, d1, d2, q1, q2, q3, q4},
  L1 = p1 + λ1 (p2 - p1);
  L2 = p3 + λ2 (p4 - p3);
  intersection =
   L1 /. First@NSolve[L1 == L2, {λ1, λ2}];
  s1 = Normalize[p2 - intersection] ;
  s2 = Normalize[p4 - intersection ];
  θ1 = 1/2 ArcCos[s1.s2];
  d1 = r/Sin[θ1];
  θ2 = 1/2 ArcCos[-s1.s2];
  d2 = r/Sin[θ2];
  q1 = intersection + d1 (s1 + s2)/Norm[s1 + s2];
  q2 = intersection - d1 (s1 + s2)/Norm[s1 + s2];
  q3 = intersection + d2 (-s1 + s2)/Norm[-s1 + s2];
  q4 = intersection - d2 (-s1 + s2)/Norm[-s1 + s2];
  {intersection, q1, q2, q3, q4}

  ]

Here is an example
{p1, p2, p3, p4} =
{{0.1246, 0.1491}, {0.0501, -0.8392},
 {0.6457, 0.7347}, {-0.4134, -0.2812}};
r = 0.2;

{p, q1, q2, q3, q4} = tangetsAndCircles[{p1, p2}, {p3, p4}, r];

Graphics[{PointSize[0.02], Purple, Point[{p1, p2, p3, p4}], Black,
  InfiniteLine[{p1, p2}], InfiniteLine[{p3, p4}], Red, Point[p],
  Lighter@Blue, Circle[q1, r], Circle[q2, r], Circle[q3, r],
  Circle[q4, r]}, Frame -> True]

Can you suggest a simpler and more robust method? Thanks

A: p = First[RegionIntersection[InfiniteLine[{p1, p2}], InfiniteLine[{p3, p4}]]]
dir1 = r Normalize[Normalize[p4 - p3] + Normalize[p2 - p1]];
dir2 = Cross[dir1];
q1 = p + Csc[VectorAngle[p4 - p3, p2 - p1]/2] dir1;
q2 = p - Csc[VectorAngle[p4 - p3, p2 - p1]/2] dir1;
q3 = p + Csc[VectorAngle[p4 - p3, p1 - p2]/2] dir2;
q4 = p - Csc[VectorAngle[p4 - p3, p1 - p2]/2] dir2;

The use of Csc is like computing the green length below where the orange and blue segments correspond to your lines:


Q: Finding lines that are not connected to network in QGIS How can I find lines that are not connected to a network and identify "gaps" in a network?
See example below:


Q: How to get index position in textBox using javascript How do i get the index position when user click in textBox using JavaScript?
for example in my textBox have this string :
`this is best| of the world`.

it should be return 13.


Q: Link Resources in c# Project I have 2 files, 1 is form1.cs and the second is form1.resx. they should be linked but are not. how can I link the 2? if i just make sure the namespaces are the same will they automatically link to each other? do i need to clean the project?

A: Install VSCommand 2010.
Select two files then group two item from the context menu.

A: Right-click both files and click Exclude from project.
Then, click Show all Files on top of the Solution Explorer, then right-click the .cs file and click Include in project.

A: You mean one as a subtree of the other?  If what SLaks says doesn't work you can edit the proj file.
I think it is like this, using the dependentupon xml
<Compile Include="FPtoICVService.cs">
      <SubType>Component</SubType>
    </Compile>
    <Compile Include="FPtoICVService.Designer.cs">
      <DependentUpon>FPtoICVService.cs</DependentUpon>
    </Compile>


Q: Personal Autoformat (Visual Studio C# / git) I have 2 different settings in visual studio, my personal and our company guidelines and a git repository where code should be commited with our company guidelines. Is it possible to automatically autoformat the code on opening the file with my personal settings? Then, when I finished working (either on save or preferably on git pre-commit) I would like to autoformat the files I worked on with our company guidelines.
Is there a way to achieve this?
EDIT: Language is C#.


Q: Dell Servers - Email notification We have all Dell servers in our environment.  We want some sort of software (Dell software or 3rd party) that will notify us via email if any hardware failures occur.  What do you recommend?

A: AFAIK, DOMSA (Dell OpenManage Server Administrator) itself can't send email notifications. DITA (Dell IT Assistant) is the management console (management station) for managing servers that have DOMSA (managed system) installed. DITA does support email notifications. DITA has been deprecated, but it's still available for download from the Dell support site. I use it because the Altiris (Symantec) product that has replaced it is too bloated, complicated, confusing, and cumbersome.
You can still download DITA from Dell's web site, although I don't have the link available at the moment.

A: The Dell OMSA can do e-mail notifications; I don't know how, but I saw some come from a couple of our servers the other day until I told the person setting up those servers to roll them into our monitoring system.

A: Open Manage Server Administrator will do it.  It has been replaced with an Altiris clone for the 11th gen servers though.  I'm not sure the details on it but it is called DMC or Dell Management Console (I think).  It will do email notification but is kind of klunky.  We use Nagios in-house with snmp checks and a subset of the open manage suite.


Q: Cannot find element in Vue Js Applications I created vue js applications with visual studio 2017 . but the problem is when i run the applications , i got following errors in google chrome console windows .
[Vue warn]: Cannot find element: #intro
[Vue warn]: You are using the runtime-only build of Vue where the template compiler is not available. Either pre-compile the templates into render functions, or use the compiler-included build.
Here is the code for App.vue...
<template>

        <Home msg="Hello world!" />

</template>

Here is the code for component1.vue..
<template>

{{ message }}

</template>

Here is the screen shot of the google console windows ..

A: You have set the class on the element instead of the id.
But that is irrelevant anyway because you do not need to any of this for a single file component; just do this instead (as you did for App.vue):
<template>

{{ message }}

</template>

Constructing a Vue component manually with new Vue() is only necessary for the root component instance.


Q: UWP: BackgroundTask open App Mainpage Is it possible to open my app by my own backgroundtask?
when i have a backgroudtask in windows universal platform, can i start or open my app.mainpage from there?
my backgroundtask checks periodicaly the clipboard and if it gets an hit, then it should open my app.
does this work with uwp or is uwp again a no-go software ?
any soltutions or ideas therefore?

A: You can do that by a toast. Here is an example.
   var content =
        $@"
            <toast activationType='foreground' launch='args'>
                <visual>
                    <binding template='ToastGeneric'>
                        <text>Open app</text>
                        <text>Your clipboard is ready.Open app</text>
                    </binding>
                </visual>
                <actions>

                    <action content='ok' activationType='foreground' arguments='check'/>

                  <action activationType='system' arguments='dismiss' content='cancel' />

                </actions>
            </toast>";

        Windows.Data.Xml.Dom.XmlDocument toastDOM = new Windows.Data.Xml.Dom.XmlDocument();
        toastDOM.LoadXml(content);
        ToastNotification toast = new ToastNotification(toastDOM);
        var notifier = ToastNotificationManager.CreateToastNotifier();
        notifier.Show(toast);

And then if user press the ok button you must go in App.xaml.cs and handle that
 protected override void OnActivated(IActivatedEventArgs args)
    {
        if (args.Kind == ActivationKind.ToastNotification)
        {
            var toastArgs = args as ToastNotificationActivatedEventArgs;
            var arguments = toastArgs.Argument;

            if (arguments == "check")
            {
                Frame rootFrame = Window.Current.Content as Frame;
                if (rootFrame == null)
                {
                    rootFrame = new Frame();
                    Window.Current.Content = rootFrame;
                }
                rootFrame.Navigate(typeof(YOURPAGEHERE));
                Window.Current.Activate();
            }
        }
    }


Q: laravel 5 .. ubuntu .. command line I am working using laravel5 php framework on ubuntu and I have 2 problems
1- when I try to use the composer to require anything .. it doesnt work
2- when i tried to make some changes to illuminate/Html .. it doesn't work too
so after that when i tried to use the artisan to serve my project I got that error
PHP Fatal error:  Class 'Illuminate\Html\HtmlServiceProvider' not found in /home/shaimaa/Sites/Laravel5/eoswdt/storage/framework/compiled.php on line 5617
exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'Class 'Illuminate\Html\HtmlServiceProvider' not found' in /home/shaimaa/Sites/Laravel5/eoswdt/storage/framework/compiled.php:5617
Stack trace:
#0 /home/shaimaa/Sites/Laravel5/eoswdt/storage/framework/compiled.php(1500): Illuminate\Foundation\Bootstrap\HandleExceptions->fatalExceptionFromError(Array)
#1 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleShutdown()
#2 {main}

A: Just run the following in your composer
composer require "illuminate/html":"5.0.*"

Inside your config/app.php add the following codes inside it
In the 'providers' => [ ..]
'Illuminate\Html\HtmlServiceProvider',

And in the
'aliases' => [ ..]
'Form'=> 'Illuminate\Html\FormFacade',
'HTML'=> 'Illuminate\Html\HtmlFacade',

And then refresh the page you should find that it should be working.


Q: error when try to install flask in the virtual enviroment I just configure the environment to develop the flask based web app. All the things goes smoothly, but when I run my hello world app, the python interpret tell me no module named flask:
Traceback (most recent call last):
  File "hello.py", line 1, in <module>
    from flask import Flask
ImportError: No module named flask

but I seriously install flask.
When I get the error, i just run the command in the virtual environment, sudo pip install flask. Then, the console show the message:
(venv)ubuntu@localhost:/var/www/demoapp$ sudo pip install flask
Requirement already satisfied (use --upgrade to upgrade): flask in /usr/local/lib/python2.7/dist-packages
Requirement already satisfied (use --upgrade to upgrade): Werkzeug>=0.7 in /usr/local/lib/python2.7/dist-packages (from flask)
Requirement already satisfied (use --upgrade to upgrade): Jinja2>=2.4 in /usr/local/lib/python2.7/dist-packages (from flask)
Requirement already satisfied (use --upgrade to upgrade): itsdangerous>=0.21 in /usr/local/lib/python2.7/dist-packages (from flask)
Requirement already satisfied (use --upgrade to upgrade): markupsafe in /usr/local/lib/python2.7/dist-packages (from Jinja2>=2.4->flask)
Cleaning up...

Who can tell me how can I run my hello world flask app?

A: When you run

$ sudo pip install...

system pip will be used. So to install flask in current environment just run

$ pip install ...
  or as:
  $ /path/to/venv/bin/pip install ...

Or make your venv able to load global system packages by parameter --system-site-packages, while configure virtual environment.

A: If you are having the same trouble even if you have your virtualenv running, just make sure you didn't accidentally delete the files and attempt to execute pip in that folder you created for your venv...  Like I did.  :D


Q: How to use the default value attribute of a select tag Now im working on a small task with a select tag like this
       <select
            name="selectmedgroup"
            id="selectmedgroup"
            value={selectedGroupValue}
            onChange={filterOnSelectChange}
          >
            <option value="" defaultValue hidden>
              -Select Group-
            </option>
            <option value="a">A</option>
            <option value="b">B</option>
            <option value="c">C</option>
            <option value="d">D</option>

          </select>

I want to get the value on change. Here is my on change function and state
const [selectedGroupValue, setSelectedGroupValue] = useState();

  const filterOnSelectChange = (e) => {
    setSelectedGroupValue(e.target.value);
    console.log(selectedGroupValue);
  };

Everything seems to work fine but when I log out the selected option first if I choose A for the first time I get undefined on the logs. If I choose B I get A logged out. If  I choose C I get B logged out.
I don't think it's my ordering that's wrong. Remember I don't want to have an initial value on the state because this will be just a selection that I will use to filter what the user sees on the page. So for the first time on the component mount, nothing should be filtered.
I have a feeling that the problem is the first Option tag with the -Select Group- . Is there any way I can avoid using that first options tag because it is just like a placeholder whose value I don't need to be selected?
How can I get the correct values? Please help

A: Try to console your selectedGroupValue on useEffect hook , solve it like this
import React, { useState } from 'react';

const App = () => {
    const [selectedGroupValue, setSelectedGroupValue] = useState();

    const filterOnSelectChange = (e) => {
        setSelectedGroupValue(e.target.value);
    };
    React.useEffect(() => {
        console.log(selectedGroupValue);
    }, [selectedGroupValue]);

    return (
        <>
            <select
                name="selectmedgroup"
                id="selectmedgroup"
                value={selectedGroupValue}
                onChange={filterOnSelectChange}
            >
                <option value="" defaultValue hidden>
                    -Select Group-
                </option>
                <option value="a">A</option>
                <option value="b">B</option>
                <option value="c">C</option>
                <option value="d">D</option>
            </select>
        </>
    );
};

export default App;


Q: two digit year as primary key in sql server I have a table with these columns:
ID int,
d date

Now what I need is to define the primary key in such a way that ID would be unique for each year; meaning that there can not be two same IDs in 2004, but it is possible to have two same IDs in two different years.
Like:
insert into myTable values(1, '1-1-2004'), (1, '1-1-2005')

but not like:
insert into myTable values(1, '3-1-2005'), (1, '1-1-2005')

I tried this:
primary key(ID, datepart(YY, d))

but I get syntax error.

A: One way of doing this, if you can alter the table structure, is to add a persisted computed column for the year part, and then add a primary key for (id, computer_col), like this:
CREATE TABLE myTable (
    id INT NOT NULL,
    d DATE NOT NULL,
    y AS DATEPART(YEAR,d) PERSISTED NOT NULL,
    PRIMARY KEY(id,y)
    )

I'm not saying this is a good solution in any way, but it should work. Using a trigger on insert or a check constraint might be better.
Using your test data this will allow the first insert statement, but disallow the second as it violates the primary key constraint.


Q: Tap UIImageView with no alpha response? I have an image which has a relatively large area of transparency, alpha space. So is there a way I can detect a tap on this UIImageView but not have any response if the user taps the alpha area?

A: This is theoretical and I don't have code to add, but you could create an identical button and add it for UIControlStateTouched so there's no change when the button/image is touched.


Q: How to get Primary MX IP from domain in Bash I am trying to write a bash script that will from a domain name find it MX records, from them figure out which is the primary (they are not always in order) and then find its IP.
(when there are more then one primary MX the first one found would be ok)
For example:
./findmxip.sh gmail.com

Would give me 173.194.71.26. For me to do this I need to host gmail.com
then find the primary MX in the results and host it, getting its IP.

A: To get exactly 0 or 1 answers:
dig +short gmail.com mx | sort -n | nawk '{print $2; exit}' | dig +short -f -

You'll need a non-ancient dig that supports +short.
As noted there may be more than one "primary" MX as the preferences need not be unique. If you want all the IP addresses of all of the lowest preference records then:
dig +short oracle.com mx | sort -n |
  nawk -v pref=65536 '($1<=pref) {pref=$1; print $2}' |
  dig +short -f - | uniq

This does not handle the case where there is no MX record and the A record accepts email, an uncommon but perfectly valid configuration.
Sadly all the dig versions I've tested return 0 whether the domain exists or not (NXDOMAIN), and whether any MX records exist or not. You can catch a DNS time-out (rc=9) though. The related host command does return a non-zero rc with NXDOMAIN, but its behaviour is a little inconsistent, it's messy to script and the output harder to parse.
A poor man's error-checking version (inspired by tripleee's comment) that might be slightly more robust depending on your host command is:
DOMAIN=gmail.com
if ! host -t any $DOMAIN >/dev/null 2>&1 ; then
  echo "no such domain"
elif ! host -t mx $DOMAIN >/dev/null 2>&1;  then
  echo "no MX records"
else
  dig +short $DOMAIN mx | sort -n | nawk '{print $2; exit}' | dig +short -f -
fi

(Perversely, you may require an older version of host (bind-8.x) for the -t mx test to work, newer versions just return 0 instead.)
This is just about the point people start backing away nervously asking why you're not using perl/python/$MFTL.
If you really need to write a robust version in bash, check out the djbdns CLI tools and debugging tools which are rather easier to parse (though sadly don't set user exit codes either).


Q: Axios request with Contact forms 7 I'm using contact forms 7, and in my form submission I use this function:
  const formData = {
      'your-name':'John Doe',
      'your-email': 'johndoe@mail.com',
    }
    axios({
      method: 'POST',
      url: 'https://0xsociety.com/wp-json/contact-form-7/v1/contact-forms/258/feedback',
      headers: {
        "content-type": "multipart/form-data",
      },
     data: formData,

    })

But it doesnt work, i get errors saying fields are empty.
But I tried with postman and it works perfectly when i do it manually
How would I get my axios post request to mimic this:
https://gyazo.com/e1ffe5bcc3f943a074d9b9e2c32b162d

A: I figured this out by using postman in my app:
import request from 'postman-request'

   const formData = {
      'your-name': name,
      'your-email': email,
      'your-subject': inquiries.find(x=> x.value === inquiry).text,
      'file-871': file
 }
    request.post('https://your-domain/wp-json/contact-form-7/v1/contact-forms/your-form-id/feedback',{ form: formData}, function(err,httpResponse,body){
      if(err) {
        console.log(err)
      }
      else {
        console.log(body)
      }
    })


Q: Angular 9 - how to inject dynamic parameters into a service constructor I need to make requests to a backend url which comes in this form:
localhost:8000/myapp/item1/:id1/item2/:id2/item3

where id1 and id2 are dynamic numbers.
I've thought using a service that takes 2 arguments in the constructor, something like this
export class Item3Service {

  private id1: number;
  private id2: number;

  constructor(
    id1: number,
    id2: number
  ) {
    this.id1 = id1;
    this.id2 = id2;
  }

  getList() {/**** implementation here ****/}
  getDetail(id3: number) {/**** implementation here ****/}
  create() {/**** implementation here ****/}
  update(id3: number) {/**** implementation here ****/}
  delete(id3: number) {/**** implementation here ****/}

}

I really don't know how to inject parameters into the constructor. I also need to use this service inside a resolver and again, how can I pass parameters to it in a resolver?
Creating injection token sounds useless in this case because the token value should change every time. I've run out of ideas

A: I don't know where you get the dynamic ids, but you could actually maybe put them in the providers array and use dependency injection like you would with injection tokens. If it is possible to create a factory method for the ids of course
Service
export class Item3Service {

  constructor(
    @inject(LOCALE_ID) private locale: string) {}

}

app.moudle.ts
@NgModule({
  providers: [
    { provide: LOCALE_ID, useFactory: () => window.navigator.language}
  ]
})

Edit
Since the ids are part of your route, I would do it like this
Component
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { MyServiceService } from '../my-service.service';

@Component({
  selector: 'app-routed',
  templateUrl: './routed.component.html',
  styleUrls: ['./routed.component.scss']
})
export class RoutedComponent implements OnInit {

  constructor(private route: Router, private myService: MyServiceService) { }

  ngOnInit(): void {
    this.myService.setUrl(this.route.url)
  }

}

Service
import { Injectable } from '@angular/core';
import { ReplaySubject, Observable } from 'rxjs';
import { share, switchMap } from 'rxjs/operators';

@Injectable({
  providedIn: 'root'
})
export class MyServiceService {
  private _url$: ReplaySubject<string> = new ReplaySubject<string>(1);

  private _mydata$: Observable<string>;
  get myData$() { return this._mydata$.pipe(share()); }

  constructor() {
    this._mydata$ = this._url$.pipe(
      switchMap(url => {
        const parsedUrl = this.parseUrl(url);
        return this.callBackend(parsedUrl)
      })
    )
  }

  setUrl(url: string) {
    this._url$.next(url);
  }

  private callBackend(parsedUrl): Observable<string> {
    // call backend
  }

  private parseUrl(url: string): number[] {
    // parse ids
  }
}

A: It's better for your Service to be stateless, it will bring down the complexity of your app and spare you some issues and debugging and it's just not necessary in your case because you can always get item1Id and item2Id from your activated route, so let the activated route hold the state of your application (in this case the state is what Item1Id and Item2Id are selected) and create a stateless service that you can call from anywhere and that holds the logic of your Item API.
Here is how I envision your service to be (Keep in mind that this is just an example to take into consideration since I don't know exactly your semantics and use cases)
ItemService
export class ItemService {
  constructor(private http: HttpClient) {}

  getList(item1Id: string, item2Id: string) {
    /* Call to Get List endpoint with Item1Id and Item2Id */
  }

  getDetails(item1: string, item2: string, item3: string) {
    /* Call to Get Details endpoint with Item1Id and Item2Id and Item3Id */
  }
}

Then you can use this service everywhere, as long as you have access to the ActivatedRouteSnapshot or ActivatedRoute
Example Use in Resolver for Route item1/:item1Id/item2/:item2Id
export class ItemResolver implements Resolve<any> {
  constructor(private itemService: ItemService) {}

  resolve(
    route: ActivatedRouteSnapshot,
    state: RouterStateSnapshot
  ): Observable<any> {
    return this.itemService.getList(route.params['item1Id'], route.params['item2Id']);
  }
}

Example Use in Component for Route item1/:item1Id/item2/:item2Id to get Item 3 details
export class HelloComponent  {

  constructor(private route: ActivatedRoute, private itemService: ItemService) {}

  getDetails(item3Id) {
    this.route.params.pipe(
      take(1),
      map(({ item1Id, item2Id }) => {
        console.log(this.itemService.getDetails(item1Id, item2Id, item3Id))
      })
    ).subscribe();
  }
}

Here is a working StackBlitz demonstrating this : https://stackblitz.com/edit/angular-ivy-h4nszy
You should rarely use stateful services (unless it's really necessary and even in that case I recommend using something like ngrx library to manage your state) with the information that you have given though, you really don't need to be passing parameters to the constructor of your service, you should keep it stateless and pass the parameters to your methods.


Q: Equation of Motion for a Point Vortex System. Need Help Solving 4 Simultaneous ODEs Background and Statement of the Problem
We consider the problem in $\mathbb{R^2}.$ As the title states, we are interested in the following equation involving the Hamiltonian of the point vortex system, $H^{2,\Omega},$ and the positions of a pair of point vortices in Lagrangian coordinate, $x_1(t)$ and $x_2(t).$
$$\Omega_j \frac{\text{d}x_j}{\text{d}t} = J\nabla_jH^{2,\Omega} (x_j). \tag{1} \label{1}$$
Here, $x_j = \begin{bmatrix} x_{j,1} \\ x_{j,2}\end{bmatrix},$ for $j=1,2.$
$J =
\begin{bmatrix} 0 & 1 \\ -1 & 0
\end{bmatrix}$
, and
$\nabla_j =
\begin{bmatrix} \partial_{x_{j,1}} \\ \partial_{x_{j,2}}
\end{bmatrix}.$
The Hamiltonian for the system is given by the following formula:
$$H^{2,\Omega}(x_j) = \frac{1}{2} \sum^{2}_{\begin{matrix}k,l=1 \\ k \neq l\end{matrix}}
\Omega_k \Omega_l G(x_{j,k} , x_{j,l}),
$$
where $G(x_{j,1} , x_{j,2}) = \frac{1}{2\pi} \ln| x_{j,1} - x_{j,2} |^{-1}$ is just the Green's function for the Laplace Equation in the whole space.
We set the constants $\Omega_i$ for this problem as follows, $\Omega_1 = \pm \Omega_2 = 1. $ Thus the Hamiltonian simplifies to the Green's function.
$$H^{2,\Omega}(x_j) = \frac{1}{2\pi} \ln| x_{j,1} - x_{j,2} |^{-1}.
$$
We can then can rewrite \eqref{1} as the following pair of vector equations:
\begin{align}
\frac{\text{d} x_1}{\text{d}t} = \pm J \nabla_1 \Big{(} \frac{1}{2\pi} \ln|x_1 - x_2|^{-1} \Big{)}, \\
\frac{\text{d} x_2}{\text{d}t} = J \nabla_2 \Big{(} \frac{1}{2\pi} \ln|x_1 - x_2|^{-1} \Big{)}.
\end{align}
My Work
The spatial derivative on the right hand side serves only to rewrite the log function into a fraction involving absolute values. We're left with a system of 4 ODEs with respect to the time variable, which are written as follows:
$$ \begin{align} \frac{\text{d} x_{1,1}}{\text{d}t} & = \pm \Big{(} -\frac{1}{2\pi} \frac{(x_{1,2} - x_{2,2})}{|x_1 - x_2|^2} \Big{)} \\
\frac{\text{d} x_{1,2}}{\text{d}t} & = \pm \Big{(} \frac{1}{2\pi} \frac{(x_{1,1} - x_{2,1})}{|x_1 - x_2|^2} \Big{)} \\
\frac{\text{d} x_{2,1}}{\text{d}t} & = \Big{(} \frac{1}{2\pi} \frac{(x_{1,2} - x_{2,2})}{|x_1 - x_2|^2} \Big{)} \\
\frac{\text{d} x_{2,2}}{\text{d}t} & = \Big{(} -\frac{1}{2\pi} \frac{(x_{1,1} - x_{2,1})}{|x_1 - x_2|^2} \Big{)}.
\end{align}$$
I have never come across a system of ODEs such as this before, and am at a complete loss as to how to solve them. Any hints or references to texts with this or a similar problem are very much appreciated. Thank you.
Edit 1.
The above equations are perhaps better represnted in the following vector form:
$$ \begin{align}
\frac{\text{d} x_{1}}{\text{d}t} & = \pm \Big{(} - J \frac{x_1 - x_2}{|x_1 - x_2|^2} \Big{)}. \\
\frac{\text{d} x_{2}}{\text{d}t} & = \pm \Big{(}  J \frac{x_1 - x_2}{|x_1 - x_2|^2} \Big{)}.
 \end{align} $$
It is then worth noting the main differences between the plus and minus cases for $x_1$. In the plus case, we get
$$ \frac{\text{d} x_{1}}{\text{d}t} + \frac{\text{d} x_{2}}{\text{d}t} = 0,  $$
which I believe corresponds to the vortices revolving together around some centre. In the minus case, we get
$$ \frac{\text{d} x_{1}}{\text{d}t} - \frac{\text{d} x_{2}}{\text{d}t} = 0,  $$
where the two point vortices travel parallel to each other.


Q: puts implementation in assembly with nasm x86-64 I'm new to assembly and I'm trying to work on an implementation of the C function puts in assembly with nasm x86-64 on my Ubuntu.
Everything was fine until I write the tests for the function: there is a behavior that I can not reproduce:
When I send char *str = strdup(""); to my puts function (alias ft_puts), my function return an error instead of printing a newline like the original puts function.
Here is my puts implementation (ft_puts.s):
section .data
new_line        db      10      ; new line

section     .text
global      ft_puts
extern      strlen

ft_puts:                        ; Alias int puts(const char *s)
    call    strlen
    push    rax                 ; Number of printed chars have to be returned by ft_puts

    cmp     rax, 0
    jg      print_string        ; if length > 0, print string
    cmp     rax, 0
    jz      print_newline       ; else if length == 0 (jle or <= 0, give the same result to my problem), print new line char
    jmp     error               ; else go to error

print_string:
    mov     rsi, rdi            ; string arg for write
    mov     rdi, 1              ; file_descriptor arg for write
    mov     rdx, rax            ; length arg returned by ft_strlen for write
    mov     rax, 1              ; write
    syscall

    test    rax, rax
    jle     error               ; if write failed, go to error
    jmp     print_newline       ; else print new line char

print_newline:
    mov     rsi, new_line       ; new line as string arg for write
    mov     rdx, 1              ; new line string length
    mov     rax, 1              ; write
    syscall

    test    rax, rax
    jle     error               ; if write failed, go to error
    jmp     success             ; else go to success

success:
    pop     rax                 ; Get number of chars printed by print_string
    inc     rax                 ; Add new line printed by print_newline to this number
    jmp     end

error:
    pop     rax
    mov     rax, -1             ; Return EOF (alias -1) on error
    jmp     end

end:
    ret

Sorry if my code looks terrible, I started assembly a week ago.
I'm new to Stack Overflow and the help center told me to give a code for testing my code. So, here is a main.c:
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>

int ft_puts(const char *s);

int main(void)
{
    char    *str;
    int     ret[2];

    str = strdup(".");

    write(1, "[", 1);
    ret[0] = puts(str);
    write(1, "]", 1);
    write(1, "\n", 1);
    write(1, "[", 1);
    ret[1] = ft_puts(str);
    write(1, "]\n", 2);

    printf("puts return value : %d | ft_puts return value : %d\n\n", ret[0], ret[1]);
    free(str);

    str = strdup("");

    write(1, "[", 1);
    ret[0] = puts(str);
    write(1, "]", 1);
    write(1, "\n", 1);
    write(1, "[", 1);
    ret[1] = ft_puts(str);
    write(1, "]\n", 2);

    printf("puts return value : %d | ft_puts return value : %d\n", ret[0], ret[1]);
    free(str);

    return (0);
}

And to compile and run this code :)
nasm -f elf64 ft_puts.s -o ft_puts.o
gcc -c main.c
gcc main.o ft_puts.o -o test
./test

The problem seems to be in my print_newline label but I can't find it. If someone can help me ? (It's hard to get some help on assembly language around me irl)
(I don't know if should include C tag to my question too haha, so much questions)

A: Two problems. One, the call strlen is allowed to clobber some registers which include rdi and you need that later. So, surround the call strlen with push rdi and pop rdi to save and restore it.
Second, you do not initialize rdi in the print_newline block. You need to set it to 1 for stdout just like you did in the print_string block.
PS: You should learn to use a debugger.


Q: Why does changing innerText value also changes innerHTML? I have a asp.net code that creates a button as follows:
Maximize

now in the javascript file I am doing the following inside the function1 function:
document.getElementById("button1").innerText = "Minimize";
document.getElementById("button1").value = "Minimize";
document.getElementById("button1").className = "iconMinimizeLightText";

What I noticed was before the line : "document.getElementById("button1").innerText = "Minimize";" is executed the value in "document.getElementById("button1").innerHTML" is
document.getElementById("button1").innerHTML = "Maximize"

but after that line is executed the value in "document.getElementById("button1").innerHTML" is
document.getElementById("button1").innerHTML = "Minimize"

Why is innerHTML value changing as I only changed the innerText value ?
Thanks in advance.
P.S. Sorry this might be a stupid question but I have only started learning this language since a couple of weeks.

A: Both innerText and innerHTML set the HTML of the element. The difference is that innerText—by the way, you might want to use textContent instead—will escape the string so that you can't embed HTML content in it.
So for example, if you did this:
var div = document.createElement('DIV');
div.innerText = 'Hello';
document.body.appendChild(div);

Then you'd actually see the string "Hello" on the screen, as opposed to "Hello" (inside a span).
There are some other subtleties to innerText as well, which are covered in the MDN article referenced above.


Q: Why does this menu act screwy in IE? SOS I hope someone can help. This is driving me nuts.
You can see the page i'm having problems with at www.jomundayphotography.com/template.html.
The dropdown menu is working everywhere but Internet Explorer (all versions are having problems).
The Code:
<!DOCTYPE HTML>

<meta charset="utf-8">
<title>Untitled Document</title>
<link href='http://fonts.googleapis.com/css?family=Droid+Sans:400,700' rel='stylesheet' type='text/css'>
<link href="css/navcss.css" rel="stylesheet" type="text/css"/>
<link href="css/csstest2.css" rel="stylesheet" type="text/css">

                            Professional
                            Experienced
                            Approachable

about Us

                    the team

Henry Drucker

Joanna Yianni

                    services

Residential Property

Commercial Property

Company Commercial

Landlord and Tenant

Wills

Trust and Probate

Family Life

Employment

General Litigation

Personal Injury

contact us

 find us

<nobr>Residential Property</nobr>

<nobr>Commercial Property</nobr>

<nobr>Company Commercial</nobr>

<nobr>Landlord and Tenant</nobr>

<nobr>Wills</nobr>

<nobr>Trust and Probate</nobr>

<nobr>Family Law</nobr>

<nobr>Employment</nobr>

<nobr>General Litigation</nobr>

<nobr>Personal Injury</nobr>

moving House?

At Sinclairs we have over
25 years experience,
helping our clients
through the moving process,
advising on how to stay
in control of their rented
properties,and in all areas
of legal documentation.

renting?

need to make a Will?

0208 203 3344
info@sinclairssolicitors.com<button class="myButton" email>email us</button>
20 Watford Way, Hendon, NW4 3AD

read what our clients have to say about us

The CSS
@charset "utf-8";
/* CSS Document */
@charset "utf-8";
/* CSS Document */

@charset "utf-8";
/* CSS Document */
/* reset */
html, body, div, span, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code,del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    vertical-align: baseline;
    }

body {
    line-height: 1;
    }

ol, ul {
    list-style: none;
    }

blockquote, q {
    quotes: none;
    }

blockquote:before, blockquote:after, q:before, q:after {
    content: '';
    content: none;
    }

table {
    border-collapse: collapse;
    border-spacing: 0;
    }
/* @font-face @/ /* Generated by Font Squirrel (http://www.fontsquirrel.com) on May 2, 2011 04:30:37 PM America/New_York */
/* end reset*/

body {
    position:relative;
    background: url(../images/Backgrounds/bgtile1.gif);
    z-index: -30;
    overflow: scroll;
    }

#container {
    position:relative;
    top: 0px;
    width: 1002px;
    height:850px;
    margin: 20px auto 0px auto;
    background-color: #fff;
    /*border-right: 15px #18c662 solid;*/
    }

#header {
    position:relative;
    display: block;
    clear: both;
    z-index:10;
    margin: 0px;
    height: 170px;
    background-image: url(../images/Backgrounds/headerbg.gif);
    background-repeat:repeat-x;
        }

#logo {
    clear:both;
    padding-top: 20px;
    padding-bottom:15px;
    padding-left: 30px;
    float:left;
    height: 140px;
    background: none;
    }

#conveyancingQuality {
        float:right;
    height: 95px;
    padding-top: 10px;
    }
#motto {
    clear:both;
    position: absolute;
    line-height:.9;
    left: 470px;
    top: 30px;
    color: #000;
    width: 200px;
    font-size: 1.8em;
    padding-top: 4px;
    padding-right: 0px;
    padding-bottom: 4px;
    padding-left: 0px;
    margin: 0px;
    font-family: 'Ropa Sans', "Trebuchet MS", Helvetica, Arial, sans-serif;
    font-style: italic;
    line-height: 1.3;
        }

#motto1 {
    display: none;
    }

#motto2 {
    display: none;
    margin-left: 40px;
        }

#motto3 {
    display: none;
    margin-left: 70px;
        }

#navBar {
    clear:both;
    width: 100%;
    margin: 0 auto;

        }

#navBar a {

    display: block;
    width: 238.5px;
    height: 18px;
    /*margin-right: 16.25px;
    margin-left: 16.25px;*/
    padding: 6px;
    border-right:0px #fff solid;
        text-decoration:none;
            background: url(../images/Buttons/buttona.png);
            height: 50px;
            background-repeat:no-repeat;
            color: #000;
    font-family: 'Ropa Sans', "Trebuchet MS", Helvetica, Arial, sans-serif;
            font-size:1.8em;

}
#aboutUsHeading a {
    /*margin-left: 30.25px;*/
    }
#contactMenuHeading a{
    /*margin-right: 0px;*/
    border-right:0px #fff solid;
    }

#navBar a:hover {

    color: #039;
    color: rgba(21, 68, 86, .9);
    background: url(../images/Buttons/buttonb.png);
    background-repeat: repeat-x;

    }

#navBar li.menuItem {
    /*z-index:21;*/
    margin-top:-6px;
    text-align:center;
    margin-right:0px;
    float:left;
    line-height: 1.6;
    font-size:100%;
    height: 30px;

    border-right:0px #fff solid;

    }

.subMenuItem {
    position:relative;
    top: 0px;
    display: none;
    font-size:80%;
    text-indent: 15px;
    text-align: left;
    border-right:0px #fff solid;
    height: 50px;
    z-index:30;
        }
#navBar ul ul li a {
    height:30px;
    background: url(../images/Buttons/submenubuttona.png);
    background-repeat: no-repeat;
    font-size: 95%;
            }
#navBar ul ul li a:hover {
    background: url(../images/Buttons/submenubuttonb.png)
            }

#content {
    clear: both;
    z-index: 22;
    position: absolute;
    top: 235px;

    }
.contentBox {

    position: absolute;
    float:left;
    border: 1px #154456 solid;
    margin: 0px;
    height: 600px;
    /*background-image: url(../images/Backgrounds/contentbg2.png);
    background-repeat: repeat-x;
    /*-webkit-border-radius: 7px;
-moz-border-radius: 7px;
border-radius: 7px;*/
}

#sideBarLeft {
    position:relative;
    width: 1000px;
    }
#miniMenu {
    padding: 5px 0px;
    margin: 210px 0px 5px 13px;
    font-family: 'Ropa Sans', "Trebuchet MS", Helvetica, Arial, sans-serif;
    background: none;
    width: 200px;
        -webkit-box-shadow: 1px 1px 2px 1px rgba(0, 0, 0, .7);
-moz-box-shadow: 1px 1px 2px 1px rgba(0, 0, 0, .7);
box-shadow: 1px 1px 2px 1px rgba(0, 0, 0, .7);
        }

#miniMenu a {

    display:block;
    text-decoration:none;
    font-size:110%;
    height: ;
    padding: 3px 3px 3px 10px;
    margin-top: 0px;
    margin-bottom: 3px;
    width:90%;
    background-image: url(../images/Buttons/submenubuttona.png);
    background-repeat:no-repeat;
    color: #000;
    font-family: 'Ropa Sans', "Trebuchet MS", Helvetica, Arial, sans-serif;
    text-indent:0px;

    }

#miniMenu a:hover {
    text-decoration:none;
    color: rgba(21, 68, 86, .9);
    background-image: url(../images/Buttons/submenubuttonb.png);
    font-style:italic;
    -webkit-box-shadow: 0px 0px 0px 0px rgba(0, 0, 0, .7);
-moz-box-shadow: 0px 0px 0px 0px rgba(0, 0, 0, .7);
box-shadow: 0px 0px 0px 0px rgba(0, 0, 0, .7);
    }
#articleBox {
    left: 210px;
    width: 580px;

    }

#sideBarRight {
    left: 799px;
    width: 200px;
    }

 .contentBox, #container,  #content {
    -webkit-box-shadow: 2px 2px 6px 2px rgba(0, 0, 0, .7);
    -moz-box-shadow: 2px 2px 6px 2px rgba(0, 0, 0, .7);
    box-shadow: 2px 2px 6px 2px rgba(0, 0, 0, .7);
    }

#galleryBox {
    positioning: absolute;
    top: 13px;
    left: 10px;
    height: 170px;
    width: 980px;
    background: url(../images/Backgrounds/dep_5272790-London-Skyline.png);
    }

#contentHolder{
    width: 550px;
    height:100%;
    background:#fff;
    margin-left:250px;
    z-index: 10
    }

#contentHolder p {
    padding: 0;
    z-index: 11;
    padding-top: 10px;
    }

#p1 {
    display: none;
    font-family: 'Droid Sans', "Trebuchet MS", Helvetica, Arial, sans-serif;
    font-size: 80%;
    color: #154456;
    margin-left: 470px;
    }

#p3 {
    position: absolute;
    top: 0px;
    display: none;
    margin-left: 320px;
    font-family: 'Droid Sans', "Trebuchet MS", Helvetica, Arial, sans-serif;
    font-size: 100%;
    text-align:center;
    color: #154456;
    }

#p4 {
    display: none;
    font-family: 'Droid Sans', "Trebuchet MS", Helvetica, Arial, sans-serif;
    font-size: 80%;
    color: #154456;
    margin-left: 470px;
    }

#p7 {
    display: none;
    font-family: 'Droid Sans', "Trebuchet MS", Helvetica, Arial, sans-serif;
    font-size: 80%;
    color: #154456;
    margin-left: 470px;
    }

#contact {
    display: none;
    font-family: 'Droid Sans', "Trebuchet MS", Helvetica, Arial, sans-serif;
    font-size: 200%;
    color: #154456;
    margin-left: 0px;
    }

#contact a{
    color: #154456;
    text-decoration:none;
}

#contact a:hover{
    text-decoration: underline;
}

#contactBox {
    display: block;
    width: 200px;
    height: 100px;
    position:absolute;
    top: 76px;
    background: #3F3
    }

.myButton {
    background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #ededed), color-stop(1, #154456) );
    background:-moz-linear-gradient( center top, #ededed 5%, #154456 100% );
    filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ededed', endColorstr='#154456');
    background-color:#ededed;
    -moz-border-radius:6px;
    -webkit-border-radius:6px;
    border-radius:6px;
    border:1px solid #154456;
    display:inline-block;
    color:#f5f5f5;
    font-family:arial;
    font-size:15px;
    font-weight:bold;
    padding:6px 24px;
    text-decoration:none;
}.myButton:hover {
    background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #154456), color-stop(1, #ededed) );
    background:-moz-linear-gradient( center top, #154456 5%, #ededed 100% );
    filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#154456', endColorstr='#ededed');
    background-color:#154456;
}.myButton:active {
    position:relative;
    top:1px;
}

#galleryBox2 img {;
    position:absolute;
    width: 100%;
    height:100%;
    margin: 0 auto;
            }

#image2 {
    display: block;
    }

#image1 {
    display: block;
    }
#galleryBox2 img:hover {

    }

#galleryBox2 {
    positioning: absolute;
    top: 190px;
    left: 215px;
    height: 375px;
    width: 210px;
background-image: url(../images/Backgrounds/contentbg2.png);
    }
#galleryBox3 {
    positioning: absolute;
    top: 190px;
    left: 440px;
    height: 375px;
    width: 538px;
background-image: url(../images/Backgrounds/contentbg2.png);
    }
#testimonialTeaser {
    position: relative;
    top: 12px;
    background:none;
    /*background: #18c662;*/
    width: ;
    height: 100px;
    margin: 0 auto;

    }
#footertop {
    margin: 40px 0px 0px 0px;
    background: url(../images/Backgrounds/footerbg.png);
    background-repeat: repeat-x;
    position:relative;
    top:0px;
    height:75px;
    }
#footer {
    background:#FFFFFF;
    position:relative;
    top:75px;
    height:auto;
    }

The JavaScript
// JavaScript Document

$(document).ready(function() {
    var teamMenuHeading = $('#teamMenuHeading');
    var teamSubMenu = $('#teamMenuHeading li');
    var teamSubMenuLinks = $('#teamMenuHeading a');
    var buttonb = ['images/buttonb.gif'];
    //alert (teamSubMenu.length)
teamMenuHeading.hover(
            function(){
                teamSubMenu.stop(true,true).slideDown(700, 'easeOutSine' //, function() {

                                    )
                }, //end teamMenuHeading hover first function

            function(){
                teamSubMenu
                        .stop(true,true).slideUp(200, 'easeOutSine'//, function() {

                )

            }); //end teamMenuHeading hover

    var servicesMenuHeading = $('#servicesMenuHeading')
    var servicesSubMenu = $('#servicesMenuHeading li');
    var servicesSubMenuLinks = $('#servicesMenuHeading a');
//alert (servicesSubMenu.length)
servicesMenuHeading.hover(
            function(){
                    servicesSubMenu.stop(true,true).slideDown(700, 'easeOutSine' //, function() {

                                    )
                }, //end teamMenuHeading hover first function

            function(){
                servicesSubMenu
                        .stop(true,true).slideUp(200, 'easeOutSine'//, function() {

                )

            }); //end servicesMenuHeading hover

    var contactMenuHeading = $('#contactMenuHeading')
    var contactSubMenu = $('#contactMenuHeading li');
    var contactSubMenuLinks = $('#contactMenuHeading a');
//alert (servicesSubMenu.length)
contactMenuHeading.hover(
            function(){
                    contactSubMenu.stop(true,true).slideDown(700, 'easeOutSine' //, function() {

                                    )
                }, //end teamMenuHeading hover first function

            function(){
                contactSubMenu
                        .stop(true,true).slideUp(500, 'easeOutSine'//, function() {

                )

            }); //end contactMenuHeading hover

}); //end ready

A: Number 1 rule for styling lists:
Reset your lists: ul, li { margin:0;padding:0 }
Do not style LIs, other than display:, position: and float:.
Use display:block and put all styling on your A-tag.
This will clear up 99% of list layout problems.
See my tutorial: http://preview.moveable.com/JM/ilovelists/


Q: Binary relation induced by another binary relation Let $S$ be any discrete set. Let $\prec$ be a binary relation defined over $S$. I refer to the corresponding partial order set as $\langle S, \prec \rangle$, which, I presume, being one possible standard nomenclature.
Now, I would like to formally introduce a new binary relation $\vdash$ which is defined only between couples $i,j \in S$ such that $i\prec j$.
Therefore $i \nprec j$ means that $\vdash$ is not defined between $i$ and $j$
I might define the subset $\{(i,j) \in S\times S : i \prec j\}$, but then I don't know how to keep things formal and standard.
My question is: is there a standard syntax of treating this scenario?

A: It's simply an equivalence class.
https://en.wikipedia.org/wiki/Equivalence_class