Event Location:
The River Club
Observatory Rd, Observatory, Cape Town, South Africa
Cape Town, Western Cape, South Africa
Abstract:
SQL Server 2016: Data quality and data cleansing have always been major challenges to any enterprise that deals with data. For those of us who have dealt with Data Profiler Tasks in SQL Server 2008, we were shocked yet pleasantly surprised with the great advances that Microsoft has made with the advent of Data Quality Services, in the SQL Server 2012 release. In this hands-on presentation we shall be looking at how to set up a new knowledge base, based upon an existing one, set up rules, do knowledge discovery within the new knowledge base and finally cleanse the data through a data quality project. The end results being more effective data, guaranteed to keep end users and management happy.
Speaker(s): Steve Simon,
Abstract:
This 500 level session will focus on using undocumented statements and trace flags to get insight into how the query optimizer works and show you which operations it performs during query optimization. I will use these undocumented features to explain what the query optimizer does from the moment a query is submitted to SQL Server until an execution plan is generated including operations like parsing, binding, simplification, trivial plan, and full optimization. Concepts like transformation rules, the memo structure, how the query optimizer generates possible alternative execution plans, and how the best alternative is chosen based on those costs will be explained as well.
Speaker(s): Benjamin Nevarez,
Abstract:
In-Memory OLTP (code name: Hekaton) is the most important new feature in SQL Server 2014, and this session will teach you how query processing and optimization work with this new database engine. After explaining the basics, we will discuss how the query optimizer is used in In-Memory OLTP by both natively compiled stored procedures and by traditional stored procedures accessing memory-optimized tables through the query interop functionality. We will also take a look at how the new hash and range indexes are used, as well as how their performance implications are also covered along with the process of translating the plan created by the query optimizer into C code. Finally, some limitations with the current release will also be explained.
Speaker(s): Benjamin Nevarez,
Abstract:
As data warehouses continue to see rapid expansions of data, traditional architectures struggle to keep up. Massively Parallel Processing is a technique that allows a data warehouse to be seamlessly distributed across multiple machines allowing for near linear scaling. Massively Parallel processing was first introduced to SQL through Parallel Data Warehouse (PDW) which was a large and often expensive deployment process. Azure SQL Data Warehouse brings much of the Power of Parallel Data Warehouse but with many advantages of the cloud such as lower costs and faster deployment. In this session we will look at how the Azure SQL Data Warehouse works behind the scenes. We will also look at various options for provisioning and loading data before ending with a look at how queries executed.
Speaker(s): Michael Johnson,
Abstract:
At the heart of Power BI is the Power Query Formula Language (informally known as M), a dynamically typed, case-sensitive functional language for creating mashup queries, similar to the F# language. Although Power BI Desktop has a number of great UI features for transformations, under the hood it's all M, and the better you understand the language, the more you can take advantage of the capabilities inherent in Power BI. In this session I will introduce you to the basics of the M language and demonstrate some of the more advanced features.
Speaker(s): Matt Horn,
Abstract:
It used to be that if you want to do analysis of data that is stored in SQL Server, you had to extract the data into a data ware-house or something similar, and run you analysis there. The downside with that is the time it takes from the time of insertion into the transaction store until the data is available in the DW. In this session we will see how we can use SQL Server 2016 to do real time analytics against your OLTP database.
Speaker(s): Niels Berglund,
Abstract:
ne of the main challenges organizations face in the BI world is to allow, via a single platform, contradicting needs of self-service BI with governance and Enterprise scale. Come and see the game changing approach of Pyramid Analytics that allows organizations to obtain these impossible needs of business users and IT in a singular BI platform. Pyramid Analytics the platform that Microsoft selected as a strategic partner for PowerBI. Pyramid Analytics revolutionary platform provides a single platform that delivers: • Self Service – No code necessary. • Web based central administration and security. • Role based functionality for different roles in the organization (Professional, Analyst and Consumer). • Universal configuration – build once use anywhere (PC, Tablet and Mobile). • Enterprise scale – parallel processing, clustering and load balancing. • And more ….
Speaker(s): Michael Raam,
Abstract:
Master Data Services can be readily be employed for Rapid Application Development. We shall be looking at important development, data security and data maintenance aspects, all based upon a recent client implementation.
Speaker(s): Steve Simon,
Abstract:
When you code do you only thing about your code? What about how you release it fast, with high Quality and in a regulated environment? We'll take a look at how SQL code traditionally (or at least most commonly) gets into production. We'll then switch our focus to using unit tests as a way to help improve quality in the fast paced world we live in and a release pipeline to simplify it all
Speaker(s): Gordon Beeming,
Abstract:
These days when you say "database server" it could really mean many things. For something like SQL server there are so many options: on-premise server, off-premise server. On-premise server with off-premise data. Then there are the various Azure offerings with fancy names like Azure SQL, Data Lake, Hadoop. You also get graph databases and document databases. This session will cover some of the more popular types of data stores that are available today and we will look at their use cases. While SQL server is great for many things, one has to be aware of the other options that are available out there.
Speaker(s): Clinton van Blommestein,
Abstract:
R has become one of the leading analysis tools for developers and data scientists alike. However, in order for R to do its magic it needs data so historically we have imported data from various sources, SQL Server being one of those sources. In SQL Server 2016, Microsoft has embedded R in the SQL engine. Yes, we do now have access to R natively in SQL Server. In this session we will look at how R works in SQL Server, and also talk about some performance improvements you are getting by running R in SQL Server.
Speaker(s): Niels Berglund,
Abstract:
No one needs to be convinced that data is valuable. But trying to understand where to look for value in your data and what to focus on is challenging. We try to give meaningful context to terminology such as big data, digital disruption, 4th industrial revolution, etc. This is a non-technical session that will give an overview of how your data landscape is changing and what you need to be aware of to derive value from data.
Speaker(s): Toufiq Abrahams,
Abstract:
In this session, we'll look at design considerations for clustered and non-clustered indexes. We'll investigate what makes an index useful to SQL Server and what common mistakes make indexes useless. We'll go into the details of how various query predicates interact with indexes and what the primary driver is when designing indexes for any database application. This session is aimed at people who are relatively new to indexing.
Speaker(s): Gail Shaw,
Abstract:
Utilization of infographics through PowerBI and BI Office
Speaker(s): Jason Basterfield,
Abstract:
If there’s one thing that we, as SQL developers, do, it's not use enough transactions. Transactions are critical when multiple changes need to be made entirely or not at all, but even given that it’s rare to see transactions used at all in most production code In this session, we'll look at what transactions are and why we should use them. We'll explore the effects transactions have on locking and the transaction log.
Speaker(s): Gail Shaw,
Abstract:
SQL 2016 introduces the Query Store, a mechanism that has been built into the SQL 2016 database engine in order to facilitate rapid identification and resolution of performance and scalability bottlenecks in SQL application scenarios. In the session we will examine Query Store architecture and features and gain an understanding of how the tools should be used.
Speaker(s): Peter Willmot,
Abstract:
Demonstrating how you can easily generate SSIS packages based on metadata, allowing us to effectively apply code reuse, templates and patterns in our ETL solutions using BIML
Speaker(s): Ziyaad Mohamed,
Abstract:
Modern self-service personal productivity analytic tools allow individual users to create sophisticated calculations and sets. However, for an organization to maximize the value of analytics this business logic must be released from myriad of spreadsheets and documents that it is embedded. Join us to discuss how analytic platforms allow data-driven organizations to centralize, share and contextualize this content.
Speaker(s): Sandesh Nagaraj,
Abstract:
SQL Server has built in tools available to assist you in Query Performance Tuning. We will go through the tools and how you can use them to quickly identify various performance issues. There are also various free software and scripts available provided by third parties which I use on a daily basis which I will recommend.
Speaker(s): Martin Phelps,
Abstract:
A look at Window functions, and how their performance has improved over the SQL versions. Also ideas/samples of potential use cases.
Speaker(s): Desmond Norton,
Abstract:
When an ETL is initially deployed it is expected to run for a certain amount of time based on testing during development. It does not always come to our attention that the duration the ETL takes to complete starts growing at an abnormal rate. Using Simple Linear Regression, we can detect the duration anomalies of ETLs. Will be going into detail on what Simple Linear Regression is and how you can use it to your advantage to detect ETL duration anomalies.
Speaker(s): Jeanne Combrinck,
This is a list of speakers from the XML Guidebook records. The details and URLs were valid at the time of the event.
LinkedIn: https://za.linkedin.com/in/clintonvb
Clinton is a senior developer at Derivco in Durban (South Africa), a company that is a leader in the online gaming space. He has over 16 years experience in highly transactions systems, with focus on the services and data tiers. He is a regular speaker at SQL events in South Africa, is also the co-leader for the Durban SQL User Group and has recognised as a Couchbase Champion for his contribution to their community.
Contact: http://sqlinthewild.co.za
Gail Shaw is a Database Specialist focusing on database performance tuning and database recovery, with a particular interest in topics such as indexing strategies, execution plans, and writing T-SQL code that performs well and scales gracefully. Gail holds a Microsoft Certified Master certification for SQL Server 2008 and is a Data Platform MVP. She's a frequent poster on the SQLServerCentral forums, a Pluralsight author, writes articles for both SQLServerCentral.com and Simple-Talk.com, and has spoken at SQLSaturdays, SQL Bits and at the PASS Community Summit. Gail has been responsible for extending the lifespan of many an application, by performance-tuning their databases and providing technical guidance on all things SQL Server related.
LinkedIn: https://www.linkedin.com/in/b1n4ryd1g1t
Contact: http://beeming.net/
Gordon Beeming is a Software Developer at Derivco in the sunny city of Durban, South Africa. He spends most his time hacking away at the keyboard in Visual Studio or with his family relaxing. He is a Visual Studio ALM Ranger, Visual Studio ALM MVP and Friend of Red Gate. His blog is at beeming.net and you can follow him on Twitter at twitter.com/gordonbeeming.
Contact: http://www.benjaminnevarez.com/
Benjamin Nevarez is a SQL Server independent consultant based in Los Angeles, California, who specializes in SQL Server query tuning and optimization. He is the author of “SQL Server 2014 Query Tuning amp; Optimization” and “Inside the SQL Server Query Optimizer” and co-author of “SQL Server 2012 Internals.quot; Benjamin has also been a speaker at many SQL Server conferences, including PASS Summit, SQL Server Connections, and SQLBits. His blog can be found at http://www.benjaminnevarez.com.
LinkedIn: https://za.linkedin.com/in/niels-berglund-0122593
Contact: https://nielsberglund.com
Niels works as Software Architect at Derivco, where he develops software as well as "dreaming" up new and innovative ways to use existing and new technology. Before joining Derivco, Niels worked as researcher/instructor at Developmentor where he was responsible for the database curriculum. He was a co-author of the first SQL Server 2005 book for developers: quot; A First Look at SQL 2005 for Developersquot;. He has presented at all leading technical conferences; Tech-ED, SQL PASS, DevWeek, Ignite the Tour, etc., and is also a Microsoft Data Platform MVP.
Contact: http://www.benjaminnevarez.com/
Benjamin Nevarez is a SQL Server independent consultant based in Los Angeles, California, who specializes in SQL Server query tuning and optimization. He is the author of “SQL Server 2014 Query Tuning amp; Optimization” and “Inside the SQL Server Query Optimizer” and co-author of “SQL Server 2012 Internals.quot; Benjamin has also been a speaker at many SQL Server conferences, including PASS Summit, SQL Server Connections, and SQLBits. His blog can be found at http://www.benjaminnevarez.com.
LinkedIn: http://www.linkedin.com/in/stephenrsimon/
Contact: http://www.sqlservercentral.com/blogs/simon_says/
Steve Simon is a Database Solutions Architect with Business Knowledge Services Inc. He has been involved with database design and analysis for over 35 years. Steve has presented papers at numerous PASS Summits and PASS SQL Rallies. He is also regular presenter on the SQL Saturday circuit and he is a contributor on SQLShack.com
LinkedIn: http://www.linkedin.com/in/phelpsm
Martin Phelps is database architect at MiX Telematics. Specialising in Solution Architecture across their OLTP and DW databases. With 20 years of in-the-trenches experience with Sql Server he has provided solutions using Sql Server since version 4.2. Has previously done work for Insurance, ICT, Marketing and Mining companies.
LinkedIn: https://za.linkedin.com/in/jeannecombrinck
Contact: http://thesqlgirl.com
Senior BI Developer at Britehouse. In her spare time she can be found spending time with her animals, doing SQL puzzles and writing on her blog http://thesqlgirl.com/.
Peter has been writing software (and teaching folk how to write software) for over 30 years. He has worked with SQL Server as an architect and developer for more than 20 years (since SQL 4.2) and has also worked extensively with the .Net and various other development platforms. Peter is a past MSDN Regional Director and was also an MVP (SQL Server and Architecture) for many years. He is a passionate and regular speaker and various industry events around the world.
LinkedIn: https://za.linkedin.com/in/niels-berglund-0122593
Contact: https://nielsberglund.com
Niels works as Software Architect at Derivco, where he develops software as well as "dreaming" up new and innovative ways to use existing and new technology. Before joining Derivco, Niels worked as researcher/instructor at Developmentor where he was responsible for the database curriculum. He was a co-author of the first SQL Server 2005 book for developers: quot; A First Look at SQL 2005 for Developersquot;. He has presented at all leading technical conferences; Tech-ED, SQL PASS, DevWeek, Ignite the Tour, etc., and is also a Microsoft Data Platform MVP.
LinkedIn: http://za.linkedin.com/pub/michael-johnson/22/73/735
Contact: http://michaeladrianjohnson.com/
Michael Johnson is a Microsoft data platform MVP and leader of the Johannesburg SQL User Group and Business Analytics Virtual Group. He works as an Independent Business Intelligence Consultant and regularly presents at local user groups, SQL Saturdays and PASS Virtual Chapters.
Studied Software Development at CPUT. Now currently working at EOH as an Intermediate SQL developer within the financial services industry for around 5 years, while also obtaining my Microsoft Certifications. When I am not drilling down data I enjoy keeping fit at the gym.
Director of a Business Intelligence company called Expeditus. Having over 15 years experience in Business Intelligence using multiple technologies and implementing numerous successful data warehousing projects within different verticals. Always looking to the future of Business Intelligence and data, trying to stay abreast of the curve.
Contact: http://www.osmosisconsulting.co.za
Toufiq Abrahams is the Principal Consultant at Osmosis Consulting and Technology Director at Plain Sight Analytics. He has a passion for turning data into business value with one foot in the cloud and the other on-prem.
LinkedIn: http://www.linkedin.com/in/stephenrsimon/
Contact: http://www.sqlservercentral.com/blogs/simon_says/
Steve Simon is a Database Solutions Architect with Business Knowledge Services Inc. He has been involved with database design and analysis for over 35 years. Steve has presented papers at numerous PASS Summits and PASS SQL Rallies. He is also regular presenter on the SQL Saturday circuit and he is a contributor on SQLShack.com
Data amp; Analytics Principal at Pyramid Analytics
Desmond is a senior database developer at Derivco, with 15 years development experience. He started out as a full stack developer, and made the move to a purely SQL developer 9 years ago.
LinkedIn: http://za.linkedin.com/in/sandeshnagaraj
A Certified Data Architect with around 15 years of experience in Data warehouse, Business Intelligence and Database implementation. Sandesh holds MCITP SQL Server in BI, Data Architect certified from Microstrategy etc. He has worked extensively as BI Consultant/Technical Specialist/BI Architect/Sales Engineer/Manager. Sandesh actively participates and speaks at Johannesburg SQL Server User and SQL Saturday events.
Contact: http://sqlinthewild.co.za
Gail Shaw is a Database Specialist focusing on database performance tuning and database recovery, with a particular interest in topics such as indexing strategies, execution plans, and writing T-SQL code that performs well and scales gracefully. Gail holds a Microsoft Certified Master certification for SQL Server 2008 and is a Data Platform MVP. She's a frequent poster on the SQLServerCentral forums, a Pluralsight author, writes articles for both SQLServerCentral.com and Simple-Talk.com, and has spoken at SQLSaturdays, SQL Bits and at the PASS Community Summit. Gail has been responsible for extending the lifespan of many an application, by performance-tuning their databases and providing technical guidance on all things SQL Server related.
LinkedIn: http://www.linkedin.com/profile/view?id=14818091
Matt Horn is a Business Intelligence Developer and director with Immersant Data Solutions. He has been a regular speaker at SQLSaturday events for many years He is the Co Lead of the IntelliCape Business Intelligence user group based in Cape Town. .
The following is a list of sponsors that helped fund the event.


