text:
# Charlesreid1.com Stack

Posted in Charlesreid1

This post is a preview of a series of posts to come, which will document the process of containerizing the entire charlesreid1.com website.

We will run through a lot of different moving parts and how to get them all working:

• Multiple domains and subdomains pointing to different services
• Docker pod for all services
• Nginx + SSL
• Reverse proxies via nginx
• Apache + MySQL + MediaWiki
• Gitea
• Configuration files under version control
• Data managed with backup/restore scripts and cron jobs
• Static content under version control
• Files server
• REST API
• Management LAN

All of the code for doing this is in docker/pod-charlesreid1, in particular in the docker-compose.yml file.

The big switchover took nearly a month, but it was relatively seamless, and only required one false start and a few minutes of downtime.

For now, check out the readme at docker/pod-charlesreid1. More details to come.

# D3 Calendar Visualizations

Posted in Javascript

# Starting example

Let's begin with a D3 example. Mike Bostock provided a Calendar View block illustrating how to draw a very interesting visualization of large amounts of data over time:

You might recognize this type of graph from Github, whose activity graph shows the same visualization.

The data shown in this example consists of several years of stock market data. It is a simple but very large data set, with each data poit consisting of one date and one number (the percentage gain or loss).

The example also shows how to perform a simple calculation from multiple fields of the data to plot a derived quantity. In this case, the data consists of a high, low, and close, and the quantity being plotted is the percent change:

$$\mbox{% Change} = \dfrac{\mbox{Close} - \mbox{Open} }{\mbox{Open}}$$

# What needs to be changed

To change this calendar visualization to visualize our own data, we need to change two things:

• The data set being visualized
• The color map being used

We can leave the rest alone, or make small modifications as needed. Fortunately, these changes are straightforward to make for the calendar visualization.

# Formatting the data

To modify the calendar graph for our own data, we'll output data as a time series: one column of date/time stamps, and another column of data to plot.

Let's take a look at the original data:

Date,Open,High,Low,Close,Volume,Adj Close
2010-10-01,10789.72,10907.41,10759.14,10829.68,4298910000,10829.68
2010-09-30,10835.96,10960.99,10732.27,10788.05,4284160000,10788.05
2010-09-29,10857.98,10901.96,10759.75,10835.28,3990280000,10835.28
2010-09-28,10809.85,10905.44,10714.03,10858.14,4025840000,10858.14
2010-09-27,10860.03,10902.52,10776.44,10812.04,3587860000,10812.04

In the code, we can see where this data is actually being parsed:

  var data = d3.nest()
.key(function(d) { return d.Date; })
.rollup(function(d) { return (d[0].Close - d[0].Open) / d[0].Open; })
.object(csv);

So, to modify this to suit our own custom data set, we can output our data as:

date,series1series2
2010-10-01,1,150
2010-10-02,2,250
2010-10-03,3,350

and change the data parsing code to:

  var data = d3.nest()
.key(function(d) { return d.date; })
.rollup(function(d) {
// Change this depending on what you want to plot
return d[0].series1;
})
.object(csv);

Next, we discuss a few interesting applications of this visualization technique and how to generate the data sets.

## MediaWiki Edits

One of the applications of interest was scraping a MediaWiki wiki (charlesreid1.com/wiki to be precise) to determine the number of edits made to the wiki on a given date.

Fortunately, MediaWiki provides a rich API for interacting with wikis programmatically, and one of the best packages for doing it is pywikibot.

The way we compiled the data set for visualization was to scrape page histories for every page on the wiki, creating one observation for each edit on each page, and agglomerate the edits for each day into a final count.

The schema used was:

• _id - sha1 of text
• title - title of article
• timestamp - timestamp of edit
• count - number of characters in edit

The pseudocode used to extract the page edits was:

    get pages generator
for page in pages:
get page revisions generator
for revision in page revisions:
drop old doc from database
insert new doc into database
update record

Finally, a bit of pywikibot code:

    # Get the site
site = get_site()

# Get the iterator returning pages to process
page_generator = get_page_generator(site, N)

# Run the algorithm:
for page in page_generator:

page_title = page.title()

print("Now parsing page: %s"%(page_title))

rev_generator = page.revisions(content=count_chars)

for rev in rev_generator:

# Assemble the NoSQL document
doc = {}
doc['_id'] = rev.sha1
doc['title'] = page_title
doc['timestamp'] = rev.timestamp
doc['count'] = len(rev.text)

# Insert the new NoSQL document
page_history_collection.insert_one(doc)

The mechanisms to obtain the page generator

def get_site():
"""Get the Site object representing charlesreid1.com
"""
return pywikibot.Site()

def get_page_generator(s,max_items=0):
"""Get the generator that returns the Page objects
that we're interested in, from Site s.
"""
page_generator = s.allpages()
if(max_items>0):
page_generator.set_maximum_items(max_items)
return page_generator

## Git Commits

Another application of these types of calendars comes directly from Github's visualization of the number of commits made by a user on each day.

To extract this information, you will need a folder full of git repositories, which will allow you to use git status to extract commit information from the log of each repository and assemble it all into a time series for a calendar.

While there is a Python package for interfacing with the git API, git itself is extremely powerful and is capable of doing this just fine. We use Python's subprocess library to make a call to git status, and parse the results into a data structure for exporting to CSV.

Here is the code that was used to walk through each directory and extract information from a git status command:

import subprocess
from glob import glob
import os, re
import pandas as pd
import datetime

[clipped]

df = pd.DataFrame()
orgs = glob(root_dir+"/repositories/*")
for org in orgs:
base_org = os.path.basename(org)
repos = glob(org+"/*")
for repo in repos:

# Print out the org and repo name
base_repo = re.sub('.git','', os.path.basename(repo))
log_file = base_org + "." + base_repo + ".log"
print("%s : %s"%(base_org,base_repo))

# Get each commit
with open(status_dir + "/" + log_file, 'r', encoding="ISO-8859-1") as f:

for line in lines:
tokens = line.split(" ")
commit_id = tokens[0]
date = tokens[1]
time = tokens[2]
msg = tokens[4:]

df = df.append(
dict(
commit_id = tokens[0],
date = tokens[1],
time = tokens[2],
commits = 1,
msg = " ".join(msg)
),
ignore_index=True
)

ag = df.groupby(['date']).agg({'commits':sum})
ag['commits'] = ag['commits'].apply(int)
ag.to_csv('commit_counts.csv')

The last bit of code groups each commit by date, applying the sum function to the number of commits (1 for each commit), to yield the total number of commits for each date:

date,commits
2014-01-17,2
2014-03-26,11
2014-03-28,3
2014-04-01,4
2014-04-02,10
2014-04-03,4
2014-04-04,3

# Creating the color map

The best part of the process is picking a color map for the calendar. The ColorBrewer site has some good color palettes inspired by cartographic color needs. Python also provides some useful libraries and functionality for generating colormaps.

There are a number of options:

Here, we'll cover an alternative approach: defining a colormap that linearly interpolates between colors at particular locations on the interval 0 to 1.

We will also use the webcolors module in Python to convert between colors in various formats, and a function make_cmap() available from Chris Slocum:

Link to make_cmap.py

make_cmap.py:

def make_cmap(colors, position=None, bit=False):
'''
make_cmap takes a list of tuples which contain RGB values. The RGB
values may either be in 8-bit [0 to 255] (in which bit must be set to
True when called) or arithmetic [0 to 1] (default). make_cmap returns
a cmap with equally spaced colors.
Arrange your tuples so that the first color is the lowest value for the
colorbar and the last is the highest.
position contains values from 0 to 1 to dictate the location of each color.
'''
import matplotlib as mpl
import numpy as np
bit_rgb = np.linspace(0,1,256)
if position == None:
position = np.linspace(0,1,len(colors))
else:
if len(position) != len(colors):
sys.exit("position length must be the same as colors")
elif position[0] != 0 or position[-1] != 1:
if bit:
for i in range(len(colors)):
colors[i] = (bit_rgb[colors[i][0]],
bit_rgb[colors[i][1]],
bit_rgb[colors[i][2]])
cdict = {'red':[], 'green':[], 'blue':[]}
for pos, color in zip(position, colors):
cdict['red'].append((pos, color[0], color[0]))
cdict['green'].append((pos, color[1], color[1]))
cdict['blue'].append((pos, color[2], color[2]))

cmap = mpl.colors.LinearSegmentedColormap('my_colormap',cdict,256)
return cmap

Now, an example of how we can call this function: this code creates a colormap ranging from purple to orange.

def purple_to_orange():
"""Dark purple to bright orange."""

start_hex = "#4d2b4b"
mid1_hex  = "#8c6bb1"
mid2_hex  = "#fdae6b"
end_hex   = "#f16913"

start_color = [j/255 for j in webcolors.hex_to_rgb(start_hex)]
mid1_color   = [j/255 for j in webcolors.hex_to_rgb(mid1_hex)]
mid2_color   = [j/255 for j in webcolors.hex_to_rgb(mid2_hex)]
end_color   = [j/255 for j in webcolors.hex_to_rgb(end_hex)]

colors = [start_color, mid1_color, mid2_color, end_color]
position = [0, 0.5, 0.6, 1]
cm = make_cmap(colors, position=position)

Now, the following code will evaluate the colormap to create 9 separate hex colors:

    # Now just call cm(0.0) thru cm(1.0)
N = 9
hex_colorz = []
for i in range(N+1):
x = i/N
rgbd_color = cm(x)[0:3]
rgb_color = [int(c*255) for c in rgbd_color]
hex_color = webcolors.rgb_to_hex(rgb_color)
hex_colorz.append(hex_color)

