text:
## Monday, April 27, 2009

### Nomenclature in Latex Made Easy

As pretty as Latex documents are, for 40 years of development you'd think they'd have made all this automatic. I'm using Texmaker to generate the Latex output and a BATCH file to generate the nomenclature. The Latex syntax you'll need can be found here.

In the directory where the Latex file is located create a BATCH file (a text document with the extension changed to .bat) with the following command

makeindex.exe filename.nlo -s nomencl.ist -o filename.nls

replace 'filename' with the name of the tex file. For example if the tex file is called 'glossary.tex' then the BATCH file command would look like

makeindex.exe glossary.nlo -s nomencl.ist -o glossary.nls

The process is 3 steps,
1) Run Latex on the document to identify the nomenclature,
2) build the nomenclature by double clicking on the BATCH file,
3) print the nomenclature to the output file by running Latex on the document again

The process should similar for generating indexes and glossaries except the Latex syntax is a little different. They all use the makeindex.exe command so they all need different identifiers.

UPDATE:  Hello All.  This post seems to have been quite helpful to many exasperated LaTeX users.  I'm very happy to help.  I wanted to update it a bit to make it more useful.  The following is an example of the syntax you would use within the document itself

\documentclass{article}
\usepackage{nomencl}
\makenomenclature
\begin{document}
\section{Example}
This is how we would use the nomenclature
\nomenclature{$a_0$}{speed of sound}%
\nomenclature{$b$}{chamber radius}%
\nomenclature{$c_p$}{specific heat}%
\printnomenclature
\end{document}

There is one problem with this:  Greek letters don't always alphabetize correctly in the nomenclature.  For instance $\eps$ is alphabetized by 'e' but $\vareps$ is alphabetized by 'v' even though they are different scripts for the same Greek letter.  Also, journals might have a bit of trouble compiling the document with nomenclature like this.  Fortunately, it's not too hard to manually generate nomenclature.  In this case, I follow the format:

\section*{Nomenclature}
\begin{tabular}{ll}
$a$ & $\quad=\quad$speed of sound\\
$b$ & $\quad=\quad$chamber radius\\
$c_p$ & $\quad=\quad$specific heat\\
\end{tabular}

Good luck!

ElSrX said...

Thank you very much! I've been searching for THIS solution for ages, specially the way of executing the line "makeindex.exe glossary.nlo -s nomencl.ist -o glossary.nls".

Thanks, greetings from Spain

Melanie said...

I am sorry but I don't know how to create this BATCH file, can someone maybe explain that? Thanks!

MS

Josh said...

Melanie - to make a batch file right click anywhere in windows explorer and click on
New->Text Document

this makes a text doc that opens in notepad or wordpad. This file can be changed to a batch file by renaming the extension from .txt to .bat

If your computer is set up to hide known extensions (like .txt) then you have to disable that to change the extension to .bat. In windows 7 open windows explorer and click
Organize->Folder and Search Options->View and uncheck "Hide extensions for known file types"

In Vista i think the path is slightly different but the "Folder Options" window is the same

JuanConMiedo said...

This is the best explanation I have found. Thank you very much! You saved me a lot of time.

GIbran said...

Thanks a lot for this. Works well. Took me a while to figure out but was definitely worth it.

Chris Simpson said...

Thank you so much - this was causing me a massive headache.
I'm really new to using LATEX, it's a pretty steep learning curve and help like this is invaluable.

ET said...

Thank you! That was very helpful.

Emily

Riccardo said...

Thank God, finally someone who solves problems! Thanks a lot, I was going crazy, with all the UNIX-oriented guides on the internet.

Christina said...

Thank you SOOOOOOOOOO much for that :)

Christina said...

Thank you !!!!!!!!!!!


text:
# The sign of $\Delta G$ for the process of melting of ice at 273 K and 1 atm pressure is

(a) positive
(b) negative
(c) neither negative nor positive
(d) either negative or positive

