8 Things Parents Rarely Do for Their Babies’ Health That Doctors Swear By
Giving a massage to premature babies has proven to have miraculous effects, helping the babies leave the hospital sooner than expected. Studies have shown that premature babies who received daily massage therapy developed more quickly, their immune system ameliorated, and their overall health improved. But that’s just one of the “adult” practices that are also useful for infants.
At Bright Side, we selected a number of things that parents will find remarkably beneficial to support their babies’ growth and health system.
1. Reflexology for stress relief
It’s almost an instinctive action for some mothers to rub their children’s hands or feet when they’re uneasy. What’s not so commonly known though is that babies also respond to reflexology. A gentle massage on their feet can help them relax and fall asleep more easily and can be used as a daily routine.
How to do it:
- Warm up the area by gently rubbing your baby’s feet.
- Start massaging the area smoothly and see how your baby responds.
- You can make this a daily routine to help relieve your baby of stress.
2. Touching and caressing for mental health
As a parent, you likely want to caress your kid instinctively. But it’s also been scientifically proven that children who were touched and nurtured more by their parents as babies have better mental health as adults because they develop stronger neuronal connections. “Having a hippocampus that’s almost 10% larger just provides concrete evidence of nurturing’s powerful effect,” writes Joan L. Luby, MD, Professor of Child Psychiatry.
3. Massage for relaxation and better health
Massage is a very popular form of stress relief for adults, but it has the same effect on infants too. Massaging your baby makes them feel secure and tender, and also helps babies who experience gas, cramps, colic, and constipation. It also lowers their stress levels. More than that, research has shown that giving a daily massage to premature babies helped their growth and bone development.
How to do it:
- Slowly and gently rub your baby’s body from tip to toe while they’re on their back.
- You can place your baby on their belly and repeat the same thing on their back.
- During the process, talk to your baby and keep eye contact with them. That will help them relax and feel secure.
- You can repeat this several times a day as long as your baby enjoys it. You can also try some essential oil or baby oil. But be sure to apply a small amount on your baby’s skin beforehand to test for allergic reactions or sensitivities.
4. Tummy time for stronger muscles
Tummy time is not just a fun parent-baby moment. It should be a regular practice because it actually helps the baby build stronger muscles. This way, crawling and sitting will be much easier for the infant as they get older.
How do it:
- For starters, keep your baby on your chest for short periods of time, even right after birth.
 Be sure that you’re fully alert the whole time.
- After a while, the baby will be ready to do the same thing on the floor.
5.  White noise devices have the exact same effect, plus they help babies fall asleep and sleep longer. Dryers or washing machines have become saviors for desperate new parents. The static sounds, experts say, are similar to the body noises that a baby listens to in the womb.
How to do it:
- Get an infant seat and place it on the appliance. Set your baby comfortably in it and be sure to hold the seat to prevent it from moving out of place.
- Start the machine and let the vibrations of the appliance slowly calm your baby.
6. Drive with your baby to help them sleep.
Driving your baby to sleep actually works and experts say that we should try it more. Car motion works as a lullaby for babies because it mimics the motion babies feel inside the womb. This makes them feel secure and peaceful like they did in their mother’s belly. Tracy Cassels, a developmental psychologist, said that “[The engine of the car] is white noise that babies also are used to. This is a muffled kind of sound in the womb.”
7. Baking soda mix for mosquito and bug bites
Especially during the summer months, mosquitos and bugs can be tough on our little ones (and for us too). A natural paste of baking soda and water relieves them from the pain and itching. The alkaline soda neutralizes and eases the acidic swelling.
How to do it:
- Just mix a tablespoon of baking soda in water and create a thick paste that can be applied easily on the skin.
- Apply the paste gently on the bite and let it do the work.
- Wipe it off with a warm cotton pad.
8. Feeding is not always the answer to crying.
This is more of a “no-no” but it’s a piece of important advice coming from Harvard’s experts. Most parents tend to respond to every cry with a feeding. That is a serious issue, doctors say, that can lead to an overweight baby. A baby’s cry doesn’t necessarily mean hunger but also fatigue, boredom, or discomfort. “If every time a baby fusses they are fed, after a while they may start to think of feeding as what they need...creating unhealthy associations with eating that are hard to undo,” a Harvard MD says.
What to try instead:
- If you’ve recently fed your baby, you can try talking or playing with them.
- You can also try holding or soothing to help them relax.
- There is also the possibility that a diaper change is needed.
Do you have any special tips to share that will help new parents with their babies? Feel free to add them in the comments below.
Preview photo credit depositphotos.com, depositphotos.com


About Me:
I attended college for five years and have two associate degrees, one in biology and one in psychology. At my last job, I was promoted and worked right under the web developers so I got a deep dive into the front-end world. I fell in love with it and the more I knew, the more I wanted to know. I would study during breaks, through lunch and at home as much as possible and still do every single day. I know enough to say with confidence I would be a valuable asset to your company. I am bettering my understanding of JavaScript all the time along with React and SASS during breaks. My goal is to ultimately be a senior full-stack developer but I want to master the front end first.
Oh! And I love photography, writing poems and painting.
I am looking for a full-time position with opportunity to advance and grow. I bring several skills such as:
Skills:
Research Implementation
HTML5, CSS3, JavaScript, Koala,
SASS, React, Slack, Discord, Outlook
Version Control (Git and GitHub)
Microsoft Office and Outlook
Ensuring Quality Performance
Maintaining High Morale
Troubleshooting Detail Orientation
Working in a team effectively
Mobile First Engineering Implementation
Photoshop Cs6 and Gimp
Assess UI designs for technical feasibility
Developing reports in graph format
Linux


|
Charbrary
2.0.0
|
Contains collision detection utils for 2D shapes (AABBs, circles, lines) More...
Functions | |
| Circle | enclosingCircle (const AABB &aabb) |
| Circle | inscribedCircle (const AABB &aabb) |
| AABB | enclosingAABB (const Circle &circle) |
| AABB | enclosingAABB (const LineSegment &lineSegment) |
| AABB | inscribedAABB (const Circle &circle) |
| bool | aabb_contains (const AABB &aabb, const vec_t &point) |
| bool | aabb_contains (const AABB &first, const AABB &other) |
| bool | aabb_contains (const AABB &aabb, const Circle &circle) |
| bool | circle_contains (const Circle &circle, const vec_t &point) |
| bool | circle_contains (const Circle &first, const Circle &other) |
| bool | circle_contains (const Circle &circle, const AABB &aabb) |
| bool | aabb_intersects (const AABB &a, const AABB &b) |
| bool | aabb_intersects (const AABB &aabb, const Circle &circle) |
| bool | circle_intersects (const Circle &circle, const Circle &other) |
| bool | circle_intersects (const Circle &circle, const AABB &aabb) |
| float | circles_distance (const Circle &a, const Circle &b) |
| AABBCollision | aabb_collision_info (const AABB &first, const AABB &other) |
| Checks if the first AABB collides with the other one. More... | |
| CirclesCollision | circles_collision_info (const Circle &first, const Circle &other) |
| Checks if the first circle collides with the other one. More... | |
| CircleAABBCollision | circle_aabb_collision_info (const AABB &aabb, const Circle &circle) |
| Checks if an AABB and a circle collide with each other. More... | |
| SegmentsIntersection | line_segments_intersection_info (const LineSegment &first, const LineSegment &other) |
| Checks if the given line segments are intersecting. More... | |
Contains collision detection utils for 2D shapes (AABBs, circles, lines)
| AABBCollision ch::collision::aabb_collision_info | ( | const AABB & | first, |
| const AABB & | other | ||
| ) |
Checks if the first AABB collides with the other one.
In case of a collision, this function returns an instance of AABBCollision containing the collision normal and the delta (overlap). The collision normal is the direction (a unit vector) towards which the other AABB needs to be pushed in order to resolve the collision. The collision normal will be set to a null vector (0,0) if there is no collision.
| CircleAABBCollision ch::collision::circle_aabb_collision_info | ( | const AABB & | aabb, |
| const Circle & | circle | ||
| ) |
Checks if an AABB and a circle collide with each other.
In case of a collision, this function returns an instance of CircleAABBCollision containing the collision normal and the penetration depth. The collision normal is the direction (a unit vector) towards which the circle needs to be pushed in order to resolve the collision. The collision normal will be set to a null vector (0,0) if there is no collision.
| CirclesCollision ch::collision::circles_collision_info | ( | const Circle & | first, |
| const Circle & | other | ||
| ) |
Checks if the first circle collides with the other one.
In case of a collision, this function returns an instance of CirclesCollision containing the collision normal and the penetration depth. The collision normal is the direction (a unit vector) towards which the other circle needs to be pushed in order to resolve the collision. The collision normal will be set to a null vector (0,0) if there is no collision.
| AABB ch::collision::enclosingAABB | ( | const LineSegment & | lineSegment | ) |
| SegmentsIntersection ch::collision::line_segments_intersection_info | ( | const LineSegment & | first, |
| const LineSegment & | other | ||
| ) |
Checks if the given line segments are intersecting.
This methods generates a SegmentsIntersection instance representing the state of intersection between the 2 segments.


A Preset Post from Jekyll
The Only Useful Post Here
A Description
This page was last updated at 2022-01-08 14:22.
2021 © Yong Lee


{% extends "base.html" %} {%block content%} {%include 'snippets/nav.html'%}
{{event}} is happening this month


2 references to CRYPT_OID_INFO
System.Management.Automation (2)
security\Authenticode.cs (2)
139
NativeMethods.
CRYPT_OID_INFO
oidInfo =
140
Marshal.PtrToStructure<NativeMethods.
CRYPT_OID_INFO
>(oidPtr);


Agenda
- What is a Genetic Algorithm?
- Components ("Lifecycle") in Genetic Algorithms
- Advantages
- Limitations
What is a Genetic Algorithm?
- Method of multi-parameter problem solving, using natural selection principles
- Uses:
- Optimization
- Data Modelling
- Searching
Terminology
- Gene
- Chromosome
- Individual
- Population
- Generation
Components
- Data encoding
- Fitness calculation
- Selection
- Crossover
- Mutation
Data Encoding
- Array-like structure
- Usually booleans or integers, but doesn't have to be
Fitness Calculation
- Takes an individual and calculates a value
- Used to determine how "fit" for the solution the individual is
Selection
- Selecting individuals for the next generation
- Relies on fitness calcuations in some manner
- Example implementations:
- Roulette Wheel Selection
- (Weighted) Rank Selection
- Tournament selection
- Reward-based selection
Crossover
- Combining genes of selected parents
- Example implementations:
- Single-point
- Two-point
- Uniform
Mutation
- Changing gene(s) of an individual, based of random chance
- Helps to increase genetic diversity
- Too much mutation chance can delay finding the optimal solution
Genetic Diversity
- Too little: sub-optimal solution
- Too much: takes longer to converge on a solution
Termination Conditions
- Acceptable fitness threshold reached
- Generation limit
- No/insufficient changes to fitness
Advantages
- Can handle a large number of parameters
- Ability to search large area of solution space
Limitations
- Can get stuck in "local" optimal solution
- Encoding the data and defining the fitness function can be tricky