Week 4 Technical Blog
Enumerable Methods
1/18/15
Enumerable Methods are very useful when it comes to sorting and searching through a collection. One of the methods is #map. The map method runs a block of code following the method and returns the results in an array. (If you're unfamiliar with arrays, take a look at my previous blog post here). Here's an example of the map method in action:
[1, 2, 3, 4, 5].map { |x| x + 10 }
This method returns an array of numbers 11 to 15, or [11, 12, 13, 14, 15]. It adds 10 to each element of the array. The x is just a placeholder so the method can run the block of code (x + 10) for each element, x. The original array is unmodified, the map method returns a new array. This means that if we assign the original array to a variable and run map like this:
arr = [1, 2, 3, 4, 5]
arr.map { |x| x + 10 }
The original array remains as [1, 2, 3, 4, 5]. If you want to replace the original array, using #map! would do the trick.


Hey. I’m Jack Butler, the owner of RigidGear LLC. I have been pursuing IT work since middle school. Although my day job is as a Software Controls Engineer, I moonlight as a friendly IT guy.
I serve small businesses and individuals looking to improve their hardware. I’ve had experience working with a large assortment of installations and upgrades, and can handle anything from security cameras to enterprise networking.
Aside from just completing an install, I like to teach clients how things work. Interested in learning how to build a computer? I’d love to teach you to pick the right parts, ensure upgradability, and assemble it safely.
You can see what services I offer on the Services page. If you’re unsure if I’m the right guy for the job, just ask! I often handle many things that aren’t listed on my website.


