text:
# Abstracts

## Penrose Limit: A Stringy Regime in Holography by Minxin Huang

Penrose limit provides a promising avenue to the stringy regime in the AdS/CFT holography, giving rise to the pp-wave background. Recently, we proposed a novel entry of the pp-wave holographic dictionary, which equated the Berenstein-Maldacena-Nastase (BMN) two-point functions in free Yang-Mills theory with the norm squares of the quantum unitary transition amplitudes between the corresponding tensionless strings. If our proposal is correct, it would not only provide first examples of systematic calculations of the higher genus critical superstring amplitudes, but may also in principle gives exact complete results for any string coupling, due to the convergence of genus expansion.

## Instanton Counting in BCD-type Gauge Theories and O-vertex by Ruidong Zhu

Localization method together with ADHM construction provide a powerful way to compute the exact partition function of 8 SUSY gauge theories. In particular, Nekrasov’s partition function is interesting because of the non-perturbative corrections from instantons. It is, however, known to be difficult to perform the integrals in an analytic way that appear in the computation of instanton partition functions of BCD-type gauge theories. In this talk, we propose an analytic expression for these integrals in the unrefined limit in the form of summation over Young diagrams. Our results are inspired by the topological vertex formalism in topological string theory.

## 3d $N=4$ Unitary/Orthosymplectic Duality by Satoshi Nawata

There are two ways to realize 3d $N=4$ $Sp(k)$ SQCDs in Type IIB string theory: either $O3^+$ plane or $O5^-$ plane. The mirror dual to the $O3^+$ plane realization is an orthosymplectic quiver theory whereas the mirror dual to the $O5^-$ plane realization is a unitary quiver theory. Using exact partition functions, we will show that these two mirror theories are dual to each other, and we also reveal brane dynamics with O-plane. Similarly, considering 5d $N=1$ $Sp(k)$ SQCDs at the infinite coupling limit, the magnetic quiver techniques find a pair of 3d $N=4$ unitary and orthosymplectic quiver with the same Higgs and Coulomb branch. We also discuss the duality between these magnetic quivers. I will end the talk with lots of open problems, expecting insightful feedbacks from audiences. This is about ongoing joint work with M. Sperling, Z. Zhong, and H. Wang.

## OPE Coefficients of ABJM Theory with Giants (Part I) by Yunfeng Jiang

This is a joint talk with Jun-Bao Wu. In these talks, we will present recent results on the exact computation of giant graviton OPE coefficients in ABJM theory. In part I, we will first introduce the general background and motivations for this series of works. Then we will explain the method of computation at weak coupling, which includes a large $N$ effective field theory and a novel coordinate Bethe ansatz solution for the alternating SU(4) integrable spin chain. The final result of the OPE coefficient takes the form of an overlap between an on-shell Bethe state and an integrable boundary state.

## OPE Coefficients of ABJM Theory with Giants (Part II) by Junbao Wu

This is a joint talk with Yunfeng Jiang. In these talks, we will present recent results on the exact computation of giant graviton OPE coefficients in ABJM theory. In part II, we will focus on the holographic computations which is dual to strong coupling in the gauge theory side. Our approach resolves puzzles and confusions in the literature on the holographic computation of correlation functions of heavy operators. In particular, we point out two important effects which are often missed in the literature; the first one is an average over classical configurations of the heavy state, which physically amounts to projecting the state to an eigenstate of quantum numbers. The second one is the contribution from wave functions of the heavy state. To demonstrate the power of the method, we first analyze the three-point functions in $\mathcal{N}=4$ super Yang-Mills and reproduce the results in field theory from holography, including the cases for which the previous holographic computation gives incorrect answers. We then apply it to ABJM theory and make solid predictions at strong coupling.

## 5d and 6d SCFTs from C3 Orbifolds by Yinan Wang

I’m going to talk about the construction of 5d SCFTs from M-theory on C3 orbifold singularities, which are classified by the discrete subgroups of $SU(3)$. The properties of such 5d SCFTs are studied using two methods: (1) group theoretic data and 3d Mckay correspondence; (2) resolution of the singularity which corresponds to the 5d Coulomb branch. In certain cases, the threefold singularity can also be embedded into an elliptic model, which leads to a 6d $(1,0)$ SCFT in the F-theory framework. We find new rank-1 6d SCFTs without gauge groups.

## Closed-form Schur Indices by Yiwen Pan

Schur index is a remarkable observable associated to any 4d $N=2$ SCFT, and plays a central role in the SCFT/VOA correspondence. In this talk, I will discuss an elementary method to compute them in closed-form in terms of finite sum of Eisenstein series. In particular, we derive a compact closed-form formula for all A1-theories of class-S, and conjecture closed-form unflavored indices for $N=4$ theories with $SU(N)$ gauge groups. Some applications will also be discussed.

## 6d Seiberg-Witten Curves and 5-brane Webs by Sung-Soo Kim

In this talk, we discuss the construction of the Seiberg-Witten (SW) curves based on Type IIB 5-brane webs. After reviewing the construction for SW curves for 5d supersymmetric gauge theories, we discuss how to generalize it to 6d superconformal theories which can be realized on a 5-brane webs with periodic direction. In particular, we construct the SW curve for 6d E-string theory using a 5-brane web with two O5-planes. In fact, the E-string SW curve is already constructed by Eguchi and Sakai which is rather complicated. Our expression is, however, much simpler than the Eguchi and Sakai’s one. We discuss equivalence between our curve and the Eguchi and Sakai. Finally we further generalize our construction of the SW curves to 6d little string theories.

## Thermodynamic Limit of Nekrasov Partition Function for 5-brane Web with O5-plane by Futoshi Yagi

We study 5d $N=1$ $Sp(N)$ gauge theory with $Nf\;( \leq 2N + 3 )$ flavors based on 5-brane web diagram with O5-plane. On the one hand, we discuss Seiberg-Witten curve directly from the 5-brane web. In this process, the boundary conditions originated from the O5-plane plays a key role. On the other hand, we compute the Nekrasov partition function based on the topological vertex formalism with O5-plane, which is the generalization for the conventional topological vertex. Rewriting it in terms of profile functions, we obtain the saddle point equation for the profile function after taking thermodynamic limit. By introducing the resolvent, we derive the Seiberg-Witten curve and its boundary conditions as well as its relation to the prepotential in terms of the cycle integrals. They coincide with those directly obtained from the 5-brane web. This result would shed light on the mirror symmetry for non-toric Calabi-Yau 3-folds including D-type singularities, which is expected to be related to the 5-brane web diagram with O5-plane.

## Anomalies and Supersymmetry by Ioannis Papadimitriou

I will discuss ‘t Hooft anomalies of continuous global symmetries in supersymmetric quantum field theories, focusing on the structure and role of the fermionic components of such anomalies and how they can be determined using a generalized anomaly descent procedure, or through supersymmetric anomaly inflow. I will then show that the fermionic components of supersymmetric ‘t Hooft anomalies result in a deformation of the charge superalgebra that affects the dependence of supersymmetric observables on the moduli of curved backgrounds admitting Killing spinors. The implications of this observation for precision tests of holographic dualities through supersymmetric localization will also be discussed.

## Representations of Quantum W subalgebras by Hong (Kilar) Zhang

We discuss the vertical and horizontal representations of Quantum W subalgebras, and confirm the Awata-Feigin-Shiraishi interwiner lemma which encodes the quantum constraints on the self-dual topological vertex.

## Worldsheet Variables for Cluster Configuration Spaces and Hypersurface Arrangements by Peng Zhao

We introduce worldsheet variables for a certain moduli space associated with a Dynkin diagram of finite type. The construction is based on gluing a pair of A-type quivers. We find new nonlinear factors that characterize such spaces as hypersurface arrangement complement. We study various topological properties using a finite-field method and propose conjectures about quasi-polynomial point count, dimensions of cohomology, and Euler characteristics for the $D_n$ space up to $n=10$. These new variables have applications for string integrals, cluster alphabets, etc.

## Brane construction of the Bethe/gauge correspondence for superspin chains by Junya Yagi

I will discuss a superalgebra generalization of the Bethe/gauge correspondence between 2d $N=(2,2)$ quiver gauge theories and rational spin chains. I will give a derivation of the correspondence by mapping it to 4d Chern-Simons theory via string dualities. Based on joint work with Nafiz Ishtiaque, Seyed Faroogh Moosavian and Surya Raghavendran.


text:
# Merica!

$\begin{array} { l l l l l l } & H & A & W & A & I & I \\ & & I & D & A & H & O \\ & & & I & O & W & A \\ + & & & O & H & I & O \\ \hline & S & T & A & T & E & S \\ \end{array}$

In the above expression, each letter stands for a single unique digit. Calculate $$\overline{AEIOHWDST}$$.

Details and Assumptions

• None of the word starts with $$0$$.

×

format: plain


text:
Logsumexp

torch_logsumexp(self, dim, keepdim = FALSE)

## Arguments

self (Tensor) the input tensor. (int or tuple of ints) the dimension or dimensions to reduce. (bool) whether the output tensor has dim retained or not.

## logsumexp(input, dim, keepdim=False, out=NULL)

Returns the log of summed exponentials of each row of the input tensor in the given dimension dim. The computation is numerically stabilized.

For summation index $$j$$ given by dim and other indices $$i$$, the result is

$$\mbox{logsumexp}(x)_{i} = \log \sum_j \exp(x_{ij})$$

If keepdim is TRUE, the output tensor is of the same size as input except in the dimension(s) dim where it is of size 1. Otherwise, dim is squeezed (see torch_squeeze), resulting in the output tensor having 1 (or len(dim)) fewer dimension(s).

## Examples

if (torch_is_installed()) {

a = torch_randn(c(3, 3))
torch_logsumexp(a, 1)
}
#> torch_tensor
#>  1.1955
#>  1.1585
#>  1.2833
#> [ CPUFloatType{3} ]


text:
One base of a trapezoid is $$100$$ units longer than the other base. The segment that joins the midpoints of the legs divides the trapezoid into two regions whose areas are in the ratio $$2: 3$$. Let x be the length of the segment joining the legs of the trapezoid that is parallel to the bases and that divides the trapezoid into two regions of equal area. Find the greatest integer that does not exceed $$x^2/100$$.

(第十八届AIME2 2000 第6题)


text:
Engineering

# Find strings within strings faster with the new wildcard field

In Elasticsearch 7.9, we’ll be introducing a new “wildcard” field type optimised for quickly finding patterns inside string values. This new field type addresses best practices for efficiently indexing and searching within logs and security data by taking a whole new approach to how we index string data. Depending on your existing field usage, wildcards can provide:

• Simpler search expressions (no need to AND words/phrases together)
• Simpler indexing (no need to define choices of analyzers)
• No more missing values
• Faster search
• Less disk usage

The most exciting feature of this new data type is its simplification of partial matches. With wildcards, you no longer need to worry about where your text pattern falls within a string. Just search using normal query syntax, and Elasticsearch will find all matches anywhere in a string. That's right, we did this all without requiring you to change your query syntax.

The wildcard data type addresses issues noted by those in the security field when it comes to partial matching of string values, but has applications in observability and beyond (covered below). In particular, users wanting to search machine-generated logs should find this new field type a more natural fit than existing options.

In this blog, we'll take a look at how we've been able to accomplish this, as well as how you'll be able to best benefit from wildcard fields. Let's take a look.

## Existing options for indexing strings

Until 7.9, when it came to searching strings, Elasticsearch has broadly offered two choices:

1. Text fields
2. Keyword fields

Text fields “tokenize” strings into multiple tokens, each typically representing words. Searchers looking for quick foxes can therefore match articles talking about a quick brown fox.

Keyword fields tend to be used for shorter, structured content like a country code which would be indexed without analysis as a single token. These can then be used by analysts e.g. to visualize popular holiday destinations using aggregations.

Without an explicit mapping choice by users, Elasticsearch’s default index template assumes that string values presented in JSON documents should be indexed as both a text field and a keyword field. The intention is that Elasticsearch should work if the string represents prose that should be chopped into multiple word tokens for search or if it represents a single structured value (like the city name “New York”) that should be displayed as one item when displayed in a “top travel destinations” bar chart.

## When text and keyword fields fall short

We don’t have to look very far for an example of string content that doesn’t work well as either text or keyword fields. Elasticsearch’s own log files produce messages that don’t fit neatly into either category. Let’s examine why.

Each Elasticsearch log file entry follows the classic minimal requirement for a logged event - a timestamp and a message. The messages that are logged are used to describe a variety of events in a semi-structured form e.g.:

1. Indexes being created or deleted
2. Servers joining or leaving the cluster
3. Warnings of resources under pressure
4. Detailed error messages with long stack traces