print(hex_colorz)

# How the calendar code works

<!DOCTYPE html>

Next, the Javascript code that creates the calendar visualization. We'll walk through each part.

var width = 700,
height = 90,
cellSize = 12;

// big integers
var formatStuff = d3.format(",");

/*
TEH COLORRRZZZZ
*/
var realBackgroundColor = "#272b30";
var tileBackgroundColor = realBackgroundColor;//"#3a3a3a";
var tileStrokeColor     = "#3a3a3a";
var monthStrokeColor    = "#4a4a4a";

var color = d3.scaleQuantize()
.domain([0, 60])
.range(["#4d2b4b","#5a3961","#684777","#77558f","#8463a5","#cc9189","#fba25c","#f78e43","#f47b2b","#f16913"]);
// purple orange

The canvas goes on the div tag with id calendar:

/*
Make the canvas
*/
var svg = d3.select("div#calendar")
.selectAll("svg")
.data(d3.range(2010, 2019).reverse())
.enter().append("svg")
.attr("width", width)
.attr("height", height)
.append("g")
.attr("transform", "translate(" + ((width - cellSize * 53) / 2) + "," + (height - cellSize * 7 - 1) + ")");

/*
Write the years
*/
svg.append("text")
.attr("transform", "translate(-6," + cellSize * 3.5 + ")rotate(-90)")
.attr("font-family", "sans-serif")
.attr("font-size", 10)
.attr("fill", "#bbb")
.attr("text-anchor", "middle")
.text(function(d) { return d; });

The next two portions are the meat of the calendar visualization, drawing the tiles and outlines:

/*
Draw the tiles representing days of the year
(also draw tile outlines)
*/
var rect = svg.append("g")
.attr("fill",   tileBackgroundColor)
.attr("stroke", tileStrokeColor)
.selectAll("rect")
.data(function(d) { return d3.timeDays(new Date(d, 0, 1), new Date(d + 1, 0, 1)); })
.enter().append("rect")
.attr("width", cellSize)
.attr("height", cellSize)
.attr("x", function(d) { return d3.timeWeek.count(d3.timeYear(d), d) * cellSize; })
.attr("y", function(d) { return d.getDay() * cellSize; })
.datum(d3.timeFormat("%Y-%m-%d"));

/*
Draw outlines of groups representing months
*/
svg.append("g")
.attr("fill", "none")
.attr("stroke", monthStrokeColor)
.selectAll("path")
.data(function(d) { return d3.timeMonths(new Date(d, 0, 1), new Date(d + 1, 0, 1)); })
.enter().append("path")
.attr("d", pathMonth);

Now, the code that loads the data, filters it, performs any calculations, and draws colored rectangles on top of the baseline square grid:

/*
*/
d3.csv("page_edits.csv", function(error, csv) {
if (error) throw error;

/*
This is where you decide what values to plot
*/
var data = d3.nest()
.key(function(d) { return d.timestamp ; })
.rollup(function(d) {
return d[0].edits;
})
.object(csv);

rect.filter(function(d) { return d in data; })
.attr("fill", function(d) { return color(data[d]); })
.append("title")
.text(function(d) { return d + ": " + formatStuff(data[d]); });
});

Finally, the most mysterious bit of magic in this code is the code that draws the squares around the months. This has to use the coordinates of the beginning and end of the months to draw a complicated square path.

It's magic, it works, we're happy.

function pathMonth(t0) {
var t1 = new Date(t0.getFullYear(), t0.getMonth() + 1, 0),
d0 = t0.getDay(), w0 = d3.timeWeek.count(d3.timeYear(t0), t0),
d1 = t1.getDay(), w1 = d3.timeWeek.count(d3.timeYear(t1), t1);
return "M" + (w0 + 1) * cellSize + "," + d0 * cellSize
+ "H" + w0 * cellSize + "V" + 7 * cellSize
+ "H" + w1 * cellSize + "V" + (d1 + 1) * cellSize
+ "H" + (w1 + 1) * cellSize + "V" + 0
+ "H" + (w0 + 1) * cellSize + "Z";
}

# Final result

The finished product, visualizing edits to charlesreid1.com/wiki/ and commits to git.charlesreid1.com, can be seen at the following links:

# Project Euler Problem 172

Posted in Mathematics

# Overview: Problem 172

How many 18-digit numbers $$n$$ (without leading zeros) are there such that no digit occurs more than three times in $$n$$?

Link to Project Euler Problem 172

# Background

Project Euler Problem 172 is your classic Project Euler problem: short, simple, and overwhelmingly complicated.

To nail this one, it's important to start simple - very simple. What I'll do is walk through the process of breaking this problem down to find and generalize the patterns needed to count permutations of digits.

First, in combinatorics problems it is important to think about what is changing, and how to count possible outcomes one piece at a time. Then the overall pieces can be combined to get the total count. In this case, we can think about a case for each digit: the case of 3 occurrences, the case of 2 occurrences, the case of 1 occurrence, and the case of 0 occurrences. Depending on the case, we limit our choices for later digits.

Let's start with a similar, but much simpler, problem: how do we construct a binary number with N digits and no more than m 0s and no more than m 1s?

In fact, let's make it even easier: how do we construct a 10 digit binary number with no more than 5 0's and no more than 5 1's?

The answer is, there is only ONE way to choose no more than 5 0's and no more than 5 1's to form a 10 digit number, and that's by having exactly 5 0's and 5 1's. Now that we know exactly how many of each digit we have, we can count the number of permutations of the number 0000011111 (the number of permutations).

## Multiset Permutations

Note that multiset permutations are also discussed on the following wiki pages and blog posts:

If we are selecting from a group of $$N_1$$ things of type A, $$N_2$$ things of type B, and $$N_3$$ things of type C to form a total of $$N$$ things, this type of combinatorics problem is called a multiset permutation, and the total number of ways of arranging this set of 3 things is given by:

$$\binom{N}{N_1, N_2, N_3} = \dfrac{N!}{N_1! N_2! N_3!}$$

In fact, this generalizes, for $$k$$ classes of things we have a $$k$$-set permutation:

$$\binom{N}{N_1, \dots, N_k} = \dfrac{N!}{N_1! \dots N_k!}$$

## A Simple Problem (And Solution)

Back to the problem at hand: to count the number of ways of placing 5 0s and 5 1s to form a 10 digit number.

Once we place 5 digits into any of the 10 available slots, that fixes the locations of the remaining 5 digits. However, we still have to include two 5! values, to account for all possible duplicates if we exchanged all 5 of the 1s with one another, or all 5 of the 0s with one another. We use the expression:

$$\binom{10}{5} = \dfrac{10!}{5! 5!} = 10 \times 9 \times 8 \times 7 \times 6$$

## A slightly More Complicated Problem

To solve a slightly more complicated problem: suppose we have to assemble a 10-digit binary number from no more than 6 0s and no more than 6 1s?

Now we have 3 possible cases of numbers of 0s:

4 0s: 0000111111 - and its permutations

5 0s: 0000011111 - and its permutations

6 0s: 0000001111 - and its permutations

For each of these cases, we can think of it as the "bucket" of 0s containing 4 0s (5 and 6 0s, respectively) and the "bucket" of 1s containing 6 1s (5 and 4 1s, respectively). We still have a number of permutations that we can form using this given number of 0s and 1s, given by a multiset permutation expression.

For each case, we have a multiset permutation expression that tells us how many permutations we can form from the given number of 0s and 1s:

$$\binom{ N }{ N_0, N_1 }$$

So we have three possible outcomes, and the total number of arrangements is the sum of these three cases:

$$N_{perms} = \binom{ 10 }{ 6, 4} + \binom{ 10 }{ 5, 5 } + \binom{ 10 }{ 6 , 4 }$$

# Algorithm

We can generalize the process. Suppose we are forming a number of length N from a number of digits/classes $$k$$ labeled from $$0 \dots k-1$$, and each digit/class can only appear a maximum of $$m$$ times.

The number of combinations that can be formed for a given $$N, k, m$$ is given by the multiset permutation expression above. So the total number of permutations that can be formed is a sum of these multiset permutation expressions, over each possible combination of digits/classes into a number of length $$N$$.

In computer science terms, we can think of this as a nested for loop or dynamic program; in mathematical terms, we can think of a sequence of summations whose limits depend on the variables in the other summations.

$$\sum_{N_1} \sum_{N_2} \dots \sum_{N_k} \binom{N}{N_0, N_1, N_2, \dots, N_{k-1}}$$

where the limits of the summations are given by:

$$N_1 = \min \left(N - (k-1) m, 0 \right) \dots m$$
$$N_2 = \min \left( N - N_1 - (k-2) m, 0 \right) \dots m$$

etc...

$$N_{k-1} = \min \left( N - N_1 - N_2 - \dots - N_{k-2}, 0 \right) \dots m$$

these all fix the number of zeros N_0:

$$N_0 = N - N_1 - N_2 - N_3 - \dots - N_k$$

Notice that we ignore N_0 in the list of summations, because fixing the number of the first k-1 digits/classes (1s, 2s, 3s, ..., (k-1)s) will fix the number of 0s. Alternatively, we could count 0s and include a summation over $$N_0$$, and eliminate the last summation over $$k-1$$.

However, the multiset permutation expression includes ALL of the N's, from $$N_0$$ to $$N_{k-1}$$, since the choice of each variable leads to additional permutations.