2 TIMOTHY
1
Greeting
1 Paul, an apostle of Christ Jesus by the will of God according to the promise of the life that is in Christ Jesus,
2 To Timothy, my beloved child:
Grace, mercy, and peace from God the Father and Christ Jesus our Lord.
Guard the Deposit Entrusted to You
3 I thank God whom I serve, as did my ancestors, with a clear conscience, as I remember you constantly in my prayers night and day.
4 As I remember your tears, I long to see you, that I may be filled with joy.
5 I am reminded of your sincere faith, a faith that dwelt first in your grandmother Lois and your mother Eunice and now, I am sure, dwells in you as well.
6 For this reason I remind you to fan into flame the gift of God, which is in you through the laying on of my hands,
7 for God gave us a spirit not of fear but of power and love and self-control.
8 Therefore do not be ashamed of the testimony about our Lord, nor of me his prisoner, but share in suffering for the gospel by the power of God,
9 who saved us and called us to a holy calling, not because of our works but because of his own purpose and grace, which he gave us in Christ Jesus before the ages began,
10 and which now has been manifested through the appearing of our Savior Christ Jesus, who abolished death and brought life and immortality to light through the gospel,
11 for which I was appointed a preacher and apostle and teacher,
12 which is why I suffer as I do. But I am not ashamed, for I know whom I have believed, and I am convinced that he is able to guard until that Day what has been entrusted to me.
13 Follow the pattern of the sound words that you have heard from me, in the faith and love that are in Christ Jesus.
14 By the Holy Spirit who dwells within us, guard the good deposit entrusted to you.
15 You are aware that all who are in Asia turned away from me, among whom are Phygelus and Hermogenes.
16 May the Lord grant mercy to the household of Onesiphorus, for he often refreshed me and was not ashamed of my chains,
17 but when he arrived in Rome he searched for me earnestly and found me—
18 may the Lord grant him to find mercy from the Lord on that Day!—and you well know all the service he rendered at Ephesus.


{% extends "base.html" %} {% block subtitle %}Home{% endblock %} {% block lead %}Welcome to Web2Badge Server{% endblock %} {% block content %}
If you want to know a little bit about how this works, there's an About page.
You can also send something to everyone by including one of the following messages on a public tweet:


