struct Pack {A a; B b; C c;};
std::map> pack_map_;
shared_ptr doesn't need copy ctor and assignment, it only
need to see the dtor at the time when you new Pack.
There is no need to use delete directly almost in all cases today.
If you use one, then there is a problem with your design.
考试嘛?上一段real code
def parameterprod(paradict):
keys = tuple(paradict.keys())
itemlist = []
for k in paradict.keys():
if isinstance(paradict[k], list):
itemlist.append( paradict[k])
else:
l = []
l.append(paradict[k])
itemlist.append(l)
prodtuples = list(itertools.product(*itemlist))
pdict = []
for l in prodtuples:
pdict.append(dict(zip(keys,l)))
return pdict
Scala for the Impatient book
The [AL][1-3] refer to Martin Odersky's Scala levels.
The Basics (A1)
Control Structures and Functions (A1)
Arrays (A1)
Maps and Tuples (A1)
Classes (A1)
Objects (A1)
Packages and Imports (A1)
Inheritance (A1)
Files and Regular Expressions (A1)
Traits (L1)
Operators (L1)
Higher-Order Functions (L1)
Collections (A2)
Pattern Matching and Case Classes (A2)
Annotations (A2)
XML Processing (A2)
Type Parameters (L2)
Advanced Types (L2)
Parsing and Domain-Specific Language... 阅读全帖
Announcing Amazon Kinesis Client Library for Python
Dear Amazon Web Services Customer,
This week we announced the release of two new enhancements to Amazon Kinesis
. The first is the release of the Amazon Kinesis Client Library (KCL) for
Python developers. The KCL handles complex issues such as adapting to
changes in stream volume, load-balancing streaming data, coordinating
distributed services, and processing data with fault-tolerance. Python
developers can use the library to easily stream dat... 阅读全帖
in c code, i can have
switch version:
case 1:
val1=10; val2=15;
case 2:
val1=20; val2=25;
...
return val1 and val2 (can use reference etc. to return)
in xml, how can we do that ?
i mean return 2 valus ?
大家给些思路吧,我能想出来的就只有用filter,但我不是统计背景的,所以真的不知道怎么用filter,大家谁能告诉一些用filter的细节,我将感激不尽,真的急啊。谢谢了
A data file contains time series energy consumption data for a home over a
one month duration sampled at 1 second granularity
Format - Each line contains a tuple , like
below:
1312182000,1322
1312182001,1322
1312182002,1328
...
The timezone is PDT and the energy readings are in Watts.
The Data:
This is aggregate energy consumption data for one home that contains the... 阅读全帖
well, let me make it concrete. (and u r right, the date attr is redundent, it's just part of the dataset)
I took record of stock price every trading day, for each tuple in the db, I
have 3 attributes:
date, previous_day_close_price, close_price
and I want to check if the system is consistent, if I see something like:
... ...
2010-07-14, 5.17, 5.21
2010-07-15, 5.21, *5.14
2010-07-16, *5.10, 5.06
... ...
(* - inconsist prices)
I know something's wrong here, since 2010-07-15's previous close pr
say, d <- "12/10/2001",
datastruct <- as.numeric( unlist( strsplit(d, "/")) )
datastruct is a tuple of (month, day,year). You shall be able to figure out
the rest stuff on your own now.
baozi plz.
大家给些思路吧,如果能帮我回答,我将感激不尽,真的急啊。谢谢了
A data file contains time series energy consumption data for a home over a
one month duration sampled at 1 second granularity
Format - Each line contains a tuple , like
below:
1312182000,1322
1312182001,1322
1312182002,1328
...
The timezone is PDT and the energy readings are in Watts.
The Data:
This is aggregate energy consumption data for one home that contains the
following main appliances,
* Central AC 1 - The mo... 阅读全帖
The 'cookbook' learning approach does not work well with Python.
Before attempting to write any useful code, one would be expected to have
crystal-clear understanding of the following basic Python concepts:
- Data Types
- Variables
- Strings
- Lists and Tuples
- Dictionary and Set
- File I/O
- Methods and Modules
- Conditionals, Loops and other statements
- Exception Handling
The good news is that you only need to focus on those relevant to data
scientists :-)
-----------------------------------... 阅读全帖
Saturday 4/19
Python Class - Saturday 8:30 AM (Pacific Daylight Time )
- Data Types and Expressions
- Variables
- Statements
- Functions, Methods and Modules
- Strings
- Lists and Tuples
- Dictionary
- Handling Exceptions
- File I/O
- Conditionals, Loops and other statements
- Hands on coding (inc. Examples: financial underwriting data)
- a quick demo on Hadoop File System, Hive and Python streaming.
---------------------------
R Class - Saturday 11:00 AM (Pacific Daylight Time)
1) R concepts r... 阅读全帖