Also note that any algorithm implementing this procedure can save time by checking if, for the preceding combinations of $$N$$, we have already reached the maximum possible digits that can be selected. (Alternatively, we could write the upper limit of the summations as expressions depending on the prior values of $$N_i$$, but we'll keep it simple.)

## Ignoring Numbers Starting with Zero

We have one last hurdle remaining, and that is how to ignore numbers that start with 0.

If we think about the problem as selecting the number of times each digit is repeated, then assembling that selection into all possible permutations, fixing the first digit as 0 is equivalent to removing one from the total length of the number that must be assembled, and removing one from the possible 0s that will go in the final number. Thus, if we are assembling an N digit number from $$N_0$$ 0s, $$N_1$$ 1s, $$N_2$$ 2s, $$N_3$$ 3s, on up to $$N_9$$ 9s, then the total number of permutations is given by:

$$\binom{ N }{N_0, N_1, \dots, N_9}$$

If we fix the first digit as 0, the remaining number of permutations is given by:

$$\binom{N-1}{ N_0-1, N_1, \dots, N_9 }$$

Therefore, the number of permutations, excluding those beginning with 0, is written:

$$\binom{ N }{N_0, N_1, \dots, N_9} - \binom{N-1}{ N_0-1, N_1, \dots, N_9 }$$

Also, it is important to note that if N_0 = 0 to begin with, there are no possible ways of assembling numbers that begin with 0 because there are no 0s in the number, so the second term becomes 0:

$$\binom{ N }{0, N_1, \dots, N_9} - 0$$

# Code

## Test Cases

### Test Case 1

Assemble two digits $$\{0,1\}$$ into a 10-digit number, if each digit $$\{0,1\}$$ can occur up to 5 times.

In this case, we know that 0 and 1 must occur exactly 5 times each. Now we are asking how we can assemble two sets of 5 things into 10 slots. This is a multiset permutation problem:

$$\binom{10}{5,5} = \dfrac{10!}{5! \cdot 5!} = \dfrac{10 \cdot 9 \cdot 8 \cdot 7 \cdot 6}{5 \cdot 4 \cdot 3 \cdot 2 \cdot 1} = 252$$

But wait! We also want to exclude numbers starting with 0, so we actually have:

$$\binom{10}{5, 5} - \binom{9}{4, 5} = 126$$

which is half of 252 - exactly what we would expect.

### Test Case 2

Assemble three digits $$\{[0, 1, 2\}$$ into a 6-digit number, if each digit $$\{0, 1, 2\}$$ can occur up to 3 times. No number should start with 0.

In the prior case, we had one outcome of number of 0s and 1s, but in this case, we have a larger number of outcomes that we might see.

Evaluating the expressions for the limits of $$N_i$$, we get:

$$\sum_{N_0 = 0}^{3} \sum_{N_1 = \max(0, 3 - N_0) }^{3} \binom{6}{N_0, N_1, (N-N_0-N_1)}$$

where $$N_2 = N - N_0 - N_1$$. Written out, this becomes the total number of possible 6-digit numbers,

$$a = \binom{6}{0,3,3} + \binom{6}{1,2,3} + \binom{6}{1,3,2} + \binom{6}{2,1,3} + \binom{6}{2,2,2} + \\ \binom{6}{2,3,1} + \binom{6}{3,0,3} + \binom{6}{3,1,2} + \binom{6}{3,2,1} + \binom{6}{3,3,0}$$

minus the number of 6-digit numbers starting with 0:

$$b = 0 + \binom{5}{0,2,3} + \binom{5}{0,3,2} + \binom{5}{1,1,3} + \binom{5}{1,2,2} + \\ \binom{5}{1,3,1} + \binom{5}{2,0,3} + \binom{5}{2,1,2} + \binom{5}{2,2,1} + \binom{5}{2,3,0}$$

Let $$a$$ be the first expression and $$b$$ be the second expression; then the total is:

In [40]: np.sum(a)
Out[40]: 510.0

In [41]: np.sum(b)
Out[41]: 170.0

In [42]: np.sum(a) - np.sum(b)
Out[42]: 340.0

$$a - b = 340$$

## Recursion

The essence of this problem is a nested for loop - but because we have 9 digits to deal with, a 9-level nested for loop would be a big headache and would not generalize well.

Instead, we can write a recursive method that is called for each of the $$k$$ (9) digits being selected to compose the final $$N$$- (18-) digit number.

The recursive method looks something like this:

global variable solution_count
global variable m
global variable N

def recursive_method( n_tuple, n) {
if(n==9) {
compute multiset permutation combinations
increment global solutions total
need N, N0, N1, N2, etc.
} else {
assemble choices for N_i
for(choice in choices) {
set N_i to choice
call recursive_method()
unset N_i
}
}
}

## Pseudocode

Computing the number of possible integers n that meet the specified criteria thus boils down to a long sequence of nested summations (nested loops).

The problem is posed for $$N = 18, k = 10, m = 3$$. For this case, the final expression for the total number of permutations is:

$$\sum_{N_1} \sum_{N_2} \sum_{N_3} \sum_{N_4} \sum_{N_5} \sum_{N_6} \sum_{N_7} \sum_{N_8} \sum_{N_9} \binom{N}{N_0, N_1, N_2, \dots, N_9} - \binom{N-1}{N_0-1, N_1, N_2, \dots, N_9}$$

where the limits of summation are given by:

$$N_1 = \max \left( N - (10-1) m, 0 \right) \dots m$$
$$N_2 = \max \left( N - N_1 - (10-2) m, 0 \right) \dots m$$
$$N_3 = \max \left( N - N_1 - N_2 - (10-3) m, 0 \right) \dots m$$
$$N_4 = \max \left( N - N_1 - N_2 - N_3 - (10-4) m, 0 \right) \dots m$$

etc...

$$N_9 = \max \left( N - N_1 - N_2 - \dots - N_7 - N_8, 0 \right) \dots m$$

and from these, $$N_0$$ is determined by:

$$N_0 = N - N_1 - N_2 - \dots - N_8 - N_9$$

## Python Code

Link to Problem 172 Python Code at git.charlesreid1.com

To implement the solution to Problem 172 in Python, we used recursion, as mentioned above. THe only tricky part of implementing this recursive method was the usual challenge with recursive methods: keeping track of the total number of solutions found via a global variable.

To do this in Python, we declare a variable outside the scope of a given function, and we use that variable as a global variable by declaring it with the global keyword.

import numpy as np

# Real problem:
k = 10
m = 3
N = 18

solution_count = 0
factorials = {}

Now we have a main() driver method to call the recursive method:

def main():
global solution_count
n_tuple = [None,]*k
recursive_method(n_tuple,1)
print("Total number of permutations:")
print("%d"%(solution_count))

We have the recursive backtracking method that constructs all combinations of $$k$$ digits into $$N$$-digit numbers:

def recursive_method( n_tuple, ni ):
"""
Use recursive backtracking to form all possible
combinations of k digits into N-digit numbers
such that the number of digits is m or less.

(n_tuple is actually a list.)

ni = current class step 1..(k-1)
n_tuple = list of number of digits for each class 0 through k
"""
global solution_count, k, m, N
if(ni==k):

# N_1 through N_(k-1) have been set,
# now it is time to set N_0:
# N_0 = N - N_1 - N_2 - N_3 - .. - N_{k-1}
sum_N = np.sum([n_tuple[j] for j in range(1,k)])
n_tuple[0] = max(0, N-sum_N)

# Compute multiset permutation
solution_count += multiset(N,n_tuple) - multiset_0(N,n_tuple)

return

else:

# Problem: we are not stopping
# when the sum of digits chosen
# is greater than N

# Assemble the minimum and maximum limits for N_i:
# (Everything up to ni-1 should be defined, no TypeErrors due to None)
sum_N = np.sum([n_tuple[j] for j in range(1,ni)])
ktm = (k - ni)*m
expr = N - sum_N - ktm
minn = int(max( 0, expr ))

# Note: previously this was just maxx=m.
# This required a check around each call to
# recursive_method to see if the sum of n_tuple
# was already maxed out. Now we just do it here.
maxx = min(m, N-sum_N)

for N_i in range(minn,maxx+1):

# Set
n_tuple[ni] = N_i

# Explore
recursive_method(n_tuple, ni+1)

# Unset
n_tuple[ni] = None

return

We have a multiset() method that evaluates the multiset permutation count formula:

$$\binom{N}{N_1, \dots, N_k} = \dfrac{N!}{N_1! \dots N_k!}$$
def multiset(N, n_tuple):
"""
Number of multiset permutations
"""
r = factorial(N)/(np.product([factorial(j) for j in n_tuple]))
return r

def multiset_0(N, n_tuple):
"""
"""
if(n_tuple[0]>0):
r = factorial(N-1)/(np.product([factorial(j-1) if(i==0) else factorial(j) for i,j in enumerate(n_tuple)]))
return r
else:
return 0

And finally, we have a factorial() method:

def factorial(n):
"""
Factorial utility
"""
if(n<0):
raise Exception("Error: negative factorials not possible")
if(n==1 or n==0):
return 1
else:
return n*factorial(n-1)

At the bottom of the file, we ensure that the driver is run when the funtion is run directly through Python:

if __name__=="__main__":
main()

$$P = 227,485,267,000,992,000$$


text:
Other Output Formats

In addition to the default native HTML output, Documenter also provides a built-in LaTeX-based PDF output. Additional output formats are provided through plugin packages. Once the corresponding package is loaded, the output format can be specified using the format option in makedocs.

PDF Output via LaTeX

makedocs can be switched over to use the PDF/LaTeX backend by passing a Documenter.LaTeX object as the format keyword:

using Documenter
makedocs(format = Documenter.LaTeX(), ...)

Documenter will then generate a PDF file of the documentation using LaTeX, which will be placed in the output (build/) directory.

The makedocs argument sitename will be used for the \title field in the tex document, and if the build is for a release tag (i.e. when the "TRAVIS_TAG" environment variable is set) the version number will be appended to the title. The makedocs argument authors should also be specified, it will be used for the \authors field in the tex document.

Compiling using natively installed latex

The following is required to build the documentation:

• You need pdflatex and latexmk commands to be installed and available to Documenter.
• You need the minted LaTeX package and its backend source highlighter Pygments installed.
• You need the DejaVu Sans and DejaVu Sans Mono fonts installed.

Compiling using Tectonic

The documentation can be also built using the Tectonic LaTeX engine. It is required to have a tectonic available in PATH, or to provide a path to the binary using the tectonic keyword:

using Documenter

# Executable tectonic is present in PATH
makedocs(
format = Documenter.LaTeX(platform="tectonic"),
...)

# The path to tectonic is provided by the tectonic_jll package
using tectonic_jll: tectonic
makedocs(
format = Documenter.LaTeX(platform="tectonic", tectonic=tectonic()),
...)

Compiling using docker image

It is also possible to use a prebuilt docker image to compile the .tex file. The image contains all of the required installs described in the section above. The only requirement for using the image is that docker is installed and available for the builder to call. You also need to tell Documenter to use the docker image, instead of natively installed tex which is the default. This is done with the LaTeX specifier:

using DocumenterLaTeX
makedocs(
format = LaTeX(platform = "docker"),
...
)

If you build the documentation on Travis you need to add

services:
- docker

to your .travis.yml file.

Compiling to LaTeX only

There's a possibility to save only the .tex file and skip the PDF compilation. For this purpose use the platform="none" keyword:

using DocumenterLaTeX
makedocs(
format = LaTeX(platform = "none"),
...
)

Custom LaTeX style

The PDF/LaTeX backend works by generating a TeX file based on the input Markdown files. For users who need or want more control over the generated PDF, it is possible to customize the setup part of the generated TeX code.

By default, the generated TeX file loads the documenter.sty style file, which loads several packages (such as fontspec, amsmath, listings, minted, tabulary, graphicx) and otherwise configures the TeX build.

Users can load additional packages and declare additional configuration by adding a custom.sty file to the assets/ source directory. The custom style file will be loaded right after the default style (documenter.sty).

Custom preamble

By default, Documenter uses the preamble.tex preamble, with only the dynamically generated declarations for the \DocMainTitle, \DocVersion, \DocAuthors, and \JuliaVersion variables preceding it.

For more control, it is possible to fully replace the preamble by adding a preamble.tex file into the assets/ source directory, which will then be used instead of the default one. The Documenter tests contain two examples of how a custom preamble can be used:

Markdown & MkDocs

Documenter no longer provides the Markdown/MkDocs output, and this functionality has moved to the DocumenterMarkdown package.

format: plain


text:
# oggm.utils.compile_glacier_statistics¶

oggm.utils.compile_glacier_statistics(gdirs, filesuffix='', path=True, inversion_only=False)[source]

Gather as much statistics as possible about a list of glaciers.

It can be used to do result diagnostics and other stuffs. If the data necessary for a statistic is not available (e.g.: flowlines length) it will simply be ignored.

Parameters: gdirs : list of oggm.GlacierDirectory objects the glacier directories to process filesuffix : str add suffix to output file path : str, bool Set to “True” in order to store the info in the working directory Set to a path to store the file to your chosen location inversion_only : bool if one wants to summarize the inversion output only (including calving)


text:
We discuss solving equations.

An equation is a statement expressing the equality between two quantities. This means that an equation will always have a single equals sign.

Usually, when dealing with an equation, we will be looking for values that make the equation true. A solution to an equation is a value that, when substituted in for the variables, yield a true number statement.

When we are asked to solve an equation, we are being asked to find all solutions. Exactly how to do that depends on the particular equation involved.

A linear equation in $x$ is an equation which is equivalent to one with the form $a x + b = 0$, where $a$ and $b$ are constants, with $a \neq 0$.

To solve a linear equation, we isolate the $x$-term and divide by the coefficient.

Solve the linear equation $\displaystyle \dfrac {4}{5}\left (x+2\right ) - 3 = \dfrac {x-1}{2}$.
It may be easier to clear fractions first.
x = $\answer {3}$.


text:
## Second Assignment

We saw the wikipedia page for "man pages" in the last section, but hopefully you didn't read it (because I told you not to). You have to trust me on this, when I tell you not to read something, don't, it will truly be a waste of your time. We will work on it as we go.

Open this man-page and write down the first three things you don't understand.

Once you have found three things you don't understand: STOP READING! It will only hurt your head, and there is no need to go any further. Remember Rule 3 of the Hacker Attitude, "Boredom and Drudgery are evil."? If you're not getting anything out of something at any point in this course, don't do it, and leave us feedback that we are wasting your time. We mean that. You won't hurt my feelings.

The reason I had you write down the first few things you didn't understand is I want to make it clear to you how useless it would be right now for you to dive, unguided into the material. Reading a man page, with no direction and no firm base to start from is a waste of your time.

For your second assignment, you will answer the following question:

Questions:

1. What is in Section 1 of man pages?

Resources:

1. https://man7.org/linux/man-pages/man1/man.1.html

Please respond in the format from the last assignment I demoed. The point of this assignment, and the format I ask you to respond in, is to teach you the thought processes you need to ingrain, along with stopping you from trying to learn too much too quickly. Even better, in later sections it helps me figure out what you don't understand so I can modify the material for other students.

Write and answer the Pre-Questions that are required for you to understand your answer to the question that was asked. Only go one level deep into the rabbit hole, please, I have designed the course to only require one level deep max in order to confidently move forward.

 Pre-Questions:
1. (any questions you asked and had to solve in order to understand the question)

Answers:

1. (the actual answer to the question)

Resources:
1.  (any helpful resources beyond what was given, especially if you had to google some of them)

Post-Questions:
1. (any questions you still have that did not get answered)

Feedback:
1. (any feedback on how the question was asked, the material, really anything)

I greatly appreciate your feedback on how this attempt at question and answer works for you, either in #feedback or the question response.


text:
Note Di Bella Ciao Pianoforte, Il Giorno Della Civetta: Recensione, Strana Malinconia Uscita, Danza Del Ventre Lezioni, Mappa Appennino Bolognese, Agnello Di Dio Frisina Contralti, Sinonimo Di Detto, Booking Wikipedia Italia, " /> Note Di Bella Ciao Pianoforte, Il Giorno Della Civetta: Recensione, Strana Malinconia Uscita, Danza Del Ventre Lezioni, Mappa Appennino Bolognese, Agnello Di Dio Frisina Contralti, Sinonimo Di Detto, Booking Wikipedia Italia, " />
Seleziona una pagina

The vibrational analysis of the gas-phase infrared spectra of chlorofluoromethane (CH2ClF, HCFC-31) was carried out in the range 200-6200 cm(-1). Experimental studies on the natural optical activity and Faraday rotation of the three different stereoisomers of tartaric acid were reported recently by Ruchon et al. The main physico-chemical effects (solvation, vibronic progression) affecting the band position and shape are progressively introduced in the computational mod... A methodology to account for non-electrostatic interactions in Quantum Mechanical (QM)/Molecular Mechanics(MM) approaches is developed. The approach is applied to the calculation of Infrared (IR), Vibrational Circular Dichroism (VCD), Raman and Raman Optical Activity (ROA) spectra... We report here a successful attempt to test a solvatochromic method to estimate the hyperpolarizability (β) of cationic push–pull chromophores. Such model is able to reproduce all plasmonic features of these materials, and their dependence on shape, dimension and fundamental physical parameters (Ferm... We present a detailed computational analysis of UV/Vis spectra of caffeine, paraxanthine and theophylline in aqueous solution. Morreu em 1990, aos 19 anos de idade. the RR spectra, namely the transform theory and the short-time dynamics. 289 Followers, 804 Following, 337 Posts - See Instagram photos and videos from Chiara (@chiara.capelli) Join ResearchGate to find the people and research you need to help your work. University students and faculty, institute members, and independent researchers, Technology or product developers, R&D specialists, and government or NGO employees in scientific roles, Health care professionals, including clinical researchers, Journalists, citizen scientists, or anyone interested in reading and discovering research. Experimental results are compared to computational predictions. Capelli e bellezza. Beata Chiara “Luce” Badano: Chiara “Luce” Badano nasceu em Savona, Itália, em 1971. The potential energy surfaces (PESs) of the ground... Analytical equations to calculate second order electric and magnetic properties of a molecular system embedded into a polarizable environment are presented. The accurate calculation of electronic transition energies and properties of isolated chromophores is not sufficient to provide a realistic simulation of their excited states in solution. 15, 2233 (2019)], is extended to the calculation of vertical excitation energies of solvated molecular systems. 136, 124108 (2012)] paved the route to routine calculations of infrared spectra for a wide set of molecular systems. Chiara Capelli, Facebook पर है. Formulations for Pauli repulsion and dispersion energy, explicitly depending on the QM density are derived. Esta é a versão do nosso site para quem fala Português em Brasil. One of the major problems rises from the simultaneous presence of slightly different conformers at equilibrium in solution. Theory Comput. Join Facebook to connect with Chiara Capelli and others you may know. Excitation energies are defined within two different solvation regimes, i.e. Properly designed organic chromophores based on functionalized terthiophenes by push–pull substituents and stilbene derivatives were efficiently incorporated into polyolefins (polyethylene (PE), polypropylene (PP) and their copolymers, even with polar functionalities) at various concentration (from 0.05 to 2 wt.%) either by casting from solvents or... A computational approach to simulate the formation of possible imprinted polymers in acetonitrile solution for theophylline (THO) is proposed, using combined molecular dynamics (MD), molecular mechanics (MM), docking and site mapping computational techniques. The presen... We present a newly implemented methodology to evaluate vibrational contributions (harmonic and anharmonic) to the optical rotation of solvated systems described by means of the polarizable continuum model (PCM). All rights reserved. It is located across the street from the Gesu Nuovo Church. The assignment of the absorption features in terms of fundamental, overtone, combination, and hot bands was performed on the medium-resolution (up to 0.2 cm(-1)) Fourier transform infrared spectra. Basilica di Santa Chiara: Igreja de Santa Clara em Assis - Veja 2.419 avaliações de viajantes 1.358 fotos reais e ótimas ofertas para Assis, Itália no Tripadvisor. Phys., 121, 8814, (2004)]; Density-functional study of electric and magnetic properties of hexafluorobenzene in the vapor phase, [J. Chem. At the heart of these developments there are latest-generation models based on Density Functional Theory for the proper t... A relevant number of experiments on short peptides has been performed in recent years. Nós lamentamos que ninguém estivesse por perto que pudesse nos guiar. Computational Design, Synthesis, and Mechanochromic Properties of New Thiophene-Based π-Conjugated Chromophores, Calculation and analysis of the harmonic vibrational frequencies in molecules at extreme pressure: Methodology and diborane as a test case, Linear Response Theory and Electronic Transition Energies for a Fully Polarizable QM/Classical Hamiltonian, Analytical First and Second Derivatives for a Fully Polarizable QM/ Classical Hamiltonian, Implementation and validation of a multi-purpose virtual spectrometer for large systems in complex environments, Toward Ab Initio Anharmonic Vibrational Circular Dichroism Spectra in the Condensed Phase, Integrated computational approaches for spectroscopic studies of molecular systems in the gas phase and in solution: Pyrimidine as a test case, Modelling vibrational coupling in DNA oligomers: A computational strategy combining QM and continuum solvation models, Toward an Accurate Modeling of Optical Rotation for Solvated Systems: Anharmonic Vibrational Contributions Coupled to the Polarizable Continuum Model, The Time-Independent Approach to Vibrational Spectroscopies, Erratum: “Towards an accurate description of anharmonic infrared spectra in solution within the polarizable continuum model: Reaction field, cavity field and nonequilibrium effects” [J. Chem. Vê os perfis de pessoas com o nome Chiara Capelli. Chiara Capelli is on Facebook. Phys., 123, 114307, (2005)], Erratum: Density functional and electron correlated study of five linear birefringences - Kerr, Cotton-Mouton, Buckingham, Jones and Magneto-electric - in gaseous benzene, [J. Chem. Purely classical approaches fail, because the quantum nature of electrons needs to be considered. Chiara CAPPELLI, Professor (Associate) of Scuola Normale Superiore di Pisa, Pisa (Normale) | Read 154 publications | Contact Chiara CAPPELLI Mostrar traduções automáticas? This represents a simple method, alternative to the sophisticated spectroscopic techniques often employed, which can be easily and quickly applied through equipment commonly available in a typical chemistry... A detailed computational characterization of the One-Photon Absorption spectrum of 2-((E)-2-[2,2']-bithiophenyl-5-yl-vinyl)-1-methyl-quinolinium cation in acetonitrile solution is presented. Only verified researchers can join ResearchGate and send messages to other members. The Case of Pyrene, Vertical Electronic Excitations in Solution with the EOM-CCSD Method Combined with a Polarizable Explicit/Implicit Solvent Model, Tuning of NMR and EPR parameters by vibrational averaging and environmental effects: An integrated computational approach. In ωFQ, each atom of the nanostructures is endowed with an el... We demonstrate that the optical properties of realistic graphene and graphene-based materials can effectively be modeled by a novel, fully atomistic, yet classical, approach, named $\omega$FQ. 2019, 15 2233-2245), is extended to the calculation of vertical excitation energies of solvated molecular systems. It is an old church with a nice altar and a lot of nice artifacts. Preliminary calculations confirm the presence of a CO-CO coupling stronger in D 2 O than in DMSO as experimentally observed. respect to analogous studies on isolated molecules. The Case of ( s )- N -Acetylproline Amide in Liquid Water, Ab Initio Study of the Magneto-Optical Rotation of Diastereoisomers, How the Environment Controls Absorption and Fluorescence Spectra of PRODAN: A Quantum-Mechanical Study in Homogeneous and Heterogeneous Media †, Modeling the Solvation of Peptides. The dispersive optical activity for aqueous solutions of non-rigid (R)-glycidyl methyl ether (R-GME) has been explored synergistically from experimental and theoretical perspectives. Due to our privacy policy, only current members can send messages to people on ResearchGate. The extension of the polarizable continuum model (PCM) to evaluate solvent effects on vibrational coupling is reported for both the transition dipole coupling and the Hessian matrix reconstruction (HMR) methods. The analysis is carried out using both a continuum model and a polarizable QM/MM method that treats the solvent atomistically and embeds each atom in the solvent with a fluctuating charge whic... We present the extension to second harmonic generation (SHG) of the atomistic fully polarizable QM/FQ method that treats the solvent atomistically and embeds each atom in the solvent with a fluctuating charge (FQ) which responds to the solute quantum mechanical (QM) electrostatic potential in a self-consistent manner. We employ a polarizable quantum mechanics/molecular mechanics (QM/MM) computational model that treats... Chiroptical properties and spectroscopies are valuable tools to study chiral molecules and assign absolute configurations. The effect of the cavity field (CF) on electronic circular dichroism spectra simulated using a polarizable continuum model (PCM) is analyzed. Integrated QM/polarizable MM/continuum approaches to model chiroptical properties of strongly interacting solute-solvent systems: Cappelli, Excitation Dynamics in Hetero-bichromophoric Calixarene Systems, A computational approach to the resonance Raman spectrum of doxorubicin in aqueous solution, Calculation of Molecular Properties in Solution, Analytical gradients for MP2, double hybrid functionals, and TD-DFT with polarizable embedding described by fluctuating charges, Origin invariance in vibrational resonance Raman optical activity, The Electronic Circular Dichroism of Nicotine in Aqueous Solution: A Test Case for Continuum and Mixed Explicit-Continuum Solvation Approaches, Optical rotatory dispersion of methyloxirane in aqueous solution: Assessing the performance of density functional theory in combination with a fully polarizable QM/MM/PCM approach, A computational study of some electric and magnetic properties of gaseous BF3 and BCl3, A benchmark study of electronic excitation energies, transition moments, and excited-state energy gradients on the nicotine molecule, An integrated computational tool to model the broadening of the absorption bands of flexible dyes in solution: Cationic chromophores as test cases, Combination of Transient 2D-IR Experiments and Ab Initio Computations Sheds Light on the Formation of the Charge-Transfer State in Photoexcited Carbonyl Carotenoids, Cobalt Complexes Able to Bind Dioxygen: Thermodynamic Studies and DFT Calculations, Stereoelectronic, Vibrational, and Environmental Contributions to Polarizabilities of Large Molecular Systems: A Feasible Anharmonic Protocol, Ultrafast resonance energy transfer in the umbelliferone-alizarin bichromophore, A Robust and Effective Time-Independent Route to the Calculation of Resonance Raman Spectra of Large Molecules in Condensed Phases with the Inclusion of Duschinsky, Herzberg-Teller, Anharmonic, and Environmental Effects, Conformational Analysis of Gly Ala NHMe in D20 and DMSO Solutions: A Two-Dimensional Infrared Spectroscopy Study, Development of a Virtual Spectrometer for Chiroptical Spectroscopies: The Case of Nicotine, Conformational Analysis of Gly–Ala–NHMe in D 2 O and DMSO Solutions: A Two-Dimensional Infrared Spectroscopy Study, An integrated experimental and quantum-chemical investigation on the vibrational spectra of chlorofluoromethane, Anharmonic theoretical simulations of infrared spectra of halogenated organic compounds, Effective time-independent studies on resonance Raman spectroscopy of trans-stilbene including the Duschinsky effect, A Gauge Invariant Multiscale Approach to Magnetic Spectroscopies in Condensed Phase: General Three-Layer Model, Computational Implementation and Pilot Applications, Duschinsky, Herzberg-Teller, and Multiple Electronic Resonance Interferential Effects in Resonance Raman Spectra and Excitation Profiles. Solvent effects have been investigated by resorting to the implicit Polarizable Continuum Model (QM/PCM) and non-polarizable and fully polarizable QM/MM approaches, the latte... We present the extension of the quantum/classical polarizable fluctuating charge model to the calculation of single residues of quadratic response functions, as required for the computational modeling of two-photon absorption cross sections. Via G.B Parodi 46/A 17055 Toirano, SV - Italy. Fully polarizable QM/MM approach based on fluctuating charges and fluctuating dipoles, named QM/FQF{\mu} (J. Chem. The magnified infectious power of the SARS-CoV-2 virus compared to its precursor SARS-CoV is intimately linked to an enhanced ability in the mutated virus to find available hydrogen bond sites in the host cells. Experiência de colheita de uva privada em... Compartilhe outra experiência antes de sair. visita completa das duas cidades!

de volta ao alojamento;

APROVEITE e seja bem-vindo a faboulous Puglia !!!! The recent implementation of the computation of infrared (IR) intensities beyond the double-harmonic approximation [J. Bloino and V. Barone, J. Chem. Veja todas as 69 excursões em Basilica di Santa Chiara no Tripadvisor dentro TRULLO visita, história, cultura e degustação de produtos locais (azeite extravirgem, taralli, vinhos etc.) The Case of (s)-N-Acetylproline Amide in Liquid Water, A quantum mechanical polarizable continuum model for the calculation of resonance Raman spectra in condensed phase, Modification and photostabilization of low density polyethylene film by photodecomposition of various diazo-compounds and methyl azidocarboxylate, Conferring dichroic properties and optical responsiveness to polyolefins through organic chromophores and metal nanoparticles, Continuum Solvation Approaches to Vibrational Properties, Towards the design of highly selective recognition sites into molecular imprinting polymers: A computational approach, Characterization of Supramolecular Polyphenol−Chromium(III) Clusters by Molecular Dynamics Simulations, Computational study of doxorubicin in aqueous solution, Institute for Chemical and Physical Processes IPCF, Institute of Chemistry of Organometallic Compounds ICCOM, "Giacomo Ciamician" Department of Chemistry CHIM, Institute for Organic Syntheses and Photoreactivity ISOF. traterraearte@virgilio.it. The new computational method, named PCM-XP, is based on the polarizable continuum model (PCM), amply used for the study of the solvent effects... A fully polarizable quantum/classical Hamiltonian including SCF (HF or DFT), fluctuating charge, and polarizable continuum regions is introduced and implemented for electronic energies of ground and excited states, using, in the latter case, a linear response formulation. Quais restaurantes ficam perto de Chiesa di Santa Chiara? The first implementation and calculation of anharmoruc VCD rotational strengths for solvated systems is reported. Excitation energies are defined within two dif... We demonstrate the pivotal role of QM density confinement effects on solvatochromic shifts. In esclusiva la tomba di Santa Chiara In diretta da Assisi, Antonella Ventre visita la Basilica di Santa Chiara Veja todas as 24 excursões em Chiesa di Santa Chiara no Tripadvisor The spectroscopic behavior of 6-propionyl-2-(N,N-dimethyl)aminonaphthalene (PRODAN) is investigated in different environments, ranging from homogeneous solutions of different polarities to diffuse interfaces mimicking membranes. This paper is devoted to the development and application of an effective computational approach for the prediction of band broadening in the electronic spectra of semi−flexible organic molecules in solution. The structure and properties of (s)-N-acetylproline amide (NAP) in aqueous solution are studied by exploiting a continuum solvation model. Essas avaliações foram traduzidas do inglês automaticamente. Restaurantes perto de Chiesa di Santa Chiara: O que fazer perto de Chiesa di Santa Chiara. Theory Comput. Residenza Santa Chiara, Naples – Tempah dengan Jaminan Harga Terbaik! Laboratorio artistico di progettazione e realizzazione . In this work, we present the derivation and implementation of analytical first and second derivatives for a fully polarizable QM/MM/PCM energy functional. Reliable computations of NMR and EPR spectroscopic parameters for flexible molecules in condensed phases require a proper account of stereo-electronic, dynamic, and nvironmental effects. Halogenated organic compounds represent an interesting class of molecules, fr... We simulate the resonance Raman spectra of trans-stilbene using a recently developed time-independent method that allows computations of the full two-dimensional spectrum as a function of the incident and scattered frequencies, including both the Franck–Condon and the Herzberg–Teller contributions. Viva capelli di indiani. começar às 9h30 vou buscar você em seu alojamento ou no ponto personalizado (por favor especificar) transporte para a MATERA unesco, visitando Sassi di matera, cavernas e grutas únicas de 39.000 anos, visita do museu CASA GROTTA (bilhete incluso) , pessoas e tradições de Matera, coffee break, transporte para o patrimônio da palavra ALBEROBELLO unesco, TRULLI típicas antigas casas em forma de cone típicas de PUGLIA! The fully atomistic model, ωFQ, based on textbook concepts (Drude theory, electrostatics, quantum tunneling) and recently developed by some of the present authors in Nanoscale, 11, 6004-6015 is applied to the calculation of the optical properties of complex Na, Ag, and Au nanostructures. In MLDFT, the Kohn-Sham equations are solved in the MO basis for the active part only, wh... We demonstrate that the plasmonic properties of realistic graphene and graphene-based materials can effectively and accurately be modeled by a novel, fully atomistic, yet classical, approach, named ωFQ. 2005, 412, 411]. Reserve excursões em Chiesa di Santa Chiara com antecedência para garantir sua vaga. The excited state dynamics of carbonyl carotenoids is very complex because of the coupling of single- and doubly-excited states and the possible involvement of intramolecular charge-transfer (ICT) states. 49 likes. The fully polarizable QM/MM approach based on Fluctuating charges and Fluctuating dipoles, named QM/FQFμ (J. Chem. The fully polarizable QM/MM approach based on fluctuating charges and fluctuating dipoles, named QM/FQF{\mu} (J. Chem. Theory Comput. Chiara, mentre era in vita, rifulgeva per la luce dei suoi meriti: ed ora, che è inabissata nella chiarità senza fine, non di meno risplende tuttora, per la meravigliosa luce dei miracoli, fino alle estremità della terra. 156 likes. Reliable computations of linear and nonlinear optical properties of molecular systems in condensed phases require a proper account of stereoelectronic, vibrational, and environmental effects. 74 reviu dan 29 gambar di Booking.com. Density functional theory analyses performed with the polarizable continuum model for implicit solvation identified nine low-lying stable conformers that are interconv... A combination of experimental and quantum mechanical investigations is applied to the study of the optical features of 4,4’-bis(2-benzoxazolyl)stilbene (BBS) dissolved in solution or in a poly(Llactic acid) (PLA) thermoplastic... We present a computational study on the spectroscopic properties of UV‐Vis absorbing dyes in water solution. The Optical Rotation of Methyloxirane in Aqueous Solution: A Never Ending Story? Lett. The ligational properties of the ligand 2-[bis-(2-aminoethyl)-aminomethyl]phenol (L) towards Co(II) ion were studied by means of potentiometric measurements in aqueous solution (298.1 ± 0.1 K, I = 0.15 mol dm-3). Such expressions are based on the definition of an auxiliary density on the MM portion and the Tkatchenko-... We present an analytical formulation and implementation of Raman and Raman Optical Activity (ROA) spectra within a three-layer fully polarizable Quantum Mechanical (QM)/ Molecular Mechanics (MM)/Polarizable Continuum Model (PCM) approach. Log into Facebook to start sharing and connecting with your friends, family, and people you know. The computation of molecular properties and spectroscopies of solvated systems by means of quantum mechanical approaches has attracted much interest in recent years, due to the capability of the developed methods of providing a reliable comparison with experiments. Laboratorio artistico di progettazione e realizzazione . Quando você reserva com o Tripadvisor, é possível receber um reembolso integral ao cancelar até 24 horas antes do início da atividade. Chiara Capelli और आपके अन्य परिचितों से जुड़ने के लिए Facebook में शामिल हों. Você recomendaria este local ou atividade a, Você visitaria este local ou atividade em um, Você recomendaria este local ou atividade a um amigo que está, Isto é algo imperdível para quem estiver viajando com um, Este é um local ou atividade romântico que você recomendaria a, Você recomendaria este local ou atividade para um amigo que busca uma experiência, Strada Santa Chiara 22, 70122, Bari Itália. framework of the polarizable continuum model (PCM). 135, 104505 (2011)], Modeling Solvent Effects on Chiroptical Properties, Towards an accurate description of anharmonic infrared spectra in solution within the polarizable continuum model: Reaction field, cavity field and nonequilibrium effects, Effective Time-Independent Calculations of Vibrational Resonance Raman Spectra of Isolated and Solvated Molecules Including Duschinsky and HerzbergÀTeller Effects, Cavity Field Effects Within a Polarizable Continuum Model of Solvation: Application to the Calculation of Electronic Circular Dichroism Spectra of R-(+)-3-Methyl-cyclopentanone, David Bishop's Approach to Vibrational Dynamic Contributions to Molecular Properties: Application to Jones and Magnetoelectric Birefringences in Diatomic Molecules, From Molecular Electrostatic Potentials to Solvation Models and Ending with Biomolecular Photophysical Processes, On the Calculation of Vibrational Frequencies for Molecules in Solution Beyond the Harmonic Approximation, Toward a Quantum-Mechanical Description of 2D-IR Spectra of Solvated Systems: The Vibrational Mode Coupling within A Polarizable Continuum Model, Properties of Excited States of Molecules in Solution Described with Continuum Solvation Models, Structures and Properties of Electronically Excited Chromophores in Solution from the Polarizable Continuum Model Coupled to the Time-Dependent Density Functional Theory, Two-dimensional infrared spectroscopy of Glycine-L-Alanine-Methylamide, Erratum: "Density functional and electron correlated study of five linear birefringences - Kerr, Cotton-Mouton, Buckingham, Jones and Magneto-electric - in gaseous benzene", [J. Chem. Laboratorio artistico di progettazione e realizzazione . © 2008-2020 ResearchGate GmbH. These two strategies refer to two different theoretical approaches to The monosignate character of Resonance Raman Optical Activity (RROA) spectra has been often taken as granted in experimental and computational approaches, on the basis of basic theoretical approximations only considering resonance with a single electronic state of the molecule and the scattering process to be governed by the Franck-Condon mechanism... Solvent effects on chiroptical properties and spectroscopies can be huge, and affect not only the absolute value but the sign of molecular chiroptical responses.


text:
# Math Help - Integer identity

1. ## Integer identity

i)Prove that if $x > 1$ and $x\in (\mathbb{R}{ - }\mathbb{Q})$ then : $\left\lfloor \frac {\lfloor nx\rfloor}{x}\right\rfloor = n - 1$

ii) Prove there is an only real $a$ such that: $\forall n \in \mathbb{N}^{*}, \left\lfloor a\lfloor na\rfloor\right\rfloor - \lfloor na\rfloor = n - 1$, (you can us i) )

2. ## Integer proof

Hello linda2005
Originally Posted by linda2005
i)Prove that if $x > 1$ and $x\in (\mathbb{R}{ - }\mathbb{Q})$ then : $\left\lfloor \frac {\lfloor nx\rfloor}{x}\right\rfloor = n - 1$
$x \in \mathbb{R} - \mathbb{Q} \Rightarrow nx\in \mathbb{R} - \mathbb{Q}$

$\Rightarrow \exists\, p \in \mathbb{N} : p (1)

$\Rightarrow p = \lfloor nx\rfloor$

$\Rightarrow \frac{p}{x} = \frac{\lfloor{nx}\rfloor}{x}< n$, from (1)

$\Rightarrow \left\lfloor{\frac{\lfloor{nx}\rfloor}{x}}\right\r floor < n$ (2)

and from (1) $\frac{p+1}{x} > n$

$\Rightarrow \frac{p}{x}+\frac{1}{x}>n$

$\Rightarrow \frac{\lfloor{nx}\rfloor}{x} > n - \frac{1}{x}> n -1$, since $x > 1$

$\Rightarrow \left\lfloor{\frac{\lfloor{nx}\rfloor}{x}}\right\r floor \ge n - 1$

So from (2) $n-1 \le \left\lfloor{\frac{\lfloor{nx}\rfloor}{x}}\right\r floor < n$

$\Rightarrow \left\lfloor{\frac{\lfloor{nx}\rfloor}{x}}\right\r floor = n - 1$

Grandad

3. hello,

Thanks Grandad, very nice proof, so for ii) no one can help me ?