Toolbox:
• Melting of ice is spontaneous above 273 K at one atm pressure.
Melting of ice is spontaneous above 273 K at one atm pressure.
At 273 K and 1 atm, there is equilibrium $H_2O(s) \leftrightharpoons H_2O(l)$
Hence, $\Delta G = 0$

format: plain


text:
×

# Hey! Can somebody give me the answer of the following problem..

Which of the following functions of A and B may be performed if A and B possess different dimensions?

(A) A+B

(B) A-B

(C) A/B

(D) A/e^A+B

Note by Hitesh Kumar
2 years, 10 months ago

Sort by:

C · 2 years, 10 months ago

answer to correct hai par aya kaise · 2 years, 10 months ago


text:
# Linear Algebra help

• Mar 3rd 2013, 12:00 PM
Tweety
Linear Algebra help
${v_{1}, v_{2}, v_{3} }$ is a basis for a three dimensional real vector space V. Show that the set ${v_{1} + v_{2} , v_{2} + v_{3}, v_{3}+ v_{1} }$ is also a basis for V.

I am finding it really hard ot understand the concept of finding bases, and my notes dont make sense, am not even sure where to start, do i first find a spanning set ?
• Mar 3rd 2013, 12:16 PM
Re: Linear Algebra help
Note that if $w_1 = v_1 + v_2, w_2 = v_2+v_3, w_3 = v_3+v_1$ then

$w_1-w_2+w_3 = 2v_1$ and so $v_1 = (1/2)(w_1-w_2+w_3)$

The same can be done to find a linear combination of w's for $v_2,v_3$. Can you finish?
• Mar 3rd 2013, 01:39 PM
ILikeSerena
Re: Linear Algebra help
Hi Tweety! :)

To show the new set is a basis for V, you should show that each of the original vectors can be constructed from the new set.
Does that make sense?
• Mar 6th 2013, 08:51 AM
Tweety
Re: Linear Algebra help
so some how show $v_{1}$ = $v_{1} + v_{2}$ ? Still not sure where to start though
• Mar 6th 2013, 08:52 AM
Tweety
Re: Linear Algebra help
Quote:

Note that if $w_1 = v_1 + v_2, w_2 = v_2+v_3, w_3 = v_3+v_1$ then

$w_1-w_2+w_3 = 2v_1$ and so $v_1 = (1/2)(w_1-w_2+w_3)$

The same can be done to find a linear combination of w's for $v_2,v_3$. Can you finish?

But thats not a linear combination ?
• Mar 6th 2013, 09:39 PM
The new set that ILikeSerena is referring to is your new set of w vectors. If you can show that each v vector is a linear combination of w vectors, then you are done. You are done because let t be an arbitrary vector in V. since t is a vector in V, with v's as the basis, t can be expressed as $t = av_1 + bv_2 + cv_3$. If you can show that $v_1,v_2,v_3$ are linear combinations of w vectors, then you can replace each $v_i$ with w's.
I have given you one such combination. (Verify by replacing each w vector by the sum of v vectors and algebra) In this case by simple replacement $t = a[(\frac{1}{2})(w_1-w_2+w_3)] + bv_2 + cv_3$
Combine like terms after you express $v_2$ and $v_3$ in terms of w's and observe the arbitrary vector t in the vector space V is a linear combination of w's, hence the set of w vectors is a basis.


text:
# Draw a line segment of length $12.8 \mathrm{~cm}$. Using compasses, divide it into four equal parts. Verify by actual measurement.

#### Complete Python Prime Pack

9 Courses     2 eBooks

#### Artificial Intelligence & Machine Learning Prime Pack

6 Courses     1 eBooks

#### Java Prime Pack

9 Courses     2 eBooks

To do:

We have to divide the line segment $12.8\ cm$ using compasses into four equal parts and verify by actual measurement.

Solution:

Steps of construction:

(i) Let us draw a line segment  $\overline{XY}$ of length $12.8\ cm$.Now, with compasses take a measure greater than half of the length of  $\overline{XY}$.

