text:
# Just how to pass enumerated values to an internet solution

My predicament is, primarily, just how to share a list in between 2 applications.

The customers post records via a front-end application that gets on the internet. This application calls an internet solution of the back-end application and also passes the record to it. The back-end application conserves the record and also inserts a row in the Document table.

The record type (7 feasible record kinds: Billing, Contract and so on) is passed as a parameter to the internet solution's UploadDocument method. The inquiry is, what need to the type (and also feasible values) of this parameter be?

Given that you require to hardcode these values in both applications, I assume it is O.K. to make use of a detailed string (Invoice, Contract, WorkOrder, SignedWorkOrder).

Is it possibly a far better strategy to create a DocumentTypes list in the first application, and also to duplicate it additionally in the 2nd application, and afterwards pass the equivalent integer value to the internet solution in between them?

0
2019-05-04 02:07:24
Source Share

I would certainly recommend versus passing an integer in between them, merely for objectives of readability and also debugging. Claim you're experiencing your logs and also you see a number of 500 mistakes for DocumentType= 4. Currently you've reached go seek out which DocumentType is 4. Or if among the applications describes a number that does not exist in the various other, probably as a result of dissimilar variations.

It's a little bit extra code, and also it massages the fixed keying component of the mind a little bit raw, yet in methods in addition to HTTP the obtained knowledge is to agree understandable strings over nontransparent lists.

0
2019-05-07 18:38:14
Source

I can just talk about.net, yet if you have an ASP.net Webservice, you need to have the ability to add a list straight to it.

When you after that make use of the "Add Web Reference" in your Client Application, the resulting Class needs to include that enum

But this is from the top of my head, i'm rather certain i've done it in the past, yet I can not claim without a doubt.

0
2019-05-07 18:32:55
Source

I would certainly still make use of list inside yet would certainly anticipate customers to pass me just the name, not the numerical value itself.

simply some foolish instance to highlight :

public enum DocumentType
{
Invoice,
Contract,
WorkOrder,
SignedWorkOrder
}

[WebMethod]
public void UploadDocument(string type, byte[] data)
{
DocumentType docType = (DocumentType)Enum.Parse(typeof(DocumentType), type);
}

0
2019-05-07 18:30:38
Source