4. Hello linda2005
Originally Posted by linda2005
ii) Prove there is an only real(?) $a$ such that: $\forall n \in \mathbb{N}^{*}, \left\lfloor a\lfloor na\rfloor\right\rfloor - \lfloor na\rfloor = n - 1$, (you can use i) )
I must confess I haven't given this much thought. I'm not really sure what the question means. Have you got the wording right?

Grandad


text:
Need help understanding constant current circuit.

Status
Not open for further replies.

JamesBond007

Joined Oct 25, 2015
24
Now, I have solved this question.
I'm trying to apply KCL and Ohm's law but things just keep looping back and I end up just restating what I already know.
Posted Sep 26
But I got this response.
Anyone who sees the title of this thread and expects it to be useful with "understanding a constant current circuit" will be very disappointed .
But I solved his problem. And then I was banned !
So, I have the right answer, I am called stupid, and I am band.
I don't get it !

tcmtech

Joined Nov 4, 2013
2,867
Um? What????????????

FYI making random babbling threads about stuff that no one cane follow really does not help a person score points with the moderators or anyone else here either.

Usually if you get banned from the site it was for being a general trollish pain in the butt to too many members for too few justifiable reasons and ignoring moderators warnings over it. .

MrAl

Joined Jun 17, 2014
9,347
Hi 007,