Call
open class Call
A Call represents a media call on Cisco Spark. The application can create an outgoing call object by calling phone.dial function:
let address =<EMAIL_ADDRESS>let localVideoView = MediaRenderView()
let remoteVideoView = MediaRenderView()
let mediaOption = MediaOption.audioVideo(local: localVideoView, remote: remoteVideoView)
let call = spark.phone.dial(address, option: mediaOption) { success in
if success {
// success
} else {
// failure
}
}
The application can receive an incoming call object via …
code
See
Phone API about how to create calls.Since
1.2.0-
The enumeration of Camera facing modes.
See moreDeclaration
Swift
public enum FacingMode: String
-
Completion handler for a call operation.
Declaration
Swift
public typealias CompletionHandler = (Bool) -> Void
-
The enumeration of Call status.
See moreDeclaration
Swift
public enum Status: String
-
The current status of this call.
Declaration
Swift
open var status: Status
-
The intended recipient of this call. - For an outgoing call, this is the same as the address specified in phone.dial. - For an incoming call, this is the identity of the authenticated user.
Declaration
Swift
open var to: String?
-
The receiver of this call. - For an outgoing call, this is the identity of the authenticated user. - For an incoming call, this is the address of the caller such as email address, phone number, or SIP address.
Declaration
Swift
open var from: String?
-
True if this call is sending audio. Otherwise, false.
Declaration
Swift
open var sendingAudio: Bool
-
True if the local party of this call is receiving audio. Otherwise, false.
Declaration
Swift
open var receivingAudio: Bool
-
True if the local party of this call is sending video. Otherwise, false.
Declaration
Swift
open var sendingVideo: Bool
-
True if the local party of this call is receiving video. Otherwise, false.
Declaration
Swift
open var receivingVideo: Bool
-
True if the remote party of this call is sending audio. Otherwise, false.
Declaration
Swift
open var remoteSendingAudio: Bool
-
True if the remote party of this call is sending video. Otherwise, false.
Declaration
Swift
open var remoteSendingVideo: Bool
-
True if loud speaker is selected as the audio output device for this call. Otherwise, false.
Declaration
Swift
open var loudSpeaker: Bool
-
The camera facing mode selected for this call.
Declaration
Swift
open var facingMode: FacingMode
-
The local video render view height (points) of this call.
Declaration
Swift
open var localVideoViewHeight: UInt32
-
The Local video render view width (points) of this call.
Declaration
Swift
open var localVideoViewWidth: UInt32
-
The remote video render view height (points) inof this call.
Declaration
Swift
open var remoteVideoViewHeight: UInt32
-
The remote video render view width (points) of this call.
Declaration
Swift
open var remoteVideoViewWidth: UInt32
-
True if the DTMF keypad is enabled for this call. Otherwise, false.
Declaration
Swift
open var sendingDTMFEnabled: Bool
-
This function answers an incoming call. It only applies to incoming calls. Calling this function on outgoing calls behaves ?
Declaration
Swift
open func answer(option: MediaOption, completionHandler: CompletionHandler?)
Parameters
option
Intended media options - audio only or audio and video - for the call.
completionHandler
A closure to be executed once the action is completed. True means success, False means failure.
Return Value
Void
-
This function disconnects this call. This applies to both incoming and outgoing calls.
Declaration
Swift
open func hangup(_ completionHandler: CompletionHandler?)
Parameters
completionHandler
A closure to be executed once the action is completed. True means success, False means failure.
Return Value
Void
-
Rejects an incoming call. This only applies to incoming calls.
Note
This function is expected to run on main thread.Declaration
Swift
open func reject(_ completionHandler: CompletionHandler?)
Parameters
completionHandler
A closure to be executed once the action is completed. True means success, False means failure.
Return Value
Void
-
This function sends DTMF events to the remote party. Valid DTMF events are 0-9, *, #, a-d, and A-D.
Declaration
Swift
open func send(dtmf: String, completionHandler: CompletionHandler?)
Parameters
dtmf
any combination of valid DTMF events matching regex mattern “^[0-9#*abcdABCD]+$”
completionHandler
A closure to be executed once the action is completed. True means success, False means failure.
Return Value
Void
-
If sending video then stop sending video. If not sending video then start sending video.
Declaration
Swift
open func toggleSendingVideo()
-
Toggle whether the local party should receive video from the remote party or not.
- If receiving video then stop receiving video.
- If not receiving video then start receiving video.
Declaration
Swift
open func toggleReceivingVideo()
-
Toggle whether the local party should send audio from the remote party or not.
- If sending audio then stop sending audio.
- If not sending audio then start sending audio.
Declaration
Swift
open func toggleSendingAudio()
-
Toggle whether the local party should receive audio from the remote party or not.
- If receiving audio then stop receiving audio.
- If not receiving audio then start receiving audio.
Declaration
Swift
open func toggleReceivingAudio()
-
Toggle camera facing mode between front camera and back camera of the iOS device.
Declaration
Swift
open func toggleFacingMode()
-
Toggle the use of loud speaker on the iOS device.
Declaration
Swift
open func toggleLoudSpeaker()
-
Send feed back to Spark.
Note
This function is expected to run on main thread.Declaration
Swift
open func sendFeedbackWith(rating: Int, comments: String? = nil, includeLogs: Bool = false)
Parameters
rating
Rating between 1 and 5.
comments
User comments.
includeLogs
True if to include logs, False as not.
Return Value
Void


title: Contributor License Agreements description: {% extends "base.html" %} {% block body %}
We are not asking you to give us your copyright, but we need to get your OK to distribute and potentially relicense your code without restriction. So please make sure you have signed our contributor agreement, please select the appropriate description of yourself:
All contributors of Crate have signed a CLA, thats how we can assure the users of Crate about the origin and continuing existence of the code. You only need to sign the CLA once.


{% extends 'base.html' %} {% block content %}
Sorry! The resource you are looking for cannot be found. Please try again later or contact the admin


Query:
{ "query": { "match_all": {} } }
format
run
reset
indices
Result:
PS. if you want to have the original result (json response), press the "copy" button.
copy


{% extends "layouts/public_base.html" %} {% block page_title %}API{% endblock %} {% block extra_stylesheets %} {% endblock %} {% block content %} {# todo: this nav was bumping into swagger Jump to: Using this live documentation page Help and support Try it out! Search API Query string syntax Default handling of phrases Searching inside a specific field Special characters Short field names Sorting of results The query string - advanced usage CRUD API Creating articles Applications - Update Requests #} Docs API {% include "api/current/swagger_description.html" %} {% include "api/current/extra_docs.html" %} {% endblock %} {% block extra_js_bottom %} {% endblock %}
Docs


cpl_complete_word cpl_complete_word
NAME
cpl_complete_word, cfc_file_start, cfc_literal_escapes,
cfc_set_check_fn, cpl_add_completion, cpl_file_completions,
cpl_last_error, cpl_list_completions, cpl_recall_matches,
cpl_record_error, del_CplFileConf, del_WordCompletion, new_CplFileConf,
new_WordCompletion - lookup possible completions for a word
SYNOPSIS
#include <stdio.h>
#include <libtecla.h>
WordCompletion *new_WordCompletion(void);
WordCompletion *del_WordCompletion(WordCompletion *cpl);
#define CPL_MATCH_FN(fn) int (fn)(WordCompletion *cpl, \
void *data, \
const char *line, \
int word_end)
typedef CPL_MATCH_FN(CplMatchFn);
CPL_MATCH_FN(cpl_file_completions);
CplMatches *cpl_complete_word(WordCompletion *cpl,
const char *line,
int word_end, void *data,
CplMatchFn *match_fn);
CplMatches *cpl_recall_matches(WordCompletion *cpl);
int cpl_list_completions(CplMatches *result, FILE *fp,
int term_width);
int cpl_add_completion(WordCompletion *cpl,
const char *line, int word_start,
int word_end, const char *suffix,
const char *type_suffix,
const char *cont_suffix);
void cpl_record_error(WordCompletion *cpl,
const char *errmsg);
const char *cpl_last_error(WordCompletion *cpl);
#define CPL_CHECK_FN(fn) int (fn)(void *data, \
const char *pathname)
typedef CPL_CHECK_FN(CplCheckFn);
CPL_CHECK_FN(cpl_check_exe);
CplFileConf *new_CplFileConf(void);
CplFileConf *del_CplFileConf(CplFileConf *cfc);
void cfc_literal_escapes(CplFileConf *cfc, int literal);
void cfc_file_start(CplFileConf *cfc, int start_index);
void cfc_set_check_fn(CplFileConf *cfc, CplCheckFn *chk_fn,
void *chk_data);
DESCRIPTION
The cpl_complete_word() function is part of the tecla library (see the
libtecla man page). It is usually called behind the
scenes by gl_get_line, but can also be called sepa-
rately.
Given an input line containing an incomplete word to be completed, it
calls a user-provided callback function (or the provided file-comple-
tion callback function) to look up all possible completion suffixes for
that word. The callback function is expected to look backward in the
line, starting from the specified cursor position, to find the start of
the word to be completed, then to look up all possible completions of
that word and record them, one at a time by calling cpl_add_comple-
tion().
Descriptions of the functions of this module are as follows:
WordCompletion *new_WordCompletion(void)
This function creates the resources used by the cpl_complete_word()
function. In particular, it maintains the memory that is used to return
the results of calling cpl_complete_word().
WordCompletion *del_WordCompletion(WordCompletion *cpl)
This function deletes the resources that were returned by a previous
call to new_WordCompletion(). It always returns NULL (ie. a deleted
object). It does nothing if the cpl argument is NULL.
The callback functions which lookup possible completions should be
defined with the following macro (which is defined in libtecla.h).
#define CPL_MATCH_FN(fn) int (fn)(WordCompletion *cpl, \
void *data, \
const char *line, \
int word_end)
Functions of this type are called by cpl_complete_word(), and all of
the arguments of the callback are those that were passed to said func-
tion. In particular, the line argument contains the input line contain-
ing the word to be completed, and word_end is the index of the charac-
ter that follows the last character of the incomplete word within this
string. The callback is expected to look backwards from word_end for
the start of the incomplete word. What constitutes the start of a word
clearly depends on the application, so it makes sense for the callback
to take on this responsibility. For example, the builtin filename com-
pletion function looks backwards until it hits an unescaped space, or
the start of the line. Having found the start of the word, the call-
back should then lookup all possible completions of this word, and
record each completion via separate calls to cpl_add_completion(). If
the callback needs access to an application-specific symbol table, it
can pass it and any other data that it needs, via the data argument.
This removes any need for globals.
The callback function should return 0 if no errors occur. On failure it
should return 1, and register a terse description of the error by call-
ing cpl_record_error().
void cpl_record_error(WordCompletion *cpl,
const char *errmsg);
The last error message recorded by calling cpl_record_error(), can sub-
sequently be queried by calling cpl_last_error(), as described later.
int cpl_add_completion(WordCompletion *cpl,
const char *line, int word_start,
int word_end, const char *suffix,
const char *type_suffix,
const char *cont_suffix);
The cpl_add_completion() function is called zero or more times by the
completion callback function to record each possible completion in the
specified WordCompletion object. These completions are subsequently
returned by cpl_complete_word(), as described later. The cpl, line, and
word_end arguments should be those that were passed to the callback
function. The word_start argument should be the index within the input
line string of the start of the word that is being completed. This
should equal word_end if a zero-length string is being completed. The
suffix argument is the string that would have to be appended to the
incomplete word to complete it. If this needs any quoting (eg. the
addition of backslashes before special charaters) to be valid within
the displayed input line, this should be included. A copy of the suffix
string is allocated internally, so there is no need to maintain your
copy of the string after cpl_add_completion() returns.
Note that in the array of possible completions which the cpl_com-
plete_word() function returns, the suffix recorded by cpl_add_comple-
tion() is listed along with the concatentation of this suffix with the
word that lies between word_start and word_end in the input line.
The type_suffix argument specifies an optional string to be appended to
the completion if it is displayed as part of a list of completions by
cpl_list_completions(). The intention is that this indicate to the user
the type of each completion. For example, the file completion function
places a directory separator after completions that are directories, to
indicate their nature to the user. Similary, if the completion were a
function, you could indicate this to the user by setting type_suffix to
"()". Note that the type_suffix string isn't copied, so if the argument
isn't a literal string between speech marks, be sure that the string
remains valid for at least as long as the results of cpl_com-
plete_word() are needed.
The cont_suffix is a continuation suffix to append to the completed
word in the input line if this is the only completion. This is some-
thing that isn't part of the completion itself, but that gives the user
an indication about how they might continue to extend the token. For
example, the file-completion callback function adds a directory separa-
tor if the completed word is a directory. If the completed word were a
function name, you could similarly aid the user by arranging for an
open parenthesis to be appended.
CplMatches *cpl_complete_word(WordCompletion *cpl,
const char *line,
int word_end, void *data,
CplMatchFn *match_fn);
The cpl_complete_word() is normally called behind the scenes by
gl_get_line, but can also be called separately if you
separately allocate a WordCompletion object. It performs word comple-
tion, as described at the beginning of this section. Its first argument
is a resource object previously returned by new_WordCompletion(). The
line argument is the input line string, containing the word to be com-
pleted. The word_end argument contains the index of the character in
the input line, that just follows the last character of the word to be
completed. When called by gl_get_line(), this is the character over
which the user pressed TAB. The match_fn argument is the function
pointer of the callback function which will lookup possible completions
of the word, as described above, and the data argument provides a way
for the application to pass arbitrary data to the callback function.
If no errors occur, the cpl_complete_word() function returns a pointer
to a CplMatches container, as defined below. This container is allo-
cated as part of the cpl object that was passed to cpl_complete_word(),
and will thus change on each call which uses the same cpl argument.
typedef struct {
char *completion; /* A matching completion */
/* string */
char *suffix; /* The part of the */
/* completion string which */
/* would have to be */
/* appended to complete the */
/* original word. */
const char *type_suffix; /* A suffix to be added when */
/* listing completions, to */
/* indicate the type of the */
/* completion. */
} CplMatch;
typedef struct {
char *suffix; /* The common initial part */
/* of all of the completion */
/* suffixes. */
const char *cont_suffix; /* Optional continuation */
/* string to be appended to */
/* the sole completion when */
/* nmatch==1. */
CplMatch *matches; /* The array of possible */
/* completion strings, */
/* sorted into lexical */
/* order. */
int nmatch; /* The number of elements in */
/* the above matches[] */
/* array. */
} CplMatches;
If an error occurs during completion, cpl_complete_word() returns NULL.
A description of the error can be acquired by calling the
cpl_last_error() function.
const char *cpl_last_error(WordCompletion *cpl);
The cpl_last_error() function returns a terse description of the error
which occurred on the last call to cpl_complete_word() or cpl_add_com-
pletion().
CplMatches *cpl_recall_matches(WordCompletion *cpl);
As a convenience, the return value of the last call to cpl_com-
plete_word() can be recalled at a later time by calling
cpl_recall_matches(). If cpl_complete_word() returned NULL, so will
cpl_recall_matches().
int cpl_list_completions(CplMatches *result, FILE *fp,
int terminal_width);
When the cpl_complete_word() function returns multiple possible comple-
tions, the cpl_list_completions() function can be called upon to list
them, suitably arranged across the available width of the terminal. It
arranges for the displayed columns of completions to all have the same
width, set by the longest completion. It also appends the type_suffix
strings that were recorded with each completion, thus indicating their
types to the user.
THE BUILT-IN FILENAME-COMPLETION CALLBACK
By default the gl_get_line function, passes the follow-
ing completion callback function to cpl_complete_word(). This function
can also be used separately, either by sending it to cpl_com-
plete_word(), or by calling it directly from your own completion call-
back function.
CPL_MATCH_FN(cpl_file_completions);
Certain aspects of the behavior of this callback can be changed via its
data argument. If you are happy with its default behavior you can pass
NULL in this argument. Otherwise it should be a pointer to a CplFile-
Conf object, previously allocated by calling new_CplFileConf().
CplFileConf *new_CplFileConf(void);
CplFileConf objects encapsulate the configuration parameters of
cpl_file_completions(). These parameters, which start out with default
values, can be changed by calling the accessor functions described
below.
By default, the cpl_file_completions() callback function searches back-
wards for the start of the filename being completed, looking for the
first un-escaped space or the start of the input line. If you wish to
specify a different location, call cfc_file_start() with the index at
which the filename starts in the input line. Passing start_index=-1 re-
enables the default behavior.
void cfc_file_start(CplFileConf *cfc, int start_index);
By default, when cpl_file_completions() looks at a filename in the
input line, each lone backslash in the input line is interpreted as
being a special character which removes any special significance of the
character which follows it, such as a space which should be taken as
part of the filename rather than delimiting the start of the filename.
These backslashes are thus ignored while looking for completions, and
subsequently added before spaces, tabs and literal backslashes in the
list of completions. To have unescaped backslashes treated as normal
characters, call cfc_literal_escapes() with a non-zero value in its
literal argument.
void cfc_literal_escapes(CplFileConf *cfc, int literal);
By default, cpl_file_completions() reports all files who's names start
with the prefix that is being completed. If you only want a selected
subset of these files to be reported in the list of completions, you
can arrange this by providing a callback function which takes the full
pathname of a file, and returns 0 if the file should be ignored, or 1
if the file should be included in the list of completions. To register
such a function for use by cpl_file_completions(), call
cfc_set_check_fn(), and pass it a pointer to the function, together
with a pointer to any data that you would like passed to this callback
whenever it is called. Your callback can make its decisions based on
any property of the file, such as the filename itself, whether the file
is readable, writable or executable, or even based on what the file
contains.
#define CPL_CHECK_FN(fn) int (fn)(void *data, \
const char *pathname)
typedef CPL_CHECK_FN(CplCheckFn);
void cfc_set_check_fn(CplFileConf *cfc,
CplCheckFn *chk_fn, void *chk_data);
The cpl_check_exe() function is a provided callback of the above type,
for use with cpl_file_completions(). It returns non-zero if the file-
name that it is given represents a normal file that the user has exe-
cute permission to. You could use this to have cpl_file_completions()
only list completions of executable files.
When you have finished with a CplFileConf variable, you can pass it to
the del_CplFileConf() destructor function to reclaim its memory.
CplFileConf *del_CplFileConf(CplFileConf *cfc);
THREAD SAFETY
In multi-threaded programs, you should use the libtecla_r.a version of
the library. This uses POSIX reentrant functions where available (hence
the _r suffix), and disables features that rely on non-reentrant system
functions. In the case of this module, the only disabled feature is
username completion in ~username/ expressions, in cpl_file_comple-
tions().
Using the libtecla_r.a version of the library, it is safe to use the
facilities of this module in multiple threads, provided that each
thread uses a separately allocated WordCompletion object. In other
words, if two threads want to do word completion, they should each call
new_WordCompletion() to allocate their own completion objects.
FILES
libtecla.a - The tecla library
libtecla.h - The tecla header file.
SEE ALSO
libtecla, gl_get_line, ef_expand_file,
pca_lookup_file
AUTHOR
Martin Shepherd<EMAIL_ADDRESS>cpl_complete_word