(ii) Now, by pointing the pointer of the compasses at point X and point Y respectively. let's draw two arcs above the line segment $\overline{XY}$ cutting each other. Similarly, by pointing the pointer of the compasses at point X and point Y respectively. let's draw another two arcs below the line segment $\overline{XY}$ cutting each other.

(iii) Then, let's draw a line segment joining intersecting points of the arcs above and below the $\overline{XY}$ and name the point of intersection of the bisector with  $\overline{XY}$ as C Therefore, C becomes the midpoint of $\overline{XY}$.

(iv) In a similar way take a measure greater than half of the length of  $\overline{CB}$ with compasses. Now, by pointing the pointer of the compasses at point C and point B respectively. let's draw two arcs cutting each other above the line segment $\overline{XY}$.

(v) Similarly, by pointing the pointer of the compasses at point C and point B respectively. let's draw another two arcs cutting each other below the line segment $\overline{XY}$. Then, let's draw a line segment joining intersecting points of the arcs above and below the $\overline{XY}$ and name the point of intersection of the bisector with $\overline{XY}$ as E.

(vi) Therefore, E becomes the midpoint of $\overline{CY}$. In a similar way take a measure greater than half of the length of  $\overline{AX}$ with compasses.

(vii) Now, by pointing the pointer of the compasses at point X and point C respectively. let's draw two arcs above the line segment cutting each other $\overline{XC}$. Similarly, by pointing the pointer of the compasses at point X and point C respectively. let's draw another two arcs cutting each other below the line segment $\overline{XY}$.

(ix) Then, let's draw a line segment joining intersecting points of the arcs above and below the $\overline{XY}$ and name the point of intersection of the bisector with $\overline{XY}$ as D.Therefore, D becomes the midpoint of $\overline{XC}$.

Updated on 10-Oct-2022 13:38:29


text:
Tag: homebrew

The featured image of this blog post has been created by Cryteria, CC BY 3.0, Link

Gdb, the GNU debugger, is probably the most used open source debugger for embedded systems. The AVR version of GDB on the Mac is unfortunately not very cooperative. If you try to read an elf file, you get the following funny message (reminding us of HAL9000):

I’m sorry, Dave, I can’t do that. Symbol format elf32-avr’ unknown.

But with the right homebrew formula, one can teach GDB some new tricks …

EDIT: The problem has been solved by the homebrew maintainers.

