text:
# Is this Python pathfinder efficient enough?

I'd like to see if my code follows common practice, or is already efficient or fast enough.

from random import randint
w=[[2,0,0,0,0],[0,0,2,0,0],[0,0,1,0,0],[0,0,0,0,0],[0,0,0,0,0]] #1 represent Mr.Pacman, #2 represent food.
for y in xrange(len(w)): #Finding the coordinate of Mr.Pacman
for x in xrange(len(w[0])):
if (w[y])[x]==1:
hor=x
ver=y
break

horbound=len(w[0])
verbound=len(w)
def letsCout(xCurrent,yCurrent,xTarget,yTarget,xBoundary,yBoundary,checkedSquare):
if (xCurrent+1==xTarget and yCurrent==yTarget) or (xCurrent-1==xTarget and yCurrent==yTarget) or (xCurrent==xTarget and yCurrent+1==yTarget) or (xCurrent==xTarget and yCurrent-1==yTarget):
return 1
else:
battle=[9999,9999,9999,9999]
d=[]
d.extend(checkedSquare)
d.append([xCurrent,yCurrent])
if xCurrent-1>-1 and [xCurrent-1,yCurrent] not in d: #going left
battle[0]=letsCout(xCurrent-1,yCurrent,xTarget,yTarget,xBoundary,yBoundary,d)+1
if xCurrent+1<xBoundary and [xCurrent+1,yCurrent] not in d: #going righ
battle[1]=letsCout(xCurrent+1,yCurrent,xTarget,yTarget,xBoundary,yBoundary,d)+1
if yCurrent-1>-1 and [xCurrent,yCurrent-1] not in d: #going up
battle[2]=letsCout(xCurrent,yCurrent-1,xTarget,yTarget,xBoundary,yBoundary,d)+1
if yCurrent+1<yBoundary and [xCurrent,yCurrent+1] not in d: #going down
battle[3]=letsCout(xCurrent,yCurrent+1,xTarget,yTarget,xBoundary,yBoundary,d)+1
battle.sort()
return battle[0]
#
happy=[9999,9999,9999,9999]
for y in xrange(len(w)): #Checking the coordinate of a food. If multiple food exist, the method will find the food with the smallest cost.
for x in xrange(len(w[0])):
if (w[y])[x]==2:
if hor-1>-1: #going left
if (w[ver])[hor-1]==2:
happy[0]=1
else:
candidate=[happy[0],letsCout(hor-1,ver,x,y,horbound,verbound,[[hor,ver]])+1]
candidate.sort()
happy[0]=candidate[0]
if hor+1<horbound: #going right
if (w[ver])[hor+1]==2:
happy[1]=1
else:
candidate=[happy[1],letsCout(hor+1,ver,x,y,horbound,verbound,[[hor,ver]])+1]
candidate.sort()
happy[1]=candidate[0]
if ver-1>-1: #going up
if (w[ver-1])[hor]==2:
happy[2]=1
else:
candidate=[happy[2],letsCout(hor,ver-1,x,y,horbound,verbound,[[hor,ver]])+1]
candidate.sort()
happy[2]=candidate[0]
if ver+1<verbound: #going down
if (w[ver+1])[hor]==2:
happy[3]=1
else:
candidate=[happy[3],letsCout(hor,ver+1,x,y,horbound,verbound,[[hor,ver]])+1]
candidate.sort()
happy[3]=candidate[0]

wow=["left","right","up","down"]
while True: #The decision. The lowest cost direction for next move will be picked. If there is tie for lowest cost, I want to pick it randomly
poop=randint(0,3)
for x in xrange(4):
if happy[poop]>happy[x]+1:
break
else:
print wow[poop]
break

I honestly see this project as a dynamic programming task. Is this code good enough?

• How efficient is "efficient enough"? And it certainly doesn't follow common practice. – jonrsharpe Jul 14 '14 at 15:53
• Faster and takes less memory can be a good point to start as efficient enough =) – Realdeo Jul 14 '14 at 15:59
• Whatever you want to improve, you will get more reviews if people can read your code. A good start would be lines short enough that reviewers don't have to scroll right, and variable names long enough that the meaning is clear. If you then post the readable code in a new question you will see how many more reviews you get. – trichoplax Jul 21 '14 at 14:20

You have far too many lines with more than 80 characters, you even have a line with 180+ characters: Does not fit my screen.

You may, as PEP8 states, put spaces around binary operators.

You also have an undocumented function with a name that does not helps me.

Seems you have copy/pasted some code many times, that's not DRY, and that may be bad, you may win some readability by using a function.

You should not use this kind of control flow:

for y in xrange(len(w)):
for x in xrange(len(w[0])):
if (w[y])[x]==2:
if hor-1>-1: #going left
if (w[ver])[hor-1]==2:

That's freaking unreadable, and I'll NOT read it. Avoid imbricate so many control flow.


text:
lilypond-user
[Top][All Lists]

Possible Bug with \numericTimeSignature

 From: Joshua Nichols Subject: Possible Bug with \numericTimeSignature Date: Mon, 12 May 2014 21:25:01 -0500

I've never experienced this before now...

I go to use the following settings:

global = {

\key c \major

\numericTimeSignature

\time 4/4

\tempo 4=100

}

and I got the attached picture. I have no idea what I'm doing wrong, or if this is a bug worth noting.

I was using absolute pitch mode. Thanks in advance.

Sincerely,

Josh

kTest.png
Description: PNG image

format: plain


text:
I am taking issue with the Riemann Integral

1. Jul 4, 2010

Poopsilon

Basically from what I understand the integral of a function, say ∫x^2dx from say 0 to 1, can be represented as the supremum/infimum of the function values within each of a countably infinite number of vanishingly small intervals in the domain created by a countably infinite number of partition points, each multiplied against the corresponding length of the interval within which each supremum/infimum resides.
By The Nested Interval Theorem (I think!) we know each of these intervals has only a single value as n->∞, which means that the infimum=supremum, the upper and lower integrals are equal, thus the integral exists etc.
My concern is that each of these intervals has length 1/n as n->∞, which means they can be put into a one-to-one correspondence with the natural numbers, meaning the number of heights at which the integral is evaluated compose a countably infinite set. Yet! the domain of the original function is the real numbers, which are uncountably infinite! I'm still a novice in the areas of higher mathematics but to my mathematical intuition this implies that we are using methods that are only precise to the level of a countably infinite set to approximate the area under the curve of a function which has an uncountably infinite domain. Does this not entail that we are not taking into account all possible inputs that the function can take? Is it not possible that this function is behaving in strange ways, possibly where L(ƒ,Pn)≠U(ƒ,Pn), if we were to zoom infinitely in on some point of the curve?

Hopefully some of you more experienced analysts can shed some light on this for me, and any other words of wisdom about analysis in general would be great to.

2. Jul 4, 2010

Dickfore

You are absolutely right. Consider the Dirichlet function:

$$f(x) = \left\{\begin{array}{l} 1, \ x \in \mathbb{Q} \\ 0, \ x \notin \mathbb{Q} \end{array}\right.$$

It is not Riemann integrable.

3. Jul 4, 2010

Poopsilon

I guess my confusion comes from the fact that the Archimedean Sequence is designed such that each interval in the partition of the function's domain collapses onto a single point, yet it has a length of 1/n. So there are only a total of n of them which means we have essentially evaluated the function at n points, but we have neglected all those points on the real number line (an infinite number of them) that if entered into the function would provide a unique output.

If I understand what you mean by bringing up the Dirichlet Function, you're saying that we have functions with an interval domain that do act strangely at a level only the density of the real numbers can accommodate, but it seems that it is possible that even continuous functions of a real variable may act strangely at a level that we are blind to if we can only discuss it within the context of sequences and their limits.

4. Jul 4, 2010

Dickfore

Continuity of a function implies Riemann integrability.

5. Jul 12, 2010

lunde

I believe that it's actually the least upper bound property and not the nested interval property. In terms of your main question, the rational numbers form a countable dense subset of R, which allows us to use Riemann integrals on it. It is always possible to find a rational number (and thus from a countable subset) arbitrarily close to any real number which places us within good striking distance of making sure the irrationals don't do anything too crazy. There are a lot of examples like this where the rationals serve as an adequate countable skeleton that allows us to do many things within an uncountable set that we couldn't do otherwise. Also, you might want to look up nets on wikipedia, I personally perfer a net of partitions partially ordered by fineness over the clunky upper and lower riemann integral set up.


text:
# How do you simplify 3sqrt18?

Mar 15, 2016

$9 \sqrt{2}$
Notice that: $18 = 2 \cdot {3}^{2}$
Therefore $3 \sqrt{18} = 3 \sqrt{2 \cdot {3}^{2}} = 3 \cdot 3 \sqrt{2}$
$= 9 \sqrt{2}$


text:
Back

Subtract the Squares

Variables in math are representations of a single, unknown quantity. “Variables” in computer science aren’t one single thing, and they’re not unknown. Without batting an eyelid, programmers will write things like this:

This is clearly absurd! There’s no $x$ such that $x = x + 1$. What's going on in the brains of programmers?


text:
\subfloat \caption odd behavior

I'm very new to Latex and trying my best to adopt it as my method of choice for paper and my Thesis. I have always managed to solve any problems encountered by browsing through this forum but can't find anything on this error.

I have a figure made up of 4 sub-figures in a 2x2 matrix. Somehow my template doesn't allow me to use the subcaption package so I am forced to use the subfig package which seems to work fine if not for the odd error I encountered.

My code is as follows:

\documentclass[11pt, english, doublespacing,]{MastersDoctoralThesis}
\usepackage{graphicx,amsmath,amssymb,rotating,float,cite,multirow,subfig,
array,bm,appendix,epsfig,epstopdf,pdfpages,array,caption}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}

\begin{figure}[!htp]
\centering
\label{Saliency_Maps}
\subfloat[]{\includegraphics[width=0.49\linewidth]{figures/colour_conp.png} \label{Sal:Colour}}
\subfloat[]{\includegraphics[width=0.49\linewidth]{figures/intensity_conp.png} \label{Sal:Intensity}}
\\
\subfloat[] {\includegraphics[width=0.49\linewidth]{figures/orientation_conp.png} \label{Sal:Orit}}
\subfloat[]{\includegraphics[width=0.49\linewidth]{figures/final_sal_map.png} \label{Sal:Final}}
\caption{ Conspicuity maps for a sample image showing colour \subref{Sal:Colour}, intensity \subref{Sal:Intensity} and orientation \subref{Sal:Orit} maps which are then combined into the final saliency map \subref{Sal:Final} which will need to be thresholded.}
\end{figure}

\end{document}

The caption is causing all sort of errors such as:

Argument of \caption@ydblarg has an extra }. ...inal} which will need to be thresholded.}

...and...

Paragraph ended before \caption@ydblarg was complete. ...inal} which will need to be thresholded.}

...among other under full and overfull \hbox errors, which make no sense.

Removing the \caption{...} doesn't show any errors, but obviously shows no cation. Also even though there are errors when the \caption{...} is inserted the figures and caption display correctly..... with the exception that the letters under the figures are uppercase while the letters substituted be \subref{...} are lower case. (See image)

The errors are only suppressed if I set \setcounter{tocdepth}{3}. Setting it to \setcounter{tocdepth}{2} triggers a whole lot of errors which similarly don't make any sense and there are some odd entries in the "List of Figures" page where the offending image entry should be.

Any ideas what could be happening and how I can solve this nagging issue. Alternatives are welcome.

Many thanks

