Thanks For Signing Up For MyBB Blog Email Updates
Your email address {{.emailAddress}}
has been successfully added to the MyBB Blog mailing list.
You should receive an email the next time a new post is published on the MyBB Blog.
If you no longer wish to receive these email updates at any time, you can unsubscribe using the unsubscribe link found in the footer of any email from the MyBB Blog.


Kitura
A high performance and simple to use web framework for building modern Swift applications.
Build end-to-end applications in Swift
Kitura is a new, modular, package-based web framework written in the Swift language. Install, create and deploy in under 3 minutes.
Built on core Swift technologies
Kitura scales out of the box, thanks to Grand Central Dispatch. Create your app using Foundation APIs you already know, on macOS and Linux. Manage dependencies and versioning with Swift Package Manager.
Ready for the cloud
Clone, build, push – using tools you already know. Easily deploy to cloud platforms like Bluemix, with buildpacks and Docker containers already provided.
Swift@IBM
For more information on how IBM Engineering is optimising Swift for end-to-end development, visit our Developer Center.


jQuery.LiteBox Example
Using the picture element for 1x and 2x resolution.
The forest in South Japan.
We went walking in Miyazaki, in the rain. It was beautiful. We could see frogs everywhere.


Actions Sheets are elements that appear from the bottom of the page. These can be triggerd by any element, buttons, text, images, and can be used as menus as well.
Trigger by Tap or Programatically
You've asked us to add the feature to simply call a function and trigger a sidebar. We've added this feature to all menus in our product. Action Sheets, Modals, Sidebars can all be triggered and dismissed programatically.
$('#yourSheetID').showMenu();
$('#yourSheetID').hideMenu();


Once completed this can not be undone.' %}


this is a button
check here
this is a textbox
What's your favorite animal?
PROTIP: The right answer is revealed below
Press this please


Make Ahead Manicotti
From: AllRecipes.com
Prep Time: 30 min |
Cook Time: 1 hr |
Servings: 6 |
Ingredients:
- 1 pint ricotta cheese
- 2 eggs
- 1 (10 ounce) package frozen chopped spinach, thawed and drained
- 1 cup shredded mozzarella cheese
- 1/2 cup grated Parmesan cheese
- 1 1/2 tablespoons white sugar
- 1/8 teaspoon salt
- 1/4 teaspoon ground black pepper
- 12 manicotti shells
- 1 (32 ounce) jar spaghetti sauce
Estimated Weight: 5 lbs
Directions:
- In a medium bowl, mix together ricotta cheese and eggs until blended. Stir in spinach, mozzarella cheese, 1/4 cup of the Parmesan cheese, sugar, salt, and pepper. Stuff mixture into uncooked pasta shells.
- Spread 1/2 cup spaghetti sauce in the bottom of a medium baking dish. Arrange stuffed pasta shells in a single layer over the sauce. Pour the remainder of the sauce over the shells, cover dish, and chill in the refrigerator for 8 hours, or overnight.
- Preheat oven to 400 degrees F (200 degrees C). Bake covered for 40 minutes. Sprinkle with remaining Parmesan cheese, and bake for another 15 minutes.


oh...hello
today is saturday
july 4
aka Jofferson
wilson's
b*RRRThday!!
i hope
it's really
a great
celebration!
click for tea song
i'd
like
to buy
you tea.
tea is on me
i'll foot the bill
this too!>>


Please select your preferred unit for display:
Last known reading shown here
made with love by seshadri.xyz


array htpasswd_read ($file = '.htpasswd');
This function reads htpasswd file and returns an account array. The keys contain the user names, the values the crypted password. The returned argument can be passed to http_auth directly.
# Authenticate using local .htpasswd file. include 'lib/http_auth.php'; include 'lib/htpasswd.php'; http_auth (htpasswd_read ('.htpasswd'), 'Admin login');


positive (.–.) samples RNA aerosol air patients influenza AGP risk (,–,) number [], copy potential sample regression []. respiratory AGPs referent viral Table collected <. sampling virus {border-style infection particles study procedures px;} #ffffff;} Health models using aerosols considered data defined factors total Results Sample negative size univariable value HN. aerosol. examining indicated performed Influenza associated baseline logistic presence produce stage variable ventilation CI) Column control patient physiotherapy refers taken transmission unique Kingdom Protection United adjusted binomial care compared different probability production results used (.%) ./journal.pone..t Bronchoscopy Intubation chest contained given included infectious litre model particle related tract Baseline higher minute pandemic repeated significantly studies Chest Estimates analysis bronchoscopy definitions human propensity px; range) recovered samples. significant stages suctioning {font-family < .–. Aerosol Available: IRR Infection Location Median OR = . Referent University areas category. font-size health hospital indicates infected level measurements. patients) present range relative standard use (-) (.) (.–) (.–.)). (e.g. (n = ) (n = ; Agency, Analysis Characteristic However, Infectious PCR Research Risk Tables activity assay categories category containing did double; dummy effect exposure from. generating hyphen indicate kit location low model. no./l nominal numbers ordinal produced quartile segment small time >. (IRR (inter- Diseases EASE JVT Porton Procedures Respiratory Unit, Viral Yes airway border-color border-width cases cohort committee concentration confirmed differences greater hierarchy high hospitals impinger including lower modelled previous prior qRT-PCR rate respiratory/airway settings solid; suggest {font-style {font-weight (HN) (i.e. (no (p<.), (unadjusted A/Cal// AGP) Care Down, Emerging Ethics HCWs High Hospital Jan KAT Manchester, Nebulisation Organization Pandemic RT-PCR Transmission Wiltshire, World addition, aerodynamic airborne analysis. available bold breathing clinical courier; curve days diagnosis does em; exhaled expected final findings guidelines healthcare humidity increase increased individual individuals, information invasive load obtained protective provided pt;} quantify random relationship repeats research shows sizes smaller source specimen specimens statistical table transcript virus. wide µm)


cleaning instructions
General Care & Cleaning
Vinyl & Faux
Sunbrella
Outdura
Weatherscape
General 100% Solution Dyed Acrylic