In.NET, list values are (by default ) serialized right into xml with the name. As an examples where you can have numerous values (flags ), after that it places a room in between the values. This functions due to the fact that the list does not have rooms, so you can get the value once more by splitting the string (ie. "Invoice Contract SignedWorkOrder", making use of lubos's instance ).

You can regulate the serialization of values of in asp.net web services making use of the XmlEnumAttribute, or making use of the EnumMember feature when making use of WCF.

0
2019-05-07 18:00:32
Source

If you are eating your Web solution from a.NET page/application, you need to have the ability to access the list after you add your Web reference to the task that is eating the solution.

0
2019-05-07 17:53:31
Source


text:
# Domination in Nice Lattices

Let an integer vector be nice when it has only two nonzero components, which sum to zero. So (0, 0, 3, 0, -3) and (-1, 0, 1, 0, 0) are examples of nice vectors in $n=5$ dimensions.

Call a lattice nice if it is of the form $\mathbb{Z}$-span({$v_1, v_2, \dotsc, v_m$}), where all $v_i$ are nice. (Note: the $v_i$ are not necessarily linearly independent so $m$ could be larger than the dimension; although WOLOG $m \le \tbinom{n}{2}$.)

Is the following decision problem in P?

• INPUT: a nice lattice and a vector $x \in \mathbb{Z}^n$
• QUESTION: does the lattice contain a $y$ such that $y_i \ge x_i$ for all $i=1, \dotsc, n$?

Motivation and background:

• in general lattices, the problem is NP-complete (via the unbounded knapsack problem)
• if this problem lies in P, one can solve an interesting more general problem

A possibly interesting partial result would be to demonstrate any useful structure for nice lattices!

(I posted a flow formulation of the problem on cstheory)

-
Trivial comment. If we take $v_1=(1,-1,0, \dots, 0), v_2=(0,1,-1,0, \dots, 0), \dots, v_{n-1}=(0, \dots, 1,-1)$, then the $\mathbb{Z}$-span of all the $v_i$'s is in fact all integer vectors whose coordinates sum to zero. – Tony Huynh Feb 22 '11 at 14:53
Not-as-trivial comment: There are at most finitely many vectors y which are both nice and greater than x (the sum of whose components must be at most 0). This can be transformed into finding integer solutions to a system of linear inequalities; if the transform went the other way, I think it would show the problem to be NP-complete. Gerhard "Ask Me About System Design" Paseman, 2011.02.22 – Gerhard Paseman Feb 22 '11 at 17:16
Of course, there is the brute force approach: if the sum of the coefficients of x is -r, try the O(r^(n-1)) nice vectors above x and see which are in the desired lattice. Gerhard "Is There A Better Way" Paseman, 2011.02.22 – Gerhard Paseman Feb 22 '11 at 17:23
Yes, your comments are valid. Tony, more generally than what you state, the problem becomes poly-time solvable if all of the nonzero entries form a chain under division (e.g., all 1s, 2s, 6s, 30s...) – Dave Pritchard Feb 24 '11 at 11:47

format: plain


text:
# How to modify the part title page in KOMA script book style by a pdf?

I have used Adobe Illustrator to draw some covers for my part title page. Despite such dedication, I would appreciate if the bookmark points into the "cover" page. The original part title page may retain, however, it is preferred to include the homemade cover as the first page of the part.

## MWE

\documentclass[12pt,a4paper,headinclude,openright]{scrbook}
\usepackage[usenames,dvipsnames,svgnames,x11names,table]{xcolor}
\usepackage{afterpage}
\usepackage{pagecolor}
\usepackage[ilines]{scrlayer-scrpage}
\usepackage[top=3cm, bottom=4cm, outer=4cm, inner=3cm, heightrounded, marginparwidth=3cm, marginparsep=0.5cm, voffset=0cm]{geometry}
\usepackage{pdfpages}
\begin{document}
\frontmatter

\let\LaTeXStandardMaketitle\maketitle

\renewcommand{\maketitle}{%
\includepdf[openright=false]{Cover.pdf}
}%
\includepdf[openright=false]{CoverVol1.pdf} % this is where the cover should be
\thispagestyle{empty}
\part{Part ONE} % I would like to retain the text title as the same format as well
\end{document}

The cover page(s) is A4 sized and available on request.

• Please make your code into a minimal working example (MWE). – cfr Mar 30 '15 at 12:00
• so, the partpage should stay as it is (on odd pages), and the even page partpage-1 should contain the pdf. Did i get this right? – Johannes_B Mar 30 '15 at 12:23
• @Johannes_B They both are in the odd number page, so that I can read the cover and the "wordy" cover on the right. – SHY.John Mar 30 '15 at 12:30
• But why are you setting openright to false? – Johannes_B Mar 30 '15 at 12:36
• @Johannes_B Okay, this is due to the odd page is at left when the cover page is at left as well. I am viewing with the cover page at right so that is why. – SHY.John Mar 30 '15 at 12:44

## 2 Answers

I am not sure if I understand what you want:

\documentclass[12pt,a4paper,headinclude,openright]{scrbook}
\usepackage[usenames,dvipsnames,svgnames,x11names,table]{xcolor}
\usepackage{afterpage}
\usepackage{pagecolor}
\usepackage[ilines]{scrlayer-scrpage}
\usepackage[top=3cm, bottom=4cm, outer=4cm, inner=3cm, heightrounded, marginparwidth=3cm, marginparsep=0.5cm, voffset=0cm]{geometry}
\usepackage{pdfpages}

\newcommand*\pdfpart[2]{%
\cleardoublepage%
\includepdf[pagecommand=\thispagestyle{empty}%
\stepcounter{part}\addparttocentry{\thepart}{#2}%
\addtocounter{part}{-1}%
]{#1.pdf}%
\cleardoublepage%
\part[]{#2}%
}

\usepackage{mwe}% dummy text and example pdf
\begin{document}
\frontmatter
\tableofcontents
\mainmatter
\pdfpart{example-image-A}{Part ONE}
\blinddocument
\blinddocument
\part{Part TWO}
\blinddocument
\blinddocument
\pdfpart{example-image-B}{Part THREE}
\blinddocument
\blinddocument
\pdfpart{example-image-C}{Part FOUR}
\blinddocument
\blinddocument
\end{document}

Note: You have to load hyperref (this package is missing in your MWE) and you have to add a \phantomsection before \addparttocentry if you want to use bookmarks.

Update

If image should be in the background of the normal part page you can define and use a new pagestyle.

\documentclass[12pt]{scrbook}
\usepackage{xcolor}
\usepackage{scrlayer-scrpage}

%%%

\usepackage{etoolbox}

\newcommand*\partpagecolor[1][]{}
\newkomafont{partpage}{\normalcolor}
\addtokomafont{part}{\usekomafont{partpage}}
\addtokomafont{partnumber}{\usekomafont{partpage}}

\newpairofpagestyles{partpageimage}{
\clearpairofpagestyles
\ofoot{\pagemark}
\addtokomafont{pagenumber}{\usekomafont{partpage}}
}
\makeatletter
\newcommand*\@partpageimage{}
\newcommand*\partpageimage[2][]{%
\ifstr{#2}{}{%
\setkomafont{partpage}{\normalcolor}%
\def\@partpageimage{}%
}{%
\setkomafont{partpage}{\partpagecolor[#1]}%
\gdef\@partpageimage{\includegraphics[width=\paperwidth]{#2}}%
}}

\appto\partheademptypage{\partpageimage{}}

\DeclareNewLayer[background,area={.5\paperwidth}{.5\paperheight}{0pt}{0pt},
contents={\makebox[0pt]{\raisebox{0pt}[.5\height][.5\height]{\@partpageimage}}}
]{partpageimage.bg}
\makeatother

\AddLayersAtBeginOfPageStyle{partpageimage}{partpageimage.bg}
\colorlet{defaultpartpagecolor}{white}

% comment the following two lines to get normal part pages
\renewcommand*{\partpagestyle}{partpageimage}
\renewcommand*{\partpagecolor}[1][]{\ifstr{#1}{}{\color{defaultpartpagecolor}}{\color{#1}}}

%%%

\usepackage{hyperref}

\usepackage{mwe}% dummy text and example pdf
\begin{document}
\frontmatter
\tableofcontents
\mainmatter
\partpageimage{example-image-golden-upright}
\part{Part ONE}
\blinddocument
\part{Part TWO}
\blinddocument
\partpageimage[yellow]{example-grid-100x100bp}
\part{Part THREE}
\blinddocument
\partpageimage{example-image-A}
\part{Part FOUR}
\blinddocument
\end{document}

• I like your idea, although I used mine for implementation. I assume yours are valid so check for the tick on the left hand side. – SHY.John Apr 1 '15 at 7:09

Inspired from esdd's answer, with trials and errors. I sought out what I need.

\documentclass[12pt,a4paper,headinclude,openright]{scrbook}
\usepackage[usenames,dvipsnames,svgnames,x11names,table]{xcolor}
\usepackage{afterpage}
\usepackage{pagecolor}
\usepackage[ilines]{scrlayer-scrpage}
\usepackage[top=3cm, bottom=4cm, outer=4cm, inner=3cm, heightrounded, marginparwidth=3cm, marginparsep=0.5cm, voffset=0cm]{geometry}
\usepackage{pdfpages}
\begin{document}
\frontmatter

\let\LaTeXStandardMaketitle\maketitle

\renewcommand{\maketitle}{%
\includepdf[openright=false]{Cover.pdf}
}%
% ================================= part and chapter style ==================================

\newcommand*\pdfpart[2]{%
\cleardoublepage%
\phantomsection%
\stepcounter{part}%
\includepdf{#1.pdf}%
\addparttocentry{\thepart}{#2}%
\cleardoubleemptypage%
\part*{#2}%
}
\pdfpart{}{}
\end{document}

I understand you may not know what I am doing. I will explain here.

1. \phantonsection makes a hidden section to redirect the bookmark to the cover page.
2. then step up the counter by 1
3. Cover page included and add the entry to the toc
4. End the page with \cleardoublepage
5. The \part* is used for as a "phantom" part
6. The \pdfpart has argument ONE for the cover and TWO for the part name.


text:
# Homework Help: Delta to Y method

1. Jul 26, 2012

### MohdAziz

Hello, I have this question that I've been working on. The question requires me to find the current across an inductor in a Delta circuit, so I want to solve this question using Delta-to-Wye method. so I transformed it using the method and I found the total impedance of the whole circuit, then I divided the phasor voltage by the impedance and I found the current, but I still have no idea how I can find the current across the inductor. I attached a picture of the question so you guys can see my problem.
The result of the total impedance was around ( 82 - 64.07i)
and the phasor current after dividing by the phasor voltage is 0.6731 < 38

Thanks a lot, your help is really appreciated.

#### Attached Files:

• ###### CT1.jpg
File size:
34.5 KB
Views:
212
2. Jul 26, 2012

### uart

Say that you transform R1 R2 and ZL1 from delta to star. As you've found, you now have a series - parallel circuit that is amenable to "ladder style" collapsing. You do lose track of L1 in the process (it gets tangled up with R1 and R2 in the transform), more importantly however you do still have access to nodes A and B.

So you can calculate the voltages at A and B from the transformed circuit, then using this knowledge of $V_{AB}$ you can then go back to the original circuit to solve for Ix

3. Jul 26, 2012

### MohdAziz

Okay. I got your idea, by that Va should the voltage across the capacitor and Vb should the voltage across R3 but the thing how could I find the voltage or apply the voltage divider rule in case of a sinosoidal voltage source.
just to tell you
Z1= 16 - 21.33i
Z2= 51.2 + 38.4i
Z3 = 64 - 48i

when I apply the voltage divider rule to Z1, VZ1 = Vin * Z1/ Ztot
all of Z1, Z total and Vin should be in phasor form?

Thanks a lot man.

4. Jul 26, 2012

### uart

Yeah that's right. Just use complex numbers for all the impedances and use the voltage divider rule with complex numbers. For the source voltage use 70 + j0 (70 angle 0).

5. Jul 26, 2012

### Staff: Mentor

Re: Delta To Y method in solving this Q

If you apply a Δ-Y transform to the circuit you will "transform away" the component through which you want to find the current (L1). However, nodes A and B still exist in the "new" layout, so you could calculate their node voltages. With the two node voltages in hand you can go back to the original layout to determine the potential difference across L1 and hence its current...

A more straightforward approach might be to write KVL mesh or KCL node equations for the original circuit.

6. Jul 26, 2012

### MohdAziz

Okay that's great, I think I got the picture. I'll solve the whole thing and I'll scan and attach it to show it to you so I can know your remarks, of course if you don't mind?

7. Jul 26, 2012

### MohdAziz

Re: Delta To Y method in solving this Q

Okay. The thing I'm supposed to do it using delta to wye, however; If I ever have time, I'll try the node analysis. And if you don't mind, can I solve the whole thing, and attach it so I can show and you could tell me what are my mistake, if I have any?

And thanks a lot for your help;.

8. Jul 27, 2012

### Staff: Mentor

Re: Delta To Y method in solving this Q

Yes, you are encouraged to show your work

9. Jul 27, 2012

### MohdAziz

There is this one weird thing that I came across when solving the question, as you know to find the voltage of node A, you have to find the voltage of the capacitor, therefore; firsr you need to find the voltage of the whole parallel part by applying voltage divider rule like this (Zparallel/ Zparallel + Z1)* 70<0 ... The answer would be 52.92<5.076. Then you use this in voltage divider rule again to find the capacitor voltage Like this, (Xc/Xc + Z2)* 52.92<076. However the weird thing that the voltage of node A (capacitor) is actually higher than the voltage of whole parallel part, and this should be impossible. I tried to check all of my results, but I'm quite sure I haven't made any calculation mistakes?

10. Jul 27, 2012

### MohdAziz

Here you go, this is my work. BTW I tried also to find the current through the capacitor and then find the voltage but I got a different result as well :S

#### Attached Files:

• ###### CTSA.jpg
File size:
25.9 KB
Views:
147
11. Jul 27, 2012

### Staff: Mentor

You'll want to recheck your calculation for Z3. Otherwise, your method of work looks fine.

12. Jul 27, 2012

### MohdAziz

You're right Z3 here is wrong, but when I calculated the total Z I used the right calculation which is 64 + 48i , and the answer of the Z of Parallel would still be 66 - 42.74. And thus the total Z is 82 - 64.07. And when we calculate Va we just need the Z parallel and Z tot so the mistake in calculation Z3 won't have any effect on the result of Va.

13. Jul 28, 2012

### Staff: Mentor

It does, however, impact Vb which in turn effects Va-Vb for the calculation of Ix.

14. Jul 28, 2012

### MohdAziz

Anyway I was concerned bcuz when we find the magnitude of Va in polar form it's greater than the magnitude of the parallel voltage in polar form. However; I decided to check the total voltage of Vz2 + Va in rectangular form and it was equal to the parallel voltage which I guess my answer is correct. Anyway I resolved everything and I corrected my mistakes and here is my final work.
Thanks a lot for your help, could you please check it for the last time. I really appreciate your help.

#### Attached Files:

• ###### CTS2.jpg
File size:
29.3 KB
Views:
156
15. Jul 28, 2012

### Staff: Mentor

It all looks fine except for your final calculation of Ix; the impedance of the inductor should be an imaginary value (240j Ω), but it seems that you've treated it as a real value.

16. Jul 28, 2012

### MohdAziz

oh missed that. SO final answer should be (28.93 - 22.27j)/240j = -0.093 +0.120i which equals to 0.152 < -127.59 in phasor form. Thanks a lot gneil, and sorry for that coin in my last solution sheet :D

17. Jul 28, 2012

### Staff: Mentor

Yes, that looks better

Next time post a cheque; paper coins are hard to cash

18. Jul 28, 2012

### MohdAziz

Hahaha, you got it take care


text:
# 7: Approximation Methods

The Schrödinger equation for realistic systems quickly becomes unwieldy, and analytical solutions are only available for very simple systems - the ones we have described as fundamental systems in this module. Numerical approaches can cope with more complex problems, but are still (and will remain for a good while) limited by the available computer power. Approximations are necessary to cope with real systems. Within limits, we can use a pick and mix approach, i.e. use linear combinations of solutions of the fundamental systems to build up something akin to the real system. There are two mathematical techniques, perturbation and variation theory, which can provide a good approximation along with an estimate of its accuracy. These two approximation techniques are described in this chapter.

• 7.1: The Variational Method Approximation
In this section we introduce the powerful and versatile variational method and use it to improve the approximate solutions we found for the helium atom using the independent electron approximation.
• 7.2: Linear Variational Method and the Secular Determinant
A special type of variation widely used in the study of molecules is the so-called linear variation function, a linear combination of N linearly independent functions (often atomic orbitals). Quite often a trial wavefunction is expanded as a linear combination of other functions (not the eigenvalues of the Hamiltonian, since they are not known) .
• 7.3: Trial Functions Can Be Linear Combinations of Functions That Also Contain Variational Parameters
An alternative approach to the general problem of introducing variational parameters into wavefunctions is the construction of a  wavefunction as a linear combination of other functions each with one or multiple parameters that can be varied
• 7.4: Perturbation Theory Expresses the Solutions in Terms of Solved Problems
Perturbation theory is the single most important method of solving problems in quantum mechanics, and is widely used in atomic physics, condensed matter and particle physics. Perturbation theory is another approach to finding approximate solutions to a problem, by starting from the exact solution of a related, simpler problem. A critical feature of the technique is a middle step that breaks the problem into "solvable" and "perturbation" parts.
• 7.E: Approximation Methods (Exercises)
These are homework exercises to accompany Chapter 7.

7: Approximation Methods is shared under a not declared license and was authored, remixed, and/or curated by LibreTexts.


text:
# Cite references in figure caption

Problem:

Getting error messages when trying to cite a reference in the figure caption. Not sure what I am doing wrong. Can't seem to find that this has been up previously either.

Minimal Working Example:

\documentclass{book}
\usepackage[utf8]{inputenc}
\usepackage[pdftex]{graphicx}
\usepackage{epstopdf}
\graphicspath{{figures/}}

\usepackage{apacite}
\bibliographystyle{apacite}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{rub14,
author = {Rubin, Jared},
title = {Printing and {Protestants}: An empirical test of the role of printing in the {Reformation}},
journal = {Review of Economics and Statistics},
volume = {96},
number = {2},
pages = {270--286},
year = {2014},
}
\end{filecontents}

\begin{document}
\begin{figure}[htp]
\centering
\includegraphics[width=\textwidth]{conceptdriven.eps}
\caption{\label{fig:researchscope}The process of concept-driven design approach in relation to theory and use situation, adopted from \citeA[p.~282]{rub14}}
\end{figure}

\bibliography{\jobname}

\end{document}

Desired outcome:

The reference to be directly after the words "adopted from".

• Try using the optional argument of caption. btw, except for the figure, this is a very very good mwe. – Johannes_B Feb 12 '15 at 20:41
• @Johannes_B Tried the notoccite on the MWE but did not work. Any suggestions regarding the optional argument? – kexxcream Feb 12 '15 at 20:45
• For lacking a better example REMOVE or KEEP the reference in the list of figures page? – Johannes_B Feb 12 '15 at 20:47
• @Johannes_B Works like a charm, you saved my evening. Very grateful! – kexxcream Feb 12 '15 at 20:50
• An alternative is to use \protect in front of \citeA, i.e., \protect\citeA{...}. The \label command should not be in the scope of the \caption command. Thus it should be \caption{....}\label{....}. – Guido Feb 12 '15 at 21:02

The macro \citeA is "fragile", in the LaTeX-specific sense of the word. If it occurs inside a "moving argument" (more LaTeX jargon, sorry), such as the argument of a \caption instruction, one must prefix a \protect instruction:

\caption{\label{fig:researchscope}The process of concept-driven design approach in
relation to theory and use situation, adopted from \protect\citeA[p.~282]{rub14}}

For another example of this type, see the posting Using \input{} inside caption.

• The 10th upvote of this answer, received on 20 June 2017, earned me not only a "Nice Answer" badge but also my 888th [!] badge overall on this site. Many thanks!!! – Mico Jun 20 '17 at 3:01
• The 25th upvote of this answer, received on 17 May 2019, earned me not only a silver "Good Answer" badge but also the 1220th badge overall on this site. Many thanks!!! – Mico May 17 at 7:46

There is a similar question in StackOverflow.

The problem with the \cite command in the figure caption is that it generates conflicts with the automatic creation of the List of Figures. So the first option is to put an alternative caption into brackets:

\caption[test caption]{test caption from~\cite{MyCite}}

You can also use the \protect environnement as suggested in the comments:

\caption{test caption from~\protect\cite{MyCite}}

As for your minimal working example, you could do it as follows:

\documentclass{book}
\usepackage[utf8]{inputenc}
\usepackage[pdftex]{graphicx}
\usepackage{epstopdf}
\graphicspath{{figures/}}

\usepackage{lipsum} % just for the example

\usepackage{apacite}
\bibliographystyle{apacite}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{rub14,
author = {Rubin, Jared},
title = {Printing and {Protestants}: An empirical test of the role of printing in the {Reformation}},
journal = {Review of Economics and Statistics},
volume = {96},
number = {2},
pages = {270--286},
year = {2014},
}
\end{filecontents}

\begin{document}
\listoffigures

\vspace{0.5cm}
\lipsum[3]
\begin{figure}[htp]
\centering
\includegraphics[width=8cm,height=5cm]{sample_pic}%
%\includegraphics[width=\textwidth]{conceptdriven.eps}
\caption[The process of concept-driven design approach in relation to theory and use situation]{The process of concept-driven design approach in relation to theory and use situation, adopted from~\citeA[p.~282}
\label{fig:researchscope}
\end{figure}

\lipsum[2]
\bibliography{\jobname}

\end{document}

And the output would look like:

• What advice would you give if the optional argument of \caption needs to be a bit more informative than just "test". – Mico Feb 12 '15 at 21:40
• @Mico Just changed that in the MWE. I would simply put the same caption in the brackets without the reference: \caption[This is the caption of my figure]{This is the caption of my figure~\cite{JSmith}}. In this way, in the figure you would have the citation, but not in the list of figures (where it's useless). – Nicolas Feb 12 '15 at 21:43
• @Mico I added the List of Figures to the MWE to emphasize the difference. – Nicolas Feb 12 '15 at 21:55


text:
0th

Percentile

##### Transfer Binary Data To and From Connections

Read binary data from or write binary data to a connection or raw vector.

Keywords
file, connection
##### Usage
readBin(con, what, n = 1L, size = NA_integer_, signed = TRUE,
endian = .Platform$endian)writeBin(object, con, size = NA_integer_, endian = .Platform$endian, useBytes = FALSE)
##### Arguments
con

A connection object or a character string naming a file or a raw vector.

what

Either an object whose mode will give the mode of the vector to be read, or a character vector of length one describing the mode: one of "numeric", "double", "integer", "int", "logical", "complex", "character", "raw".

n

numeric. The (maximal) number of records to be read. You can use an over-estimate here, but not too large as storage is reserved for n items.

size

integer. The number of bytes per element in the byte stream. The default, NA_integer_, uses the natural size. Size changing is not supported for raw and complex vectors.

signed

logical. Only used for integers of sizes 1 and 2, when it determines if the quantity on file should be regarded as a signed or unsigned integer.

endian

The endian-ness ("big" or "little") of the target system for the file. Using "swap" will force swapping endian-ness.

object

An R object to be written to the connection.

useBytes

See writeLines.

##### Details

These functions can only be used with binary-mode connections. If con is a character string, the functions call file to obtain a binary-mode file connection which is opened for the duration of the function call.

If the connection is open it is read/written from its current position. If it is not open, it is opened for the duration of the call in an appropriate mode (binary read or write) and then closed again. An open connection must be in binary mode.

If readBin is called with con a raw vector, the data in the vector is used as input. If writeBin is called with con a raw vector, it is just an indication that a raw vector should be returned.

If size is specified and not the natural size of the object, each element of the vector is coerced to an appropriate type before being written or as it is read. Possible sizes are 1, 2, 4 and possibly 8 for integer or logical vectors, and 4, 8 and possibly 12/16 for numeric vectors. (Note that coercion occurs as signed types except if signed = FALSE when reading integers of sizes 1 and 2.) Changing sizes is unlikely to preserve NAs, and the extended precision sizes are unlikely to be portable across platforms.

readBin and writeBin read and write C-style zero-terminated character strings. Input strings are limited to 10000 characters. readChar and writeChar can be used to read and write fixed-length strings. No check is made that the string is valid in the current locale's encoding.

Handling R's missing and special (Inf, -Inf and NaN) values is discussed in the ‘R Data Import/Export’ manual.

Only $2^{31}-1$ bytes can be written in a single call (and that is the maximum capacity of a raw vector on 32-bit platforms).

‘Endian-ness’ is relevant for size > 1, and should always be set for portable code (the default is only appropriate when writing and then reading files on the same platform).

##### Value

For readBin, a vector of appropriate mode and length the number of items read (which might be less than n).

For writeBin, a raw vector (if con is a raw vector) or invisibly NULL.

##### Note

Integer read/writes of size 8 will be available if either C type long is of size 8 bytes or C type long long exists and is of size 8 bytes.

Real read/writes of size sizeof(long double) (usually 12 or 16 bytes) will be available only if that type is available and different from double.

If readBin(what = character()) is used incorrectly on a file which does not contain C-style character strings, warnings (usually many) are given. From a file or connection, the input will be broken into pieces of length 10000 with any final part being discarded.

The ‘R Data Import/Export’ manual.

readChar to read/write fixed-length strings.

connections, readLines, writeLines.

.Machine for the sizes of long, long long and long double.

##### Aliases
library(base) # NOT RUN { zzfil <- tempfile("testbin") zz <- file(zzfil, "wb") writeBin(1:10, zz) writeBin(pi, zz, endian = "swap") writeBin(pi, zz, size = 4) writeBin(pi^2, zz, size = 4, endian = "swap") writeBin(pi+3i, zz) writeBin("A test of a connection", zz) z <- paste("A very long string", 1:100, collapse = " + ") writeBin(z, zz) if(.Machine$sizeof.long == 8 || .Machine$sizeof.longlong == 8) writeBin(as.integer(5^(1:10)), zz, size = 8) if((s <- .Machine$sizeof.longdouble) > 8) writeBin((pi/3)^(1:10), zz, size = s) close(zz) zz <- file(zzfil, "rb") readBin(zz, integer(), 4) readBin(zz, integer(), 6) readBin(zz, numeric(), 1, endian = "swap") readBin(zz, numeric(), size = 4) readBin(zz, numeric(), size = 4, endian = "swap") readBin(zz, complex(), 1) readBin(zz, character(), 1) z2 <- readBin(zz, character(), 1) if(.Machine$sizeof.long == 8 || .Machine$sizeof.longlong == 8) readBin(zz, integer(), 10, size = 8) if((s <- .Machine$sizeof.longdouble) > 8) readBin(zz, numeric(), 10, size = s) close(zz) unlink(zzfil) stopifnot(z2 == z) ## signed vs unsigned ints zzfil <- tempfile("testbin") zz <- file(zzfil, "wb") x <- as.integer(seq(0, 255, 32)) writeBin(x, zz, size = 1) writeBin(x, zz, size = 1) x <- as.integer(seq(0, 60000, 10000)) writeBin(x, zz, size = 2) writeBin(x, zz, size = 2) close(zz) zz <- file(zzfil, "rb") readBin(zz, integer(), 8, size = 1) readBin(zz, integer(), 8, size = 1, signed = FALSE) readBin(zz, integer(), 7, size = 2) readBin(zz, integer(), 7, size = 2, signed = FALSE) close(zz) unlink(zzfil) ## use of raw z <- writeBin(pi^{1:5}, raw(), size = 4) readBin(z, numeric(), 5, size = 4) z <- writeBin(c("a", "test", "of", "character"), raw()) readBin(z, character(), 4) # }


text:
How to remove effect of different batch variances in linear modelling

I have a dataset with 300 rows/genes and 900 columns/samples. The data were collected in 10 different batches, and study design was balanced in all of the batches. However, there is a huge difference in variances of each gene across multiple batches (1-5 units). I assume because of this, I am not getting statistically significant results because higher variance batches reduce the t-statistics.

One approach, I was taking is removing those high variance batches and do t-tests on small variance batches. However, is there any method that I can use which can account for different batch variances?

a <- rnorm(20, mean = 15, sd = 2) b <- rnorm(20, mean = 13, sd = 2) boxplot(a,b) t.test(a,b) data: a and b t = 2.8167, df = 36.319, p-value = 0.007799

Now I add another batch with same means but higher standard deviation-

A <- c(a,rnorm(20, mean = 15, sd = 5)) B <- c(b,rnorm(20, mean = 13, sd = 5)) boxplot(A,B) t.test(A,B) data: A and B t = 0.69185, df = 77.973, p-value = 0.4911  As I add another batch with higher standard deviation, I lose significance.

• Take a look at stats.stackexchange.com/q/256860/121522 – mkt - Reinstate Monica Apr 9 '18 at 18:11
• The page focuses on heteroscedasticity where data for output groups have different variances. In my case, when I join two batches ('a' -> 'A') of the same group because of the higher variance of added batch I lose significance. Is there a way to consider this batch variance while performing t-test or other tests? – Shubham Gupta Apr 9 '18 at 21:34


text:
RUS  ENG JOURNALS   PEOPLE   ORGANISATIONS   CONFERENCES   SEMINARS   VIDEO LIBRARY   PACKAGE AMSBIB
 General information Latest issue Forthcoming papers Archive Impact factor Subscription Guidelines for authors License agreement Submit a manuscript Search papers Search references RSS Latest issue Current issues Archive issues What is RSS

 Mat. Zametki: Year: Volume: Issue: Page: Find

 Mat. Zametki, 1997, Volume 62, Issue 3, Pages 363–371 (Mi mz1618)

Approximation of functions of bounded $p$-variation by polynomials in terms of the Faber–Schauder system

S. S. Volosivets

Saratov State University named after N. G. Chernyshevsky

Abstract: In this paper the best polynomial approximation in terms of the system of Faber–Schauder functions in the space $C_p[0,1]$ is studied. The constant in the estimate of Jackson's inequality for the best approximation in the metric of $C_p[0,1]$ and the estimate of the modulus of continuity $\omega_{1-1/p}$ are refined.

DOI: https://doi.org/10.4213/mzm1618

Full text: PDF file (187 kB)
References: PDF file   HTML file

English version:
Mathematical Notes, 1997, 62:3, 306–313

Bibliographic databases:

UDC: 517

Citation: S. S. Volosivets, “Approximation of functions of bounded $p$-variation by polynomials in terms of the Faber–Schauder system”, Mat. Zametki, 62:3 (1997), 363–371; Math. Notes, 62:3 (1997), 306–313

Citation in format AMSBIB
\Bibitem{Vol97} \by S.~S.~Volosivets \paper Approximation of functions of bounded $p$-variation by polynomials in terms of the Faber--Schauder system \jour Mat. Zametki \yr 1997 \vol 62 \issue 3 \pages 363--371 \mathnet{http://mi.mathnet.ru/mz1618} \crossref{https://doi.org/10.4213/mzm1618} \mathscinet{http://www.ams.org/mathscinet-getitem?mr=1620058} \zmath{https://zbmath.org/?q=an:0923.41009} \transl \jour Math. Notes \yr 1997 \vol 62 \issue 3 \pages 306--313 \crossref{https://doi.org/10.1007/BF02360871} \isi{http://gateway.isiknowledge.com/gateway/Gateway.cgi?GWVersion=2&SrcApp=PARTNER_APP&SrcAuth=LinksAMR&DestLinkType=FullRecord&DestApp=ALL_WOS&KeyUT=000072500900005}


text:
## Electronic Journal of Statistics

### Clustering and variable selection for categorical multivariate data

#### Abstract

This article investigates unsupervised classification techniques for categorical multivariate data. The study employs multivariate multinomial mixture modeling, which is a type of model particularly applicable to multilocus genotypic data. A model selection procedure is used to simultaneously select the number of components and the relevant variables. A non-asymptotic oracle inequality is obtained, leading to the proposal of a new penalized maximum likelihood criterion. The selected model proves to be asymptotically consistent under weak assumptions on the true probability underlying the observations. The main theoretical result obtained in this study suggests a penalty function defined to within a multiplicative parameter. In practice, the data-driven calibration of the penalty function is made possible by slope heuristics. Based on simulated data, this procedure is found to improve the performance of the selection procedure with respect to classical criteria such as $\mathbf{BIC}$ and $\mathbf{AIC}$. The new criterion provides an answer to the question “Which criterion for which sample size?” Examples of real dataset applications are also provided.

#### Article information

Source
Electron. J. Statist., Volume 7 (2013), 2344-2371.

Dates
First available in Project Euclid: 19 September 2013

https://projecteuclid.org/euclid.ejs/1379596773

Digital Object Identifier
doi:10.1214/13-EJS844

Mathematical Reviews number (MathSciNet)
MR3108816

Zentralblatt MATH identifier
1349.62259

#### Citation

Bontemps, Dominique; Toussile, Wilson. Clustering and variable selection for categorical multivariate data. Electron. J. Statist. 7 (2013), 2344--2371. doi:10.1214/13-EJS844. https://projecteuclid.org/euclid.ejs/1379596773

#### References

• Arlot, S. and Massart, P. (2009). Data-driven calibration of penalties for least-squares regression., J. Mach. Learn. Res. 10 245–279.
• Asuncion, A. and Newman, D. J. (2007). UCI Machine Learning, Repository.
• Bai, Z., Rao, C. R. and Wu, Y. (1999). Model selection with data-oriented penalty., J. Statist. Plann. Inference 77 102–117.
• Biernacki, C., Celeux, G. and Govaert, G. (2000). Assessing a mixture model for clustering with the integrated completed likelihood., IEEE Trans. Pattern Anal. 22 719–725.
• Birgé, L. and Massart, P. (2007). Minimal penalties for Gaussian model selection., Probab. Theory Related Fields 138 33–73.
• Celeux, G. and Govaert, G. (1991). Clustering criteria for discrete data and latent class models., J. Classif. 8 157–176.
• Celeux, G., Hurn, M. and Robert, C. P. (2000). Computational and inferential difficulties with mixture posterior distributions., J. Am. Stat. Assoc. 95 957–970.
• Chen, C., Forbes, F. and Francois, O. (2006). Fastruct: Model-based clustering made faster., Molecular Ecology Notes 6 980–983.
• Collins, L. M. and Lanza, S. T. (2010)., Latent Class and Latent Transition Analysis: With Applications in the Social, Behavioral, and Health Sciences. Wiley Series in Probability and Statistics. Wiley.
• Corander, J., Marttinen, P., Sirén, J. and Tang, J. (2008). Enhanced Bayesian modelling in BAPS software for learning genetic structures of populations., BMC Bioinformatics 9 539.
• Dempster, A. P., Lairdsand, N. M. and Rubin, D. B. (1977). Maximum likelihood from incomplete data via the EM algorithm., J. Royal Statist. Soc. Series B 39 1–38.
• Genoveve, C. R. and Wasserman, L. (2000). Rates of convergence for the Gaussian mixture sieve., Ann. Statist. 28 1105–1127.
• Goodman, L. A. (1974). Exploratory latent structure analysis using both identifiable and unidentifiable models., Biometrika 61 215–231.
• Latch, E. K., Dharmarajan, G., Glaubitz, J. C. and Rhodes, O. E. Jr. (2006). Relative performance of Bayesian clustering software for inferring population substructure and individual assignment at low levels of population differentiation., Conservation Genetics 7 295.
• Lebarbier, É. (2002). Quelques approches pour la détection de rupture à horizon fini PhD thesis, Univ Paris-Sud, F-91405, Orsay.
• Massart, P. (2007)., Concentration inequalities and model selection. Lecture Notes in Mathematics 1896. Springer-Verlag, Berlin.
• Maugis, C. and Michel, B. (2011a). A non asymptotic penalized criterion for Gaussian mixture model selection., ESAIM: P&S 15 41–68.
• Maugis, C. and Michel, B. (2011b). Data-driven penalty calibration: A case study for Gaussian mixture model selection., ESAIM: P&S 15 320–339.
• McCutcheon, A. L. (1987)., Latent Class Analysis. Quantitative Applications in the Social Sciences 64. Sage Publications, Thousand Oaks, California.
• McLachlan, G. and Peel, D. (2000)., Finite Mixture Models. Wiley Series in Probability and Statistics. Wiley.
• Nadif, M. and Govaert, G. (1998). Clustering for binary data and mixture models – choice of the model., Appl. Stoch. Models Data Anal. 13 269–278.
• Pritchard, J. K., Stephens, M. and Donnelly, P. (2000). Inference of population structure using multilocus genotype data., Genetics 155 945–59.
• Rigouste, L., Cappé, O. and Yvon, F. (2006). Inference and evaluation of the multinomial mixture model for text clustering., Inform. Process. Manag. 43 1260–1280.
• Rosenberg, N. A., Burke, T., Elo, K., Feldman, M. W., Freidlin, P. J., Groenen, M. A. M., Hillel, J., Ma, A., Vignal, A., Wimmers, K. and Weigend, S. (2001). Empirical evaluation of genetic clustering methods using multilocus genotypes from 20 chicken breeds., Biotechnology.
• Toussile, W. and Gassiat, E. (2009). Variable selection in model-based clustering using multilocus genotype data., Adv. Data Anal. Classif. 3 109–134.
• Verzelen, N. (2009). Adaptative estimation to regular Gaussian Markov random fields PhD thesis, Univ, Paris-Sud.
• Villers, F. (2007). Tests et selection de modèles pour l’analyse de données protéomiques et transcriptomiques PhD thesis, Univ, Paris-Sud.


text:
Differential Equations and Linear Algebra, 2.7: Laplace Transform: First Order Equation

From the series: Differential Equations and Linear Algebra


text:
Tag Info

5

Well this goes to show that Fourier series is just approximation that gets more and more correct when you add more harmonics. Take a look at this: $\dfrac{4\sin\theta}{\pi}$ is just first harmonic. Harmonics are integer multiple of base frequency as you can see: $\sin3\theta$, $\sin5\theta$ etc. And the more of them you add to the first harmonic the more ...

1

The second term can be expanded to \begin{align} 2|a_k|\left(\frac{ e^{i(2\pi f_k t+\angle a_k)} + e^{-i(2\pi f_k t+\angle a_k)}}{2}\right) &= |a_k|e^{i\angle a_k}e^{i(2\pi f_k t)}+|a_k|e^{-i\angle a_k}e^{-i(2\pi f_k t)} \\ &= a_k e^{i(2\pi f_k t)}+a_k^*e^{-i(2\pi f_k t)} \\ \end{align} Since $a_k=|a_k|e^{i\angle a_k}$ and $a_k^*=|a_k|e^{-i\... 2 Simple: Euler's formula: $$e^{i\theta} = \cos(\theta) + i \sin(\theta)$$ and $$e^{-i\theta} = \cos(\theta) - i \sin(\theta)$$ Add them together: $$e^{i\theta} + e^{-i\theta} = 2 \cos(\theta)$$ You should see that in your equation. From there it is usually stated: $$\cos(\theta) = \frac{ e^{i\theta} + e^{-i\theta}}{ 2 }$$ See my article The ... 1 The magnitude response of both the sine and the cosine waves are the same . The difference is in the phase response. The extra j term in the definition of the FT of sine introduces the$\pi/2$in the phase response and since there is a minus sign between the two delta functions of the FT of the sine wave ($j*pi*(\delta(\omega+\omega0)-\delta(\omega-\omega0))$... 1 The assumption you made is that sum of 2 complex exponentials with opposite phase is always$sin$. That is not true.$x(t) = 4 + 4 e^{j\omega_0 4t + \pi /2} + 4e^{-j\omega_0 4t -\pi /2} + 2e^{j\omega_0 3 t + \pi /2} + 2e^{-j\omega_0 3 t +\pi /2} = 4 + 8cos(4\omega_0 t+\pi /2) + 4cos(3\omega_0t -\pi/2)$. 1 The video could've stopped at the answer:$x(t)=4+ 2e^{j(3\omega t + \pi /2)} + 4e^{j(4\omega t - \pi /2)} + 2e^{-j(3\omega t + \pi /2)} + 4e^{-j(4\omega t - \pi /2)}$And this answer can be read directly from the plots. The idea is that the$n^{th}$term in the sum is equal to$|C_n|e^{j(n\omega t+\angle C_n)}. You get this from the Fourier series ... 2 Let me put a practical answer with the following Matlab / Octave Code : L = 2*1000; % signal sample count n = 0:L-1; % discrete-time index Fs = 44100; % sampling frequency am = [1, 0.5, 2, 0.5, 0.3, 0.6, 0.1, 0.2]; % magnitudes of 8 components fm = [882, 2646, 4410, 6615, 8820, 10000, 13230, 15876]; % frequencies % Time domain ... 0 If you have a periodic signal, that is a repeating waveform, you can most easily find the constituent component parameters by aligning the Discrete Fourier Transform (DFT) frame on a whole number of cycles. Suppose you chose four. Then bins 0, 4, 8, 12, etc. contain the relevant values. For a signal: $$x[n] = A \cos( \omega n + \phi )$$ If\$ \omega =...

Top 50 recent answers are included


text:
bandwidth.nrd

0th

Percentile

A well-supported rule-of-thumb for choosing the bandwidth of a Gaussian kernel density estimator.

Keywords
dplot
Usage
bandwidth.nrd(x)
x
A data vector.
Value

A bandwidth on a scale suitable for the width argument of density.

References

Venables, W. N. and Ripley, B. D. (2002) Modern Applied Statistics with S. Springer, equation (5.5) on page 130.

Aliases
• bandwidth.nrd
Examples
library(MASS) # The function is currently defined as function(x) { r <- quantile(x, c(0.25, 0.75)) h <- (r[2] - r[1])/1.34 4 * 1.06 * min(sqrt(var(x)), h) * length(x)^(-1/5) }
Documentation reproduced from package MASS, version 7.3-47, License: GPL-2 | GPL-3

Community examples

Looks like there are no examples yet.


text:
# Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 14235 - Template misses its parameter when containing a link with "=" character in the URL
 Summary: Template misses its parameter when containing a link with "=" character in th...
 Status: Product: REOPENED MediaWiki Unclassified Component: Templates (Other open bugs) unspecified All All Low enhancement with 3 votes (vote) --- Nobody - You can work on this! (view as bug list) Show dependency tree / graph

 Reported: 2008-05-23 12:24 UTC by Huji 2014-09-06 17:12 UTC (History) 18 users (show) admin ayg b charlottethewebb D.U.Thibault darklama gtisza happy.melon.wiki jackmcbarn+wmbz lists M8R-cyc3n3 mail mediawiki-bugs pashev.igor Platonides ricordisamoa roan.kattouw tstarling --- --- ---

Attachments

 Huji 2008-05-23 12:24:18 UTC See http://test.wikipedia.org/wiki/Template:Warn/tests and its source. It appears that when the parameter contains a link with "=" character in its URL, the parmater is totally missed! However, if "1=" is added to the beginning of the parameter to make the template understand it, things are better. Roan Kattouw 2008-05-23 17:30:46 UTC This is an elementary lesson about templates: if one of your numbered parameters contains an =, you need to explicitly use 1= (or 2= or whatever). This is not a bug, because there's no real reason there couldn't be a variable called {{{your edit [http://localhost/index.php?diff}}} in that template; in fact, add that code to your template and you'll see that it'll actually expand to " here] is vandalism" just like it should. Huji 2008-05-24 19:29:43 UTC Thanks Roan, but I think the whole point of this bug is that we should have a way to prevent this. For example, we can disallow parameter names to contain "http://" (etc). With all due respect, I think you went to fast towards closing this bug; I'm reopening it, seeking more comments from other experienced devs. Roan Kattouw 2008-05-24 19:32:11 UTC Why should we? There's a workaround and it's easy. Recommending WONTFIX to your suggestion. Brion Vibber 2008-08-07 18:13:02 UTC *** Bug 15069 has been marked as a duplicate of this bug. *** A R 2008-08-07 19:24:46 UTC I agree with Roan. Saying that a parameter can never begin with "http://" may make using url addresses in implied numbered parameters more intuitive, but it would reduce the maximum functionality one could acheive with a template. The existing solution is not that difficult, as Roan explains, just not well known. Brion Vibber 2008-08-07 19:58:11 UTC Honestly I can't think of much reason for a named parameter to have a name starting with "http://" :) It is however potentially a bit open-ended with other protocols and various arbitrary text which might contain a url or HTML fragment at some point in it, however. A sensible thing might be to just pick an actual format for what parameter names can be... Max Semenik 2008-08-07 20:04:23 UTC (In reply to comment #6) > Honestly I can't think of much reason for a named parameter to have a name > starting with "http://" :) Not only start from 'http://' - URL with '=' in any place of an anonymous parameter will break it. > A sensible thing might be to just pick an actual format for what parameter > names can be... As I proposed on IRC, certain chars or their combinations could be banned. '?' or '://' come into mind. Also, parameter name length could be limited to a sane number, say, 64. Daniel Friesen 2008-08-07 21:29:04 UTC Making a blacklist of things that a key cannot be is IMHO a extremely poor method of solving this issue. Blacklisting things just slowly adds more cruft into the parser, testing for random things, which really shouldn't be tested for. The reason this issue came up is use like so: -------------------- {{foo|http://www.example.com/?foo=bar}} ----Template:Foo---- {{bar|{{{1}}}}} -------------------- The issue here is NOT that "url syntax should not be considered a parameter name", trying to /solve/ the issue as if that were the problem is just bypassing the real issue with a shitty hack. The real issue here is in this: {{bar|{{{1}}}}} Take this other use: {{foo|1=foo=bar}} This will expand to: {{bar|foo=bar}} Which will expand Template:Bar with bar in {{{foo}}}. This is bad. You should not be able to specify the name of a parameter to pass inside of the template in this way. This is what leads to unexpected things happening, and leads to people using poor parser hacks that later cause regressions when people fix the issue. The correct thing to fix here, is not blacklisting of possible keys. It is that the preprocessor should not expand variables like {{{1}}} before it searches for the =. That should be done AFTER. Just as it is with any strict language. Roan Kattouw 2008-08-07 22:24:15 UTC (In reply to comment #8) > This is bad. You should not be able to specify the name of a parameter to pass > inside of the template in this way. This is what leads to unexpected things > happening, and leads to people using poor parser hacks that later cause > regressions when people fix the issue. > > The correct thing to fix here, is not blacklisting of possible keys. It is that > the preprocessor should not expand variables like {{{1}}} before it searches > for the =. That should be done AFTER. Just as it is with any strict language. > So you're basically suggesting to break all named parameters? Remember there are quite a few cases where {{template|foo=bar}} is quite legitimate. Or maybe we should stop skipping named parameters in the numbered parameters count? That would make {{template|foo=bar|baz}} behave like {{{foo}}}=bar, {{{1}}}=foo=bar and {{{2}}}=baz rather than {{{foo}}}=bar and {{{1}}}=baz (which is the current behavior). Aryeh Gregor (not reading bugmail, please e-mail directly) 2008-08-07 22:45:02 UTC (In reply to comment #8) > Making a blacklist of things that a key cannot be is IMHO a extremely poor > method of solving this issue. However, requiring a specific format isn't *necessarily* a bad idea. For instance, we could prohibit all ASCII punctuation characters except whitespace/underscore/hyphen, like: ~!@#$%^&*()+=[]\;',./{}|:"<>? As well as newlines, if those aren't already verboten. This would be more consistent and comprehensible. We would then have no problems with URLs, because the bit before the = sign wouldn't be valid, and the same would probably be true for some other cases. Banning *just* URLs is a poor way to go about this, certainly. Unfortunately, we're stuck with lousy MediaWiki error reporting here. In a real language this would be sensible because you would raise a syntax error if an invalid identifier were used. Here the template would just mysteriously not work, if for some reason someone uses a parameter with a weird name. It's kind of a lose-lose scenario. (So how about sandboxed Python again? :) ) (In reply to comment #9) > Or maybe > we should stop skipping named parameters in the numbered parameters count? That > would make {{template|foo=bar|baz}} behave like {{{foo}}}=bar, {{{1}}}=foo=bar > and {{{2}}}=baz rather than {{{foo}}}=bar and {{{1}}}=baz (which is the current > behavior). In addition to breaking like all templates ever, this makes the ordering of named and unnamed parameters significant: {{template|foo=bar|baz}} is different from {{template|baz|foo=bar}}. I don't think that's expected. It does have a certain appeal, but it replaces an obscure gotcha with a very non-obscure one. Basically you couldn't mix numbered and named parameters in a template, which is a pretty major restriction compared to present. Tim Starling 2008-08-08 10:04:34 UTC (In reply to comment #8) > The correct thing to fix here, is not blacklisting of possible keys. It is that > the preprocessor should not expand variables like {{{1}}} before it searches > for the =. That should be done AFTER. Just as it is with any strict language. What are you talking about? It *is* done after. You can't uncover a name/value separator in MW 1.12+.  Daniel Friesen 2008-08-08 14:17:48 UTC (In reply to comment #9) > (In reply to comment #8) > > This is bad. You should not be able to specify the name of a parameter to pass > > inside of the template in this way. This is what leads to unexpected things > > happening, and leads to people using poor parser hacks that later cause > > regressions when people fix the issue. > > > > The correct thing to fix here, is not blacklisting of possible keys. It is that > > the preprocessor should not expand variables like {{{1}}} before it searches > > for the =. That should be done AFTER. Just as it is with any strict language. > > > > So you're basically suggesting to break all named parameters? Remember there > are quite a few cases where {{template|foo=bar}} is quite legitimate. Or maybe > we should stop skipping named parameters in the numbered parameters count? That > would make {{template|foo=bar|baz}} behave like {{{foo}}}=bar, {{{1}}}=foo=bar > and {{{2}}}=baz rather than {{{foo}}}=bar and {{{1}}}=baz (which is the current > behavior). > I think you're misreading what I meant. My notes weren't for the use of: {{Foo|http://example.com/?foo=bar}} There you do explicitly know that there is a = inside of there and you are going to need to use a 1= to escape it. Mine was about the use like: {{Foo|1=http://example.com/?foo=bar}} Where Foo contains: {{Bar|{{{1}}}}} However, doing some tests and it appears that the parser does actually act as I'd expect. I read the bug and it appeared as if the reporter was saying that something inside of a template was being expanded wrong. So since things aren't being expanded wrong as I expected, and the reporter actually appears merely discontent with the age old requirement of "if your parameter uses a =, prepend it with the param number" then I recommend WONTFIX as well. (In reply to comment #10) > (In reply to comment #8) > > Making a blacklist of things that a key cannot be is IMHO a extremely poor > > method of solving this issue. > > However, requiring a specific format isn't *necessarily* a bad idea. For > instance, we could prohibit all ASCII punctuation characters except > whitespace/underscore/hyphen, like: > > ~!@#$%^&*()+=[]\;',./{}|:"<>? > > As well as newlines, if those aren't already verboten. This would be more > consistent and comprehensible. We would then have no problems with URLs, > because the bit before the = sign wouldn't be valid, and the same would > probably be true for some other cases. Banning *just* URLs is a poor way to go > about this, certainly. > > Unfortunately, we're stuck with lousy MediaWiki error reporting here. In a > real language this would be sensible because you would raise a syntax error if > an invalid identifier were used. Here the template would just mysteriously not > work, if for some reason someone uses a parameter with a weird name. It's kind > of a lose-lose scenario. (So how about sandboxed Python again? :) ) > Blacklisting those characters is something you really need to be careful about. Believe it or not, but people DO name parameters using many of those characters. Some wiki prefer human readable parameters over key like parameters. Characters like &/!@+(), are used sometimes as they would be when writing, especially in infoboxes where it makes things a bit more readable. {{Infobox/Character | Name (English) = | Name (Kanji) = | Name (Romanji) = | Birthdate = | Species & Gender = | Birth/Death Date = }} That's just a very rough and fictional example. But it is highly possible that people are already relying on the fact that they can include characters like / and & in parameter names in the same way they would normal text. Same goes for punctuation characters. And as for, : think about the wiki on things like C or another language where they may use : as a visual separator to create a bit of a hierarchy. With those likely use cases I fail to see what characters we can blacklist to prevent urls from being treated as keys without causing a regression on some wiki that causes them to need to alter a number of their templates, and change the use of those templates on a large number of pages. Actually, rather than restricting of the key. I'd like to see some way to escape the current numeric parameter without needing to know exactly what numeric parameter is next. {{Foo|foo|bar|=Foo=Bar}} Aryeh Gregor (not reading bugmail, please e-mail directly) 2008-08-08 14:32:44 UTC (In reply to comment #12) > Blacklisting those characters is something you really need to be careful about. > Believe it or not, but people DO name parameters using many of those > characters. Some wiki prefer human readable parameters over key like > parameters. Characters like &/!@+(), are used sometimes as they would be when > writing, especially in infoboxes where it makes things a bit more readable. Yeah, good point. *Probably* no one's using question marks, but that's a little narrow . . . > Actually, rather than restricting of the key. I'd like to see some way to > escape the current numeric parameter without needing to know exactly what > numeric parameter is next. > {{Foo|foo|bar|=Foo=Bar}} That's a sensible idea. Then people could adopt the convention of using |= to delimit numbered parameters, instead of just |, and the problem wouldn't arise in the first place. If we weren't too concerned with BC, we might even enforce it at some point In the Distant Future. For now, as a matter of template design, it would be an excellent idea to use only named parameters for things that might plausibly be URLs. That would entirely avoid the specific issue brought up in this bug. Daniel Friesen 2008-08-08 14:44:35 UTC (In reply to comment #13) > (In reply to comment #12) > > Blacklisting those characters is something you really need to be careful about. > > Believe it or not, but people DO name parameters using many of those > > characters. Some wiki prefer human readable parameters over key like > > parameters. Characters like &/!@+(), are used sometimes as they would be when > > writing, especially in infoboxes where it makes things a bit more readable. > > Yeah, good point. *Probably* no one's using question marks, but that's a > little narrow . . . > Perhaps, ;) unless you consider sentences. FWIW templates are sometimes used in say, surveys. {{Survey/August 2008 | What type of bugs do you prefer claiming on bugzilla? = | Do you prefer using http://bugzilla.wikimedia.org or http://bugs.wikimedia.org to access the site? = | Have you ever reported a bug with yourself already assigned to it? = | If so, for what reason did you decide to do this? = }} ^_^ Oh the evil things we do with WikiText. > > Actually, rather than restricting of the key. I'd like to see some way to > > escape the current numeric parameter without needing to know exactly what > > numeric parameter is next. > > {{Foo|foo|bar|=Foo=Bar}} > > That's a sensible idea. Then people could adopt the convention of using |= to > delimit numbered parameters, instead of just |, and the problem wouldn't arise > in the first place. If we weren't too concerned with BC, we might even enforce > it at some point In the Distant Future. > > For now, as a matter of template design, it would be an excellent idea to use > only named parameters for things that might plausibly be URLs. That would > entirely avoid the specific issue brought up in this bug. > Yes, named parameters are the best way to avoid any issues with the =. The tricky thing is {{{}}} actually does contain the value of |=, I have no clue if anyone is actually making use of that. Though, there are probably less people using {{{}}} than there are using {{{#}}} so it is probably the best option. And that idea of using = at the start to escape does fit in line with some other languages. darklama 2008-08-08 15:00:09 UTC What about first checking for uses of {{{name}}} in templates and if a named parameter is passed which doesn't exist in the template it is treated as if it were a numbered argument? Template:Foo: -------------- {{{first}}} {{{1}}}} -------------- So that given {{foo|first=John|bar=Doe}} it would make {{{first}}}=John and {{{1}}}=bar=Doe, since bar isn't a named parameter in the template. Aryeh Gregor (not reading bugmail, please e-mail directly) 2008-08-08 15:05:09 UTC That's more or less what Roan suggested in comment #9. See my response to that. If it's not clear, consider if Template:Foo were "{{{1}}} {{{first}}}" instead, and you use {{foo|first=John|bar=Doe}}. The parser reaches {{{1}}} and . . . what does it do? It doesn't necessarily know yet if there's going to be any {{{bar}}} or {{{first}}} later on. Even if it did, and I don't know if that's feasible, this would mean that parameter behavior would be very non-localized. Adding a new named parameter anywhere could change the interpretation of numeric parameters in an entirely different part of the template. It might be doable, but it seems pretty scary. Daniel Friesen 2008-08-08 15:15:28 UTC Well... Firstly, that requires complex parsing of the template beforehand. Secondly, it causes an inconsistency in what happens with templates and makes things harder to debug. Thirdly, there is nothing saying that an extension can't insert a variable call on it's own in a way we can't check for it's existence. {{#default:foo|''default''}} Could expand itself to something like: {{#if:{{{foo|}}}|{{{foo}}}|''default''}} Or even, it could just expand the first parameter on it's own and never let the {{{foo|}}} it tests show up in the page. Just as a shorthand to make syntax easier. Those kind of things can never be tested for. In fact, what about this {{{ {{{1}}} }}} It's perfectly valid syntax: {{Foo|foo|foo=bar}} From what I remember that should expand into {{{ foo }}} and then expand into 'bar'. There is no feasible way to test if a variable appears inside of a template or not. On the contrary, one of the things I'd like is for parserfunctions to be able to access the variable list of a parent template. That way a complex extension can make a number of useful things possible, and more efficient. That'll never happen if things get insanely limited in the way you note. Tisza Gergő 2009-10-31 21:08:48 UTC Disallowing parameter names starting with http:// would break compatibility with template hacks which check for the http://wiki.domain/w/index.php?title parameter to see if they are dealing with a page name or a diff link. It would be a better solution to allow templates to give an exhaustive list of the parameters they except (this will be done for a lot of templates anyway to support the new usability features), and unexpected template names could be handled as unnamed parameters. P.Copp 2009-11-26 03:23:16 UTC *** Bug 5138 has been marked as a duplicate of this bug. *** darklama 2011-01-15 12:33:19 UTC (In reply to comment #18) > ... unexpected template [parameter] names could be handled as unnamed parameters. This seems like a sane and simple solution to me. Than given template A: Hello {{{name}}} {{{1}}}! Given template call: {{A|name=MediaWiki|foobar=World}} Render as: Hello MediaWiki World! Thana 2011-01-15 19:58:59 UTC remember that the offending use case involves a string meant to appear in "=", something like: > {{A|http://domain.lol/some.cgi?time=money}} so for this to be helpful where it matters the new template behavior must take "foobar=World" in its entirety as the first unnamed parameter {{{1}}} if/when the template contains no references to parameter {{{foobar}}}. so the output would have to be: > Hello MediaWiki foobar=World! ------------------------------------------ one thing i noticed, wiki-links are special in this regard: > {{A|[[Foobar=World|Example link 1]]}} here the entire link is interpreted as parameter {{{1}}}. but external links are not: > {{A|[http://domain.lol/?Foobar=World Example link 2]}} this input is interpreted as one parameter named > [http://domain.lol/?Foobar= with value > World Example link 2] seems like the easiest thing would be to make both cases "special" and (beyond consideration as part of a parameter name). Thana 2011-01-15 20:02:45 UTC (In reply to comment #21) > meant to appear in "=", should have read: > meant to appear in spite of containing "=" darklama 2011-01-16 14:53:15 UTC (In reply to comment #21) > would have to be: > Hello MediaWiki foobar=World! I didn't think that through enough. You are right. Either behavior could be useful though. If implemented the way I had suggested, using named parameters that don't exist could be a used as aliases for unnamed parameters without having to include them directly. While your correction would give the expected behavior. > seems like the easiest thing would be to make both > cases [internal and external links] "special". > (beyond consideration as part of a parameter name). That could work too. I think = inside tags should be a special case too then. Use of custom signatures seems to be the common case where I have seen a problem with this. {{A|[[User:Foobar]]}} Implementing no parameter by that name, include the whole thing as a unnamed parameter approach would mean special cases would no longer be needed though. Platonides 2011-01-16 17:35:49 UTC (In reply to comment #21) > one thing i noticed, wiki-links are special in this regard: > > {{A|[[Foobar=World|Example link 1]]}} > here the entire link is interpreted as parameter {{{1}}}. > > but external links are not: > > {{A|[http://domain.lol/?Foobar=World Example link 2]}} > this input is interpreted as one parameter named > > [http://domain.lol/?Foobar= > with value > > World Example link 2] > > seems like the easiest thing would be to make both cases "special" and (beyond > consideration as part of a parameter name). That's easily doable by adding a new preprocessor rule for one [. However, it would change the AST of hundreds of templates, and still not fix the basic problem: {{A|http://domain.lol/?Foobar=World}}. > > {{A|http://domain.lol/some.cgi?time=money}} > > so for this to be helpful where it matters the new template behavior must take > "foobar=World" in its entirety as the first unnamed parameter {{{1}}} if/when > the template contains no references to parameter {{{foobar}}}. That's the same as proposed in comment #15. I'm sympathetic with the idea of a potential {{{ {{{1}}} }}} breaking change, since wikitext is not a programming language, and dereferencing goes quite too far. An efficient list of all the of that would mean bumping the preprocessor version to additionally generate a list with used parameters, not only to avoid the O(n) search of parameters, but also so that expanding just a subnode is easier. It'd be much easier to make numeric parameters indexes absolute (cf Roan comment #9) but the huge template breakage prevents it. Thana 2011-01-18 04:24:59 UTC (In reply to comment #24) > That's easily doable by adding a new preprocessor rule for one [. > However, it would change the AST of hundreds of templates, and still not fix > the basic problem: {{A|http://domain.lol/?Foobar=World}}. yeah but splitting a bare url like this one: > {{A|http://domain.lol/?Foo=Bar}} or a page title like this one > {{A|Foo=Bar}} ...is still more expectable (i.e. less astonishing) than splitting a long-form external link syntax like this one: > {{A|[http://domain.lol/?Foo=Bar http://domain.lol/?Foo=Bar]}} but not splitting a long-form internal link syntax like this one: > {{A|[[Foo=Bar|Foo=Bar]]}} the first examples must be interpreted as plain text so that links may be formed of them inside the template (even though the first renders identically to the third in isolation). however i see no reason not to consider both the third and fourth as fully-formed links. disallowing certain punctuation in parameter names is a great shoulda-thought- about-that-earlier idea, but is independent of the disparity between internal- and external-style links in the effective order of syntax precedence. perhaps the latter issue ought to be raised on a separate ticket. Platonides 2011-03-07 23:07:27 UTC You may find it more logical taking into account images: {{A| [[File:example.jpg|link=http://www.example.org|E=mc²]] }} P.Copp 2011-03-26 15:38:02 UTC *** Bug 28252 has been marked as a duplicate of this bug. *** Tim Starling 2011-03-30 03:44:31 UTC I understand from comment 2 that this is a feature request, not a bug report. Altering severity. Christian Kujau 2011-04-18 16:38:52 UTC AIUI, it's a request for the template feature to not to be buggy :-) If we cannot put a certain character in a template, we should admit that it's a shortcoming and (if it cannot be fixed) issue some kind of warning when editing templates. Dunno if "altering severities" does any good 3 years after the bug was reported. Happy-melon 2011-04-18 18:50:59 UTC People understand perfectly well what the equals character does in templaes when they are consciously thinking about it, in exactly the same way as they recognise that | and } are characters with special meaning in the same context. The fact that some people do not consciously think of the equals sign in {{t|foo=bar}} and {{t|http://eg.com/foo=bar}} as the same character with the same special meaning is a bug in their thought processes, not in our parser. It's certainly a shortcoming we can add a feature to work around, but it's an enhancement, not a bugfix. Huji 2011-04-18 18:57:41 UTC (In reply to comment #30) > The fact that some people do not consciously think of the equals sign in > {{t|foo=bar}} and {{t|http://eg.com/foo=bar}} as the same character with the > same special meaning is a bug in their thought processes, not in our parser. It depends on how you view the problem. A different approach is to think that the parser should be accommodated with the common though processes of users, so for example, if two = signs are found within the context of one parameter. However, as the person reporting this bug originally, I think there's no definite solution to this problem. One might say we should modify the parser to not treat = signs as parameter assignment operators, if they are preceded by http:// (or other URI schemes), which is what I thought at the time of submitting this bug; another person may say this will disable us from having template parameters whose names start with http:// (although I can't think how this can be useful). So, again, as the person who originally opened this bug report, I'm totally fine with Tim's alteration of severity, and I even think this can be marked as a WONTFIX again. Platonides 2011-04-18 20:09:22 UTC It's something to take into account if/when we do a graphical template inserter. We shouldn't make grammar for this case. I encourage instead template authors to use named parameters for urls, which avoids the unexpected outcome when using the shorthand. {{foo|url=http://example.com/foo?bar=baz}} Tisza Gergő 2011-04-18 20:12:26 UTC (In reply to comment #31) > another person may say this will disable us from having > template parameters whose names start with http:// (although I can't think how > this can be useful). See comment 18 for a use case (which is common on hu.wikipedia, for example). Ricordisamoa 2014-03-16 21:27:11 UTC WONTFIX Christian Kujau 2014-03-20 06:29:41 UTC Ricordisamoa, can you please elaborate why you wanted to close this one as WONTFIX? Igor Pashev 2014-09-04 20:06:08 UTC I think I hit this bug with such text: {{foo| hello, world}} This is no synthetic case. If one has MathJax extention installed {{foo|bar}} will be replaced with {{foo|bar}}

 Note You need to log in before you can comment on or make changes to this bug.


text:
# 15.1.1.3.40. TopicDataQosPolicy¶

class TopicDataQosPolicy : public eprosima::fastdds::dds::GenericDataQosPolicy

Class derived from GenericDataQosPolicy.

The purpose of this QoS is to allow the application to attach additional information to the created Topic such that when a remote application discovers their existence it can examine the information and use it in an application-defined way.

In combination with the listeners on the DataReader and DataWriter as well as by means of operations such as ignore_topic,these QoS can assist an application to extend the provided QoS.


text:
## Predicting Migratory Corridors of White Storks, Ciconia ciconia, to Enhance Sustainable Wind Energy Planning : A Data-Driven Agent-Based Model

2018
Oloo, Francis
Aryal, Jagannath
Journal article
Published
##### Published in
Sustainability ; 10 (2018), 5. - 1470. - MDPI. - eISSN 2071-1050
##### Abstract
White storks (Ciconia ciconia) are birds that make annual long-distance migration flights from their breeding grounds in the Northern Hemisphere to the south of Africa. These trips take place in the winter season, when the temperatures in the North fall and food supply drops. White storks, because of their large size, depend on the wind, thermals, and orographic characteristics of the environment in order to minimize their energy expenditure during flight. In particular, the birds adopt a soaring behavior in landscapes where the thermal uplift and orographic updrafts are conducive. By attaining suitable soaring heights, the birds then use the wind characteristics to glide for hundreds of kilometers. It is therefore expected that white storks would prefer landscapes that are characterized by suitable wind and thermal characteristics, which promote the soaring and gliding behaviors. However, these same landscapes are also potential sites for large-scale wind energy generation. In this study, we used the observed data of the white stork movement trajectories to specify a data-driven agent-based model, which simulates flight behavior of the white storks in a dynamic environment. The data on the wind characteristics and thermal uplift are dynamically changed on a daily basis so as to mimic the scenarios that the observed birds experienced during flight. The flight corridors that emerge from the simulated flights are then combined with the predicted surface on the wind energy potential, in order to highlight the potential risk of collision between the migratory white storks and hypothetical wind farms in the locations that are suitable for wind energy developments. This work provides methods that can be adopted to assess the overlap between wind energy potential and migratory corridors of the migration of birds. This can contribute to achieving sustainable trade-offs between wind energy development and conservation of wildlife and, hence, handling the issues of human–wildlife conflicts.
##### Subject (DDC)
570 Biosciences, Biology
##### Keywords
agent-based models; collision risk; data-driven models; sustainability; wind energy
##### Cite This
ISO 690OLOO, Francis, Kamran SAFI, Jagannath ARYAL, 2018. Predicting Migratory Corridors of White Storks, Ciconia ciconia, to Enhance Sustainable Wind Energy Planning : A Data-Driven Agent-Based Model. In: Sustainability. MDPI. 10(5), 1470. eISSN 2071-1050. Available under: doi: 10.3390/su10051470
BibTex
@article{Oloo2018-05-08Predi-51765,
year={2018},
doi={10.3390/su10051470},
title={Predicting Migratory Corridors of White Storks, Ciconia ciconia, to Enhance Sustainable Wind Energy Planning : A Data-Driven Agent-Based Model},
number={5},
volume={10},
journal={Sustainability},
author={Oloo, Francis and Safi, Kamran and Aryal, Jagannath},
note={Article Number: 1470}
}

RDF
<rdf:RDF
xmlns:dcterms="http://purl.org/dc/terms/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:bibo="http://purl.org/ontology/bibo/"
xmlns:dspace="http://digital-repositories.org/ontologies/dspace/0.1.0#"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:void="http://rdfs.org/ns/void#"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#" >
<bibo:uri rdf:resource="https://kops.uni-konstanz.de/handle/123456789/51765"/>
<dc:creator>Oloo, Francis</dc:creator>
<dcterms:available rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2020-11-13T09:40:40Z</dcterms:available>
<dcterms:title>Predicting Migratory Corridors of White Storks, Ciconia ciconia, to Enhance Sustainable Wind Energy Planning : A Data-Driven Agent-Based Model</dcterms:title>
<dc:creator>Aryal, Jagannath</dc:creator>
<foaf:homepage rdf:resource="http://localhost:8080/"/>
<void:sparqlEndpoint rdf:resource="http://localhost/fuseki/dspace/sparql"/>
<dc:date rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2020-11-13T09:40:40Z</dc:date>
<dcterms:issued>2018-05-08</dcterms:issued>
<dc:creator>Safi, Kamran</dc:creator>
<dspace:hasBitstream rdf:resource="https://kops.uni-konstanz.de/bitstream/123456789/51765/3/Oloo_2-1xid65oa49auh5.pdf"/>
<dc:contributor>Oloo, Francis</dc:contributor>
<dcterms:hasPart rdf:resource="https://kops.uni-konstanz.de/bitstream/123456789/51765/3/Oloo_2-1xid65oa49auh5.pdf"/>
<dcterms:isPartOf rdf:resource="https://kops.uni-konstanz.de/server/rdf/resource/123456789/28"/>
<dc:language>eng</dc:language>
<dc:contributor>Aryal, Jagannath</dc:contributor>
<dspace:isPartOfCollection rdf:resource="https://kops.uni-konstanz.de/server/rdf/resource/123456789/28"/>
<dc:contributor>Safi, Kamran</dc:contributor>
<dcterms:abstract xml:lang="eng">White storks (Ciconia ciconia) are birds that make annual long-distance migration flights from their breeding grounds in the Northern Hemisphere to the south of Africa. These trips take place in the winter season, when the temperatures in the North fall and food supply drops. White storks, because of their large size, depend on the wind, thermals, and orographic characteristics of the environment in order to minimize their energy expenditure during flight. In particular, the birds adopt a soaring behavior in landscapes where the thermal uplift and orographic updrafts are conducive. By attaining suitable soaring heights, the birds then use the wind characteristics to glide for hundreds of kilometers. It is therefore expected that white storks would prefer landscapes that are characterized by suitable wind and thermal characteristics, which promote the soaring and gliding behaviors. However, these same landscapes are also potential sites for large-scale wind energy generation. In this study, we used the observed data of the white stork movement trajectories to specify a data-driven agent-based model, which simulates flight behavior of the white storks in a dynamic environment. The data on the wind characteristics and thermal uplift are dynamically changed on a daily basis so as to mimic the scenarios that the observed birds experienced during flight. The flight corridors that emerge from the simulated flights are then combined with the predicted surface on the wind energy potential, in order to highlight the potential risk of collision between the migratory white storks and hypothetical wind farms in the locations that are suitable for wind energy developments. This work provides methods that can be adopted to assess the overlap between wind energy potential and migratory corridors of the migration of birds. This can contribute to achieving sustainable trade-offs between wind energy development and conservation of wildlife and, hence, handling the issues of human–wildlife conflicts.</dcterms:abstract>


text:
# What does it mean when two encrypted files, encrypted with the same method but with different keys, when xor'd together, produce a repeating pattern?

Let's say I have fileA and fileB, both encrypted somehow, but in the same method with different keys.

If I xor them together, they will make a repeating pattern of 32 bytes length.

What does that say about the repeating pattern, the encryption pattern, and the likelihood of the unencrypted files to be identical?

Is there any way to extract the keys used to encrypt them?

Is there a way, other than to open up Ollydbg and try to reverse engineer the decryption procedure?

The program contacts a server, sends a certain unique code, and the server replies back with an md5 hash. Then the server sends back the encrypted file, which is easily decrypted by the program. I want to reverse engineer this program and encryption method.

This is not a homework question, this is a real situation that is tormenting me.

The decrypted plaintext is either Lua source or Lua VM bytecode, with a small possibility of being XML.

Edit: I now realize that the repeating sequence is probably two different MD5 hashes XOR'd with each other. Is there a method to analyze and try to extract the individual MD5 hashes?

• Identifying the cipher is a big step in breaking it. By all means do fire up Olly and have a crack at it. But you will also find the key, and you won't have to do any codebreaking. You can always find one part of the XOR if you know the other, so you should probably XOR the result with the MD5 hashes that you've intercepted – rath Apr 19 '14 at 5:54
• Re close votes: Analyzing / decrypting a block of data for a question that doesn't contain an explicit request to do so isn't a valid close reason. – rath Apr 19 '14 at 5:55

The two plaintexts are almost certainly identical. At the very least, any difference between them must be representable in 32 bytes, since that's as much information as the XOR of the encrypted files contains.

Assuming that the plaintexts are indeed identical, we can also see that changing the encryption key has a very simple and predictable effect on the ciphertext: every 32nd byte is affected the same way. Clearly, this cannot be a semantically secure encryption scheme.

Indeed, the most likely explanation of the phenomenon you observe is that:

1. the two plaintext files are identical, and

2. the encryption simply consists of taking a 32-byte key (or possibly the 32-byte hash of a key) and XORing it with each 32-byte block of the plaintext.

If true, this is a very weak cipher, and it should not be hard to break. A couple of methods to try would be:

• If you can guess some part of the plaintext, you can immediately get the corresponding part of the key by XORing the guessed plaintext with the ciphertext. For example, if the plaintext is XML, there's a good chance it'll begin with something like:

<?xml version="1.0" encoding="utf-8" standalone="no"?>

With a bit of luck, this can reveal the entire key! Similarly, I believe Lua bytecode files should have a more or less fixed header that should also reveal at least part of the key.

• Even if you can't directly guess the plaintext, you can make use of the fact that the key repeats, essentially making the cipher a many-time pad.

One way to attack such a many-time pad is to use crib dragging. Basically, you guess an $n$-byte string that's likely to occur somewhere in the plaintext (such as, say, function in Lua code) and XOR it with each $n$-byte substring of the ciphertext. Each XOR will yield a candidate $n$-byte substring of the key, which you then XOR with the corresponding parts of the ciphertext. If the guess was wrong, you'll mostly get garbage, but if and when you guess right, the decrypted plaintext suddenly starts making sense.

Another way to attack such a cipher is to split the ciphertext into 32-byte blocks, take one of the blocks and XOR all the other with it (which cancels out the key, leaving you with an XOR of the plaintext blocks), print out the XORed blocks as a hex+ASCII dump (as with xxd -c 32) and examine the columns. With the help of an ASCII table, you can infer a lot about the plaintext block you chose to XOR with the others (and thereby about the key).

Alternatively, if you're feeling lazy, you can just download xortool and feed one of the ciphertexts to it. With a bit of luck (and the right options), it'll spit out the key and the plaintext (or at least something close enough for you to finish the job by hand) for you.


text:
# Compact Set in Metric Space

1. ### wayneckm

68
Hello all,

Here is my question while reading a proof.

For a compact set $$K$$ in a separable metrizable spce $$(E,\rho)$$ and a continuous function $$t \mapsto f(t)$$, if we define

$$D_{K} = \inf \{ t \geq 0 \; : \; f(t) \in K \}$$

then, $$D_{K} \leq t$$ if and only if $$\inf\{ \rho(f(q),K) : q \in \mathbb{Q} \cap [0,t] \}$$ = 0

May someone shed some light on this? I do not understand it. Thanks very much.

Wayne

2. ### Landau

905
It's not really clear what the domain and codomain of your function f are.

3. ### wayneckm

68
Domain of $$f$$ is $$\mathbb{R}^{+}$$
Codomain of $$f$$ is $$\mathbb{R}$$

4. ### Landau

905
Huh? Then I don't understand $f(t)\in K$...

5. ### wayneckm

68
Oops...sorry, i misunderstood the term codomain. So codomain here should be $$E$$ as stated.

6. ### Office_Shredder

4,499
Staff Emeritus
If $$D_k \leq t$$ then $$f(D_k)\in K$$. We can approximate $$D_k$$ with rational numbers, and because $$D_k \in [0,t]$$ we can approximate $$D_k$$ with rational numbers in $$\mathbb{Q}\cap [0,t]$$ If $$q_r$$ is such a sequence converging to $$D_k$$, the distance between $$f(q_r)$$ and $$f(D_k)$$ goes to zero, which means the distance between $$f(q_r)$$ and $$K$$ must go to zero. So the infimum of the distance between $$f(q)$$ and $$K$$ for $$q\in \mathbb{Q}\cap [0,t]$$ must be zero because we just found a sequence for which the distance is arbitrarily small.

This is basically the direction $$D_k\leq t$$ implies the infimum is zero.


text:
General solution of differential equation

1. Oct 16, 2007

captainjack2000

1. The question asks me to show that e^x is a solution of xy'' - (2x+1)y' + (x+1)y=0 and find the general solution.

2. I managed to simplify the equation to u''xe^(x) - u'e^(x) = 0 by letting y=ue^(x) and finding the differentials and substituting them in.
I've then let z=u dz/du=u' and d^2z/du^2 = u''
so I get xe^(x)(d^2z/du^2) - e^(x)dz/du = 0
How would I solve this?

2. Oct 16, 2007

kring_c14

use integration by parts

3. Oct 16, 2007

captainjack2000

Sorry but I am still confused;

if xe^(x)(d^2z/du^2) - e^(x)dz/du = 0
can I simplify this to

x(d^2z/du^2) = dz/du

xdz = du
xz = u +c but z = u???
xu = u +c
How does this help find the general solution?

4. Oct 17, 2007

HallsofIvy

Staff Emeritus

You don't solve that! It has two independent variables, u and x. Surely, you don't mean "let z=u dz/du=u' and d^2z/du^2 = u''. If you let z= u, then dz/du= 1. Perhaps you meant "let z= u, dz/dx= u'". But in that case you've gained nothing- you've just renamed u. Much better is "let z= du/dx, dz/dx= d2u/dx2". Then your equation becomes the first order equation xe^(x) z'- e^(x) z= 0. I would be inclined to first divide the entire equation by e^(x)!

5. Apr 30, 2011

doroulla

Hi can someone please help me with: general solution of dy/dx - y = x + 2x^2

i know how to find general solutions but only when i can seperate the y and x in 2 sides and multiply with dx and dy. someone please help me. i have looked in many books

6. Apr 30, 2011

HallsofIvy

Staff Emeritus


text:
Suppose that all the keys in a binary tree are distinct positive integers. A unique binary tree can be determined by a given pair of postorder and inorder traversal sequences, or preorder and inorder traversal sequences. However, if only the postorder and preorder traversal sequences are given, the corresponding tree may no longer be unique.

Now given a pair of postorder and preorder traversal sequences, you are supposed to output the corresponding inorder traversal sequence of the tree. If the tree is not unique, simply output any one of them.

Input Specification:

Each input file contains one test case. For each case, the first line gives a positive integer N (≤ 30), the total number of nodes in the binary tree. The second line gives the preorder sequence and the third line gives the postorder sequence. All the numbers in a line are separated by a space.

Output Specification:

For each test case, first printf in a line Yes if the tree is unique, or No if not. Then print in the next line the inorder traversal sequence of the corresponding binary tree. If the solution is not unique, any answer would do. It is guaranteed that at least one solution exists. All the numbers in a line must be separated by exactly one space, and there must be no extra space at the end of the line.

7
1 2 3 4 6 7 5
2 6 7 4 5 3 1

Yes
2 1 6 4 7 3 5

4
1 2 3 4
2 4 3 1

No
2 1 3 4

解答

#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<vector>

using namespace std;

vector<int> in, pre, post;
bool unique = true;
void getInOrder(int prel, int prer, int postl, int postr) {
if (prel == prer) {
in.push_back(pre[prel]);
return;
}
if (pre[prel] == post[postr]) {
int i = prel + 1;
while (i <= prer && pre[i] != post[postr - 1]) i++;
if (i - prel > 1) getInOrder(prel + 1, i - 1, postl, postl + (i - prel - 1) - 1);
else unique = false;
in.push_back(post[postr]);
getInOrder(i, prer, postl + (i - prel - 1), postr - 1);
}
}

int main()
{
int n;
scanf("%d", &n);
pre.resize(n), post.resize(n);
for (int i = 0; i < n; i++) scanf("%d", &pre[i]);
for (int i = 0; i < n; i++) scanf("%d", &post[i]);
getInOrder(0, n - 1, 0, n - 1);
printf("%s\n%d", unique ? "Yes" : "No", in[0]);
for (int i = 1; i < n; i++) printf(" %d", in[i]);
printf("\n");
return 0;
}


text:
Hi, I'm the here-bot cat!

Here I am:
content/blog/lewis-series/02-spoonful/index.md

To remove me, delete this line inside that file: {{< here >}}

My content section is:
blog
My layout is:
single-series
/blog/lewis-series/02-spoonful/sidebar-inverse.jpg

If $$p_{1}, . . . p_{n}$$ are the propositions whose fictionality a representation generates directly, another proposition, q, is fictional in it if, and only if, were it the case that $$p_{1}, . . . p_{n}$$, it would be the case that q.

$$\frac{\psi^{1}, . . ., \psi^{n}}{\therefore\phi}$$

Where there is a wn between w1-n at which $$\neg\psi\land\phi$$

You might think that there is no reason to think that Sherlock Holmes has 105 number of hairs on his head anywhere in the set $$\psi_{1-n}$$ but if this is true, then it does not answer those cases where:

• Holmes lived on Baker Street (which is not nearer Paddington Station than it is Waterloo Station in the actual world w0)
• Holmes lived nearer to Paddington Station than Waterloo Station
• Holmes was just a person—a person of flesh and blood (Not person of flesh and blood at w0)
• Holmes really existed (doesn’t exist?)

The interpreter of the fiction is to ask: “what the real world would be like if the propositions (as a whole within fiction) whose fictionality is generated directly were true: What else would be true if they were?”

We can possibly amend this problem by prefixing an operator; say “In the fiction f . . .”, to each premiss and to the conclusion of the original arguments.

$$\frac{In f, \psi^{1}, . . ., In f, \psi^{n}}{\therefore In f, \phi}$$


text:
#### Vol. 312, No. 1, 2021

 Download this article For screen For printing
 Recent Issues Vol. 314: 1  2 Vol. 313: 1  2 Vol. 312: 1  2 Vol. 311: 1  2 Vol. 310: 1  2 Vol. 309: 1  2 Vol. 308: 1  2 Vol. 307: 1  2 Online Archive Volume: Issue:
 The Journal Subscriptions Editorial Board Officers Contacts Submission Guidelines Submission Form Policies for Authors ISSN: 1945-5844 (e-only) ISSN: 0030-8730 (print) Special Issues Author Index To Appear Other MSP Journals
Derived decompositions of abelian categories I

### Hongxing Chen and Changchang Xi

Vol. 312 (2021), No. 1, 41–74
##### Abstract

Derived decompositions of abelian categories are introduced in internal terms of abelian subcategories. They are used to construct semiorthogonal decompositions (or in other terminology, Bousfield localizations, or hereditary torsion pairs) in derived categories of abelian categories. A sufficient condition is given for abelian categories to have derived decompositions. This is necessary if abelian categories have enough projectives and injectives. Applications are given to homological ring epimorphisms, localizing subcategories, nonsingular rings and commutative noetherian rings. Moreover, a derived stratification of module categories over commutative noetherian rings of Krull dimension at most $1$ is presented.

##### Keywords
Abelian category, commutative noetherian ring, derived decomposition, localizing subcategory, semiorthogonal decomposition
##### Mathematical Subject Classification
Primary: 13D09, 16G10, 18E10
Secondary: 13C60, 13E05, 18E40
##### Milestones
Received: 3 December 2020
Revised: 5 February 2021
Accepted: 9 February 2021
Published: 4 August 2021
##### Authors
 Hongxing Chen School of Mathematical sciences Capital Normal University Beijing China Changchang Xi School of Mathematical Sciences Capital Normal University Beijing China School of Mathematics and Information Science Henan Normal University Xinxiang Henan, China