• Welcome to TeX - LaTeX! Please extend your code snippet to minimal working example (MWE)](meta.tex.stackexchange.com/q/228) including the documentclass and packages needed. – Andrew Swann Apr 5 '16 at 18:34
• Please update your question with the new information. – Andrew Swann Apr 5 '16 at 18:41
• Why can't you use subcaption? it should work just fine. – Johannes_B Apr 8 '16 at 21:04
• I get an error saying "Package subcaption Error: This package can't be used in cooperation(subcaption) with the subfig package. \endinput}{}" and I need to use sibfig as I have some old tex files I'm using in this document that use this and it's laborious to change them all. – PDF417 Apr 9 '16 at 9:58
• For completeness sake, I corrected the capital letters under the sub figures by inserting "\captionsetup[subfigure]{labelfont=rm}" before the \begin{figure}. – PDF417 Apr 9 '16 at 10:00

The cause of your problem is use of \subref{...}. Their use in caption had to be protected: \protect\subref{ ...}. See and test code below:

\documentclass{article}
\usepackage{graphicx}
\usepackage{subfig}

\begin{document}
\begin{figure}[htp]
\centering
\subfloat[\label{Sal:Colour}]{\includegraphics[width=0.49\linewidth]{example-image}}
\hfill
\subfloat[\label{Sal:Intensity}]{\includegraphics[width=0.49\linewidth]{example-image}}
\\
\subfloat[\label{Sal:Orit}] {\includegraphics[width=0.49\linewidth]{example-image}}
\hfill
\subfloat[\label{Sal:Final}]{\includegraphics[width=0.49\linewidth]{example-image}}
\caption{ Conspicuity maps for a sample image showing colour \protect\subref{Sal:Colour}, intensity \protect\subref{Sal:Intensity} and orientation \protect\subref{Sal:Orit} maps which are then combined into the final saliency map \protect\subref{Sal:Final} which will need to be thresholded.}
\label{Saliency_Maps}
\end{figure}
\end{document}

By the way, label in figure environment had to be always after caption, othervise the referencing will work wrong.

• Brilliant, Thanks for your help and comments. The \protect\subre{} was the issue. Noted re: \label after caption. The only difference between mine and yours is that mine still has uppercase letters under each figure and lower case in the caption. Would you have any hints on how to chance the uppercase letter to lower case? Edited the question to include an image of what's happening. – PDF417 Apr 5 '16 at 19:28
• Ah, seem that the goblin "copy-past" was on the work :-). Corrected! – Zarko Apr 5 '16 at 19:30


text:
# CMS-Studc Student Research Session

All abstracts
Size: 131 kb
Centro de Investigación y de Estudios Avanzados del Instituto Politécnico Nacional
Hilbert Transform associated to the main Vekua equation
PDF abstract
Size: 76 kb
We will recall some results from article $[1]$, where an explicit representation to the Hilbert transform $\mathcal{H}$ was given on the unit sphere in $\mathbb{R}^n$. The Hilbert transform takes data on the boundary and completes them to obtain the boundary value of a monogenic (hyper-holomorphic) function. These results will be reduced to the case $n=3$ with $\Omega=B^3$ and $\partial\Omega=S^2$. Then, we will give a definition for the Hilbert transform $\mathcal{H}_f$ associated to the main Vekua equation $DW=\frac{Df}{f}\overline{W}$. Furthermore, some results about $\mathcal{H}_f$ will be enunciated such as the continuity, invertibility and uniqueness. After that an extension in $\Omega$ will be given for the vectorial part of the solutions of the main Vekua equation, when the boundary value of the scalar part is known. That vectorial extension in terms of $\mathcal{H}_f$ will be compared with the vectorial extension derivated of the general solution of the Div-Curl system corresponding to the main Vekua equation given in [2]. [1] Tao Qian and Yan Yang. Hilbert Transform on the Sphere with the Clifford Algebra Setting, Journal of Fourier Analysis and Applications, ($2009$), $753-774$. [2] Briceyda B. Delgado and R. Michael Porter. General Solution of the Inhomogeneous Div-Curl System and Consequences, $2017$ (in preparation).
• Siddhi Pathak
Queen's University
On a Conjecture of Livingston
PDF abstract
Size: 45 kb
In the early 1960s, Erdos conjectured that the $L$-series attached to periodic arithmetical functions with period $q$, taking the value 0 on multiples of $q$ and values in {1, -1} otherwise, do not vanish at $s$ = 1. In an attempt to resolve this conjecture, Livingston predicted the linear independence of logarithm of certain algebraic numbers. In this talk, we outline recent work settling Livingston’s conjecture.
• Jean Lagacé
Université de Montréal
Lattice point counting in spectral theory
PDF abstract
Size: 38 kb
The spectral asymptotics of elliptic operators (e.g. the Laplacian) and analytic number theory are linked together via lattice point counting problems. As an example, counting eigenvalues of the Laplacian on a flat square torus corresponds to counting integer points in a disk of large radius, which is precisely the Gauss circle problem, a longstanding problem in analytic number theory. In this presentation, I will explain how lattice counting methods are applied to study spectral asymptotics for Schrödinger operators on waveguides and resonators, and also for the Steklov eigenvalue problem on a cube. These two settings will illustrate different flavors of lattice counting problems arising in spectral theory. The talk is based on joint works with L. Parnovski (UCL), as well as with A. Girouard (Laval), I. Polterovich (Montréal) and A. Savo (Rome).
• Miriam Bocardo Gaspar
Centro de Investigación y de Estudios Avanzados del Instituto Politécnico Nacional
Local zeta functions and p-adic string amplitudes
PDF abstract
Size: 57 kb
In this talk we explain some connections between $p$-adic local zeta functions and $p$-adic Koba-Nielsen type string amplitudes. The convergence of these amplitudes is related with the convergence of Igusa-type integrals depending on several complex parameters. Hence, the string amplitudes are "essentially" local zeta functions, and thus, they are algebraic-geometric objects that can be studied over several ground fields, for instance $\mathbb{R}$, $\mathbb{C}$, $\mathbb{Q}_{p}$, $\mathbb{C}((t))$, and that on each of these fields these objects have similar mathematical properties.
• Jordan Kostiuk
University of Alberta
Geometrization of Supersymmetry Algebras
PDF abstract
Size: 39 kb
Supersymmetry algebras are special kinds of algebras that arise in the study of supersymmetric physics. M.Faux and S.J.Gates have shown that much of the structure of $1$-dimensional supersymmetry algebras can be encoded in bipartite graphs with additional combinatorial structures know as \emph{adinkras}. In this talk I will present a method for geometrizing adinkras --- that is, a means of interpreting all of the structure of an adinkra in a geometrically meaningful way --- as described in my recent works. After describing the construction I will spend some time explaining just how special the kinds of objects that we are deriving in this way are; this is a reflection of the supersymmetry from which we started.
• Yurij Salmaniw
McMaster University
Bounded Solutions to a Singular Parabolic System
PDF abstract
Size: 91 kb
Recently, authors have studied singular elliptic systems, such as \begin{equation*} \begin{cases} - \Delta u = \frac{1}{u^p} + \frac{1}{v^q} \cr - \Delta v = \frac{1}{u^r} + \frac{1}{v^s}, \quad \quad \quad x \in \Omega , \cr u(x,t) = v(x,t) = 0 , \quad x \in \partial \Omega , \end{cases} \end{equation*} in a smooth, bounded domain $\Omega \subset \mathbb{R}^N$. Such problems arise in the study of enzyme kinetics, chemical reactions that are catalyzed by enzymes, as well as some applications to physics used to describe the gravitational potential of self-gravitating, spherically symmetric, polytropic fluid. This presentation concerns the recently submitted joint work with S. Chen and R. Xu on the following singular parabolic system \begin{equation*} \begin{cases} u_t = \Delta u + \frac{f(x)}{v^p} \cr v_t = \Delta v + \frac{g(x)}{u^q},\quad \quad t>0, x \in \Omega , \cr u(x,t) = v(x,t) = 0 , \quad \quad \ x \in \partial \Omega , \end{cases} \end{equation*} a natural extension of the elliptic problem found above. Under suitable conditions for real valued constants $p,q >0$ and the functions $f(x)$, $g(x)$, existence of weak and classical solutions are obtained using a powerful functional method. Such equations are interesting due to their singular nature on the boundary $\partial \Omega$. Applications of classical methods are unsuccessful, so alternative methods must be utilized. Through obtaining bounds for functions combining the solutions $u,v$, and $\phi$, the first normalized eigenfunction of $-\Delta$, we obtain uniform $L^p$ bounds for $u_\varepsilon,v_\varepsilon$ in a related perturbation problem. Then, we use Sobolev embedding theorem to obtain classical solutions.
• Kento Osuga
University of Alberta
Supereigenvalue Models and Topological Recursion
PDF abstract
Size: 38 kb
It is an open question how to construct intersection theory on moduli spaces of super-Riemann surfaces. Since there is a well known relation between expectation values of Hermitian matrix models and intersection numbers on moduli spaces of Riemann surfaces, a potential approach to this mystery is to study supereigenvalue models, which are supersymmetric generalizations of Hermitian matrix models. About ten years ago, Eynard and Orantin showed that expectation values of Hermitian matrix models can be nicely reconstructed recursively via a formalism now called topological recursion. In this talk I will explain that, perhaps surprisingly, the Eynard-Orantin topological recursion can also be used to calculate expectation values of supereigenvalue models. It remains to be seen whether these new results help further our understanding of moduli spaces of super-Riemann surfaces.
• Octavian Mitria
University of Western Ontario
Open Whitney umbrellas are locally polynomially convex
PDF abstract
Size: 62 kb
The notion of polynomial convexity of compact subsets of the Euclidean complex space $\mathbb{C}^n$ plays a fundamental role in the general theory of approximation of continuous functions, uncovering deep connections to topology, Banach algebras, symplectic geometry, and other areas of mathematics. In this talk, we show that every totally real smooth surface in $\mathbb{C}^2$, with a singularity of the open Whitney umbrella type at the origin, is locally polynomially convex near the singularity. The motivation comes from the work of Givental who proved that for any compact real surface $S$ there exists a smooth mapping of $S$ into a symplectic manifold which is a Lagrangian embedding, except at a finite set of singular points. Moreover, these singularities can only be of the following two types: a transverse double self intersection, or an open Whitney umbrella. This is joint work with my adviser, R. Shafikov.
• Marie Lafrance
Université de Montréal
Supersymmetric sigma models and constant solutions
PDF abstract
Size: 68 kb
It was recently shown how to construct surfaces immersed in the $su(N)$ Lie algebra from solutions of the bosonic $CP^{N-1}$ sigma model. The method has also been generalized to more general Grassmanniann sigma models $G(M,N)$. Furthermore, we know in many cases the conditions on the solutions to lead to constant gaussian curvature surfaces. In this presentation, I will show you how to generalize these conditions to supersymmetric fields. The work has been done for the case $CP^{N-1}$ but little is known for other Grassmanniann manifolds fields. Starting with Lagrange equations, I will construct the extended solutions and prove that they have constant curvature. In some cases, we can prove that these are the only constant curvature solutions that exists.
University of Toronto
Finding Subalgebras of Real Semisimple Lie Algebras
PDF abstract
Size: 52 kb
In the 1950's, Tits gave a Bourbaki seminar talk wherein he presented a complete classification of subalgebras of compact real Lie algebras. One of the centrals idea in the classification, regularity, showed that compact Lie algebras have very rigid subalgebra structure. Continuing this line of inquiry, we shall describe techniques to exploit the rigid structure for compact Lie algebras to identify and classify subalgebras in the non-compact case, using the split real form $G_2$ as an example.
• Nancy Wallace
Université du Québec à Montreal
Une généralisation de l'opérateur $\nabla$. A generalization of the $\nabla$ operator. (Talk in French slides in English)
PDF abstract
Size: 72 kb
Introduits en 1988, par Ian G. Macdonald, les polynômes de Macdonald ont, depuis, fait l'objet de beaucoup de recherche. Dans cet exposé nous discuterons d'opérateurs linéaires à coefficients dans $\mathbb{Q}[q, q^{-1}, t, t^{-1}]$ ayant les polynômes de Macdonald comme vecteurs propres. Il n'est pas nécessaire de connaitre les polynômes de Macdonald pour comprendre l'exposé, il sera fait du point de vue des opérateurs en axiomisant les propriétés induites par la base de vecteurs propres. Plus précisément nous introduirons un ensemble d'opérateurs dits monomiaux généralisant l'opérateur $\nabla$ introduit par F.Bergeron et A.Garcia dans Science Fiction and Macdonald's Polynomials. Nous discuterons des opérateurs monomiaux ayant une interprétation combinatoire, nous en ferons une caractérisation, ainsi qu'une caractérisation de $\nabla$. Si le temps nous le permet, nous verrons comment ceci peut nous aider à résoudre une conjecture et certains problèmes. Talk on a certain class of Macdonald eigenfuctions.
• Nitin Chidambaram
University of Alberta
Topological recursion and quantum curves
PDF abstract
Size: 40 kb
The Eynard-Orantin topological recursion is a technique inspired by random matrix theory, that can be used to compute interesting enumerative invariants including knot invariants, Hurwitz numbers and Gromov-Witten invariants. Given a spectral curve, topological recursion computes an infinite sequence of symplectic-invariant meromorphic differentials on the curve. I will present the basic formalism of topological recursion. A 'quantum curve' is a differential operator associated with the curve and a WKB-type asymptotic solution to this curve. Quantum curves also encode some interesting (quantum) enumerative invariants. In this context, the conjecture that topological recursion on a spectral curve can be used to construct a quantum curve seems natural (this is proved for a large class of genus zero curves). I shall try to explain the relationship between topological recursion and quantum curves and hopefully discuss our recent work with Bouchard and Dauphinee (arxiv:1610.00225) where we studied the first class of higher genus quantum curves.
• Victor I. Bravo Reyna
Centro de Investigación en Matemáticas
Electromagnetism on supersymmetric structures
PDF abstract
Size: 38 kb
The objective of this talk is to present Dirac-like operators which are compatible with orthogonal and symplectic geometry, simultaneously. In particular, on the conformal flat homogeneous model of 4-dimensional Minkoski space we are introducing a operator that contains Maxwell's equations on a supersymmetric enviroment.
• Sumin Leem
University of Calgary
Cryptographic pairings and applications
PDF abstract
Size: 37 kb
Cryptographic pairings are bilinear, non-degenerate and computable maps, defined on elliptic or hyperelliptic curves. The primary application of a pairing is to enable tri-partite key exchange, but there are other useful and unique applications. Pairings can also be used for the remote secure authentication of authorized users using short space-efficient digital signatures. Pairings also have an important role in realizing ID-based cryptography, which uses a user’s ID as a compact and user-friendly public encryption key. In this talk, we first introduce properties and some examples of pairings. We then discuss applications of pairings mentioned above.
• Olivier Binette
Université du Québec à Montreal
Bayesian learning: semiparametric modelling and asymptotic theory
PDF abstract
Size: 38 kb
Bayesian learning, for our purposes, is about finding the probability distribution that a stochastic mechanism is following. For instance, it is of interest in bioinformatics to learn the distributions of protein torsional angles to better predict new protein structures. The bayesian solution is to characterize the space of possible distributions and to assign subsets prior probabilities, quantifying uncertainty about what the true distribution may be. Observations are incorporated in the model through Bayes’ theorem. Exploiting a correspondence between a class of bayesian statistical models and linear approximation operators, we demonstrate a general result on the asymptotic correctness of bayesian learning. The practical use of our approach is shown for the problem of learning the distribution of angular data: new angular data models, satisfying smoothness and geometric constraints, are constructed and studied using the approximation-theoric framework.
• Arpita Kar
Queen's University
A conjecture of Bateman regarding $r_5$$(n)$
PDF abstract
Size: 81 kb
Paul T. Bateman made a conjecture about the exact formula for $\sum_{|j| \leq n} \sigma(n-j^2)$. Later, he and Knopp proved the conjecture using the theory of half-integral weight modular forms. We present a simpler proof of the conjecture in the case when $n \equiv$ 1(mod 4). This is joint work with Prof. Ram Murty.