So where is the circuit you need help with?
If you dont post a circuit you cant expect anyone to help.

DickCappels

Joined Aug 21, 2008
9,088
Jamesbond007, what is the point of your post?

Also, if you were banned, why did you come back?

JamesBond007

Joined Oct 25, 2015
24
tcmtech
take a pill
Just because you are not speaking with people face to face, does not give u the right to use profanities like $, @ and #. MrAl Read the post. I think I didn't explain myself. I am not asking the question, I answered it ScottWang Joined Aug 23, 2012 7,277 So if you talked with yourself then you should post on your blog, because the forum is not created for this, if there is no any good reason then this thread will be closed to avoid any arguing to happen. MaxHeadRoom Joined Jul 18, 2013 25,636 Max. Thread Starter JamesBond007 Joined Oct 25, 2015 24 Thread. What thread. bertus Joined Apr 5, 2008 22,007 Hello, If you are dannyf, you got a 1 day ban. Or if you are peter taylor, you got a ban until 1 november. When you continue to misbehave, both accounts will be banned. Bertus Last edited: Thread Starter JamesBond007 Joined Oct 25, 2015 24 So if you talked with yourself then you should post on your blog, because the forum is not created for this, if there is no any good reason then this thread will be closed to avoid any arguing to happen. It just dawned on me. Are u not also using this forum as a sounding board ? bertus Joined Apr 5, 2008 22,007 Hello, The forum is for asking questions that can be answered by other members with more knowledge on the topic. A lot of questions are answered by a great group of members that have a long existence over here. Bertus Thread Starter JamesBond007 Joined Oct 25, 2015 24 Thankyou Bertus I have 30 years experience with electronics. In Australia, I am developing a rodent trap for the CSIRO. I went to RMIT, the top electrical institute in the world. I know what I'm talking about. ScottWang Joined Aug 23, 2012 7,277 It just dawned on me. Are u not also using this forum as a sounding board ? Bertus just answer your question. You have your own blog, if you are not asking something for help then you can post on your blog, when the members visit your blog then they will see your post, your blog is your private place to put anything about ee by your own, as I also putted some circuits on my blog, if any members visit my blog then they will see the circuits. If I have anything to ask for help then I will also post on the forums. if you have any good completed stuffs to sharing to the members then you can post on : We mods team just want to keeping a good mood for discussion, if you want to argue only arguing with ee theories. Thread Starter JamesBond007 Joined Oct 25, 2015 24 Thank you ScottWang, there was no anxst, just my way. Keep up the good work tcmtech Joined Nov 4, 2013 2,867 tcmtech take a pill Just because you are not speaking with people face to face, does not give u the right to use profanities like$, @ and #.
Um what profanities?

