CNode¶
The CNode
API is one of the representation in Bip for
the AST nodes of an Hexrays decompiled function. Of the two representations,
it is the one which is prefered. The class CNode
is an
abstract class which is used as parent for the actual classes representing the
nodes. For more informations about AST nodes and their different types see
Ast Nodes & Visitors.
For recuperating the CNode
objects for a particular
function several methods of HxCFunc
can be used:
- the
root_node()
property for getting the root of the AST for a particular function; - the
get_cnode_filter()
andget_cnode_filter_type()
methods provide list of the nodes in the functions (those are based on the visitors); - the
visit_cnode()
andvisit_cnode_filterlist()
methods which allow to visit the AST using a Deep-First Search (DFS) algorithm with preorder-traversal.
For a list of possible node type see AST Node types.
Two internal mechanisms are important to understand
the CNode
implementation:
- all
CNode
are generated from acitem_t
object in IDA, the correct classes is determine depending of the type of thecitem_t
(HxCType
). Thefrom_citem()
static method exist for finding the correct child class ofCNode
corresponding to thecitem_t
and creating it, as a general rule the constructors should not be called directly. - most of the
CNode
subclasses are created dynamically from their equivalentHxCItem
, this is for avoiding code duplication. For more information see CNode generation and internals.
CNode API¶
-
class
bip.hexrays.
CNode
(citem, hxcfunc, parent)¶ Abstract class which allow to represent C expression and C statement decompiled from HexRays. This is an equivalent class to
HxCItem
but is designed for visiting an AST generated by HexRays. The main advantage to use this class and its subclasses and not theHxCItem
is the additional features which it provides, such as:- access to the parent node,
- access to the parent
HxCFunc
, - visitor for nodes below the current one,
- several node specific methods, listed in Methods specific to CNode implementation.
The parrent class
AbstractCItem
also provides common functionnality with theHxCItem
objects. All subclasses of this class have the same behavior as the one fromHxCItem
with just some aditional feature.This is an abstract class and no object of this class should ever be created. The static method
from_citem()
allow to create object of the correct subclass which inherit fromCNode
.-
__init__
(citem, hxcfunc, parent)¶ Constructor for the abstract class
CNode
. This should never be used directly.Parameters: - citem – a
citem_t
object, in practice this should always be acexpr_t
or acinsn_t
object. - hxcfunc – A
HxCFunc
object corresponding to the function which contains this node/item. - parent – An object which inherit from
CNode
corresponding to the parent expression or statement of this object. This may beNone
if this node is the root of the AST tree for its function.
- citem – a
-
_hxcfunc
= None¶ The function associated with this node. This is a
HxCFunc
object. This is private and should not be modify. Modifying this attribute will not make any modification to the data stored in IDA.
-
_parent
= None¶ The parent node of this node. This should be an object which inherit from
CNode
. This may beNone
if this node is the root node of the AST tree for its function. This is private and should not be modify. Modifying this attribute will not make any modification to the data stored in IDA.
-
closest_ea
¶ Property which return the closest address for this
CNode
.By default this should be equivalent to the
ea()
property except if it returnidc.BADADDR
, in this case it will try and get the address of the parent. If the most parrent node of this node (which should be the root node of the function) still has no address,None
is return.Returns: An integer corresponding to the closest address for this node. If no address where found this method will return None.
-
cstr
¶ Property which return the C code corresponding to the decompilation of this
CNode
as a onliner. This will include the children of this object.Return str: The human readable C string corresponding to this CNode
as a onliner.
-
has_parent
¶ Property which return true if the
CNode
as a parent. Only CNode which are root of a function should not have a parent.
-
parent
¶ Property which return the parent of this
CNode
. If this node does not have a parent aRuntimeError
exception will be raised.Returns: A CNode
object parent of this node.
-
hxcfunc
¶ Property returning the
HxCFunc
to which this node is associated.Returns: A HxCFunc
object corresponding to the function associated with this node.
-
comment
¶ Get the comment at the closest address of this node.
Note that two node with the same closest_ea will have the same comment.
Todo
Default ITP will work only for expression, should make another one for statement.
Note
This use the default itp (at the semi-colon level), see
HxCFunc.get_cmt()
.
-
visit_cnode
(callback)¶ Method which allow to visit this
CNode
elements and all those below it. This is implemented using a DFS algorithm. This does not use the hexrays visitor. For more information about the implementation seevisit_dfs_cnode()
(this method is just a wrapper).Parameters: callback – A callable which will be called on this and all CNode
below it. The call should take only one argument which correspond to theCNode
currently visited. If this callback return False the visit is stoped, all other result is ignored.
-
visit_cnode_filterlist
(callback, filter_list)¶ Method which allow to visit
CNode
elements which are of a type present in a list. Start with the currentCNode
and look in all its children. This is implemented using a DFS algorithm. This does not use the hexrays visitor. For more information about the implementation seevisit_dfs_cnode_filterlist()
(this method is just a wrapper).Parameters: - callback – A callable which will be called on all
CNode
in the function decompiled by hexrays. The call should take only one argument which correspond to theCNode
currently visited. If this callback return False the visit is stoped, all other result is ignored. - filter_list – A list of class which inherit from
CNode
. The callback will be called only for the node from a class in this list.
- callback – A callable which will be called on all
-
get_cnode_filter
(cb_filter)¶ Method which return a list of
CNode
for which a filter return true. Internally this use thevisit_cnode()
method which visit all nodes below (and including) the current one, this is just a wrapper.Parameters: cb_filter – A callable which take a CNode
in parameter and return a boolean. This callback will be called on all children nodes and all nodes for which it returns true will be added in a list which will be returned by this function.Returns: A list of CNode
which have match the filter. This list is order in which the node have been visited (seevisit_cnode()
for more information).
-
get_cnode_filter_type
(type_filter)¶ Method which return a list of
CNode
of a particular type(s). Internally this use thevisit_cnode_filterlist()
method which visit all nodes below and including the current one, this is just a wrapper.Parameters: type_filter – The type(s) of CNode
to get. OnlyCNode
matching the isinstance of this type will be returned. This can be a type, a class or a tuple (or list) of class and type.Returns: A list of CNode
which have match the type. This list is order in which the node have been visited (seevisit_cnode()
for more information).
-
ignore_cast
¶ Property which return this node if it is not a cast or its child if it is a cast. This is designed for allowing to quickly ignore cast when going through some nodes.
Returns: The first CNode
which is not a cast.
-
ignore_cast_parent
¶ Property which return this node if it is not a cast or its parent if it is a cast. This is designed for allowing to quickly ignore cast when going backward through some nodes.
Returns: The first CNode
which is not a cast.
-
_create_child
(citem)¶ Internal method which allow to create a
CNode
object from acitem_t
child of the current node. This must be used byCNodeStmt
andCNodeExpr
for creating their child expression and statement. This method is used for having compatibility with theHxCItem
class.Internally this function is a wrapper on
from_citem()
which is call with the same function than this object and with this object as parent.Parameters: citem – A citem_t
from ida.Returns: The equivalent node object to the citem_t
for bip. This will be an object which inherit fromCNode
.
-
static
from_citem
(citem, hxcfunc, parent)¶ Static method which allow to create an object of the correct child class of
CNode
which is equivalent to acitem_t
from ida. In particular it will be used for convertingcexpr_t
andcinsn_t
from ida toCNodeExpr
andCNodeStmt
in bip. If noCNode
child object exist corresponding to thecitem
provided aValueError
exception will be raised.This is the equivalent of
HxCItem.from_citem()
but for theCNode
.Note
CNodeExpr
andCNodeStmt
should not used this function for creating child item butCNode._create_child()
.Parameters: - citem – A
citem_t
from ida. - hxcfunc – A
HxCFunc
object corresponding to the function which contains this node/item. - parent – An object which inherit from
CNode
corresponding to the parent expression or statement of this object. This may beNone
if this node is the root of the AST tree for its function.
Returns: The equivalent object to the
citem_t
for bip. This will be an object which inherit fromHxCItem
.- citem – A
CNodeExpr API¶
-
class
bip.hexrays.
CNodeExpr
(cexpr, hxcfunc, parent)¶ Abstract class for representing a C Expression decompiled from HexRays. This is an abstract class which is used as a wrapper on top of the
cexpr_t
object. This is the equivalent of theHxCExpr
class but which inherit from theCNode
and is made for visiting an AST.No object of this class should be instanstiated, for getting an expression the function
from_citem()
should be used.Todo
something better could be done here for avoiding code duplication of the
HxCExpr
class.-
__init__
(cexpr, hxcfunc, parent)¶ Constructor for the
CNodeExpr
object. Arguments are used by theCNode
constructor.Parameters: - cexpr – A
cexpr_t
object from ida. - hxcfunc – A
HxCFunc
object corresponding to the function which contains this node/item. - parent – An object which inherit from
CNode
corresponding to the parent expression or statement of this object. This may beNone
if this node is the root of the AST tree for its function.
- cexpr – A
-
_cexpr
= None¶ The
cexpr_t
object from ida.
-
__str__
()¶ Surcharge for printing a CExpr
-
ops
¶ Function which return the C Expressions child of this expression. This is used only when the expression is recursive.
Returns: A list
of object inheriting fromCNodeExpr
and child of the current expression.
-
type
¶ Property which return the type (
BipType
) of this expression.Returns: An object which inherit from BipType
which correspond to the type of this object. Change to this type object will not change the type of this expression.
-
find_final_left_node
()¶ Return the node which is the left most “final” expression (inherit from
CNodeExprFinal
) below this node. If this node is a final expression it is returned.
-
find_left_node_notmatching
(li)¶ Find the most left node not matching some classes. If the current node does not match any classes in the list provided it will be returned.
This function allow to bypass nodes to ignored. A common utilisation will be to bypass some unary operand for getting a final value or to bypass cast, reference or ptr derefence only. For getting the final node and ingore all other nodes see
find_final_left_node()
. If a node found is a “final” node (inherit fromCNodeExprFinal
) it will always be returned.For example for ignoring cast and ref use:
cn.find_left_node_notmatching([CNodeExprCast, CNodeExprRef])
.Parameters: li – A list
ortuple
of classes which inherit fromCNodeExpr
to ignore.Returns: A CNode object which is not of one of the class in li
.
-
CNodeStmt API¶
-
class
bip.hexrays.
CNodeStmt
(cinsn, hxcfunc, parent)¶ Abstract class for representing a C Statement as returned by hexrays. This is an abstract class which is a wrapper on top of the
cinsn_t
ida object. This is the equivalent of theHxCStmt
class but which inherit from theCNode
and is made for visiting an AST.No object of this class should be instanstiated, for getting an expression the function
from_citem()
should be used.A statement can contain one or more child statement and one or more child expression (
HxCExpr
) object. By convention properties which will return child statement of an object will start with the prefixstmt_
orst_
.-
__init__
(cinsn, hxcfunc, parent)¶ Constructor for a
CNodeStmt
object. Arguments are used by theCNode
constructor.Parameters: - cinsn – A
cinsn_t
from ida. - hxcfunc – A
HxCFunc
object corresponding to the function which contains this node/item. - parent – An object which inherit from
CNode
corresponding to the parent expression or statement of this object. This may beNone
if this node is the root of the AST tree for its function.
- cinsn – A
-
_cinsn
= None¶ The
cinsn_t
object from ida.
-
__str__
()¶ Surcharge for printing a CStmt.
-
stmt_children
¶ Property which return a list of the statements which are children of this statement. This is used only when the statement is recursive, if not this will return an empty list.
Returns: A list of child statement of this object. Return type: Objects which inherit from CNodeStmt
.
-
expr_children
¶ Property which return a list of the expression (
CNodeExpr
) which are children of this statement. This will not return children expression of the statement child of the current object.Returns: A list of child expression of this object. Return type: Objects which inherit from CNodeExpr
.
-
Final Expression API¶
-
class
bip.hexrays.
CNodeExprFinal
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprFinal
but which inherit fromCNode
. Automatically created bybuildCNode()
-
__str__
()¶ Surcharge for printing a HxCExprFinal.
-
value
¶ Property which return the value of a final expression. This is abstract and if not overwritten it will raise a
RuntimeError
.
-
-
class
bip.hexrays.
CNodeExprEmpty
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprEmpty
but which inherit fromCNode
. Automatically created bybuildCNode()
-
class
bip.hexrays.
CNodeExprNum
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprNum
but which inherit fromCNode
. Automatically created bybuildCNode()
-
size
¶ Original size in bytes of the number.
Return int: the size in bytes.
-
value
¶ Value of the number.
Return int: the value of this number.
-
-
class
bip.hexrays.
CNodeExprFNum
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprFNum
but which inherit fromCNode
. Automatically created bybuildCNode()
-
size
¶ Original size in bytes of the number.
Return int: the size in bytes.
-
value
¶ Todo
not sure if this works at all and probably not what we want anyway.
-
-
class
bip.hexrays.
CNodeExprStr
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprStr
but which inherit fromCNode
. Automatically created bybuildCNode()
-
value
¶ String value.
Return str: the value of this string.
-
-
class
bip.hexrays.
CNodeExprObj
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprObj
but which inherit fromCNode
. Automatically created bybuildCNode()
-
value
¶ Address of the object.
Return int: the address of the object.
-
-
class
bip.hexrays.
CNodeExprVar
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprVar
but which inherit fromCNode
. Automatically created bybuildCNode()
-
index
¶ Index in the lvar array.
Todo
this should probably directly return the lvar ?
Return int: the index in the lvar array.
-
lvar
¶ Property which allow direct access to the
HxLvar
object referenced by this node.This method exist only for the
CNode
implementation.Returns: the HxLvar
object referenced by this node.
-
lvar_name
¶ Property which allow to get the name of the
HxLvar
referenced by this node.This method exist only for the
CNode
implementation.Returns: The name of the lvar as a string.
-
value
¶ Index in the lvar array.
Return int: the index in the lvar array.
-
-
class
bip.hexrays.
CNodeExprHelper
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprHelper
but which inherit fromCNode
. Automatically created bybuildCNode()
-
value
¶ Value of this helper.
Return str: the string containing the value of the helper.
-
-
class
bip.hexrays.
CNodeExprInsn
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprInsn
but which inherit fromCNode
. Automatically created bybuildCNode()
-
class
bip.hexrays.
CNodeExprType
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprType
but which inherit fromCNode
. Automatically created bybuildCNode()
MemAccess Expression API¶
-
class
bip.hexrays.
CNodeExprMemAccess
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprMemAccess
but which inherit fromCNode
. Automatically created bybuildCNode()
-
class
bip.hexrays.
CNodeExprIdx
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprIdx
but which inherit fromCNode
. Automatically created bybuildCNode()
-
class
bip.hexrays.
CNodeExprMemref
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprMemref
but which inherit fromCNode
. Automatically created bybuildCNode()
-
mem
¶ Property which return a
HxCExpr
representing the object which is access by this expression.Returns: An operand of the expression, an object which inherit from HxCExpr
.
-
off
¶ Property which return the memory offset which is access by this expression. In practice this should be an offset in a structure or an enum.
Return int: The memory offset.
-
-
class
bip.hexrays.
CNodeExprMemptr
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprMemptr
but which inherit fromCNode
. Automatically created bybuildCNode()
-
access_size
¶ Property which return the size which is access by the derefencement of this pointer.
Returns: An int corresponding to the size acceded.
-
off
¶ Property which return the memory offset which is access by this expression. In practice this should be an offset in a structure or an enum.
Return int: The memory offset.
-
Unary Operation Expression API¶
-
class
bip.hexrays.
CNodeExprUnaryOperation
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprUnaryOperation
but which inherit fromCNode
. Automatically created bybuildCNode()
-
class
bip.hexrays.
CNodeExprPtr
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprPtr
but which inherit fromCNode
. Automatically created bybuildCNode()
-
access_size
¶ Property which return the size which is access by the derefencement of this pointer.
Returns: An int corresponding to the size acceded.
-
-
class
bip.hexrays.
CNodeExprFneg
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprFneg
but which inherit fromCNode
. Automatically created bybuildCNode()
-
class
bip.hexrays.
CNodeExprNeg
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprNeg
but which inherit fromCNode
. Automatically created bybuildCNode()
-
class
bip.hexrays.
CNodeExprCast
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprCast
but which inherit fromCNode
. Automatically created bybuildCNode()
-
ignore_cast
¶ Property which return the first child expression of this node cast which is not a cast. This is implemented for all
CNode
for allowing to quickly ignore cast (seeignore_cast()
). Multiple chained cast are handle.Returns: A CNodeExpr
which is not a cast.
-
-
class
bip.hexrays.
CNodeExprLnot
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprLnot
but which inherit fromCNode
. Automatically created bybuildCNode()
-
class
bip.hexrays.
CNodeExprBnot
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprBnot
but which inherit fromCNode
. Automatically created bybuildCNode()
-
class
bip.hexrays.
CNodeExprRef
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprRef
but which inherit fromCNode
. Automatically created bybuildCNode()
-
class
bip.hexrays.
CNodeExprPostinc
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprPostinc
but which inherit fromCNode
. Automatically created bybuildCNode()
-
class
bip.hexrays.
CNodeExprPostdec
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprPostdec
but which inherit fromCNode
. Automatically created bybuildCNode()
-
class
bip.hexrays.
CNodeExprPreinc
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprPreinc
but which inherit fromCNode
. Automatically created bybuildCNode()
-
class
bip.hexrays.
CNodeExprPredec
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprPredec
but which inherit fromCNode
. Automatically created bybuildCNode()
-
class
bip.hexrays.
CNodeExprSizeof
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprSizeof
but which inherit fromCNode
. Automatically created bybuildCNode()
Double Operation Expression API¶
-
class
bip.hexrays.
CNodeExprDoubleOperation
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprDoubleOperation
but which inherit fromCNode
. Automatically created bybuildCNode()
-
class
bip.hexrays.
CNodeExprComma
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprComma
but which inherit fromCNode
. Automatically created bybuildCNode()
-
class
bip.hexrays.
CNodeExprLor
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprLor
but which inherit fromCNode
. Automatically created bybuildCNode()
-
class
bip.hexrays.
CNodeExprLand
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprLand
but which inherit fromCNode
. Automatically created bybuildCNode()
-
class
bip.hexrays.
CNodeExprBor
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprBor
but which inherit fromCNode
. Automatically created bybuildCNode()
-
class
bip.hexrays.
CNodeExprXor
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprXor
but which inherit fromCNode
. Automatically created bybuildCNode()
-
class
bip.hexrays.
CNodeExprBand
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprBand
but which inherit fromCNode
. Automatically created bybuildCNode()
-
class
bip.hexrays.
CNodeExprEq
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprEq
but which inherit fromCNode
. Automatically created bybuildCNode()
-
class
bip.hexrays.
CNodeExprNe
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprNe
but which inherit fromCNode
. Automatically created bybuildCNode()
-
class
bip.hexrays.
CNodeExprSge
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprSge
but which inherit fromCNode
. Automatically created bybuildCNode()
-
class
bip.hexrays.
CNodeExprUge
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprUge
but which inherit fromCNode
. Automatically created bybuildCNode()
-
class
bip.hexrays.
CNodeExprSle
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprSle
but which inherit fromCNode
. Automatically created bybuildCNode()
-
class
bip.hexrays.
CNodeExprUle
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprUle
but which inherit fromCNode
. Automatically created bybuildCNode()
-
class
bip.hexrays.
CNodeExprSgt
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprSgt
but which inherit fromCNode
. Automatically created bybuildCNode()
-
class
bip.hexrays.
CNodeExprUgt
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprUgt
but which inherit fromCNode
. Automatically created bybuildCNode()
-
class
bip.hexrays.
CNodeExprSlt
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprSlt
but which inherit fromCNode
. Automatically created bybuildCNode()
-
class
bip.hexrays.
CNodeExprUlt
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprUlt
but which inherit fromCNode
. Automatically created bybuildCNode()
-
class
bip.hexrays.
CNodeExprSshr
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprSshr
but which inherit fromCNode
. Automatically created bybuildCNode()
-
class
bip.hexrays.
CNodeExprUshr
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprUshr
but which inherit fromCNode
. Automatically created bybuildCNode()
-
class
bip.hexrays.
CNodeExprShl
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprShl
but which inherit fromCNode
. Automatically created bybuildCNode()
-
class
bip.hexrays.
CNodeExprAdd
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprAdd
but which inherit fromCNode
. Automatically created bybuildCNode()
-
class
bip.hexrays.
CNodeExprSub
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprSub
but which inherit fromCNode
. Automatically created bybuildCNode()
-
class
bip.hexrays.
CNodeExprMul
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprMul
but which inherit fromCNode
. Automatically created bybuildCNode()
-
class
bip.hexrays.
CNodeExprSdiv
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprSdiv
but which inherit fromCNode
. Automatically created bybuildCNode()
-
class
bip.hexrays.
CNodeExprUdiv
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprUdiv
but which inherit fromCNode
. Automatically created bybuildCNode()
-
class
bip.hexrays.
CNodeExprSmod
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprSmod
but which inherit fromCNode
. Automatically created bybuildCNode()
-
class
bip.hexrays.
CNodeExprUmod
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprUmod
but which inherit fromCNode
. Automatically created bybuildCNode()
-
class
bip.hexrays.
CNodeExprFadd
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprFadd
but which inherit fromCNode
. Automatically created bybuildCNode()
-
class
bip.hexrays.
CNodeExprFsub
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprFsub
but which inherit fromCNode
. Automatically created bybuildCNode()
-
class
bip.hexrays.
CNodeExprFmul
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprFmul
but which inherit fromCNode
. Automatically created bybuildCNode()
-
class
bip.hexrays.
CNodeExprFdiv
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprFdiv
but which inherit fromCNode
. Automatically created bybuildCNode()
Assignment¶
-
class
bip.hexrays.
CNodeExprAssignment
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprAssignment
but which inherit fromCNode
. Automatically created bybuildCNode()
-
dst
¶ Helper property which return the destination of the assignment.
This is just a wrapper on top of
first_op()
.Returns: The first operand of the expression, an object which inherit from HxCExpr
.
-
src
¶ Helper property which return the source of the assignment.
This is just a wrapper on top of
second_op()
.Returns: The second operand of the expression, an object which inherit from HxCExpr
.
-
-
class
bip.hexrays.
CNodeExprAsg
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprAsg
but which inherit fromCNode
. Automatically created bybuildCNode()
-
class
bip.hexrays.
CNodeExprAsgbor
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprAsgbor
but which inherit fromCNode
. Automatically created bybuildCNode()
-
class
bip.hexrays.
CNodeExprAsgxor
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprAsgxor
but which inherit fromCNode
. Automatically created bybuildCNode()
-
class
bip.hexrays.
CNodeExprAsgband
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprAsgband
but which inherit fromCNode
. Automatically created bybuildCNode()
-
class
bip.hexrays.
CNodeExprAsgadd
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprAsgadd
but which inherit fromCNode
. Automatically created bybuildCNode()
-
class
bip.hexrays.
CNodeExprAsgsub
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprAsgsub
but which inherit fromCNode
. Automatically created bybuildCNode()
-
class
bip.hexrays.
CNodeExprAsgmul
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprAsgmul
but which inherit fromCNode
. Automatically created bybuildCNode()
-
class
bip.hexrays.
CNodeExprAsgsshr
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprAsgsshr
but which inherit fromCNode
. Automatically created bybuildCNode()
-
class
bip.hexrays.
CNodeExprAsgushr
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprAsgushr
but which inherit fromCNode
. Automatically created bybuildCNode()
-
class
bip.hexrays.
CNodeExprAsgshl
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprAsgshl
but which inherit fromCNode
. Automatically created bybuildCNode()
-
class
bip.hexrays.
CNodeExprAsgsdiv
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprAsgsdiv
but which inherit fromCNode
. Automatically created bybuildCNode()
-
class
bip.hexrays.
CNodeExprAsgudiv
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprAsgudiv
but which inherit fromCNode
. Automatically created bybuildCNode()
-
class
bip.hexrays.
CNodeExprAsgsmod
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprAsgsmod
but which inherit fromCNode
. Automatically created bybuildCNode()
-
class
bip.hexrays.
CNodeExprAsgumod
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprAsgumod
but which inherit fromCNode
. Automatically created bybuildCNode()
Other leaf Expressions API¶
-
class
bip.hexrays.
CNodeExprTernary
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprTernary
but which inherit fromCNode
. Automatically created bybuildCNode()
-
cond
¶ Property which return the condition of the ternary expression.
Returns: An object which inherit from HxCExpr
.
-
-
class
bip.hexrays.
CNodeExprCall
(cexpr, hxcfunc, parent)¶ Copy of
HxCExprCall
but which inherit fromCNode
. Automatically created bybuildCNode()
-
_carglist
¶ Property which return the
carglist_t
from IDA.
-
_get_carg
(num)¶ Internal function which give access to the argument at position number
num
. There is no check on the value of num.
-
args
¶ Property which return the args of the call. Those args are also expressions.
Returns: A list of HxCExpr
.
-
args_iter
¶ Property which return an iterator on the args of the call. This is similar to
args()
but with an iterator, and should have more perf.
-
caller
¶ Property which return the caller of this expression. The caller is also an expression.
Returns: An object which inherit from HxCExpr
.
-
caller_addr
¶ Property which return the address called by this
CNodeExprCall
if it exist.This property ignore the cast.
Returns: An integer corresponding to the address called or None
if the caller is not aCNodeExprObj
node.
-
caller_func
¶ Property which return the
BipFunction
called by thisCNodeExprCall
if it exist.This property ignore the cast and works only for function in the binary. If this function is not able to create the
BipFunction
None
will be returned (in particular this will not work for the imported function).Returns: The BipFunction
called by this node or None if it was not able to get it.
-
get_arg
(num)¶ Function which return one of the argument of the call to a function. Each argument is also an expression.
Parameters: num (int) – The argument number. Raises: ValueError – if num
is superior to the number of arguments in the call expression.Returns: An object which inherit from HxCExpr
.
-
get_arg_intval
(argnum)¶ Method for getting the integer value used for an argument at a given position. This allows to quickly get the value of an argument which is an address (
CNodeExprObj
) or an integer (CNodeExprNum
), this function will returnNone
for all other case.This property ignore the cast.
Parameters: argnum (int) – The argument number for which to get the value. Raises: ValueError – If argument at position argnum
does not exist.Returns: The number or address passed in that argument or None if a number could not be found.
-
is_helper
¶ Property which return true if this function is a decompiler helper function.
Returns: A bool indicating if this is a helper function (true) or a “real” call.
-
number_args
¶ Property which return the number of arguments pass to the call expresion.
Return int: The number of argument to the call expression.
-
Final Statement API¶
-
class
bip.hexrays.
CNodeStmtFinal
(cinsn, hxcfunc, parent)¶ Copy of
HxCStmtFinal
but which inherit fromCNode
. Automatically created bybuildCNode()
-
__str__
()¶ Surcharge for printing a HxCExprFinal.
-
value
¶ Property which return the value of a final expression. This is abstract and if not overwritten it will raise a
RuntimeError
.
-
-
class
bip.hexrays.
CNodeStmtEmpty
(cinsn, hxcfunc, parent)¶ Copy of
HxCStmtEmpty
but which inherit fromCNode
. Automatically created bybuildCNode()
-
class
bip.hexrays.
CNodeStmtExpr
(cinsn, hxcfunc, parent)¶ Copy of
HxCStmtExpr
but which inherit fromCNode
. Automatically created bybuildCNode()
-
class
bip.hexrays.
CNodeStmtGoto
(cinsn, hxcfunc, parent)¶ Copy of
HxCStmtGoto
but which inherit fromCNode
. Automatically created bybuildCNode()
-
cnode_dst
¶ Property which return the
CNode
which is the destination of thegoto
. This is not a child node, but a link to on other part of the AST.
-
label
¶ Property which return the label number of the goto statement.
Returns: An integer representing the label number.
-
-
class
bip.hexrays.
CNodeStmtAsm
(cinsn, hxcfunc, parent)¶ Copy of
HxCStmtAsm
but which inherit fromCNode
. Automatically created bybuildCNode()
-
addr_instr
¶ Property which return a list of address corresponding to the ASM instruction which are inline.
Returns: A list of address (integer) representing the address of the inline assembly instruction in the binary.
-
length
¶ Property which return the number of instruction in this ASM statement.
-
-
class
bip.hexrays.
CNodeStmtReturn
(cinsn, hxcfunc, parent)¶ Copy of
HxCStmtReturn
but which inherit fromCNode
. Automatically created bybuildCNode()
Loop Statement API¶
-
class
bip.hexrays.
CNodeStmtLoop
(cinsn, hxcfunc, parent)¶ Copy of
HxCStmtLoop
but which inherit fromCNode
. Automatically created bybuildCNode()
-
class
bip.hexrays.
CNodeStmtFor
(cinsn, hxcfunc, parent)¶ Copy of
HxCStmtFor
but which inherit fromCNode
. Automatically created bybuildCNode()
-
cond
¶ Property which return the expression used as a condition for the for.
Returns: An object which inherits from HxCExpr
.
-
init
¶ Property which return the expression for the initialization of the for loop.
Returns: An object which inherits from HxCExpr
.
-
-
class
bip.hexrays.
CNodeStmtWhile
(cinsn, hxcfunc, parent)¶ Copy of
HxCStmtWhile
but which inherit fromCNode
. Automatically created bybuildCNode()
-
class
bip.hexrays.
CNodeStmtDoWhile
(cinsn, hxcfunc, parent)¶ Copy of
HxCStmtDoWhile
but which inherit fromCNode
. Automatically created bybuildCNode()
Other leaf Statement API¶
-
class
bip.hexrays.
CNodeStmtIf
(cinsn, hxcfunc, parent)¶ Copy of
HxCStmtIf
but which inherit fromCNode
. Automatically created bybuildCNode()
-
cond
¶ Property which return the expression used as a condition for the if.
Returns: An object which inherits from HxCExpr
.
-
has_else
¶ Property which indicate if this if statement as an else condtion.
Returns: True if this statement has an else condition, False otherwise.
-
st_else
¶ Property which return the executed if the condition (
cond()
) is False.This property will return
None
if this condition has no else statement. This can be tested by checkinghas_else()
.Returns: An object which inherits from HxCStmt
.
-
-
class
bip.hexrays.
CNodeStmtSwitch
(cinsn, hxcfunc, parent)¶ Copy of
HxCStmtSwitch
but which inherit fromCNode
. Automatically created bybuildCNode()
-
cases_val
¶ Property which return the list of values for each statement. This list is in the same order as the list of statement return by
st_cases()
.As each case can have several values for triggering it, this property return a list of list of values.
Returns: A list of lists of values (int), each list correspond to a different case and contain the values which will make the code enter this path. An empty list means it the default case.
-
expr
¶ Property which return the expression used as the switch expression.
Returns: An object which inherits from HxCExpr
.
-
max_val
¶ Property which return the case maximum value for the switch.
Returns: An integer which is the maximum case value for the switch.
-
-
class
bip.hexrays.
CNodeStmtContinue
(cinsn, hxcfunc, parent)¶ Copy of
HxCStmtContinue
but which inherit fromCNode
. Automatically created bybuildCNode()
-
class
bip.hexrays.
CNodeStmtBreak
(cinsn, hxcfunc, parent)¶ Copy of
HxCStmtBreak
but which inherit fromCNode
. Automatically created bybuildCNode()
-
class
bip.hexrays.
CNodeStmtBlock
(cinsn, hxcfunc, parent)¶ Copy of
HxCStmtBlock
but which inherit fromCNode
. Automatically created bybuildCNode()
Methods specific to CNode implementation¶
This list the methods which exist only in the implementation of
the CNode
and not in the HxCItem
.
Those methods are documented correctly in their respective class, they are
listed here only as an easy way to see functionnality which are
CNode
specific. Access to parent
HxCFunc
and parent node are not listed here.
Internal Hexrays Visitor API¶
-
bip.hexrays.cnode_visitor.
visit_dfs_cnode
(cnode, callback)¶ Basic visitor for a CNode: this will allow to call a callback on every node under the current one (and including the current node) in the AST. This method does not used the visitor from hexrays (
ctree_visitor_t
). The callback will receive aCNode
in argument.This visitor implements a Deep-First Search (DFS) algorithm which will always visit first the
CNodeExpr
and then theCNodeStmt
. The callback is called before visiting deeper. For an object which inherit fromCNodeExpr
the child nodes will be called in the same order than returned byops()
; for an object which inherit fromCNodeStmt
the child nodes will be called in the same order than returned byexpr_children()
(expression) follow by the nodes in the same order asstmt_children()
(statements).If the callback return
False
the visitor will stop. Every other result is ignore.Note
This function will not visit a statement which is under a
CNodeExprInsn
. Those should not be present in the last stage of a ctree and so this should not be a problem.An exception raised by the callback will interupt the visitor.
Parameters: - cnode – An object which inherit from
CNode
. This object and all its child will be visited. - callback – A callable taking one argument which will be called
on all the
CNode
visited with theCNode
as argument. If it returns False the visitor stops.
- cnode – An object which inherit from
-
bip.hexrays.cnode_visitor.
visit_dfs_cnode_filterlist
(cnode, callback, filter_list)¶ Visitor for
CNode
with filtering. This function is the same thanvisit_dfs_cnode()
but allow to use the callback only onCNode
which are in a list (white listing of the node to visit).For information about the visitor implementation see
visit_dfs_cnode()
. If the filter_list parameter contain only statement (CNodeStmt
) the expression will not be visited at all, this should allow a little performance gain.If the callback return
False
the visitor will stop. Every other result is ignore.Parameters: - cnode – An object which inherit from
CNode
. This object and all its child will be visited. - callback – A callable taking one argument which will be called
on all the
CNode
visited with theCNode
as argument. - filter_list – A list or tuple of class or a class which inherit
from
CNode
. The callback will be called only for the node from a class in this list. If it returns False the visitor stops.
- cnode – An object which inherit from
CNode generation and internals¶
This description explains how the CNode
subclasses are
created and is mainly destined to developers and maintainers of Bip.
For avoiding code duplication most classes which inherit
from CNode
are created dynamically from their equivalent
HxCItem
(the direct wrapper on the IDA implementation).
The classes for both representation will have mainly the same attributes and
the same method. When generating the CNode
subclasses
the names for the classes are generated by replacing the HxC
prefix by
the CNode
prefix, for example HxCExprAdd
will become
CNodeExprAdd
.
Three classes are not generated dynamically. The CNode
class (equivalent to HxCItem
) which contains the added
method and attributes which are specific to this implementation, this is the
main based abstract class for all of this implementation. Both
CNode
and HxCItem
inherit from
the AbstractCItem
abstract class which contains most
of the code common to those two classes. The CNodeExpr
(equivalent to HxCExpr
) and
CNodeStmt
(equivalent to HxCStmt
)
classes are not generated dynamically mainly because their constructors must
be changed.
All other subclasses of CNode
are created dynamically
using the buildCNode()
class decorator. This
decorator is used on all the HxCItem
subclasses and
for each class it is used on it will create the equivalent
CNode
subclasses. For doing that the following steps are
taken:
- recreating the architecture of inheritance for the new class,
- performing a copy of the attributes of the base class and modifying the
__doc__
and__module__
, - creating the name for the new class (replace
HxC
byCNode
prefix), - adding methods which are specific to the CNode version of the implementation if any,
- creating the actual new class,
- registering the new class in the corresponding module globals
(
bip.hexrays.cnode
accessible for a user directly frombip.hexrays
or frombip
) for being able to access it later on, - registering the new class for being able to create the equivalent when rebuilding the inheritance.
For being able to rebuild the inheritance of the class it is necessary to
keep an equivalence between the HxCItem
subclasses and
the CNode
ones. This equivalence is stored in the
_citem2cnode
global dictionary and updated each
time a new class is created by the bip.hexrays.cnode.buildCNode()
decorator (first and last step of the previous algorithm).
Note
The system of using bip.hexrays.cnode.buildCNode()
as a
decorator may be changed in the future as a metaclass is probably more
appropriate for this.
For being able to add new methods to a CNode
subclass,
another decorator exists: addCNodeMethod()
. This
decorator take in argument a string representing the name of the CNode
subclasses the method should be added and an optional second argument
which allow to specify a different name for the class method than the one
the function decorated has. This decorator will simply add the
method in the _cnodeMethods
global array which
will then be used by the buildCNode()
decorator for
adding the methods and properties at the class creation. Because of the way
this work it is necessary for all specific methods to be created before
the actual class creation. Presently, because the number of specific methods
is quite small, those methods are directly at the end of the cnode.py
file.
Internal generation API¶
Those functions are not currently exported by Bip, and are documented for internal use only:
-
bip.hexrays.cnode.
buildCNode
(cls)¶ Class decorator for automatically building a class equivalent to the one pass in argument but which inherit from
CNode
instead ofHxCItem
.Internally this will:
- find the equivalent of the base classes by looking
in
_citem2cnode
. - create a class identicall to the one in arguments but with name
change for being prefix by
CNode
instead ofHxC
. Attributes of the class are copied into the new class. - set the new class created as global to this module (the cnode one, not the one it was used in).
- find the equivalent of the base classes by looking
in
-
bip.hexrays.cnode.
addCNodeMethod
(cnode_name, func_name=None)¶ Decorator for a function, allow to add a method to a CNode class. This is for supporting to add method specific to a CNode which are not implemented (probably because it is not possible to do so) in their equivalent HxCItem class. This is design to be used in conjonction with the
buildCNode()
decorator, methods which are added this way should be done before calling it. If the method already exist it will be overwrite by this implementation, this allow to redefine base methods from the HxCExpr. Internally this use the_cnodeMethods
global dictionary.It is possible to add properties using this method, if no
func_name
parameter is provided the name of the getter will be taken (and so the property must have a getter name). It is possible to useproperty
as a decorator but this will work only for getter:@addCNodeMethod(myclassname) @property #order of those decorator is important def my_new_property(self): """ Documentation will be correctly seen when generating the doc. """ pass # THE CODE
Todo
correctly handle all property decorators
Warning
All methods/properties decorated by this functions should be defined before the creation of the corresponding CNode! Currently the simplest way to do this is by adding it at the end of the
cnode.py
files.Parameters: - cnode_name (str) – The name of the CNode class to which add the property.
- func_name (str) – The name to use for adding to the CNode class, if None the name of the function will be used.
-
bip.hexrays.cnode.
_cnodeMethods
¶ Dictionary which allows to add method to a particular CNode implementation. This is used by
addCNodeMethod()
for adding a method in a CNode class which does not exist (is not possible to implement) in the HxCItem class equivalent. When the object is created bybuildCNode
the method will be added.This dictionary as the name of the class for key, and a parameter a list of tuples. Each tuple consist of the name of the method as first element follow by the function object.
-
bip.hexrays.cnode.
_citem2cnode
¶ Dictionary which contain an equivalence between the class which inherit from
HxCItem
and the one which inherit fromCNode
. This is used for automatically constructing the classes which inherit fromCNode
dynamically and should not be modified by hand. It is initialized with the 3 base classes which have a constructor.