text:
Timed Modal Operator causes delay for serial data

I want to apply data send by an Arduino to a blender object to rotate it. Now I use this script, which works, but blocks blender so I can not see the rotation:

obj = bpy.data.objects['cube']
obj.rotation_mode = 'QUATERNION'

ser = serial.Serial(SerialConnectionPath,57600, timeout=1)
time.sleep(2)
ser.write('x'.encode('ascii'))

while 1:
try :
print(x)

# apply rotation here....
except ValueError:
error = "Error"

ser.close()

The next way I tried is to use a timed modal operator from the templates which I only changed slightly. The one I use looks the following:

class cl(bpy.types.Operator):
"""Operator which runs its self from a timer"""
bl_idname = "object.op"
bl_label = "Modal Timer Operator"

_timer = None
ser = None
obj = None

def __init__(self):
self.ser = serial.Serial(SerialConnectionPath,57600, timeout=1)
time.sleep(2)
self.ser.write('x'.encode('ascii'))     #tell the arduino to begin sending data

self.obj = bpy.data.objects['cube']

def modal(self, context, event):
if event.type in {'RIGHTMOUSE', 'ESC'}:
self.cancel(context)
self.ser.close()
return {'CANCELLED'}

if event.type == 'TIMER':
try :
print(x)

# apply rotation here

except ValueError:
error = "SomeError"

return {'PASS_THROUGH'}

def execute(self, context):
wm = context.window_manager
return {'RUNNING_MODAL'}

def cancel(self, context):
wm = context.window_manager
wm.event_timer_remove(self._timer)
return {'CANCELLED'}

def register():
bpy.utils.register_class(cl)

def unregister():
bpy.utils.unregister_class(cl)

if __name__ == "__main__":
register()
bpy.ops.object.op()

The problem is, that it works, it prints out the received values, but there is a massive delay in the data (about a few seconds). Does anyone know what could cause this? Another strange thing, is that it works maybe one out of ten times when I run the script.

• – lemon Mar 15 '17 at 18:45
• Thank you for your answer. Even though I've read that thread several times before, reading it again made me discover the solution. Adding while self.ser.in_waiting !=0: in front of the try, solved the issue for me. Using if instead of while however doesn't work. Can someone maybe explain why? And this also doesn't work if I want to use multiple serial connections, because the while blocks the one connection as long as there is data available and never lets the second connection transfer its data. Would it be possible to do this with threads? – Thyra Mar 25 '17 at 17:40
• Just reading your last comment, it is difficult to visualize what is your code with several serial inputs. Could you add this code to your question or in a link in the comments? Also, by the way, what is the need to have a timer here? – lemon Mar 25 '17 at 17:49


text:
# Percolation on Irregular High-dimensional Product Graphs

Sahar Diskin, Joshua Erde, Mihyun Kang, Michael Krivelevich

Publikation: ArbeitspapierPreprint

## Abstract

We consider bond percolation on high-dimensional product graphs $G=\square_{i=1}^tG^{(i)}$, where $\square$ denotes the Cartesian product. We call the $G^{(i)}$ the base graphs and the product graph $G$ the host graph. Very recently, Lichev showed that, under a mild requirement on the isoperimetric properties of the base graphs, the component structure of the percolated graph $G_p$ undergoes a phase transition when $p$ is around $\frac{1}{d}$, where $d$ is the average degree of the host graph. In the supercritical regime, we strengthen Lichev's result by showing that the giant component is in fact unique, with all other components of order $o(|G|)$, and determining the sharp asymptotic order of the giant. Furthermore, we answer two questions posed by Lichev: firstly, we provide a construction showing that the requirement of bounded-degree is necessary for the likely emergence of a linear order component; secondly, we show that the isoperimetric requirement on the base graphs can be, in fact, super-exponentially small in the dimension. Finally, in the subcritical regime, we give an example showing that in the case of irregular high-dimensional product graphs, there can be a polynomially large component with high probability, very much unlike the quantitative behaviour seen in the Erd\H{o}s-R\'enyi random graph and in the percolated hypercube, and in fact in any regular high-dimensional product graphs, as shown by the authors in a companion paper.
Originalsprache englisch Veröffentlicht - 18 Nov. 2022

## Fingerprint

Untersuchen Sie die Forschungsthemen von „Percolation on Irregular High-dimensional Product Graphs“. Zusammen bilden sie einen einzigartigen Fingerprint.


text:
# NEET Chemistry The p-Block Elements (XII) Questions Solved

BOARD

(a) Draw the structures of the following :

(i) $Xe{F}_{4}$                                                 (ii) ${H}_{2}{S}_{2}{O}_{7}$

(b) Explain the following observations :

(i) Phosphorus has a greater tendency for catenation than nitrogen.

(ii) The negative value of electron gain enthalpy is less for fluorine than that for chlorine.

(iii) Hydrogen fluoride has a much higher boiling point than hydrogen chloride.

(a) (i) $Xe{F}_{4}$ :

Shape : Square planar

(ii) ${H}_{2}{S}_{2}{O}_{7}$ :

(b) (i) The bond strength of P-P is more than N-N, therefore phosphorus shows more tendency for catenation than nitrogen.

(ii) Because of small size of flourine atom and strong electron-electron repulsions in its compact 2p orbitals.

(iii) Hydrogen fluoride (HF) has higher boiling point than HCl due to extensive intermolecular hydrogen bonding while HCl doesn't show this H-bonding.

Difficulty Level:


text:
## The 80-80-20 Triangle Problem, A Derivative, Solution #10

$ABC\;$ is an isosceles triangle with vertex angle $\angle BAC = 20^{\circ}\;$ and $AB = AC.\;$ Point $E\;$ is on $AB\;$ such that $AE = BC.\;$ Find the measure of $\angle AEC.$

Solution

Construct an equilateral $\Delta ADE$ outside $\Delta ABC.$
Since $\angle CAD=80^{\circ},\;$ $AD=AE=BC,\;$ $\Delta ACD=\Delta ABC.$ In particular, $\angle CED=\angle AEC.$ Thus $2\angle AEC+60^{\circ}=360^{\circ}.$ It follows that $\angle AEC=150^{\circ}.$


text:
# Tag Archives: python

computing

## Python script to upload to a specified directory

Whenever I need to solve a practical computing problem that requires writing a script, tracking down the right tool for the job is often the trickiest part. Especially when I am learning a new language, it is easy to fall down the rabbit hole of documentation and extra libraries (not to mention threads on discussion forums).

Today, I wanted to write a script that would automatically upload a particular file on my local machine to my server that hosts my website. Basically, I got tired of constantly having to remember and type out the (long) destination path for every file I wanted to upload. Since I am learning Python, I thought I would figure out how to solve the problem in Python.

After doing some research, I found the Plumbum library offers exactly the tools I needed to get the job done. Since I didn’t have Plumbum installed on my machine, I installed it using pip.

pip install git+git://github.com/tomerfiliba/plumbum.git

Now with Plumbum installed, I was able to put together this code which does exactly what I want so far:

#!/usr/bin/env python

import plumbum
import sys

host = "willrosenbaum.com"
key = "/path/to/my/public/key"

filename = sys.argv[1]

r = plumbum.machines.SshMachine(host, user = username, keyfile = key)

fro = plumbum.local.path(filename)
remote_path = str(fro).replace(local_prefix, remote_prefix)
to = r.path(remote_path)