Comments
-
Greg Hurrell
For things like feeds with an explicit call to a
_url
helper, we can do stuff like:entry.content :src => post_url(post, :protocol => 'https')
But there are places where the URL is implicit such as:
for post in @posts feed.entry post do |entry| ...
There
feed.entry
builds up info based on the passed-inpost
instance, and if the user is accessing over HTTP, the generated link will begin with the "http" schema.In that case would need to pass in an explicit
:url
option:for post in @posts feed.entry(post, :url => post_url(post, :protocol => 'https') ...
-
Greg Hurrell
And in that same example, I can see the top-level of the feed contains:
<link type="text/html" rel="alternate" href="http://localhost:3000/blog"/> <link type="application/atom+xml" rel="self" href="http://localhost:3000/blog.atom"/>
Which is generated like this:
xml.link :rel => 'alternate', :type => 'text/html', :href => request.url.gsub(/\.atom$/, '') xml.link :rel => 'self', :type => 'application/atom+xml', :href => request.url
So that will need to change as well.
-
Greg Hurrell
Actually, I think I am over-thinking this (again).
When the server is properly configured (ie. with nginx on the front end accepting all requests, forwarding only HTTPS requests to the Rails app, and the firewall preventing any direct non-localhost connections to the the application server) no non-HTTPS requests will ever hit the app. All requests will have
HTTP_X_FORWARDED_PROTO
set tohttps
, and Rails will pick that up when generating URLs.Test requests will come from localhost, so might produce non-HTTPS links, but test requests should never hit the live app server running in production mode, so no bad links should ever be cached.
-
Greg Hurrell
Status changed:
- From: new
- To: closed
Add a comment
Comments are now closed for this issue.


HTML can be looked at as the builder in this scenario, its job is to build the structure that holds everything together while CSS comes in as a designer and builds on top of what is already there. Taking what the frames have laid out and styling it in any which way you can imagine.
What is control flow? Control flow when defined is the order in which a computer executes statements in a script. That's all good and well but what does that actually look like? Let's use an example! For this example we are going to imagine you are walking to your favourite store. You know how to get there, down the road, around the corner and across the street. Without control flow if you followed these directions how long would it take to walk into something/someone on the footpath or get hit because you walked out into a busy street. Control flow allows us to step in and add extra parameters when needed, for example when you come across a street execute code that stops walking and looks both ways, confirm its safe and then continue with the original directions.
The Document Object Model (DOM) is what allows us to interact & apply javascript to our HTML. It resembles a family tree which allows you to be as precise or as wide reaching as you like when making changes. For example imagine making every one of your cousins have green hair or maybe just one, with DOM if you can think of it you can do it.
Beginning with arrays we should note they use use zero-based indexing, so the first item in an array has an index of 0, the second item an index of 1 etc… so if we had an array of 5 different city names and we want access the first one we would write that as cityNames[0] . Additionally Items can be added and removed from the beginning or end of an array using the push(), pop(), unshift(), and shift() methods.
Lastly we have Objcets. Objects are used to represent a “thing” in your code. That could be a person, a car, a building, a book, a character in a game. Basically anything that is made up or can be defined by a set of characteristics. In objects, these characteristics are called properties that consist of a key and a value. Properties in objects can be accessed, added, changed, and removed by using either dot or bracket notation. If we had an object called person holding basic info about them you could access it like the following - person.age or person[‘age’] . Both of these would return the same value.
Functions are blocks of code that preform a task, this could be as simple as adding two numbers or as complex as you would like to make it. One of the many benefits of functions is that if you need to use that block of code again you don’t have to write out all that code again, you can just call whatever you named your function and it perform that block of code you already wrote..or copied from the internet.


| Obligation | |
|---|---|
| MidYear | YearEnd |
|
|
|
| Disbursement | |
|---|---|
| MidYear | YearEnd |
|
|
|
| Physical Average | |
|---|---|
| MidYear | YearEnd |
|
|
|
| Financial Status with more than 12M Budget Allocation |
|---|
| Top 5 Physical Performer | |
|---|---|
| Financial Status with less than 12M Budget Allocation |
|---|
| Physical Monthly Status | |
|---|---|
| {{ l.month }} | Closed Opened |
| Performance Summary by Program |
|---|
|
|
| Logs Active Status | |||
|---|---|---|---|
| Banner/OUs | Obligation | Physical | Disbursement |
| {{l.username | uppercase}} | {{ l.bed1.date_updated | amTimeAgo }} | {{ l.bed2.date_updated | amTimeAgo }} | {{ l.bed3.date_updated | amTimeAgo }} |


angular-message-format.js currently does not allow you to use custom start and end symbols for interpolation.
You have redefined $interpolate.startSymbol
/$interpolate.endSymbol
and also
loaded the ngMessageFormat
module (provided by angular-message-format.min.js)
while creating your injector.
ngMessageFormat
currently does not support redefinition of the
startSymbol/endSymbol used by $interpolate
. If this is affecting you, please
file an issue and mention @chirayuk on it. This is intended to be fixed in a
future commit and the github issue will help gauge urgency.
For more information about the MessageFormat syntax in interpolation expressions, please refer to MessageFormat extensions section at AngularJS i18n MessageFormat


title = "Privacy Policy"
url = "/legal/privacy-policy"
layout = "default"
is_hidden = 0
==
{% put page_title %}
Terms & Conditions
{% endput %}
{% put meta_title %}
{{ this.theme.site_name }} Privacy Policy
{% endput %}
Introduction
This privacy policy applies between you, the User of this Website and {{ this.theme.site_owner }}, the owner and provider
of this Website. {{ this.theme.site_owner }} takes the privacy of your information very seriously. This privacy policy
applies to our use of any and all Data collected by us or provided by you in relation to your use of the
Website.
This privacy policy should be read alongside, and in addition to, our Terms and Conditions, which can be found
at: {{ 'terms-conditions' | page }}.
Please read this privacy policy carefully.
Definitions and interpretation
- In this privacy policy, the following definitions are used:
| Data |
collectively all information that you submit to {{ this.theme.site_owner }} via the Website. This
definition incorporates, where applicable, the definitions provided in the Data Protection Laws;
|
| Cookies |
a small text file placed on your computer by this Website when you visit certain parts of the
Website and/or when you use certain features of the Website. Details of the cookies used by this
Website are set out in the clause below (Cookies);
|
| Data Protection Laws |
any applicable law relating to the processing of personal Data, including but not limited to the
Directive 96/46/EC (Data Protection Directive) or the GDPR, and any national implementing laws,
regulations and secondary legislation, for as long as the GDPR is effective in the UK;
|
| GDPR |
the General Data Protection Regulation (EU) 2016/679; |
{{ this.theme.site_owner }},
we or us |
{{ this.theme.site_owner }}
{% if this.theme.site_owner_type != 'private' %}
{% if this.theme.site_owner_type == 'company' %}
is a company incorporated in England and Wales with registered number {{ this.theme.company_number }}
{% elseif this.theme.site_owner_type == 'partnership' %}
is a partnership
{% elseif this.theme.site_owner_type == 'sole-trader' %}
is a sole trader
{% endif %}
whose registered address is:
{{ this.theme.site_owner_business_address |raw }}
{% else %}
is a private individual or organisation.
{% endif %}
|
| UK and EU Cookie Law |
the Privacy and Electronic Communications (EC Directive) Regulations 2003 as amended by the
Privacy and Electronic Communications (EC Directive) (Amendment) Regulations 2011;
|
| User or you |
any third party that accesses the Website and is not either (i) employed by {{ this.theme.site_owner }}
and acting in the course of their employment or (ii) engaged as a consultant or otherwise
providing services to {{ this.theme.site_owner }} and accessing the Website in connection with the
provision of such services; and
|
| Website |
the website that you are currently using, {{ url('/') }}, and any sub-domains of this site
unless expressly excluded by their own terms and conditions.
|
- In this privacy policy, unless the context requires a different interpretation:
- the singular includes the plural and vice versa;
- references to sub-clauses, clauses, schedules or appendices are to sub-clauses, clauses, schedules
or appendices of this privacy policy;
- a reference to a person includes firms, companies, government entities, trusts and partnerships;
- "including" is understood to mean "including without limitation";
- reference to any statutory provision includes any modification or amendment of it;
- the headings and sub-headings do not form part of this privacy policy.
Scope of this privacy policy
- This privacy policy applies only to the actions of {{ this.theme.site_owner }} and Users with respect to this Website.
It does not extend to any websites that can be accessed from this Website including, but not limited to, any
links we may provide to social media websites.
- For purposes of the applicable Data Protection Laws, {{ this.theme.site_owner }} is the "data controller". This means
that {{ this.theme.site_owner }} determines the purposes for which, and the manner in which, your Data is processed.
Data collected
- We may collect the following Data, which includes personal Data, from you:
- name;
- job title;
- profession;
- contact Information such as email addresses and telephone numbers;
- IP address (automatically collected);
- web browser type and version (automatically collected);
in each case, in accordance with this privacy policy.
How we collect Data
- We collect Data in the following ways:
- data is given to us by you;
- data is received from other sources; and
- data is collected automatically.
Data that is given to us by you
- {{ this.theme.site_owner }} will collect your Data in a number of ways, for example:
- when you contact us through the Website, by telephone, post, e-mail or through any other means;
- when you register with us and set up an account to receive our products/services;
- when you make payments to us, through this Website or otherwise;
- when you elect to receive marketing communications from us;
- when you use our services;
in each case, in accordance with this privacy policy.
Data that is received from publicly available third parties sources
- We will receive Data about you from the following publicly available third party sources:
- Information readily available through the internet;
Data that is collected automatically
- To the extent that you access the Website, we will collect your Data automatically, for example:
- we automatically collect some information about your visit to the Website. This information helps us
to make improvements to Website content and navigation, and includes your IP address, the date,
times and frequency with which you access the Website and the way you use and interact with its
content.
- we will collect your Data automatically via cookies, in line with the cookie settings on your
browser. For more information about cookies, and how we use them on the Website, see the section
below, headed "Cookies".
Our use of Data
- Any or all of the above Data may be required by us from time to time in order to provide you with the best
possible service and experience when using our Website. Specifically, Data may be used by us for the
following reasons:
- internal record keeping;
- improvement of our products / services;
in each case, in accordance with this privacy policy.
- We may use your Data for the above purposes if we deem it necessary to do so for our legitimate interests.
If you are not satisfied with this, you have the right to object in certain circumstances (see the section
headed "Your rights" below).
- When you register with us and set up an account to receive our services, the legal basis for this processing
is the performance of a contract between you and us and/or taking steps, at your request, to enter into such
a contract.
- We may use your Data to show you {{ this.theme.site_owner }} adverts and other content on other websites. If you do
not want us to use your data to show you {{ this.theme.site_owner }} adverts and other content on other websites,
please turn off the relevant cookies (please refer to the section headed "Cookies" below).
Who we share Data with
- We may share your Data with the following groups of people for the following reasons:
- our employees, agents and/or professional advisors - to obtain advice from professional advisers;
- third party payment providers who process payments made over the Website - to enable third party
payment providers to process user payments and refunds;
in each case, in accordance with this privacy policy.
Keeping Data secure
- We will use technical and organisational measures to safeguard your Data, for example:
- access to your account is controlled by a password and a user name that is unique to you.
- we store your Data on secure servers.
- Technical and organisational measures include measures to deal with any suspected data breach. If you
suspect any misuse or loss or unauthorised access to your Data, please let us know immediately by contacting
us via this e-mail address<EMAIL_ADDRESS>- If you want detailed information from Get Safe Online on how to protect your information and your computers
and devices against fraud, identity theft, viruses and many other online problems, please visit
www.getsafeonline.org. Get Safe Online is supported by HM Government and leading businesses.
Data retention
- Unless a longer retention period is required or permitted by law, we will only hold your Data on our systems
for the period necessary to fulfil the purposes outlined in this privacy policy or until you request that
the Data be deleted.
- Even if we delete your Data, it may persist on backup or archival media for legal, tax or regulatory
purposes.
Your rights
- You have the following rights in relation to your Data:
- Right to access - the right to request (i) copies of the information we hold about you at any
time, or (ii) that we modify, update or delete such information. If we provide you with access to
the information we hold about you, we will not charge you for this, unless your request is
"manifestly unfounded or excessive." Where we are legally permitted to do so, we may refuse your
request. If we refuse your request, we will tell you the reasons why.
- Right to correct - the right to have your Data rectified if it is inaccurate or incomplete.
- Right to erase - the right to request that we delete or remove your Data from our systems.
- Right to restrict our use of your Data - the right to "block" us from using your Data or
limit the way in which we can use it.
- Right to data portability - the right to request that we move, copy or transfer your Data.
- Right to object - the right to object to our use of your Data including where we use it for
our legitimate interests.
- To make enquiries, exercise any of your rights set out above, or withdraw your consent to the processing of
your Data (where consent is our legal basis for processing your Data), please contact us via this e-mail
address<EMAIL_ADDRESS>- If you are not satisfied with the way a complaint you make in relation to your Data is handled by us, you
may be able to refer your complaint to the relevant data protection authority. For the UK, this is the
Information Commissioner's Office (ICO). The ICO's contact details can be found on their website at
https://ico.org.uk/.
- It is important that the Data we hold about you is accurate and current. Please keep us informed if your
Data changes during the period for which we hold it.
Links to other websites
- This Website may, from time to time, provide links to other websites. We have no control over such websites
and are not responsible for the content of these websites. This privacy policy does not extend to your use
of such websites. You are advised to read the privacy policy or statement of other websites prior to using
them.
Changes of business ownership and control
- {{ this.theme.site_owner }} may, from time to time, expand or reduce our business and this may involve the sale and/or
the transfer of control of all or part of {{ this.theme.site_owner }}. Data provided by Users will, where it is
relevant to any part of our business so transferred, be transferred along with that part and the new owner
or newly controlling party will, under the terms of this privacy policy, be permitted to use the Data for
the purposes for which it was originally supplied to us.
- We may also disclose Data to a prospective purchaser of our business or any part of it.
- In the above instances, we will take steps with the aim of ensuring your privacy is protected.
Cookies
- This Website may place and access certain Cookies on your computer.
{{ this.theme.site_owner }} uses Cookies to improve your experience of using the Website and to improve our range of
services.
{{ this.theme.site_owner }} has carefully chosen these Cookies and has taken steps to ensure that your privacy is
protected and respected at all times.
- All Cookies used by this Website are used in accordance with current UK and EU Cookie Law.
- Before the Website places Cookies on your computer, you will be presented with a message bar requesting your
consent to set those Cookies. By giving your consent to the placing of Cookies, you are enabling Dynamedia
Limited to provide a better experience and service to you. You may, if you wish, deny consent to the placing
of Cookies; however certain features of the Website may not function fully or as intended.
- This Website may place the following Cookies:
| Type of Cookie |
Purpose |
| Strictly necessary cookies |
These are cookies that are required for the operation of our website. They
include, for example, cookies that enable you to log into secure areas of our website, use a
shopping cart or make use of e-billing services.
|
| Analytical/performance cookies |
They allow us to recognise and count the number of visitors and to see how
visitors move around our website when they are using it. This helps us to improve the way our
website works, for example, by ensuring that users are finding what they are looking for easily.
|
| Functionality cookies |
These are used to recognise you when you return to our website. This
enables us to personalise our content for you, greet you by name and remember your preferences (for
example, your choice of language or region).
|
| Targeting cookies |
These cookies record your visit to our website, the pages you have visited
and the links you have followed. We will use this information to make our website and the
advertising displayed on it more relevant to your interests. We may also share this information with
third parties for this purpose.
|
- You can find a list of Cookies that we use at {{ 'cookies' | page }}.
- You can choose to enable or disable Cookies in your internet browser. By default, most internet browsers
accept Cookies but this can be changed. For further details, please consult the help menu in your internet
browser.
- You can choose to delete Cookies at any time; however you may lose any information that enables you to
access the Website more quickly and efficiently including, but not limited to, personalisation settings.
- It is recommended that you ensure that your internet browser is up-to-date and that you consult the help and
guidance provided by the developer of your internet browser if you are unsure about adjusting your privacy
settings.
- For more information generally on cookies, including how to disable them, please refer to aboutcookies.org.
You will also find details on how to delete cookies from your computer.
General
- You may not transfer any of your rights under this privacy policy to any other person. We may transfer our
rights under this privacy policy where we reasonably believe your rights will not be affected.
- If any court or competent authority finds that any provision of this privacy policy (or part of any
provision) is invalid, illegal or unenforceable, that provision or part-provision will, to the extent
required, be deemed to be deleted, and the validity and enforceability of the other provisions of this
privacy policy will not be affected.
- Unless otherwise agreed, no delay, act or omission by a party in exercising any right or remedy will be
deemed a waiver of that, or any other, right or remedy.
- This Agreement will be governed by and interpreted according to the law of England and Wales. All disputes
arising under the Agreement will be subject to the exclusive jurisdiction of the English and Welsh courts.
Changes to this privacy policy
- {{ this.theme.site_owner }} reserves the right to change this privacy policy as we may deem necessary from time to
time or as may be required by law. Any changes will be immediately posted on the Website and you are deemed
to have accepted the terms of the privacy policy on your first use of the Website following the alterations.
You may contact {{ this.theme.site_owner }} by email at {{ this.theme.site_owner_email }}.
Attribution
- This privacy policy was created using a document from Rocket
Lawyer (https://www.rocketlawyer.co.uk).
01 October 2018


info theory
Contents
4.5. info theory#
material from Cover “Elements of Information Theory”
4.5.1. overview#
with small number of points, estimated mutual information is too high
founded with claude shannon 1948
set of principles that govern flow + transmission of info
X is a R.V. on (finite) discrete alphabet ~ won’t cover much continuous
4.5.2. entropy, relative entropy, and mutual info#
<IP_ADDRESS>. entropy#
\(H(X) = - \sum p(x) \:\log p(x) = E[h(p)]\)
\(h(p)= - \log(p)\)
\(H(p)\) implies p is binary
usually for discrete variables only
assume 0 log 0 = 0
intuition
higher entropy \(\implies\) more uniform
lower entropy \(\implies\) more pure
expectation of variable \(W=W(X)\), which assumes the value \(-log(p_i)\) with probability \(p_i\)
minimum, average number of binary questions (like is X=1?) required to determine value is between \(H(X)\) and \(H(X)+1\)
related to asymptotic behavior of sequence of i.i.d. random variables
properties
\(H(X) \geq 0\) since \(p(x) \in [0, 1]\)
funtion of distr. only, not the specific values the RV takes (the support of the RV)
gaussian has max entropy s.t. variance constraint
\(H(Y\|X)=\sum p(x) H(Y\|X=x) =- \sum_x p(x) \sum_y p(y|x) \log \: p(y|x)\)
\(H(X,Y)=H(X)+H(Y\|X) =H(Y)+H(X\|Y)\)
<IP_ADDRESS>. relative entropy / mutual info#
relative entropy = KL divergence - measures distance between 2 distributions
- \[D(p\|\|q) = \sum_x p(x) log \frac{p(x)}{q(x)} = \mathbb E_p log \frac{p(X)}{q(X)} = \mathbb E_p[-\log q(X)] - H(p) \]
if we knew the true distribution p of the random variable, we could construct a code with average description length H(p).
If, instead, we used the code for a distribution q, we would need H(p) + D(p||q) bits on average to describe the random variable.
\(D(p\|\|q) \neq D(q\|\|p)\)
properties
nonnegative
not symmetric
mutual info I(X; Y): how much you can predict about one given the other
\(I(X; Y) = \sum_X \sum_y p(x,y) \log \frac{p(x,y)}{p(x) p(y)} = D(p(x,y)\|\|p(x) p(y))\)
\(I(X; Y) = -H(X,Y) + H(X) + H(Y))\)
\(=I(Y|X)\)
\(I(X; X) = H(X)\) so entropy sometimes called self-information
cross-entropy: \(H_q(p) = -\sum_x p(x) \: \log \: q(x)\)
<IP_ADDRESS>. chain rules#
entropy \(H(X_1, ..., X_n) = \sum_i H(X_i \| X_{i-1}, ..., X_1) = H(X_n \| X_{n-1}, ..., X_1) + ... + H(X_1)\)
conditional mutual info \(I(X; Y\|Z) = H(X\|Z) - H(X\|Y,Z)\)
\(I(X_1, ..., X_n; Y) = \sum_i I(X_i; Y\|X_{i-1}, ... , X_1)\)
conditional relative entropy \(D(p(y\|x) \|\| q(y\|x)) = \sum_x p(x) \sum_y p(y\|x) log \frac{p(y\|x)}{q(y\|x)}\)
\(D(p(x, y)\|\|q(x, y)) = D(p(x)\|\|q(x)) + D(p(y\|x)\|\|q(y\|x))\)
<IP_ADDRESS>. axiomatic approach#
fundamental theorem of information theory - it is possible to transmit information through a noisy channel at any rate less than channel capacity with an arbitrarily small probability of error
to achieve arbitrarily high reliability, it is necessary to reduce the transmission rate to the channel capacity
uncertainty measure axioms
H(1/M,…,1/M)=f(M) is a montonically increasing function of M
f(ML) = f(M)+f(L) where M,L \(\in \mathbb{Z}^+\)
grouping axiom
H(p,1-p) is continuous function of p
\(H(p_1,...,p_M) = - \sum p_i log p_i = E[h(p_i)]\)
\(h(p_i)= - log(p_i)\)
only solution satisfying above axioms
H(p,1-p) has max at 1/2
lemma - Let \(p_1,...,p_M\) and \(q_1,...,q_M\) be arbitrary positive numbers with \(\sum p_i = \sum q_i = 1\). Then \(-\sum p_i log p_i \leq - \sum p_i log q_i\). Only equal if \(p_i = q_i \: \forall i\)
intuitively, \(\sum p_i log q_i\) is maximized when \(p_i=q_i\), like a dot product
\(H(p_1,...,p_M) \leq log M\) with equality iff all \(p_i = 1/M\)
\(H(X,Y) \leq H(X) + H(Y)\) with equality iff X and Y are independent
\(I(X,Y)=H(Y)-H(Y\|X)\)
sometimes allow p=0 by saying 0log0 = 0
information \(I(x)=log_2 \frac{1}{p(x)}=-log_2p(x)\)
reduction in uncertainty (amount of surprise in the outcome)
if the probability of event happening is small and it happens the info is large
entropy \(H(X)=E[I(X)]=\sum_i p(x_i)I(x_i)=-\sum_i p(x_i)log_2 p(x_i)\)
information gain \(IG(X,Y)=H(Y)-H(Y\|X)\)
\(=-\sum_j p(x_j) \sum_i p(y_i\|x_j) log_2 p(y_i\|x_j)\)
parts
random variable X taking on \(x_1,...,x_M\) with probabilities \(p_1,...,p_M\)
code alphabet = set \(a_1,...,a_D\) . Each symbol \(x_i\) is assigned to finite sequence of code characters called code word associated with \(x_i\)
objective - minimize the average word length \(\sum p_i n_i\) where \(n_i\) is average word length of \(x_i\)
code is uniquely decipherable if every finite sequence of code characters corresponds to at most one message
instantaneous code - no code word is a prefix of another code word
4.5.3. basic inequalities#
<IP_ADDRESS>. jensen’s inequality#
convex - function lies below any chord
has positive 2nd deriv
linear functions are both convex and concave
Jensen’s inequality - if f is a convex function and X is an R.V., \(f(E[X]) \leq E[f(X)]\)
if f strictly convex, equality \(\implies X=E[X]\)
implications
information inequality \(D(p\|\|q) \geq 0\) with equality iff p(x)=q(x) for all x
\(H(X) \leq log \|X\|\) where |X| denotes the number of elements in the range of X, with equality if and only X has a uniform distr
\(H(X\|Y) \leq H(X)\) - information can’t hurt
\(H(X_1, ..., X_n) \leq \sum_i H(X_i)\)
4.5.4. mdl#
chapter 1: overview
explain data given limited observations
benefits
occam’s razor
no overfitting (can pick both form of model and params), without need for ad hoc penalties
bayesian interpretation
no need for underlying truth
description - in terms of some description method
e.g. a python program which prints a sequence then halts = Kolmogorov complexity
invariance thm - as long as sequence is long enough, choice of programming language doesn’t matter) - (kolmogorov 1965, chaitin 1969, solomonoff 1964)
not computable in general
for small samples in practice, depends on choice of programming language
in practice, we don’t use general programming languages but rather select a description method which we know we can get the length of the shortest description in that class (e.g. linear models)
trade-off: we may fail to minimally compress some sequences which have regularity
knowing data-generating process can help compress (e.g. recording times for something to fall from a height, generating digits of \(\pi\) via taylor expansion, compressing natural language based on correct grammar)
simplest version - let \(\theta\) be the model and \(X\) be the data
2-part MDL: minimize \(L(\theta) + L(X|\theta)\)
\(L(X|\theta) = - \log P(X|\theta)\) - Shannon code
\(L(\theta)\) - hard to get this, basic problem with 2-part codes
have to do this for each model, not model-class (e.g. different linear models with same number of parameters would have different \(L(\theta)\)
stochastic complexity (“refined mdl”): \(\bar{L}(X|\theta)\) - only construct one code
ex. \(\bar L(X|\theta) = |\theta|_0 + L(X|\theta)\) - like 2-part code but breaks up \(\theta\) space into different sets (e.g. same number of parameters) and assigns them equal codelength
normalized maximum likelihood - most recent version - select from among a set of codes
chapter 2.2.1 background
in mdl, we only work with prefix codes (i.e. no codeword is a prefix of any other codeword)
these are uniquely decodable
in fact, any uniquely decodable code can be rewritten as a prefix code which achieves the same code length
chapter 2.2.2: probability mass functions correspond to codelength functions
coding: \(x \sim P(X)\), codelengths \(\ell(x)\)
Kraft inequality: \(\sum_x 2^{-\ell(x)} \leq 1\)
given a code \(C\) and a prob distr. \(P\), we can construct a code so short codewords get high probs and vice versa
given \(P\), \(\exists C, \forall z \: L_C(z) \leq \lceil -\log P(z) \rceil\)
given \(C'\), \(\exists P' \: \forall z -\log P(z) = L_{C'}(z)\)
we redefine codelength so it doesn’t require actual integer lengths
we don’t care about the actual encodings, only the codelengths
given a sample space \(\mathcal Z\), the set of all codelength functions \(L_\mathcal Z\) is the set of functions \(L\) on \(\mathcal Z\) where \(\exists \,Q\) (distr), such that \(\sum_z Q(z) \leq 1\) and \(\forall z,\; L(z) = -\log Q(z)\)
uniform distr. - every codeword just has same length (fixed-length)
we usually assume we are encoding a sequence \(x^n\) which is large, so the rounding becomes negligible
ex. encoding integers: send \(\log k\) zeros, then add a 1, then uniform code from 0 to \(2^{\log k}\)
Given \(P(X)\), the codelength function \(L(X) = -\log P(X)\) minimizes expected code length for the variable \(X\)
chapter 2.2.3 - the information inequality: \(E_P[-\log Q(X)] > E_P[-\log P(X)]\)
if \(X\) was generated by \(P\), then codes with length \(-\log P(X)\) give the shortest encodings on average
not surprising - in a large sample, X will occur with frequency proportial to \(P(X)\), so we want to give it a short codelength \(-\log P(X)\)
consequently, ideal mean length = \(H(X)\)
chapter 2.4: crude mdl ex. pick order of markov chain by minimizing \(L(H) + L(D|H)\) where \(D\) is data, \(H\) is hypothesis
we get to pick codes for \(L(H)\) and \(L(D|H)\)
let \(L(x^n|H) = -\log P(x^n|H)\) (length of data is just negative log-likelihood)
for \(L(H)\), describe length of chain \(k\) with code for integers, then \(k\) parameters between 0 and 1 by describing the counts generated by the params in n samples - this tends to be harder to do well
chapter 2.5: universal codes + models
note: these codes are only universal relative to the set of considered codes \(\mathcal L\)
universal model - prob. distr corresponding to universal codes
(different from how we use model in statistics)
given a set of codes \(\mathcal L = \{ L_1, L_2, ... \}\), given a squences \(x^n\), one of the codes \(L \in \mathcal L\) has the shortest length for that sequence \(\bar L(x^n)\)
however, we have to pick one \(L\), before we see \(x^n\)
universal code - one code such that no matter which \(x^n\) arrives, length is not much longer than the shortest length among all considered codes
ex. 2-part codes: first send bits to pick among codes, then use the selected code to encode \(x^n\) - overhead is small because it doesn’t depend on \(n\)
among countably infinite codes, can still send \(k\) to index the code, although \(k\) can get very large
ex. bayesian universal model - assign prior distr to codes
ex. nml is an optimal (minimizes worst-case regret) universal model
\(\bar P_{\text{nml}} (x^n) = \frac{P(x^n | \hat \theta (x^n))}{\sum_{z^n \in \mathcal X^n} P(z^n | \hat \theta (z^n))}\)
literally a normalized likelihood
regret of \(\bar P\) relative to \(M\): \(−\log \bar P(x^n)− \min_{P \in M} -\log P(x^n )\)
measures the performance of universal models relative to a set of candidate sources M
\(\bar P\) is a probability distribution on \(\mathcal X^n\) (\(P\) is not necessarily in \(M\))
when evaluating a code, we may look at the worst regret over all \(x^n\), or the average


eveMt
Create an Account
First Name
Last Name
Email
Username
Password
Confirm Password
Powered by Group 109


Christina Martinez
26 years old
McDuffie Place, Albuquerque, New Mexico
Christina (or "Chris" as everyone calls her) is a reference librarian at the Cherry Hills branch library. She has a Master of Library and Information Science (MLIS) degree from Simmons College and has been with the Albuquerque Public Library for two years.
Chris had the opportunity to take an introduction to HTML and CSS course while working on her master's degree, so she is very comfortable with computers. At work, she uses a 2016 Dell XPS 8900 Desktop that runs on Windows 10 Pro. The smartphone she recently purchased is an LG G6 with Android 7.0. Additionally, her personal laptop is a 13-inch 2017 MacBook Air, on which she installed macOS Mojave a few weeks ago.
Chris has loved house and techno since she was a teenager in Chicago, but ever since she and her spouse started their careers, they haven't gone out clubbing very much.
Recently, Chris and her wife have had a desire to start going out again on the weekends. However, in spite of Chris's superior research skills, she has found the experience of searching for DJs and local night clubs to be a bothersome activity. Looking through local venues' calendars takes up too much of her free time, so she and her spouse end up spending weekends at home more often than not.
When Chris and her wife first moved to Albuquerque, they picked up a few copies of the Alibi and then eventually started using the paper's website. Chris in particular was put-off by the website's poor aesthetic qualities and the calendar section, which only allows users to search by dates. The quality of indivdual venues' websites varies, but Chris finds searching through them to be too time-consuming to be worth the trouble. She would love to have a website or application that lists all upcoming musical events that is both easy to navigate and pleasing to the eye. If the site/app could be easily accessed via mobile, she and her wife would be even happier.
Chris and her spouse feel comfortable in their careers now and really want to revive their old passion for clubbing. They need a resource that will make it easy to find events by date, genre, venue, artist, and possibly promoter. As they both have errands to run and various activities that take up their weekend mornings and afternoons (on top of their jobs and obligations during the work week), they need something that can be accessed on-the-go to make evening planning easier.
Chris Martinez is a dance music enthusiast who needs an application or website that will help her easily and quickly find current and upcoming house and/or techno nights to attend.
Searching for a bar or night club with a house and/or techno DJ.
Chris wants to find a venue where she and her spouse can go dance to house and/or techno music.
Chris, a house and techno fan who wants to find a DJ playing in a local club this weekend
She must have a mobile phone that can access the website.
The website confirms that Moodymann will be playing at Sister Bar on Saturday at 10:00 PM. From the site she can share the event on social media, click a link to locate the venue in her map application, or be taken to an external site to purchase a ticket/pay the cover charge.
Once per week, primarily on the weekends


{% extends 'base.html' %} {% block header %}
{% endblock %} {% block content %}
{% block title %}Available Activities{% endblock %}
These are all the available activities that your chapter can complete. En Español
Chapter Building
| Activity |
Description |
Points |
{% for activity in activities %}
{% if activity.type == 'Community Building' %}
|
{{ activity.title }}
|
{{activity.description | safe}}
|
{{activity.point_value}}
|
{% endif %}
{% endfor %}
Policy Change
| Activity |
Description |
Points |
{% for activity in activities %}
{% if activity.type == 'Policy Change' %}
|
{{ activity.title }}
|
{{activity.description | safe}}
|
{{activity.point_value}}
|
{% endif %}
{% endfor %}
Training and Education
| Activity |
Description |
Points |
{% for activity in activities %}
{% if activity.type == 'Training and Education' %}
|
{{ activity.title }}
|
{{activity.description | safe}}
|
{{activity.point_value}}
|
{% endif %}
{% endfor %}
Chapter Building
| Activity |
Description |
Points |
{% for activity in activities %}
{% if activity.type == 'Community Building' %}
|
{{ activity.title }}
|
{{activity.spanish_translation | safe}}
|
{{activity.point_value}}
|
{% endif %}
{% endfor %}
Policy Change
| Activity |
Description |
Points |
{% for activity in activities %}
{% if activity.type == 'Policy Change' %}
|
{{ activity.title }}
|
{{activity.spanish_translation | safe}}
|
{{activity.point_value}}
|
{% endif %}
{% endfor %}
Training and Education
| Activity |
Description |
Points |
{% for activity in activities %}
{% if activity.type == 'Training and Education' %}
|
{{ activity.title }}
|
{{activity.spanish_translation | safe}}
|
{{activity.point_value}}
|
{% endif %}
{% endfor %}
{% endblock %}


Lorem ipsum ...for a moment I stood a little puzzled by this curious request, not knowing exactly how to take it, whether humorously or in earnest. But concentrating all his crow's feet into one scowl, Captain Peleg started me on the errand.
Don't mind me, I'm just playing with layouts, 3d and scrolling triggers...
For a moment I stood a little puzzled by this curious request, not knowing exactly how to take it, whether humorously or in earnest. But concentrating all his crow's feet into one scowl, Captain Peleg started me on the errand.
Going forward and glancing over the weather bow, I perceived that the ship swinging to her anchor with the flood-tide, was now obliquely pointing towards the open ocean. The prospect was unlimited, but exceedingly monotonous and forbidding; not the slightest variety that I could see.
"Well, what's the report?" said Peleg when I came back; "what did ye see?"
"Not much," I replied—"nothing but water; considerable horizon though, and there's a squall coming up, I think."
"Well, what does thou think then of seeing the world? Do ye wish to go round Cape Horn to see any more of it, eh? Can't ye see the world where you stand?"
I was a little staggered, but go a-whaling I must, and I would; and the Pequod was as good a ship as any—I thought the best—and all this I now repeated to Peleg. Seeing me so determined, he expressed his willingness to ship me.
"And thou mayest as well sign the papers right off," he added—"come along with ye." And so saying, he led the way below deck into the cabin.
"Well, what does thou think then of seeing the world? Do ye wish to go round Cape Horn to see any more of it, eh? Can't ye see the world where you stand?"
I was a little staggered, but go a-whaling I must, and I would; and the Pequod was as good a ship as any—I thought the best—and all this I now repeated to Peleg. Seeing me so determined, he expressed his willingness to ship me.
Going forward and glancing over the weather bow, I perceived that the ship swinging to her anchor with the flood-tide, was now obliquely pointing towards the open ocean. The prospect was unlimited, but exceedingly monotonous and forbidding; not the slightest variety that I could see.
For a moment I stood a little puzzled by this curious request, not knowing exactly how to take it, whether humorously or in earnest. But concentrating all his crow's feet into one scowl, Captain Peleg started me on the errand.
Going forward and glancing over the weather bow, I perceived that the ship swinging to her anchor with the flood-tide, was now obliquely pointing towards the open ocean. The prospect was unlimited, but exceedingly monotonous and forbidding; not the slightest variety that I could see.
Thanks for viewing!


Activity
Airplay
Alert Circle
Alert Octagon
Alert Triangle
Align Center
Align Justify
Align Left
Align Right
Anchor
Aperture
Archive
Arrow Down
Arrow Left
Arrow Right
Arrow Down
Arrow Left
Arrow Left
Arrow Up
Arrow Right
Arrow Right
Arrow Up
At Sign
Award
Bar Chart 2
Bar Chart
battery-charging
battery
bell-off
bell
bluetooth
bold
book-open
book
bookmark
calendar
camera-off
camera
cast
check-circle
check-square
check
chevron-down
chevron-left
chevron-right
chevron-up
chevrons-down
chevrons-left
chevrons-right
chevrons-up
chrome
circle
clipboard
clock
cloud-drizzle
cloud-lightning
cloud-off
cloud-rain
cloud-snow
cloud
code
codepen
codesandbox
coffee
columns
command
compass
copy
corner-down-left
corner-down-right
corner-left-down
corner-left-up
corner-right-down
corner-right-up
corner-up-left
corner-up-right
cpu
credit-card
crop
crosshair
database
delete
disc
dollar-sign
download-cloud
download
droplet
edit-2
edit-3
edit
external-link
eye-off
eye
fast-forward
feather
figma
file-minus
file-plus
file-text
file
film
flag
folder-minus
folder-plus
folder
framer
frown
gift
git-branch
git-commit
git-merge
git-pull-request
github
gitlab
globe
grid
hard-drive
hash
headphones
heart
help-circle
hexagon
home
image
inbox
inbox
info
italic
key
layers
layout
life-buoy
link-2
link
list
loader
lock
log-in
log-out
map-pin
map
maximize-2
maximize
meh
menu
inbox
message-circle
message-square
mic-off
mic
minimize-2
minimize
minus-circle
minus-square
minus
monitor
moon
more-horizontal
more-vertical
mouse-pointer
move
music
navigation-2
inbox
octagon
package
paperclip
pause-circle
pause
pen-tool
percent
phone-call
phone-forwarded
phone-incoming
phone-missed
phone-off
phone-outgoing
phone
pie-chart
play-circle
play
plus-circle
plus-square
plus
power
printer
radio
refresh-ccw
repeat
rewind
rotate-ccw
rotate-cw
rss
save
scissors
search
send
server
settings
share-2
share
shield-off
shield
shopping-bag
shopping-cart
shuffle
sidebar
skip-back
skip-forward
slack
slash
sliders
smartphone
smile
speaker
square
star
stop-circle
sun
sunrise
sunset
tablet
tag
target
terminal
thermometer
thumbs-down
thumbs-up
toggle-left
toggle-right
tool
trash-2
trash
trello
trending-down
square
trending-up
triangle
truck
tv
twitch
type
umbrella
underline
unlock
unlock
upload
user-check
user-minus
user-plus
user-x
user
users
video-off
video
voicemail
volume-1
volume-2
volume-x
volume
watch
wifi-off
wifi
wind
x-circle
x-octagon
x-square
x
youtube
zap-off
zap
zoom-in
zoom-out


Class EtsyProductAdmin
Methods summary
public
|
|
protected
|
|
protected
|
#
createSettings( )
Add a section in the WooCommerce settings page for us. And show the settings in the admin |
protected
|
#
createProductSettingsTab( )
Add a tab in the WooCommerce admin for settings specific to this Etsy Product |


Reactive Programming
To the reactive programming
blog
Start animation
Observable
complete
2
next
30
next
22
next
5
next
filter (x => x > 10)
Operation
subscribe
complete
Observer


Module: Debrew Private
- Extended by:
- Mutex_m, Predicable
- Defined in:
- debrew.rb
Overview
This module is part of a private API. This module may only be used in the Homebrew/brew repository. Third parties should avoid using this module if possible, as it may be removed or changed without warning.
Helper module for debugging formulae.
Defined Under Namespace
Modules: Formula Classes: Menu
Class Attribute Summary collapse
-
.debugged_exceptions ⇒ Object
readonly
private
Class Method Summary collapse
-
.debrew ⇒ Object
private
-
.debug(exception) ⇒ Object
private
Methods included from Predicable
Class Attribute Details
.debugged_exceptions ⇒ Object (readonly)
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
80 81 82 |
# File 'debrew.rb', line 80 def debugged_exceptions @debugged_exceptions end |
Class Method Details
.debrew ⇒ Object
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'debrew.rb', line 83 def self.debrew @active = true Ignorable.hook_raise begin yield rescue SystemExit raise rescue Ignorable::ExceptionMixin => e e.ignore if debug(e) == :ignore # execution jumps back to where the exception was thrown ensure Ignorable.unhook_raise @active = false end end |
.debug(exception) ⇒ Object
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 |
# File 'debrew.rb', line 99 def self.debug(exception) raise(exception) if !active? || !debugged_exceptions.add?(exception) || !mu_try_lock begin puts exception.backtrace.first puts Formatter.error(exception, label: exception.class.name) loop do Menu.choose do || .prompt = "Choose an action: " .choice(:raise) { raise(exception) } .choice(:ignore) { return :ignore } if exception.is_a?(Ignorable::ExceptionMixin) .choice(:backtrace) { puts exception.backtrace } if exception.is_a?(Ignorable::ExceptionMixin) .choice(:irb) do puts "When you exit this IRB session, execution will continue." set_trace_func proc { |event, _, _, id, binding, klass| if klass == Object && id == :raise && event == "return" set_trace_func(nil) mu_synchronize { IRB.start_within(binding) } end } return :ignore end end .choice(:shell) do puts "When you exit this shell, you will return to the menu." interactive_shell end end end ensure mu_unlock end end |


Examples
Simple Echo server and client
Echo server & client variants
AMP server & client variants
Cred
cred.py
- Authenticate a user with an in-memory username/password database
dbcred.py
- Using a database backend to authenticate a user
FTP examples
ftpclient.py
- example of using the FTP client
ftpserver.py
- create an FTP server which serves files for anonymous users from the working directory and serves files for authenticated users from /home
.
Miscellaneous
shaper.py
- example of rate-limiting your web server
stdiodemo.py
- example using stdio, Deferreds, LineReceiver and twisted.web.client.
ptyserv.py
- serve shells in pseudo-terminals over TCP
courier.py
- example of interfacing to Courier’s mail filter interface
longex.py
- example of doing arbitrarily long calculations nicely in Twisted
longex2.py
- using generators to do long calculations
stdin.py
- reading a line at a time from standard input without blocking the reactor
streaming.py
- example of a push producer/consumer system
filewatch.py
- write the content of a file to standard out one line at a time
shoutcast.py
- example Shoutcast client
wxacceptance.py
- acceptance tests for wxreactor
postfix.py
- test application for PostfixTCPMapServer
udpbroadcast.py
- broadcasting using UDP
tls_alpn_npn_client.py
- example of TLS next-protocol negotiation on the client side using NPN and ALPN.
tls_alpn_npn_server.py
- example of TLS next-protocol negotiation on the server side using NPN and ALPN.


I am using the code below but only get positive number whether I am importing or exporting power to the grid. Any advice on what i am doing wrong, probably trivial as I am rather a begiiner in this area
emon1.current(1, 111.1); // Current: input pin, calibration.
emon1.voltage(2, 234.26, 1.7); // Voltage: input pin, calibration, phase_shift
emon2.current(3, 111.1);
....
double Irms = emon1.calcIrms(1480); // Calculate Irms only
emon1.calcVI(20,2000); // Calculate all. No.of crossings, time-out
double Irmsfeed = emon2.calcIrms(1480); // Calculate Irms only
emontx.powersolar=Irms*230;
emontx.powerfeed=emon1.realPower;
Re: telling when energy is being exported
Power direction depends on the relative phases of the current and the voltage - read about it in Building Blocks - An introduction to AC Power
Your sketch has no knowledge of the voltage, hence it cannot know the relationship between current and voltage. You need to look at one of the CT123_voltage example sketches - and measure the voltage as well as the current.
Re: telling when energy is being exported
Robert,
many thanks for the suggestion, I have read both the intro and CT123 but am still confused. In my script I have the line
emon1.voltage(2, 234.26, 1.7);
does this not do what is required?  I assumed the the calc in calcirms invoked what I needed. I have run the CT123 demo script but do not get meaningful, at least to me, output. What have I missed here?
Dave
Re: telling when energy is being exported
Take a look at emonTx_CT123_Voltage which you can get from Github
In the emonLib library, in the EnergyMonitor there are two principal methods that do the donkey work:
void calcVI(int wavelengths, int timeout, long refCal=1126400L);
double calcIrms(int NUMBER_OF_SAMPLES, long refCal=1126400L);
and some supporting methods that set up the variables:
void voltage(int _inPinV, double _VCAL, double _PHASECAL);
void current(int _inPinI, double _ICAL);
void voltageTX(double _VCAL, double _PHASECAL);
void currentTX(int _channel, double _ICAL);
void voltageTX3(double _VCAL, double _PHASECAL);
void currentTX3(int _channel, double _ICAL);
You are using calcIrms, the one that calculates rms current. If you read through the code in EmonLib.cpp, you'll see that nowhere is the voltage used.
Now look at calcVI(....), and you'll see that - like the graphs in the BB article, each sample of current is multiplied by the corresponding voltage sample to give you power. Hence if voltage and current are the same sign, power is positive and if they are the opposite sign, power is negative.
You do have an ac-ac voltage adapter connected to your voltage input, don't you?
Re: telling when energy is being exported
I do have a ac-ac voltage adapter connected and thanks for the explanation of why calcirms does not work. Now with calcirms I assign the answer in the invocation ( irms = calcirms ...) but for ClacVI i just invoke the routine, how do I reference the results, in particular the realpower with its associated direction indication. This is where I think my main problem in grasping how things for together lies, too many years since I programmed seriously.
Dave
Re: telling when energy is being exported
Look at emonTx_CT123_Voltage.ino and the line immediately after calcVI(...)
realPower is a property of the EnergyMonitor class - calcVI gives it a value and there it sits until it's changed. That line fishes it out and assigns the value to the left-hand side. You could equally well do
Serial.print([whatever].realPower);
or indeed any of the other properties listed as public in emonLib.h, apparentPower, powerFactor, Vrms, Irms.
[whatever] is the name you gave to the class instance, emon1 or emon2 in your case. You almost had this in the last line of your first post.
[Edit: Robin - don't confuse the poor guy at this stage, he's fumbling with getting his first sketch to work.]
Re: telling when energy is being exported
Once you have a working voltage sensor and current sensor, you may find it helpful to run some of the simple sketches which are listed near the top of my Summary Page. They may seem trivial, but they can really show you what's going on at a low level.
Using MinAndMaxValues, you are actually seeing the raw sample values from your ADC. The later version, MinMaxAndRangeChecker, repeatedly displays these values for each of the first four analogue channels. Your V and I sensors are likely to be using two of these channels, but the other two channels will be floating so beware of spurious values from them.
RawSamplesTool can provide a simple graphical display on your Serial Monitor of your voltage and current waveforms. This is a really useful tool to run on any new front-end hardware. If you don't have EmonLib handy (which it doesn't actually use), the later version RawSamplesTool_4ss_2 may be better. I used that one myself only yesterday.
Any of my Mk2 PV Router sketches will allow you to measure continuously the flow of energy. Mk2_PV_Router_mini_3 might be a good one to try first. Every second, it displays how many Joules have been recorded. It should work fine with just the input hardware, but it does require the AC voltage source to be present, as do most of my sketches.
Another useful sketch which I'd almost forgotten about is DigitalMeterEmulator. This gives a 40 mS pulse every 3600 Joules which is what most digital electricity meters do. If you happen to have a spare 1000 pulses-per-kWh meter which you can connect in series, calibration then becomes very straightforward. When both LEDs are flashing at the same rate, your calibration is perfect :D
Edit - Many people have told me that the simple tools that I've posted have been really helpful to get their systems up and running. I look forward to seeing how this thread develops ...
Re: telling when energy is being exported
many thanks for the help with my sketch, I think I now have direction of current and am going to let it run for a while to collect some data. I will then try some of the suggested stuff to both calibrate and refine what i am collecting. I think I am starting to get the hang of how things link together, fairly simple once grasped but really very confusing until you see the linkages between the setup section, the loop section and the libraries.
Dave


NATURAL BORN KILLERS A film review by Scott Renshaw Copyright 1994 Scott Renshaw
Starring: Woody Harrelson, Juliette Lewis, Robert Downey Jr., Tom Sizemore, Tommy Lee Jones. Screenplay: David Veloz, Richard Rutowski and Oliver Stone. Director: Oliver Stone. Reviewed by Scott Renshaw.
Few filmmakers in the last twenty years have so consistently had so little to say as loudly as Oliver Stone. By pairing up his single-note self-righteousness with cinematic histrionics, Stone has managed to create a controversial body of work which dazzles with its visual inventiveness even as it clubs you insensible with its strident moralizing. NATURAL BORN KILLERS is the natural culmination of this style/message schism, a gutsy and gaudy assault on the senses that forgets to bring along a single original or insightful thought. Even the dynamic performances of Woody Harrelson and Juliette Lewis can't salvage this busy mess.
Harrelson and Lewis star as Mickey and Mallory Knox, a pair of happy-go-lucky lovebirds who happen to be in the middle of a massive killing spree when first we meet them. Both are the result of deeply dysfunctional families, and with little moral awareness they cut a path of death through the Southwest. Eventually they are captured, and become the objects of a media frenzy and a cult of personality. Most eager to cash in on this fame is Wayne Gale (Robert Downey Jr.) the hose of a tabloid television program called "American Maniacs." He sets up a live interview with Mickey on Super Bowl Sunday, destined to be a ratings bonanza. The one hitch in the plan is a riot at the prison, which turns into a nationally televised bloodbath.
The first hour of NATURAL BORN KILLERS is made watchable only by the intensity of the two stars. Woody Harrelson stretches himself as never before, his simpleton charm connecting to a genuine amorality, while Juliette Lewis takes her wounded white-trash act from KALIFORNIA and runs with it, exploding at arbitrary moments into astonishing ferocity. But for all their sound and fury, Mickey and Mallory aren't really characters. They're ciphers, stick-figure representations of a societal ill, and ciphers just aren't all that interesting. The technical flotsam and jetsam surrounding them can't disguise that fact, and only the positively inspired segment casting Mallory's home life as a twisted 1950s sitcom goes anywhere beneath the surface. As it nears its mid-point, Mickey and Mallory's road show becomes extremely tedious.
The prison-based second half of NATURAL BORN KILLERS is something of an improvement, if only for the inclusion of some delightfully bug-eyed acting by Tommy Lee Jones as the prison warden and Tom Sizemore as the brutal cop who arrested Mickey and Mallory. As over-the-top as they are, they seem at least remotely grounded in humanity, unlike our surreal chauffeurs through the netherworld. Again, however, Stone falls victim to the One Obvious Idea syndrome. "Look at what the media has done to us," he says with genuine shock and, of course, superiority. "Any of us could become like Mickey and Mallory." The problem is that it's the same idea that drove MAN BITES DOG. And KALIFORNIA. And SERIAL MOM, for that matter. And every one of those films told the same story better, without pumping steroids into the production. There is no satire to the excesses of NATURAL BORN KILLERS, because Oliver Stone has no idea how to achieve that level of subtlety. It's simply a freak show, and Stone comes off looking like a colossal hypocrite attempting to cash in on exactly what he spends two hours clucking his tongue at.
If NATURAL BORN KILLERS had been made by any other director, I might have given it grudging support simply for having the courage to run to the limit in its audacious originality. Unfortunately, I have lost all patience with Stone's pedantry-as-art approach to filmmaking. Compare the first hour of NATURAL BORN KILLERS with David Lynch's WILD AT HEART, which leavened its shock value with a warped sense of humor and simmering menace, and you'll see that what Stone attempted to accomplish could have been done right. Instead, NATURAL BORN KILLERS is like getting a lecture from your parents during a particularly bad acid trip. You just want it to stop.
On the Renshaw scale of 0 to 10 natural born killers: 3.
-- Scott Renshaw Stanford University Office of the General Counsel
.
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


air wave acoustic valve said bleed sensor hydraulic document-id:: citation: cited vent [patcit]: classification-national:: sensors examiner second transducer al. used claim aircraft flight input CLAIM-TEXT:. claim-ref[claim figref[FIG. substrate output signal type connected formed mounted present surface housing piezoelectric use circuit shown signals view characteristics controller exemplary fluid oil system. electronic SH-SAW attached control known method action-date: cross-sectional devices electrical electrically electrode embodiment generating-office:: include liquid sensor. sensor; test using venting Acoustic CLAIM-TEXT:a Classification: [addressbook]: activation disclosure drawings, film frequency presence propagates receiver volume actuator allow applicant art closed controlling determine device device. high mode opening perspective propagation referring reservoir sensing shear suitable CLAIM-TEXT:an EMI-D Pune Wave bonded certain changes claims controller. described detect disc drawings gas generate including ipc-version-indicator:: layer liquids nested normally open particularly piezo present. process sense silicon substrate. valve, vented wave.


{% extends "layout.html" %} {% block page_title %} {% if error %}Error: {% endif %}Select a funding type {% endblock %} {% block content %} {% include version + "/includes/phase_banner_beta.html" %} Choose how to view funding Select a funding type {% if error %} There is a problem Select a funding type {% endif %} Select a funding type {% if error %} Select a funding type {% endif %} Dedicated schools grant PE and sport premium I'm looking for another funding type All users can view the funding types above. There are more funding types that only the organisation that receives them can view. More funding types which everyone can view will be available in future on this service. These are: pupil premium schools improvement grant teachers' pay grant teachers' pension grant universal infant free school meals year 7 literacy and numeracy catch-up premium Continue {% include version + "/includes/support.html" %} {% endblock %}
All users can view the funding types above. There are more funding types that only the organisation that receives them can view.
More funding types which everyone can view will be available in future on this service. These are:


Introduction
In this section we will follow along with LiveOverflow as he demonstrates how to change an internal variable in a running program from the command line. The technique involves overflowing a buffer to overwrite contents of the internal variable. The video is shown below.
The Vulnerable C Program stack0.c
We start with the vulnerable C Program stack0.c. The reason this program is vulnerable is because the gets function does not have any bounds checking. In other words, it will take whatever amount of data is given to it and put this data into the buffer argument. It will do so even if the amount of data exceeds the storage space allocated for buffer. In this case buffer is allocated 64 bytes.
If one were to input a properly coded payload into the gets function, one could overwrite the buffer variable and even overwrite other variables. In this case, the variable we wish to overwrite is called modified.
Running the Vulnerable C Program stack0.c Through GDB+GEF
In this section we start the program in GDB+GEF and see what it does. As can be seen from the image below, the program waits for input on stdin. After inputing four A's, it replies with "Try again?".
Clearly we need to disassemble the program to figure out what it does, and how we can change the modified variable. We enter a breakpoint at *main (Note: not main). We use *main so that we can get to the beginning of the main function with respect to the assembly code. Otherwise, break main will bring us to the beginning of the variable assignments. In this case we would have missed the very import function prefix, which sets up the stack. It is through the stack that we are able to complete the challege.
In the next section, we show the output of the run command in GDB+GEF.
Disassembling The Vulnerable C Program stack0.c with GDB+GEF
Visualizing Main's Stack Frame
In this section we will visualize main's stack frame. As seen in the previous section, the command line arguments to main are pushed onto the stack in reverse order. Then main's return address to libc is pushed onto the stack. Once the executable is ready to run, the stack pointer ESP points to main's return address. This is the top of the stack. Everything else that will be pushed onto the stack will enter into lower addresses, since the stack grows down in memory.
The image below shows main's stack frame. It was highlighted in the image for clarity.
We will now begin show a table that summarizes the state of the stack at this point.
Layout of the stack in program stack0.c
The table below illustrates the layout of the stack once stack.c is executed.
| High Memory | Stack entry name | Size [bytes] |
|---|---|---|
| ARGV (Address of array of strings. The first string is the executable fullpath, the second, third, etc. are the arguments) | 4 | |
| ARGC (number of command line arguments including executable name) | 4 | |
| STACK POINTER ESP -> | RET (MAIN's return address back to libc) | 4 |
| garbage | 4 | |
| garbage | 4 | |
| Low Memory | garbage | 4 |
The arguments of main are pushed onto the stack in reverse order. First is ARGV, the ARGC, then finally Main's return address is pushed onto the stack.
Disassembling and Executing the Vulnerable C Program stack0.c with GDB+GEF
Stepping From (main+0) to (main+1)
In this section, we advance a single assembly instruction, describe what happened, and show the state of the stack.
Execution was advanced a single step in GDB+GEF by using the si instruction. EIP now points to (main+1).
As can be seen from the disassembly above, the instruction push ebp was executed. This saves main's ebp so that it can be restored when main is finished executing. We will now show the state of the stack below.
Layout of the stack in program stack0.c after push ebp instruction.
The table below illustrates the layout of the stack once push ebp is executed.
| High Memory | Stack entry name | Size [bytes] |
|---|---|---|
| ARGV (Address of array of strings. The first string is the executable fullpath, the second, third, etc. are the arguments) | 4 | |
| ARGC (number of command line arguments including executable name) | 4 | |
| RET (MAIN's return address back to libc) | 4 | |
| STACK POINTER ESP -> | Mains's saved EBP | 4 |
| garbage | 4 | |
| Low Memory | garbage | 4 |
We can see that the stack pointer ESP was advanced four bytes down into lower memory, and Main's saved ebp is now on the stack.
Disassembling and Executing The Vulnerable C Program stack0.c with GDB+GEF
Stepping From (main+1) to (main+3)
In this section, we advance a single assembly instruction, describe what happened, and show the state of the stack.
Execution was advanced a single step in GDB+GEF by using the si instruction. EIP now points to (main+3).
As can be seen from the disassembly above, the instruction mov ebp, esp was executed. This moves the current stack pointer esp into ebp so that data on the stack can be referenced with respect to the base pointer ebp. The state of the stack has not changed since the last instruction. We will now advance one more instruction and describe the result.
Disassembling and Executing The Vulnerable C Program stack0.c with GDB+GEF
Stepping From (main+3) to (main+6)
In this section, we advance a single assembly instruction, describe what happened, and show the state of the stack.
Execution was advanced a single step in GDB+GEF by using the si instruction. EIP now points to (main+6).
As can be seen from the disassembly above, the instruction and esp, 0xfffffff0 was executed. This clears out the last 4 bits of the esp register. The reason is that this action effectively subtracts 8 bytes from the current stack address. We will now show the current state of the stack in the table below.
Layout of the stack in program stack0.c after and esp, 0xfffffff0 instruction.
The table below illustrates the layout of the stack once and esp, 0xfffffff0 is executed.
| High Memory | Stack entry name | Size [bytes] |
|---|---|---|
| ARGV (Address of array of strings. The first string is the executable fullpath, the second, third, etc. are the arguments) | 4 | |
| ARGC (number of command line arguments including executable name) | 4 | |
| RET (MAIN's return address back to libc) | 4 | |
| Mains's saved EBP | 4 | |
| 0xf7f99000 | 4 | |
| Low Memory...STACK POINTER ESP -> | 0xf7f99000 | 4 |
We can see that the stack pointer ESP was advanced four bytes down into lower memory, and esp now points 8 bytes lower than previously. The data on the stack, namely 0xf7f99000 repeated twice is probably from functions that ran prior to main's invocation. We now advance another step and examine the effect on the stack.
Disassembling and Executing The Vulnerable C Program stack0.c with GDB+GEF
Stepping From (main+6) to (main+9)
In this section, we advance a single assembly instruction, describe what happened, and show the state of the stack.
Execution was advanced a single step in GDB+GEF by using the si instruction. EIP now points to (main+9).
As can be seen from the disassembly above, the instruction sub esp, 0x60 was executed. This moves the stack pointer esp further down in memory by 96 bytes. The reason this is being done is to make room for the local variables modified and buffer. Recall that modified requires 4 bytes and buffer requires 64 bytes. The total amount of stack memory required for these two local variables is 64+4 = 68 bytes. Why has the compiler decided to provide an additional 96-68=28 bytes? 28 bytes correspons to 7 groups of 4 bytes. Let's step through the program so that we can figure out the compiler's intentions. We will now show the current state of the stack in the table below.
Layout of the stack in program stack0.c after sub esp, 0x60 instruction.
The table below illustrates the layout of the stack once sub esp, 0x60 is executed.
| High Memory | Stack entry name | Size [bytes] |
|---|---|---|
| ARGV (Address of array of strings. The first string is the executable fullpath, the second, third, etc. are the arguments) | 4 | |
| ARGC (number of command line arguments including executable name) | 4 | |
| RET (MAIN's return address back to libc) | 4 | |
| Mains's saved EBP | 4 | |
| 0xf7f99000 | 4 | |
| 0xf7f99000 | 4 | |
| Low Memory...STACK POINTER ESP -> | Local Variables | 96 |
We can see that the stack pointer ESP was advanced 96 bytes down into lower memory, and esp now points 96 bytes lower than previously. Why has the compiler decided to allocate 96 bytes when only 68 were needed to accomodate main's local variables? To find out, we now advance another step and examine the effect on the stack.
Disassembling and Executing The Vulnerable C Program stack0.c with GDB+GEF
Stepping From (main+9) to (main+17)
In this section, we advance a single assembly instruction, describe what happened, and show the state of the stack.
Execution was advanced a single step in GDB+GEF by using the si instruction. EIP now points to (main+17).
As can be seen from the disassembly above, the instruction mov DWORD PTR [esp+0x5c], 0x0 was executed. This moves a 0 into the stack location esp+0x5c, or esp+92. Recall that the compiler previously allocated 96 bytes for local variable storage on the stack, and now has moved a 0 into the location 92 bytes above from where it is currently pointing. This is nothing but setting the local variable modified to zero. So the local variable modified resides at esp+0x5c or esp+92 on the stack. We will now show the current state of the stack in the table below.
Layout of the stack in program stack0.c after mov DWORD PTR [esp+0x5c], 0x0 instruction.
The table below illustrates the layout of the stack once mov DWORD PTR [esp+0x5c], 0x0 is executed.
| Stack Address - High Memory | Stack entry name | Value | Size [bytes] |
|---|---|---|---|
| 0xffffd174 | ARGV (Address of array of strings. The first string is the executable's full path, the second, third, etc. are the arguments) | 0xffffd204 | 4 |
| 0xffffd170 | ARGC (number of command line arguments including executable name) | 0x00000001 | 4 |
| 0xffffd16c | RET (MAIN's return address back to libc) | 0xf7ddc9a1 | 4 |
| 0xffffd168 | Mains's saved EBP | 0x00000000 | 4 |
| 0xffffd164 | unknown | 0xf7f99000 | 4 |
| 0xffffd160 | unknown | 0xf7f99000 | 4 |
| 0xffffd15c | Local variable modified = 0 | 0x00000000 | 4 |
| 0xffffd100 ... STACK POINTER ESP -> | Local Variable Data | unknown | 92 |
We can see that the location on the stack at stack pointer ESP+92 (ESP+0x5C) was set to 0. This is the modified local variable. This is the variable that we need to change to complete the challenge. The next few assembly instructions will allocate stack memory of the 64 byte buffer. We now advance another step and examine the effect on the stack.
Disassembling and Executing The Vulnerable C Program stack0.c with GDB+GEF
Stepping From (main+17) to (main+21)
In this section, we advance a single assembly instruction, describe what happened, and show the state of the stack.
Execution was advanced a single step in GDB+GEF by using the si instruction. EIP now points to (main+21).
As can be seen from the disassembly above, the instruction lea eax, [esp+0x1c] was executed. This instruction loads the effective address of what the location at ESP+0x1C (ESP+28) contains. All this does is result in EAX containing the stack address ESP+0x1C (ESP+28). This can be verified by issueing the following command:
gef➤ x/x $esp+0x1c
0xffffd11c: 0xf7f9c808
gef➤
We can see that the address 0xffffd11c was loaded into eax from the operation lea eax, [esp+0x1c]. What is so special about the address ESP+0x1C (ESP+28)? Our stack pointer is at 0xffffd100. Adding 0x1C to this address results in 0xffffd11c. The difference is 28 bytes. If you recall, previously the stack pointer was moved down by 96 bytes. Then at ESP+92 bytes, the local variable modified was stored on the stack. This leaves 92 bytes left for the local buffer buffer[64]. What this means is that buffer[64] is at ESP+0x1C, or at stack address 0xffffd11c.
The compiler decided to place buffer[64] at ESP+28 bytes. The difference is:
92-28 = 64 bytes exactly.The question then becomes, why did the compiler allocate the extra:
96 - (64 + 4) = 28 bytes?To find out, we now advance another step and examine the effect on the stack.
Disassembling and Executing The Vulnerable C Program stack0.c with GDB+GEF
Stepping From (main+21) to (main+24)
In this section, we advance a single assembly instruction, describe what happened, and show the state of the stack.
Execution was advanced a single step in GDB+GEF by using the si instruction. EIP now points to (main+24).
Why has the compiler decided to use this instruction rather than a push EAX? This is a good question, and may be a function of optimization or byte alignment.
As can be seen from the disassembly above, the instruction mov DWORD PTR [esp], eax was executed. This instruction loads what is stored in EAX into the the address at the location that ESP points to. In other words, the top of the stack. Effectively, the contents of EAX, or the address 0xffffd11c, was pushed onto the stack. The memory address 0xffffd11c contains the value 0xf7f9c808, which by itself is also a memory address. So what is stored at ESP is basically a pointer to a memory address, or equivalently a pointer to a string.
What was the purpose of all of this setup? It might have something to do with the next assembly instruction, which is a call to the gets function. Let's look at the man page for the gets function for some answers...
GETS(3) Linux Programmer's Manual GETS(3)
NAMEgets - get a string from standard input (DEPRECATED)SYNOPSIS#include <stdio.h> char *gets(char *s);DESCRIPTIONNever use this function. gets() reads a line from stdin into the buffer pointed to by s until either a terminating newline or EOF, which it replaces with a null byte ('\0'). No check for buffer overrun is performed (see BUGS below).RETURN VALUEgets() returns s on success, and NULL on error or when end of file occurs while no characters have been read. However, given the lack of buffer overrun checking, there can be no guarantees that the function will even return.
So we can see from the man page for the function gets that it takes in a string (i.e. an address), and on success returns a string (i.e. an address) into EAX. We know that in x86-32Bit Linux, the arguments to a function are pushed in reverse order onto the stack. Since there is only one argument, this argument was loaded onto the top of the stack. That was the reason why we had the instruction mov DWORD PTR [esp], eax. The contents of what is stored at the address ESP is the argument to the gets function.
What is the significance of the address 0xffffd11c? Well, this is actually a stack address! If this address sounds familiar it is. 0xffffd11c, as we have found out earlier, is the address of the local variable buffer[64]. So basically, the gets function was given the address of the local variable buffer[64], and any data entered into stdin will be stored on the stack, starting at address 0xffffd11c.
This is a tremendous clue as to how to complete this challenge. If the number of entered bytes into stdin is less than the size of the buffer, then everything is fine according to the local variable modified. It was set to zero and will remain zero. The program will continue and exit as usual. Although the program is fine, the challenge was not accomplished.
If one were to enter more than 64 bytes into stdin, then since the gets function has no bounds checking, it will overflow buffer[64] and overwrite the local variable modified. Let's draw the current state of the stack to provide a visual explanation.
Layout of the stack in program stack0.c after mov DWORD PTR [esp], eax instruction.
The table below illustrates the layout of the stack once mov DWORD PTR [esp], eax is executed.
| Stack Address - High Memory | Stack entry name | Value | Size [bytes] |
|---|---|---|---|
| 0xffffd174 | ARGV (Address of array of strings. The first string is the executable's full path, the second, third, etc. are the arguments) | 0xffffd204 | 4 |
| 0xffffd170 | ARGC (number of command line arguments including executable name) | 0x00000001 | 4 |
| 0xffffd16c | RET (MAIN's return address back to libc) | 0xf7ddc9a1 | 4 |
| 0xffffd168 | Main's saved EBP | 0x00000000 | 4 |
| 0xffffd164 | unknown | 0xf7f99000 | 4 |
| 0xffffd160 | unknown | 0xf7f99000 | 4 |
| 0xffffd15c | Local variable modified = 0 | 0x00000000 | 4 |
| 0xffffd11c | Local Variable buffer[64] | 0x00000000 | 64 |
| 0xffffd104 ---- 0xfffd118 | Stack Data | unknown | 20 |
| 0xffffd100 ... STACK POINTER ESP -> | Address of buffer[64] | 0xffffd11c | 4 |
We can see from the table above which depicts the state of the stack, that if we enter an amount of bytes into buffer[64] that exceeds its size, i.e. greater than 64 bytes, then we can overflow the buffer[64] and overwrite modified.
Disassembling and Executing The Vulnerable C Program stack0.c with GDB+GEF
Stepping From (main+24) to (main+29)
In this section, we advance a single assembly instruction, describe what happened, and show the state of the stack.
Execution was advanced a single step in GDB+GEF by using the si instruction. EIP now points to (main+29).
We can see from the image above that since we started the debugging session with the command:
run AAAA
the gets function was given the string "AAAA". As expected, this string was put into the local variable buffer[64], and the address of this string was also returned into EAX.
We can confirm that the string "AAAA" was entered onto the stack by looking at the stack memory address 0xffffd11c in the image above. It contains four "A"'s directly. This same stack address was also entered into EAX.
Obviously, four "A"'s is less than 64 bytes, where each "A" uses up one byte. Therefore, we can conclude that the local variable modified has not been altered. We can confirm this with the examine memory command in GDB as shown below:
gef➤ x/17x $esp+0x1c 0xffffd11c: 0x41414141 0xf7f99000 0x08049620 0xffffd138 0xffffd12c: 0x080482e8 0xf7f993fc 0x08049620 0xffffd168 0xffffd13c: 0x08048469 0x00000000 0xf7df3e3b 0xf7ffd000 0xffffd14c: 0xf7df3f05 0xf7fe4f60 0x00000000 0x0804845b 0xffffd15c: 0x00000000 gef➤
From the output of the x/17x $esp+0x1c command shown above, we can see the four "A"'s at stack memory location 0xffffd11c. Then, if we count 64 bytes over, i.e. each hex number is 4 bytes, and each row 16 bytes, therefore, 4 rows is 64 bytes. At the first position in the 5th row, i.e. stack address 0xffffd15c, we can see the value 0x00000000. This is the local variable modified. Our goal in the challenge is to input sufficient data into the buffer to overwrite the stack memory at location 0xffffd15c.
Below, we show an image of the result when executing the command x/17x $esp+0x1c.
In the image above, we have highlighted the contents of stack memory location 0xffffd15c. This is the local variable modified, and its contents is 0x00000000.
Creating the payload to overwrite the variable modified
We will create a python script to build a payload. This payload will contain 64+4 characters, which is the 68 bytes necessary to completely overwrite the variable modified.
The goal of this program is to generate 66 bytes. The reason it is not 68 bytes is because we need to account for the carriage return (CR) character that Python's print statement appends to the end. Below we show the output of exploit.py and a view of the xxd's output of the payload file.
As can be seen from the above output, the exploit.py Python script produced 66 A's. These are saved into a file called payload. We then pass payload into the hex viewer xxd. We can see the 66 A's as hex 41, and the final byte is 0a. 0a is the hex ASCII code for a carriage return (CR).
The file payload can now be input into the vulnerable program stack0.c.


Police investigating feces-throwing incidents at two Toronto university libraries
Toronto police say they are investigating two incidents of feces being thrown at students in university libraries in recent days.
Const. Allyson Douglas-Cook says officers are investigating a link between similar incidents at the University of Toronto and York University.
She says one incident occurred at the Robarts Library at U of T on Friday afternoon, while another took place Sunday afternoon at York University’s Scott Library.
Douglas-Cook says detectives are looking to determine if the same suspect is responsible for both incidents.
She says assault charges could be laid.
A spokesman for York University confirmed that an “unknown male” entered the library around 5 p.m. Sunday and “deposited a substance, suspected of containing fecal matter, on a student.”
“We have reached out to the victim of the assault to offer support,” Yanni Dagonas said in an email.
The school has launched its own investigation and is also working with Toronto police, Dagonas said.
U of T also said it’s supporting the Toronto police probe.
“As a public university we work to make the resources of our libraries as open as possible,” the university said in a statement.
“What happened was shocking and assistance was provided to those affected.”
Our Morning Update and Evening Update newsletters are written by Globe editors, giving you a concise summary of the day’s most important headlines. Sign up today .


| Dear
Leighann,
I
assumed that there would be a document with instructions on the cd,
but I guess it was left open to see what the artist does with the information.
I hope this is what you were looking for. Thanks again, I hope to hear
from you soon.
Beatrice
Aispuro
*SEWING TIPS*
|


SUBROUTINE ZGGRQF( M, P, N, A, LDA, TAUA, B, LDB, TAUB, WORK, $ LWORK, INFO ) * * -- LAPACK routine (version 3.1) -- * Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. * November 2006 * * .. Scalar Arguments .. INTEGER INFO, LDA, LDB, LWORK, M, N, P * .. * .. Array Arguments .. COMPLEX*16 A( LDA, * ), B( LDB, * ), TAUA( * ), TAUB( * ), $ WORK( * ) * .. * * Purpose * ======= * * ZGGRQF computes a generalized RQ factorization of an M-by-N matrix A * and a P-by-N matrix B: * * A = R*Q, B = Z*T*Q, * * where Q is an N-by-N unitary matrix, Z is a P-by-P unitary * matrix, and R and T assume one of the forms: * * if M <= N, R = ( 0 R12 ) M, or if M > N, R = ( R11 ) M-N, * N-M M ( R21 ) N * N * * where R12 or R21 is upper triangular, and * * if P >= N, T = ( T11 ) N , or if P < N, T = ( T11 T12 ) P, * ( 0 ) P-N P N-P * N * * where T11 is upper triangular. * * In particular, if B is square and nonsingular, the GRQ factorization * of A and B implicitly gives the RQ factorization of A*inv(B): * * A*inv(B) = (R*inv(T))*Z' * * where inv(B) denotes the inverse of the matrix B, and Z' denotes the * conjugate transpose of the matrix Z. * * Arguments * ========= * * M (input) INTEGER * The number of rows of the matrix A. M >= 0. * * P (input) INTEGER * The number of rows of the matrix B. P >= 0. * * N (input) INTEGER * The number of columns of the matrices A and B. N >= 0. * * A (input/output) COMPLEX*16 array, dimension (LDA,N) * On entry, the M-by-N matrix A. * On exit, if M <= N, the upper triangle of the subarray * A(1:M,N-M+1:N) contains the M-by-M upper triangular matrix R; * if M > N, the elements on and above the (M-N)-th subdiagonal * contain the M-by-N upper trapezoidal matrix R; the remaining * elements, with the array TAUA, represent the unitary * matrix Q as a product of elementary reflectors (see Further * Details). * * LDA (input) INTEGER * The leading dimension of the array A. LDA >= max(1,M). * * TAUA (output) COMPLEX*16 array, dimension (min(M,N)) * The scalar factors of the elementary reflectors which * represent the unitary matrix Q (see Further Details). * * B (input/output) COMPLEX*16 array, dimension (LDB,N) * On entry, the P-by-N matrix B. * On exit, the elements on and above the diagonal of the array * contain the min(P,N)-by-N upper trapezoidal matrix T (T is * upper triangular if P >= N); the elements below the diagonal, * with the array TAUB, represent the unitary matrix Z as a * product of elementary reflectors (see Further Details). * * LDB (input) INTEGER * The leading dimension of the array B. LDB >= max(1,P). * * TAUB (output) COMPLEX*16 array, dimension (min(P,N)) * The scalar factors of the elementary reflectors which * represent the unitary matrix Z (see Further Details). * * WORK (workspace/output) COMPLEX*16 array, dimension (MAX(1,LWORK)) * On exit, if INFO = 0, WORK(1) returns the optimal LWORK. * * LWORK (input) INTEGER * The dimension of the array WORK. LWORK >= max(1,N,M,P). * For optimum performance LWORK >= max(N,M,P)*max(NB1,NB2,NB3), * where NB1 is the optimal blocksize for the RQ factorization * of an M-by-N matrix, NB2 is the optimal blocksize for the * QR factorization of a P-by-N matrix, and NB3 is the optimal * blocksize for a call of ZUNMRQ. * * If LWORK = -1, then a workspace query is assumed; the routine * only calculates the optimal size of the WORK array, returns * this value as the first entry of the WORK array, and no error * message related to LWORK is issued by XERBLA. * * INFO (output) INTEGER * = 0: successful exit * < 0: if INFO=-i, the i-th argument had an illegal value. * * Further Details * =============== * * The matrix Q is represented as a product of elementary reflectors * * Q = H(1) H(2) . . . H(k), where k = min(m,n). * * Each H(i) has the form * * H(i) = I - taua * v * v' * * where taua is a complex scalar, and v is a complex vector with * v(n-k+i+1:n) = 0 and v(n-k+i) = 1; v(1:n-k+i-1) is stored on exit in * A(m-k+i,1:n-k+i-1), and taua in TAUA(i). * To form Q explicitly, use LAPACK subroutine ZUNGRQ. * To use Q to update another matrix, use LAPACK subroutine ZUNMRQ. * * The matrix Z is represented as a product of elementary reflectors * * Z = H(1) H(2) . . . H(k), where k = min(p,n). * * Each H(i) has the form * * H(i) = I - taub * v * v' * * where taub is a complex scalar, and v is a complex vector with * v(1:i-1) = 0 and v(i) = 1; v(i+1:p) is stored on exit in B(i+1:p,i), * and taub in TAUB(i). * To form Z explicitly, use LAPACK subroutine ZUNGQR. * To use Z to update another matrix, use LAPACK subroutine ZUNMQR. * * ===================================================================== * * .. Local Scalars .. LOGICAL LQUERY INTEGER LOPT, LWKOPT, NB, NB1, NB2, NB3 * .. * .. External Subroutines .. EXTERNAL XERBLA, ZGEQRF, ZGERQF, ZUNMRQ * .. * .. External Functions .. INTEGER ILAENV EXTERNAL ILAENV * .. * .. Intrinsic Functions .. INTRINSIC INT, MAX, MIN * .. * .. Executable Statements .. * * Test the input parameters * INFO = 0 NB1 = ILAENV( 1, 'ZGERQF', ' ', M, N, -1, -1 ) NB2 = ILAENV( 1, 'ZGEQRF', ' ', P, N, -1, -1 ) NB3 = ILAENV( 1, 'ZUNMRQ', ' ', M, N, P, -1 ) NB = MAX( NB1, NB2, NB3 ) LWKOPT = MAX( N, M, P )*NB WORK( 1 ) = LWKOPT LQUERY = ( LWORK.EQ.-1 ) IF( M.LT.0 ) THEN INFO = -1 ELSE IF( P.LT.0 ) THEN INFO = -2 ELSE IF( N.LT.0 ) THEN INFO = -3 ELSE IF( LDA.LT.MAX( 1, M ) ) THEN INFO = -5 ELSE IF( LDB.LT.MAX( 1, P ) ) THEN INFO = -8 ELSE IF( LWORK.LT.MAX( 1, M, P, N ) .AND. .NOT.LQUERY ) THEN INFO = -11 END IF IF( INFO.NE.0 ) THEN CALL XERBLA( 'ZGGRQF', -INFO ) RETURN ELSE IF( LQUERY ) THEN RETURN END IF * * RQ factorization of M-by-N matrix A: A = R*Q * CALL ZGERQF( M, N, A, LDA, TAUA, WORK, LWORK, INFO ) LOPT = WORK( 1 ) * * Update B := B*Q' * CALL ZUNMRQ( 'Right', 'Conjugate Transpose', P, N, MIN( M, N ), $ A( MAX( 1, M-N+1 ), 1 ), LDA, TAUA, B, LDB, WORK, $ LWORK, INFO ) LOPT = MAX( LOPT, INT( WORK( 1 ) ) ) * * QR factorization of P-by-N matrix B: B = Z*T * CALL ZGEQRF( P, N, B, LDB, TAUB, WORK, LWORK, INFO ) WORK( 1 ) = MAX( LOPT, INT( WORK( 1 ) ) ) * RETURN * * End of ZGGRQF * END


In Circulation{{ currentAsset.balance.toFixed(2) }}
There are no holders of this asset on the network.