If you are seeing anything else it must be coming from some text error on your end of the system being I have not posted any text speak profanities of any sort.

JamesBond007

Joined Oct 25, 2015
24
tcmtech. Are u stoned ?

tcmtech

Joined Nov 4, 2013
2,867
Not that I am aware of but I was glueing some PVC pipe together about 15 minutes ago.

A actual reference to what you are talking about showing where I have used profanity towards you would be helpfull for all of us here to follow the context of your accusation.

JamesBond007

Joined Oct 25, 2015
24
Because if you want to take the cartoon character figurine of the hulk outside, I'll come outside with my comic book daffy duck, and put u on the train

GopherT

Joined Nov 23, 2012
8,012
In Australia,
I always just thought of Australia as being upside down, not backwards.

tcmtech

Joined Nov 4, 2013
2,867
Because if you want to take the cartoon character figurine of the hulk outside, I'll come outside with my comic book daffy duck, and put u on the train
Hmmm...........

My avatar picture is presently The Joker character from the 'The Batman' animated series that was popular a few years ago.

Not sure how you got 'The Hulk' out of that one but either way I am pretty sure evil insane clown trumps idiot duck in cartoon land.

Now if you were sporting a Batman avatar well yea they you probably could smack me around a bit.

Status
Not open for further replies.