Athens Student Involvement
Home
MyProfile
About
Update
Interests
Clubs
Events
Logout
Your
Interests
Current Interests
Select Current Interests to Delete
Find New Interests
Select New Interests to Add
Not To Be Seen


Manage Fee
Facility Licencing Fee
Application Fee
200
Review Fee
150
500 beds plus
1000
499 beds to 300 beds
25
299 beds to 100 beds
25
99 beds and below
25
Diagnostic Centers
25
Blood/Organ Banks
25
Pharmacies
25
New Professional License Fee
Medical/Physician
200
Nursing
200
Dental
200
Consultant
200
Visiting Doctor
200
Dental Application Fee
200
Allied Health Care Fee
200
Chiropractor Fee
200
Review Fee
150
Verification/PSV Fee
1000
BLS/MMI
25
Urgent Fee
25
Good standing
25
NOC
25
Transfer
25
ID Card
25
Final Amount
25
Courier charges
25
Renewal License Fee
Medical/Physician Fee
200
Nursing Fee
150
Dental Fee
1000
Chriropractor
25
Allied Health Care
25
Consultant
25
Visiting Doctor
25
Final Amount
25
Sick Leaves Attestation Fee
Sick Leave
200
Escort Certificate
150
Joining Certificate
300
Courier Charges
25
Advertisement Fee
Newspaper
200
Magazine
150
Television
300
Social Media/Web
25
Billboard
25
Signage
25
Moving Ads
25


In this post, I'll show how to interface an NILM algorithm written in Matlab with nilmtk. I'll be using the code provided by the authors of the Infinite Factorial Dynamical Model paper presented at NIPS 2015. The authors have kindly made their code available on Github. I had a conversation with them and they modified the code so that it can be easily interfaced with nilmk.
Since the code is written in Matlab, we need to install some package that allows communication between Python and Matlab. The Matlab engine for Python would have been a perfect choice given that it is supported by Matlab. However, I had tough luck getting it to work on my system. Instead, I ended up using pymatbridge. Not only does pymatbridge provide the ability to communicate between the two languages, it also comes with a handy IPython extension that I'll be using in this post.
import pandas as pd
import matplotlib.pyplot as plt
plt.style.use('ggplot')
import warnings
warnings.filterwarnings('ignore')
import pymatbridge as pymat
%matplotlib inline
%load_ext pymatbridge
Now, I have a Matlab session started.
I'll be using the REDD data set for illustration. I'll disaggregate the first day from House #1. Also, we'll be disaggregating the lights, fridge, dish washer, microwave.
from nilmtk import *
ds = DataSet("/data/REDD/redd.h5")
Getting the elec
for the first house.
elec = ds.buildings[1].elec
Setting the time window for our analysis.
ds.set_window("2011-04-19", "2011-04-20")
Creating a Pandas dataframe of the appliances we are interested in, along with the mains. We will be summing up all the lights instances.
appliances = {'mains':elec.mains(),
'fridge':elec['fridge'],
'dish washer':elec['dish washer'],
'microwave':elec['microwave'],
'light':MeterGroup([elec['light',1], elec['light',2], elec['light',3]])}
We'll be downsampling the data to 30 seconds by median filter.
data = {}
for appliance_name, appliance_el in appliances.iteritems():
print appliance_name
data[appliance_name] = next(appliance_el.load(sample_period=30, resample_kwargs = {"how":"median"}))
if appliance_name =="mains":
data[appliance_name] = data[appliance_name][('power','apparent')]
else:
data[appliance_name] = data[appliance_name][('power','active')]
Creating the dataframe.
data_df = pd.DataFrame(data)[["mains","fridge","light","dish washer", "microwave"]].dropna()
data_df.head()
data_df.describe()
data_df.plot()
Creating a dataframe with mains as sum of appliances.
We do this because the algorithm in this NIPS paper assumes that the signal to be disaggregated is the sum of the the appliances we are trying to disaggregate.
data_df_artificial_aggregate = data_df.copy()
data_df_artificial_aggregate["mains"] = data_df_artificial_aggregate[["fridge","light","dish washer", "microwave"]].sum(axis=1)
data_df_artificial_aggregate.head()
The reason we chose to create a dataframe in this format is that we tried to keep a simple interface between Matlab and Python. We chose the following interface:
So, based on these requirements, the Matlab function had the following signature
function power_disaggregation(input_file, output_file, config_file)
%
% This function applies the iFDM model [1] for power disaggregation.
%
% Usage:
% power_disaggregation(input_file, output_file [, config_file])
%
% +input_file: Path to the input file. It should contain a matrix in which
% the first row corresponds to the observations (aggregated signal),
% while the rest of the rows correspond to the individual consuption of
% the devices. The number of columns of the matrix corresponds to the
% number of time steps.
%
% +output_file: Path to the output file. Two variables are saved in the
% output file, detailed below. Warning: These results correspond to the
% last iteration of the sampler, they have not been averaged over several
% iterations.
% -acc: The resulting accuracy.
% -output: The inferred disaggregated signals, sorted to match the input.
%
% +config_file: Path to a JSON configuration file (optional).
So, we are all set. We'll have a look at the first few lines of the parameters passed to the disaggregation method.
!head /Users/nipunbatra/git/iFDM/PowerDisaggregation/parameters.json
The authors suggested that the data should be scaled such that the aggregate power is in 10s. So, they suggested a scaling down factor of 100, which I'll do next.
scaled_data_df = data_df_artificial_aggregate.div(100)
Now, we'll get the matrix representation from the dataframe and store in a .mat.
import scipy.io as sio
sio.savemat("/Users/nipunbatra/git/iFDM/PowerDisaggregation/redd_data_nilmtk_1.mat",{"X":scaled_data_df.T.values})
cd ~/git/iFDM/PowerDisaggregation/
Finally, I'll call the Matlab method for disaggregation on the data we've produced using nilmtk.
%%matlab
cd('/Users/nipunbatra/git/iFDM/PowerDisaggregation/');
pwd;
power_disaggregation('redd_data_nilmtk_1.mat','output_nilmtk.mat', 'parameters.json' )
out = sio.loadmat("/Users/nipunbatra/git/iFDM/PowerDisaggregation/output_nilmtk.mat")
disag_df = out['output']
disag_df = pd.DataFrame(disag_df).T
disag_df.columns = data_df.columns[1:]
disag_df.index = data_df.index
# Scaling back up by a factor of 100
disag_df = disag_df.mul(100)
Creating dataframes for appliances to compare the ground truth and the disaggregated streams.
appliance_dfs = {}
for appliance in ['fridge', 'light', 'dish washer','microwave']:
appliance_dfs[appliance] = pd.DataFrame({"GT":data_df[appliance],"Predicted":disag_df[appliance]})
appliance_dfs[appliance].plot(title=appliance)
There you go! We have a working interface to the Matlab iFDM NILM algorithm. It should be noted that the program over 1000 iterations took several hours to run. I think that speedups upto 2 orders of magnitude should be possible by compiling it using mex-setup
. I'll get onto that in a while. Another thing to note is that the disaggregated fridge power signal matches the state changes observed in the ground truth signal. However, the predicted seems to have a higher magniutde than the ground truth. This can possibly be due to the fact that the aggregate measures apparent power and the appliance meters measure active power.
I think that this small demo shows that it is straight forward to interface a Matlab NILM algorithm with nilmtk. Hope to get more such state-of-the-art algorithms interfaced with nilmtk soon.