plumbum.path.utils.copy(fro, to)

Now whenever I want to copy a file from my local machine to its corresponding directory on my server, all I have to do is run

noga-sync filename


text:
# [SOLVED]What is the name of this PDE?

#### dwsmith

##### Well-known member
\begin{align*}
\psi_t + \psi_{xxx} + f(\psi)\psi_x &= 0
\end{align*}

This equation leads to the nonlinear Shrodinger equation but does this equation have a name?

Staff member


text:
# scipy.optimize.linprog#

scipy.optimize.linprog(c, A_ub=None, b_ub=None, A_eq=None, b_eq=None, bounds=None, method='highs', callback=None, options=None, x0=None, integrality=None)[source]#

Linear programming: minimize a linear objective function subject to linear equality and inequality constraints.

Linear programming solves problems of the following form:

$\begin{split}\min_x \ & c^T x \\ \mbox{such that} \ & A_{ub} x \leq b_{ub},\\ & A_{eq} x = b_{eq},\\ & l \leq x \leq u ,\end{split}$

where $$x$$ is a vector of decision variables; $$c$$, $$b_{ub}$$, $$b_{eq}$$, $$l$$, and $$u$$ are vectors; and $$A_{ub}$$ and $$A_{eq}$$ are matrices.

Alternatively, that’s:

• minimize

c @ x

• such that

A_ub @ x <= b_ub
A_eq @ x == b_eq
lb <= x <= ub

Note that by default lb = 0 and ub = None. Other bounds can be specified with bounds.

Parameters:
c1-D array

The coefficients of the linear objective function to be minimized.

A_ub2-D array, optional

The inequality constraint matrix. Each row of A_ub specifies the coefficients of a linear inequality constraint on x.

b_ub1-D array, optional

The inequality constraint vector. Each element represents an upper bound on the corresponding value of A_ub @ x.

A_eq2-D array, optional

The equality constraint matrix. Each row of A_eq specifies the coefficients of a linear equality constraint on x.

b_eq1-D array, optional

The equality constraint vector. Each element of A_eq @ x must equal the corresponding element of b_eq.

boundssequence, optional

A sequence of (min, max) pairs for each element in x, defining the minimum and maximum values of that decision variable. If a single tuple (min, max) is provided, then min and max will serve as bounds for all decision variables. Use None to indicate that there is no bound. For instance, the default bound (0, None) means that all decision variables are non-negative, and the pair (None, None) means no bounds at all, i.e. all variables are allowed to be any real.

methodstr, optional

The algorithm used to solve the standard form problem. ‘highs’ (default), ‘highs-ds’, ‘highs-ipm’, ‘interior-point’ (legacy), ‘revised simplex’ (legacy), and ‘simplex’ (legacy) are supported. The legacy methods are deprecated and will be removed in SciPy 1.11.0.

callbackcallable, optional

If a callback function is provided, it will be called at least once per iteration of the algorithm. The callback function must accept a single scipy.optimize.OptimizeResult consisting of the following fields:

x1-D array

The current solution vector.

funfloat

The current value of the objective function c @ x.

successbool

True when the algorithm has completed successfully.

slack1-D array

The (nominally positive) values of the slack, b_ub - A_ub @ x.

con1-D array

The (nominally zero) residuals of the equality constraints, b_eq - A_eq @ x.

phaseint

The phase of the algorithm being executed.

statusint

An integer representing the status of the algorithm.

0 : Optimization proceeding nominally.

1 : Iteration limit reached.

2 : Problem appears to be infeasible.

3 : Problem appears to be unbounded.

4 : Numerical difficulties encountered.

nitint

The current iteration number.

messagestr

A string descriptor of the algorithm status.

Callback functions are not currently supported by the HiGHS methods.

optionsdict, optional

A dictionary of solver options. All methods accept the following options:

maxiterint

Maximum number of iterations to perform. Default: see method-specific documentation.

dispbool

Set to True to print convergence messages. Default: False.

presolvebool

Set to False to disable automatic presolve. Default: True.

All methods except the HiGHS solvers also accept:

tolfloat

A tolerance which determines when a residual is “close enough” to zero to be considered exactly zero.

autoscalebool

Set to True to automatically perform equilibration. Consider using this option if the numerical values in the constraints are separated by several orders of magnitude. Default: False.

rrbool

Set to False to disable automatic redundancy removal. Default: True.

rr_methodstring

Method used to identify and remove redundant rows from the equality constraint matrix after presolve. For problems with dense input, the available methods for redundancy removal are:

“SVD”:

Repeatedly performs singular value decomposition on the matrix, detecting redundant rows based on nonzeros in the left singular vectors that correspond with zero singular values. May be fast when the matrix is nearly full rank.

“pivot”:

Uses the algorithm presented in [5] to identify redundant rows.

“ID”:

Uses a randomized interpolative decomposition. Identifies columns of the matrix transpose not used in a full-rank interpolative decomposition of the matrix.

None:

Uses “svd” if the matrix is nearly full rank, that is, the difference between the matrix rank and the number of rows is less than five. If not, uses “pivot”. The behavior of this default is subject to change without prior notice.

Default: None. For problems with sparse input, this option is ignored, and the pivot-based algorithm presented in [5] is used.

For method-specific options, see show_options('linprog').

x01-D array, optional

Guess values of the decision variables, which will be refined by the optimization algorithm. This argument is currently used only by the ‘revised simplex’ method, and can only be used if x0 represents a basic feasible solution.

integrality1-D array or int, optional

Indicates the type of integrality constraint on each decision variable.

0 : Continuous variable; no integrality constraint.

1 : Integer variable; decision variable must be an integer within bounds.

2 : Semi-continuous variable; decision variable must be within bounds or take value 0.

3 : Semi-integer variable; decision variable must be an integer within bounds or take value 0.

By default, all variables are continuous.

For mixed integrality constraints, supply an array of shape c.shape. To infer a constraint on each decision variable from shorter inputs, the argument will be broadcasted to c.shape using np.broadcast_to.

This argument is currently used only by the 'highs' method and ignored otherwise.

Returns:
resOptimizeResult

A scipy.optimize.OptimizeResult consisting of the fields below. Note that the return types of the fields may depend on whether the optimization was successful, therefore it is recommended to check OptimizeResult.status before relying on the other fields:

x1-D array

The values of the decision variables that minimizes the objective function while satisfying the constraints.

funfloat

The optimal value of the objective function c @ x.

slack1-D array

The (nominally positive) values of the slack variables, b_ub - A_ub @ x.

con1-D array

The (nominally zero) residuals of the equality constraints, b_eq - A_eq @ x.

successbool

True when the algorithm succeeds in finding an optimal solution.

statusint

An integer representing the exit status of the algorithm.

0 : Optimization terminated successfully.

1 : Iteration limit reached.

2 : Problem appears to be infeasible.

3 : Problem appears to be unbounded.

4 : Numerical difficulties encountered.

nitint

The total number of iterations performed in all phases.

messagestr

A string descriptor of the exit status of the algorithm.

show_options

Additional options accepted by the solvers.

Notes

This section describes the available solvers that can be selected by the ‘method’ parameter.

‘highs-ds’ and ‘highs-ipm’ are interfaces to the HiGHS simplex and interior-point method solvers [13], respectively. ‘highs’ (default) chooses between the two automatically. These are the fastest linear programming solvers in SciPy, especially for large, sparse problems; which of these two is faster is problem-dependent. The other solvers (‘interior-point’, ‘revised simplex’, and ‘simplex’) are legacy methods and will be removed in SciPy 1.11.0.

Method highs-ds is a wrapper of the C++ high performance dual revised simplex implementation (HSOL) [13], [14]. Method highs-ipm is a wrapper of a C++ implementation of an interior-point method [13]; it features a crossover routine, so it is as accurate as a simplex solver. Method highs chooses between the two automatically. For new code involving linprog, we recommend explicitly choosing one of these three method values.

New in version 1.6.0.

Method interior-point uses the primal-dual path following algorithm as outlined in [4]. This algorithm supports sparse constraint matrices and is typically faster than the simplex methods, especially for large, sparse problems. Note, however, that the solution returned may be slightly less accurate than those of the simplex methods and will not, in general, correspond with a vertex of the polytope defined by the constraints.

New in version 1.0.0.

Method revised simplex uses the revised simplex method as described in [9], except that a factorization [11] of the basis matrix, rather than its inverse, is efficiently maintained and used to solve the linear systems at each iteration of the algorithm.

New in version 1.3.0.

Method simplex uses a traditional, full-tableau implementation of Dantzig’s simplex algorithm [1], [2] (not the Nelder-Mead simplex). This algorithm is included for backwards compatibility and educational purposes.

New in version 0.15.0.

Before applying interior-point, revised simplex, or simplex, a presolve procedure based on [8] attempts to identify trivial infeasibilities, trivial unboundedness, and potential problem simplifications. Specifically, it checks for:

• rows of zeros in A_eq or A_ub, representing trivial constraints;

• columns of zeros in A_eq and A_ub, representing unconstrained variables;

• column singletons in A_eq, representing fixed variables; and

• column singletons in A_ub, representing simple bounds.

If presolve reveals that the problem is unbounded (e.g. an unconstrained and unbounded variable has negative cost) or infeasible (e.g., a row of zeros in A_eq corresponds with a nonzero in b_eq), the solver terminates with the appropriate status code. Note that presolve terminates as soon as any sign of unboundedness is detected; consequently, a problem may be reported as unbounded when in reality the problem is infeasible (but infeasibility has not been detected yet). Therefore, if it is important to know whether the problem is actually infeasible, solve the problem again with option presolve=False.

If neither infeasibility nor unboundedness are detected in a single pass of the presolve, bounds are tightened where possible and fixed variables are removed from the problem. Then, linearly dependent rows of the A_eq matrix are removed, (unless they represent an infeasibility) to avoid numerical difficulties in the primary solve routine. Note that rows that are nearly linearly dependent (within a prescribed tolerance) may also be removed, which can change the optimal solution in rare cases. If this is a concern, eliminate redundancy from your problem formulation and run with option rr=False or presolve=False.

Several potential improvements can be made here: additional presolve checks outlined in [8] should be implemented, the presolve routine should be run multiple times (until no further simplifications can be made), and more of the efficiency improvements from [5] should be implemented in the redundancy removal routines.

After presolve, the problem is transformed to standard form by converting the (tightened) simple bounds to upper bound constraints, introducing non-negative slack variables for inequality constraints, and expressing unbounded variables as the difference between two non-negative variables. Optionally, the problem is automatically scaled via equilibration [12]. The selected algorithm solves the standard form problem, and a postprocessing routine converts the result to a solution to the original problem.

References

[1]

Dantzig, George B., Linear programming and extensions. Rand Corporation Research Study Princeton Univ. Press, Princeton, NJ, 1963

[2]

Hillier, S.H. and Lieberman, G.J. (1995), “Introduction to Mathematical Programming”, McGraw-Hill, Chapter 4.

[3]

Bland, Robert G. New finite pivoting rules for the simplex method. Mathematics of Operations Research (2), 1977: pp. 103-107.

[4]

Andersen, Erling D., and Knud D. Andersen. “The MOSEK interior point optimizer for linear programming: an implementation of the homogeneous algorithm.” High performance optimization. Springer US, 2000. 197-232.

[5] (1,2,3)

Andersen, Erling D. “Finding all linearly dependent rows in large-scale linear programming.” Optimization Methods and Software 6.3 (1995): 219-227.

[6]