text:
# Simple Logarithms

1. Aug 22, 2007

1. The problem statement, all variables and given/known data
#8: Simplify: log91/27

2. Relevant equations

y=logb(x)
x=b^y

3. The attempt at a solution

I have personally not tried logarithms before, but I think the problem is really easy and im probably just over-thinking it?

I think that, using the formula's below, 9^a=1/27
So, a=1/243, so my simplified answer should be 9^1/243=1/27..
Can I simplify fractions then, so that 9^1/9=1?
I have personally no exact knowledge on what im doing, but can someone give me some hints or basic concepts on logarithms? Thanks!

**Edit:
Ok, I might be wrong above, I found some more laws, and since loga (x/y)= logax - loga y,
I get:
log 9 (1) - log 9 (27)

since loga 1 = 0
I know have:
- log 9 (27)
Err.. now what?
I have no idea how to plot it into my calculator...
But from my formulas (first two) I get that 9^2/3=27.. but does simplifying mean turning into exponential form? :S

Last edited: Aug 22, 2007
2. Aug 22, 2007

### genneth

27 = 3^3 = 9^(3/2) ==> log_9(27) == 3/2

3. Aug 22, 2007

Huh? I'm pretty sure its 2/3... maybe im wrong but could you further explain yourself?

4. Aug 22, 2007

### rocomath

log(base9) (1/27) = x

9^x = (1/27)

x = log(1/27)/log(9)

5. Aug 22, 2007

So log (1/27) / log (9)

log (1/27) = - log 27 / log 9
Can I simplify to - log 3 / log (1)
So - log 3 / ..0?

Hmm, so I can't simplify or my answer is undefined...

Is my answer -log 27 / log 9..
Im really lost here.