Prerequisites
- [ ] I have searched for similar issues in both open and closed tickets and cannot find a duplicate
- [ ] The issue still exists against the latest
master
branch of Select2
- [ ] This is not a usage question (Those should be directed to the community)
- [ ] I have attempted to find the simplest possible steos to reproduce the issue
- [ ] I have included a failing test as a pull request (Optional)
Steps to reproduce the issue
1.
2.
3.
Expected behavior and actual behavior
When I follow those steps, I see...
I was expecting...
Environment
Browsers
- [ ] Google Chrome
- [ ] Mozilla Firefox
- [ ] Internet Explorer
Operating System
- [ ] Windows
- [ ] Mac OS X
- [ ] Linux
- [ ] Mobile
Libraries
- jQuery version:
- Select2 version:
Isolating the problem
- [ ] This bug happens on the examples page
- [ ] The bug happens consistently across all tested browsers
- [ ] This bug happens when using Select2 without other pluigns
- [ ] I can reproduce this bug in a jsbin


{% if original.moderated == 'spam' %}
{% blocktrans with moderated_by=original.moderated_by %}
The comment has been marked as spam by {{ moderated_by }}
{% endblocktrans %}
{% elif original.moderated and original.published %}
{% blocktrans with moderated_by=original.moderated_by moderated=original.get_moderated_display.lower %}
The comment has been {{ moderated }} by {{ moderated_by }}
{% endblocktrans %}
{% endif %}
{% trans "Written by" %}
{{ original.author }}{{ original.created_at|timesince }}
{% trans "ago" %}
{% if original.is_edited %}
(and edited {{ original.updated_at|timesince }}
{% trans "ago" %})
{% endif %}