Freund, Robert M. “Primal-Dual Interior-Point Methods for Linear Programming based on Newton’s Method.” Unpublished Course Notes, March 2004. Available 2/25/2017 at https://ocw.mit.edu/courses/sloan-school-of-management/15-084j-nonlinear-programming-spring-2004/lecture-notes/lec14_int_pt_mthd.pdf

[7]

Fourer, Robert. “Solving Linear Programs by Interior-Point Methods.” Unpublished Course Notes, August 26, 2005. Available 2/25/2017 at http://www.4er.org/CourseNotes/Book%20B/B-III.pdf

[8] (1,2)

Andersen, Erling D., and Knud D. Andersen. “Presolving in linear programming.” Mathematical Programming 71.2 (1995): 221-245.

[9]

Bertsimas, Dimitris, and J. Tsitsiklis. “Introduction to linear programming.” Athena Scientific 1 (1997): 997.

[10]

Andersen, Erling D., et al. Implementation of interior point methods for large scale linear programming. HEC/Universite de Geneve, 1996.

[11]

Bartels, Richard H. “A stabilization of the simplex method.” Journal in Numerische Mathematik 16.5 (1971): 414-434.

[12]

Tomlin, J. A. “On scaling linear programming problems.” Mathematical Programming Study 4 (1975): 146-166.

[13] (1,2,3)

Huangfu, Q., Galabova, I., Feldmeier, M., and Hall, J. A. J. “HiGHS - high performance software for linear optimization.” https://highs.dev/

[14]

Huangfu, Q. and Hall, J. A. J. “Parallelizing the dual revised simplex method.” Mathematical Programming Computation, 10 (1), 119-142, 2018. DOI: 10.1007/s12532-017-0130-5

Examples

Consider the following problem:

$\begin{split}\min_{x_0, x_1} \ -x_0 + 4x_1 & \\ \mbox{such that} \ -3x_0 + x_1 & \leq 6,\\ -x_0 - 2x_1 & \geq -4,\\ x_1 & \geq -3.\end{split}$

The problem is not presented in the form accepted by linprog. This is easily remedied by converting the “greater than” inequality constraint to a “less than” inequality constraint by multiplying both sides by a factor of $$-1$$. Note also that the last constraint is really the simple bound $$-3 \leq x_1 \leq \infty$$. Finally, since there are no bounds on $$x_0$$, we must explicitly specify the bounds $$-\infty \leq x_0 \leq \infty$$, as the default is for variables to be non-negative. After collecting coeffecients into arrays and tuples, the input for this problem is:

>>> from scipy.optimize import linprog
>>> c = [-1, 4]
>>> A = [[-3, 1], [1, 2]]
>>> b = [6, 4]
>>> x0_bounds = (None, None)
>>> x1_bounds = (-3, None)
>>> res = linprog(c, A_ub=A, b_ub=b, bounds=[x0_bounds, x1_bounds])
>>> res.fun
-22.0
>>> res.x
array([10., -3.])
>>> res.message
'Optimization terminated successfully. (HiGHS Status 7: Optimal)'

The marginals (AKA dual values / shadow prices / Lagrange multipliers) and residuals (slacks) are also available.

>>> res.ineqlin
residual: [ 3.900e+01  0.000e+00]
marginals: [-0.000e+00 -1.000e+00]

For example, because the marginal associated with the second inequality constraint is -1, we expect the optimal value of the objective function to decrease by eps if we add a small amount eps to the right hand side of the second inequality constraint:

>>> eps = 0.05
>>> b[1] += eps
>>> linprog(c, A_ub=A, b_ub=b, bounds=[x0_bounds, x1_bounds]).fun
-22.05

Also, because the residual on the first inequality constraint is 39, we can decrease the right hand side of the first constraint by 39 without affecting the optimal solution.

>>> b = [6, 4]  # reset to original values
>>> b[0] -= 39
>>> linprog(c, A_ub=A, b_ub=b, bounds=[x0_bounds, x1_bounds]).fun
-22.0


text:
# A first order reaction is 50% complete in 20 minutes. What is its rate constant ?

Updated On: 17-04-2022

Get Answer to any question, just click a photo and upload the photo
and get the answer completely free,

Watch 1000+ concepts & tricky questions explained!

Text Solution