Above is an example of a logged event. Highlighted is a section of the message that I’d like to search for to find similar logged errors. That would be a simple “Cmd/Ctrl-F” key press in a text editor, but is not quite so simple using Elasticsearch. Remember, Elasticsearch operates at scale, so Ctrl-F is great for a small text file, but not for TBs of logs. An index of some kind is required to make searches fast.

#### Log message as text field

If we indexed the message content as a text field the end user immediately has a translation problem. The selected substring is “NodeNotConnectedException:[54b_data_2]” but the critical question is “how this is represented in the index”?

• Is it half a token?
• One token?
• One and a half tokens?
• Two? Two and a half? ...

The mystery arises because, unlike English text such as “quick brown fox”, we have no clue where words begin or end in log messages like the stack trace shown above. This is not a language humans speak naturally so it is easy to accidentally select only part of a word.

The match query can help users avoid having to know if the : or [ or _ characters in our selection are parts of word tokens or just used to split words. However, the match query will not help with knowing if the beginning or end of our selection happens to crop what would otherwise be a complete token. If the choice of analyzer kept the full stops in the Java package names we would have to use an expensive leading wildcard search for *NodeNotConnectedException or back-up the text selection to add the preceding org.elasticsearch.transport. characters in our “match” query.

Constructing a query that is respectful of tokenisation policies is a significant challenge, even for experienced Elasticsearch developers.

#### Log message as a keyword field

The keyword field has much less mystery about how the indexed content is stored — it’s one string and we can use a single regexp or wildcard expression to match arbitrary fragments like our search string inside the field values.

Search is made much simpler for users but there are two main issues with the execution:

1. Search speed
2. Missing data

Search speeds are very slow if, like our search, we are searching for something in the middle of strings and there are many unique values. Although keyword fields are indexed, it’s the wrong data structure for this task. An equivalent task would be a researcher trying to find all words with “oo” in the dictionary. They’d have to scan every word on every page from A to Z to find values “afoot” to “zoo”. That’s essentially what the keyword field has to do with every unique value and the index is of no help in speeding this up. Making things more difficult, log messages often produce many unique string values if, like those produced by Elasticsearch, they contain variables such as timings and memory sizes etc.

The other big issue with the keyword field is it can’t handle very long fields. The default string mapping ignores strings longer than 256 characters, silently dropping values from the list of indexed terms. The majority of Elasticsearch’s log file messages exceed this limit.

And even if you do raise the Elasticsearch limit, you cannot exceed the hard Lucene limit of 32k for a single token, and Elasticsearch certainly logs some messages that exceed this.

This makes a bit of a blind spot for our logging which is undesirable and, in some security cases, unacceptable.

## Introducing the new wildcard field

To solve these issues we have a new wildcard field which is adept at finding any patterns in the middle of arbitrary string values.

• Unlike the text field, it does not treat strings as a collection of words separated by punctuation.
• Unlike the keyword field, it can be very fast to infix search many unique values and is free of size restrictions.

### How it works

Detailed pattern-matching operations like wildcard or regular expressions can be expensive to run on large data sets. The key to speeding up these operations is to limit the amount of data on which you apply these detailed comparisons. If a quick approximate match can be applied to narrow the bulk of the data then the more expensive operation of detailed matching can be reserved to verifying a few promising candidate matches.

The new wildcard field automatically accelerates wildcard and regexp searches in this way using two data structures:

1. An “n-gram” index of all 3 character sequences found in strings
2. A “binary doc value” store of the full original document values

The first structure is used to provide a fast but rough narrowing of candidates based on matching n-gram fragments from the search string.

The second data structure is used to verify the match candidates produced by the n-gram match with an automaton query.

#### Wildcard example

A security analyst might be interested in finding any log messages where a hacker may have referred to the word “shell”. Given the wildcard query “*shell*” the wildcard field would automatically split this search string into 3 character n-grams, creating the equivalent of this Lucene query:

she AND ell

This would reduce the number of documents we need to consider but may produce some false positives — e.g. a document containing the string

/Users/Me/Documents/Fell walking trip with Sheila.docx

Obviously, the longer the search string the fewer false positives produced. A search for “*powershell.exe*”, for example would produce a much more selective n-gram query of

pow AND wer AND rsh AND hel AND l.e AND exe

Removing any false positives is a necessary finishing stage and so the wildcard field does this check on all the matches produced by the rough n-gram query. This is done by retrieving the full original value from a Lucene binary doc value store and running the wildcard or regexp pattern on the full value.

#### Regexp example

Regular expressions are more complex and can include choices of value paths — e.g. this search for references to DLL or EXE files:

.*\.(dll|exe)

To accelerate this sort of query the expression is parsed into n-grams arranged with this Boolean logic:

 (.dl AND ll_) OR (.ex AND xe_)

Note in this example that the _ character is used to show where a non-printable character is added to mark the end of the indexed string.

#### Regular expressions and case sensitivity

We know security analysts have adapted their Elasticsearch regexp searches to use mixed case expressions e.g when searching for references to cmd.exe regardless of case they will write:

 [Cc][Mm][Dd].[Ee][Xx][Ee]

The wildcard field recognises these mixed case expressions and the rough-cut query for the above expression would be optimised to the equivalent of this Lucene query:

cmd AND d.e AND exe

(Note the n-gram index used to accelerate queries is always lowercased).

Existing security rules that use these mixed case expressions on keyword fields should run faster when used on content indexed into a wildcard field.

However, these expressions still look ugly and are a pain to write, so in a future Elasticsearch release we also hope to introduce a case sensitive flag to the regexp query which can be set to “false” to make a query case insensitive. It will essentially make a search for abc search for [Aa][Bb][Cc] without the need for the user to write all those square brackets. The net result will be simpler, faster rules.

## Comparison with keyword fields

One key goal of the wildcard field is to be a drop-in replacement for keyword fields where it makes sense. We have worked hard to ensure that it produces the same results for all query types — albeit sometimes wildcard will be faster and sometimes slower. This table should help compare the two fields:

 Feature Keyword Wildcard Sorting speeds Fast Not quite as fast (see *1) Aggregation speeds Fast Not quite as fast (see *1) Prefix query speeds (foo*) Fast Not quite as fast (see *2) Leading wildcard query speeds on low-cardinality fields (*foo) Fast Slower (see *3) Leading wildcard or regexp query speeds on high-cardinality fields (*foo) Terrible Much faster Term query. full value match (foo) Fast Not quite as fast (see *2) Fuzzy query Y (see *4) Y Regexp query Y (see *4) Y Range query Y (see *4) Y Supports highlighting Y N Searched by "all field" queries Y Y Disk costs for mostly unique values high (see *5) lower (see *5) Disk costs for mostly identical values low (see *5) medium (see *5) Max character size for a field value 256 for default JSON string mappings, 32,766 Lucene max unlimited Supports normalizers in mappings Y N Indexing speeds Fast Slower (see *6)
1. Somewhat slower as doc values retrieved from compressed blocks of 32
2. Somewhat slower because approximate matches with n-grams need verification
3. Keyword field visits every unique value only once but wildcard field assesses every utterance of values
4. If “allow expensive queries” setting enabled
5. It depends on common prefixes — keyword fields have common-prefix based compression whereas wildcard fields are whole-value LZ4 compression
6. Will vary with content but a test indexing weblogs took 499 seconds Vs keyword’s 365 seconds

### What’s next?

To make life easier for search and analytics applications contemplating the growing list of field types, we have simplified the way indexes describe fields in the field capabilities API. Physical fields like wildcard and constant_keyword that are functionally equivalent to the keyword field now describe themselves as belonging to the keyword family. The introduction of family types mean other field type groupings can be made in the future and adopted without downstream client applications needing to know about new physical field types. As long as they behave the same as other members of the same family they can be used without any changes to the client application.

Elastic Common Schema (ECS) defines standardised index mappings for popular data fields.

In 7.9, ECS has not been updated to use wildcard fields but in the future we can expect that several high-cardinality keyword fields will be changed over to use wildcard fields instead. When this happens client applications should typically not need to change anything as a result but should benefit from faster searches.

## All sounds great, what does it cost me?

As usual, the answer is “it depends”. Storage costs mostly depend on the level of duplication in your field’s data. For mostly-unique values the storage costs can actually be less than those of using a keyword field. This is because we made an addition to Lucene to compress the binary doc value store used to access the original content.

We tested an example dataset of 2 million weblog records where each line in the file is indexed as a single value held in a single field. An index using a keyword field was 310MB but thanks to compression the equialent index using the new wildcard field was 227MB. Admittedly the timestamp helped ensure each document value was unique but combinations of URL, IP address and user-agent could also lead to many unique strings.

## Summary cheat sheet — when should I use a wildcard field?

We recognise all of the above is a lot to think about so a rough guide to when a wildcard field is appropriate is given below.

## Take it for a spin

As someone who’s helped develop this feature, I’m excited to see it production-ready. Wildcard fields can provide an immediate boost for almost every Elasticsearch user, not just folks in the security and observability spaces. I know I’ll be using it to search my own Elasticsearch log files.

If all this has piqued your interest, try wildcards out for yourself in a free trial of Elasticsearch Service, and let us know what you think in our forums. We’re always interested in learning about new use cases.

Happy searching!


text:
# Lim of An=(n+1)^(1/3) - n^(1/3)

1. Feb 10, 2012

### oferon

Hi all!
Been trying to look for some examples with no luck.. all I found is
related to square roots, not cube roots..
Anyway I'm trying to solve: $$\lim_{n\to\infty}\sqrt[3]{n+1} - \sqrt[3]{n}$$

The limit is obviously 0.. But how do I simplify this expression to show it?
Or should I use the ratio\root test? Even though I couldn't..
Thanks a bunch

Last edited: Feb 10, 2012
2. Feb 10, 2012

### kai_sikorski

$$(n+x)^{1/3} = n^{1/3}+\frac{x}{3 n^{2/3}}-\frac{x^2}{9 n^{5/3}}+\frac{5 x^3}{81 n^{8/3}} + ...$$
$$(n+1)^{1/3} - (n)^{1/3} = \frac{1}{3 n^{2/3}} + O(n^{-5/3})$$
$$\lim_{n \to \infty} \left((n+1)^{1/3} - (n)^{1/3}\right) = 0$$

3. Feb 10, 2012

### oferon

This is the binomal theorem right? Is this the only way to solve this lim?

4. Feb 10, 2012

### kai_sikorski

I just expanded using a Taylor series. There's probably other ways.

5. Feb 10, 2012

### oferon

Yep, the trick is using $$a^3-b^3=(a-b)(a^2+ab+b^2)$$

6. Feb 10, 2012

### kai_sikorski

Not sure how that helps, but if you found some way it does great!

7. Feb 10, 2012

### kai_sikorski

Oh okay I see. You know it's positive and then you bound it above using what you wrote.

8. Feb 12, 2012

### checkitagain

$Let \ a \ = \ \ \sqrt[3]{n + 1} \ \ and \ \ b \ \ = \ \sqrt[3]{n}.$

$Then \ \ \dfrac{a - b}{1} \cdot \dfrac{a^2 + ab + b^2}{a^2 + ab + b^2} \ =$

$\dfrac{a^3 - b^3}{a^2 + ab + b^3}$

What does the numerator become?

As n --> oo, what happens to the denominator?


text:
This lesson is in the early stages of development (Alpha version)

# Anatomy of a NIfTI

## Overview

Teaching: 20 min
Exercises: 5 min
Questions
• How are MRI data represented digitally?

Objectives
• Introduce Python data types

• Load an MRI scan into Python and understand how the data is stored

• Understand what a voxel is

• Introduce MRI coordinate systems

• View and manipulate image data

In the last lesson, we introduced the NIfTI. We’ll cover a few details to get started working with them.

NiBabel is a Python package for reading and writing neuroimaging data. To learn more about how NiBabel handles NIfTIs, check out the Working with NIfTI images page of the NiBabel documentation, from which this episode is heavily based.

import nibabel as nib

First, use the load() function to create a NiBabel image object from a NIfTI file. We’ll load in an example T1w image from the zip file we just downloaded.

t1_img = nib.load("../data/dicom_examples/nii/0219191_mystudy-0219-1114_anat_ses-01_T1w_20190219111436_5.nii.gz")

Loading in a NIfTI file with NiBabel gives us a special type of data object which encodes all the information in the file.Each bit of information is called an attribute in Python’s terminology. To see all of these attributes, type t1_img. followed by Tab. There are three main attributes that we’ll discuss today:

t1_hdr = t1_img.header
print(t1_hdr)

<class 'nibabel.nifti1.Nifti1Header'> object, endian='<'
sizeof_hdr      : 348
data_type       : b''
db_name         : b''
extents         : 0
session_error   : 0
regular         : b''
dim_info        : 0
dim             : [ 3 57 67 56  1  1  1  1]
intent_p1       : 0.0
intent_p2       : 0.0
intent_p3       : 0.0
intent_code     : none
datatype        : uint8
bitpix          : 8
slice_start     : 0
pixdim          : [1.   2.75 2.75 2.75 1.   1.   1.   1.  ]
vox_offset      : 0.0
scl_slope       : nan
scl_inter       : nan
slice_end       : 0
slice_code      : unknown
xyzt_units      : 2
cal_max         : 0.0
cal_min         : 0.0
slice_duration  : 0.0
toffset         : 0.0
glmax           : 0
glmin           : 0
descrip         : b''
aux_file        : b''
qform_code      : mni
sform_code      : mni
quatern_b       : 0.0
quatern_c       : 0.0
quatern_d       : 0.0
qoffset_x       : -78.0
qoffset_y       : -91.0
qoffset_z       : -91.0
srow_x          : [  2.75   0.     0.   -78.  ]
srow_y          : [  0.     2.75   0.   -91.  ]
srow_z          : [  0.     0.     2.75 -91.  ]
intent_name     : b''
magic           : b'n+1'

t1_hdr is a Python dictionary. Dictionaries are containers that hold pairs of objects - keys and values. Let’s take a look at all of the keys. Similar to t1_img in which attributes can be accessed by typing t1_img. followed by Tab, you can do the same with t1_hdr. In particular, we’ll be using a method belonging to t1_hdr that will allow you to view the keys associated with it.

t1_hdr.keys()

['sizeof_hdr',
'data_type',
'db_name',
'extents',
'session_error',
'regular',
'dim_info',
'dim',
'intent_p1',
'intent_p2',
'intent_p3',
'intent_code',
'datatype',
'bitpix',
'slice_start',
'pixdim',
'vox_offset',
'scl_slope',
'scl_inter',
'slice_end',
'slice_code',
'xyzt_units',
'cal_max',
'cal_min',
'slice_duration',
'toffset',
'glmax',
'glmin',
'descrip',
'aux_file',
'qform_code',
'sform_code',
'quatern_b',
'quatern_c',
'quatern_d',
'qoffset_x',
'qoffset_y',
'qoffset_z',
'srow_x',
'srow_y',
'srow_z',
'intent_name',
'magic']

Notice that methods require you to include () at the end of them whereas attributes do not. The key difference between a method and an attribute is:

• Attributes are stored values kept within an object
• Methods are processes that we can run using the object. Usually a method takes attributes, performs an operation on them, then returns it for you to use.

When you type in t1_img. followed by Tab, you’ll see that attributes are highlighted in orange and methods highlighted in blue.

The output above is a list of keys you can use from t1_hdr to access values. We can access the value stored by a given key by typing:

t1_hdr['<key_name>']

## Extract values from the NIfTI header

Extract the value of pixdim from t1_hdr

## Solution

t1_hdr['pixdim']

array([1.  , 2.75, 2.75, 2.75, 1.  , 1.  , 1.  , 1.  ], dtype=float32)

### 2. Data

As you’ve seen above, the header contains useful information that gives us information about the properties (metadata) associated with the MR data we’ve loaded in. Now we’ll move in to loading the actual image data itself. We can achieve this by using the method called t1_img.get_fdata().

t1_data = t1_img.get_fdata()
t1_data

array([[[ 8.79311806,  8.79311806,  8.79311806, ...,  7.73574093,
7.73574093,  7.38328189],
[ 8.79311806,  9.1455771 ,  8.79311806, ...,  8.08819997,
8.08819997,  8.08819997],
[ 9.1455771 ,  8.79311806,  8.79311806, ...,  8.44065902,
8.44065902,  8.44065902],
...,
[ 8.08819997,  8.44065902,  8.08819997, ...,  7.38328189,
7.38328189,  7.38328189],
[ 8.08819997,  8.08819997,  8.08819997, ...,  7.73574093,
7.38328189,  7.38328189],
[ 8.08819997,  8.08819997,  8.08819997, ...,  7.38328189,
7.38328189,  7.03082284]],

[[ 8.79311806,  9.1455771 ,  8.79311806, ...,  7.73574093,
7.38328189,  7.38328189],
[ 8.79311806,  9.1455771 ,  9.1455771 , ...,  8.08819997,
7.73574093,  8.08819997],
[ 8.79311806,  9.49803615,  9.1455771 , ...,  8.44065902,
8.44065902,  8.44065902],
...,
[ 8.08819997,  8.08819997,  8.08819997, ...,  7.38328189,
7.38328189,  7.03082284],
[ 8.08819997,  8.08819997,  8.08819997, ...,  7.38328189,
7.38328189,  7.38328189],
[ 8.08819997,  8.08819997,  8.08819997, ...,  7.38328189,
7.38328189,  7.73574093]],

[[ 9.1455771 ,  9.1455771 ,  8.79311806, ...,  7.73574093,
7.38328189,  7.03082284],
[ 9.1455771 ,  9.49803615,  9.1455771 , ...,  8.08819997,
7.73574093,  7.38328189],
[ 9.1455771 ,  9.49803615,  9.1455771 , ...,  8.08819997,
8.08819997,  8.08819997],
...,
[ 8.08819997,  8.44065902,  8.44065902, ...,  7.73574093,
7.38328189,  7.38328189],
[ 8.44065902,  8.08819997,  8.44065902, ...,  7.38328189,
7.38328189,  7.38328189],
[ 8.08819997,  8.08819997,  8.08819997, ...,  7.38328189,
7.38328189,  7.38328189]],

...,

[[ 9.49803615,  9.85049519,  9.85049519, ...,  7.38328189,
7.38328189,  7.03082284],
[ 9.85049519,  9.85049519,  9.85049519, ...,  7.38328189,
7.38328189,  7.73574093],
[ 9.85049519,  9.85049519, 10.20295423, ...,  8.08819997,
8.08819997,  8.08819997],
...,
[ 9.49803615,  9.1455771 ,  9.49803615, ...,  7.73574093,
7.73574093,  7.73574093],
[ 9.49803615,  9.49803615,  9.1455771 , ...,  7.73574093,
8.08819997,  7.73574093],
[ 9.49803615,  9.1455771 ,  8.79311806, ...,  8.08819997,
7.73574093,  7.73574093]],

[[ 9.49803615,  9.85049519, 10.20295423, ...,  7.38328189,
7.38328189,  7.03082284],
[ 9.1455771 ,  9.85049519,  9.1455771 , ...,  7.73574093,
7.38328189,  7.38328189],
[ 9.85049519,  9.85049519,  9.49803615, ...,  8.08819997,
7.73574093,  8.08819997],
...,
[ 9.49803615,  8.79311806,  9.1455771 , ...,  8.08819997,
7.38328189,  7.73574093],
[ 9.1455771 ,  9.1455771 ,  9.1455771 , ...,  7.73574093,
8.08819997,  7.73574093],
[ 8.79311806,  9.1455771 ,  9.1455771 , ...,  7.73574093,
7.73574093,  7.38328189]],

[[ 9.1455771 ,  8.79311806,  8.79311806, ...,  7.03082284,
7.03082284,  6.6783638 ],
[ 9.49803615,  9.85049519,  9.49803615, ...,  7.73574093,
7.73574093,  7.73574093],
[ 9.49803615,  9.49803615,  9.85049519, ...,  7.73574093,
8.08819997,  7.73574093],
...,
[ 8.79311806,  9.1455771 ,  9.1455771 , ...,  8.08819997,
8.08819997,  8.08819997],
[ 9.1455771 ,  9.1455771 ,  9.1455771 , ...,  8.08819997,
8.08819997,  7.73574093],
[ 8.79311806,  9.1455771 ,  9.1455771 , ...,  8.08819997,
7.73574093,  7.73574093]]])

What type of data is this exactly? We can determine this by calling the type() function on t1_data.

type(t1_data)

numpy.ndarray

The data is a multidimensional array representing the image data. In Python, an array is used to store lists of numerical data into something like a table.

## Check out attributes of the array

How can we see the number of dimensions in the t1_data array? Once again, all of the attributes of the array can be seen by typing t1_data. followed by Tab.

## Solution

t1_data.ndim

3

t1_data contains 3 dimensions. You can think of the data as a 3D version of a picture (more accurately, a volume).

While typical 2D pictures are made out of squares called pixels, a 3D MR image is made up of 3D cubes called voxels.
What about the how big each dimension is (shape)?

## Solution

t1_data.shape

(57, 67, 56)

The 3 numbers given here represent the number of values along a respective dimension (x,y,z). This brain was scanned in 57 slices with a resolution of 67 x 56 voxels per slice. That means there are:

57 * 67 * 56 = 213864

voxels in total!

Let’s see the type of data inside of the array.

t1_data.dtype

dtype('float64')

This tells us that each element in the array (or voxel) is a floating-point number.
The data type of an image controls the range of possible intensities. As the number of possible values increases, the amount of space the image takes up in memory also increases.

import numpy as np
print(np.min(t1_data))
print(np.max(t1_data))

6.678363800048828
96.55541983246803

For our data, the range of intensity values goes from 0 (black) to more positive digits (whiter).

How do we examine what value a particular voxel is? We can inspect the value of a voxel by selecting an index as follows:

data[x,y,z]

So for example we can inspect a voxel at coordinates (10,20,3) by doing the following:

t1_data[9, 19, 2]

32.40787395834923

NOTE: Python uses zero-based indexing. The first item in the array is item 0. The second item is item 1, the third is item 2, etc.

This yields a single value representing the intensity of the signal at a particular voxel! Next we’ll see how to not just pull one voxel but a slice or an array of voxels for visualization and analysis!

## Working with image data

Slicing does exactly what it seems to imply. Giving our 3D volume, we pull out a 2D slice of our data. Here’s an example of slicing from left to right (sagittal slicing):

This gif is a series of 2D images or slices moving from left to right.

Let’s pull the 10th slice in the x axis.

x_slice = t1_data[9, :, :]

This is similar to the indexing we did before to pull out a single voxel. However, instead of providing a value for each axis, the : indicates that we want to grab all values from that particular axis.

## Slicing MRI data

Now try selecting the 20th slice from the y axis.

## Solution

y_slice = t1_data[:, 19, :]

Finally, try grabbing the 3rd slice from the z axis

## Solution

z_slice = t1_data[:, :, 2]

We’ve been slicing and dicing brain images but we have no idea what they look like! In the next section we’ll show you how you can visualize brain slices!

## Visualizing the data

We previously inspected the signal intensity of the voxel at coordinates (10,20,3). Let’s see what out data looks like when we slice it at this location. We’ve already indexed the data at each x, y, and z axis. Let’s use matplotlib.

import matplotlib.pyplot as plt
%matplotlib inline

slices = [x_slice, y_slice, z_slice]

fig, axes = plt.subplots(1, len(slices))
for i, slice in enumerate(slices):
axes[i].imshow(slice.T, cmap="gray", origin="lower")

Now, we’re going to step away from discussing our data and talk about the final important attribute of a NIfTI.

### 3. Affine: tells the position of the image array data in a reference space

The final important piece of metadata associated with an image file is the affine matrix. Below is the affine matrix for our data.

t1_affine = t1_img.affine
t1_affine

array([[  2.75,   0.  ,   0.  , -78.  ],
[  0.  ,   2.75,   0.  , -91.  ],
[  0.  ,   0.  ,   2.75, -91.  ],
[  0.  ,   0.  ,   0.  ,   1.  ]])

To explain this concept, recall that we referred to coordinates in our data as (x,y,z) coordinates such that:

• x is the first dimension of t1_data
• y is the second dimension of t1_data
• z is the third dimension of t1_data

Although this tells us how to access our data in terms of voxels in a 3D volume, it doesn’t tell us much about the actual dimensions in our data (centimetres, right or left, up or down, back or front). The affine matrix allows us to translate between voxel coordinates in (x,y,z) and world space coordinates in (left/right,bottom/top,back/front). An important thing to note is that in reality in which order you have:

• left/right
• bottom/top
• back/front

Depends on how you’ve constructed the affine matrix, but for the data we’re dealing with it always refers to:

• Right
• Anterior
• Superior

Applying the affine matrix (t1_affine) is done through using a linear map (matrix multiplication) on voxel coordinates (defined in t1_data).

The concept of an affine matrix may seem confusing at first but an example might help gain an intuition:

Suppose we have two voxels located at the the following coordinates: $(64, 100, 2)$

And we wanted to know what the distances between these two voxels are in terms of real world distances (millimetres). This information cannot be derived from using voxel coordinates so we turn to the affine matrix.

Now, the affine matrix we’ll be using happens to be encoded in RAS. That means once we apply the matrix our coordinates are as follows:
(Right, Anterior, Superior)

So increasing a coordinate value in the first dimension corresponds to moving to the right of the person being scanned.

Applying our affine matrix yields the following coordinates: $(10.25, 30.5, 9.2)$

This means that:

• Voxel 1 is 90.23 - 10.25 = 79.98 in the R axis. Positive values mean move right
• Voxel 1 is 0.2 - 30.5 = -30.3 in the A axis. Negative values mean move posterior
• Voxel 1 is 2.15 - 9.2 = -7.05 in the S axis. Negative values mean move inferior

This covers the basics of how NIfTI data and metadata are stored and organized in the context of Python. In the next segment we’ll talk a bit about an increasingly important component of MR data analysis - data organization. This is a key component to reproducible analysis and so we’ll spend a bit of time here.


text:
# Finding generating function for the recurrence $a_0 = 1$, $a_n = {n \choose 2} + 3a_{n - 1}$

I am trying to find generating function for the recurrence:

• $a_0 = 1$,
• $a_n = {n \choose 2} + 3a_{n - 1}$ for every $n \ge 1$.

It looks like this:

• $a_0 = 1$
• $a_1 = {1 \choose 2} + 3$
• $a_2 = {2 \choose 2} + 3{1 \choose 2} + 9$
• $a_3 = {3 \choose 2} + 3{2 \choose 2} + 9{1 \choose 2} + 27$
• $a_4 = {4 \choose 2} + 3{3 \choose 2} + 9{2 \choose 2} + 27 {1 \choose 2} + 81$

I know what the generating function of the sequence $3 ^n = (1, 3, 9, 27, 81, \dots)$ is, as well as what the generating functions for some sequences of combinatorial numbers are, but how do I split the sequence up into these pieces I know?

(The problem is those combinatorial numbers "move right" every time. If they were growing left-to-right along with their coefficients, it would be much easier. And there is no constant difference between $a_i$ and $a_{i + 1}$.)

-
You should first write $a_n$ as a function of $n$ and then see what it can look like. In your case: $$\displaystyle a_n=3^n+\sum_{k=0}^{n-1}3^k{n-k \choose 2}$$ –  Dolma Apr 25 '13 at 13:15

A related problem. Assume $F(x) = \sum_{n=0}^{\infty}a_n x^n$, then $$a_n = {n \choose 2} + 3a_{n - 1} \implies a_{n+1} = {n+1 \choose 2} + 3a_{n}$$

$$\sum_{n=0}^{\infty} a_{n+1} x^n = \frac{1}{2}\sum_{n=0}^{\infty}n(n+1)x^n + 3\sum_{n=0}^{\infty}a_{n}x^n$$

$$\implies \sum_{n=1}^{\infty} a_{n} x^{n-1} = \frac{1}{2}\sum_{n=1}^{\infty}nx^{n}+\frac{1}{2}\sum_{n=1}^{\infty}n^2x^{n} +3F(x)$$

$$\implies \frac{1}{x}F(x)-\frac{a_0}{x}-3F(x) = \frac{1}{2}\sum_{n=1}^{\infty}nx^{n}+\frac{1}{2}\sum_{n=1}^{\infty}n^2x^{n}$$

$$\implies \left(\frac{1}{x}-3 \right)F(x)=\frac{1}{x}+\frac{1}{2}\frac{x}{(x-1)^2}-\frac{1}{2}\frac{x(x+1)}{(x-1)^3}$$

$$\implies \left(\frac{1}{x}-3 \right)F(x)=\frac{1}{x}-\frac{x}{(x-1)^3}$$

$$\implies F(x)=\frac{x}{1-3x}\left( \frac{1}{x}-\frac{x}{(x-1)^3} \right).$$

-
At the third line of the block of equations, you have changed the sums to start at $n = 1$ instead of $n = 0$. If I understood it correctly, you just rewrote those sums from the previous line. But then $$\frac{1}{2}\sum_{n = 0}^\infty {n(n + 1)x^n}$$ turns into $$\frac{1}{2}\sum_{n = 1}^\infty {(n - 1)n x^{n - 1}} = \frac{1}{2}\sum_{n = 1}^\infty {nx^{n-1}} - \frac{1}{2}\sum_{n = 1}^\infty {n^2x^{n-1}}$$. What is wrong? –  David Čepelík Apr 26 '13 at 8:13
Huh, I see now. Both $n^2$ and $n$ are $0$ for $n = 0$. Sorry –  David Čepelík Apr 26 '13 at 13:34
Mhenni, it took me a long time to figure out what you were doing, but finally, I got it! Thanks a lot! –  David Čepelík Apr 26 '13 at 20:41
@David: You are welcome. All of us spend long time to understand things. It is natural. Good luck. –  Mhenni Benghorbal Apr 26 '13 at 20:50

Let $A(x)=\sum_{n=0}^\infty a_nx^n$. Then \begin{eqnarray} A(x)&=&1+\sum_{n=1}^\infty a_{n}x^n\\ &=&1+\sum_{n=1}^\infty (3a_{n-1}+\frac{1}{2}n(n-1))x^n\\ &=&1+3xA(x)+\frac{1}{2}\sum_{n=1}^\infty n(n-1)x^n. \end{eqnarray} Note $\sum_{n=0}^\infty x^n=\frac{1}{1-x}$ for $|x|<1$. Differentiating this twice, you can give $$\sum_{n=2}^\infty n(n-1)x^{n-2}=\frac{2}{(1-x)^3}.$$ Thus $$A(x)=1+3xA(x)+\frac{x^2}{(1-x)^3}$$ from which you can get $A(x)$.

-
Could you please explain to me what is the point of differentiating the equation? I get lost reading the second half of the answer. –  David Čepelík Apr 25 '13 at 14:06
Differentiating $\sum_{n=0}^\infty x^n=\frac{1}{1-x}$, you can get $\sum_{n=1}^\infty nx^{n-1}=\frac{1}{(1-x)^2}$. Differentiating $\sum_{n=1}^\infty nx^{n-1}=\frac{1}{(1-x)^2}$, you can get $\sum_{n=2}^\infty n(n-1)x^{n-2}=\frac{2}{(1-x)^3}$. –  xpaul Apr 25 '13 at 14:39
I see. I have never seen this before, so that's what confused me. –  David Čepelík Apr 25 '13 at 14:43

Hint Let $F:=\sum_0^\infty a_n x^n$. Consider $a_n x^n= 3 a_{n-1}x^{n}+C_n^2 x^n$.

-

As I said in my comment, you have:

$$\displaystyle a_n=3^n+\sum_{k=0}^{n-1}3^k{n-k \choose 2}$$

You can rewrite this as:

$$\displaystyle a_n=3^n+\sum_{k=1}^{n}3^{n-k}{k \choose 2}=3^n+3^n\sum_{k=1}^{n}3^{-k}{k \choose 2}=3^n\left(1+\sum_{k=1}^{n}\left(\frac{1}{3}\right)^{k}{k \choose 2}\right)$$

Also you have:

$$\displaystyle\sum_{k=1}^\infty \left(\frac{1}{3}\right)^{k}{k \choose 2}=\sum_{k=0}^\infty \left(\frac{1}{3}\right)^{k}{k \choose 2}=\dfrac{\left(\frac{1}{3}\right)^{2}}{\left(1-\frac{1}{3}\right)^{3}}=\frac{3}{8}$$

-


text:
# Solve differential equation using 'variation of parameters'

Given the differential equation $L \ u = f$, with $$L \ u = a_2(t) \frac{d^2u}{dt^2}+a_1(t)\frac{du}{dt}+a_0(t)u$$ with $a_i(t)$ sufficiently smooth and $a_2(t) \neq 0$ for every $t$. Suppose that $u_0$ is a solution to the homogenenous equation $L \ u=0$, with $u_0(t)\neq0$ for every $t$. How can I then use the variation of parameters method by Lagrange to find the solution $u =u_0v$ ? And how can I find the general solution if the equation isn't homogeneous?

Update: I've substituted $u=u_0v$ into the equation and found a new $2^{nd}$ order differential equation of the form $$f = \frac{d^2v}{dt^2}(a_2(t)u_0)+\frac{dv}{dt}(2a_2(t)u_0'+a_1(t)u_0)+va_0(t)u_0$$ which I'm supposed to solve for $w$ using $w=v'$. But I don't seem to be able to proceed as I'm not sure how to solve the system $$$$\begin{split} w =&\ v'\\ w'a_2(t)u_0+w(2a_2(t)u_0'+a_1(t)u_0)+v(a_0(t)u_0)=&\ f\ \\ \end{split}$$$$


text:
# Combine nested list entries [closed]

I have a list with stock index data (which I load from a database) as follows:

lis={{{2000,01,03,^AEX", 4470}, {2000,01,05, ^AEX, 4470}},
{{2000,01,04, ^AFLI, 4471}, {2000,01,05, ^AFLI, 4471}},
{{2000,01,03,^AORD, 4472}, {2000,01,05, ^AORD, 4472}}}

I would like to update the database. For that purpose I need the date of the last database entry per symbol. I use the following function:

updateParameter =
Map[
Flatten[{
Last[Transpose[#][[1]]],
#[[1, 2]],
#[[1, 3]]
}] &, lis]

It provide the desired result:

{{2015,01,05, ^AEX, 4470}, {2015,01,05, ^AFLI,
4471}, {2015,01,05, ^AORD, 4472}}

But my function seems to be a little bit awkward. I´m sure there is a more "elegant" way. Does anyone have a hint?

## closed as off-topic by ciao, Karsten 7., xyz, ubpdqn, bbgodfreyApr 5 '15 at 11:38

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – ciao, Karsten 7., xyz, ubpdqn, bbgodfrey
If this question can be reworded to fit the rules in the help center, please edit the question.

• lis[[All, -1]] will give you same result... – ciao Apr 5 '15 at 6:32


text:
Which TeX editors are able to compile just a snippet of a .tex file?

A friend of mine asked me whether TeXShop is able to compile just a snippet of a .tex file or not. More generally, one could ask which TeX editors are able to compile just a snippet of a .tex file? This question:

Update

More precisely, I'm looking for pure TeX editors solutions that let the user select a region of a .tex file and compile just this region from the current .tex file (with its class, packages, personal macros, more generally its preamble). Just the names of such editors would be nice, how it is done would be the icing on the cake.

• WinEdt certainly has or had this concept, but one has to start by deciding what the 'master' document for a snippet is, which itself sounds tricky. – Joseph Wright Nov 6 '16 at 17:59
• Emacs + AUCTeX is available also on Windows. – giordano Nov 6 '16 at 18:02
• I'm not quite sure what you're asking. For the Mac, there is LaTeXit which is effectively a snippet editor. And of course you can use the standalone class to create snippets. But maybe I'm misunderstanding the question. – Alan Munn Nov 6 '16 at 18:09
• any editor that has programmable customisation should be able to do this, basically copy the preamble of the current document, the current region and \end{document} into a temporary file and run latex. – David Carlisle Nov 6 '16 at 18:34
• Are you asking for people simply to name editors where it is possible, or how it is done in the relevant editor? (It is pretty easy with Emacs + AUCTeX....) – jon Nov 6 '16 at 19:12

Amazingly enough, TeXShop does in fact have such a facility. The problem is that long-time users of it like myself are probably unaware of it.

It can be found under the Edit Menu -> Experiment

This menu will open a window which you can copy a snippet of the currently open document. When you press the Typeset button on the window, it will show the result in a small preview window:

• Nice to having excavated this feature! Nevertheless, too bad it requires a copy-paste: I guess it should be possible for TeXShop to do the same job just by selecting the region and running Edit Menu → Experiment. I'll post a feature request to Richard Koch. – Denis Bitouzé Nov 7 '16 at 6:12
• Richard Koch nicely accepted my feature request: many thanks to him! :) No need to copy paste anymore (when TeXShop update will be available, starting tomorrow): if you select text and then go to Edit Menu → Experiment, the selected text will be automatically copied in the Experiment (text) window, the layout of which can be controlled with "Typeset" button which brings up the typeset window. If nothing is selected when you go to Edit Menu → Experiment, you'll get the previous contents (or an empty page if this is its first use in the session). – Denis Bitouzé Nov 8 '16 at 13:32
• @DenisBitouzé Great! Yes Dick is extremely responsive to user suggestions. – Alan Munn Nov 8 '16 at 17:02

With Emacs and AUCTeX, it is as simple as highlighting the portion of the text you want to compile and then hitting C-c C-r (or M-x TeX-command-region).

The command tries to be 'smart' about it, so if you do C-c C-r RET C-c C-r RET (i.e., run the same command on the same section twice) it will first compile, then, second, open a viewer for resultant PDF. (By default, called _region_.pdf).

In order to selection the region, the easiest way is to move the cursor to the start (or end) or the desired region, hit C-SPC (or M-x set-mark-command) to set the mark, then move it to the end (or start) of the region. Then hit C-c C-r RET to compile that selection.

Note that this also creates a file called _region_.tex.

Consider this file (called, say, fulldoc.tex):

\documentclass{article}
\usepackage{lipsum}
\begin{document}

\lipsum[1]

\lipsum[2]

% imagine trying to compile only this list (note you must do the whole environment)
\begin{itemize}
\item More lorem
\item More ipsum
\end{itemize}
% end of region being compiled
\lipsum[3]

\lipsum[4]

\end{document}

This would create the following file and run (in this case) pdflatex on it:

\message{ !name(fulldoc.tex)}\documentclass{article}
\usepackage{lipsum}
\begin{document}

\message{ !name(fulldoc.tex) !offset(3) }
\begin{itemize}
\item More lorem
\item More ipsum
\end{itemize}

\message{ !name(fulldoc.tex) !offset(5) }

\end{document}

Doing C-r RET again will open a viewer of _region_.pdf Of course, you could also compile the _region_.tex file from the shell, etc.

Note: if you mark a new region, it will do the same thing all over again, but use the same _region_ base filename.

Note As giordano notes, starting with version 11.89 of AUCTeX, it is now possible to compile a single section (not necessarily a single '\section') of your file. From the manual:

Command: LaTeX-command-section

(C-c C-z) Query the user for a command, and apply it to the current section (or part, chapter, subsection, paragraph, or subparagraph). What makes the current section is determined by LaTeX-command-section-level which can be enlarged/shrunken using LaTeX-command-section-change-level (C-c M-z). The given numeric prefix arg is added to the current value of LaTeX-command-section-level. By default, LaTeX-command-section-level is initialized with the current document’s LaTeX-largest-level. The buffer contents are written into the region file, after extracting the header and trailer from the master file. The command is then actually run on the region file. See TeX-command-region for details.

In essence, what AUCTeX does is the same as in my example above. The advantage is that you don't need to explicitly mark a portion of text that you want to compile.

• It's worth mentioning that you can also automatically run LaTeX on the current section without even selecting it, using C-c C-z: gnu.org/software/auctex/manual/auctex/… – giordano Nov 7 '16 at 9:21
• Whoa! Never even noticed that option before! Will edit. – jon Nov 7 '16 at 15:35

Kile has this feature. It is called QuickPreview. I've never used it before, but I tested it in a minimal example and it seems to work.

I tested with my answer to another question:

\documentclass[tikz,border=10pt]{standalone}
\usepackage{circuitikz}
\standaloneenv{circuitikz}
\usetikzlibrary{fit}
\begin{document}
\tikzset{
pics/multimeter/.style={
code={
\tikzset{
multi meter/.cd,
#1,
}
\begin{scope}[]
\coordinate (\multimetername-o) at (0,0);
\foreach \i/\j/\k/\l in {A/o/south/A,V/o/north/V,TL/mA.west/east/HI,BL/mV.west/east/HI,TR/mA.east/west/LO,BR/mV.east/west/LO} \node (\multimetername-m\i) [multi meter/label, anchor=\k] at (\multimetername-\j) {\l};
\foreach \i in {TL.west,TR.east,BL.south,BR.south} \node [circle, fill, inner sep=1.25pt] at (\multimetername-m\i) {};
\node [draw, fit=(\multimetername-mTR) (\multimetername-mBL)] {};
\end{scope}
}
},
multi meter/.search also={/tikz,/circuitikz},
multi meter/.cd,
label/.style={font=\sffamily, align=center, transform shape, pic actions},
name/.store in=\multimetername,
name=multimeter,
}
\begin{circuitikz}[american, cute inductors]
\draw
(0,0) node[anchor = east] {C} coordinate (C)
(0,2) node[anchor = east] {B} coordinate (B)
(0,4) node[anchor = east] {A} coordinate (A)
pic [rotate=-90] at (3,0) {multimeter={name=M}}

(A) to [short] ++(2,0)
(B) to [short] ++(6,0)
(C) to [short] ++(2,0)
(1.5,0) to[short,*-] ++(0,1.2)
to[short] ++(1,0)
-| (M-mTL.west)
(M-mBR.south) to[short] ++(-1.25,0) coordinate (c) to [short,-*] (B -| c)
;
\end{circuitikz}
\end{document}

Highlighting the contents of the document environment (but not the environment itself or the preamble) and choosing Build > QuickPreview > Selection typeset the selection.

As far as I can ascertain, the way this works is that Kile tries to identify the preamble by looking for the first line containing \documentclass for the start of the preamble and the \begin{document} line to figure out where the preamble ends. It copies the preamble to a file in a temporary directory called preview.tex, along with the selection, wrapped in a document environment. It then typesets this document and displays the result, if successful.

I tested the QuickPreview > Selection option. Other QuickPreview options include Environment, Subdocument and Maths group.


text:
# Problem with an integral

• March 21st 2010, 12:05 PM
Bart
Problem with an integral
The integral is $\int{\frac{1-3*x}{3+2*x}}dx$.

According to Maple I should first rewrite it as $\frac{-3}{2} + \frac{11}{2}\frac{1}{3 + 2*x}$ and then solve it.
My problem is that I don't know how to rewrite it, after that I can solve it (I know how to use the rules for integration) but how to get there?
I would like a method which works all the time.
• March 21st 2010, 12:17 PM
skeeter
Quote:

Originally Posted by Bart
The integral is $\int{\frac{1-3*x}{3+2*x}}dx$.

According to Maple I should first rewrite it as $\frac{-3}{2} + \frac{11}{2}\frac{1}{3 + 2*x}$ and then solve it.
My problem is that I don't know how to rewrite it, after that I can solve it (I know how to use the rules for integration) but how to get there?
I would like a method which works all the time.

when the degree of the numerator $\ge$ the degree of the denominator, perform long division.
• March 21st 2010, 12:55 PM
Bart
Problem solved. ;)

If I have a question about another integral, should I then post it in the same topic or make a new topic for it?
• March 21st 2010, 01:01 PM
skeeter
Quote:

Originally Posted by Bart
Problem solved. ;)

If I have a question about another integral, should I then post it in the same topic or make a new topic for it?


text:
# How do you simplify -6(x+4)?

Oct 10, 2016

$- 6 x - 24$

#### Explanation:

Distribute the $- 6$ throughout the set of parenthesis. Meaning, multiply $- 6$ to each term within the parenthesis.

$- 6 \times x$ = $- 6 x$
and
$- 6 \times 4$ = $- 24$

$- 6 x - 24$


text:
# zbMATH — the first resource for mathematics

## Journal of Anhui University. Natural Science Edition

 Short Title: J. Anhui Univ., Nat. Sci. Parallel Title: Anhui Daxue Xuebao. Ziran Kexue Ban Publisher: Editorial Department of Journal of Anhui University, Hefei ISSN: 1000-2162 Online: http://www.ilib.cn/P-ahdxxb.htmlhttp://ahdxzkb.paperopen.com/oa/dlistnum.aspxhttp://en.cnki.com.cn/Journal_en/A-A000-AHDX-2009-01.htm
 Documents Indexed: 395 Publications (since 1999)
all top 5

#### Latest Issues

 45, No. 3 (2021) 45, No. 2 (2021) 45, No. 1 (2021) 44, No. 6 (2020) 44, No. 5 (2020) 44, No. 4 (2020) 44, No. 3 (2020) 44, No. 2 (2020) 44, No. 1 (2020) 43, No. 6 (2019) 43, No. 5 (2019) 43, No. 4 (2019) 43, No. 3 (2019) 43, No. 2 (2019) 43, No. 1 (2019) 42, No. 6 (2018) 42, No. 5 (2018) 42, No. 4 (2018) 42, No. 3 (2018) 42, No. 2 (2018) 42, No. 1 (2018) 41, No. 6 (2017) 41, No. 5 (2017) 41, No. 4 (2017) 41, No. 3 (2017) 41, No. 2 (2017) 41, No. 1 (2017) 40, No. 6 (2016) 40, No. 5 (2016) 40, No. 4 (2016) 40, No. 3 (2016) 40, No. 2 (2016) 40, No. 1 (2016) 39, No. 6 (2015) 39, No. 5 (2015) 39, No. 4 (2015) 39, No. 3 (2015) 39, No. 1 (2015) 29, No. 2 (2015) 38, No. 6 (2014) 38, No. 5 (2014) 38, No. 4 (2014) 38, No. 3 (2014) 38, No. 2 (2014) 38, No. 1 (2014) 37, No. 6 (2013) 37, No. 5 (2013) 37, No. 4 (2013) 37, No. 3 (2013) 37, No. 2 (2013) 37, No. 1 (2013) 36, No. 6 (2012) 36, No. 5 (2012) 36, No. 4 (2012) 36, No. 3 (2012) 36, No. 2 (2012) 36, No. 1 (2012) 35, No. 6 (2011) 35, No. 5 (2011) 35, No. 4 (2011) 35, No. 3 (2011) 35, No. 2 (2011) 35, No. 1 (2011) 34, No. 6 (2010) 34, No. 5 (2010) 34, No. 4 (2010) 34, No. 3 (2010) 34, No. 2 (2010) 34, No. 1 (2010) 33, No. 6 (2009) 33, No. 5 (2009) 33, No. 4 (2009) 33, No. 3 (2009) 33, No. 2 (2009) 33, No. 1 (2009) 31, No. 6 (2007) 31, No. 5 (2007) 31, No. 4 (2007) 31, No. 3 (2007) 31, No. 2 (2007) 31, No. 1 (2007) 30, No. 6 (2006) 30, No. 5 (2006) 30, No. 4 (2006) 30, No. 3 (2006) 30, No. 2 (2006) 30, No. 1 (2006) 23, No. 4 (1999)
all top 5

#### Authors

 10 Han, Jiahua 8 Yang, Jiashan 6 Chen, Huayou 6 Jiang, Wei 5 Jiang, Lihua 5 Mao, Beixing 5 Wang, Junmao 5 Wu, Guojiang 5 Zhang, Wenliang 4 Wang, Changyou 4 Yang, Shangjun 4 Zhang, Miao 4 Zhang, Qianhong 3 Deng, Yihua 3 Du, Xiancun 3 Du, Xianneng 3 Guan, Xungui 3 Hong, Baojian 3 Hu, Shuhe 3 Li, Deming 3 Li, Jinlong 3 Li, Qiaoli 3 Lin, Fubiao 3 Lin, Wenxian 3 Liu, Zhongfei 3 Lu, Dianchen 3 Ma, Changfeng 3 Qiao, Zongmin 3 Wang, Tao 3 Wu, Xianliang 3 Xu, Baogen 3 Yang, Kaifan 3 Zhang, Sibao 3 Zhao, Jianzhong 3 Zhu, Chunpeng 2 Bao, Yanhong 2 Bie, Qunyi 2 Chen, Fubin 2 Chen, Siyang 2 Ding, Danping 2 Han, Huili 2 Han, Xiu 2 He, Shuping 2 Hu, Guikai 2 Hu, Lin 2 Ji, Zhanjiang 2 Lei, Yingjie 2 Li, Xiaohua 2 Li, Xuefeng 2 Li, Zhirong 2 Li, Zhixiu 2 Lin, Yuqing 2 Ling, Xiaoliang 2 Luo, Bin 2 Mo, Xieqiang 2 Qi, Min-ju 2 Qin, Guijiang 2 Qin, Xiaoyan 2 Shen, Yan 2 Sheng, Liren 2 Shi, Liangma 2 Sun, Min 2 Wang, Aili 2 Wang, Bing 2 Wang, Dongxiao 2 Wang, Lianglong 2 Wang, Nian 2 Wang, Suping 2 Wang, Xuejun 2 Wang, Zhanwei 2 Wu, Yuesheng 2 Xiao, Hong 2 Xiao, Jian 2 Xiao, Wenxian 2 Xin, Yunbing 2 Xu, Changjin 2 Xu, Chuanqing 2 Xu, Xin 2 Xue, Yimin 2 Yin, Rong 2 Yuan, Fushun 2 Zeng, Huiping 2 Zeng, Zhaoyun 2 Zhang, Gengrong 2 Zhang, Hongli 2 Zhang, Xiumei 2 Zhang, Yamin 2 Zhang, Zhixin 2 Zhao, Jianxing 2 Zhao, Yue 2 Zhou, Jiaquan 2 Zhou, Ligang 2 Zhou, Zongfu 2 Zhu, Wengang 1 Ai, Quanda 1 An, Tianqing 1 Asefa, Dadi 1 Bai, Jing 1 Bai, Yuzhen 1 Bao, Shuai-shan ...and 563 more Authors
all top 5

#### Fields

 59 Ordinary differential equations (34-XX) 46 Partial differential equations (35-XX) 45 Numerical analysis (65-XX) 38 Operations research, mathematical programming (90-XX) 36 Systems theory; control (93-XX) 31 Combinatorics (05-XX) 26 Linear and multilinear algebra; matrix theory (15-XX) 26 Computer science (68-XX) 21 Biology and other natural sciences (92-XX) 19 Operator theory (47-XX) 17 Information and communication theory, circuits (94-XX) 16 Statistics (62-XX) 15 Number theory (11-XX) 15 Dynamical systems and ergodic theory (37-XX) 13 Associative rings and algebras (16-XX) 12 Group theory and generalizations (20-XX) 12 Game theory, economics, finance, and other social and behavioral sciences (91-XX) 11 Probability theory and stochastic processes (60-XX) 8 Calculus of variations and optimal control; optimization (49-XX) 7 Order, lattices, ordered algebraic structures (06-XX) 6 Mathematical logic and foundations (03-XX) 6 Difference and functional equations (39-XX) 5 Functions of a complex variable (30-XX) 5 Harmonic analysis on Euclidean spaces (42-XX) 5 Integral equations (45-XX) 5 General topology (54-XX) 5 Optics, electromagnetic theory (78-XX) 5 Statistical mechanics, structure of matter (82-XX) 4 Nonassociative rings and algebras (17-XX) 4 Real functions (26-XX) 3 Commutative algebra (13-XX) 3 Approximations and expansions (41-XX) 3 Differential geometry (53-XX) 2 General algebraic systems (08-XX) 2 Category theory; homological algebra (18-XX) 2 Measure and integration (28-XX) 2 Mechanics of particles and systems (70-XX) 2 Mechanics of deformable solids (74-XX) 2 Fluid mechanics (76-XX) 1 Algebraic geometry (14-XX) 1 $$K$$-theory (19-XX) 1 Potential theory (31-XX) 1 Several complex variables and analytic spaces (32-XX) 1 Sequences, series, summability (40-XX) 1 Functional analysis (46-XX) 1 Geometry (51-XX) 1 Relativity and gravitational theory (83-XX)

#### Citations contained in zbMATH Open

7 Publications have been cited 11 times in 11 Documents Cited by Year
Augmentation quotients for complex representation rings of point groups. Zbl 1324.20002
Chang, Shan
2014
State-feedback stabilization for a class of high-order stochastic nonlinear systems. Zbl 1274.93274
Qin, Xiaoyan
2012
Some new results and problems in spectral extremal graph theory. Zbl 1399.05121
Chen, Mingzhu; Zhang, Xiaodong
2018
The periodic solution of compound singular differential equation with delay. Zbl 1099.34528
Zhang, Zhixing; Jiang, Wei
2006
On the system of Diophantine equations $$x^2-6y^2=1$$ and $$y^2-Dz^2=4$$. Zbl 1349.11062
Du, Xiancun; Li, Yulong
2015
Input-to-state stability of nonlinear descriptor systems. Zbl 1221.93100
Ma, He-bao; Kang, Hui-guang
2009
The gracefulness of wheels and fans. Zbl 1230.05255
Liu, Jia-bao; Pan, Xiang-feng
2009
Some new results and problems in spectral extremal graph theory. Zbl 1399.05121
Chen, Mingzhu; Zhang, Xiaodong
2018
On the system of Diophantine equations $$x^2-6y^2=1$$ and $$y^2-Dz^2=4$$. Zbl 1349.11062
Du, Xiancun; Li, Yulong
2015
Augmentation quotients for complex representation rings of point groups. Zbl 1324.20002
Chang, Shan
2014
State-feedback stabilization for a class of high-order stochastic nonlinear systems. Zbl 1274.93274
Qin, Xiaoyan
2012
Input-to-state stability of nonlinear descriptor systems. Zbl 1221.93100
Ma, He-bao; Kang, Hui-guang
2009
The gracefulness of wheels and fans. Zbl 1230.05255
Liu, Jia-bao; Pan, Xiang-feng
2009
The periodic solution of compound singular differential equation with delay. Zbl 1099.34528
Zhang, Zhixing; Jiang, Wei
2006
all top 5

#### Cited by 17 Authors

 5 Chang, Shan 1 Fu, Ruiqin 1 Guo, Hangtian 1 Huang, Shoudong 1 Lin, Huiqiu 1 Liu, Hang 1 Lu, Xuanzhu 1 Men, Bo 1 Qin, Xiaoyan 1 Sun, Caiyun 1 Wang, Tao 1 Wei, Jing 1 Wei, Xuting 1 Yang, Hai 1 Zhang, Qingling 1 Zhao, Yanhua 1 Zhou, Juan
all top 5

#### Cited in 10 Journals

 2 Proceedings of the Indian Academy of Sciences. Mathematical Sciences 1 Czechoslovak Mathematical Journal 1 Journal of Algebra 1 Chinese Annals of Mathematics. Series B 1 Linear Algebra and its Applications 1 International Journal of Robust and Nonlinear Control 1 Mathematical Problems in Engineering 1 Wuhan University Journal of Natural Sciences (WUJNS) 1 International Journal of Number Theory 1 International Journal of Differential Equations
all top 5

#### Cited in 9 Fields

 5 Associative rings and algebras (16-XX) 5 Group theory and generalizations (20-XX) 2 Combinatorics (05-XX) 2 $$K$$-theory (19-XX) 2 Systems theory; control (93-XX) 1 Number theory (11-XX) 1 Commutative algebra (13-XX) 1 Ordinary differential equations (34-XX) 1 Probability theory and stochastic processes (60-XX)


text:
# How does gravity behave outside the geoid?

I was watching a program about the geoid recently and the relative "height" of the Himalayan plateau gave me an idea. It makes sense for the geoid to be "highest" (is that the correct term?) there as there is more mass underneath you than in other places, however I remembered from physics that your distance from the center of the earth effects gravity as well.

So if you were on the peak of Mount Everest what would have a stronger impact on your weight as compared to say sea level at a comparable latitude (to control for the spin of the earth), there being more mass underneath you, or you being further from the center of the earth? In other words, would you feel slightly lighter or slightly heavier?

I tried working it out myself, but I haven't done any calculus in over fours years, so I couldn't figure it out.

-

Well, let us estimate. The Everest mountain under you is of order $h\sim 10 \textrm{km}$ thick. And lets say it has the same density as the Earth on average.

Everest creates the gravity force, which is guaranteed to be smaller than that created by a spherical shell of thickness $h$ and radius $R_{Earth}$ (because the additional material under you would only add up to gravity).

Now, the gravity force(acceleration) from the Earth is $g=\dfrac{G M_{Earth}}{R^2}=\dfrac{4\pi G\rho R^3}{3R^2} = \dfrac{4}{3}\pi G\rho R$. The gravity from the shell is $\delta g = \dfrac{G m_{shell}}{R^2}=\dfrac{4\pi G \rho R^2 h}{R^2}=4\pi G \rho h$.

The relative importance of the forces is then $\dfrac{\delta g}{g}=\dfrac{3h}{R}\sim\dfrac{30}{6000}=0.005$.

You may also check that the mountain will produce approximately two times smaller gravity force than a spherical shell we considered, which yields two times smaller answer.

Generally, gravity is something which is caused by all pieces of objects you consider, rather than only by the nearest ones.

-

My calculations show these two effects are both of order $\delta R/R$ and hence approximately equal. If Mount Everest is a pole, you would be lighter at the top. If it were a complete shell, you would be heavier, as mass increases as the cube and the force decreases as the inverse square, so the increase wins. You can calculate exactly if you assume that Mt Everest is a sphere, like a pea on a basketball. in this case, the decrease will be very nearly twice the increase so you would be slightly lighter. But if Mt Everests effective gravity is nearly twice as strong as the sphere, the two effects will cancel and you will weigh the same as if there were no mountain. So the result depends critically on the size, shape and density of Mt Everest.

If R is the radius of the earth and if r is the radius of the sphere substituting for Mt Everest, then the base case is $R^3/R^2$ , the base plus decrease is $R^3/(R+2r)^2$, and the increase is $r^3/r^2$. All times the same constant, which is $4 \pi G \rho /3$ as in the previous answer.

Put everything on a common denominator and expand to see the conclusion.

-


text:
# Posts

### July 25, 2014

+
Jesus I’m tired of myself. I’m tired of wanting to be right. Tired of wanting people to agree with me. Tired of arguing and striving. I’m doing it completely wrong. All of it. When I first got sober, there was an enormous relief that I felt in so many things. Relief that I didn’t have […]
+
When reading the presentation of Rod Kennedy on Kernel-Based Formulations of Spatio-Spectral and Three Related Transforms on the Sphere featured in the Science on the Sphere workshop, I was reminded of this earlier blog entry ( It's Friday afternoon, it's Hamming's time: Antipode Seismic Maps ? )Could the second map be roughly approximated through the use of correlation between zero-th, first and higher order harmonic on the sphere ? Join the CompressiveSensing subreddit or the Google+ […]
+
Marco just sent me the following:Dear Igor,could you be so kind to post the attached CFP  (last call for contributions - TCMM 2014) on Nuit Blanche?kind regardsMarco--dr. Marco SignorettoFWO research fellow,ESAT - STADIUS,Katholieke Universiteit Leuven,Kasteelpark Arenberg 10, B-3001 LEUVEN - HEVERLEE (BELGIUM)Homepage: http://homes.esat.kuleuven.be/~msignore/Sure Marco, here is the call:                        […]
+
No summary available for this post.
+
Fast matrix completion without the condition number by Moritz Hardt, Mary WoottersWe give the first algorithm for Matrix Completion whose running time and sample complexity is polynomial in the rank of the unknown target matrix, linear in the dimension of the matrix, and logarithmic in the condition number of the matrix. To the best of our knowledge, all previous algorithms either incurred a quadratic dependence on the condition number of the unknown matrix or a quadratic dependence on the […]
+
Managing Communication in New Product Development Process: Virtual R&D Teams and Information TechnologyUnited Kingdom - Malaysia - Ireland Engineering Science Conference, pp. 495-502, 2011Nader Ale Ebrahim ,Shamsuddin Ahmed ,Salwa Hanim Abdul Rashid andZahari Taha Department of Engineering Design and Manufacture, Faculty of Engineering, University of Malaya (UM)Research Support Unit, Centre of Research Services, Institute of Research Management and Monitoring (IPPP), University of […]
+
Managing Communication in New Product Development Process: Virtual R&D Teams and Information TechnologyNader Ale Ebrahim, Shamsuddin Ahmed, Salwa Hanim Abdul Rashid and Zahari Taha Department of Engineering Design and Manufacture, Faculty of Engineering, University of Malaya (UM)Research Support Unit, Centre of Research Services, Institute of Research Management and Monitoring (IPPP), University of Malaya (UM), University of Malaya (UM), University of Malaya (UM) -

### July 24, 2014

+
No summary available for this post.
+
I have often joked to the older son that I learned, far too late, that I didn’t have to do everything perfectly: I just had to do it better than everyone else. While that statement reeks of hubris, it comes with an extremely large side of truth.  More importantly, it was something that enabled me to […]
+
Over at Complex Roots, I’m closing up shop after deciding I don’t have what it takes to make that place in my vision.
+
An elderly Wisconsin man who had been missing three days was found with the help of a drone. Continue reading →
+
There used to be the Six Million Dollar Man, but now with inflation and all, we have the 200 Million Dollar Assumption. In some of the Slides from the workshop on Science on the Sphere, you may have noticed this slide from Tom Kitching on Weak lensing on the sphereI went ahead and asked Tom what he meant by mentioning a 200M$assumption, here is what he responded:Dear Igor,Thank you for your email.The the plot on the slide is from this paper http://arxiv.org/pdf/1007.2953.pdf where we […] + Hydraulic fracturing (“fracking”) has flipped the global energy discussion on its head. Over the past five years, the world has watched the U.S. shift its focus from fears of peak oil and... -- Read more on ScientificAmerican.com + The new iPhone could replace your wallet. + A specially outfitted marine vessel will destroy the most dangerous chemicals at sea. + A new motion-capture technique could make 3-D movies easier to capture. + No summary available for this post. + In 2005, an estimated 4.1 million people worldwide were newly infected with human immunodeficiency virus (HIV) (UNAIDS 2006). – Rupp, Rosenthal and Stanberry, 2007 Who am I? My name is SPL 7013. I am the active ingredient in those fancy new “HIV-killing condoms” you’ve been hearing about on Facebook and Twitter. The Washington Post claimed I could kill the human immunodeficiency virus (HIV) that causes AIDS. That is not true, for several reasons which I will […] + How to Promote Your ArticleNader Ale Ebrahim Department of Engineering Design and Manufacture, Faculty of Engineering, University of Malaya (UM); Research Support Unit, Centre of Research Services, Institute of Research Management and Monitoring (IPPP), University of Malaya (UM)June 23, 2014University of Malaya Research Bulletin, vol. 1, no. 1, 23 June, 2014. doi: 10.6084/m9.figshare.1083502 Abstract: Writing an article for online distribution in a way that maximized […] + Laurent Duval just sent me the following:Dear IgorNuit Blanche is a nest of choice for many sparsities. The ones of concern here are those approximated by an$l_1/l_2\$, or Taxicab/Euclidean norm ratio, which was already covered in some of your posts: http://nuit-blanche.blogspot.fr/2012/04/compressive-sensing-this-week.htmlhttp://nuit-blanche.blogspot.fr/2012/03/old-and-new-algorithm-for-blind.htmlhttp://nuit-blanche.blogspot.fr/2008/05/cs-kgg-explanation-of-l0-and-l1.html We propose […]
+
How to Promote Your Article Ale Ebrahim, NaderHow to Promote Your Article., 2014[Newspaper/magazine article] TextHow to promote article - UM Bulletin Vol 1 2014.pdf - Published versionDownload (370Kb) | Preview Official URL: http://um.edu.my/doc/research/Vol12014/#p=38 http:...English abstractWriting an article for online distribution in a way that maximized the chances of citation hits, is different from preparing one for print journals in […]

### July 23, 2014

+
“Let me start with an audacious assertion:  A major problem confronting science journalists is that they have trouble communicating what’s true. Even when competing claims are wildly lopsided — think climate change, for example — science journalists feel that they cannot tell their audience that one of the claims is surviving scientific scrutiny better than others.” – Sharon Dunwoody, on SciDev.net SciDev.net recently posted an excellent piece by Sharon […]
+
No summary available for this post.
+
Sometimes energy issues aren’t partisan, but are still poorly understood. According to the Spring 2014 UT Energy Poll, 84 percent of Americans say they are concerned about the cost of gasoline,... -- Read more on ScientificAmerican.com
+
An accelerant forces air bubbles into the batter, which helps the cake rise without baking soda or baking powder. Continue reading →
+
From a discussion of the Hemingway app on Hacker News, jaxn writes, Could someone create a gmail plugin to filter my outgoing emails through this. Maybe it would help to make my emails clearer and more persuasive. To which fl0wenol replies, No, because instead of discerning if you're a dullard by the quality of your writing at a glance, I'll instead have to stumble through mechanically de-voiced inanity. At least without Hemmingway your stream-of-consciousness as committed to typed form can be […]
+
A couple of online conversations have me thinking. I’m about to put forth a fairly long “No True Scotsman” description of alcoholism. I am friends with a bunch of neuroscientists. Many of them study addictions. I am not going to pretend that I understand the first thing about neuroscience. I don’t even understand basic cell biology […]
+
The webpage of the EADS Summer School on Hashing: Theory and Applications that took place on July 14-17, 2014 at University of Copenhagen, Denmark, now features the slides of the presentation made there:OVERVIEW AND GOALHashing is used everywhere in computing and is getting increasingly important with the exploding amount of data. The summer school will provide an in-depth introduction to hashing, both theory and applications. The topics range will from modern theory of hashing, […]
+
Hydraulic fracturing (“fracking”) has flipped the global energy discussion on its head. Over the past five years, the world has watched the U.S. shift its focus from fears of peak oil and... -- Read more on ScientificAmerican.com
+
A new wireless monitoring device provides early warnings to medical staff when a patient's health is suffering.


text:
What is the improper integrals 1/(x^2+2x+2) dx from 0 to +infinity ? .

Jun 1, 2018

$\textcolor{b l u e}{{\int}_{0}^{+ \infty} \frac{1}{{x}^{2} + 2 x + 2} \cdot \mathrm{dx} = {\lim}_{b \rightarrow + \infty} {\int}_{0}^{b} \frac{1}{{x}^{2} + 2 x + 2} \cdot \mathrm{dx} = 3 \frac{\pi}{4}}$

Explanation:

show below:

${\int}_{0}^{+ \infty} \frac{1}{{x}^{2} + 2 x + 2} \cdot \mathrm{dx} = {\lim}_{b \rightarrow + \infty} {\int}_{0}^{b} \frac{1}{{x}^{2} + 2 x + 2} \cdot \mathrm{dx}$

${\lim}_{b \rightarrow + \infty} {\int}_{0}^{b} \frac{1}{{x}^{2} + 2 x + 1 + 1} \cdot \mathrm{dx} =$

${\lim}_{b \rightarrow + \infty} {\int}_{0}^{b} \frac{1}{{\left(x + 1\right)}^{2} + 1} \cdot \mathrm{dx} = {\lim}_{b \rightarrow + \infty} {\left[\arctan \left(x + 1\right)\right]}_{0}^{b} =$

${\lim}_{b \rightarrow + \infty} \left[\arctan \left(a + 1\right) + \arctan \left(1\right)\right] = \left[\arctan \left(+ \infty\right) + \frac{\pi}{4}\right]$

$\frac{\pi}{2} + \frac{\pi}{4} = 3 \frac{\pi}{4}$


text:
# 20 c 25 /25 compictc) 'Scoie: 86 f 490 _Sccte: 0 0/ 1 ptTutaluQucetkn HlebBus Econ 5 60Ihlnel Laepr Featt

###### Question:

20 c 25 /25 compictc) ' Scoie: 86 f 490 _ Sccte: 0 0/ 1 pt Tutalu Qucetkn Hleb Bus Econ 5 60 Ihlnel Laepr Featt eeete Mleqlla Mcet trtbulr Hutel CeE ollldt AuInr mniel Mananlc 76 Amioucit in cnubulsin Qou Juniouidigu AMLmI Iro 1| r0% 0f 573 covnpounded stnamiualy? ninickehonantenl' Htname vc Mlenl Dccme auruhlolxo dcall! Heraua

#### Similar Solved Questions

##### Challenge Problem I: The following compound is amphoteric, able to act as either E weak acid or a5 wcak base as shown:a) Indicate the hybridization at each carbon and each oxygen in the neutral (parent) compound and the geometry at each central atom. Draw all resonance structures for each compound. Rank each resonance form in order of 'decreasing order of its contribution towards representing the true structure of the compound, explaining the chemical basis for your 'rankings: You may
Challenge Problem I: The following compound is amphoteric, able to act as either E weak acid or a5 wcak base as shown: a) Indicate the hybridization at each carbon and each oxygen in the neutral (parent) compound and the geometry at each central atom. Draw all resonance structures for each compound....
##### In the circuit shown, the voltage of the (ideal) battery is V = 39 V, and...
In the circuit shown, the voltage of the (ideal) battery is V = 39 V, and the resistances are R1 = 83 Ω , R2 = 58 Ω , R3 = 146 Ω , and R4 = 371 Ω . What is the voltage across the resistance R2? Give your answer in Volts to at least three significant figures, to avoid being co...
##### Among fatal plane crashes that occurred during the past 70 years, 446 were due to pilot...
Among fatal plane crashes that occurred during the past 70 years, 446 were due to pilot error, 63 were due to other human error, 587 were due to weather, 243 were due to mechanical problems, and 198 were due to sabotage. Q Construct the relative frequency distribution. What is the most serious threa...
##### In a population of fish, body coloration varies from a light shade, almost white, to a very dark shade of green. If changes in the environment resulted in decreased predation of individuals withthe lightest coloration, this would be an example of ____________ selection.a. diversifyingb. stabilizingc. directionald. sexuale. artificial
In a population of fish, body coloration varies from a light shade, almost white, to a very dark shade of green. If changes in the environment resulted in decreased predation of individuals with the lightest coloration, this would be an example of ____________ selection. a. diversifying b. stabilizi...
##### Artoodret (graphite)(s) 1 1 oxygen(g) following reaction, how carbon many dioxide(g) grams UnerdL 0f 282 1 Loq4RJ[O (graphite)
Artoodret (graphite)(s) 1 1 oxygen(g) following reaction, how carbon many dioxide(g) grams Unerd L 0f 282 1 Loq4RJ[O (graphite)...
##### Chapters 7, 8, 9 - Bacterial Growth & Metabolism (some chapter sections will be covered in...
Chapters 7, 8, 9 - Bacterial Growth & Metabolism (some chapter sections will be covered in lab) Prerequisite: Basic catabolic pathways (respiration and fermentation) and anabolic reactions (photosynthesis) BACTERIAL GROWTH AND CONTROL- Some of these topics will be covered in greater detail durin...
##### The figure shows a circuit containing three switches, labeled S1, S2, and S3. Find the current...
The figure shows a circuit containing three switches, labeled S1, S2, and S3. Find the current at "a" for all possible combinations of switch settings. Put e = 90 V, R1 = 20 Ohm, and R2 = 10 Ohm. Assume that the battery has no resistance. a. Current at "a" for S1 and S3 closed, S2 op...
Exercise 12-15B Direct: Computing cash flows LO P5 Case X: Case Zt Compute cash received from customers: Sales Accounts receivable, December 31, 2018 Accounts receivable, December 31, 2019 Compute cash paid for rent: Rent expense Rent payable, December 31, 2018 Rent payable, December 31, 2019 $790,0... 1 answer ##### CAN You SHow Formula and Slep Step Pleag 3. Light, which is emitted from a gas... CAN You SHow Formula and Slep Step Pleag 3. Light, which is emitted from a gas sample, is incident on a diffraction grating with 700 lines/cm. The antinodes appear on a screen 1.25 m away and the antinodes are separated by 2.90x102 m. (a) What is the wavelength of the light? (3 marks) (b) What is th... 1 answer ##### Is 'Kudos' an informal word? I found some references that were telling that it's an informal word. Can I use it in formal language, for example in IELTS speaking test?... 1 answer ##### Please re-answer all parts of the question if possible. I really don't know if any off... Please re-answer all parts of the question if possible. I really don't know if any off my numbers are correct at all. Let x be a random variable that represents the percentage of successful free throws a professional basketball player makes in a season. Let y be a random variable that represents... 1 answer ##### 10_ (10 pts) Suppose that a0, C1, is bounded sequence of real numbers_ Show that Ck_o 2k converges to a continuous function on all of R 10_ (10 pts) Suppose that a0, C1, is bounded sequence of real numbers_ Show that Ck_o 2k converges to a continuous function on all of R... 1 answer ##### What is the charge Q1? Express your answer to three significant figures and include the appropriate... What is the charge Q1? Express your answer to three significant figures and include the appropriate units. Constants Two small nonconducting spheres have a total charge of Q- 1Q 95.0 C, Q1Q2. When placed 22.0 cm apart, the force each exerts on the other is 13.0 N and is repulsive. -Value Units Submi... 5 answers ##### Use cylindrical coordinates and an integral to show that thecentroid of a right circular cone of height H and radius R islocated at height 4/H on the central axis Use cylindrical coordinates and an integral to show that the centroid of a right circular cone of height H and radius R is located at height 4/H on the central axis... 5 answers ##### @ukkbmkwKKbMEOKE EB @EDEemKRRISRM 0S @EeRR ESRRELEERREEEEM ANHMLEEREREHPYEHRLMMEELE KMNNNNAEMHRMHMMNGMGMHDKomGMHnHHBEU DNAUEARHKMMHHKHKRHNANHANKRHHHNNLKRHKHHHHHHNEHHDUNNKNNNHNHHKHHHKHHHMHMNKMHMA KHHEUEERMMNMMHKHHHMMHRHUHHMNHMMHHHHMMMMHHMMHMN KKEGLEUEUUHE MHHMHHRHHHHMELH MHMMNHMNHNSH HNGERRNEEHEMARALMMRMEMMMMMMKMMMMMMM EKhkHEMKHMIHM @ukkbmkwKKbMEOKE EB @EDEemKRRISRM 0S @EeRR ESRRELEERREEEEM ANHMLEEREREHPYEHRLMMEELE KMNNNNAEMHRMHMMNGMGMHD KomGMHnHHBEU DNAUEARHK MMHHKHKRHNANHANKRHHHNNLKRHKHHHHHHNEHHDUNNKNNNHNHHKHHHKHHHMHMNKMHMA KHHEUEERMMNMMHKHHHMMHRHUHHMNHMMHHHHMMMMHHMMHMN KKEGLEUEUUHE MHHMHHRHHHHMELH MHMMNHMNHNSH HNGERRNEEHEMAR... 1 answer ##### Calculate the density of bromine if 586g of the substance occupies 188mL Calculate the density of bromine if 586g of the substance occupies 188mL... 5 answers ##### 3.3 Bonus: The determinant as a homomorphism The set GLn(R) of invertible matrices with real entries forms a group. The determinant of a matrix can be thought of as a map det GLn(R) _ R* where R* is the group R 0 under multiplication_ Since det AB det Adet B, det is a homomor- phism .Show that the set L of matrices with the formM =where det M  0is a subgroup of GL2(R)b) Give a geometric description of the quotient group L/ ker (det). (Of course, we re thinking of det as map from L to R*.) 3.3 Bonus: The determinant as a homomorphism The set GLn(R) of invertible matrices with real entries forms a group. The determinant of a matrix can be thought of as a map det GLn(R) _ R* where R* is the group R 0 under multiplication_ Since det AB det Adet B, det is a homomor- phism . Show that the ... 1 answer ##### A couple has narrowed down the choices of a name for their new baby to 5... A couple has narrowed down the choices of a name for their new baby to 5 first names and 7 middle names. How many different first- and middle-name arrangements are possible? There are different possible first- and middle-name arrangements. (Type a whole number.)... 5 answers ##### Use the Quadratic Formula and calculator to find all real soutions roundeothree decima(Enter your answers as comma-separated list .therereal solution_ enter NO REAL SOLUTION2.457* 1.250 Use the Quadratic Formula and calculator to find all real soutions roundeo three decima (Enter your answers as comma-separated list . there real solution_ enter NO REAL SOLUTION 2.457* 1.250... 1 answer ##### For each of the following chemical structures a 'H-NMR spectrum is provided on the following 3... For each of the following chemical structures a 'H-NMR spectrum is provided on the following 3 pages. Match each compound with its 'H-NMR spectrum. Draw the structure above the corresponding spectrum and clearly assign the chemical shifts to the appropriate protons on the molecule. CH, CH, C... 5 answers ##### What asymptote does the graph of y = l0g2 4 (x 3) + 4 have and what is its equation? Possibilities: Vertical: x = 3 b) Horizontal: y = 4 Vertical: x = -3 Vertical: x = 2 Horizontal: y = 2 What asymptote does the graph of y = l0g2 4 (x 3) + 4 have and what is its equation? Possibilities: Vertical: x = 3 b) Horizontal: y = 4 Vertical: x = -3 Vertical: x = 2 Horizontal: y = 2... 5 answers ##### Scor: 01 1 pt 40.32040*22 I6 complote)SuLcor- Ihalcn Janujry Vuuhaun G{ jcot 4 cldu: GATO Cxalloin - Elttt ,70tu mukn inoy 7lueric-_ncut ~Dtuln pecornoe 0 yoar Istal {ymoci Irc7i PIn (bJi Etuna7 monli} pa, 79ni n Thu Tounahninut [email protected] oln 1 *c Asaun ^ Eal You Iaa n0 adc ror U chArzo4 I [nr Card ior Scor: 01 1 pt 40.32 040*22 I6 complote) SuLcor- Ihalcn Janujry Vuuhaun G{ jcot 4 cldu: GATO Cxalloin - Elttt ,70tu mukn inoy 7lueric-_ncut ~Dtuln pecornoe 0 yoar Istal {ymoci Irc7i PIn (bJi Etuna7 monli} pa, 79ni n Thu Tounahninut Fnetnnt FIR= [email protected] oln 1 *c Asaun ^ Eal You Iaa n0 adc ror U chAr... 5 answers ##### How do I write and start each equation showing my work?(pre-calculus) How do I write and start each equation showing my work?(pre-calculus)... 5 answers ##### Boxplot of Concentration10057 Boxplot of Concentration 100 5 7... 5 answers ##### Problem 2 [22 points]: Consider simple linear regression Y; = Bo+ Bx;+e; i=1,2,3and 4_22 1/4 22 22 22 1/4 22 1/4 The hat matrix is given by H = 5/12 22 22 22 22 22 22 11/12 (a) [15 points] Fill in ALL the missing values from the hat matrix H. (Note: H is idempotent): (b) [7 points] Given thatx = 9.50 and x=(x +X2 +X, +x4)/4=2.50_ On the real line (like the one below with 0 included), put down the rough locations of xu Xz Xz X4 and X Problem 2 [22 points]: Consider simple linear regression Y; = Bo+ Bx;+e; i=1,2,3and 4_ 22 1/4 22 22 22 1/4 22 1/4 The hat matrix is given by H = 5/12 22 22 22 22 22 22 11/12 (a) [15 points] Fill in ALL the missing values from the hat matrix H. (Note: H is idempotent): (b) [7 points] Given thatx = 9.... 5 answers ##### 10. When a substance condenses (g - 1) below its boiling point at 1 atm; what are the signs of 4, W, 4Ssys and 4Suniv? A t,+, B. +,3++ C. -+,+,+ D. 3+,-t E: 10. When a substance condenses (g - 1) below its boiling point at 1 atm; what are the signs of 4, W, 4Ssys and 4Suniv? A t,+, B. +,3++ C. -+,+,+ D. 3+,-t E:... 5 answers ##### @uer_the folluwing questions: Right the object of this experiment: ccMtin;r 0ha.As shown from your graph; describe the relationship between and _ JZRH77k:By comparing the equation of straight line and obm' 1aw. lind 4 oltionship between the slope and m =.R_Erom xuur_eqh: determine the value of Rcrp squixilenLresistance cxperimcntallyFind the equivalent resister Rmhe theoreticullx for the resistor'$ that were used and which it is deterined by using the multimeter to determinc the valuc
@uer_the folluwing questions: Right the object of this experiment: ccMtin;r 0ha. As shown from your graph; describe the relationship between and _ JZRH77k: By comparing the equation of straight line and obm' 1aw. lind 4 oltionship between the slope and m =.R_ Erom xuur_eqh: determine the value ...
##### A child psychologist believe that controlled physical outbursts of anger (like punching a pillow) may improve...
A child psychologist believe that controlled physical outbursts of anger (like punching a pillow) may improve the mood of young boys with emotional impairment. He believes that the proportion of boys who benefit from the treatment is greater than the proportion of girls. A random sample from each po...
##### 1.Make the following molecules using your molecular model kit, and their associated structural isomers (if any)Ethane(Cnecked off by Instructor) Draw the different condensed forms in the pace deiowb. Cyclobutane;(Checked off by Instructor) Draw the different condensed forms in the space below3-methyl pentane (Checked off Dy Instructor)0.2- Cnloro propaneDraw 4-isopropyl metnyl neptane in tne space below
1.Make the following molecules using your molecular model kit, and their associated structural isomers (if any) Ethane (Cnecked off by Instructor) Draw the different condensed forms in the pace deiow b. Cyclobutane; (Checked off by Instructor) Draw the different condensed forms in the space below 3-...
##### Find the doubling time of an investment earning 3% interest if interest Is compounded continuously: The doubling time of an investment earning 3% interest if interest is compounded continuously is years. (Round t0 the nearest tenth of a year:)
Find the doubling time of an investment earning 3% interest if interest Is compounded continuously: The doubling time of an investment earning 3% interest if interest is compounded continuously is years. (Round t0 the nearest tenth of a year:)...
##### What is the role of the Bromide in the given partial mechanism of Hell-Volhard-Zelinksi Reaction:Br P BrBr 'Lewis acidLeaving groupLewis baseBronsted base
What is the role of the Bromide in the given partial mechanism of Hell-Volhard-Zelinksi Reaction: Br P Br Br ' Lewis acid Leaving group Lewis base Bronsted base...
##### Which species will reduce Mn3+ to Mn2+ (Ecell = 1.51 V) but will NOT reduce Cr3+...
Which species will reduce Mn3+ to Mn2+ (Ecell = 1.51 V) but will NOT reduce Cr3+ to Cr2+ (Ecell = -0.40 V)? (Can you explain with steps on how to find the correct answer, and why the other answers are not correct?)...
##### Write 8 of 11 ent Score: the equation 54.106 the reaction L with theWrite the equation for the reaclion associuled Lhe of the curbonale iOn; 80 of sulfuric acid, Rasourcuscheck Answer
Write 8 of 11 ent Score: the equation 54.106 the reaction L with the Write the equation for the reaclion associuled Lhe of the curbonale iOn; 8 0 of sulfuric acid, Rasourcus check Answer...


text:
## add_rewrite_rule query_var not being set

Question

I have an unusual use of add_rewrite_rule (is there a usual use?) and I am getting some unexpected behavior. First here is my code:

if(!empty($list_view_template)) add_rewrite_rule( "{$list_view_template}/(.*)?",
'index.php?mlscrit=$matches[1]/list-view/&pagename=' .$list_view_template,
'top'
);

function mls_declare_mls_custom_vars() {
}

so as you can see I am using a pagename set within the admin dashboard to a variable called \$list_view_template to limit a rewrite rule. This works fine so long as I flush rewrite rules after I update the value (which I do). The problem is with the query variable mlscrit. When I run this through Jan Fabry’s excellent rewrite analyzer, https://wordpress.stackexchange.com/a/3608/27556, it gives me what I expect, mlscrit = ‘/list-view/’ plus whatever is in the regex even if the regex is empty.

However if I do this:

add_action( 'template_redirect', 'mls_feed_rewrite_catch' );
function mls_feed_rewrite_catch()
{
echo 'mlscrit: ' . get_query_var('mlscrit' );
}

and the regex has something in it, it works. But if the regex is empty, the variable also loses the ‘/list-view/’ part such that it is empty.

Can anyone explain to me why this would be the case?

I should also mention I have tried hardcoding the pagename, I have tried using the query_var filter in lieu of the add_rewrite_tag and I have tried grabbing the value of mlscrit in a bunch of different places and I always get the same answer, mlscrit is empty unless there is something in the regex.

Thank you!

Matthew

0
8 years 2014-03-11T20:36:03-05:00 0 Answers 65 views 0


text:
S-arithmetic subgroup question

I've been reading a proof concerning S-arithmetic subgroups of algebraic groups and I'm having trouble determining why the following step should be true. First, the setup:

Let $G$ be a connected absolutely simple adjoint algebraic group defined over a nonarchimedean local field $F$. Let $K \subset F$ be a global field and let $v_0$ be the pullback of the normalized valuation on $F$ using the embedding $K \hookrightarrow F$. Let $S$ be a set of discrete valuations on $K$ such that $S$ contains all archimedean places and does not contain any place where $G$ is anisotropic. Let $\mathcal{O}_K(S)$ be the ring of $S$-integers in $K$. Let $\Gamma = G(\mathcal{O}_K(S))$.

Let $\displaystyle G_S = \prod_{v \in S} G(K_v)$.

We are given that $\Gamma$ is discrete in $G(K_{v_0})$. We know from Margulis' "Discrete Subgroups of Semisimple Lie Groups," Theorem 3.2.5, that $\Gamma$ is a lattice in $G_S$.

The paper I'm reading concludes that $G(K_v)$ must be compact for all $v \in S \setminus \{ v_0 \}$. The thing that I'm having difficulty understanding is how this follow from the discreteness of $\Gamma$ and the fact that $\Gamma$ is a lattice in $G_S$. Can someone point me in the right direction?

-
That $\Gamma$ is a lattice is due to Borel and Harish-Chandra in the early 60's. –  Yves Cornulier Mar 5 at 21:38
I think that you need to elaborate a bit more (maybe point to the article? or at-least say something about $char(F)$?). Anyway, it sounds very similar to one of the steps in the proof of the Arithmeticity theorem, where Margulis' shows that the $p$-adic embeddings must be pre-compact. –  Asaf Mar 5 at 22:29
This is strong approximation. $\Gamma$ is an $irreducible$ lattice in the product group $G_S$. If there is more than one place $v$ in $S$ other than $v_0$ where $G(K_v)$ is not compact, then the projection of $\Gamma$ to $G(K_{v_0})$ is dense, and therefore cannot be discrete. Margulis' book itself may contain this result that $\Gamma$ is an irreducible lattice. Otherwise, you may look at the book by Platonov and Rapinchuk "Algebraic Groups and Number Theory" where these facts are explained and proved.
I have assumed, in using strong approximation, that $G$ is $simply \quad connected$. You are assuming that $G$ is of adjoint type. However, once you conclude that $G(K_v)$ is compact for all other places for th simply connceted group, the same follows for the adjoint group.
@joshschw: No problem. Glad to be of help. @ Martel: yes, strong approximation is used $p$-adically, tp prove versions of the "Chinese remainder theorem" (strong approximation for unipotent groups), and in this case, could be used to prove denseness of images at archimedean places. –  Aakumadula Mar 6 at 3:09