Collection
Materials and resources to help schools and providers market and promote School Direct initial teacher training places.
For initial teacher training (ITT) providers and schools participating in School Direct programmes, these resources and downloads will help you market and promote School Direct places. Some resources can be personalised for added effectiveness.
For other information and guidance on managing a School Direct programme visit: School Direct: Information for schools .
Published: 1 June 2014
Updated: 15 December 2016


Turmoil as factionalism in MDC unfolds
by Staff ReporterMembers of the opposition MDC in Masvingo province are reportedly fighting for influential positions in the party.
Regional chairperson, James Gumbi and former deputy youth minister, Tongai Matutu are allegedly at loggerheads as Matutu is sabotaging party programmes in a bid to portray the chairperson as a failure in the eyes of the national leadership.
Gumbi told Daily News that Matutu and those backing him had the backing of party bigwigs. He added:
The problem is that he (Matutu) is supported by a good number of national standing committee members that is why he does what he is doing without reprimand.
We offered him the position of provincial secretary as we attempted to unite the party after Congress, but he refused because he thinks he is bigger than that. Under those circumstances, what can we do?
On the other hand, Matutu accuses Gumbi’s executive of failure saying that it was not properly elected and has failed to set up proper local structures.
The alleged factionalism comes at a time when the party has so far performed dismally in the by-elections held countrywide.
More: Daily News


TESTING IS PAINFUL. Everyone hates testing, and most front end developers simply don't test. There are a few reasons for this:
FuncUnit aims to fix these problems:
There are many testing frameworks out there, but nothing comes close to being a complete solution for front end testing like FuncUnit does.
FuncUnit has undergone some big changes from JavaScriptMVC 3.1.
The method of running from commandline is now more consistent. You configure reporting and settings the same way in settings.js. Env, Phantom, and Selenium work in the same way.
The new steal.browser API is a layer that abstracts opening a browser using a browser automation tool and makes it easy to add new ones. PhantomJS was a new browser added with this API. Steal.browser can be used in other parts of JavaScriptMVC, like steal/html.
There used to be separate browser drivers for running in browser and selenium. Now there is only one way of using the FuncUnit API, which brings consistency no matter the environments.
The driver system created difficult to debug issues when running from Selenium, which would not occur in browser mode. Without drivers, tests run more consistently.
Also, implementing features in both drivers was difficult and required a complex build step. Adding to the FuncUnit API is now simpler and faster.
Integration with Jenkins and Maven are part of the 3.2 changes. Using the XUnit plugin and passing error codes, you can more easily build FuncUnit into your build and CI system.
Its also possible to easily customize FuncUnit output by making your own reporting functionality. All you have to do is add your own FuncUnit event handlers.
FuncUnit's internals are reworked so that S is now a subbed version of jQuery. S calls $ with the context set to your app window. "this" always points to current collection, whereas before it wasn't possible to access the actual collection, just the selector.
This has several advantages. Its easier to add plugins to S. Its also easier to get information about the elements, using any jQuery.fn method. Debugging is easier, because there is more visibility while executing asynchronous callbacks. You can inspect at various points and see why the test is failing
We were very careful while making these changes to not break the API. Any existing tests will still work, but will be less brittle when using Selenium and other automation tools.
** There is actually one minor difference, which most users won't ever notice. It used to be that you could "cache" S objects and reuse them within callbacks. The query they represented would be re-run. In 3.2+ FuncUnit, this is no longer the case. Since S objects are just jQuery collections, synchronous queries need to be rerun by calling S again.
The latest version of QUnit has a few nice features and an updated UI.
PhantomJS support now makes it more feasible to run FuncUnit tests as part of a build process.
The next FuncUnit features we plan to work on include. Let us know if you want these features or want to help!