Solution :
t_(1//2) = 20 min <br>  k= ( 0.693 )/( t_(1//2) ) = ( 0.693 )/( 20 ) = 0.03465 min""^(-1)


text:
This repository has been archived by the owner. It is now read-only.

# Too many dependencies break the Windows file system #3697

Closed
opened this issue Jul 25, 2013 · 66 comments
Closed

# Too many dependencies break the Windows file system#3697

opened this issue Jul 25, 2013 · 66 comments
Labels
Milestone

### mcartoixa commented Jul 25, 2013

 On Windows, the file system itself cannot seem to cope very well with a too deeply nested node_modules directory... We just added bower to our dependencies, and now: the node_modules directory cannot be deleted from a batch command: DEL /S /Q /F node_modules fails. CLOC fails, even when told to ignore the node_modules directory completely. Git clean fails C:\PROGRA~2\Git\bin\git.exe clean -d -f -x. MSBuild item wildcards are not replaced anymore. We have tried to run npm dedupe to flatten our hierarchy but this is not enough. Effectively our Continuous Integration and delivery platform is broken for node.js/bower projects. Other people seem to have encountered the same kinds of problems on Windows. Any heads up? A more efficient dedupe command, perhaps? Using npm 1.3.2 on node.js 0.10.13. Reproduced on Windows 8 (x64) and Windows Server 2008 R2 (x64).

### dominictarr commented Aug 7, 2013

 oh, I've been experimenting with a new npm client, https://github.com/dominictarr/npmd you can do npmd install X --greedy and it installs everything directly into node_modules, only going deeper if there is a version conflict. This is all pretty experimental, and npmd is very young, so no promises, but it might fix your problem.

### ralt commented Aug 27, 2013

 This sounds like a huge issue. Is it a problem that npm cannot solve? Can we determine exactly what corrupts the filesystem? Is there no workaround? (Like switching an option on or off in ntfs.) The issue seems serious enough that time should be spent on it. Having no windows, I can't help, but from an external point of view, this looks serious.

### domenic commented Aug 27, 2013

 The file system is not corrupted. You just need to manipulate the files in question using the GUI or using UNC paths instead of the command line and traditional paths.

### mcartoixa commented Aug 27, 2013

 Maybe my wording is wrong, as could be my understanding of the problem. But the symptoms remain: the GUI is not a very practical solution in continuous integration scenarii. node.js tools like npm or grunt can fail too on our systems due to the mere presence of these folders (even on unrelated projects in different directories). I am not sure I could rewrite all our scripts to use UNC paths instead of traditional paths. @domenic Do you have more insight (maybe links) as to why UNC paths would work? I have once had to manually rename a whole hierarchy of folders to single letter names so that they could be deleted, even using the GUI...

### domenic commented Aug 27, 2013

 My impression was that libuv does this prefixing of "\\?\" transparently for you and so node programs should never run in to this problem. I have not verified however.

### mcartoixa commented Aug 28, 2013

 Here's an excerpt of a failing npm install output, due to filesystem related issues: unbuild isogeo-id@0.0.1 error : error rolling back Error: ENOTEMPTY, rmdir 'D:\ccnet\projects\Isogeo.App\ContinuousBuild\work\node_modules\isogeo-id\node_modules\express-hbs\node_modules\glob' error : error rolling back express-hbs@0.2.0 { [Error: ENOTEMPTY, rmdir 'D:\ccnet\projects\Isogeo.App\ContinuousBuild\work\node_modules\isogeo-id\node_modules\express-hbs\node_modules\glob'] error : error rolling back errno: 53, error : error rolling back code: 'ENOTEMPTY', error : error rolling back path: 'D:\\ccnet\\projects\\Isogeo.App\\ContinuousBuild\\work\\node_modules\\isogeo-id\\node_modules\\express-hbs\\node_modules\\glob' } npm http GET https://registry.npmjs.org/i/-/i-0.3.2.tgz error : Error: ENOENT, lstat 'D:\ccnet\projects\Isogeo.App\ContinuousBuild\work\node_modules\isogeo-id\node_modules\express-hbs\node_modules\glob\README.md' error : If you need help, you may report this log at: error : <http://github.com/isaacs/npm/issues> error : or email it to: error : <npm-@googlegroups.com> error : System Windows_NT 6.1.7601 error : command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" error : cwd D:\ccnet\projects\Isogeo.App\ContinuousBuild\work\build error : node -v v0.10.13 error : npm -v 1.3.2 error : path D:\ccnet\projects\Isogeo.App\ContinuousBuild\work\node_modules\isogeo-id\node_modules\express-hbs\node_modules\glob\README.md error : fstream_path D:\ccnet\projects\Isogeo.App\ContinuousBuild\work\node_modules\isogeo-id\node_modules\express-hbs\node_modules\glob\README.md error : fstream_type File error : fstream_class FileWriter error : code ENOENT error : errno 34 error : fstream_stack C:\Program Files\nodejs\node_modules\npm\node_modules\fstream\lib\writer.js:284:26 error : fstream_stack Object.oncomplete (fs.js:107:15) npm http GET https://registry.npmjs.org/esprima/-/esprima-1.0.3.tgz npm http 304 https://registry.npmjs.org/argparse  The same command would work on other OSs (this is Windows Server 2008 x64). A build on a Windows 7 x64 machine would fail at the grunt stage. Note that the folders described in the output are unlikely to be the cause of the trouble, but at this stage other deeply nested dependencies have already been fetched (based on bower on our case) that trigger all the kinds of strange behaviour described above.
mentioned this issue Sep 9, 2013

### JoseOneTime commented Dec 31, 2013

 Is there a resolution for this problem yet? I'm running into it on Windows 7.

### ghost23 commented Feb 5, 2014

 I am running into this, too. I can install almost no packages, always get errors like shown above. If i browse through the folder structure, i see huge nested 'node_modules' structures.

### clca commented Feb 6, 2014

 to repro the problem I did the following: create a temp directory ran npm install bower cd node_modules/bower npm install (at that point I could see the huge node_modules structure) I ran rmdir /s /q node_modules (from the temp directory) to delete the whole directory structure. It worked just fine on my Win8 machine.

### isaacs commented Feb 7, 2014

 It looks like this is related to a bug that's been fixed in later versions of rimraf and npm. Please update, and it should be fixed. While the Windows cmd program may have issues with long folder names, Node (and thus npm) always uses the UNC paths internally for fs operations, so it should work fine in npm. If you want to remove a folder, you can do npm install -g rimraf and then use the rimraf bin to do this. rimraf path\to\folder
closed this Feb 7, 2014

### calbertts commented Feb 11, 2014

 rimraf command works for me, thanks. Shit Windows!.

### mcartoixa commented Feb 11, 2014

 But what if I want to use CLOC or MSBuild item wildcards while the node_modules folder is still around?

### domenic commented Feb 11, 2014

 I suppose you can only hope those programs are as well designed as node and npm are, and can cope with paths longer than 256 characters!
mentioned this issue May 1, 2014

### neenhouse commented May 4, 2014

 I just wrote a node module "npm-flatten" that can do this. Check it out here: https://www.npmjs.org/package/npm-flatten. Source is here: https://github.com/neenhouse/npm-flatten
mentioned this issue Jun 1, 2014
mentioned this issue Jun 12, 2014

### ghost commented Jun 23, 2014

 An easy solution would be have an option to symlink dependencies directly into the top level node_modules folder. Say you had something like bower. The top level node_modules directory would have a folder structure looking something like: node_modules ├───abbrev │ └───1.0.5 ├───amdefine │ └───0.1.0 ├───ansi-styles │ └───1.0.0 ├───ansicolors │ └───0.2.1 ├───archy │ └───0.0.2 ├───argparse │ └───0.1.15 ├───array-filter │ └───0.0.1 ├───array-map │ └───0.0.0 ├───array-reduce │ └───0.0.0 ├───asn1 │ └───0.1.11 ├───assert-plus │ └───0.1.2 ├───async │ ├───0.2.10 │ └───0.9.0 ├───aws-sign │ └───0.3.0 ├───aws-sign2 │ └───0.5.0 ├───binary │ └───0.3.0 ├───block-stream │ └───0.0.7 ├───boom │ └───0.4.2 ├───bower │ └───1.3.4 ├───bower-config │ └───0.5.1 ├───bower-endpoint-parser │ └───0.2.1 ├───bower-json │ └───0.4.0 ├───bower-logger │ └───0.2.2 ├───bower-registry-client │ └───0.2.1 ├───buffers │ └───0.1.1 ├───cardinal │ └───0.4.4 ├───chainsaw │ └───0.1.0 ├───chalk │ └───0.4.0 ├───chmodr │ └───0.1.0 ├───cli-color │ └───0.2.3 ├───configstore │ ├───0.2.3 │ └───0.3.1 ├───cookie-jar │ └───0.3.0 ├───core-util-is │ └───1.0.1 ├───cryptiles │ └───0.2.2 ├───ctype │ └───0.5.2 ├───decompress-zip │ └───0.0.8 ├───deep-extend │ └───0.2.10 ├───es5-ext │ └───0.9.2 ├───esprima │ └───1.0.4 ├───event-emitter │ └───0.2.2 ├───forever-agent │ └───0.5.2 ├───form-data │ └───0.1.3 ├───fstream │ └───0.1.27 ├───fstream-ignore │ └───0.0.8 ├───glob │ └───3.2.11 ├───graceful-fs │ ├───2.0.3 │ └───3.0.2 ├───handlebars │ └───1.3.0 ├───has-color │ └───0.1.7 ├───hawk │ └───1.0.0 ├───hoek │ └───0.9.1 ├───http-signature │ └───0.10.0 ├───inherits │ └───2.0.1 ├───inquirer │ └───0.4.1 ├───insight │ └───0.3.1 ├───intersect │ └───0.0.3 ├───is-root │ └───0.1.0 ├───isarray │ └───0.0.1 ├───js-yaml │ └───3.0.2 ├───json-stringify-safe │ └───5.0.0 ├───jsonify │ └───0.0.0 ├───junk │ └───0.3.0 ├───lockfile │ └───0.4.2 ├───lodash │ └───2.4.1 ├───lodash.debounce │ └───2.4.1 ├───lodash.isfunction │ └───2.4.1 ├───lodash.isnative │ └───2.4.1 ├───lodash.isobject │ └───2.4.1 ├───lodash.now │ └───2.4.1 ├───lodash.objecttypes │ └───2.4.1 ├───lru-cache │ ├───2.3.1 │ └───2.5.0 ├───memoizee │ └───0.2.6 ├───minimatch │ └───0.3.0 ├───minimist │ ├───0.0.10 │ └───0.0.8 ├───mkdirp │ ├───0.3.5 │ └───0.5.0 ├───mkpath │ └───0.1.0 ├───mout │ └───0.9.1 ├───mute-stream │ └───0.0.4 ├───next-tick │ └───0.1.0 ├───nopt │ ├───1.0.10 │ └───2.2.1 ├───oauth-sign │ └───0.3.0 ├───object-assign │ ├───0.1.2 │ └───0.3.1 ├───opn │ └───0.1.2 ├───optimist │ ├───0.3.7 │ └───0.6.1 ├───osenv │ ├───0.0.3 │ └───0.1.0 ├───p-throttler │ └───0.0.1 ├───promptly │ └───0.2.0 ├───punycode │ └───1.2.4 ├───q │ ├───0.9.7 │ └───1.0.1 ├───qs │ └───0.6.6 ├───read │ └───1.0.5 ├───readable-stream │ └───1.1.13-1 ├───readline2 │ └───0.1.0 ├───redeyed │ └───0.4.4 ├───request │ ├───2.27.0 │ ├───2.34.0 │ └───2.36.0 ├───request-progress │ └───0.3.1 ├───request-replay │ └───0.2.0 ├───retry │ └───0.6.0 ├───semver │ ├───2.2.1 │ └───2.3.1 ├───shell-quote │ └───1.4.1 ├───sigmund │ └───1.0.0 ├───sntp │ └───0.2.4 ├───source-map │ └───0.1.34 ├───stringdecoder │ └───0.10.25-1 ├───stringify-object │ └───0.2.1 ├───strip-ansi │ └───0.1.1 ├───tar │ └───0.1.19 ├───throttleit │ └───0.0.2 ├───through │ └───2.3.4 ├───tmp │ └───0.0.23 ├───touch │ └───0.0.2 ├───tough-cookie │ └───0.12.1 ├───traverse │ └───0.3.9 ├───tunnel-agent │ ├───0.3.0 │ └───0.4.0 ├───uglify-js │ └───2.3.6 ├───underscore │ └───1.4.4 ├───underscore.string │ └───2.3.3 ├───update-notifier │ └───0.1.10 ├───uuid │ └───1.4.1 ├───which │ └───1.0.5 └───wordwrap └───0.0.2  Then each of the dependencies under node_modules for bower would be symlinked to these versions. Same would happen for dependencies of dependencies. At most you would only ever have a folder depth of 3 under node_modules (node_modules/bower/1.3.4/node_modules/) ├─┬ bower │ ├── abbrev (Symlink to ../../../abbrev/1.0.5) │ ├── archy (Symlink to ../../../archy/0.0.2) │ ├── bower-config (Symlink to ../../../bower-config/0.5.1) │ ├── bower-endpoint-parser (Symlink to ../../../bower-endpoint-parser/0.2.1) │ ├── bower-json (Symlink to ../../../bower-json/0.4.0) │ ├── bower-logger (Symlink to ../../../bower-logger/0.2.2) │ ├── bower-registry-client (Symlink to ../../../bower-registry-client/0.2.1) │ ├── cardinal (Symlink to ../../../cardinal/0.4.4) │ ├── chalk (Symlink to ../../../chalk/0.4.0) │ ├── chmodr (Symlink to ../../../chmodr/0.1.0) │ ├── decompress-zip (Symlink to ../../../decompress-zip/0.0.8) │ ├── fstream (Symlink to ../../../fstream/0.1.27) │ ├── fstream-ignore (Symlink to ../../../fstream-ignore/0.0.8) │ ├── glob (Symlink to ../../../glob/3.2.11) │ ├── graceful-fs (Symlink to ../../../graceful-fs/2.0.3) │ ├── handlebars (Symlink to ../../../handlebars/1.3.0) │ ├── inquirer (Symlink to ../../../inquirer/0.4.1) │ ├── insight (Symlink to ../../../insight/0.3.1) │ ├── is-root (Symlink to ../../../is-root/0.1.0) │ ├── junk (Symlink to ../../../junk/0.3.0) │ ├── lockfile (Symlink to ../../../lockfile/0.4.2) │ ├── lru-cache (Symlink to ../../../lru-cache/2.5.0) │ ├── mkdirp (Symlink to ../../../mkdirp/0.3.5) │ ├── mout (Symlink to ../../../mout/0.9.1) │ ├── nopt (Symlink to ../../../nopt/2.2.1) │ ├── opn (Symlink to ../../../opn/0.1.2) │ ├── osenv (Symlink to ../../../osenv/0.0.3) │ ├── p-throttler (Symlink to ../../../p-throttler/0.0.1) │ ├── promptly (Symlink to ../../../promptly/0.2.0) │ ├── q (Symlink to ../../../q/1.0.1) │ ├── request (Symlink to ../../../request/2.34.0) │ ├── request-progress (Symlink to ../../../request-progress/0.3.1) │ ├── retry (Symlink to ../../../retry/0.6.0) │ ├── semver (Symlink to ../../../semver/2.2.1) │ ├── shell-quote (Symlink to ../../../shell-quote/1.4.1) │ ├── stringify-object (Symlink to ../../../stringify-object/0.2.1) │ ├── tar (Symlink to ../../../tar/0.1.19) │ ├── tmp (Symlink to ../../../tmp/0.0.23) │ ├── update-notifier (Symlink to ../../../update-notifier/0.1.10) │ └── which (Symlink to ../../../which/1.0.5)  This would also help with deduplicating because you could easily just repoint the symlink to a module. This, from the programming point of view, wouldn't be difficult to implement. I'd happily submit a pull request, however it would be a question of whether or not it was considered the correct direction for the project manager as a whole.

### isaacs commented Jun 23, 2014

 So, like i said in my comment on joyent/node, the issue isn't that we haven't invented any flat reification strategies. There are plenty of those, and a lot of them work, even using symlinks. (One single global folder where everything lives, with symlinks all over the damn place, and swapping out the require.paths value, is not an ideal strategy, but there are many others.) We could, for example, have node_modules/.store// much like @Xeoncore is proposing. A problem you quickly run into is people doing require('.store/abbrev/1.2.3'), which, if you think people won't do, you have a short memory ;) We can avoid that by having the name be non-predictable, but then that kinda sucks for a lot of other reasons. One of the really nice things about nesting node_modules is that it will literally break half the time if you rely on it being in ./node_modules, so people don't do that for long So, let's say you have: node_modules +-- .store | +-- a | | +-- 1.2.3 | | +-- 2.5.4 | | | +-- b | +-- 1.2.3 | +-- 5.4.3 | +-- a -> .store/a/1.2.3 +-- node_modules +-- b -> ../.store/b/5.4.3  I guess you'd have to put the a/node_modules/b in .store/a/node_modules/b, and it's a symlink to a dir, so that's how it'd work anyway. But now you end up with a rats' nest pretty fast, because actually it's this: node_modules +-- .store | +-- a | | +-- 1.2.3 | | | +-- node_modules | | | +-- b -> ../../../.store/b/5.4.3 | | +-- 2.5.4 | | | +-- b | +-- 1.2.3 | +-- 5.4.3 | +-- a -> .store/a/1.2.3  Let's say b->c, and c->a@2.5.4, and a@2.5.4 depends on the other version of b. Updating a dep, then, is not a simple matter of replacing a single dir. you still have to build the tree, analyze the tree, reify the tree. We still have to figure out who needs what, and dedupe it as much as possible, and then analyze the changes, or else we're just trading deep trees for a giant .store dir. What's more, we MUST maintain the symlinks in each .store/*/node_modules dir, because otherwise they'll fall up to the top level node_modules folder, and potentially get an incompatible version! My point here is not to shoot down @Xeoncore's proposal, but merely to point out that coming up with the reification strategy is only a small part of the solution (albeit the creative fun part.) The other parts are much less fun: Figuring out the ways that people will abuse it, and how to make sure that they feel the pain of doing so as early as possible, when it is easy to correct. Working out all the ways that the strategy will fall over when there are deeply nested dep trees with lots of conflict management. Implementing the code that predictably guarantees dep version satisfaction in the craziest desert-island scenarios that we can imagine.

### ghost commented Jun 24, 2014

 @isaacs You make a good point with the user abuse situation. I wasn't suggesting a solution, more so trying to encourage discussion and development because in my opinion this is a legitimate and prevalent issue. To solve the issue with people directly using modules from the .store directory, is prohibit requiring of modules from it. That wouldn't be hard to do would it?

### pushpan999 commented Jun 25, 2014

 @isaacs Thanks a lot. I tried every possible option that I found in google, none of them worked. Finally rimraf worked :)

### StoneCypher commented Jul 3, 2014

 Fixing this in NPM isn't enough, because normal tools don't do things like this, so when you try to use node with other things, like the Windows Git package, these paths break them by proxy. Please stop pursuing the existing bad install strategy.