Harry Styles to release new album, ‘Fine Line’, next month
LOS ANGELES, Nov 6 — Harry Styles shared details about his forthcoming new album ahead of his appearance as both the host and musical guest of Saturday Night Live on November 16.
The former One Direction star announced that his sophomore studio album, entitled Fine Line, will arrive a few weeks ahead of Christmas on December 13.
He also revealed the album cover featuring a portrait of Styles in a fuchsia blouse and custom Gucci white sailor pants, which was shot through a fisheye lens.
Rumours that Styles’ sophomore solo album was on its way were fuelled last month, when the 25-year-old vocalist unveiled his latest single, Lights Up, along with a sensual accompanying visual.
The indie-pop song will likely appear on Fine Line, although no track list has been announced yet.
In a recent Rolling Stone cover story, Styles opened up about the genesis of his new solo album, which will follow his 2017 self-titled debut.
The full-length, which he described as “all about having sex and feeling sad”, was recorded over a six-week period in Rick Rubin’s Shangri-La studios in Malibu, California.
Styles notably collaborated with producers Tyler Johnson and Jeff Bhasker, along with writers and musicians from his first LP such as guitarist Mitch Rowland, drummer Sarah Jones and producer Kid Harpoon.
Ahead of the release of Fine Line, Styles will both host and perform on Saturday Night Live on November 16.
As Fader pointed out, he will be the 28th artist to pull double duty in the history of the long-running TV show, which has been previously hosted by fellow musicians Lady Gaga, Taylor Swift and Ariana Grande. — AFP-Relaxnews


"Whoa, whoa, whoa, Detective {{ detective.name }}, that ain't mine!" he said. "I couldn't have been in the lunch room at the time of the deed! I was busy out here, looking for my {{ SuspectsFactory.innocents[1].item }}. Have you seen it? I just looked in the in the lunchroom trash and found {{ SuspectsFactory.innocents[2].item }}.
I also found this {{ detective.favorite }} in the garbage.


Project Admin Area
slony1 Home
|
Slony-I Website
|
Slony-I CVS
|
Mailing Lists
Project Admin Area
Heh. Doesn't exist yet...
Christopher Browne
Last modified: Thu Jan 25 11:46:42 EST 2007