The Poems of Emily Dickinson: Series One
by Emily Dickinson
Poems by Emily Dickinson, Three Series, Complete is a compilation of the poetry of Emily Dickinson in three different series, each composed of the following subjects: Life, Love, Nature, Time and Eternity.
Source: Dickenson, E. (1896). The Poems of Emily Dickinson: Series One.Boston, MA: Roberts Brothers.
- Life, Poem 1: Success
- Success is counted sweetest
- Life, Poem 2
- Our share of night to bear
- Life, Poem 3: Rouge et Noir
- Soul, wilt thou toss again?
- Life, Poem 4: Rouge Gagne
- 'T is so much joy!
- Life, Poem 5
- Glee! The great storm is over!
- Life, Poem 6
- If I can stop one heart from breaking,
- Life, Poem 7: Almost
- Within my reach!
- Life, Poem 8
- A wounded deer leaps highest,
- Life, Poem 9
- The heart asks pleasure firsts
- Life, Poem 10: In a Library
- A precious, mouldering pleasure 't is
- Life, Poem 11
- Much madness is divinest sense
- Life, Poem 12
- I asked no other thing
- Life, Poem 13: Exclusion
- The soul selects her own society
- Life, Poem 14: The Secret
- Some things that fly there be, —
- Life, Poem 15: The Lonely House
- I know some lonely houses off the road
- Life, Poem 16
- To fight aloud is very brave
- Life, Poem 17: Dawn
- When night is almost done
- Life, Poem 18: The Book of Martyrs
- Read, sweet, how others strove
- Life, Poem 19: The Mystery of Pain
- Pain has an element of blank
- Life, Poem 20
- I taste a liquor never brewed
- Life, Poem 21: A Book
- He ate and drank the precious words
- Life, Poem 22
- I had no time to hate, because
- Life, Poem 23: Unreturning
- 'T was such a little, little boat
- Life, Poem 24
- Whether my bark went down at sea
- Life, Poem 25
- Belshazzar had a letter, —
- Life, Poem 26
- The brain within its groove
- Love, Poem 1: Mine
- Mine by the right of the white election
- Love, Poem 2: Bequest
- You left me, sweet, two legacies, —
- Love, Poem 3
- Alter? When the hills do.
- Love, Poem 4: Suspense
- Elysium is as far as to
- Love, Poem 5: Surrender
- If you were coming in the fall
- Love, Poem 7: With a Flower
- I hide myself within my flower
- Love, Poem 8: Proof
- That I did always love
- Love, Poem 9
- Have you got a brook in your little heart
- Love, Poem 10: Transplanted
- As if some little Arctic flower
- Love, Poem 11: The Outlet
- My river runs to thee:
- Love, Poem 12: In Vain
- I cannot live with you
- Love, Poem 13: Renunciation
- There came a day at summer's full
- Love, Poem 14: Love's Baptism
- I'm ceded, I've stopped being theirs;
- Love, Poem 15: Resurrection
- 'T was a long parting, but the time
- Love, Poem 16: Apocalypse
- I'm wife; I've finished that
- Love, Poem 17: The Wife
- She rose to his requirement, dropped
- Love, Poem 18: Apotheosis
- Come slowly, Eden!
- Nature, Poem 1
- New feet within my garden go
- Nature, Poem 2: May-Flower
- Pink, small, and punctual
- Nature, Poem 3: Why
- The murmur of a bee
- Nature, Poem 4
- Perhaps you'd like to buy a flower?
- Nature, Poem 5
- The pedigree of honey
- Nature, Poem 6: A Service of Song
- Some keep the Sabbath going to church;
- Nature, Poem 7
- The bee is not afraid of me
- Nature, Poem 8: Summer's Armies
- Some rainbow coming from the fair!
- Nature, Poem 9: The Grass
- The grass so little has to do, —
- Nature, Poem 10
- A little road not made of man
- Nature, Poem 11: Summer Shower
- A drop fell on the apple tree
- Nature, Poem 12: Psalm of the Day
- A something in a summer's day
- Nature, Poem 13: The Sea of Sunset
- This is the land the sunset washes
- Nature, Poem 14: Purple Cover
- There is a flower that bees prefer
- Nature, Poem 15: The Bee
- Like trains of cars on tracks of plush
- Nature, Poem 16
- Presentiment is that long shadow on the lawn
- Nature, Poem 17
- As children bid the guest good-night
- Nature, Poem 18
- Angels in the early morning
- Nature, Poem 19
- So bashful when I spied her
- Nature, Poem 20: Two Worlds
- It makes no difference abroad
- Nature, Poem 21: The Mountain
- The mountain sat upon the plain
- Nature, Poem 22: A Day
- I'll tell you how the sun rose, —
- Nature, Poem 23
- The butterfly's assumption-gown
- Nature, Poem 24: The Wind
- Of all the sounds despatched abroad
- Nature, Poem 25: Death and Life
- Apparently with no surprise
- Nature, Poem 26
- 'T was latter when the summer went
- Nature, Poem 27: Indian Summer
- These are the days when birds come back
- Nature, Poem 28: Autumn
- The Morns are meeker than they were
- Nature, Poem 29: Beclouded
- The sky is low, the clouds are mean
- Nature, Poem 30: Hemlock
- I think the hemlock likes to stand
- Nature, Poem 31
- There's a certain slant of light
- Time and Eternity, Poem 1
- One dignity delays for all
- Time and Eternity, Poem 2: Too Late
- Delayed till she had ceased to know
- Time and Eternity, Poem 3: Astra Castra
- Departed to the judgement
- Time and Eternity, Poem 4
- Safe in their alabaster chambers
- Time and Eternity, Poem 5
- On this long storm the rainbow rose
- Time and Eternity, Poem 6: From the Chrysalis
- My cocoon tightens, colors tease
- Time and Eternity, Poem 7: Setting Sail
- Exultation is the going
- Time and Eternity, Poem 8
- Look back on time with kindly eyes
- Time and Eternity, Poem 9
- A train went through a burial gate
- Time and Eternity, Poem 10
- I died for beauty, but was scarce
- Time and Eternity, Poem 11: Troubled About Many Things
- How many times these low feet staggered
- Time and Eternity, Poem 12: Real
- I like a look of agony
- Time and Eternity, Poem 13: The Funeral
- That short, potential stir
- Time and Eternity, Poem 14
- I went to thank her
- Time and Eternity, Poem 15
- I've seen a dying eye
- Time and Eternity, Poem 16: Refuge
- The clouds their backs together laid
- Time and Eternity, Poem 17
- I never saw a moor
- Time and Eternity, Poem 18: Playmates
- God permits industrious angels
- Time and Eternity, Poem 19
- To know just how he suffered would be dear
- Time and Eternity, Poem 20
- The last night that she lived
- Time and Eternity, Poem 21: The First Lesson
- Not in this world to see his face
- Time and Eternity, Poem 22
- The bustle in a house
- Time and Eternity, Poem 23
- I reason, earth is short
- Time and Eternity, Poem 24
- Afraid? Of whom am I afraid?
- Time and Eternity, Poem 25: Dying
- The sun kept setting, setting still;
- Time and Eternity, Poem 26
- Two swimmers wrestled on the spar
- Time and Eternity, Poem 27: The Chariot
- Because I could not stop for Death
- Time and Eternity, Poem 28
- She went as quiet as the dew
- Time and Eternity, Poem 29: Resurgam
- At last to be identified!
- Time and Eternity, Poem 30
- Except to heaven, she is nought;
- Time and Eternity, Poem 31
- Death is a dialogue between
- Time and Eternity, Poem 32
- It was too late for man
- Time and Eternity, Poem 33: Along the Potomac
- When I was small, a woman died.
- Time and Eternity, Poem 34
- The daisy follows soft the sun
- Time and Eternity, Poem 35: Emancipation
- No rack can torture me
- Time and Eternity, Poem 36: Lost
- I lost a world the other day.
- Time and Eternity, Poem 37
- If I shouldn't be alive
- Time and Eternity, Poem 38
- Sleep is supposed to be
- Time and Eternity, Poem 39
- I shall know why, when time is over
- Time and Eternity, Poem 40
- I never lost as much but twice


Consolidators are used to combine smaller data points into larger bars. Commonly this is used to create 5, 10 or 15 minute bars from minute data. We provide tick, second, minute, hour and daily resolution bars which can be consolidated into any form you wish.
To use consolidators you create the consolidator class and then register it to receive data. Once you've registered the class
it automatically gets data updates. Once it has aggregated the desired data it emits an event on the DataConsolidated
event handler. You setup the consolidator and bind to this event handler once from inside your
Initialize()
def Initialize:
method.
// Create and initialize a consolidator public override void Initialize() { //...other initialization... AddEquity("SPY", Resolution.Minute); var consolidator = new TradeBarConsolidator(15); consolidator.DataConsolidated += { Debug(Time.ToString() + " > New Bar!"); }; SubscriptionManager.AddConsolidator("SPY", consolidator); }
# Create and initialize a consolidator def Initialize(self): # ...other initialization... self.AddEquity("SPY", Resolution.Minute) consolidator = TradeBarConsolidator(15) consolidator.DataConsolidated += self.OnDataConsolidated self.SubscriptionManager.AddConsolidator("SPY", consolidator) def OnDataConsolidated(self, sender, bar): self.Debug(str(self.Time) + " > New Bar!")


Home
Login
Sign up
About
Login
Please fill in this form to Login .
Email
Password
Remember me
Login
Not Registerd
Signup