### ghost commented Jul 3, 2014

 @StoneCypher You shouldn't be committing your node_modules folder anyway.

### justrhysism commented Jul 14, 2014

 @Xeoncore You're right, we "shouldn't". But unfortunately, in the real-world, we need to. I've been bitten one too many times relying on package versions to handle this for me, and when a client calls for an update to an old project with old dependencies - and for whichever reason these dependencies aren't available, the project cannot be built and many, many hours are wasted trying to get a project to build just so a simply update can be done.

### ryanmargheriti commented Jul 24, 2014

 @Xeoncore Irrelevant.

### graphnode commented Sep 1, 2014

 Maybe I'm just showing my ignorance but couldn't we have a simple structure like: node_modules +-- a@1.2.3 | +-- a.js | +-- package.json +-- a@2.5.4 | +-- a.js | +-- package.json +-- b@1.2.3 | +-- b.js | +-- package.json +-- b@5.4.3 | +-- b.js | +-- package.json main.js package.json  Where, when a module requires another module, node.js tries to: Get the module from the local node_module folder; if not found: Get the module from the main node_module where the application started (like above); if not found: Get the module from the global node_module folder. Note: All of this with the specific version requested (from package.json) in mind. Any attempt to directly require a versioned module should throw a error (ex: require('a@2.5.4') or require('node_modules/a@2.5.4'): the versions used are in the package.json. No symbolic links are used and you can still use deep nesting if you wish (for module development?). What do you guys think?

### StoneCypher commented Sep 1, 2014

 Should work.

### bradleyflood commented Sep 2, 2014

 Sounds good @graphnode

### StoneCypher commented Jan 25, 2015

 @hopeseekr well, all other operating systems should conform to their expectations, you see, and if they've found an api that allows abuse, that means that all software globally should update to the thing they expect, and damn the consequences. this is especially easy since all software worldwide is actively being maintained, and nobody anywhere needs unsupported legacy software for anything. also what's a red book cd clearly that's much more straightforward than just having a sensible module deploy system in a single product that claims first class windows support, and didn't bother to learn how the filesystem worked

### StoneCypher commented Jan 25, 2015

 anything that doesn't work the way they expect is emphasis-bold broken, and should immediately conform to them

### othiym23 commented Jan 25, 2015

 @StoneCypher I know you're passionate about this, but I'd just like to point out that I've been doing all of my non-release process work on npm so far this year running Windows 8.1 as my sole OS (i.e. not in a vm), and I've already addressed several issues with Windows, as well as working with the io.js team to improve the Windows experience. In addition, npm@3 will be beta soon, and it builds a flatter dependency tree by default. I don't think the npm team can make any more plain that we do care about Windows and are committed to improving the experience of npm on it.

### StoneCypher commented Jan 25, 2015

 The commentary mostly regards community positions and tone. As before, I'm engaging in someone else's pre-existing commentary theretowards. I like node. A lot. I continue to use it. I am slowly becoming productive in it. However, every time Windows people point out where Node is doing severely broken things unnecessarily, like abusing the internationalization api's widechar support to stuff bytes where the API explicitly states they're not permitted to be, we are met with claims that because we do things differently, we suck and are broken, and that 40 years of other software's stability should be violated so that a marginally more sophisticated layout algorithm need not be deployed. We're fine with "this is pretty hard to do because it turns out that it involves rewriting a bunch of the core." ljharb told me about that the other day. I didn't get a clear context on the problem, and to be frank it seems super weird, but if that's the case, then fine. But that's not what we got. We got mocking and taunting and sophistry that didn't make sense. This community has an admirable focus on choice of wording to prevent subtle hostility from excluding people. The gender pronoun debate, though I think handled poorly, was on the right topic. You do realize that more than ninety percent of developers are Windows goons, right? Have you ever wondered why you have so few of them? I am glad that you choose to stamp out the exclusory behaviors that you can see, so as to make a more inclusive environment where you can get the greatest participation. I just wish that you saw more of them. People hang lanterns on them all the time. Hopeseeker's a fun dude. I met him in the PHP community. Don't ignore him just because you see my name.

### am11 commented Jan 25, 2015

 Guys what I have learned from IRC (freenode -> nodejs@freenode channel) is that this issue will be fixed in npm v3 as @othiym23 mentioned. Also @iarna indicated above that she was working on it. TBVH, this is no straightforward workaround for this 256 char limitation of NTFS (not very new after all). Not sure what is the situation with ReFS. Nonetheless, I also sent a feedback for this on Windows 10 preview, _hopefully others will do the same_ in order to make them realize that this limitation needs to be revoked and/or reworked. IMO, as a whole npm team has done much better job compared to other package managers (Nuget Packages, Ruby Gems etc.). Well the reluctance to Windows in any non-MSFT technology community is very common. Although, some people are quite transparent in delivering their concern (for instance the guy who wrote dietlibc (which I was using to make node-sass binary cross-Linux-distro compatible) has to say something in his no windows passage), but on that stance they forget that others (MacWhack) are doing similar stuff (making revenue -- limiting freedom). Since WindOS being non-pure-Unix-like, it will keep getting this special treatment which is not something really new / surprising. :) On the flipside, see the work from neovim and clang folks, how hard they had to struggle to make their software compatible with Windows, when VC team was not making it easier for masses up until very recently (C99, C11, C++11, C++14 STL and lang features and since so forth).