Avrdude` is the workhorse for programming AVR chips from Atmel (now Microchip). It works flawlessly on all platforms with a huge number of different programmers. There are a few exceptions, though. The Atmel-ICE, a very decent programmer and debugger, could not be used under macOS (>10.13). But finally there seems to be light …


text:
# Calculate VAT

Easily calculate U.K. VAT amounts using the Oopen calculator for entrepreneurs. You can start with either the including-VAT or without-VAT amounts. Also, it's quite simple to switch between the 5% (reduced rate) or 20% (standard rate) VAT.

£
£
£


text:
# R function for Dynamic Ordinary Least Squares regression

SHORT VERSION: Made a workflow function, want a better output with methods.

General Background

I have been working on a package for some time to eliminate the tedium of preliminary time series econometrics (unit root testing, cointegration, model building and lag/lead selection). I am aware of many alternatives out there but I am still happy with the direction I am going for now. Based off of Stock & Watson.

Function Workflow (simple version)

1. Takes a user-specified cointegrating relationship (written as a formula): $$Y_t = \alpha_t + X_t$$ in R: Y ~ 1 + X where the dependent and independent variables are all nonstationary and alpha is the (optional) constant.

2. Creates the formula $$Y_t = \alpha_t + X_t + \sum_{i = -k}^k \Delta X_{t-i}$$ in R: Y ~ 1 + X + L(diff(X),-k:k) using dynlm's handy L() capabilities (although I do not use D() for diff(). Where k is the maximum lag/lead value.

3. The rest of the function runs different k values and selects the best model using the BIC function (but any model selection function can be put in as an argument). It also computes HAC estimated errors using Newey West.

Code Here is the function. I am very open to criticism/critiques/comments.

Requires packages:

library(dynlm)
library(lmtest)
library(sandwich)

buildDOLS <- function (coint_formula, data, fixedk = NULL, robusterrors = TRUE, selection = BIC){
# checks
stopifnot(is.ts(data)) # time series data
stopifnot(is.null(fixedk)|is.numeric(fixedk)) # fixed k either is null or is numeric
stopifnot(is.function(selection)) # selection method is a function (should work on a function)
#  Formula creation
ff <- coint_formula
all_names <- dimnames(attr(terms(ff), "factors")) # X and Y variables
y_names <- all_names[[1]][!(all_names[[1]] %in% all_names[[2]])]
x_names <- all_names[[2]][all_names[[2]] %in% colnames(data)]
# Dynamic Ordinary Least Squares formulation
ff_LHS <- y_names
ff_RHS <- paste(c(ifelse(attr(terms(ff), "intercept") == 1, "1", "-1"), # constant
x_names, # input variables
paste0("L(diff(", x_names, "),-k:k)")), # sum of lead/lagged differences of x variables
collapse=" + ")
ff_k <- paste(ff_LHS, "~", ff_RHS)
# if k (the maximum number of lags/leads) was not fixed, use a default value
k <- ifelse(is.null(fixedk), floor(dim(data)[1]^(1/3)/2), fixedk)
# run the model. If k was fixed, this is the final model:
DOLS_k <- dynlm(formula(ff_k), data = data)
# If k was not fixed, DOLS_k will be used to keep constant the start and end dates during model selection
if(is.null(fixedk)){
# Use any selection function that is indicated in the selection argument
k_select <- sapply(1:k, function(k) match.fun(FUN = selection)(dynlm(formula(ff_k),
data = data,
start = start(DOLS_k),
end = end(DOLS_k))))
# only re-estimate the model if k_select differs from k to be efficient
if(k != which.min(k_select)){
k <- which.min(k_select)
DOLS_k <- dynlm(formula(ff_k), data = data)
}
# save the selection matrix results inside the model
DOLS_k$selection <- cbind(1:k, k_select, DOLS_k$df + length(DOLS_k$coeff), start(DOLS_k)[1], end(DOLS_k)[1]) colnames(DOLS_k$selection) <- c("# of lags/leads (k)", deparse(substitute(selection)),"#Obs",
"StartDate", "EndDate")
}
DOLS_k$k <- k # save the lag used inside the model # save the HAC estimated errors inside the model if(robusterrors) DOLS_k$HAC <- lmtest::coeftest(DOLS_k, vcov = sandwich::NeweyWest(DOLS_k, lag = k))
# rewriting the call function to be a run on its own
DOLS_k$call <- as.call(c(quote(dynlm), formula = formula(gsub("-k:k", paste0("-",k,":",k), ff_k)), data = substitute(data))) class(DOLS_k) <- append(class(DOLS_k), "workflow") DOLS_k }  Example Case Say we have the cointegrating relationship: MB ~ RTPS from lmtest::valueofstocks. (The interpretation is not important here). dols <- buildDOLS(coint_formula = MB ~ RTPS, data = valueofstocks, fixedk = NULL, robusterrors = T, selection = BIC) dols summary(dols) # the Non-HAC, biased standard errors but model fit results dols$selection # shows the model selection process
dols$k # the result of that process dols$call # a stand-alone call function to replicate results with dynlm
dols$HAC # the HAC estimated standard errors/significance values  Output The output is not ideal as it is hidden within the model. I have written a few methods but would like some feedback. Does it clearly show what is interesting to the user? Is it too long? etc. Print Method Shows model selection and a cleaner eval print.workflow <- function(x) { if(!is.null(x$selection)){
cat("\n    Selecting k for Model\n")
cat("______________________________\n")
print(x$selection) } cat("\n Model with k =",x$k,"\n")
cat("______________________________")
print(eval(x$call)) } dols #** Is it too long? Does it give the important information?  Summary Method Shows HAC estimated errors automatically summary.workflow <- function(x, ...){ if("HAC" %in% names(x)){ # if the function has a robusterrors arg addHAC <- NextMethod(x) # alter the summary coeffs addHAC$coefficients <- x$HAC cat("*Summary table depicts HAC estimated errors found by:\n") cat(paste0("lmtest::coeftest(model, vcov = sandwich::NeweyWest(model, lag = ",x$k,"))\n"))
} else {
warning("\tSummary table does not depict HAC estimated errors\n\tPlease indicate the buildDOLS robusterrors argument to be TRUE")
print(NextMethod(x))
}
}
summary(dols)

Please let me know what you think!

The choice of k, half the cube root, is not obvious. Please cite http://www.ssc.wisc.edu/~kwest/publications/1990/ Automatic Lag Selection eqn. 2.1 (though I still found \gamma hat & parameter a bit mysterious).


text:
## Elementary Algebra

Published by Cengage Learning

# Chapter 3 - Equations and Problem Solving - 3.5 - Problem Solving - Problem Set 3.5 - Page 131: 25

#### Answer

12.5 ml of acid must be added in the solution.

#### Work Step by Step

Let X represent the amount of acid to be added in the 100ml solution. After this amount is added, we obtain a solution with a 20% acid concentration. We use the following guideline to solve this problem: Amount of pure acid in original solution + Amount of pure acid to be added = Amount of pure acid in final solution. So: 10% $\times$ 100ml + X = 20% $\times$ (100+X) .1 x 100mL+X= .2 x (100+X) 10 + X = 20 + $\frac{X}{5}$ 10 = X - $\frac{X}{5}$ 10 = $\frac{4X}{5}$ Multiply both sides by 5 50 = 4X Divide both sides by 4 X = 12.5 ml 12.5 ml of acid must be added in the solution.

After you claim an answer you’ll have 24 hours to send in a draft. An editor will review the submission and either publish your submission or provide feedback.


text:
# Pi Fan Controller

A tiny script allowing temperature controlled Raspberry Pi cooling.

This script is loosely based on work by Edoardo Paolo Scalafiotti found here1, though this is a complete rewrite using the gpiozero library. It also makes use of two temperature variables (a minimum and a maximum), allowing the user to define a temperature range to oscillate within, avoiding rapid on/off switching when trying to stabilize around a single value.

By default, the fan will turn on once the CPU reaches 60°C and will turn off when the temperature returns to 50°C.

Most small fans (like this one) are designed to be run off the Pi’s 5V GPIO pins, however, there is no way to control these pins directly. Instead, we can use a transistor as a switch to turn on and off our fan. I personally used a NPN BJT with its base pin wired to BCM pin 14 (physical pin 8) and then used the ground and 5V power pins right beside it. Edoardo describes something similar in is his write up as well, though I find pin 14 has much better positioning, plus has the benefit of being pulled low by default, meaning your fan will not be spinning when the Pi is shutdown but still receiving power.

The wiring diagram

To install the script, download or clone it from GitHub. Note that you may need to install the Python 3 gpiozero library, especially if you are running the lite version of Raspbian/Raspberry Pi OS. When running locally, line 52 can be uncommented to help with debugging. User variables such as the temperature ranges and the check frequency are all easily available towards the top of the document.

To have the script run on boot, add python3 /path/to/pifancontroller.py & to your rc.local file, making sure to include the ampersand to fork the process as the script runs in an infinite loop.

1. Mirror available here. ↩


text:
# Can matlab be connected with solidity

2022-02-03 23:09:30

solidity Is a development language .

You should want to know MATLAB Connect with the smart contract on the chain .

I didn't MATLAB, But I can tell you , As long as it can be connected, it can interact with the contract .