Since log (base a) (a) = 1, does log (base a) (3a) = 3? If so, log (base 9) (27) = 3?

6. Aug 22, 2007

### rocomath

log(base9) (1/27) = x

9^x = (1/27) in exponential form ... since it said to simplify, i solved sorry

type in your calculator log(1/27)/log(9) and plug into x, 9^(-1.5) = 1/27

7. Aug 22, 2007

No problem. So, 9^x= 1/27 is simplified?..

*bangs head against wall* ( I knew it wasn't that complicated, :P)

8. Aug 22, 2007

### rocomath

so the general rule, and with the relevant equations you gave should have been enough information for you to solve it

anyways, the way i learned to convert/simplify/solve logs is by how you read logs

log(base) (y) = x

the base must be raised to some power x, to get y

logs are just inverses, one-to-one functions

9. Aug 22, 2007

Thanks alot for your help, ill go on to the next log problem :) hehe, I guess it wasn't so complicated, I just really didn't know what they ment by "simplify" but now I will assume that simplifying a log solely involves getting rid of the 'log'. Again, thanks.

10. Aug 22, 2007

### rocomath

i just reviewed logs Monday so it's fresh on my mind!

some can be a real b tho :) have fun

11. Aug 22, 2007

### Feldoh

Actually simply means simplify until you cannot simplify anymore. If you can reach a solution that is how far you need to go, like in this case.

Here's how I did it (since you already have the answer :-/):

$$log_9(\frac{1}{27}) = \frac{log_{3}\frac{1}{27}}{log_{3}9}$$

$$\frac{log_{3}\frac{1}{27}}{log_{3}9} = \frac{log_{3}3^{-3}}{log_{3}3^2}$$

$$\frac{log_{3}3^{-3}}{log_{3}3^2} = \frac{-3}{2}$$

12. Aug 22, 2007

### learningphysics

$$27 = 9 * 3 = 9 * 9^{1/2} = 9^{1 + 1/2} = 9^{3/2}$$

$$1/27 = 27^{-1} = (9^{3/2})^{-1} = 9^{-3/2}$$

Last edited: Aug 22, 2007
13. Aug 22, 2007

Wow... Thanks alot for that! That explains alot :P

14. Aug 22, 2007

Umm, may I ask how you get from $$log_9(\frac{1}{27}) = \frac{log_{3}\frac{1}{27}}{log_{3}9}$$

Is there a formula?
Like...: log(base a) (b) = log (base (square root of a)) (b) / log (base (square root of a)

You kind of make sense, but I want to know how to implement it in any problem..
I hope you don't mind explaining after you solved it...

15. Aug 22, 2007

### Feldoh

Change of base is what it is, most people don't realize you can change to any base and not just base 10.

$$log_{a}b = \frac {log_{n}b}{log_{n}a}$$ where n is an integer and is the new base.

Last edited: Aug 22, 2007
16. Aug 22, 2007

Umm, but leaving n as an integer doesnt that give room for n=any integer while a and b dont change? Im going to analyze this and ill get back to you.

17. Aug 22, 2007

### rocomath

change-of-base formula is ... log(b)M=log(a)M/log(a)b where log(a) = log(base10)

let's start off with the Proof

Proof, let x = log(b)M ... in exponential form b^x = M

1) b^x = M

2) take the log(a) of both sides ... log(a)b^x = log(a)M

3) solve for x ... x = log(a)M/log(a)b

4) if x = log(b)M ... (step 3) log(b)M = log(a)M/log(a)b

... log(a) can be anything, it doesn't have to be log(base10)

Last edited: Aug 22, 2007
18. Aug 22, 2007

so... if my answer is log(3) 3^-3 / log (3) 3^2 = -3/2...
Can it also be log (5) 3^-3 / log (5) 3^2 = -3/2.. ?

Or does the new base have to be related to the original base? This is what has me confused.. How do you define the new base, and what effect does this have on the other terms of the equation?

This would be because even though even though the numbers may be larger/smaller, the ratio is the same? I hope im right this time, I think im getting this logs thing :)

Last edited: Aug 22, 2007
19. Aug 22, 2007

### rocomath

i think so ... lol, but i'm no expert.

20. Aug 22, 2007

Thanks, ill re-check with my teacher tommorow. Anyways, I got stuck again.
1. The problem statement, all variables and given/known data
Convert $$\frac{8}{\log_{5}9}$$ to an expression of the form $$a\log_{3}b$$
Ok that's the problem.

2. Relevant equations
#1: $$y=\log_{a}(x)$$
#2: $$x=a^y$$
3. The attempt at a solution
**Im working on it as you read :) bare with me and I'll give you my attempt hehe

Last edited: Aug 22, 2007


text:
## Is light-induced degradation of a-Si:H/c-Si interfaces reversible?

Thin hydrogenated amorphous silicon (a-Si:H) films deposited on crystalline silicon (c-Si) surfaces are sensitive probes for the bulk electronic properties of a-Si:H. Here, we use such samples during repeated low-temperature annealing and visible-light soaking to investigate the long-term stability of a-Si:H films. We observe that during annealing the electronic improvement of the interfaces follows stretched exponentials as long as hydrogen evolution in the films can be detected. Once such evolution is no longer observed, the electronic improvement occurs much faster. Based on these findings, we discuss how the reversibility of light-induced defects depends on (the lack of observable) hydrogen evolution.

Published in:
Applied Physics Letters, 104, 25, 252108
Year:
2014
Publisher:
Melville, Amer Inst Physics
ISSN:
1077-3118
Keywords:
Laboratories:

Note: The status of this file is: EPFL only


text:
## Zentralblatt MATH

Publications of (and about) Paul Erdös

Zbl.No:  359.10038
Title:  On an additive arithmetic function. (In English)
Source:  Pac. J. Math. 71, 275-294 (1977).
Review:  Let n be a positive integer, n = prodi = 1rpi\alpha1 in canonical form, and let A(n) = sumi = 1r\alpha1p1. Clearly A is an additive arithmetic function. Assume the primes p1 are arranged so that p1 \leq p2 < ... < pr. Define P1(n) = pr and, in general, Pk(n) = P1(n/P1(n)... Pk-1(n)) for k \leq sumi = 1r\alpha1 and Pk(n) = 0 for k > sumi = 1r\alpha1. If f and g are arithmetic functions such that sumn \leq xf(n) ~ sumn < xg(n), and if g is a well behaved function (e.g. polynomial, exponential), then g is referred to as the average order of f. It is proved that for all positive integers, we have

sumn \leq xPm(n) ~ sumn \leq x{A(n)-P1(n)-... -Pm-1(n)} ~ kmx1+(1/m)/(log x)m

where km is a positive constant depending only on m. It follows almost immediately from this theorem that the average order of A(n) is \pi2n/6 log n. Let A^*(n) = sumi = 1rp1. Then the average order of A^*(n) is also \pi2n/6 log n, and the average order of A(n)-A^*(n) is log log n. For any fixed positive integer M, the set of solutions to A(n)-A^*(n) = M has a positive natural density. Now A(n) = n if and only if n is a prime or n = 4. Call n a ''special number'' if n\equiv O(mod A(n)) and n\neq A(n), and let {ln} be the sequence of special numbers. This paper's first author has previously proved that the sequence {ln} is infinite [Srinivasa Ramanujan Commemoration Volume, Oxford Press, Madras, India, (1974) part II] . Denote by L(x) the number of \elln \leq x. It is shown that there exist positive constants c, c' such that

L(x) = O(xe-c\sqrt{log x log log x}) and L(x) >> xe-c'\sqrt{log x log log x}.

Finally, let \alpha(n) = (-1)A(n). It is proved that there exists a positive constant c'' such that

sum1 \leq n \leq x\alpha(n) = O(xe-{c''\sqrt log x log log x}),

and that sumn = 1oo\alpha(n)/n = 0.
Reviewer:  B.Garrison
Classif.:  * 11N37 Asymptotic results on arithmetic functions
11K65 Arithmetic functions (probabilistic number theory)

© European Mathematical Society & FIZ Karlsruhe & Springer-Verlag


text:
# Adding Dirac Delta with Unit Step

What does the graph of the function $x(t)=-\delta(t)+u(t)$ look like? $$\delta(t)\ldots\text{ Dirac delta impulse}\\ u(t)\ldots\text{unit step function}$$

Will the impulse at the origin start from 0 downwards or from 1? I'm having trouble because the unit step is discontinuous at t=0, so I don't know how it will shift the impulse. I am talking about continuous time.

• Since the (positive) "impulse" is of "infinite" height, it does not matter in the least whether it "starts" at $0$ or at $1$ (or at $\frac 12$ for mealy-mouthed straddlers unable to reach a decision) on the vertical axis as it "zooms" downwards towards $-\infty$. – Dilip Sarwate Dec 29 '14 at 20:24

Note that $\delta(t)$ is no function but a distribution. This means that it doesn't have function values but it is only defined by its integral. Consequently, the (generalized) function $x(t)=-\delta(t)+u(t)$ has no value at $t=0$ (the only useful value would be $-\infty$ but that's kind of hard to sketch). For sketching the function graph, you can define function values for $t\neq 0$ in the usual way. At $t=0$ you simply sketch a negative $\delta$-impulse, for $t<0$ the function is zero, and for $t>0$ you assign it the value $1$.
• this is a good example of how electrical engineers play fast and loose with $\delta(t)$. i just like to pretend it's a "regular" function that has width of 1 Planck time. – robert bristow-johnson Dec 30 '14 at 21:08