### iarna commented Jan 25, 2015

 @StoneCypher When you complain here about "you all" not taking windows seriously, and "here" is an issue on npm, it's hard to not take that as "npm is not taking windows issues seriously." We're aware that we've got some work to build back trust for Windows users, but I'm hopeful that 2015 will be a year that will change that perception. As far as fixing issues with nodejs, you might try raising the issues again over on the iojs issue board (if you haven't already), as it's possible they'll be more receptive. @am11 That's right: npm@3's dependency resolution algorithm makes the node_modules folder as flat as possible (that is, if there are no conflicts, it puts all requirements at the top level. This results in a implicitly deduped and very shallow tree. Outside of pathological cases, I anticipate that this will solve the "256 char limit" problem by never producing folders nested deeply enough to hit it.

### hopeseekr commented Jan 26, 2015

 @iarna That's great news! And it's a complete reversal from the first comments about this issue, that went something like, "Haha! You run Windows? You Plebe! Suck it!"

### StoneCypher commented Jan 26, 2015

 @iarna The io.js people have been great; I'm a semi-regular in their channel.

### droppedoncaprica commented Jan 26, 2015

 @StoneCypher As a non-npm or node/io developer just lurking the issue trackers, you've always seemed very combative on the subject of Windows integration, which is why I assume most people aren't taking you seriously on it. Not trying to poke the bear here; I understand you're frustrated. But I do think the developres are moving towards a solution here.

### StoneCypher commented Jan 26, 2015

 @droppedoncaprica I understand how telling people how it feels to be treated this way must seem combative, yes.

### johnnyreilly commented Jan 28, 2015

 @iarna - great to hear that npm@3 is likely to improve life in Windows. Is there any thought as to when that might ship?
mentioned this issue Feb 8, 2015
mentioned this issue Feb 17, 2015
mentioned this issue Feb 26, 2015

### nurbek-ab commented Mar 25, 2015

 @StoneCypher thanks a lot! subst solution provided by you works like a charm. All other solutions suggested here didn't work for me but by simply mounting node_modules folder to Z drive I was able to remove the whole folder structure.
mentioned this issue Mar 29, 2015
mentioned this issue Mar 30, 2015
mentioned this issue Apr 1, 2015
mentioned this issue Apr 1, 2015
mentioned this issue Apr 14, 2015

### DullReferenceException commented Apr 30, 2015

 Is this still being tracked? I see it's been closed but not resolved. My perception when a non-resolved issue is closed is that it's being ignored, which I really hope is not the case.

### kevva commented Apr 30, 2015

 It's being fixed in npm@3.

### deostroll commented May 4, 2015

 You can uninstall node modules in that folder serially to solve the problem. http://stackoverflow.com/a/29915329/145682
mentioned this issue May 16, 2015

### chrispappas commented May 28, 2015

 Found this suggestion for using robocopy with an empty directory and node_modules, using the purge switch: http://stackoverflow.com/a/3320317 Paraphrased TL;DR: robocopy empty_dir node_modules /purge I wasn't able to install rimraf because of a borked up npm directory... hoping I can get everything back working again. Hope this helps someone!

### crertel commented Jun 2, 2015

 So, what is the solution in npm@3 going to be? And how far away is that, exactly? I'm rather blocked on this at work, and honestly I'm really getting a bit sick of dealing with the Node ecosystem's quirks. I don't want to clutter up this thread with continued kvetching, but I'm really a bit puzzled that a problem well-solved by, say, Bundler and Hex is somehow still causing grief. (And unfortunately, yes, some of us are stuck with Windows deployments--and no, we'd rather not be, but them's the breaks.)

### iarna commented Jun 23, 2015

 npm@3 makes the install "maximally flat" by hoisting everything it can to the top level node_modules. This means nesting only occurs on conflicts and as such, trees should never get very deep. As such, the windows path length limitation shouldn't be run into. Timeline-wise, we're looking to do the first public release this week.

### hopeseekr commented Jun 24, 2015

 Thank God[dess]!! After the release, NodeJS can announce it once again supports Windows operating systems! I've been battling this issue for... get this!! 2 years and 4 months! For such a critical issue for so many of my clients, I am very happy something is finally being done. Because, frankly, I've had to create a pure PHP equivalent of npm, Gulp and Grunt that doesn't have the damn nested problem. And it works a lot better, too.

### iarna commented Jun 24, 2015

 I'm locking comments here as they're no longer constructive. Anything new issues around the things discussed here should be opened as new issues.
locked and limited conversation to collaborators Jun 24, 2015


text:
# Has the Rational Number 441 2 2 × 5 7 × 7 2 a Terminating Or a Nonterminating Decimal Representation? - Mathematics

Numerical

Has the rational number $\frac{441}{2^2 \times 5^7 \times 7^2}$a terminating or a nonterminating decimal representation?

#### Solution

We have,

441/(2^2xx5^7xx7^2)

Theorem states:

Let  x=p/q be a rational number, such that the prime factorization of q is not of the form  2^nxx5^m , where mand n are non-negative integers.

Then, x has a decimal expression which is non-terminating repeating.

This is clear that the prime factorization of the denominator is not of the form 2^nxx5^m .

Hence, it has terminating decimal expansion.

Is there an error in this question or solution?

#### APPEARS IN

RD Sharma Class 10 Maths
Chapter 1 Real Numbers
Q 12 | Page 58


text:
# Does watching Youtube generate entrophy

Does watching videos (either online videos such as off youtube or saved locally) generate enough (if any) entropy to create secure encryption keys? I understand that some activities such as memory usage, disk access, network utilization, using the mouse and keyboard, etc... generate entropy under Linux. What I don't know is if using the CPU and GPU also generates entropy? I also don't know if this is the same under Windows.

It does, but it's practically impossible to evaluate how much: just a tiny little bit, or enough for security?

A PC is an extremely complex thing, and it's practically impossible to know its exact state at a precise moment in time, even having observed its external behavior (user actions, network packets…) very precisely. Even knowing the exact state of the CPU alone is very difficult: it's very difficult to build a cycle-accurate simulator for the CPU of a modern PC or smartphone, much more difficult than building a simulator that implements all the operations but not their precise timing. Furthermore such complex chips have multiple clocks, and there is some unavoidable manufacturing imprecision that causes a drift between those clocks (CPU jitter), which is the basis of HAVEGE.

The problem with relying solely on the entropy from jitter (within the CPU and between peripherals) is that it's unreliable. Depending on the system configuration, on how much activity there is, on the ambient temperature, there may be more or less jitter. The entropy from user input is unreliable because the user may be somewhat predictable and may be observable. The entropy from network input is suspect because an adversary may be able to obtain it (e.g. if they control your Internet access because you're in a cybercafé or because they breached your router's 5-year old unpatched firmware).

All of these methods have the problem that shortly after boot, no or little entropy has had time to accumulate; a way to counter this is to save entropy from past runs in a file, and load that at boot time. This way, there may be a lack of entropy during the system installation, but as soon as the system has accumulated enough entropy for security, it keeps that entropy forever.

Operating systems like Linux and Windows mix all the entropy sources inside the kernel and expose it through system calls or similar methods (modern interfaces: getrandom(), BCryptGenRandom(); deprecated interfaces: /dev/urandom, CryptGenRandom()). The entropy you get from those system interfaces is more reliable than anything you could cobble up on your own, and is at least as trustworthy since it's coming from the operating system kernel which you have to trust anyway.

Fortunately modern systems, at least in the PC/smartphone range, have a built-in hardware random generator that is actually designed to produce entropy. The system mixes in all the entropy from various sources, which (barring bugs in the entropy mixing) gives you entropy that's at least as strong as the strongest source. While sources such as user activity and disk jitter are mixed in, it doesn't matter if they don't provide enough entropy, since the hardware RNG is sufficient on its own.

• @PaulUszak I know that I emit a certain instruction and it sets a register to a value that I can't predict. I know that others have tried the same thing and come to the same conclusion. Might the random generator be flawed? Sure, it might, but I have no reason to distrust it more than the rest of the CPU. If I'm worried that a CPU might be backdoored, its RNG is the least of my worries: exploiting a backdoored HRNG without another backdoor is not really practical. May 3, 2021 at 21:05
• How do you know that CPUs have built-in hardware random generator(s) ? You cannot prove that by visualising the die. See electronics.stackexchange.com/q/311438/56469. Yes, this is a conspiracy theory, or it might be a theory of conspiracy. Read the Times/CNN/WaPo. We are talking about regime change, colonialism and USA first. Think about the concept of computational indistinguishability. This is serious stuff and people get killed. Gilles - I suggest a tag of Effics. Or is that too erythemal? May 3, 2021 at 22:38
• The entropy from network input is suspect because an adversary may be able to obtain it – It's not quite that bad because it's not the network data that's used for generating entropy but the timing of the NIC interrupts, so even an attacker who can monitor all your internet activity won't be 100% effective at deducing the entropy state. But if the attacker is close (e.g. on your router), then they'll be more accurate than if, say, they were monitoring your VPN. Sadly, NIC interrupt coalescing is a thing...
– forest
May 3, 2021 at 22:42
• @PaulUszak You do realize that backdooring RDRAND is probably the least effective backdoor that the IC could possibly introduce, right? And I'm pretty sure we do know that it has a built-in RNG.
– forest
May 3, 2021 at 22:45

Or course it does. That's the foundational basis of /dev/random.

I'm not going to repeat what's already well documented. Please read Documentation and Analysis of the Linux Random Number Generator.

What's not really spelt out is where the entropy comes from. It comes from quantization noise. It's the attempt of digital systems to accurately model analogue events. There is also the Observer Effect which is a principal concept in physics. If you measure it, you change it.

The two conflate so that sampling you shoving your mouse about at a resolution of 4 GHz, or 250 trillionth of one second means that good entropy is generated. CPU, GPU, Tablet, mobile phone or washing machine are all the same.

Stick a randomness extractor on the output, and so come your secure encryption keys.


text:
# grupo de supervisión y diagnóstico de procesos industrialesGSDPI

Introduction People Gallery Publications Projects Contact

en español

## Interactive dimensionality reduction (iDR)

### DR algorithms in visual analytics

 Dimensionality reduction (DR) algorithms are able to find latent low dimensional structures hidden in high dimensional data, allowing to obtain a mapping onto a low dimensional space (typically 2D or 3D, for visualization) that preserves the most significant underlying structure in data. DR algorithms are based in computing the mutual distances between the elements of a high dimensional input space, to obtain a representation on a low dimensional visualization space (2D/3D) that preserves the underlying structure of data defined by these mutual distances. In other words, DR algorithms define a mapping or projection from the high dimensional input space onto a low dimensional visualization space that preserves the most significant structure and topological relationships of the data in the original space. DR algorithms are very useful tools for visual analytics, since they provide an advanced form of data "spatialization", that is, they allow to generate visual representations whereby the spatial proximity between two elements $$i$$ and $$j$$ in the visualization, represent the similarity between elements $$\mathbf x_i$$ and $$\mathbf x_j$$ in the high dimensional input space.

### Interactive DR algorithms (iDR)

A key element in visual analytics is interaction. Interaction techniques, such as zoom zoom, translation and rotation of data, focus & context, brushing, etc., allow the user to reconfigure the visualization to focus on interesting aspects of data or to discard irrelevant information. In the typical workflow of DR application for data visualization, interaction often takes place after DR computation of projections. The user typically sets an initial configuration for the DR algorithm, runs it until convergence and, after N iterations, the results are visualized. The user can then use interaction techniques to reconfigure this visualization or even decide to run the DR algorithm again with a different parameterization, therby starting the cycle again.

However, interaction can go far beyond this approach if we allow the user to take complete control of the DR algorithm during convergence, and visualize the intermediante results. Using non-convex algorithms, such as the SNE (stochastic neighbor embedding), that are based on an iterative approximation mechanism, the visualization of intermediate results describes a smoothly changing structure that reveals in a dynamic way the changes in the relationships between the samples in terms of the chosen parameters (e.g. redefining the weights of the variables to define similarities).

The result is a visualization that changes dynamically -an animated transition- that allows the user to track the changes in the projection that results from changes in the formulation of the problem, such as changes in the metrics of the input space (e.g. through user-defined modifications of weights in the input variables), or time varying input data (e.g. dynamical processes where the input data vectors vary with time).

### Application to the interactive visualization of vibration states on an induction rotating machine

 A preliminary version of this idea can be seen in the sample web-based application on the right, applying the stochastic neighbor embedding (SNE) algorithm on a high dimensional space composed of the RMS values at different frequency bands of vibrations (accelerations) and currents, for different working conditions of the motor, including: Fault in one phase Mechanincal asymmetry (mass eccentricity w.r.t. the axis) Combined fault in one phase and mechanical asymmetry Electrical imbalances of several degrees, produced by loads of 5Ω, 10Ω, 15Ω, 20Ω in one of the phases Gradual variation of the electrical imbalances from 0Ω to 20Ω, Modifying the weights of each variable (frequency bands in vibrations and currents) the map of vibration states is "reconfigured" on the fly, organizing the states by similarities on the variables to which the user has assigned a significant weight. If one variable is fundamental to characterize a certain condition and is omitted by the user (i.e. given a small weight), this fault will not be isolated in the visualization and the corresponding states will become "merged" with the other states. On the other hand, if the user gives weight to this variable, a separation emerges, showing the user in a natural and intuitive way, that this variable is relevant in the characterization of this fault. Proof of concepto of iDR mousewheel: zoom inertia: smoothness in the transitions between projections attrib: attribute being represented by size and color sigma: degree of local approximation in the SNE sliders feature weights: modification of the weights in the variables (current and vibration harmonics in this case) (click on the image to test the iDR idea)

#### References

• Ignacio Díaz, Abel A. Cuadrado, Daniel Pérez, Francisco J. García, and Michel Verleysen "Interactive Dimensionality Reduction for Visual Analytics". In European Symposium on Artificial Neural Networks, Computational Intelligence and Machine Learning, Bruges, Belgium. April, 2014. (descargar pdf)
• Ignacio Díaz Blanco, Abel A. Cuadrado, and Michel Verleysen "A State-Space Model on Interactive Dimensionality Reduction". In European Symposium on Artificial Neural Networks, Computational Intelligence and Machine Learning, Bruges, Belgium. pp. 647-652. April, 2016. [→ pdf][→ pdf poster][→ pdf spotlight]

### Acknowledgements

 The research published in this page has been financed by funds of the Principado de Asturias, from the Ministry of Economy and Competitivity (mineco) and by FEDER funds from the European Union under project grants DPI2009-13398-C02/01 and DPI2015-69891-C2-2-R

## Poster of the iDR idea

See below a poster with the core idea of iDR, presented in the ESANN2014 symposium, in Brugge, Belgium (pdf version here).

## Poster with the state space interpretation of the dynamics of iDR algorithms

We show here a poster showing the state space interpretation of the dynamic behavior of iDR algorithms, presented at ESANN2016 symposium, in Brugge, Belgium(versión en pdf disponible aquí)

.


text:
# check, if any “add_action” function contains string XXXXXXXXX

i want to filter out any function, that output such string : http://twitter.com/xxxxxx.js (this is example,i will need other strings to filter out..)

is there any way, to find which "add_action" adds any script or link, containing that string?


text:
### B-1 - Act respecting the Barreau du Québec

99. (Repealed).
1966-67, c. 77, s. 98; 1973, c. 44, s. 46; 1988, c. 21, s. 66; 1994, c. 40, s. 261.
99. The complaint shall be served upon the respondent advocate by the bailiff, either personally, at his last law office known to the Bar or, if such office is closed or if there is no person at such office, at the office of the Court of Québec where the respondent advocate had such office.
1966-67, c. 77, s. 98; 1973, c. 44, s. 46; 1988, c. 21, s. 66.
99. The complaint shall be served upon the respondent advocate by the bailiff, either personally, at his last law office known to the Bar or, if such office is closed or if there is no person at such office, at the office of the Provincial Court where the respondent advocate had such office.
1966-67, c. 77, s. 98; 1973, c. 44, s. 46.


text:
Use adaptive quiz-based learning to study this topic faster and more effectively.

# A.C. rectification

## Half-wave rectification

Diodes can be used to convert alternating current (a.c.) into direct current (d.c.). This process is called rectification.

Half-wave rectifier circuit (left) and half-wave rectified a.c. waveform (right)

The diagram shows a simple a.c. rectifier circuit.

The diode only allows current to flow in one direction and not the other.

This means that only the positive half of the a.c. is allowed to pass through the circuit, effectively converting the a.c into d.c. This is called half-wave rectification.

Appliances such as mobile phones, computers and radios require direct current to function. A rectifier is needed when they are connected to the a.c. mains supply.

## Full-wave rectification

Full-wave bridge rectifier circuit (left) and full-wave rectified a.c. waveform (right)

A full-wave rectifier converts the entire a.c. waveform to one that is only positive. The process is called full-wave rectification.

Full-wave rectifiers usually use four diodes to change the alternating current. An example of a full-wave rectifier circuit is shown in the diagram.

The rapid changes in voltage can damage sensitive electrical components. To avoid this, the output can be smoothed using a capacitor.

## Rms current of rectified a.c.

The rms current and voltage of a full wave rectified a.c. are the same as the rms of the original a.c.$$I_{\text{rms, rec}}= I_{\text{rms}}\quad V_{\text{rms, rec}}=V_{\text{rms}}$$

When the waveform is symmetrical (which is the case for a sinusoidal or a square wave), the rms current and voltage of a half-wave rectified a.c. are given by:$$I_{\text{rms}, \text{ half rec}} = \frac{I_{\text{rms}}}{\sqrt{2}}\qquad V_{\text{rms}, \text{ half rec}} =\frac{V_{\text{rms}}}{\sqrt{2}}$$ The reason is that the power loss of each half-wave is the same and that the sum of the contribution of each of them is the total power loss.

A half-wave rectifier circuit.