I would best describe myself as a hybrid between a copywriter and a marketer. Recognizing the heavy transition to digital materials (both in publishing in marketing), I have taught myself many skills and tools in digital media creation ranging from InDesign to HTML and CSS to build upon my education (in fact: I built this website by hand in these languages!).
Currently, I am in the job market having recently moved to Boston (from the San Francisco Bay Area). I am extremely ambitious, quick to learn new technologies, comfortable in various environments (engineering and tech companies), and importantly: am interesting in taking on a role that would fit closely with the skills I described above. I strongly encourage you to look at my Resume page, as well as my Projects page to see a few samples of my writing and digital layouts.
I love to be active! Whether it be running, biking, yoga, rock climbing, or just going for a walk I want to be outside moving around.
In the past 4 years I have ran in several 5k's, completing each race in under 30 minutes. I also finished 9th in my age group in my first 10k, I have only ran one official half marathon and was so tired by the end of it I forgot to check my official time. Woops! One day I hope to complete a marathon, but I need way more training for that.
 Some of the adventures I have been on while traveling include climbing mountains in Arizona, hiking all over Northern California, camping in Idaho, scrambling over glacial deposits in New York, and meeting bison in Yellowstone. When I visited Hawaii in September I spent more days hiking and exploring than hanging at the beach. While there I climbed to the top of Haleakala, and visited the West Maui Forest Reserve. In Vancouver my friends and I climbed up 2,830 stairs to complete the Grouse Grind under the average time of an hour and a half.
This Christmas I was given a hiking guide of Massachusetts, the guide points out the best locations for hikers of all levels. I hoped to get a lot of use out of the guide this winter, but the weather had other ideas. Now that the snow is finally melting I am planning on hiking every weekend. I also have plans to hike some of the Appalachian Trail and take a long weekend to Acadia National Park in Maine. If it's outside, I want to do it!
Erie, Pittsburgh, San Francisco, and Boston oh my! I was born and grew up in Erie, PA and moved to a suburb of Pittsburgh in high school. I thought I hadn’t spent enough time in Pittsburgh to warrant going to a school somewhere else so I went to Duquesne University in downtown Pittsburgh. There I studied English Literature and PR & Advertising and dreamed of moving to New York City or DC to work at a publishing company as an editor.
After graduation, I moved to the San Francisco Bay Area with my significant other, where we were both offered jobs. It is such an amazing place, California is like a different country compared to Pennsylvania. Technology plays a huge role in the Bay Area, everyone I met worked for a tech startup and were creating an app on the side. It became clear to me that we are becoming a more technological society, this inspired me to take the initiative to learn programming languages and new software programs to become more marketable in a computer age. As much as I would have liked to stay in San Francisco, opportunity called and after 367 days we packed up and moved to Boston.
The job market in Boston is friendlier towards those with Liberal Arts backgrounds and being closer to NYC, there are more publishing companies with branches in the area. Moving to Boston is the opportunity I need to break into the marketing or publishing industry. Despite the weather I have felt welcomed and at home in Massachusetts. It is such a historic state, exploring Salem and Plymouth is like going to a living museum! In the end being driving distance to my family is a great bonus and I didn’t even have to give up the ocean!
I love to cook and garden. Growing your own food and making something delicious out of it is so fulfilling (and filling). When I lived in San Francisco I had a small garden and grew kale, arugula, carrots, radishes, and sugar snap peas. The carrots and radishes didn’t do too well because the soil was too hard, but the peas were some of the best I had ever eaten. Now that I live on the third floor of an apartment building I am stuck growing plants in containers.
Since moving I have been recycling glass jars from jelly, salsa, and pasta sauce to be used as small planters. Carrots and radishes are probably out of the question, but I will grow myself a spice rack instead. By growing herbs I will be able to season most of my food from plants I grow myself. No more buying basil, mint, and sage from the grocery store, I can have it fresh whenever I need it!
Cooking and baking are also hobbies of mine, I enjoy picking out a new recipe to try and making it my own. My mom was always cooking for my family so I never got a chance to make food for others until I moved out after college. Once I had a kitchen of my own, I couldn’t be stopped. I was making a new dinner or dessert every night. I have made donuts, bagels, stuffed grape leaves, stews, soups, burgers, pastas, and more! I want to keep challenging myself to find and execute more and more complex dishes. I hope one day I will be able to have Thanksgiving dinner at my house like my mom does now. Cooking for others is my main motivation, I want to give that I make to my friends so we can all enjoy a meal together. This motivation is probably why I tend to make too much food for just two people and end up with enough leftovers for a whole week.
I never know what I’m going to make next, I just let inspiration strike!