Source code for pyhpeimc.plat.perf
#!/usr/bin/env python3
# author: @netmanchris
# -*- coding: utf-8 -*-
"""
This module contains functions for working with the performance management
capabilities of the HPE IMC NMS platform using the RESTful API
"""
# This section imports required libraries
import json
import requests
HEADERS = {'Accept': 'application/json', 'Content-Type':
'application/json', 'Accept-encoding': 'application/json'}
[docs]def add_perf_task(task, auth, url):
"""
function takes the a python dict containing all necessary fields for a performance tasks, transforms the dict into
JSON and issues a RESTFUL call to create the performance task. device.
:param task: dictionary containing all required fields for performance tasks
:param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class
:param url: base url of IMC RS interface #usually auth.url from pyhpeimc.auth.authclass
:return: 204
:rtype: str
>>> from pyhpeimc.auth import *
>>> from pyhpeimc.plat.perf import *
>>> auth = IMCAuth("http://", "<IP_ADDRESS>", "8080", "admin", "admin")
>>> new_task = {'indexDesc': '<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.3','indexType': '[index1[0]:ciscoEnvMonTemperatureStatusValue:1:0]','itemFunction': '<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>.3','itemName': 'Cisco_Temperature','selectDefaultUnit': '400','unit': 'Celsius'}
>>> new_perf_task = add_perf_task(new_task, auth.creds, auth.url)
"""
add_perf_task_url = "/imcrs/perf/task"
f_url = url + add_perf_task_url
payload = json.dumps(task)
# creates the URL using the payload variable as the contents
r = requests.post(f_url, data=payload, auth=auth, headers=HEADERS)
try:
return r.status_code
except requests.exceptions.RequestException as e:
return "Error:\n" + str(e) + ' add_perf_task: An Error has occured'
[docs]def get_perf_task(task_name, auth, url):
"""
function takes the a str object containing the name of an existing performance tasks and issues a RESTFUL call
to the IMC REST service. It will return a list
:param task_name: str containing the name of the performance task
:param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class
:param url: base url of IMC RS interface #usually auth.url from pyhpeimc.auth.authclass
:return: 204
:rtype: dict
>>> from pyhpeimc.auth import *
>>> from pyhpeimc.plat.perf import *
>>> auth = IMCAuth("http://", "<IP_ADDRESS>", "8080", "admin", "admin")
>>> selected_task = get_perf_task('Cisco_Temperature', auth.creds, auth.url)
>>> assert type(selected_task) is dict
>>> assert 'taskName' in selected_task
"""
get_perf_task_url = "/imcrs/perf/task?name=" + task_name + "&orderBy=taskId&desc=false"
f_url = url + get_perf_task_url
# creates the URL using the payload variable as the contents
r = requests.get(f_url, auth=auth, headers=HEADERS)
try:
if r.status_code == 200:
perf_task_info = (json.loads(r.text))
if 'task' in perf_task_info:
perf_task_info = (json.loads(r.text))['task']
else:
perf_task_info = "Task Doesn't Exist"
return perf_task_info
except requests.exceptions.RequestException as e:
return "Error:\n" + str(e) + ' get_perf_task: An Error has occured'
[docs]def delete_perf_task(task_name, auth, url):
"""
Function takes a str of the target task_name to be deleted and retrieves task_id using
the get_perf_task function. Once the task_id has been successfully retrieved it is
populated into the task_id variable and an DELETE call is made against the HPE IMC REST
interface to delete the target task.
:param task_name: str of task name
:param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class
:param url: base url of IMC RS interface #usually auth.url from pyhpeimc.auth.authclass
:return: int of 204 if successful, str of "Perf Task doesn't exist" i
:rtype: int
"""
task_id = get_perf_task(task_name, auth, url)
if type(task_id) is str:
print("Perf task doesn't exist")
return 403
task_id = task_id['taskId']
get_perf_task_url = "/imcrs/perf/task/delete/" + str(task_id)
f_url = url + get_perf_task_url
# creates the URL using the payload variable as the contents
r = requests.delete(f_url, auth=auth, headers=HEADERS)
try:
if r.status_code == 204:
print("Perf Task successfully delete")
return r.status_code
except requests.exceptions.RequestException as e:
return "Error:\n" + str(e) + ' delete_perf_task: An Error has occured'


[ all classes ]
[ opennlp.tools.ml.maxent.io ]
Coverage Summary for Package: opennlp.tools.ml.maxent.io
| Package | Class, % | Method, % | Line, % |
|---|---|---|---|
| opennlp.tools.ml.maxent.io | 75% (6/ 8) | 71.4% (20/ 28) | 82.9% (116/ 140) |
| Class | Class, % | Method, % | Line, % |
|---|---|---|---|
| BinaryGISModelReader | 0% (0/ 1) | 0% (0/ 1) | 0% (0/ 1) |
| BinaryQNModelReader | 0% (0/ 1) | 0% (0/ 1) | 0% (0/ 1) |
| GISModelReader | 100% (1/ 1) | 50% (2/ 4) | 60% (9/ 15) |
| QNModelReader | 100% (1/ 1) | 50% (2/ 4) | 53.8% (7/ 13) |
| BinaryGISModelWriter | 100% (1/ 1) | 83.3% (5/ 6) | 70.6% (12/ 17) |
| BinaryQNModelWriter | 100% (1/ 1) | 83.3% (5/ 6) | 70.6% (12/ 17) |
| GISModelWriter | 100% (1/ 1) | 100% (4/ 4) | 100% (56/ 56) |
| QNModelWriter | 100% (1/ 1) | 100% (2/ 2) | 100% (20/ 20) |


Nice To Know
IT
Database & Storage
Relational
CockroachDB
Cloud Native / Cluster Aware
https://www.cockroachlabs.com
https://github.com/cockroachdb/cockroach


Correct! You are {{ correctAnswers }} / {{ count }} Nope! You are {{ correctAnswers }} / {{ count }}
You were {{ correctAnswers }} / {{ count-1 }}
That was awful. You should look at the list of people you got wrong.
Congratulations! Now get back to work, and look at the list of people you got wrong.
Maybe you should keep trying bruv. And definitely look at the list of people you got wrong.
100%! If we had gold stars to give out, we would give one to you!
But we don't. So please get back to work. Cheers.
{{ employee.name }}


(Most of these can also be read at Medium.)
{{ post.date | date: "%B %e, %Y" }} — {{ post.headline }}


Legon student dies after armed attack on campus
A final year student of the University of Ghana, Papa Ayensu Appiah Ofori, has died after being attacked on campus.
While the cause of death is yet to be established by a medical report, multiple sources confirm he passed away due to internal bleeding from an injury he suffered following the attack.
Papa Ayensu Appiah Ofori, was reportedly stabbed in the leg by suspected armed robbers on Friday, November 8, 2019, around Block C of the African Union Hall, popularly known as Pent.
The Political Science student, following the attack, was reportedly rushed to the Legon Hospital where he was placed on admission.
Papa Ayensu Appiah Ofori was later discharged on Sunday, November 10, 2019.
On Tuesday, November 12, 2019, the student, known among his colleagues as Don Self, passed away. Some friends of the deceased took to social media to mourn his demise.
State of security around African Union Hall
Students of the University who regularly ply the route leading to the African Union Hall continue to lament about the state of insecurity in the area.
With less security visibility and malfunctioning streetlights along the path leading to the hall, students who ply the route become susceptible to robbers.


Have you ever wished that you could play above your current bracket in Dota 2, but just can’t find the time to level up your account? We can help you with that, that’s exactly what a Dota 2 MMR boosting service is: our professional players will log into your account securely (so no one will ever notice it’s not you that is playing!) and play with it until you reach your desired MMR!
Safe, fast, professional boosting. We boost up to 6500 MMR.
Buy boostRazer Booster– Dota 2 MMR Boosting has proven to be one of the most popular and top rated Dota 2 MMR boosting services out there. There’s a reason more and more customers prefer BoostMMR over our competitors for Dota 2 MMR boosting. We are literally “leagues above the rest” when it comes to providing MMR boost services. Find out today why we have always been, and will always be, the #1 site in the world for Dota 2 MMR boosting. Don’t make the mistake of taking boosting service from amateurs. Our boosters are friendly, professional, and above all, experienced. When choosing BoostMMR – Dota 2 MMR Boosting service, you are choosing to have your Dota 2 account in the best care possible.
We placed a great emphasis on assembling the BoostMMR team. It consists of long-known and trusted MMR boosters with previous MMR boosting experience. These top tier Dota 2 players will consider your order as a professional job, and they will try to finish your order in the quickest possible way. Since quality is one of our main standards, we made great efforts in order to compose the best and most effective MMR boosting team. To achieve this, we signed simply from the best boosters available. Our dedicated team members will give their 100 precent skills and knowledge in order to win all games while MMR boosting your account. We try to accomplish the highest win rate possible, which benefits both the client and the booster.
We think about high-end security as a standard in an online service such as MMR boosting and we also consider security as the most important obligation towards our clients. In order to achieve this level of security, numerous measures were created in pursuance of making our site the most secured. All information provided by our customers is treated privately, such as passwords and usernames. Only the MMR booster employee will have the access to the client provided information since the sites system was worked out in such a way to make this possible. To secure all information stream on the site, SSL Certificate was created, and its banner was placed on the site, such as a green lock illustrating the SSL protection in your browser, located next to the sites address. All transactions on the site are protected with 256-bit Secure Sockets Layer encryption. These measures make BoostMMR the safest MMR boosting site.
We constantly monitor our competitors, negotiate with our employees to provide you the best prices around.  Running a high quality, high volume MMR boosting service takes loads of time, work and funds.
Step 1
Fill the Order Form below. Price will be calculated automatically based on your Current MMR And Desired MMR.
It’s recommended you change to a temporary password while being boosted.
Step 2
Click on “Buy Now With Paypal” you will be redirected to Paypal where you’re able to select your payment option. A Paypal account isn’t required if you have a Credit Card. Paypal is the biggest online payment provider in the world and therefore 100% safe.
Step 3
Our booster will be assigned to your account within 12 hours. Please be patient, boosters usually are in the middle of other order, and they have to finish their current job in order to start your boost. You can expect at least 6 games played a day.
Step 4
You can create a smurf account to chat or spectate while your booster is playing.
Delivery Time:


Hi, I am trying to do like this project - http://openenergymonitor.org/emon/buildingblocks/how-to-build-an-arduino-energy-monitor
for the 2x 470kOhm for both current and voltage i used 10Kohm resistors as it says in the brackets or am I wrong ?