Your browser does not support JavaScript! For full functionality of this site it is necessary to enable JavaScript. Here are the
instructions how to enable JavaScript in your web browser
.


Various utilities. More...
#include "bit.h"
#include "board.h"
#include "move.h"
#include "util.h"
#include "options.h"
#include "const.h"
#include <assert.h>
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <errno.h>
#include <string.h>
#include <stdbool.h>
#include <signal.h>
#include <time.h>
Functions | |
| void | time_print (long long t, bool justified, FILE *f) |
| Print time as "D:HH:MM:SS.CC". | |
| long long | time_read (FILE *f) |
| read time as "D:HH:MM:SS.C". | |
| void | time_stamp (FILE *f) |
| Print local time. | |
| void | relax (int t) |
| sleep for t ms. | |
| char * | format_scientific (double v, const char *unit, char *f) |
| Format a value with a unit. | |
| void | print_scientific (double v, const char *unit, FILE *f) |
| Print a value with a unit. | |
| char * | string_read_line (FILE *f) |
| Read a line. | |
| char * | string_duplicate (const char *s) |
| Duplicate a string. | |
| long long | string_to_time (const char *string) |
| Read time as "D:HH:MM:SS.C". | |
| void | string_to_lowercase (char *s) |
| Change all char of a string to lowercase. | |
| void | string_to_uppercase (char *s) |
| Change all char of a string to uppercase. | |
| int | string_to_coordinate (const char *s) |
| Convert the two first chars of a string into a coordinate. | |
| char * | string_to_word (char *s) |
| remove spaces from a string. | |
| bool | string_to_boolean (const char *s) |
| Convert a string into a boolean. | |
| int | string_to_int (const char *s, const int default_value) |
| Convert a string into an integer. | |
| double | string_to_real (const char *s, const double default_value) |
| Convert a string into a real number. | |
| char * | parse_skip_spaces (const char *string) |
| Skip spaces. | |
| char * | parse_skip_word (const char *string) |
| Skip word. | |
| char * | parse_find (const char *string, const int c) |
| Find a char. | |
| char * | parse_word (const char *string, char *word, unsigned int n) |
| Parse a word. | |
| char * | parse_field (const char *string, char *word, unsigned int n, char separator) |
| Parse a field. | |
| char * | parse_line (const char *string, char *line, unsigned int n) |
| Parse a line. | |
| char * | parse_move (const char *string, const Board *board, Move *move) |
| Parse a move. | |
| char * | parse_game (const char *string, const Board *board_init, Line *line) |
| Parse a sequence of moves. | |
| char * | parse_board (const char *string, Board *board, int *player) |
| Parse a board. | |
| char * | parse_boolean (const char *string, bool *result) |
| Parse a boolean. | |
| char * | parse_int (const char *string, int *result) |
| Parse an integer. | |
| char * | parse_real (const char *string, double *result) |
| Parse a real number (as a double floating point). | |
| char * | parse_time (const char *string, long long *t) |
| parse time as "D:HH:MM:SS.C". | |
| char * | parse_command (const char *string, char *cmd, char *param, const unsigned int size) |
| Parse a command. | |
| void | path_get_dir (const char *path, char *dir) |
| Extract the directory of a file path. | |
| char * | file_add_ext (const char *base, const char *ext, char *file) |
| Add an extension to a string. | |
| void | thread_create (Thread *thread, void *(*function)(void *), void *data) |
| Create a thread. | |
| void | thread_join (Thread thread) |
| Join a thread. | |
| Thread | thread_self (void) |
| Current thread. | |
| void | thread_set_cpu (Thread thread, int i) |
| Choose a single core or cpu to run on, under linux systems, to avoid context changes. | |
| int | get_cpu_number (void) |
| Get the number of cpus or cores on the machine. | |
| unsigned long long | random_get (Random *random) |
| Pseudo-random number generator. | |
| void | random_seed (Random *random, const unsigned long long seed) |
| Pseudo-random number seed. |
Variables | |
| long long(* | time_clock )(void) = real_clock |
| Time clock. |
Various utilities.
This should be the only file with linux/windows dedicated code.
| char* file_add_ext | ( | const char * | base, |
| const char * | ext, | ||
| char * | file | ||
| ) |
Add an extension to a string.
| base | Base name. |
| ext | Extension (.dat, .ext, .bin, etc.) |
| file | Output file name. |
| char* format_scientific | ( | double | v, |
| const char * | unit, | ||
| char * | f | ||
| ) |
Format a value with a unit.
| v | Value to print. |
| unit | Unit. |
| f | Output string. |
| int get_cpu_number | ( | void | ) |
Get the number of cpus or cores on the machine.
| char* parse_board | ( | const char * | string, |
| Board * | board, | ||
| int * | player | ||
| ) |
Parse a board.
| string | String to parse |
| board | Board. |
| player | Player to move color. |
| char* parse_boolean | ( | const char * | string, |
| bool * | result | ||
| ) |
Parse a boolean.
| string | String to parse |
| result | Boolean output value. |
| char* parse_command | ( | const char * | string, |
| char * | cmd, | ||
| char * | param, | ||
| const unsigned int | size | ||
| ) |
Parse a command.
| string | String to parse. |
| cmd | Output command string (first word of the input string). |
| param | Output parameters (remaining of the line). |
| size | cmd string capacity. |
| char* parse_field | ( | const char * | string, |
| char * | word, | ||
| unsigned int | n, | ||
| char | separator | ||
| ) |
Parse a field.
| string | String to parse |
| word | String receiving a copy of the parsed word. |
| n | word string capacity. |
| separator | field separator. NOTE: It is assumed that w is big enough to contains the word copy. |
| char* parse_find | ( | const char * | string, |
| const int | c | ||
| ) |
Find a char.
| string | String to parse. |
| c | Seeked char. |
Parse a sequence of moves.
| string | String to parse. |
| board_init | Initial board from where to play the moves. |
| line | A move sequence. |
| char* parse_int | ( | const char * | string, |
| int * | result | ||
| ) |
Parse an integer.
| string | String to parse |
| result | Integer output value. |
| char* parse_line | ( | const char * | string, |
| char * | line, | ||
| unsigned int | n | ||
| ) |
Parse a line.
| string | string to parse |
| line | string receiving a copy of the parsed line. |
| n | line string capacity. NOTE: It is assumed that line is big enough to contains 'n' characters. if the line to be parsed contains more than 'n' characters, only 'n' caracters will be copied, but the whole line will be parsed. |
Parse a move.
| string | String to parse |
| board | Board where to play the move. |
| move | A move. |
| char* parse_real | ( | const char * | string, |
| double * | result | ||
| ) |
Parse a real number (as a double floating point).
| string | String to parse. |
| result | Real number (double) output value. |
| char* parse_skip_spaces | ( | const char * | string | ) |
Skip spaces.
| string | String to parse. |
| char* parse_skip_word | ( | const char * | string | ) |
Skip word.
| string | String to parse. |
| char* parse_time | ( | const char * | string, |
| long long * | t | ||
| ) |
parse time as "D:HH:MM:SS.C".
| string | Time as a string. |
| t | Output time in milliseconds. |
| char* parse_word | ( | const char * | string, |
| char * | word, | ||
| unsigned int | n | ||
| ) |
Parse a word.
| string | String to parse |
| word | String receiving a copy of the parsed word. |
| n | word string capacity. NOTE: It is assumed that w is big enough to contains the word copy. |
| void path_get_dir | ( | const char * | path, |
| char * | dir | ||
| ) |
Extract the directory of a file path.
| path | Full path. |
| dir | directory part of the path. |
| void print_scientific | ( | double | v, |
| const char * | unit, | ||
| FILE * | f | ||
| ) |
Print a value with a unit.
| v | Value to print. |
| unit | Unit. |
| f | Output stream. |
| unsigned long long random_get | ( | Random * | random | ) |
Pseudo-random number generator.
A good pseudo-random generator (derived from rand48 or Java's one) to set the hash codes.
| random | Pseudo-Random generator state. |
| void random_seed | ( | Random * | random, |
| const unsigned long long | seed | ||
| ) |
Pseudo-random number seed.
| random | Pseudo-Random generator state. |
| seed | a 64-bits integer used as seed. |
| void relax | ( | int | t | ) |
sleep for t ms.
| t | time in ms. |
| char* string_duplicate | ( | const char * | s | ) |
Duplicate a string.
| s | string to duplicate. |
| char* string_read_line | ( | FILE * | f | ) |
Read a line.
Read a line from an input string. The needed memory is allocated.
| f | Input stream. |
| bool string_to_boolean | ( | const char * | s | ) |
Convert a string into a boolean.
Parse a string into a boolean (false/true).
| s | String. |
| int string_to_coordinate | ( | const char * | s | ) |
Convert the two first chars of a string into a coordinate.
| s | String. |
| int string_to_int | ( | const char * | s, |
| const int | default_value | ||
| ) |
Convert a string into an integer.
Parse a string into an int.
| s | String. |
| default_value | default value if parsing failed. |
| void string_to_lowercase | ( | char * | s | ) |
Change all char of a string to lowercase.
| s | string. |
| double string_to_real | ( | const char * | s, |
| const double | default_value | ||
| ) |
Convert a string into a real number.
Parse a string into a double.
| s | String. |
| default_value | default value if parsing failed. |
| long long string_to_time | ( | const char * | string | ) |
Read time as "D:HH:MM:SS.C".
| string | Time as a string. |
| void string_to_uppercase | ( | char * | s | ) |
Change all char of a string to uppercase.
| s | Input string. |
| char* string_to_word | ( | char * | s | ) |
remove spaces from a string.
| s | string. |
| void thread_create | ( | Thread * | thread, |
| void *(*)(void *) | function, | ||
| void * | data | ||
| ) |
Create a thread.
| thread | Thread. |
| function | Function to run in parallel. |
| data | Data for the function. |
| void thread_join | ( | Thread | thread | ) |
Join a thread.
Wait for the thread termination. this function also frees the resources allocated by a thread that has not been detached.
| thread | Thread. |
| Thread thread_self | ( | void | ) |
Current thread.
| void thread_set_cpu | ( | Thread | thread, |
| int | i | ||
| ) |
Choose a single core or cpu to run on, under linux systems, to avoid context changes.
| void time_print | ( | long long | t, |
| bool | justified, | ||
| FILE * | f | ||
| ) |
Print time as "D:HH:MM:SS.CC".
| t | Time in milliseconds. |
| justified | add spaces or not before the text. |
| f | Stream. |
| long long time_read | ( | FILE * | f | ) |
read time as "D:HH:MM:SS.C".
| f | Input stream. |
| void time_stamp | ( | FILE * | f | ) |
Print local time.
| f | Output stream. |
| long long(* time_clock)(void) = real_clock |
Time clock.
Can be set as a real_clock or a cpu_clock.


LSF Daemons: (chart)
- LIM - Load Information Manager
master lim, receives load information from the LIMs running on hosts in the cluster periodically.
host lim, collects host load and configuration information and forwards it to the master LIM running on the master host. - MBD - Master Batch Daemon, running on the master host. Responsible for the overall state of jobs in the system. Receives job submission, and information query requests. Manages jobs held in queues. Dispatches jobs to hosts as determined by mbschd.
- MBSCHD - Master Batch Scheduler Daemon, running on the master host. Works with mbatchd. Makes scheduling decisions based on job requirements and policies.
- SBD - Slave Batch Daemon, running on each server host. Receives the request to run the job from mbatchd and manages local execution of the job. Responsible for enforcing local policies and maintaining the state of jobs on the host.
- RES - Remote Execution Server, running on each server host. Accepts remote execution requests to provide transparent and secure remote execution of jobs and tasks.
- PIM - Process Information Manager, running on each server host. Collects information about job processes running on the host such as CPU and memory used by the job, and reports the information to sbatchd.


Urls that start with one of the strings listed below are blocked. You can unblock urls by starting a line with a # character.


ASTWriter
Errcode: 404
Errtext: Existential Crisis!
Let's go to Home!
Copyright ©
XinYaanZyoy(心言自由) The Helper Boy


---
layout: post
title: 'Clay Loveless: Failure Is Not An Option'
date: '2011-04-22T23:27:16-07:00'
tags:
tumblr_url: http://alexhwilliams.tumblr.com/post/4859630690/clay-loveless-failure-is-not-an-option
---
Clay Loveless: Failure Is Not An Option
Gene Kranz was 37 years old when Apollo 13, the space mission he served on as lead Flight Director, launched. A few days after takeoff, the Apollo 13 Service Module exploded, jeopardizing the lives of the three astronauts on board. While he never used the phrase “Failure Is Not An…


I'm working on the world,
revised, improved edition,
featuring fun for fools,
blues for brooders,
combs for bald pates,
tricks for old dogs.
Here's one chapter: The Speech
of Animals and Plants.
Each species comes, of course,
with its own dictionary.
Even a simple "Hi there,"
when traded with a fish,
make both the fish and you
feel quite extraordinary.
The long-suspected meanings
of rustlings, chirps, and growls!
Soliloquies of forests!
The epic hoot of owls!
Those crafty hedgehogs drafting
aphorisms after dark,
while we blindly believe
they are sleeping in the park!
Time retains
its sacred right to meddle
in each earthly affair.

Old age is, in my book,
the price that felons pay,
so don't whine that it's steep:
you'll stay young if you're good.
Suffering doesn't insult the body.
Death? It comes in your sleep,
exactly as it should.
When it comes, you'll be dreaming
that you don't need to breathe;
that breathless silence is
the music of the dark
and it's part of the rhythm
to vanish like a spark.
Only a death like that. A rose
could prick you harder, I suppose;
you'd feel more terror at the sound
of petals falling to the ground.
Only a world like that. To die
just that much. And to live just so.
And all the rest is Bach's fugue, played
for the time being
on a saw.


Unstaged Changes
Staged Changes
Commit
Push
Name
Last commit
Options
Fetch from tracking branch
Checkout
Cancel
Name
Last commit
Options
Force deletion (do not perform merge check)
Delete
Cancel
Options
Checkout branch
Create
Cancel
Select remote:
Options
Include tags
Push
Cancel
Top committers
Options
All
Exclude merges
Only merges
Limit:
Commit count
Name
Email
x
Open repository


Montana, Jehovah’s Witness settle discrimination complaint
BILLINGS, Mont. (AP) - The state of Montana has agreed to pay some of an inmate’s attorney fees and have a prison warden undergo religion rights training to settle a discrimination complaint.
The Billings Gazette reported Wednesday that the state Department of Corrections settled with Montana Women’s Prison inmate May Simmons in October.
Simmons said the prison failed to grant her full access to worship services as a Jehovah’s Witness.
The state Human Rights Bureau says the department likely violated the law by denying Simmons use of the prison chapel while permitting its use for other religions.
An agreement copy released this week says the state would pay $4,400 in fees to attorney Eric Holm and $1,000 to Simmons.
It also requires the prison to provide training and an internal analysis by February.
Information from: The Billings Gazette, http://www.billingsgazette.com
Sign up for Daily Newsletters
Copyright © 2019 The Washington Times, LLC.
Please read our comment policy before commenting.


Half Of Australian Kids Use A Mobile Phone
by Elliot NashHalf of the Australian children aged 6 to 13 own or use a mobile phone, according to new research showing that kids are becoming increasingly more digital.
Analysis of data from the Australian Communication and Media Authority (ACMA) by Roy Morgan shows that in 2018, 32% of kids owned a mobile phone with another 16% having access to one, but not owning the phone.
In fact, one in four kids between the ages of 6 and 7 had or used a mobile phone, bringing rise to an even more interconnected Australia.
That being said, 52% of children neither own nor have access to a mobile phone.
It comes as TCL enters into the kid’s smartwatch market with its TCL MOVETIME Family Watch (MT40) that allows for voice and video calling, GPS tracking and geofencing alerts for parental peace of mind.
However, the MT40 is positioned as a compelling option for parents wanting to stay connected and monitor their children’s movements at a distance, without needing to give their child a mobile phone.
ACMA Chair Nerida O’Loughlin said, ‘Australia is becoming a more connected society, and that trend is being driven by an increase in mobile devices, even amongst our children’.
According to the research, girls had the most significant access to mobile phones, with 50% aged 6 to 13 owning or having access, compared to 46% of boys.
NSW and the ACT had the highest access levels, with 52% of kids in both areas owning or having access to a mobile, up from 44% in 2013.
To no one’s surprise, the most common use for mobile phones for kids is to play games, with 70% of children using a phone for video games alone.
67% of children used phones to take photos, 57% used it for calling their parents or family, and 64% used other non-gaming apps.


I have carefully taken into consideration about team name before choosing one for the whole team. I have come into an understanding that a team name has to reflect a workgroup where every individual in the team is different and each of our ideas will be as well. So I have chosen a name that will most likely describe a team full of unique personalities: The Colors. “The Colors” has a very special meaning to it. Just like colors, it consists of members whose ideas are very original and creative. But not only that, it also shows that each person will have their own unique talent, and will be able to contribute differently to current and future team projects.
I was able to find myself a team of amazing people with unique personalities and talents. It seems that my personality fits with them as well. To my surprise, there are a total of three Turbulent Mediators (including me), and there is a Debater as well. That means that there are people who think just like me, and working with other Mediators will strengthen what this special personality has for me: thoughtful, open-minded, creative, and passionate. Working with a Debater will gain the team a big advantage, because they are quick thinkers who are very flexible with ideas and are very knowledgeable with new concepts, which will help each member develop with their own ideas.


Atom 0.3 Support Deprecated
12:45 AM on Thursday, September 15, 2005
Two months after the IETF Atom syndication format specification was declared ready for implementation (more), deprecation warnings have been put in place for all prior versions of Atom, including 0.3. While feeds that previously worked with a given combination of tools yesterday will presumably continue to work with the same combination of tools tomorrow, producers of feeds are being encouraged to step up to the IETF standard.
As always, feel free to join us on the feedvalidator-users discussion list.


Menu
Tyler Magpuri
Redesign
Animation
LSS
Gallery
Tyler?
Tyler
Magpuri.
UX/
Product
Design.
Redesign
Animation
LSS
Gallery
Tyler?


| Interface and Description |
|---|
| oracle.ateam.sample.mobile.persistence.metadata.MethodHeaderParameter
Use the class with same name in oracle.ateam.sample.mobile.v2.persistence.* instead
|
| oracle.ateam.sample.mobile.persistence.metadata.MethodParameter
Use the class with same name in oracle.ateam.sample.mobile.v2.persistence.* instead
|
| oracle.ateam.sample.mobile.persistence.manager.PersistenceManager
Use the class with same name in oracle.ateam.sample.mobile.v2.persistence.* instead
|
| oracle.ateam.sample.mobile.persistence.manager.RemotePersistenceManager
Use the class with same name in oracle.ateam.sample.mobile.v2.persistence.* instead
|
| oracle.ateam.sample.mobile.persistence.service.ValueHolderInterface
Use the class with same name in oracle.ateam.sample.mobile.v2.persistence.* instead
|
| Class and Description |
|---|
| oracle.ateam.sample.mobile.persistence.manager.AbstractPersistenceManager
Use the class with same name in oracle.ateam.sample.mobile.v2.persistence.* instead
|
| oracle.ateam.sample.mobile.persistence.manager.AbstractRemotePersistenceManager
Use the class with same name in oracle.ateam.sample.mobile.v2.persistence.* instead
|
| oracle.ateam.sample.mobile.persistence.metadata.AttributeMapping
Use the class with same name in oracle.ateam.sample.mobile.v2.persistence.* instead
|
| oracle.ateam.sample.mobile.persistence.metadata.AttributeMappingDirect
Use the class with same name in oracle.ateam.sample.mobile.v2.persistence.* instead
|
| oracle.ateam.sample.mobile.persistence.metadata.AttributeMappingOneToMany
Use the class with same name in oracle.ateam.sample.mobile.v2.persistence.* instead
|
| oracle.ateam.sample.mobile.persistence.metadata.AttributeMappingOneToOne
Use the class with same name in oracle.ateam.sample.mobile.v2.persistence.* instead
|
| oracle.ateam.sample.mobile.persistence.db.BindParamInfo
Use the class with same name in oracle.ateam.sample.mobile.v2.persistence.* instead
|
| oracle.ateam.sample.mobile.persistence.model.ChangeEventSupportable
Use the class with same name in oracle.ateam.sample.mobile.v2.persistence.* instead
|
| oracle.ateam.sample.mobile.persistence.metadata.ClassMappingDescriptor
Use the class with same name in oracle.ateam.sample.mobile.v2.persistence.* instead
|
| oracle.ateam.sample.mobile.persistence.manager.DataControlPersistenceManager
Use the class with same name in oracle.ateam.sample.mobile.v2.persistence.* instead
|
| oracle.ateam.sample.mobile.persistence.service.DataSynchAction
Use the class with same name in oracle.ateam.sample.mobile.v2.persistence.* instead
|
| oracle.ateam.sample.mobile.persistence.service.DataSynchManager
Use the class with same name in oracle.ateam.sample.mobile.v2.persistence.* instead
|
| oracle.ateam.sample.mobile.persistence.service.DataSynchPayload
Use the class with same name in oracle.ateam.sample.mobile.v2.persistence.* instead
|
| oracle.ateam.sample.mobile.persistence.service.DataSynchronizer
Use the class with same name in oracle.ateam.sample.mobile.v2.persistence.* instead
|
| oracle.ateam.sample.mobile.persistence.db.DBConnectionFactory
Use the class with same name in oracle.ateam.sample.mobile.v2.persistence.* instead
|
| oracle.ateam.sample.mobile.persistence.manager.DBPersistenceManager
Use the class with same name in oracle.ateam.sample.mobile.v2.persistence.* instead
|
| oracle.ateam.sample.mobile.persistence.model.Entity
Use the class with same name in oracle.ateam.sample.mobile.v2.persistence.* instead
|
| oracle.ateam.sample.mobile.persistence.cache.EntityCache
Use the class with same name in oracle.ateam.sample.mobile.v2.persistence.* instead
|
| oracle.ateam.sample.mobile.persistence.service.EntityCRUDService
Use the class with same name in oracle.ateam.sample.mobile.v2.persistence.* instead
|
| oracle.ateam.sample.mobile.persistence.util.EntityUtils
Use the class with same name in oracle.ateam.sample.mobile.v2.persistence.* instead
|
| oracle.ateam.sample.mobile.persistence.service.IndirectList
Use the class with same name in oracle.ateam.sample.mobile.v2.persistence.* instead
|
| oracle.ateam.sample.mobile.util.MCSManager |
| oracle.ateam.sample.mobile.persistence.metadata.Method
Use the class with same name in oracle.ateam.sample.mobile.v2.persistence.* instead
|
| oracle.ateam.sample.mobile.persistence.metadata.MethodHeaderParameterImpl
Use the class with same name in oracle.ateam.sample.mobile.v2.persistence.* instead
|
| oracle.ateam.sample.mobile.persistence.metadata.MethodParameterImpl
Use the class with same name in oracle.ateam.sample.mobile.v2.persistence.* instead
|
| oracle.ateam.sample.mobile.persistence.metadata.OAuthConfig
Use the class with same name in oracle.ateam.sample.mobile.v2.persistence.* instead
|
| oracle.ateam.sample.mobile.security.OAuthToken
Use the class with same name in oracle.ateam.sample.mobile.v2.security instead
|
| oracle.ateam.sample.mobile.security.OAuthTokenManager
Use the class with same name in oracle.ateam.sample.mobile.v2.security instead
|
| oracle.ateam.sample.mobile.persistence.metadata.ObjectPersistenceMapping
Use the class with same name in oracle.ateam.sample.mobile.v2.persistence.* instead
|
| oracle.ateam.sample.mobile.persistence.metadata.PersistenceConfig
Use the class with same name in oracle.ateam.sample.mobile.v2.persistence.* instead
|
| oracle.ateam.sample.mobile.persistence.manager.RestADFBCXMLPersistenceManager
Use the class with same name in oracle.ateam.sample.mobile.v2.persistence.* instead
|
| oracle.ateam.sample.mobile.persistence.manager.RestJSONPersistenceManager
Use the class with same name in oracle.ateam.sample.mobile.v2.persistence.* instead
|
| oracle.ateam.sample.mobile.persistence.manager.RestPersistenceManager
Use the class with same name in oracle.ateam.sample.mobile.v2.persistence.* instead
|
| oracle.ateam.sample.mobile.persistence.manager.RestXMLPersistenceManager
Use the class with same name in oracle.ateam.sample.mobile.v2.persistence.* instead
|
| oracle.ateam.sample.mobile.persistence.service.ValueHolder
Use the class with same name in oracle.ateam.sample.mobile.v2.persistence.* instead
|
| oracle.ateam.sample.mobile.persistence.metadata.XMLMethodHeaderParameter
Use the class with same name in oracle.ateam.sample.mobile.v2.persistence.* instead
|
| oracle.ateam.sample.mobile.persistence.metadata.XMLMethodParameter
Use the class with same name in oracle.ateam.sample.mobile.v2.persistence.* instead
|
| Method and Description |
|---|
| oracle.ateam.sample.mobile.v2.persistence.service.EntityCRUDService.getHasDataSynchActions()
Evaluate expression #{applicationScope.ampa_hasDataSyncActions} instead
|
| oracle.ateam.sample.mobile.v2.persistence.util.EntityUtils.refreshCurrentEntity(String, List<E>, ProviderChangeSupport)
This method can cause an endless loop in combination with getCanonicalEntityy method. Also, the
iteratorRefresh method was an awkward way to do it, including the "guessing" of iterator name. Use the new refreshEntity
method instead.
|


Invoice
Please change the fields as required before saving the changes.
Company:
Receipt No:
Terms:
Bill Date:
Due Date:
Mailing Address:
Billing Address:
No
Quantity
Description
Amount
Action
Total
Memo:
Save
Save and New


EBD - Easton Bible DIctionary
Drawer of water
DRAWER OF WATER
"DRAWER OF WATER "(
Deuteronomy 29:11
;
Joshua 9:21, 23
), a servile employment to which the Gibeonites were condemned.
"DRAWER OF WATER "(Deuteronomy 29:11; Joshua 9:21, 23), a servile employment to which the Gibeonites were condemned.


Filters settings
For setup appearance of filters component use settings:
<ngx-silly-datatable-filter [settings]="filterSettings"></ngx-silly-datatable-filter>
Object settings is a instance of class FilterSettings. It has the following
properties for setup datatable filters component:
-
formContainerClass - Css class name for div container
of filter.
-
cancelButtonTitle - Cancel button text ("Cancel" by
default).
-
cancelButtonClass - Cancel button css class name.
-
submitButtonTitle - Submit button text ("Apply filters"
by default).
-
submitButtonClass - Submit button css class name.
-
buttonsContainerClass - Css class name of the div
container that contains buttons 'Cancel' and 'Apply filters'.
-
formElementsContainerClass - Class of the div container
that contains the container with buttons and all form fields.
* - required property.
For example:
Don't forget import FilterSettings for init new instance:
import {{'{'}} FilterSettings {{'}'}} from 'silly-datatable';


Earo Wang
Lab 02
{"pig", "pig", "car"}
to door {1, 2, 3}
{pig}
, and if so show the other {pig}
. If it is the {car}
, randomly select one of the two other doors to revealswitch
or stay
sample()
do?sample(c("pig", "pig", "car"), 1)
?sample
ppc_sample()
ppc_sample <- function() {
sample(c("pig", "pig", "car"), 1)
}
ppc_sample()
## [1] "car"
for (i in 1:20) {
print(i)
}
ppc_sample()
in a for-loopfor (i in 1:20) {
print(ppc_sample())
}
car
is selected. (You could put this in a loop and compute the proportion of times car
shows.)# My version
results <- vector(mode = "character", length = 20)
for (i in 1:20) {
results[i] <- ppc_sample()
}
ncar <- sum(results == "car")
ncar / 20
# Di's version
ncar <- 0
for (i in 1:20) {
if (ppc_sample() == "car") {
ncar <- ncar + 1
}
}
ncar / 20
The code above does the same thing. Which piece of R code is more efficient?
car
to be selected out of 20 runs?ppc_choice <- function(choice = 1) {
doors <- sample(c("pig", "pig", "car"))
doors[choice]
}
ppc_choice(choice = 2)
## [1] "car"
pig
, the host opens the door for the other pig
. (if
)car
, the host randomly opens either one of the doors for pig
. (else
)if (condition) { # if the condition is satisfied, then excute
# R code
if (condition) { # nested if-else
# R code
} else {
# R code
}
} else {
# R code
}
choice <- 2
doors <- sample(c("pig", "pig", "car"))
notchosen <- c(1:3)[-choice]
if (doors[choice] == "pig") { # if the player's choice is pig
if (doors[notchosen[1]] == "pig") {
host_choice <- paste(notchosen[1], doors[notchosen[1]], sep = "-")
} else {
host_choice <- paste(notchosen[2], doors[notchosen[2]], sep = "-")
}
} else { # if the player's choice is car
d <- sample(notchosen, 1)
host_choice <- paste(d, doors[d], sep = "-")
}
host_choice
## [1] "3-pig"
ppc_host()
ppc_host <- function(choice = 1) {
# R code
}
ppc_play <- function(choice = 1, strategy = "switch") {
# Leaving the fun bit to you to figure out :)
}
.Rmd
file


Computer
.RAM.RAM(int, int)
arguments Computer.ADDRESS_SIZE
and Computer.VALUE_SIZE
.addressSize
and valueSize
must pass Computer.validateSize(int)
or an IllegalArgumentException
is thrown.TableView
where the current state of RAM
will be displayed.Register.Register(int)
with an argument of 1
.Compiler.generate()
with their hex values in their respective Instruction
instances in Compiler.instructions
using Compiler.labelMap
.Computer
to its initial state which was right after its instantiation using Computer.Computer()
.TextField
where the value of the interrupt flip-flop will be displayed.ToggleButton
for running and pausing the simulation.


This is part 4 of a tutorial series on how to make an FT style offline web app. If you haven't already, read part 1 first.
We left off last time with an app that delivers offline news on most modern browsers - and degrades gracefully on older browsers. But if we look back to our list of ideas for further development in the first tutorial we still have work to do to make it work just as well as a website as it does as an app.
These might not sound like groundbreaking features - websites have been doing the first three since forever - but as usual the HTML5 application cache gets in the way.
As always, the full code is up on GitHub.
Product managers often come up with feature requests with descriptions along the lines of: when the app is online do this, when it's offline do that. Unfortunately, it's rarely that black and white.
Connections can be weak and very slow, they can be flaky - disconnecting frequently. Devices can even be tricked into thinking they're online when they're not - they could be behind a captive portal in a coffee shop or hotel; or the device could have a perfect connection to a wifi router that isn't connected to anything else. Requests to your website may be being blocked or somehow mangled by a government or corporate proxy. Or, of course, the device could actually be completely offline.
Rather than thinking in terms of offline and online, the way to deliver the best possible user experience during that initial app boot phase up is to aim to deliver an app startup time that is consistent and unaffected by the connection type or speed. In order to achieve this we're going to need some more AppCache hacking.
The only way you can have a consistent start up time in the face of a wild west of internet connection possibilities is to ensure your web app will prefer, whenever possible load from the device's local application cache. To do this you have to ensure that the page which your app starts on is explicitly cached in the application cache manifest.
At FT Labs we refer to this kind of application cache behaviour as prefer offline, where the application cache - if populated - will always be the preferred source for the app to load itself from, rather than the network. This means that the amount of time the demo app will take to start up will always be the same - no matter what kind of connection the user's device has to the internet.
We can achieve this either by listing the root of the app explicitly in the CACHE
section of the app cache manifest. Or, as we do in our demo app, listing it as the 2nd part of a fallback within the FALLBACK
section.
(In an ideal world we would like for the application cache to be configured so that every request (even ones not listed in the application cache) are always prefer offline unless we say otherwise, but that is not currently possible with the current spec or any browser implementation :-(. Given the home page is the likeliest entry point to your application, we prioritise that.)
This means the web server must serve the root of your application (in the FT's case that's http://app.ft.com/
) with the bootstrap code - explained in the first tutorial.
However, in order to achieve the server side render of the HTML for the first time the user visits the app (which makes for a much faster initial app start; allows our app to be crawled by search engines and work without javascript) that same application root URL sometimes also needs, in the case of our demo app, to return the current latest blog posts.
To summarise:
Given we have no Javascript control over either these requests (the former is made by the application cache's update mechanism, the latter by the user typing the URL into their browser / clicking a link from another site) we only have one solution.
* By bootstrap I mean the bootstrap of the sort we described in Tutorial 1 - just enough Javascript and HTML to pull your Javascript's application logic out of localStorage
and eval
it but no more. Not to be confused with any other kind of bootstrap, of course.
We already have quite precise control over how and when the application cache is loaded through the iframe (implemented in the previous tutorial) so solving this problem is actually quite easy.
Before adding the iframe, simply set a cookie and when we receive a notification from the Javascript within that iframe (which is listening to the application cache events) that the application cache has finished updating we unset the cookie.
Then on the server side, within /index.php, if that cookie is set: return the bootstrap otherwise return the latest blog posts.
This is, of course, a monumental hack. But with the app cache as it is today it's the best we can do.
Start by cloning (or downloading) the GitHub repository from Part 3.
git clone git://github.com/matthew-andrews/ft-style-offline-web-app-part-3.git
| /api/resources/javascript.php |
| /index.php |
| /server/application/applicationcontroller.php |
| /server/articles/article.php |
| /server/articles/articlescontroller.php |
| /server/templates.php |
| /source/appcache.js |
| /source/application/applicationcontroller.js |
| /source/templates.js |
New files are highlighted in bold, changes to existing files not in bold.
As I explained above in the More app cache hacking section this file needs to be able to return the latest blog items for ordinary requests and it should return the bootstrap we created in Tutorial 1 when requested during an application cache update.
We detect whether the cookie is set at the top of the file via the PHP isset
function:-
$appcacheUpdate = isset($_COOKIE['appcacheUpdate']);
The code we return if we're not doing an app cache update can be a normal web page that follows all the best practises, such as:
<script type="text/javascript" src="<?php $appRoot; ?>api/resources/javascript.php"></script>
<link href="<?php echo $appRoot; ?>css/global.css" media="all" rel="stylesheet" type="text/css" />
js
containing the demo web app's Javascript and another, css
containing its css).
The next step is to take the code we've written in Javascript and make it so that it will run on our server. The easiest way to do this (where easiest for the purposes of this tutorial means not adding dependencies on any more technologies) is to rewrite it in PHP.
To keep things as simple as possible I've copied the same structure as the Javascript file - giving the files, classes and their methods all the same names wherever possible.
')),
'author' => strval($item->children('http://purl.org/dc/elements/1.1/')->creator)
);
}
if ($articleId > 0) {
return $output[0];
} else {
return $output;
}
}
}
}
[/php]
Much like /sources/articles/article.js the role of this class is to just return article data. If the get
function is passed a parameter (and ID of the article) it will return a single article, otherwise it will return all the articles in the RSS feed.
To simplify the explanations in this tutorial I've not bothered to combine some of the logic in this file with the logic in /api/articles/index.php - even though it is almost exactly the same. The only difference is /api/article/index.php outputs a json encoded object - used by the Javascript in the demo app, whereas this file will be used by other PHP files to get a PHP associative array containing article data.
This code should look very similar to the corresponding Javascript file in /sources/articles/articlescontroller.js.
No articles have been found, maybe you haven\'t refreshed the news?
'; } for ($i = 0, $l = count($articles); $i < $l; $i = $i + 1) { $output .= 'In this file we've reimplemented the logic inside /sources/templates.js. Rather than copying this file directly you could choose to copy the Javascript file and manually port the code to PHP. If you do this make sure to be careful replacing +
's with .
's.
For example:-
[js] output = output + 'Becomes:-
[php] $output .= 'As we discussed above with the More hacking the app cache section, we have two changes to make inside /source/appcache.js.
The first change is to set the cookie inside the innerLoad
function:-
And the second change is to unset that same cookie once we know the appcache update process is complete:-
[js] function logEvent(evtcode, hasChecked) { var s = statuses[evtcode], loaderEl, cookieExpires; if (hasChecked || s === 'timeout') { if (s === 'uncached' || s === 'idle' || s === 'obsolete' || s === 'timeout' || s === 'updateready') { loaderEl = document.getElementById('appcacheloader'); loaderEl.parentNode.removeChild(loaderEl); // Remove appcacheUpdate cookie cookieExpires = new Date(new Date().getTime() - 60 * 5 * 1000); document.cookie = "appcacheUpdate=;expires=" + cookieExpires.toGMTString(); } } } [/js]The changes to the application controller are a little more complicated. We want to make some changes to existing code, and add a few new methods. I'm just going to post the changes in this tutorial - for the full code please view the file on the GitHub project.
We need to make the following changes to the applicationcontroller.js file:
initialRenderOnServer
:-route
function with one that is able to understand real URLs instead of hash tag URLs.Notice that we're also adding our code to hook into the HTML5 History API here.
initialise
and start
methods with ones that are able to boot the app either from our locally cached bootstrap (discussed in Tutorial 1) or from the network.route
and newly added startFromServer
methods.No articles have been found, maybe you haven\'t refreshed the news?
'; } for (i = 0, l = articles.length; i < l; i = i + 1) { output = output + 'The majority of the changes here are changing the URLs inside the each of the <a href="">
's from using a hashtag URL to using a real URL (e.g. yourapp.com/#5 becomes yourapp/5).
There's also a small change to the way the error handler works - previously it just redirected the user to the error page by calling window.location = '#error';
but now since we aren't using hashtag URLs we have to call the route function instead.
In this tutorial we've made our demo web app work just as well as a website as it does as an app. But in doing so we've created a bit of a monster.
If we look back again at the PHP server side code and compare it to the client side Javascript there is a huge amount of duplicated logic. With the exception of the client side specific code (such as the local database and app cache logic) the contents of the /sources folder, used for client side Javascript is almost exactly the same at the /server folder, used for PHP.
Having to maintain two sets of files with identical logic wastes time as every feature or bug fix has to be implemented twice.
The codebase would be a lot neater and more manageable if we were able to just write the Javascript versions and then run that Javascript code on both the server and client.
In 2009 Ryan Dahl created NodeJS, which allows developers to do just that. In the next tutorial we will bid farewell to the web technologies of the past (PHP and Apache) and rebuild the app with the latest tools and techniques (Node, NPM, Grunt, BusterJS and more…).
Finally, if you think you’d like to work on this sort of thing and live (or would like to live) in London, we’re hiring!
By Matt Andrews - @andrewsmatt on Twitter and Weibo


| {{user.name}} | {{user.email}} |
| {{user.name}} | {{user.email}} |
Each player except the czar starts with 10 answer cards
A player is randomly chosen as czar
Other players answer the question card by selecting answer cards
The Card Czar then picks a favorite answer, and whoever that answer wins
You are the Card Czar.


return
finally
While occasionally intended, such return statements may mask thrown exceptions and complicate debugging.
Example:
try { foo(); } finally { if (bar()) return; }


Consist of individual with expertise in the following areas:
Client Servicing
We exhibit clear understanding of client business, operations and strategies and how HN Conseil will help you achieve it
We begin every process with interaction and planning with the client’s needs in focus
We also work with a structured coordination and highly technical skills among team members to deliver on every client requests
RFQ/RFPs/Proposal Process
Explore and discuss the brief with client
Gather and check cost quotations against specification
Responsible for project design, management and execution
Undertake specific project related functions including writing proposals, designing questionnaires/discussion guides, sample design and tab specs.
Cost and Finance
Our desire is that every study is important and seeks to address a need. We always propose cost saving solutions to ensure such study materializes and addresses clients objectives
Our GM and profit on projects are reasonable to allow for the sustainability of the business and that which the client can afford
We are prudent and highlight costs and budget concerns/options to achieve reasonable and affordable clients budget without compromising on quality
We liaise with credible field agencies to secure best project estimates/budgets as well as coordinate the project
Project Management
Approve itinerary provided by Operations department (Field & DP)
Brief the Quality Control, Data Management, Field and Project Management team
Develop project related materials – colour card, concept cards, showcards, memory aid cards, picture cards, training and briefing manuals, DP specs, code frames etc
Effectively communicate project needs to vendors
Ensure implementation of the best and fastest project schedules and processes
Key account management for liaison with vendors
Responsible for orderly & effective process and quality documentation
Update Account Managers on progress and problems as and when they occur on live projects
Analysis/reporting
Provide analyses & research findings to meet client needs
Check, confirm and approve data before commencement of charting
Generate actionable insights and recommendations to meet client needs
Collect secondary information from sources such as website, social platforms, prints, press and industry reports to back up inputs in the analysis
Responsible for timely and quality deliverables
Team and People Management
Setup a clear directions, objectives and questions where appropriate
Promote team bonding, engagement and spirit
Supervise, Coordinate, Control, Manage, Monitor and Maintain standards throughout the lifecycle of each project
Communication
Liaise with client /relevant internal departments on project related matters
Prepare presentations using HNC’s tools and specific software
Seek approval where necessary and communicate any changes


CH410/510 Scientific Computing¶
Overview¶
The class will meet Monday and Wednesday at 9 am 1 hr, and then Friday at 9 am for 2 hr.
All classwork will be done remotely. Details are here.
Details regarding grading and course policies are in the syllabus.
Getting help¶
Python reference and links to helpful material
Office hours:¶
Check slack #general
channel for zoom links to office hours.
Anneliese: 4 pm on Mondays
Luis: 5 pm on Mondays and 4 or 6 pm on Tuesdays
Michael: 2 pm on Wednesdays
Joseph: 2 pm on Thursdays
Mike: 1 pm on Fridays
Getting set up:¶
To get your environment set up, please follow these instructions.
To test your environment, please try to run this jupyter notebook (right-click to save onto your computer.)
Schedule and course materials¶
Warning: Future dates and material may be subject to (minor) change.
In general, Mon and Wed will be instruction days where we cover new programming material. Fri will be an open “lab” where you will work on exercises in groups.
Date |
Topic |
|---|---|
3/30 |
Introduction. Configuring jupyter and python
|
4/1 |
The jupyter notebook. Python as a calculator.
|
4/3 |
Conditionals and loops
|
4/6 |
Lists
|
4/8 |
Numpy arrays
|
4/10 |
Tuples, dicts, and strings; functions |
4/13 |
Pandas data frames
|
4/15 |
Graphing and matplotlib
|
4/17 |
Lab: programming puzzles
|
4/20 |
Simulation
|
4/22 |
Simulation |
4/24 |
Lab: simulating an experiment.
|
4/27 |
Fitting models to data
|
4/29 |
Fitting models to data
|
5/1 |
Lab: fitting models to data
|
5/4 |
Intro to machine learning
|
5/6 |
Classification with machine learning
|
5/8 |
Lab: classification using machine learning
|
5/11 |
Molecular structures
|
5/13 |
Molecular structures |
5/15 |
Lab: calculating structural properties
|
5/18 |
Big(ish) data
|
5/20 |
Big(ish) data |
5/22 |
Lab: analyzing HTS data
|
5/25 |
Memorial day, no class |
5/27 |
Working with images
|
5/29 |
Working with images, start lab
|
6/1 |
Finish lab: analyzing microscopy images
|
6/3 |
Final project, in-class work |
6/5 |
Final project, in-class work
|
6/9 |
Final project due
|


You will start every assignment with full credit. Points will be deducted based on the rubric provided for each assignments.
The phrase It works on my machine.
will not be a valid excuse for contesting a grade. If your code will not render or function except on your machine, you will immediately lose 60 points for that assignment.


--- layout: post status: publish published: true title: 'MSN Messenger: Missing In Action' author: display_name: Tomas Restrepo login: tomasr email<EMAIL_ADDRESS>url: http://winterdom.com/ author_login: tomasr author_email<EMAIL_ADDRESS>author_url: http://winterdom.com/ wordpress_id: 833 wordpress_url: http://winterdom.com/2007/06/msnmessengermissinginaction date: '2007-06-05 05:16:57 +0000' date_gmt: '2007-06-05 05:16:57 +0000' categories: - Personal tags: [] comments: [] ---
Today my MSN Messenger icon went missing in action:


Light introduction to Vue.js
What is Framework?
-
Frameworks need for creation Single page Applications (SPA) and not only this
-
The framework defines the basic structure and organization of the code
-
The framework defines the structure of the application at the file system level and provides tools for compiling and debugging it
-
The framework increases the speed of development as well as support and bug fixes in applications
-
The ability to create cross-platform applications
-
The framework makes it easier for several developers to work on an application at the same time because framework has modules
Why Vue.js?
Execution speed
Lightweight
A lot of things are already out of the box. Routing, Vuex, Test utils, PWA, preprocessor support, animation, etc
Can start to use without additional knowledge
Vue CLI
Vue UI Tool. A graphical interface
Documentation
Get started
Plugin: Eslint
Plugin: Vetur
Plugin: Prettier
Need to do some VS code settings
Install Vue.js devtools plugin
Installing Vue CLI
Node.js
Vue CLI
npm install -g @vue/cli
Vue commands
vue version
vue create myapp
Installing Vue CLI
Folder structure
Vue components
Attribute syntax
Directives. v-if/v-else
Template directive
v-show/v-if
Event handling
Event handling
Event handling
Get data from target and save it to variable
Computed properties
Computed properties: Get/Set
Watch
Bind styles
Bind styles
Bind styles
Bind styles
Bind styles


WITNESS LIST S/C on Emerging Technologies & Economic Dev. Committee May 2, 2005 - 3:00P HB 1734 Registering, but not testifying: For: Atkins, Rick (City of Round Rock), Round Rock, TX McLarley, James (City of McKinney), Dallas, TX Yawn, Nancy (Round Rock Convention and Visitors Bureau), Round Rock, TX HB 1938 FOR: Baylor, Don (Center for Public Policy Priorities), Austin, TX Registering, but not testifying: For: Hinajosa, Walter (Self), Austin, TX On: Norris, Robert (Legislative Budget Board), Austin, TX SB 770 FOR: Tonn, Larry (Texas Association of Voluntary Hospitals), Austin, TX Registering, but not testifying: For: Baylor, Don (Center for Public Policy Priorities), Austin, TX SB 818 FOR: Tonn, Larry (Texas Association of Voluntary Hospitals), Austin, TX Registering, but not testifying: For: Mendez, Mark (Tarrant County), Ft. Worth, TX SB 1730 FOR: Harris, Jack (Brazoria County), Pearland, TX