CL-GSERVER.ACTOR
make-actor BEHAVIOR &KEY NAME STATE → result
BEHAVIOR
:
a
T
NAME
:
a
T
STATE
:
a
T
result
: a T.
Default constructor of an `actor'. The `behavior' parameter is a function that should take 3 parameters. That is the actor instance itself, the message and the current state of the actor. The `behavior' can then decide how to handle the message. In any case it has to return a `cons' of message to be sent back to caller (`car'), if applicable. And the new state of the actor. I.e.: `(cons <my-response> <my-new-state>)' If the operation was an `ask' or `async-ask' then the `car' part of the `cons' will be sent back to the caller. In case of a `tell' operation there will be no response and the `car' of the `cons' is ignored.


The WiFi sensor performs a scan of nearby WiFi networks.
The scan result is formatted as a list of JSON objects with each network's SSID, BSSID, capabilities, level, and frequency. If there are no results, the scanResult
list contains the string "unavailable".
{
"sensorType": "WiFi",
"senseStartTime":"HH:mm:ss:SSS dd MM yyyy Z z",
"senseStartTimeMillis":0,
"userid":"string",
"deviceid":"string",
"postSenseSleepMillis":0,
"isAdaptivelySensed":false,
"scanResult":
[
{
"ssid":"string",
"bssid":"string",
"capabilities":"string",
"level":int,
"frequency":int
}
]
}


'Sneaky'
‘Sneaky’ Rangers star Jack slammed by Dutch media following Feyenoord draw
by Gary TaylorRANGERS star Ryan Jack was slammed by the Dutch media following last night's draw with Feyenoord.
The Light Blues midfielder was accused of 'sneakily' trying to injure Tyrell Malacia, in a way which would 'probably make the British inventors of the game spin in their graves'
Dutch media outlets were left less than impressed with the performance of Steven Gerrard's men in Rotterdam.
Alfredo Morelos hit a second half double as Rangers climbed to the top of the section.
And he also came in for some criticism for his "provocative celebrations".
Victory over Young Boys at Ibrox will secure first place in the group - but Gers know they will qualify for the last 32 by avoiding defeat in the final round of fixtures.
Here is a round-up of what was said about Thursday's Europa League encounter.
De Volskrant: "A young Feyenoord got scant reward for their passionate play" against a Rangers team described as "playing rather poorly".
Bart Vlietstra wrote: "The two Rangers goals from striker Morelos came from just about the only two chances for the visitors, in just about their only strong phase, while Feyenoord could have scored more".
Voetball Primeur's report says: "Rangers were completely lost in the first half as a crowded De Kuip encouraged Feyenoord to grab the Scots by the throat from the first minute.
"In the end they concluded that the hosts "threw it away".
Algemeen Daglblad feel that the groups bottom side need a miracle to finish in the top two.
They wrote: "The three points were there for the taking, but a weak first 15 minutes after half-time put Advocaat's team in unnecessary trouble.
"Advocaat had given his former employers from Scotland plenty of compliments in advance about their level, but in the first half Feyenoord were much better than the Scots - only the team from Rotterdam have found scoring extremely difficult this season."
De Telegraaf claimed the Rotterdam club still had a 'glimmer of hope' in their bid to reach the knockout phase
While Nederlands Nieuws claim the equaliser came out of nowhere. But they praised Morelos for his 'two fine headers'.
Meanwhile, Rangers could face having Ibrox closed for their next Europa League match against Young Boys if Uefa take action following reports of sectarian singing against Feyenoord.
Gers have already been ordered by Uefa to close sections of the stadium on two occasions this season - for the visits of Legia Warsaw and Feyenoord.
Rangers also declined to take any away tickets for the trip to face Young Boys at the start of October.
Now, under Uefa's strict Article 14 rules on racism and other discriminatory conduct, they could be ordered to close the entire stadium for the final group game against Young Boys on December 12.
Keep u p to date with ALL the latest news and transfers at the Scottish Sun football page


Yukari’s Birthday
Time Limit: 12000/6000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 2549 Accepted Submission(s): 522
Problem Description
Today is Yukari’s n-th birthday. Ran and Chen hold a celebration party for her. Now comes the most important part, birthday cake! But it’s a big challenge for them to place n candles on the top of the cake. As Yukari has lived for such a long long time, though
she herself insists that she is a 17-year-old girl.
To make the birthday cake look more beautiful, Ran and Chen decide to place them like r ≥ 1 concentric circles. They place ki candles equidistantly on the i-th circle, where k ≥ 2, 1 ≤ i ≤ r. And it’s optional to place at most one candle at the center
of the cake. In case that there are a lot of different pairs of r and k satisfying these restrictions, they want to minimize r × k. If there is still a tie, minimize r.
she herself insists that she is a 17-year-old girl.
To make the birthday cake look more beautiful, Ran and Chen decide to place them like r ≥ 1 concentric circles. They place ki candles equidistantly on the i-th circle, where k ≥ 2, 1 ≤ i ≤ r. And it’s optional to place at most one candle at the center
of the cake. In case that there are a lot of different pairs of r and k satisfying these restrictions, they want to minimize r × k. If there is still a tie, minimize r.
Input
There are about 10,000 test cases. Process to the end of file.
Each test consists of only an integer 18 ≤ n ≤ 1012.
Each test consists of only an integer 18 ≤ n ≤ 1012.
Output
For each test case, output r and k.
Sample Input
18 111 1111
Sample Output
1 17 2 10 3 10
#include <iostream> #include <cstdio> #include <cstdlib> #include <cstring> #include <string> #include <queue> #include <algorithm> #include <map> #include <cmath> #include <iomanip> #define INF 99999999 typedef __int64 LL; using namespace std; const int MAX=1000+10; LL n; LL cal(LL k,LL r){ LL sum=1,ans=0; for(int i=1;i<=r;++i){ if(n/sum<k)return n+1; sum=sum*k;//sum*k可能会溢出 ans+=sum; if(ans>n)return ans;//ans大于n直接返回 } return ans; } LL search(LL i){ LL l=2,r=n; while(l<=r){ LL mid=(l+r)>>1; LL sum=cal(mid,i); if(sum == n-1 || sum == n)return mid; if(sum<n-1)l=mid+1; else r=mid-1; } return -1; } int main(){ while(~scanf("%I64d",&n)){ LL a=1,b=n-1; for(LL i=2;i<=60;++i){//枚举r然后对k进行二分查找,因为k>?=2,2^60>10^12,所以i只要枚举到60即可 LL k=search(i); if(k != -1 && i*k<a*b){a=i,b=k;} } printf("%I64d %I64d\n",a,b); } return 0; }
版权声明：本文为博主原创文章，未经博主允许不得转载。
(adsbygoogle = window.adsbygoogle || []).push({});
双刀火鸡的腕力惊人，只有她！才能打出这么好的牛丸！


Name:{{x.name}}
Color:{{x.color}}
Memory:{{x.memory}}
Price:⁕{{x.price}}
this is description
this is specification
this is review


Partridge
Partridge is a Green food. Green foods are safe to eat as a regular part of a diet.
Category Quotes
Guideline related quotes related to Poultry-Wild and Green throughout Geoff Bond's publications.
For the meat, poultry, eggs, and fish group, Preferably consume two servings a day of “Green-Green” foods. If unavailable, you can consume two servings a day of “Green” foods. ~Paleo in a Nutshell p.102
To be in conformity with the Savanna Model Use only omega-3-rich, free-range, organic hen’s eggs. ~Paleo in a Nutshell p.102
For the meat, poultry, eggs, and fish group Restrict total food group servings per session to one. ~Paleo in a Nutshell p.102
For the meat, poultry, eggs, and fish group, Restrict total food group servings per day to two. ~Paleo in a Nutshell p.102
Additional Quotes
Specific references to Partridge throughout Geoff Bond's publications.
The early civilizations carried on the old traditions of hunting, trapping, and snaring fowl. The ancient Egyptians caught and ate ostrich, bustard, crane, dove, pigeon, duck, quail, partridge, pheasant, and goose. Birds associated with the gods were taboo, notably the falcon, the ibis (a kind of heron), and the vulture. The Greeks and Romans did not eat much fowl, although at feasts peacock, thrushes, and ring-dove might be served. However, we must remember that the food of the ordinary citizen was extremely frugal; banquets and feasts were for the few, the wealthy gentry. ~Deadly Harvest p.61
Wild bird flesh corresponds closely to the Savanna Model. In addition, there is a large production of "managed" game to provide sport for shooting parties. These are predominantly pheasant, grouse, pigeon, partridge, and quail. (The partridge is related to the francolin hunted by the San.) However, often the managing techniques involve intensive feeding and the production of slow-flying birds. Their meat might well be closer to battery chicken quality than their wild counterparts. ~Deadly Harvest p.61


Heading of the content
An example content here for demonstration. This is some dummy text. Some dummy text inside a dummy paragraph pretending to be a real content.
Really? Are there real content here? What do you think? Here are just some dummy text.
An example content here for demonstration. This is some dummy text. Some dummy text inside a dummy paragraph pretending to be a real content.
Really? Are there real content here? What do you think? Here are just some dummy text.
An example content here for demonstration. This is some dummy text. Some dummy text inside a dummy paragraph pretending to be a real content.
Really? Are there real content here? What do you think? Here are just some dummy text.