I am using everything the same as the diagram apart from those 471Kohm resistors and I am using Mega 2560
Re: EmonLib Problem on energy monitor
Are those the first readings displayed after you start/restart the sketch? If so, what you are looking at is the output of the high pass filter in the library as it finds the quiescent level of the input (which should be 512, but probably won't be exactly). When the filter has had time to settle, I would expect you to see small random variations in current values, and a small residual power value. This is because the ADC converter seems - especially with Arduino boards - to pick up a small amount of digital noise from the processor itself.
It should be nothing to do with those resistors, which are perfectly OK if you're mains powered, but will add unnecessary current drain if you're running on batteries.
Re: EmonLib Problem on energy monitor
For the sketch that you are using, the AC voltage needs to be sent to the processor via Analog input No 2. The corresponding Vrms should then appear as the 3rd value in each set of results, but this does not appear to be happening.
Are you sure that your voltage signal is being fed to the correct pin of the processor?
Re: EmonLib Problem on energy monitor
@Robert Wall, Yes they are the first readings and running on mains.
@calypso_rae, yes the AC voltage is being sent to A2.
I have quickly re done the current "circuit" and it sort of was showing something but what i was running was 18W and it was showing about 8W (as the second reading). Then it started "refreshing" at about 5 times a second instead of following those 2 sec delay.
I will re wire everything from scratch tomorrow in case I made a mistake, lest hope this fix it :/
Thanks for your replies, will keep you posted.
Re: EmonLib Problem on energy monitor
Then it started "refreshing" at about 5 times a second ...
If the code that you're using is as below, that behaviour sounds correct. Each measurement process will run for 20 half-cycles which takes 200 ms. With no additional delay, loop() will be executed at about 5 times a second
The 2-second time-out is only used to terminate the measurement process if the normal mechanism fails to work. This would presumably happen if the AC voltage signal were not available.
Re: EmonLib Problem on energy monitor
I have made some progress but not quite sure if it working as it should. I ended up re wiring everything from scratch which might have fixed a mistake Ive made.
Anyway, I hooked up a 15" TFT on stand by (No signal mode) to a wall socket meter (below pic) and as you can see it displays 18W, a constant 18W.
This is the output from the arduino while the TFT is switched on
36.08 178.29 134.34 1.33 0.20
-1.08 237.42 134.42 1.77 -0.00
23.45 114.38 132.27 0.86 0.21
24.37 80.28 133.43 0.60 0.30
-2.08 110.30 133.94 0.82 -0.02
27.76 106.46 133.84 0.80 0.26
21.00 69.12 133.85 0.52 0.30
23.71 114.36 134.32 0.85 0.21
38.20 129.76 134.18 0.97 0.29
36.93 95.94 134.34 0.71 0.38
17.77 132.56 134.76 0.98 0.13
27.84 131.05 134.68 0.97 0.21
3.44 112.42 135.31 0.83 0.03
24.53 70.27 135.12 0.52 0.35
And this is a few secs after it is switched off
8.74 56.31 134.95 0.42 0.16
13.31 114.21 134.29 0.85 0.12
4.73 40.29 133.98 0.30 0.12
1.45 94.06 134.29 0.70 0.02
-1.70 98.00 134.18 0.73 -0.02
-6.48 185.53 134.96 1.37 -0.03
6.24 194.18 134.26 1.45 0.03
-8.21 157.65 134.53 1.17 -0.05
-2.14 150.33 131.01 1.15 -0.01
-2.04 204.84 134.33 1.52 -0.01
-10.37 228.85 134.33 1.70 -0.05
5.72 87.61 134.29 0.65 0.07
11.76 113.15 134.61 0.84 0.10
My question : Is it what it should display as Ive seen someone elses output and when switched off it shows zeros
Could it be a calibration issue (second number from the below voltage parameters ?
Re: EmonLib Problem on energy monitor
On your first set of results, the third value did not appear to be showing any voltage signal. But now there is a sensible looking value which is nice and stable, whether or not any current is flowing.
The first two columns should be showing power, but it's not obvious what's going on. Have you tried with a larger load, say a kW or two? Then you should see much more effect. When only 18 Watts is flowing, very little of the ADC's range will be in use, maybe only a step or two depending on the value of your burden resistor.
Re: EmonLib Problem on energy monitor
As calypso_rae says, you are trying to read next to nothing. Your input is designed (unless you've changed things) to read up to 100 A, or about 24 kW. 18 W is only 0.075% of maximum reading, and as I wrote above, I think you're seeing mainly noise and your wanted measurement is buried in the noise.
Re: EmonLib Problem on energy monitor
Some progress :) I did put a larger load and it gave me a more stable readings
I have noticed that the wall monitor is giving me an average because that is what the arduino gave me when I made an average of the readings.
Anyway, I am a little confused on how to calculate the units just like the electricity provider caculates them.
Do i add up all the watts for 1 hour and get an average of those readings (1 reading every second) and then divide by 1000 which should result in units or is there a much more precise formula than that ?
Thanks
Re: EmonLib Problem on energy monitor
I do not understand what a wall monitor is.
The output from SerialPrint is (in order) real power (W), apparent power (VA), rms voltage (V), rms current (A) and power factor.
Your supplier's meter registers kWh, which is real power integrated over time. If you want to do that sum inside your Arduino, the theory is this: you must take the real power samples at whatever time interval you want (normally we use 10 s in the "discrete samples" sketch), multiply it by the interval between readings in seconds - this gives you the energy in Ws (watt seconds, or Joules) and continuously add these resulting values to an accumulator. To convert to kWh, you divide that by 3600000.
It is harder in practice because you cannot have an infinitely long number in the maths, so it is usually best to do the maths in two stages. You accumulate the readings as before in a long integer, then each time before you add the next reading, you test for the accumulated value is greater than 3600000. When it is, you subtract 3600000 from your first accumulator and add 1 to a second accumulator (probably also a long integer). Therefore the second accumulator increments in steps of 1 kWh and is exactly the same as your supplier's meter.
Re: EmonLib Problem on energy monitor
Your revenue meter measures energy, and you're measuring power. Energy is power x time. So if you use a 2kW heater for 3 hours, it will cost you 6kWH, as will a 3kW heater for 2 hours.
If you've arranged things such that your monitor gives you one power reading every second, a steady 18W say, and we assume that was the power reading for the entire second (or an average power reading throughout the second) then you've used 18W x 1sec = 18WattSeconds of energy in that second. A WattSecond is also known as a Joule. There are 3600 WattSeconds in a WattHr, and 3,600,000 WattSeconds in a kWH.
Do i add up all the watts for 1 hour
If you want to mimic your revenue meter, you add up the WattSeconds forever, not just for an hour. The number should always get bigger. Then simply divide it by 3,600,000 if you want to display your accumulated WattSeconds in kWH (which is what most revenue meters display).
Re: EmonLib Problem on energy monitor
I'll bet good money that the 18W being displayed by your plug-through monitor is completely bogus. That particular monitor should go in the bin. In the attached photo you'll see two monitors both monitoring my microwave oven while it's in standby (i.e. just being a clock). The good meter claims it's using 2.5W(*) with a PF of 0.1, the bad meter (which looks identical to yours) claims it's using 98W with a PF of 1 (displayed as a %-age so 100).
I've confirmed the good meter's results with my precision front-end. Further analysis reveals the power supply in the microwave (while in standby) looks like one massive capacitor. It draws a lot of amps (about 98 "watts" worth) with a nice clean sine wave on I, but that sine wave is almost exactly 90 degrees shifted compared to V. So the PF is indeed close to 0, as is the real power being used.
There's something about that signal that completely confuses that make of meter into thinking the PF is 1, so it counts all that apparent power as real power. It's very unlikely that your TFT in standby would have a PF of 1, so I'm guessing the meter is showing the same bug.
(*) some of which will be the power being consumed by the bad meter, given the way I've piggybacked them.
Re: EmonLib Problem on energy monitor
I prepare energy monitor on arduino and i have problem. Without any load i have value :
-37.41 74.64 238.59 0.31 -0.50
-38.75 75.23 237.49 0.32 -0.52
-37.15 74.25 237.58 0.31 -0.50
Load 100W
-143.56 157.94 237.53 0.66 -0.91
-142.66 157.37 237.54 0.66 -0.91
My calibration:
emon1.voltage(A3, 116.8, 1.7); // Voltage: input pin, calibration, phase_shift
emon1.current(A0, 30); // Current: input pin, calibration.
CT sensor:
30A SCT-013-030
Where i should to look for bug?
Re: EmonLib Problem on energy monitor
Which circuit diagram have you used?
Which sketch are you using - what do those numbers represent?
We cannot help you when we do not know what you have.
Re: EmonLib Problem on energy monitor
Circuit diagram
and
Arduino sketch - voltage and current:
// EmonLibrary examples openenergymonitor.org, Licence GNU GPL V3
#include "EmonLib.h" // Include Emon Library
EnergyMonitor emon1; // Create an instance
void setup()
{
Serial.begin(9600);
emon1.voltage(A3, 116.8, 1.7); // Voltage: input pin, calibration, phase_shift
emon1.current(A0, 30); // Current: input pin, calibration.
}
void loop()
{
float sensorValue = analogRead(A0);
emon1.calcVI(20,2000); // Calculate all. No.of half wavelengths (crossings), time-out
emon1.serialprint(); // Print out all variables (realpower, apparent power, Vrms, Irms, power factor)
float realPower = emon1.realPower; //extract Real Power into variable
float apparentPower = emon1.apparentPower; //extract Apparent Power into variable
float powerFActor = emon1.powerFactor; //extract Power Factor into Variable
float supplyVoltage = emon1.Vrms; //extract Vrms into Variable
float Irms = emon1.Irms; //extract Irms into Variable
}
Re: EmonLib Problem on energy monitor
Do you have just the 1 burden resistor per CT channel ? the SCT-013-030 has an internal burden resistor where as the usual SCT-013-000 CT does not.
Re: EmonLib Problem on energy monitor
I use only internal burden resistor. Maybe is it problem in my power supply because of on my supply i have 5,22V and middle point have 2.61V?
Re: EmonLib Problem on energy monitor
The power supply being high should not cause the problem you have.
The numbers you are seeing are Real power, Apparent power, Vrms, Irms and Power factor. The negative power means that you must reverse your CT on its cable.
However, you are reading a current when there should be none. That is almost certainly due to noise being picked up by the analogue to digital converter, which sees it as a current. This is likely to be digital noise from the digital part of your Arduino being transferred via the 5 V supply, but it could also be from your power supply itself. As far as I know, the Arduino PCB has no filtering to reduce this problem, whereas with our emonTx V3, great care was taken with the PCB layout and filtering to reduce this interference. You might be able to reduce the noise a little by putting additional capacitors (say 0.22 μF plastic film) across your 5 V supply to ground, positioned as close to the microprocessor as possible.
Re: EmonLib Problem on energy monitor
I turned wires and values are correct. If the noise is constant whether it can be calibrated in software? If i good understand i should improve power 5v or get new better power supply on 5v?
Re: EmonLib Problem on energy monitor
Unfortunately, although the noise is not true random (white) noise, I cannot say exactly where it comes from and so I cannot guarantee that the noise will be constant. As you can see from the numbers you read, it appears to have a power factor of 0.5, which means that there is both a real part and a reactive part. These two things together mean that it will be difficult to remove it completely in the software. It will be best to try first to remove as much as possible in hardware, then, if it is still a problem, look to subtracting the average value in your sketch.
Re: EmonLib Problem on energy monitor
I exchange power supply and effect is the same:
-36.17 77.07 235.93 0.33 -0.47
-35.16 77.18 236.02 0.33 -0.46
-35.00 73.67 235.87 0.31 -0.48
-37.42 75.87 236.04 0.32 -0.49
-35.83 75.33 235.98 0.32 -0.48
Maybe I'm connect incorrect?
Re: EmonLib Problem on energy monitor
"I exchange power supply and effect is the same:"
Then I think the problem is digital noise from the microprocessor finding a route in to the analogue to digital converter.
Re: EmonLib Problem on energy monitor
What arduino is the best for emoncms? Now I have Pro Mini 5V and probably analog digital converter have a lot of noise.
Re: EmonLib Problem on energy monitor
I know very little about the Arduino range, so I cannot advise you.
But I can tell you two things:
(1) Most of the people who report that they have a noise problem are using the Arduino and not the emonTx.
(2) When I looked at the PCB layout of an Arduino, there was no power supply filtering between the supply pin to the analogue side and the supply pin for the digital side. When Glyn Hudson was laying out the PCB for the emonTx V3, he was very careful to run the analogue circuits as far as possible away from the digital circuits, and screened them with a ground plane. The analogue ground is also separated from the digital ground to prevent 'ground noise' from getting into the ADC.
Re: EmonLib Problem on energy monitor
Some Arduinos do have the AVR recommended inductor between AVCC and VCC. From memory I think the Leonardo might have it. A quick check of your ProMini reveals it doesn't, and nor do my Mega2560s. Here's a very simple check you could start off with. When I try this on my Mega2560 (powered from my desktop's USB port) I see:
Min: 510, Max: 511
Very occasionally Min drops down to 509, and that seems to happen more often on A1 (with the 150K divider) than on A0 (10K divider). You might need to reduce the size of the array depending on how much RAM your Arduino has. The array is only there so you can look at the signal should your rmin/max show something more exciting than 510/511, in which case you can paste the values into a spreadsheet and plot them.
Assuming yours also shows just 510/511 then you could start adding back in the components of your energy monitoring schematic, and see if/when that changes.
[EDIT-1] P.S. I used 1% resistors which would explain why both dividers have nailed the mid-point so well. If you don't have 1%'ers you might see a different value from 510/511, which doesn't matter. You're looking for stability rather than accuracy.
[EDIT-2] P.P.S. If I stick my finger on the mid-point of the divider, the readings go to 505/515 for the low impedance source (A0) and 490/531 for the high impedance source (A1).
Re: EmonLib Problem on energy monitor
Power from USB:
Min: 512, Max: 512
Min: 511, Max: 513
Power from supply:
Min: 508, Max: 514
Do I need better power supply?
PS. I exchanged resistor on middle point and now is better:
load = 0
1.89 25.21 237.43 0.11 0.07
4.43 26.12 237.41 0.11 0.17
4.27 25.63 237.52 0.11 0.17
2.73 26.89 237.57 0.11 0.10
2.40 24.60 237.39 0.10 0.10
4.68 26.69 237.42 0.11 0.18
3.11 26.58 237.72 0.11 0.12
Re: EmonLib Problem on energy monitor
Those values are much more like the numbers we expect to see with an Arduino module project. You might not be able to improve much more than that.
Re: EmonLib Problem on energy monitor
I hope last question. Is it correct code for 3 phases?
// EmonLibrary examples openenergymonitor.org, Licence GNU GPL V3
#include "EmonLib.h" // Include Emon Library
EnergyMonitor emon1; // Create an instance
EnergyMonitor emon2; // Create an instance
EnergyMonitor emon3; // Create an instance
void setup()
{
Serial.begin(115200);
emon1.voltage(A3, 115.8, 1.7); // Voltage: input pin, calibration, phase_shift
emon1.current(A0, 29); // Current: input pin, calibration.
emon2.voltage(A4, 115.8, 1.7); // Voltage: input pin, calibration, phase_shift
emon2.current(A1, 29); // Current: input pin, calibration.
emon3.voltage(A5, 115.8, 1.7); // Voltage: input pin, calibration, phase_shift
emon3.current(A2, 29); // Current: input pin, calibration.
}
void loop()
{
emon1.calcVI(20,2000); // Calculate all. No.of half wavelengths (crossings), time-out
emon1.serialprint(); // Print out all variables (realpower, apparent power, Vrms, Irms, power factor)
emon2.calcVI(20,2000); // Calculate all. No.of half wavelengths (crossings), time-out
emon2.serialprint(); // Print out all variables (realpower, apparent power, Vrms, Irms, power factor)
emon3.calcVI(20,2000); // Calculate all. No.of half wavelengths (crossings), time-out
emon3.serialprint(); // Print out all variables (realpower, apparent power, Vrms, Irms, power factor)
float realPower = emon1.realPower; //extract Real Power into variable
float apparentPower = emon1.apparentPower; //extract Apparent Power into variable
float powerFActor = emon1.powerFactor; //extract Power Factor into Variable
float supplyVoltage = emon1.Vrms; //extract Vrms into Variable
float Irms = emon1.Irms; //extract Irms into Variable
float realPower2 = emon2.realPower; //extract Real Power into variable
float apparentPower2 = emon2.apparentPower; //extract Apparent Power into variable
float powerFActor2 = emon2.powerFactor; //extract Power Factor into Variable
float supplyVoltage2 = emon2.Vrms; //extract Vrms into Variable
float Irms2 = emon2.Irms; //extract Irms into Variable
float realPower3 = emon3.realPower; //extract Real Power into variable
float apparentPower3 = emon3.apparentPower; //extract Apparent Power into variable
float powerFActor3 = emon3.powerFactor; //extract Power Factor into Variable
float supplyVoltage3 = emon3.Vrms; //extract Vrms into Variable
float Irms3 = emon3.Irms; //extract Irms into Variable
}
Re: EmonLib Problem on energy monitor
[Discussion about grounding has been moved to a new thread - RW]
Re: EmonLib Problem on energy monitor
maglo:
That code looks OK, you have created an instance of EnergyMonitor for each phase, and I think you have set each one up with the correct input pins and calibration. You will probably find that, because of component tolerances, you might need different calibration values on each phase. That is perfectly OK.
But there is no need to copy all the values from the instances of EnergyMonitor, and the values will remain in the class members until they are overwritten when you next call calcVI(..).
Re: EmonLib Problem on energy monitor
I think 'double' and 'float' are identical in the AVR gcc implementation. If you've got an ARM based Due, then a it makes a difference.
Re: EmonLib Problem on energy monitor
It would be interesting to know what changes you made, maglo. What values were you using before and after ?
Re: EmonLib Problem on energy monitor
Now is 10k before was 330.
Re: EmonLib Problem on energy monitor
I assume you mean they were 330K before (not ohms),
and these readings were using the 10K dividers, is that correct ?
also were they just average resistors or did you use higher precision ones ?
hope you don't mind me asking.
Re: EmonLib Problem on energy monitor
No. I didn't use yours sketch before for measure.
330 ohm resistor:
-36.17 77.07 235.93 0.33 -0.47
-35.16 77.18 236.02 0.33 -0.46
-35.00 73.67 235.87 0.31 -0.48
-37.42 75.87 236.04 0.32 -0.49
10k resistor :
1.89 25.21 237.43 0.11 0.07
4.43 26.12 237.41 0.11 0.17
4.27 25.63 237.52 0.11 0.17
Re: EmonLib Problem on energy monitor
Maglo18,
In the image that you posted (copy below), you have only one passive Vref supply and it is being shared between all of your sensors. That system will not work at all well, there will a lot of crosstalk between your analogue channels. You should either have a separate Vref circuit for each analog channel, or add an op amp to buffer the single Vref rail so that it remains constant.
Re: EmonLib Problem on energy monitor
If i good understand i should add 6 x different middle point for 3 x voltage meter and 3 x ampere meter?
Re: EmonLib Problem on energy monitor
Maybe better way will be use Micropower Voltage Reference Diodes ex. LM385-2.5 for each analog input?
Re: EmonLib Problem on energy monitor
I do not recommend Zener diodes / voltage reference diodes. To get the best range from your meaurements, you want the midpoint to be exactly the midpoint, whatever the supply voltage happens to be, and not exactly 2.5 V (except of course when the supply happens to be exactly 5.0 V).
As calypso_rae says, if you do not want 6 sets of resistors & capacitor, then use an op. amp. as a voltage follower, as he did in his Mk2 Diverter http://openenergymonitor.org/emon/sites/default/files/Mk2_CircuitSchematic.pdf
Re: EmonLib Problem on energy monitor
Thank you for help. I used 6 sets resistor (24k) and capacitor 100 µF. I hope it is fine because on schematic capacitor doesn't have value
Re: EmonLib Problem on energy monitor
"Building Blocks", where you found the diagram you posted, are not fully engineered circuits. They are examples to explain the theory of how the circuit works. If you want working fully engineered circuits, you should be looking at the schematic diagrams for, in this case, the emonTx. On the Wiki, you will find a link to the diagrams, which are on Solderpad.


With TIBCO Graph Database, you will be able to create intelligent models of data in nodes and edges to be able to dynamically change relationships between sets of data without taking performance hits.
To demonstrate this, with this editor, you will be able to interact with an instance of TIBCO Graph DB to create your own data schema in the form of a graph.
Note that you are able to create relationships without incurring any table joins! This will allow you to dynamically build and analyze relationships in multiple levels without suffering the performance defecits of multiple joins.


   We got stats for that?
Would be cool to see a live graphic showing all the clusters/chains firing up,
Caglio16-Jul-19 02:07 AM
!arrtip cannon 2.00
!arrrtip cannon 2.00
ARRR TipBotBOT16-Jul-19 02:07 AM
:skull_crossbones: @Smedley@Volku@freakbros@ksample8686@Link have been cannonstruck with 0.39998 ARRR!
A network fee of 0.0001 ARRR was deducted from the total amount.
This operation is pending. You will be notified when when it has finished.
rainbro716-Jul-19 02:09 AM
New logo killed the hype :(
dan.16-Jul-19 02:14 AM
It doesn't have instant appeal. But i can see it working
p.16-Jul-19 02:14 AM
Sperm pump
1
Caglio16-Jul-19 02:20 AM
Its best to pump a sperm up the girls butt, so she need to fart me out for a week
The Centricity Mobile App is a mobile extension of our web platform,with three core features designed for comprehensive job management.
dan.16-Jul-19 02:28 AM
I like their logo
Caglio16-Jul-19 02:28 AM
Hm that logo really looks like ours
Are they gonna sue us ?
#rebrandingwentwrong
dan.16-Jul-19 02:29 AM
Don't think there's really a case for that, but kind of funny
Caglio16-Jul-19 02:30 AM
It would be fun if a guy who made the logo earned like 1000kmd to steal logo from others ( :
hyperDEX16-Jul-19 02:30 AM
Take it easy Caglio
grumpygoron16-Jul-19 02:30 AM
Lol it does look identical, even the color scheme is extremely close
hyperDEX16-Jul-19 02:30 AM
Need to take that medication in regular intervals
Caglio16-Jul-19 02:32 AM
Mhm
hyperDEX16-Jul-19 02:33 AM
I let the team know @shrk thanks
Caglio16-Jul-19 02:34 AM
We should have used adidas logo with little komodo underneath(edited)
grumpygoron16-Jul-19 02:35 AM
Re-rebrand coming 2021
2
hyperDEX16-Jul-19 02:35 AM
lol
Na Nike, just do it
It would not be Komodo if it went smooth
p.16-Jul-19 02:36 AM
Re-re-logo-ing in 6 months
Caglio16-Jul-19 02:37 AM
@p. but just the start of re-re-logo-ing - final product, at least 2-3 months later
dan.16-Jul-19 02:37 AM
I'd be curious what other logos they passed on
grumpygoron16-Jul-19 02:37 AM
I miss the library presentation days
Caglio16-Jul-19 02:37 AM
Of all the things I ve lost, I miss my mind the most
shrk16-Jul-19 02:38 AM
Actually I think it's okay that the logos are similar, almost everything in the world of design has already been invented
grumpygoron16-Jul-19 02:38 AM
Let’s copy a logo rather than keeping our original one
Caglio16-Jul-19 02:39 AM
It would be so funny if the whole rebrand is just new logo
shrk16-Jul-19 02:40 AM
Check the site, it’s sexy
Caglio16-Jul-19 02:40 AM
Yeah, looks really nice
!arrrtip cannon 2
ARRR TipBotBOT16-Jul-19 02:43 AM
:skull_crossbones: @ichi@walkerisduder@axsajim.creator(最初に) have been cannonstruck with 0.66663333 ARRR!
A network fee of 0.0001 ARRR was deducted from the total amount.
This operation is pending. You will be notified when when it has finished.
blubbi16-Jul-19 02:46 AM
okay
not toda
Caglio16-Jul-19 02:46 AM
Hahah blubbi lol
I am watching some guy gambling at some btc casino


How do you want to set up your site?
Install October without any plugins or themes. This is a good option to choose for custom building.
You'll need to code your site in HTML / CSS.
Pick from a pre-built site that fits a general purpose and you can customize later.
For example: A blog site, a portfolio site.
If you've set up a project at the OctoberCMS website you can enter it here.
This option can be used to define plugins and themes manually.


Info
Error
Faucet App
Welcome to the Faucet App using Test Blockchain network as part of Kingsland University.- The faucet is an app that holds some coins which is donated from the genesis transaction.
- The faucet works like a wallet.
- It sends 1 coin (or less) to anyone who requests coins. Limits one request per address per hour.
Faucet
NodeURL:
Faucet Sender:
Recipient:
Value (Max of 1 coin -> 1,000,000 micro-coins):


Just give me the website's address like this, and I'll give you JSON with all the metadata I find:
http://maas.dfth.in/meta/campushash.com
Or you can specify any particular metadata you need:
http://maas.dfth.in/meta/description/campushash.com


Introduction to Feature Creation & Dummy Variables
introml.analyticsdojo.com
!wget https://raw.githubusercontent.com/rpi-techfundamentals/spring2019-materials/master/input/train.csv
!wget https://raw.githubusercontent.com/rpi-techfundamentals/spring2019-materials/master/input/test.csv
--2020-11-10 17:42:13-- https://raw.githubusercontent.com/rpi-techfundamentals/spring2019-materials/master/input/train.csv
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... <IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|<IP_ADDRESS>|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 61194 (60K) [text/plain]
Saving to: ‘train.csv.1’
train.csv.1 100%[===================>] 59.76K --.-KB/s in 0.009s
2020-11-10 17:42:13 (6.51 MB/s) - ‘train.csv.1’ saved [61194/61194]
--2020-11-10 17:42:13-- https://raw.githubusercontent.com/rpi-techfundamentals/spring2019-materials/master/input/test.csv
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... <IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|<IP_ADDRESS>|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 28629 (28K) [text/plain]
Saving to: ‘test.csv.1’
test.csv.1 100%[===================>] 27.96K --.-KB/s in 0.005s
2020-11-10 17:42:13 (6.00 MB/s) - ‘test.csv.1’ saved [28629/28629]
15. Feature Extraction¶
Here we will talk about an important piece of machine learning: the extraction of quantitative features from data. By the end of this section you will
Know how features are extracted from real-world data.
See an example of extracting numerical features from textual data
In addition, we will go over several basic tools within scikit-learn which can be used to accomplish the above tasks.
15.1. What Are Features?¶
15.2. Numerical Features¶
Recall that data in scikit-learn is expected to be in two-dimensional arrays, of size n_samples \(\times\) n_features.
Previously, we looked at the iris dataset, which has 150 samples and 4 features
from sklearn.datasets import load_iris
iris = load_iris()
print(iris.data.shape)
(150, 4)
These features are:
sepal length in cm
sepal width in cm
petal length in cm
petal width in cm
Numerical features such as these are pretty straightforward: each sample contains a list of floating-point numbers corresponding to the features
15.3. Categorical Features¶
What if you have categorical features? For example, imagine there is data on the color of each iris:
color in [red, blue, purple]
You might be tempted to assign numbers to these features, i.e. red=1, blue=2, purple=3 but in general this is a bad idea. Estimators tend to operate under the assumption that numerical features lie on some continuous scale, so, for example, 1 and 2 are more alike than 1 and 3, and this is often not the case for categorical features.
In fact, the example above is a subcategory of “categorical” features, namely, “nominal” features. Nominal features don’t imply an order, whereas “ordinal” features are categorical features that do imply an order. An example of ordinal features would be T-shirt sizes, e.g., XL > L > M > S.
One work-around for parsing nominal features into a format that prevents the classification algorithm from asserting an order is the so-called one-hot encoding representation. Here, we give each category its own dimension.
The enriched iris feature set would hence be in this case:
sepal length in cm
sepal width in cm
petal length in cm
petal width in cm
color=purple (1.0 or 0.0)
color=blue (1.0 or 0.0)
color=red (1.0 or 0.0)
Note that using many of these categorical features may result in data which is better represented as a sparse matrix, as we’ll see with the text classification example below.
15.4. Derived Features¶
Another common feature type are derived features, where some pre-processing step is applied to the data to generate features that are somehow more informative. Derived features may be based in feature extraction and dimensionality reduction (such as PCA or manifold learning), may be linear or nonlinear combinations of features (such as in polynomial regression), or may be some more sophisticated transform of the features.
15.5. Combining Numerical and Categorical Features¶
As an example of how to work with both categorical and numerical data, we will perform survival predicition for the passengers of the HMS Titanic.
import os
import pandas as pd
titanic = pd.read_csv('train.csv')
print(titanic.columns)
Index(['PassengerId', 'Survived', 'Pclass', 'Name', 'Sex', 'Age', 'SibSp',
'Parch', 'Ticket', 'Fare', 'Cabin', 'Embarked'],
dtype='object')
Here is a broad description of the keys and what they mean:
pclass Passenger Class
(1 = 1st; 2 = 2nd; 3 = 3rd)
survival Survival
(0 = No; 1 = Yes)
name Name
sex Sex
age Age
sibsp Number of Siblings/Spouses Aboard
parch Number of Parents/Children Aboard
ticket Ticket Number
fare Passenger Fare
cabin Cabin
embarked Port of Embarkation
(C = Cherbourg; Q = Queenstown; S = Southampton)
boat Lifeboat
body Body Identification Number
home.dest Home/Destination
In general, it looks like name
, sex
, cabin
, embarked
, boat
, body
, and homedest
may be candidates for categorical features, while the rest appear to be numerical features. We can also look at the first couple of rows in the dataset to get a better understanding:
titanic.head()
| PassengerId | Survived | Pclass | Name | Sex | Age | SibSp | Parch | Ticket | Fare | Cabin | Embarked | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 1 | 0 | 3 | Braund, Mr. Owen Harris | male | 22.0 | 1 | 0 | A/5 21171 | 7.2500 | NaN | S |
| 1 | 2 | 1 | 1 | Cumings, Mrs. John Bradley (Florence Briggs Th... | female | 38.0 | 1 | 0 | PC 17599 | 71.2833 | C85 | C |
| 2 | 3 | 1 | 3 | Heikkinen, Miss. Laina | female | 26.0 | 0 | 0 | STON/O2. 3101282 | 7.9250 | NaN | S |
| 3 | 4 | 1 | 1 | Futrelle, Mrs. Jacques Heath (Lily May Peel) | female | 35.0 | 1 | 0 | 113803 | 53.1000 | C123 | S |
| 4 | 5 | 0 | 3 | Allen, Mr. William Henry | male | 35.0 | 0 | 0 | 373450 | 8.0500 | NaN | S |
We clearly want to discard the “boat” and “body” columns for any classification into survived vs not survived as they already contain this information. The name is unique to each person (probably) and also non-informative. For a first try, we will use “pclass”, “sibsp”, “parch”, “fare” and “embarked” as our features:
labels = titanic.Survived.values
features = titanic[['Pclass', 'Sex', 'Age', 'SibSp', 'Parch', 'Fare', 'Embarked']].copy()
features.head()
| Pclass | Sex | Age | SibSp | Parch | Fare | Embarked | |
|---|---|---|---|---|---|---|---|
| 0 | 3 | male | 22.0 | 1 | 0 | 7.2500 | S |
| 1 | 1 | female | 38.0 | 1 | 0 | 71.2833 | C |
| 2 | 3 | female | 26.0 | 0 | 0 | 7.9250 | S |
| 3 | 1 | female | 35.0 | 1 | 0 | 53.1000 | S |
| 4 | 3 | male | 35.0 | 0 | 0 | 8.0500 | S |
The data now contains only useful features, but they are not in a format that the machine learning algorithms can understand. We need to transform the strings “male” and “female” into binary variables that indicate the gender, and similarly for “embarked”.
We can do that using the pandas get_dummies
function:
featuremodel=pd.get_dummies(features)
featuremodel
| Pclass | Age | SibSp | Parch | Fare | Sex_female | Sex_male | Embarked_C | Embarked_Q | Embarked_S | |
|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 3 | 22.0 | 1 | 0 | 7.2500 | 0 | 1 | 0 | 0 | 1 |
| 1 | 1 | 38.0 | 1 | 0 | 71.2833 | 1 | 0 | 1 | 0 | 0 |
| 2 | 3 | 26.0 | 0 | 0 | 7.9250 | 1 | 0 | 0 | 0 | 1 |
| 3 | 1 | 35.0 | 1 | 0 | 53.1000 | 1 | 0 | 0 | 0 | 1 |
| 4 | 3 | 35.0 | 0 | 0 | 8.0500 | 0 | 1 | 0 | 0 | 1 |
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
| 886 | 2 | 27.0 | 0 | 0 | 13.0000 | 0 | 1 | 0 | 0 | 1 |
| 887 | 1 | 19.0 | 0 | 0 | 30.0000 | 1 | 0 | 0 | 0 | 1 |
| 888 | 3 | NaN | 1 | 2 | 23.4500 | 1 | 0 | 0 | 0 | 1 |
| 889 | 1 | 26.0 | 0 | 0 | 30.0000 | 0 | 1 | 1 | 0 | 0 |
| 890 | 3 | 32.0 | 0 | 0 | 7.7500 | 0 | 1 | 0 | 1 | 0 |
891 rows × 10 columns
Notice that this includes N dummy variables. When we are modeling we will need N-1 categorical variables.
pd.get_dummies(features, drop_first=True).head()
| Pclass | Age | SibSp | Parch | Fare | Sex_male | Embarked_Q | Embarked_S | |
|---|---|---|---|---|---|---|---|---|
| 0 | 3 | 22.0 | 1 | 0 | 7.2500 | 1 | 0 | 1 |
| 1 | 1 | 38.0 | 1 | 0 | 71.2833 | 0 | 0 | 0 |
| 2 | 3 | 26.0 | 0 | 0 | 7.9250 | 0 | 0 | 1 |
| 3 | 1 | 35.0 | 1 | 0 | 53.1000 | 0 | 0 | 1 |
| 4 | 3 | 35.0 | 0 | 0 | 8.0500 | 1 | 0 | 1 |
This transformation successfully encoded the string columns. However, one might argue that the class is also a categorical variable. We can explicitly list the columns to encode using the columns
parameter, and include pclass
:
features_dummies = pd.get_dummies(features, columns=['Pclass', 'Sex', 'Embarked'], drop_first=True)
features_dummies
| Age | SibSp | Parch | Fare | Pclass_2 | Pclass_3 | Sex_male | Embarked_Q | Embarked_S | |
|---|---|---|---|---|---|---|---|---|---|
| 0 | 22.0 | 1 | 0 | 7.2500 | 0 | 1 | 1 | 0 | 1 |
| 1 | 38.0 | 1 | 0 | 71.2833 | 0 | 0 | 0 | 0 | 0 |
| 2 | 26.0 | 0 | 0 | 7.9250 | 0 | 1 | 0 | 0 | 1 |
| 3 | 35.0 | 1 | 0 | 53.1000 | 0 | 0 | 0 | 0 | 1 |
| 4 | 35.0 | 0 | 0 | 8.0500 | 0 | 1 | 1 | 0 | 1 |
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
| 886 | 27.0 | 0 | 0 | 13.0000 | 1 | 0 | 1 | 0 | 1 |
| 887 | 19.0 | 0 | 0 | 30.0000 | 0 | 0 | 0 | 0 | 1 |
| 888 | NaN | 1 | 2 | 23.4500 | 0 | 1 | 0 | 0 | 1 |
| 889 | 26.0 | 0 | 0 | 30.0000 | 0 | 0 | 1 | 0 | 0 |
| 890 | 32.0 | 0 | 0 | 7.7500 | 0 | 1 | 1 | 1 | 0 |
891 rows × 9 columns
#Transform from Pandas to numpy with .values
data = features_dummies.values
data
array([[22., 1., 0., ..., 1., 0., 1.],
[38., 1., 0., ..., 0., 0., 0.],
[26., 0., 0., ..., 0., 0., 1.],
...,
[nan, 1., 2., ..., 0., 0., 1.],
[26., 0., 0., ..., 1., 0., 0.],
[32., 0., 0., ..., 1., 1., 0.]])
type(data)
numpy.ndarray
16. Feature Preprocessing with Scikit Learn¶
Here we are going to look at a more efficient way to prepare our datasets using pipelines.
features.head()
| Pclass | Sex | Age | SibSp | Parch | Fare | Embarked | |
|---|---|---|---|---|---|---|---|
| 0 | 3 | male | 22.0 | 1 | 0 | 7.2500 | S |
| 1 | 1 | female | 38.0 | 1 | 0 | 71.2833 | C |
| 2 | 3 | female | 26.0 | 0 | 0 | 7.9250 | S |
| 3 | 1 | female | 35.0 | 1 | 0 | 53.1000 | S |
| 4 | 3 | male | 35.0 | 0 | 0 | 8.0500 | S |
features.isna().sum()
Pclass 0
Sex 0
Age 177
SibSp 0
Parch 0
Fare 0
Embarked 2
dtype: int64
#Quick example to show how the data Imputer works.
from sklearn.impute import SimpleImputer
import numpy as np
imp_mean = SimpleImputer(missing_values=np.nan, strategy='mean')
imp_mean=imp_mean.fit_transform([[7, 2, 3], [4, np.nan, 6], [10, 5, 9]])
imp_mean
array([[ 7. , 2. , 3. ],
[ 4. , 3.5, 6. ],
[10. , 5. , 9. ]])
A really useful function below. You will want to remember this one.
from sklearn.preprocessing import StandardScaler, OneHotEncoder
from sklearn.compose import make_column_transformer
from sklearn.impute import SimpleImputer
from sklearn.pipeline import Pipeline, make_pipeline
missing_values = ['Age','Embarked']
features_num = ['Fare', 'Age']
features_cat = [ 'Sex', 'Embarked', 'Pclass', 'SibSp']
def pre_process_dataframe(df, numeric, categorical, missing=np.nan, missing_num='mean', missing_cat = 'most_frequent'):
"""This will use a data imputer to fill in missing values and standardize numeric features.
"""
#Create a data imputer for numeric values
imp_num = SimpleImputer(missing_values=missing, strategy=missing_num)
#Create a pipeline which imputes values and then usese the standard scaler.
pipe_num = make_pipeline(imp_num, StandardScaler()) # StandardScaler()
#Create a different imputer for categorical values.
imp_cat = SimpleImputer(missing_values=missing, strategy=missing_cat)
pipe_cat = make_pipeline(imp_cat, OneHotEncoder(drop= 'first'))
preprocessor = make_column_transformer((pipe_num, features_num),(pipe_cat, features_cat))
return pd.DataFrame(preprocessor.fit_transform(df))
df=pre_process_dataframe(features, features_num, features_cat )
df
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | -0.502445 | -0.592481 | 1.0 | 0.0 | 1.0 | 0.0 | 1.0 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 |
| 1 | 0.786845 | 0.638789 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 |
| 2 | -0.488854 | -0.284663 | 0.0 | 0.0 | 1.0 | 0.0 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 |
| 3 | 0.420730 | 0.407926 | 0.0 | 0.0 | 1.0 | 0.0 | 0.0 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 |
| 4 | -0.486337 | 0.407926 | 1.0 | 0.0 | 1.0 | 0.0 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 |
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
| 886 | -0.386671 | -0.207709 | 1.0 | 0.0 | 1.0 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 |
| 887 | -0.044381 | -0.823344 | 0.0 | 0.0 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 |
| 888 | -0.176263 | 0.000000 | 0.0 | 0.0 | 1.0 | 0.0 | 1.0 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 |
| 889 | -0.044381 | -0.284663 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 |
| 890 | -0.492378 | 0.177063 | 1.0 | 1.0 | 0.0 | 0.0 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 |
891 rows × 13 columns


◆ getIdHash()
| String ch.ethz.systems.netbench.core.config.GraphDetails.getIdHash |
( |
| ) |
|
Get the identifying hash for the this topology. The identifying hash is the SHA-1 hash of the topology file's content.
- Returns
- Topology identifying hash
◆ getNumEdges()
| int ch.ethz.systems.netbench.core.config.GraphDetails.getNumEdges |
( |
| ) |
|
Retrieve number of edges.
- Returns
- Number of edges
◆ getNumNodes()
| int ch.ethz.systems.netbench.core.config.GraphDetails.getNumNodes |
( |
| ) |
|
Retrieve number of nodes.
- Returns
- Number of nodes
◆ getNumServers()
| int ch.ethz.systems.netbench.core.config.GraphDetails.getNumServers |
( |
| ) |
|
Get the number of servers (nodes with transport layer).
- Returns
- Number of servers
◆ getNumSwitches()
| int ch.ethz.systems.netbench.core.config.GraphDetails.getNumSwitches |
( |
| ) |
|
Get the number of switches (nodes that cannot have a transport layer, nor be directly connected to a server).
- Returns
- Number of switches
◆ getNumTors()
| int ch.ethz.systems.netbench.core.config.GraphDetails.getNumTors |
( |
| ) |
|
Get the number of Top of Racks (ToRs) (either all ToRs are servers, or every server is connected to a ToR).
- Returns
- Number of ToRs
◆ getServerNodeIds()
| Set<Integer> ch.ethz.systems.netbench.core.config.GraphDetails.getServerNodeIds |
( |
| ) |
|
Retrieve all node identifiers marked with having a transport layer.
- Returns
- List of transport layer node identifiers
◆ getServersOfTor()
| Set<Integer> ch.ethz.systems.netbench.core.config.GraphDetails.getServersOfTor |
( |
int |
torNodeId | ) |
|
Get all the servers associated with a certain ToR.
- Parameters
-
| torNodeId | ToR node identifier |
- Returns
- Set of associated servers
◆ getSwitchNodeIds()
| Set<Integer> ch.ethz.systems.netbench.core.config.GraphDetails.getSwitchNodeIds |
( |
| ) |
|
Retrieve all node identifiers only doing switching.
- Returns
- List of switch node identifiers
◆ getTorIdOfServer()
| Integer ch.ethz.systems.netbench.core.config.GraphDetails.getTorIdOfServer |
( |
int |
serverId | ) |
|
Retrieve the ToR identifier of ToR to which the server belongs and is connected to.
- Parameters
-
| serverId | Server identifier |
- Returns
- ToR identifier
◆ getTorNodeIds()
| Set<Integer> ch.ethz.systems.netbench.core.config.GraphDetails.getTorNodeIds |
( |
| ) |
|
Retrieve all node identifiers marked as ToR.
- Returns
- List of ToR node identifiers
◆ isAutoExtended()
| boolean ch.ethz.systems.netbench.core.config.GraphDetails.isAutoExtended |
( |
| ) |
|
Check whether the graph was extended.
- Returns
- True iff the graph was extended with servers
◆ autoExtended
| boolean ch.ethz.systems.netbench.core.config.GraphDetails.autoExtended |
|
private |
◆ idHash
| final String ch.ethz.systems.netbench.core.config.GraphDetails.idHash |
|
private |
◆ numEdges
| int ch.ethz.systems.netbench.core.config.GraphDetails.numEdges |
|
private |
◆ numNodes
| int ch.ethz.systems.netbench.core.config.GraphDetails.numNodes |
|
private |
◆ serverNodeIds
| Set<Integer> ch.ethz.systems.netbench.core.config.GraphDetails.serverNodeIds |
|
private |
◆ serverToTorId
| HashMap<Integer, Integer> ch.ethz.systems.netbench.core.config.GraphDetails.serverToTorId |
|
private |
◆ switchNodeIds
| Set<Integer> ch.ethz.systems.netbench.core.config.GraphDetails.switchNodeIds |
|
private |
◆ torNodeIds
| Set<Integer> ch.ethz.systems.netbench.core.config.GraphDetails.torNodeIds |
|
private |
◆ torToServerIds
| HashMap<Integer, Set<Integer> > ch.ethz.systems.netbench.core.config.GraphDetails.torToServerIds |
|
private |
The documentation for this class was generated from the following file:


Create build trigger
Go to Goggle Cloud Build → Build Triggers section on the GCP Console and click “Add trigger”:
Select GitHub as the source of your repository. In the next screen, you may be asked to authorize access to your GitHub account and repositories. This is needed for Google Cloud Source Repositories to mirror and create commit hooks on your GitHub repositories.
Then, pick your repository from the list
In the next screen
- give this Build Trigger a name (e.g. master)
- choose Build Configuration "cloudbuild.yaml"
- choose Trigger Type ”Branch”
- Set the file location to cloudbuild.yaml
create a cloudbuild.yaml file with the following contents in your repository.
I am using jekyll for static site builder, _site directory is where the generated site will be placed (by default) once Jekyll is done build. replace _site with your website content directory
YAML file declares a build step with the gsutil -m rsync command and makes sure that the website is uploaded to the storage bucket. The -m flag accelerates upload by processing multiple files in parallel and the -c flag avoids re-uploading unchanged files.
Trigger the first build
Once you push the cloudbuild.yaml file to your repository and create the Build Trigger, you can kick off the first build manually. Head over to the GCP Console Build Triggers section, click “Run Trigger”


WITNESS LIST Sex Offenders (Interim) Committee November 12, 1997-9:30A Sex Offender Treatment Programs On: Capers. Lisa (Tx Juvenile Prob. Comm.), Austin Fabelo, Tony (CJPC, Director), Austin Hayes, Patricia (Texas Youth Commission), Austin Jeffries, Carl (TDCJ, Dir Prog & Serv), Huntsville Johnson, Judy Dr. (TDCJ, Clinical Director), Huntsville McLane, Marsha (TDCJ, Assist Dir.), Huntsville McVey, Catherine (TDCJ, Assist Dir Prog), Hunstville Reyes, Linda Dr. (Texas Youth Commission), Austin Robinson, Steve (Texas Youth Commission), Austin Scott, Wayne (TDCJ, Director), Hunstville Spriggs, Vicki (Tx Juv. Prob Comm, Dir.), Austin Registering, but not testifying: On: Aguirre, Ana (Tx Juv. Prob Comm.), Austin


MenuAim jQuery plugin advanced example
with Responsive Horizontal Drop-Down Menu
Features
- UX enhancement for drop-down menus to achieve behavior when moving mouse cursor towards submenu through sibling menu item, current submenu stays open and sibling submenu does not open
- Ability to set first submenu activation delay - in case menu opening is optional and not crutial and is potentially annoying to users
- When mouse cursor leaves menu submenu autocloses (if set in 'hover' mode)
- When in 'click' mode, user can close submenu by clicking outside menu
- Ability to set whether submenu opens on 'hover' (default) or 'click'
- Ability to change submenu opening trigger on-the-fly
Switch submenu open trigger
Switch to CLICK
Switch to HOVER
Repository
You can clone, download or see additional project details on https://github.com/banesto/jQuery-menu-aim.
Menu design by codrops


A ContactPatch is the description of the forces and the deformed shape of the contact surfaces that result from compliant contact interactions.
This should not be confused with the Contact object that describes only the overlap in undeformed surface geometry and knows nothing of forces or materials. Although there are several qualitatively different kinds of compliant contact models, we assume that each can be described by some number of contact "elements" and report the detailed results in terms of those elements. Depending on the model, the elements may be associated with the surfaces or may be associated with the patch. Either way, every element applies equal and opposite forces to both surfaces. There is not necessarily any direct correspondence between elements on one surface with elements on the other.
A Hertz contact will have only a single element that belongs to the patch, while an elastic foundation contact will have many, with each element associated with one or the other surface. Only the elements that are currently participating in contact will have entries here; the surface and element id is stored with each piece of ContactDetail information. There is also some basic information needed to advance the simulation and that is common to all contact patch types and stored as a ContactForce resultant.


Once upon a time, an ocean away, Mischa was a software developer. Since than, he has mastered moving skills. In places whith dimmed light and loud music, he calls himself A Movin' Star, which is often over heard as A Movie Star.
Build a Portfolio Site is the second project built during completion of the Udacity's Nanodegree program Full Stack Web Developer.
Google Chrome extension that integrates Granot Moving Software with (some) Google services
MakeSpace Tip Calculator is an app for MakeSpace Gmail domain users. It searches user's mailbox for e-mail messages that contain info about tips received and makes a digest of data found.