| Top |
| gchar * | accept-language | Read / Write |
| gboolean | accept-language-auto | Read / Write |
| SoupSessionFeature * | add-feature | Read / Write |
| GType * | add-feature-by-type | Read / Write |
| gpointer | async-context | Read / Write / Construct Only |
| GStrv | http-aliases | Read / Write |
| GStrv | https-aliases | Read / Write |
| guint | idle-timeout | Read / Write |
| SoupAddress * | local-address | Read / Write / Construct Only |
| gint | max-conns | Read / Write |
| gint | max-conns-per-host | Read / Write |
| GProxyResolver * | proxy-resolver | Read / Write |
| SoupURI * | proxy-uri | Read / Write |
| GType * | remove-feature-by-type | Read / Write |
| gchar * | ssl-ca-file | Read / Write |
| gboolean | ssl-strict | Read / Write |
| gboolean | ssl-use-system-ca-file | Read / Write |
| guint | timeout | Read / Write |
| GTlsDatabase * | tls-database | Read / Write |
| GTlsInteraction * | tls-interaction | Read / Write |
| gboolean | use-ntlm | Read / Write |
| gboolean | use-thread-context | Read / Write |
| gchar * | user-agent | Read / Write |
| void | authenticate | Run First |
| void | connection-created | Run First |
| void | request-queued | Run First |
| void | request-started | Run First |
| void | request-unqueued | Run First |
| void | tunneling | Run First |
| SoupSession | |
| enum | SoupRequestError |
| #define | SOUP_REQUEST_ERROR |
| #define | SOUP_SESSION_PROXY_URI |
| #define | SOUP_SESSION_PROXY_RESOLVER |
| #define | SOUP_SESSION_MAX_CONNS |
| #define | SOUP_SESSION_MAX_CONNS_PER_HOST |
| #define | SOUP_SESSION_TLS_DATABASE |
| #define | SOUP_SESSION_SSL_USE_SYSTEM_CA_FILE |
| #define | SOUP_SESSION_SSL_CA_FILE |
| #define | SOUP_SESSION_SSL_STRICT |
| #define | SOUP_SESSION_ASYNC_CONTEXT |
| #define | SOUP_SESSION_USE_THREAD_CONTEXT |
| #define | SOUP_SESSION_TIMEOUT |
| #define | SOUP_SESSION_IDLE_TIMEOUT |
| #define | SOUP_SESSION_USER_AGENT |
| #define | SOUP_SESSION_ADD_FEATURE |
| #define | SOUP_SESSION_ADD_FEATURE_BY_TYPE |
| #define | SOUP_SESSION_REMOVE_FEATURE_BY_TYPE |
| #define | SOUP_SESSION_ACCEPT_LANGUAGE |
| #define | SOUP_SESSION_ACCEPT_LANGUAGE_AUTO |
| #define | SOUP_SESSION_HTTP_ALIASES |
| #define | SOUP_SESSION_HTTPS_ALIASES |
| #define | SOUP_SESSION_LOCAL_ADDRESS |
SoupSession is the object that controls client-side HTTP. A SoupSession encapsulates all of the state that libsoup is keeping on behalf of your program; cached HTTP connections, authentication information, etc. It also keeps track of various global options and features that you are using.
Most applications will only need a single SoupSession; the primary reason you might need multiple sessions is if you need to have multiple independent authentication contexts. (Eg, you are connecting to a server and authenticating as two different users at different times; the easiest way to ensure that each SoupMessage is sent with the authentication information you intended is to use one session for the first user, and a second session for the other user.)
In the past, SoupSession was an abstract class, and users needed
to choose between SoupSessionAsync (which always uses
GMainLoop-based I/O), or SoupSessionSync (which always uses
blocking I/O and can be used from multiple threads simultaneously).
This is no longer necessary; you can (and should) use a plain
SoupSession, which supports both synchronous and asynchronous use.

SoupSession *
soup_session_new (void
);
Creates a SoupSession with the default options.
Since 2.42
SoupSession * soup_session_new_with_options (const char *optname1
,...
);
Creates a SoupSession with the specified options.
optname1 |
name of first property to set |
|
... |
value of |
Since 2.42
SoupRequest * soup_session_request (SoupSession *session
,const char *uri_string
,GError **error
);
Creates a SoupRequest for retrieving uri_string
.
Since 2.42
SoupRequest * soup_session_request_uri (SoupSession *session
,SoupURI *uri
,GError **error
);
Creates a SoupRequest for retrieving uri
.
session |
||
uri |
a SoupURI representing the URI to retrieve |
|
error |
return location for a GError, or |
Since 2.42
SoupRequestHTTP * soup_session_request_http (SoupSession *session
,const char *method
,const char *uri_string
,GError **error
);
Creates a SoupRequest for retrieving uri_string
, which must be an
"http" or "https" URI (or another protocol listed in session
's
“http-aliases” or “https-aliases”).
session |
||
method |
an HTTP method |
|
uri_string |
a URI, in string form |
|
error |
return location for a GError, or |
Since 2.42
SoupRequestHTTP * soup_session_request_http_uri (SoupSession *session
,const char *method
,SoupURI *uri
,GError **error
);
Creates a SoupRequest for retrieving uri
, which must be an
"http" or "https" URI (or another protocol listed in session
's
“http-aliases” or “https-aliases”).
session |
||
method |
an HTTP method |
|
uri |
a SoupURI representing the URI to retrieve |
|
error |
return location for a GError, or |
Since 2.42
void (*SoupSessionCallback) (SoupSession *session
,SoupMessage *msg
,gpointer user_data
);
Prototype for the callback passed to soup_session_queue_message()
,
qv.
void soup_session_queue_message (SoupSession *session
,SoupMessage *msg
,SoupSessionCallback callback
,gpointer user_data
);
Queues the message msg
for asynchronously sending the request and
receiving a response in the current thread-default GMainContext.
If msg
has been processed before, any resources related to the
time it was last sent are freed.
Upon message completion, the callback specified in callback
will
be invoked. If after returning from this callback the message has not
been requeued, msg
will be unreffed.
(The behavior above applies to a plain SoupSession; if you are using SoupSessionAsync or SoupSessionSync, then the GMainContext that is used depends on the settings of “async-context” and “use-thread-context”, and for SoupSessionSync, the message will actually be sent and processed in another thread, with only the final callback occurring in the indicated GMainContext.)
Contrast this method with soup_session_send_async()
, which also
asynchronously sends a message, but returns before reading the
response body, and allows you to read the response via a
GInputStream.
session |
||
msg |
the message to queue. |
[transfer full] |
callback |
a SoupSessionCallback which will be called after the message completes or when an unrecoverable error occurs. |
[allow-none][scope async] |
user_data |
a pointer passed to |
[allow-none] |
void soup_session_requeue_message (SoupSession *session
,SoupMessage *msg
);
This causes msg
to be placed back on the queue to be attempted
again.
guint soup_session_send_message (SoupSession *session
,SoupMessage *msg
);
Synchronously send msg
. This call will not return until the
transfer is finished successfully or there is an unrecoverable
error.
Unlike with soup_session_queue_message()
, msg
is not freed upon
return.
(Note that if you call this method on a SoupSessionAsync, it will still use asynchronous I/O internally, running the glib main loop to process the message, which may also cause other events to be processed.)
Contrast this method with soup_session_send()
, which also
synchronously sends a message, but returns before reading the
response body, and allows you to read the response via a
GInputStream.
void soup_session_cancel_message (SoupSession *session
,SoupMessage *msg
,guint status_code
);
Causes session
to immediately finish processing msg
(regardless
of its current state) with a final status_code of status_code
. You
may call this at any time after handing msg
off to session
; if
session
has started sending the request but has not yet received
the complete response, then it will close the request's connection.
Note that with requests that have side effects (eg,
POST
, PUT
,
DELETE
) it is possible that you might cancel the
request after the server acts on it, but before it returns a
response, leaving the remote resource in an unknown state.
If the message is cancelled while its response body is being read,
then the response body in msg
will be left partially-filled-in.
The response headers, on the other hand, will always be either
empty or complete.
Beware that with the deprecated SoupSessionAsync, messages queued
with soup_session_queue_message()
will have their callbacks invoked
before soup_session_cancel_message()
returns. The plain
SoupSession does not have this behavior; cancelling an
asynchronous message will merely queue its callback to be run after
returning to the main loop.
session |
||
msg |
the message to cancel |
|
status_code |
status code to set on |
GInputStream * soup_session_send (SoupSession *session
,SoupMessage *msg
,GCancellable *cancellable
,GError **error
);
Synchronously sends msg
and waits for the beginning of a response.
On success, a GInputStream will be returned which you can use to
read the response body. ("Success" here means only that an HTTP
response was received and understood; it does not necessarily mean
that a 2xx class status code was received.)
If non-NULL
, cancellable
can be used to cancel the request;
soup_session_send()
will return a G_IO_ERROR_CANCELLED
error. Note
that with requests that have side effects (eg,
POST
, PUT
,
DELETE
) it is possible that you might cancel the
request after the server acts on it, but before it returns a
response, leaving the remote resource in an unknown state.
If msg
is requeued due to a redirect or authentication, the
initial (3xx/401/407) response body will be suppressed, and
soup_session_send()
will only return once a final response has been
received.
Contrast this method with soup_session_send_message()
, which also
synchronously sends a SoupMessage, but doesn't return until the
response has been completely read.
(Note that this method cannot be called on the deprecated SoupSessionAsync subclass.)
Since 2.42
void soup_session_send_async (SoupSession *session
,SoupMessage *msg
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Asynchronously sends msg
and waits for the beginning of a
response. When callback
is called, then either msg
has been sent,
and its response headers received, or else an error has occurred.
Call soup_session_send_finish()
to get a GInputStream for reading
the response body.
See soup_session_send()
for more details on the general semantics.
Contrast this method with soup_session_queue_message()
, which also
asynchronously sends a SoupMessage, but doesn't invoke its
callback until the response has been completely read.
(Note that this method cannot be called on the deprecated SoupSessionSync subclass, and can only be called on SoupSessionAsync if you have set the “use-thread-context” property.)
Since 2.42
GInputStream * soup_session_send_finish (SoupSession *session
,GAsyncResult *result
,GError **error
);
Gets the response to a soup_session_send_async()
call and (if
successful), returns a GInputStream that can be used to read the
response body.
session |
||
result |
the GAsyncResult passed to your callback |
|
error |
return location for a GError, or |
Since 2.42
void soup_session_prefetch_dns (SoupSession *session
,const char *hostname
,GCancellable *cancellable
,SoupAddressCallback callback
,gpointer user_data
);
Tells session
that an URI from the given hostname
may be requested
shortly, and so the session can try to prepare by resolving the
domain name in advance, in order to work more quickly once the URI
is actually requested.
If cancellable
is non-NULL
, it can be used to cancel the
resolution. callback
will still be invoked in this case, with a
status of SOUP_STATUS_CANCELLED
.
session |
||
hostname |
a hostname to be resolved |
|
cancellable |
a GCancellable object, or |
[allow-none] |
callback |
callback to call with the
result, or |
[scope async][allow-none] |
user_data |
data for |
Since 2.38
void soup_session_prepare_for_uri (SoupSession *session
,SoupURI *uri
);
soup_session_prepare_for_uri
has been deprecated since version 2.38 and should not be used in newly-written code.
use soup_session_prefetch_dns()
instead
Tells session
that uri
may be requested shortly, and so the
session can try to prepare (resolving the domain name, obtaining
proxy address, etc.) in order to work more quickly once the URI is
actually requested.
Since 2.30
void
soup_session_abort (SoupSession *session
);
Cancels all pending requests in session
and closes all idle
persistent connections.
The message cancellation has the same semantics as with
soup_session_cancel_message()
; asynchronous requests on a
SoupSessionAsync will have their callback called before
soup_session_abort()
returns. Requests on a plain SoupSession will
not.
gboolean soup_session_would_redirect (SoupSession *session
,SoupMessage *msg
);
Checks if msg
contains a response that would cause session
to
redirect it to a new URL (ignoring msg
's SOUP_MESSAGE_NO_REDIRECT
flag, and the number of times it has already been redirected).
Since 2.38
gboolean soup_session_redirect_message (SoupSession *session
,SoupMessage *msg
);
Updates msg
's URI according to its status code and "Location"
header, and requeues it on session
. Use this when you have set
SOUP_MESSAGE_NO_REDIRECT
on a message, but have decided to allow a
particular redirection to occur, or if you want to allow a
redirection that SoupSession will not perform automatically (eg,
redirecting a non-safe method such as DELETE).
If msg
's status code indicates that it should be retried as a GET
request, then msg
will be modified accordingly.
If msg
has already been redirected too many times, this will
cause it to fail with SOUP_STATUS_TOO_MANY_REDIRECTS
.
TRUE
if a redirection was applied, FALSE
if not
(eg, because there was no Location header, or it could not be
parsed).
Since 2.38
void soup_session_pause_message (SoupSession *session
,SoupMessage *msg
);
Pauses HTTP I/O on msg
. Call soup_session_unpause_message()
to
resume I/O.
This may only be called for asynchronous messages (those sent on a
SoupSessionAsync or using soup_session_queue_message()
).
void soup_session_unpause_message (SoupSession *session
,SoupMessage *msg
);
Resumes HTTP I/O on msg
. Use this to resume after calling
soup_session_pause_message()
.
If msg
is being sent via blocking I/O, this will resume reading or
writing immediately. If msg
is using non-blocking I/O, then
reading or writing won't resume until you return to the main loop.
This may only be called for asynchronous messages (those sent on a
SoupSessionAsync or using soup_session_queue_message()
).
GMainContext *
soup_session_get_async_context (SoupSession *session
);
Gets session
's “async-context”. This does not add a ref
to the context, so you will need to ref it yourself if you want it
to outlive its session.
For a modern SoupSession, this will always just return the thread-default GMainContext, and so is not especially useful.
void soup_session_add_feature (SoupSession *session
,SoupSessionFeature *feature
);
Adds feature
's functionality to session
. You can also add a
feature to the session at construct time by using the
SOUP_SESSION_ADD_FEATURE
property.
Note that a SoupContentDecoder is added to the session by default (unless you are using one of the deprecated session subclasses).
Since 2.24
void soup_session_add_feature_by_type (SoupSession *session
,GType feature_type
);
If feature_type
is the type of a class that implements
SoupSessionFeature, this creates a new feature of that type and
adds it to session
as with soup_session_add_feature()
. You can use
this when you don't need to customize the new feature in any way.
If feature_type
is not a SoupSessionFeature type, this gives each
existing feature on session
the chance to accept feature_type
as
a "subfeature". This can be used to add new SoupAuth or
SoupRequest types, for instance.
You can also add a feature to the session at construct time by
using the SOUP_SESSION_ADD_FEATURE_BY_TYPE
property.
Note that a SoupContentDecoder is added to the session by default (unless you are using one of the deprecated session subclasses).
Since 2.24
void soup_session_remove_feature (SoupSession *session
,SoupSessionFeature *feature
);
Removes feature
's functionality from session
.
Since 2.24
void soup_session_remove_feature_by_type (SoupSession *session
,GType feature_type
);
Removes all features of type feature_type
(or any subclass of
feature_type
) from session
. You can also remove standard features
from the session at construct time by using the
SOUP_SESSION_REMOVE_FEATURE_BY_TYPE
property.
Since 2.24
GSList * soup_session_get_features (SoupSession *session
,GType feature_type
);
Generates a list of session
's features of type feature_type
. (If
you want to see all features, you can pass SOUP_TYPE_SESSION_FEATURE
for feature_type
.)
a list of features. You must free the list, but not its contents.
[transfer container][element-type Soup.SessionFeature]
Since 2.26
SoupSessionFeature * soup_session_get_feature (SoupSession *session
,GType feature_type
);
Gets the first feature in session
of type feature_type
. For
features where there may be more than one feature of a given type,
use soup_session_get_features()
.
Since 2.26
SoupSessionFeature * soup_session_get_feature_for_message (SoupSession *session
,GType feature_type
,SoupMessage *msg
);
Gets the first feature in session
of type feature_type
, provided
that it is not disabled for msg
. As with
soup_session_get_feature()
, this should only be used for features
where feature_type
is only expected to match a single feature. In
particular, if there are two matching features, and the first is
disabled on msg
, and the second is not, then this will return
NULL
, not the second feature.
Since 2.28
gboolean soup_session_has_feature (SoupSession *session
,GType feature_type
);
Tests if session
has at a feature of type feature_type
(which can
be the type of either a SoupSessionFeature, or else a subtype of
some class managed by another feature, such as SoupAuth or
SoupRequest).
Since 2.42
A SoupRequest error.
|
the URI could not be parsed |
||
|
the URI scheme is not supported by this SoupSession |
||
|
the server's response could not be parsed |
||
|
the server's response was in an unsupported format |
Since 2.42
#define SOUP_REQUEST_ERROR soup_request_error_quark ()
A GError domain for SoupRequest-related errors. Used with SoupRequestError.
Since 2.42
#define SOUP_SESSION_PROXY_URI "proxy-uri"
Alias for the “proxy-uri” property, qv.
#define SOUP_SESSION_PROXY_RESOLVER "proxy-resolver"
Alias for the “proxy-resolver” property, qv.
#define SOUP_SESSION_MAX_CONNS "max-conns"
Alias for the “max-conns” property, qv.
#define SOUP_SESSION_MAX_CONNS_PER_HOST "max-conns-per-host"
Alias for the “max-conns-per-host” property, qv.
#define SOUP_SESSION_TLS_DATABASE "tls-database"
Alias for the “tls-database” property, qv.
Since 2.38
#define SOUP_SESSION_SSL_USE_SYSTEM_CA_FILE "ssl-use-system-ca-file"
Alias for the “ssl-use-system-ca-file” property, qv.
Since 2.38
#define SOUP_SESSION_SSL_CA_FILE "ssl-ca-file"
Alias for the “ssl-ca-file” property, qv.
#define SOUP_SESSION_SSL_STRICT "ssl-strict"
Alias for the “ssl-strict” property, qv.
Since 2.30
#define SOUP_SESSION_ASYNC_CONTEXT "async-context"
Alias for the “async-context” property, qv.
#define SOUP_SESSION_USE_THREAD_CONTEXT "use-thread-context"
Alias for the “use-thread-context” property, qv.
Since 2.38
#define SOUP_SESSION_IDLE_TIMEOUT "idle-timeout"
Alias for the “idle-timeout” property, qv.
Since 2.24
#define SOUP_SESSION_USER_AGENT "user-agent"
Alias for the “user-agent” property, qv.
#define SOUP_SESSION_ADD_FEATURE "add-feature"
Alias for the “add-feature” property, qv.
Since 2.24
#define SOUP_SESSION_ADD_FEATURE_BY_TYPE "add-feature-by-type"
Alias for the “add-feature-by-type” property, qv.
Since 2.24
#define SOUP_SESSION_REMOVE_FEATURE_BY_TYPE "remove-feature-by-type"
Alias for the “remove-feature-by-type” property, qv.
Since 2.24
#define SOUP_SESSION_ACCEPT_LANGUAGE "accept-language"
Alias for the “accept-language” property, qv.
Since 2.30
#define SOUP_SESSION_ACCEPT_LANGUAGE_AUTO "accept-language-auto"
Alias for the “accept-language-auto” property, qv.
Since 2.30
#define SOUP_SESSION_HTTP_ALIASES "http-aliases"
Alias for the “http-aliases” property, qv.
Since 2.38
#define SOUP_SESSION_HTTPS_ALIASES "https-aliases"
Alias for the “https-aliases” property, qv.
Since 2.38
#define SOUP_SESSION_LOCAL_ADDRESS "local-address"
Alias for the “local-address” property, qv.
Since 2.42
“accept-language”
property “accept-language” gchar *
If non-NULL
, the value to use for the "Accept-Language" header
on SoupMessages sent from this session.
Setting this will disable “accept-language-auto”.
Flags: Read / Write
Default value: NULL
Since 2.30
“accept-language-auto”
property “accept-language-auto” gboolean
If TRUE
, SoupSession will automatically set the string
for the "Accept-Language" header on every SoupMessage
sent, based on the return value of g_get_language_names()
.
Setting this will override any previous value of “accept-language”.
Flags: Read / Write
Default value: FALSE
Since 2.30
“add-feature”
property“add-feature” SoupSessionFeature *
Add a feature object to the session. (Shortcut for calling
soup_session_add_feature()
.)
Flags: Read / Write
Since 2.24
“add-feature-by-type”
property“add-feature-by-type” GType *
Add a feature object of the given type to the session.
(Shortcut for calling soup_session_add_feature_by_type()
.)
Flags: Read / Write
Allowed values: GObject
Since 2.24
“async-context”
property “async-context” gpointer
The GMainContext that miscellaneous session-related asynchronous callbacks are invoked on. (Eg, setting “idle-timeout” will add a timeout source on this context.)
For a plain SoupSession, this property is always set to
the GMainContext that is the thread-default at the time
the session was created, and cannot be overridden. For the
deprecated SoupSession subclasses, the default value is
NULL
, meaning to use the global default GMainContext.
If “use-thread-context” is FALSE
, this context
will also be used for asynchronous HTTP I/O.
Flags: Read / Write / Construct Only
“http-aliases”
property“http-aliases” GStrv
A NULL
-terminated array of URI schemes that should be
considered to be aliases for "http". Eg, if this included
"dav"
, than a URI of
dav://example.com/path
would be treated
identically to http://example.com/path
.
In a plain SoupSession, the default value is NULL
,
meaning that only "http" is recognized as meaning "http".
In SoupSessionAsync and SoupSessionSync, for backward
compatibility, the default value is an array containing the
single element "*"
, a special value
which means that any scheme except "https" is considered to
be an alias for "http".
See also “https-aliases”.
Flags: Read / Write
Since 2.38
“https-aliases”
property“https-aliases” GStrv
A comma-delimited list of URI schemes that should be considered to be aliases for "https". See “http-aliases” for more information.
The default value is NULL
, meaning that no URI schemes
are considered aliases for "https".
Flags: Read / Write
Since 2.38
“idle-timeout”
property “idle-timeout” guint
Connection lifetime (in seconds) when idle. Any connection left idle longer than this will be closed.
Although you can change this property at any time, it will
only affect newly-created connections, not currently-open
ones. You can call soup_session_abort()
after setting this
if you want to ensure that all future connections will have
this timeout value.
Note that the default value of 60 seconds only applies to plain SoupSessions. If you are using SoupSessionAsync or SoupSessionSync, the default value is 0 (meaning idle connections will never time out).
Flags: Read / Write
Default value: 60
Since 2.24
“local-address”
property“local-address” SoupAddress *
Sets the SoupAddress to use for the client side of the connection.
Use this property if you want for instance to bind the local socket to a specific IP address.
Flags: Read / Write / Construct Only
Since 2.42
“max-conns”
property “max-conns” gint
The maximum number of connections that the session can open at once.
Flags: Read / Write
Allowed values: >= 1
Default value: 10
“max-conns-per-host”
property “max-conns-per-host” gint
The maximum number of connections that the session can open at once to a given host.
Flags: Read / Write
Allowed values: >= 1
Default value: 2
“proxy-resolver”
property“proxy-resolver” GProxyResolver *
A GProxyResolver to use with this session. Setting this will clear the “proxy-uri” property, and remove any SoupProxyURIResolver features that have been added to the session.
By default, in a plain SoupSession, this is set to the
default GProxyResolver, but you can set it to NULL
if you
don't want to use proxies, or set it to your own
GProxyResolver if you want to control what proxies get
used.
Flags: Read / Write
Since 2.42
“proxy-uri”
property“proxy-uri” SoupURI *
A proxy to use for all http and https requests in this session. Setting this will clear the “proxy-resolver” property, and remove any
SoupProxyURIResolver features that have beenadded to the session. Setting this property will also cancel all currently pending messages.
Note that SoupSession will normally handle looking up the user's proxy settings for you; you should only use “proxy-uri” if you need to override the user's normal proxy settings.
Also note that this proxy will be used for
all requests; even requests to
localhost
. If you need more control over
proxies, you can create a GSimpleProxyResolver and set the
“proxy-resolver” property.
Flags: Read / Write
“remove-feature-by-type”
property“remove-feature-by-type” GType *
Remove feature objects from the session. (Shortcut for
calling soup_session_remove_feature_by_type()
.)
Flags: Read / Write
Allowed values: GObject
Since 2.24
“ssl-ca-file”
property “ssl-ca-file” gchar *
File containing SSL CA certificates.
If the specified file does not exist or cannot be read, then libsoup will print a warning, and then behave as though it had read in a empty CA file, meaning that all SSL certificates will be considered invalid.
SoupSession:ssl-ca-file
is deprecated and should not be used in newly-written code.
use “ssl-use-system-ca-file”, or else “tls-database” with a GTlsFileDatabase (which allows you to do explicit error handling).
Flags: Read / Write
Default value: NULL
“ssl-strict”
property “ssl-strict” gboolean
Normally, if “tls-database” is set (including if
it was set via “ssl-use-system-ca-file” or
“ssl-ca-file”), then libsoup will reject any
certificate that is invalid (ie, expired) or that is not
signed by one of the given CA certificates, and the
SoupMessage will fail with the status
SOUP_STATUS_SSL_FAILED
.
If you set “ssl-strict” to FALSE
, then all
certificates will be accepted, and you will need to call
soup_message_get_https_status()
to distinguish valid from
invalid certificates. (This can be used, eg, if you want to
accept invalid certificates after giving some sort of
warning.)
For a plain SoupSession, if the session has no CA file or
TLS database, and this property is TRUE
, then all
certificates will be rejected. However, beware that the
deprecated SoupSession subclasses (SoupSessionAsync and
SoupSessionSync) have the opposite behavior: if there is
no CA file or TLS database, then all certificates are always
accepted, and this property has no effect.
Flags: Read / Write
Default value: TRUE
Since 2.30
“ssl-use-system-ca-file”
property “ssl-use-system-ca-file” gboolean
Setting this to TRUE
is equivalent to setting
“tls-database” to the default system CA database.
(and likewise, setting “tls-database” to the
default database by hand will cause this property to
become TRUE
).
Setting this to FALSE
(when it was previously TRUE
) will
clear the “tls-database” field.
See “ssl-strict” for more information on how https certificate validation is handled.
Note that the default value of TRUE
only applies to plain
SoupSessions. If you are using SoupSessionAsync or
SoupSessionSync, the default value is FALSE
, for backward
compatibility.
Flags: Read / Write
Default value: TRUE
Since 2.38
“timeout”
property “timeout” guint
The timeout (in seconds) for socket I/O operations (including connecting to a server, and waiting for a reply to an HTTP request).
Although you can change this property at any time, it will
only affect newly-created connections, not currently-open
ones. You can call soup_session_abort()
after setting this
if you want to ensure that all future connections will have
this timeout value.
Note that the default value of 60 seconds only applies to plain SoupSessions. If you are using SoupSessionAsync or SoupSessionSync, the default value is 0 (meaning socket I/O will not time out).
Not to be confused with “idle-timeout” (which is the length of time that idle persistent connections will be kept open).
Flags: Read / Write
Default value: 0
“tls-database”
property“tls-database” GTlsDatabase *
Sets the GTlsDatabase to use for validating SSL/TLS certificates.
Note that setting the “ssl-ca-file” or “ssl-use-system-ca-file” property will cause this property to be set to a GTlsDatabase corresponding to the indicated file or system default.
See “ssl-strict” for more information on how https certificate validation is handled.
If you are using a plain SoupSession then
“ssl-use-system-ca-file” will be TRUE
by
default, and so this property will be a copy of the system
CA database. If you are using SoupSessionAsync or
SoupSessionSync, this property will be NULL
by default.
Flags: Read / Write
Since 2.38
“tls-interaction”
property“tls-interaction” GTlsInteraction *
A GTlsInteraction object that will be passed on to any GTlsConnections created by the session. (This can be used to provide client-side certificates, for example.)
Flags: Read / Write
Since 2.48
“use-ntlm”
property “use-ntlm” gboolean
Whether or not to use NTLM authentication.
SoupSession:use-ntlm
is deprecated and should not be used in newly-written code.
use soup_session_add_feature_by_type()
with
SOUP_TYPE_AUTH_NTLM.
Flags: Read / Write
Default value: FALSE
“use-thread-context”
property “use-thread-context” gboolean
If TRUE
(which it always is on a plain SoupSession),
asynchronous HTTP requests in this session will run in
whatever the thread-default GMainContext is at the time
they are started, rather than always occurring in
“async-context”.
Flags: Read / Write
Default value: FALSE
Since 2.38
“user-agent”
property “user-agent” gchar *
If non-NULL
, the value to use for the "User-Agent" header
on SoupMessages sent from this session.
RFC 2616 says: "The User-Agent request-header field contains information about the user agent originating the request. This is for statistical purposes, the tracing of protocol violations, and automated recognition of user agents for the sake of tailoring responses to avoid particular user agent limitations. User agents SHOULD include this field with requests."
The User-Agent header contains a list of one or more product tokens, separated by whitespace, with the most significant product token coming first. The tokens must be brief, ASCII, and mostly alphanumeric (although "-", "_", and "." are also allowed), and may optionally include a "/" followed by a version string. You may also put comments, enclosed in parentheses, between or after the tokens.
If you set a “user_agent” property that has trailing
whitespace, SoupSession will append its own product token
(eg, "libsoup/2.3.2
") to the end of the
header for you.
Flags: Read / Write
Default value: NULL
“authenticate”
signalvoid user_function (SoupSession *session, SoupMessage *msg, SoupAuth *auth, gboolean retrying, gpointer user_data)
Emitted when the session requires authentication. If
credentials are available call soup_auth_authenticate()
on
auth
. If these credentials fail, the signal will be
emitted again, with retrying
set to TRUE
, which will
continue until you return without calling
soup_auth_authenticate()
on auth
.
Note that this may be emitted before msg
's body has been
fully read.
If you call soup_session_pause_message()
on msg
before
returning, then you can authenticate auth
asynchronously
(as long as you g_object_ref()
it to make sure it doesn't
get destroyed), and then unpause msg
when you are ready
for it to continue.
session |
the session |
|
msg |
the SoupMessage being sent |
|
auth |
the SoupAuth to authenticate |
|
retrying |
|
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First
“connection-created”
signalvoid user_function (SoupSession *session, GObject *connection, gpointer user_data)
Emitted when a new connection is created. This is an internal signal intended only to be used for debugging purposes, and may go away in the future.
session |
the SoupSession |
|
connection |
the connection |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First
Since 2.30
“request-queued”
signalvoid user_function (SoupSession *session, SoupMessage *msg, gpointer user_data)
Emitted when a request is queued on session
. (Note that
"queued" doesn't just mean soup_session_queue_message()
;
soup_session_send_message()
implicitly queues the message
as well.)
When sending a request, first “request_queued” is emitted, indicating that the session has become aware of the request.
Once a connection is available to send the request on, the session emits “request_started”. Then, various SoupMessage signals are emitted as the message is processed. If the message is requeued, it will emit “restarted”, which will then be followed by another “request_started” and another set of SoupMessage signals when the message is re-sent.
Eventually, the message will emit “finished”.
Normally, this signals the completion of message
processing. However, it is possible that the application
will requeue the message from the "finished" handler (or
equivalently, from the soup_session_queue_message()
callback). In that case, the process will loop back to
“request_started”.
Eventually, a message will reach "finished" and not be requeued. At that point, the session will emit “request_unqueued” to indicate that it is done with the message.
To sum up: “request_queued” and “request_unqueued” are guaranteed to be emitted exactly once, but “request_started” and “finished” (and all of the other SoupMessage signals) may be invoked multiple times for a given message.
session |
the session |
|
msg |
the request that was queued |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First
Since 2.24
“request-started”
signalvoid user_function (SoupSession *session, SoupMessage *msg, SoupSocket *socket, gpointer user_data)
Emitted just before a request is sent. See “request_queued” for a detailed description of the message lifecycle within a session.
session |
the session |
|
msg |
the request being sent |
|
socket |
the socket the request is being sent on |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First
“request-unqueued”
signalvoid user_function (SoupSession *session, SoupMessage *msg, gpointer user_data)
Emitted when a request is removed from session
's queue,
indicating that session
is done with it. See
“request_queued” for a detailed description of the
message lifecycle within a session.
session |
the session |
|
msg |
the request that was unqueued |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First
Since 2.24
“tunneling”
signalvoid user_function (SoupSession *session, GObject *connection, gpointer user_data)
Emitted when an SSL tunnel is being created on a proxy connection. This is an internal signal intended only to be used for debugging purposes, and may go away in the future.
session |
the SoupSession |
|
connection |
the connection |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First
Since 2.30


About me
I am currently a student at University of Eastern Africa, Baraton taking a Bachelors degree in Business Information Technology.
I recently joined Moringa School to persue Software Development. I do not have any work experience at the moment but I am looking foward to gaining more of it as time goes by.
I decided to join Moringa School because i always had this passion to do Softwatre Development and I realised that this is an instituition that has so many people talking great things about it's teaching methords being great.
I love nature and thus hiking is one of my hobbies. I do have a few skills in networking.


--- ---
| Medical School | Internship/Residency | Fellowship | Appointment |
|---|---|---|---|
| University of Texas, Houston | Internal Medicine, University of California, Los Angeles | Endocrinology, University of California, Los Angeles | Associate Professor at Department of Medicine, University of California, Los Angeles |
American Board of Internal Medicine - Endocrinology, Diabetes, and Metabolism


the AUDI e-tron sportback debuts as company's second electric car
by kieron marchesethe new AUDI e-tron sportback made its debut at the 2019 LA auto show, launched as the company’s second electric car. it uses largely identical hardware to the e-tron SUV, which was revealed last year, packing the same 95 kWh battery with a few new features and specs.
images courtesy of AUDI
slated for a 2020 europe release, the dynamic SUV coupé offers up to 277 miles of range and uses dual electric motors with an output of 265 kW and a combined peak of 355 horsepower. a slightly less powerful version of the sportback with a smaller battery will also be available, starting at €71,350 (around $79,000).
its roof extends flat over the muscular body, dropping down steeply to the rear and flowing into the steeply raked D-pillars. the lower edge of the third side window rises towards the rear—a typical sportback feature.
inside, the driver can activate functions using voice controls and amazon alexa is built in. there is a 12.3-inch digital instrument cluster behind the steering wheel, a 12.1-inch main touchscreen in the dashboard, and another 8.6-inch touchscreen below that for text input and climate controls.
digital matrix LED headlights are a new feature, available for the first time in a mass-production vehicle. their light is broken down into tiny pixels and can be controlled with exceptional precision. this makes safe lane-centring easier on narrow stretches of road and shows the position of the vehicle in the lane.
AUDI will begin taking preorders starting at the end of this month, november 2019. the first deliveries are expected in europe beginning in march 2020, with the sportback reaching north american shores near the end of summer 2020. pricing is yet to be confirmed for the latter.
project info
company: AUDI
model: e-tron sportback
price: starting from €71,350 (around $79,000)


Reusable Components
MontageJS simplifies rich-client development by offering a modular approach to organizing code and components. Small teams can build applications faster through maximum reusability and larger teams can be more efficient by breaking complex problems into smaller units without stepping on each other during the development process.
Component Oriented Templates
MontageJS templates are HTML5 documents. These HTML templates encapsulate a component's JavaScript code, as well as resources like CSS files and images, in a folder with the "reel" file extension. Developers can instantiate a component without having to worry about what JavaScript dependencies the component has, or what CSS content and other files it may rely upon. This leads to dramatic improvements in reliability and ease of use.
High Performance
MontageJS supports implicit event delegation and a managed draw cycle. This minimizes expensive layout reflows to provide a better user experience, particularly on hardware-limited mobile devices.
Functional Reactive Bindings (FRB)
MontageJS supports simple and two-way data binding between components, objects, and collections, allowing you to coordinate the state between views and models, among other entangled objects. FRB go farther and can gracefully bind long property paths and the contents of collections, as well as incrementally update the results of chains of queries including maps, flattened arrays, sums, and averages. FRB makes it easy to ensure consistent state without having to write a lot of "glue" code.
Visual Authoring for MontageJS
MontageJS is the only open source HTML5 framework with a dedicated, cloud-based, visual authoring environment that is free to use for creating open source content. With Montage Studio, you will be able to login with your GitHub account and discover an easier, faster way to develop single page applications that exceed user expectations. Montage Studio is a great way to learn and explore the powerful capabilities of MontageJS.
If you prefer to write code by hand in your favorite text editor, you can use MontageJS on your local system. The MontageJS framework is available from npm, the node.js package manager. Read our Quick Start guide to learn how to install our helpful set of MontageJS command line tools.
If you need help, visit our Community page to discover all the ways you can learn more about MontageJS. You can also take a look at some of our sample applications and demos to see MontageJS in action.
Join our BETA


1.Backup:Backing up information is a time-consuming and complicated process. You would have to do many tedious things just to make sure your data is backed up. Instead of doing these complex things, you can use cloud. Cloud computing allows you to automatically transmit data without worrying about capacity, security, nor availability.
2.File Storage:This is one of the most major uses of cloud computing. Cloud Computing allows you to store your files from any web enabled interface. At any location and time, you have speed, security, and availability. Businesses only pay for the storage you are using, so you do not have to worry constantly about storage infrastructure.
3.Disaster Recovery:Businesses often experience difficult situations with disaster recovery. This is a where cloud computing comes in. With cloud computing, disaster recovery is cheaper, faster and effective compared to the expensive, stiff procedures.
4.Online Applications:A commonly used program by many students, adults, and professionals, Google Documents allows for easy access to all of your saved documents. These documents can range from a simple note typed in a hurry to a doctorial thesis written over the span of two semesters. Google Documents relies on cloud computing servers to store and send data from the device used to write the document to anywhere where Google Documents is accessible.
But online applications don't have to be only for the hard working professional or student, Adobe Photoshop Express also utilizes cloud computing servers to allows you to easily edit and share photos. With the widely ranging and ever growing software industry, the number of programs relying on cloud computing technology is increasing and shows no sign of stopping.


By default, inspection consider a compile-time constant as a format string if it's used as argument to appropriate methods on
java.util.Formatter
, java.lang.String
, java.io.PrintWriter
or java.io.PrintStream
.
Example:
String.format("x = %d, y = %d", 42);
Use settings below to mark additional classes and methods as related to the string formatting.


Based on the crypto-js library, StatiCrypt uses AES-256 to encrypt your string with your passphrase in your browser (client side).
Download your encrypted string in a HTML page with a password prompt you can upload anywhere (see example).
The tool is also available as a CLI on NPM.
Disclaimer if you have extra sensitive banking data, you should probably use something else!
StatiCrypt generates a static, password protected page that can be decrypted in-browser: just send or upload the generated page to a place serving static content (github pages, for example) and you're done: the javascript will prompt users for password, decrypt the page and load your HTML.
It basically encrypts your page and puts everything with a user-friendly way to use a password
in the new file.
AES-256 is state of the art but brute-force/dictionary attacks would be trivial to
do at a really fast pace: use a long, unusual passphrase!
Feel free to contribute or report any thought to the GitHub project!


|
Clingo C API
C API for clingo providing high level functions to control grounding and solving.
|
Functions to control the grounding and solving process.
For an example, see control.c.
Modules | |
| Symbolic Atom Inspection | |
| Inspection of atoms occurring in ground logic programs. | |
| Theory Atom Inspection | |
| Inspection of theory atoms occurring in ground logic programs. | |
| Theory Propagation | |
| Extend the search with propagators for arbitrary theories. | |
| Program Building | |
| Add non-ground program representations (ASTs) to logic programs or extend the ground (aspif) program. | |
| Solver Configuration | |
| Configuration of search and enumeration algorithms. | |
| Statistics | |
| Inspect search and problem statistics. | |
| Model Inspection | |
| Inspection of models and a high-level interface to add constraints during solving. | |
| Solving | |
| Interact with a running search. | |
| Program Inspection | |
| Functions and data structures to inspect programs. | |
Classes | |
| struct | clingo_part |
| Struct used to specify the program parts that have to be grounded. More... | |
Typedefs | |
| typedef struct clingo_part | clingo_part_t |
| Struct used to specify the program parts that have to be grounded. More... | |
| typedef bool(* | clingo_ground_callback_t) (clingo_location_t const *location, char const *name, clingo_symbol_t const *arguments, size_t arguments_size, void *data, clingo_symbol_callback_t symbol_callback, void *symbol_callback_data) |
| Callback function to implement external functions. More... | |
| typedef struct clingo_control | clingo_control_t |
| Control object holding grounding and solving state. | |
| typedef unsigned | clingo_solve_result_bitset_t |
Enumerations | |
| enum | clingo_solve_result_e { clingo_solve_result_satisfiable = 1, clingo_solve_result_unsatisfiable = 2, clingo_solve_result_exhausted = 4, clingo_solve_result_interrupted = 8 } |
Functions | |
| CLINGO_VISIBILITY_DEFAULT bool | clingo_control_new (char const *const *arguments, size_t arguments_size, clingo_logger_t logger, void *logger_data, unsigned message_limit, clingo_control_t **control) |
| Create a new control object. More... | |
| CLINGO_VISIBILITY_DEFAULT void | clingo_control_free (clingo_control_t *control) |
| Free a control object created with clingo_control_new(). More... | |
Grounding Functions | |
| CLINGO_VISIBILITY_DEFAULT bool | clingo_control_load (clingo_control_t *control, char const *file) |
| Extend the logic program with a program in a file. More... | |
| CLINGO_VISIBILITY_DEFAULT bool | clingo_control_add (clingo_control_t *control, char const *name, char const *const *parameters, size_t parameters_size, char const *program) |
| Extend the logic program with the given non-ground logic program in string form. More... | |
| CLINGO_VISIBILITY_DEFAULT bool | clingo_control_ground (clingo_control_t *control, clingo_part_t const *parts, size_t parts_size, clingo_ground_callback_t ground_callback, void *ground_callback_data) |
| Ground the selected parts of the current (non-ground) logic program. More... | |
Solving Functions | |
| CLINGO_VISIBILITY_DEFAULT bool | clingo_control_solve (clingo_control_t *control, clingo_solve_mode_bitset_t mode, clingo_literal_t const *assumptions, size_t assumptions_size, clingo_solve_event_callback_t notify, void *data, clingo_solve_handle_t **handle) |
| Solve the currently grounded logic program enumerating its models. More... | |
| CLINGO_VISIBILITY_DEFAULT bool | clingo_control_cleanup (clingo_control_t *control) |
| Clean up the domains of the grounding component using the solving component's top level assignment. More... | |
| CLINGO_VISIBILITY_DEFAULT bool | clingo_control_assign_external (clingo_control_t *control, clingo_literal_t literal, clingo_truth_value_t value) |
| Assign a truth value to an external atom. More... | |
| CLINGO_VISIBILITY_DEFAULT bool | clingo_control_release_external (clingo_control_t *control, clingo_literal_t literal) |
| Release an external atom. More... | |
| CLINGO_VISIBILITY_DEFAULT bool | clingo_control_register_propagator (clingo_control_t *control, clingo_propagator_t const *propagator, void *data, bool sequential) |
| Register a custom propagator with the control object. More... | |
| CLINGO_VISIBILITY_DEFAULT bool | clingo_control_is_conflicting (clingo_control_t const *control) |
| Check if the solver has determined that the internal program representation is conflicting. More... | |
| CLINGO_VISIBILITY_DEFAULT bool | clingo_control_statistics (clingo_control_t const *control, clingo_statistics_t const **statistics) |
| Get a statistics object to inspect solver statistics. More... | |
| CLINGO_VISIBILITY_DEFAULT void | clingo_control_interrupt (clingo_control_t *control) |
| Interrupt the active solve call (or the following solve call right at the beginning). More... | |
| CLINGO_VISIBILITY_DEFAULT bool | clingo_control_clasp_facade (clingo_control_t *control, void **clasp) |
| Get low-level access to clasp. More... | |
Configuration Functions | |
| CLINGO_VISIBILITY_DEFAULT bool | clingo_control_configuration (clingo_control_t *control, clingo_configuration_t **configuration) |
| Get a configuration object to change the solver configuration. More... | |
| CLINGO_VISIBILITY_DEFAULT bool | clingo_control_set_enable_enumeration_assumption (clingo_control_t *control, bool enable) |
| Configure how learnt constraints are handled during enumeration. More... | |
| CLINGO_VISIBILITY_DEFAULT bool | clingo_control_get_enable_enumeration_assumption (clingo_control_t *control) |
| Check whether the enumeration assumption is enabled. More... | |
| CLINGO_VISIBILITY_DEFAULT bool | clingo_control_set_enable_cleanup (clingo_control_t *control, bool enable) |
| Enable automatic cleanup after solving. More... | |
| CLINGO_VISIBILITY_DEFAULT bool | clingo_control_get_enable_cleanup (clingo_control_t *control) |
| Check whether automatic cleanup is enabled. More... | |
Program Inspection Functions | |
| CLINGO_VISIBILITY_DEFAULT bool | clingo_control_get_const (clingo_control_t const *control, char const *name, clingo_symbol_t *symbol) |
Return the symbol for a constant definition of form: #const name = symbol . More... | |
| CLINGO_VISIBILITY_DEFAULT bool | clingo_control_has_const (clingo_control_t const *control, char const *name, bool *exists) |
| Check if there is a constant definition for the given constant. More... | |
| CLINGO_VISIBILITY_DEFAULT bool | clingo_control_symbolic_atoms (clingo_control_t const *control, clingo_symbolic_atoms_t const **atoms) |
| Get an object to inspect symbolic atoms (the relevant Herbrand base) used for grounding. More... | |
| CLINGO_VISIBILITY_DEFAULT bool | clingo_control_theory_atoms (clingo_control_t const *control, clingo_theory_atoms_t const **atoms) |
| Get an object to inspect theory atoms that occur in the grounding. More... | |
| CLINGO_VISIBILITY_DEFAULT bool | clingo_control_register_observer (clingo_control_t *control, clingo_ground_program_observer_t const *observer, bool replace, void *data) |
| Register a program observer with the control object. More... | |
Program Modification Functions | |
| CLINGO_VISIBILITY_DEFAULT bool | clingo_control_backend (clingo_control_t *control, clingo_backend_t **backend) |
| Get an object to add ground directives to the program. More... | |
| typedef bool(* clingo_ground_callback_t) (clingo_location_t const *location, char const *name, clingo_symbol_t const *arguments, size_t arguments_size, void *data, clingo_symbol_callback_t symbol_callback, void *symbol_callback_data) |
Callback function to implement external functions.
If an external function of form @name(parameters)
occurs in a logic program, then this function is called with its location, name, parameters, and a callback to inject symbols as arguments. The callback can be called multiple times; all symbols passed are injected.
If a (non-recoverable) clingo API function fails in this callback, for example, the symbol callback, the callback must return false. In case of errors not related to clingo, this function can set error clingo_error_unknown and return false to stop grounding with an error.
| [in] | location | location from which the external function was called |
| [in] | name | name of the called external function |
| [in] | arguments | arguments of the called external function |
| [in] | arguments_size | number of arguments |
| [in] | data | user data of the callback |
| [in] | symbol_callback | function to inject symbols |
| [in] | symbol_callback_data | user data for the symbol callback (must be passed untouched) |
The following example implements the external function @f()
returning 42.
| typedef struct clingo_part clingo_part_t |
Struct used to specify the program parts that have to be grounded.
Programs may be structured into parts, which can be grounded independently with clingo_control_ground. Program parts are mainly interesting for incremental grounding and multi-shot solving. For single-shot solving, program parts are not needed.
#program
specification are by default put into a program called base
without arguments.Corresponding type to clingo_solve_result_e.
Enumeration of bit masks for solve call results.
| Enumerator | |
|---|---|
| clingo_solve_result_satisfiable | The last solve call found a solution. |
| clingo_solve_result_unsatisfiable | The last solve call did not find a solution. |
| clingo_solve_result_exhausted | The last solve call completely exhausted the search space. |
| clingo_solve_result_interrupted | The last solve call was interrupted.
|
| CLINGO_VISIBILITY_DEFAULT bool clingo_control_add | ( | clingo_control_t * | control, |
| char const * | name, | ||
| char const *const * | parameters, | ||
| size_t | parameters_size, | ||
| char const * | program | ||
| ) |
Extend the logic program with the given non-ground logic program in string form.
This function puts the given program into a block of form: #program name(parameters).
After extending the logic program, the corresponding program parts are typically grounded with clingo_control_ground.
| [in] | control | the target |
| [in] | name | name of the program block |
| [in] | parameters | string array of parameters of the program block |
| [in] | parameters_size | number of parameters |
| [in] | program | string representation of the program |
| CLINGO_VISIBILITY_DEFAULT bool clingo_control_assign_external | ( | clingo_control_t * | control, |
| clingo_literal_t | literal, | ||
| clingo_truth_value_t | value | ||
| ) |
Assign a truth value to an external atom.
If a negative literal is passed, the corresponding atom is assigned the inverted truth value.
If the atom does not exist or is not external, this is a noop.
| [in] | control | the target |
| [in] | literal | literal to assign |
| [in] | value | the truth value |
| CLINGO_VISIBILITY_DEFAULT bool clingo_control_backend | ( | clingo_control_t * | control, |
| clingo_backend_t ** | backend | ||
| ) |
Get an object to add ground directives to the program.
See the Program Building module for more information.
| [in] | control | the target |
| [out] | backend | the backend object |
| CLINGO_VISIBILITY_DEFAULT bool clingo_control_clasp_facade | ( | clingo_control_t * | control, |
| void ** | clasp | ||
| ) |
Get low-level access to clasp.
This function may return a nullptr
. Otherwise, the returned pointer can be casted to a ClaspFacade pointer.
| [in] | control | the target |
| [out] | clasp | pointer to the ClaspFacade object (may be nullptr ) |
| CLINGO_VISIBILITY_DEFAULT bool clingo_control_cleanup | ( | clingo_control_t * | control | ) |
Clean up the domains of the grounding component using the solving component's top level assignment.
This function removes atoms from domains that are false and marks atoms as facts that are true. With multi-shot solving, this can result in smaller groundings because less rules have to be instantiated and more simplifications can be applied.
| [in] | control | the target |
| CLINGO_VISIBILITY_DEFAULT bool clingo_control_configuration | ( | clingo_control_t * | control, |
| clingo_configuration_t ** | configuration | ||
| ) |
Get a configuration object to change the solver configuration.
See the Solver Configuration module for more information.
| [in] | control | the target |
| [out] | configuration | the configuration object |
| CLINGO_VISIBILITY_DEFAULT void clingo_control_free | ( | clingo_control_t * | control | ) |
Free a control object created with clingo_control_new().
| [in] | control | the target |
| CLINGO_VISIBILITY_DEFAULT bool clingo_control_get_const | ( | clingo_control_t const * | control, |
| char const * | name, | ||
| clingo_symbol_t * | symbol | ||
| ) |
Return the symbol for a constant definition of form: #const name = symbol
.
| [in] | control | the target |
| [in] | name | the name of the constant |
| [out] | symbol | the resulting symbol |
| CLINGO_VISIBILITY_DEFAULT bool clingo_control_get_enable_cleanup | ( | clingo_control_t * | control | ) |
Check whether automatic cleanup is enabled.
See clingo_control_set_enable_cleanup().
| [in] | control | the target |
| CLINGO_VISIBILITY_DEFAULT bool clingo_control_get_enable_enumeration_assumption | ( | clingo_control_t * | control | ) |
Check whether the enumeration assumption is enabled.
See clingo_control_set_enable_enumeration_assumption().
| [in] | control | the target |
| CLINGO_VISIBILITY_DEFAULT bool clingo_control_ground | ( | clingo_control_t * | control, |
| clingo_part_t const * | parts, | ||
| size_t | parts_size, | ||
| clingo_ground_callback_t | ground_callback, | ||
| void * | ground_callback_data | ||
| ) |
Ground the selected parts of the current (non-ground) logic program.
After grounding, logic programs can be solved with clingo_control_solve().
#program
specification are by default put into a program called base
without arguments.| [in] | control | the target |
| [in] | parts | array of parts to ground |
| [in] | parts_size | size of the parts array |
| [in] | ground_callback | callback to implement external functions |
| [in] | ground_callback_data | user data for ground_callback |
| CLINGO_VISIBILITY_DEFAULT bool clingo_control_has_const | ( | clingo_control_t const * | control, |
| char const * | name, | ||
| bool * | exists | ||
| ) |
Check if there is a constant definition for the given constant.
| [in] | control | the target |
| [in] | name | the name of the constant |
| [out] | exists | whether a matching constant definition exists |
| CLINGO_VISIBILITY_DEFAULT void clingo_control_interrupt | ( | clingo_control_t * | control | ) |
Interrupt the active solve call (or the following solve call right at the beginning).
| [in] | control | the target |
| CLINGO_VISIBILITY_DEFAULT bool clingo_control_is_conflicting | ( | clingo_control_t const * | control | ) |
Check if the solver has determined that the internal program representation is conflicting.
If this function returns true, solve calls will return immediately with an unsatisfiable solve result. Note that conflicts first have to be detected, e.g. - initial unit propagation results in an empty clause, or later if an empty clause is resolved during solving. Hence, the function might return false even if the problem is unsatisfiable.
| [in] | control | the target |
| CLINGO_VISIBILITY_DEFAULT bool clingo_control_load | ( | clingo_control_t * | control, |
| char const * | file | ||
| ) |
Extend the logic program with a program in a file.
| [in] | control | the target |
| [in] | file | path to the file |
| CLINGO_VISIBILITY_DEFAULT bool clingo_control_new | ( | char const *const * | arguments, |
| size_t | arguments_size, | ||
| clingo_logger_t | logger, | ||
| void * | logger_data, | ||
| unsigned | message_limit, | ||
| clingo_control_t ** | control | ||
| ) |
Create a new control object.
A control object has to be freed using clingo_control_free().
--output
) and clasp's options are supported as arguments, except basic options such as --help
. Furthermore, a control object is blocked while a search call is active; you must not call any member function during search.If the logger is NULL, messages are printed to stderr.
| [in] | arguments | C string array of command line arguments |
| [in] | arguments_size | size of the arguments array |
| [in] | logger | callback functions for warnings and info messages |
| [in] | logger_data | user data for the logger callback |
| [in] | message_limit | maximum number of times the logger callback is called |
| [out] | control | resulting control object |
| CLINGO_VISIBILITY_DEFAULT bool clingo_control_register_observer | ( | clingo_control_t * | control, |
| clingo_ground_program_observer_t const * | observer, | ||
| bool | replace, | ||
| void * | data | ||
| ) |
Register a program observer with the control object.
| [in] | control | the target |
| [in] | observer | the observer to register |
| [in] | replace | just pass the grounding to the observer but not the solver |
| [in] | data | user data passed to the observer functions |
| CLINGO_VISIBILITY_DEFAULT bool clingo_control_register_propagator | ( | clingo_control_t * | control, |
| clingo_propagator_t const * | propagator, | ||
| void * | data, | ||
| bool | sequential | ||
| ) |
Register a custom propagator with the control object.
If the sequential flag is set to true, the propagator is called sequentially when solving with multiple threads.
See the Theory Propagation module for more information.
| [in] | control | the target |
| [in] | propagator | the propagator |
| [in] | data | user data passed to the propagator functions |
| [in] | sequential | whether the propagator should be called sequentially |
| CLINGO_VISIBILITY_DEFAULT bool clingo_control_release_external | ( | clingo_control_t * | control, |
| clingo_literal_t | literal | ||
| ) |
Release an external atom.
If a negative literal is passed, the corresponding atom is released.
After this call, an external atom is no longer external and subject to program simplifications. If the atom does not exist or is not external, this is a noop.
| [in] | control | the target |
| [in] | literal | literal to release |
| CLINGO_VISIBILITY_DEFAULT bool clingo_control_set_enable_cleanup | ( | clingo_control_t * | control, |
| bool | enable | ||
| ) |
Enable automatic cleanup after solving.
| [in] | control | the target |
| [in] | enable | whether to enable cleanups |
| CLINGO_VISIBILITY_DEFAULT bool clingo_control_set_enable_enumeration_assumption | ( | clingo_control_t * | control, |
| bool | enable | ||
| ) |
Configure how learnt constraints are handled during enumeration.
If the enumeration assumption is enabled, then all information learnt from the solver's various enumeration modes is removed after a solve call. This includes enumeration of cautious or brave consequences, enumeration of answer sets with or without projection, or finding optimal models, as well as clauses added with clingo_solve_control_add_clause().
| [in] | control | the target |
| [in] | enable | whether to enable the assumption |
| CLINGO_VISIBILITY_DEFAULT bool clingo_control_solve | ( | clingo_control_t * | control, |
| clingo_solve_mode_bitset_t | mode, | ||
| clingo_literal_t const * | assumptions, | ||
| size_t | assumptions_size, | ||
| clingo_solve_event_callback_t | notify, | ||
| void * | data, | ||
| clingo_solve_handle_t ** | handle | ||
| ) |
Solve the currently grounded logic program enumerating its models.
See the Solving module for more information.
| [in] | control | the target |
| [in] | mode | configures the search mode |
| [in] | assumptions | array of assumptions to solve under |
| [in] | assumptions_size | number of assumptions |
| [in] | notify | the event handler to register |
| [in] | data | the user data for the event handler |
| [out] | handle | handle to the current search to enumerate models |
| CLINGO_VISIBILITY_DEFAULT bool clingo_control_statistics | ( | clingo_control_t const * | control, |
| clingo_statistics_t const ** | statistics | ||
| ) |
Get a statistics object to inspect solver statistics.
Statistics are updated after a solve call.
See the Statistics module for more information.
| [in] | control | the target |
| [out] | statistics | the statistics object |
| CLINGO_VISIBILITY_DEFAULT bool clingo_control_symbolic_atoms | ( | clingo_control_t const * | control, |
| clingo_symbolic_atoms_t const ** | atoms | ||
| ) |
Get an object to inspect symbolic atoms (the relevant Herbrand base) used for grounding.
See the Symbolic Atom Inspection module for more information.
| [in] | control | the target |
| [out] | atoms | the symbolic atoms object |
| CLINGO_VISIBILITY_DEFAULT bool clingo_control_theory_atoms | ( | clingo_control_t const * | control, |
| clingo_theory_atoms_t const ** | atoms | ||
| ) |
Get an object to inspect theory atoms that occur in the grounding.
See the Theory Atom Inspection module for more information.
| [in] | control | the target |
| [out] | atoms | the theory atoms object |


#include <ParticleUniversePlaneCollider.h>
Public Member Functions | |
| PlaneCollider (void) | |
| virtual | ~PlaneCollider (void) |
| const Ogre::Vector3 | getNormal (void) const |
| void | setNormal (const Ogre::Vector3 &normal) |
| virtual void | _notifyRescaled (const Ogre::Vector3 &scale) |
| void | calculateDirectionAfterCollision (Particle *particle, Ogre::Real timeElapsed) |
| virtual void | _affect (ParticleTechnique *particleTechnique, Particle *particle, Ogre::Real timeElapsed) |
| virtual void | copyAttributesTo (ParticleAffector *affector) |
Static Public Attributes | |
| static const Ogre::Vector3 | DEFAULT_NORMAL = Ogre::Vector3::ZERO |
Protected Attributes | |
| Ogre::Vector3 | mNormal |
| Ogre::Vector3 | mPredictedPosition |
| Ogre::Plane | mPlane |
| ParticleUniverse::PlaneCollider::PlaneCollider | ( | void | ) |
| virtual ParticleUniverse::PlaneCollider::~PlaneCollider | ( | void | ) | [inline, virtual] |
| const Ogre::Vector3 ParticleUniverse::PlaneCollider::getNormal | ( | void | ) | const |
Returns the normal of the plane
| void ParticleUniverse::PlaneCollider::setNormal | ( | const Ogre::Vector3 & | normal | ) |
Sets the normal of the plane
| void ParticleUniverse::PlaneCollider::_notifyRescaled | ( | const Ogre::Vector3 & | scale | ) | [virtual] |
Notify that the Affector is rescaled.
Reimplemented from ParticleUniverse::ParticleAffector.
| void ParticleUniverse::PlaneCollider::calculateDirectionAfterCollision | ( | Particle * | particle, | |
| Ogre::Real | timeElapsed | |||
| ) |
If the particle is on the plane or at the back of the plane, bounce it. Make use of the same formula as the sphere collider.
Reset the position (just in front of the plane), but keep the direction.
| void ParticleUniverse::PlaneCollider::_affect | ( | ParticleTechnique * | particleTechnique, | |
| Particle * | particle, | |||
| Ogre::Real | timeElapsed | |||
| ) | [virtual] |
Affect a particle.
| particle | Pointer to a ParticleTechnique to which the particle belongs. | |
| particle | Pointer to a Particle. | |
| timeElapsed | The number of seconds which have elapsed since the last call. |
Implements ParticleUniverse::ParticleAffector.
| void ParticleUniverse::PlaneCollider::copyAttributesTo | ( | ParticleAffector * | affector | ) | [virtual] |
Copy attributes to another affector.
Reimplemented from ParticleUniverse::BaseCollider.
const Ogre::Vector3 ParticleUniverse::PlaneCollider::DEFAULT_NORMAL = Ogre::Vector3::ZERO [static] |
Ogre::Vector3 ParticleUniverse::PlaneCollider::mNormal [protected] |
Ogre::Vector3 ParticleUniverse::PlaneCollider::mPredictedPosition [protected] |
Ogre::Plane ParticleUniverse::PlaneCollider::mPlane [protected] |


Advanced Search Made Easy
You can increase the accuracy of your searches by adding
operators that fine-tune your keywords and numbers. All the options
listed on this page can be entered directly into the search box(es).
The basics of Searching
Click on the
icon to unhide the search form. Then you enter a word/number or an expression, e.g.
Miller,
> 500 or
>=
Smith, into the respective search field(s) and click the [OK] button.
The basics of Sorting
If an attribute is sortable you can click on the respective column header to change to sort order (ascending - descending - unsorted).
Operators
The following operators are supported (please note, however,
that some database systems do not support all operators):
- like (%), default operator for string searches
- not like (!%), default operator for string searches
- sounds like (*)
- not sounds like (!*)
- equal to (=), default operator for boolean, number, and code
searches
- not equal to (<>, !=)
- less than (<)
- less than or equal to (<=)
- greater than (>)
- greater than or equal to (>=)
"AND" Searches
To retrieve objects that match more than one condition at the same time,
use an ampersand & between conditions. For example, to search for objects
with values between 500 and 1000 (i.e. greater than 500 and less than 1000), enter: >500 & <1000
"OR" Searches
To retrieve objects that include
either term A or term B, use a semicolon ; between terms. For example,
to search for contacts named 'Smith' OR 'Miller', just type: Smith; Miller
Combining Searches
You can combine searches virtually without limits. For example, to search
for objects with
values less than '1000', but different from '500' and different from '600',
just
type: <>500; 600 & <1000
The parsing rules for combined searches are as follows:
- searchExpr ::= filterValue { & filterValue }
(--> string tokenizer with & as separator)
- filterValue ::= [operator] value { ; value }
(--> string tokenizer with ; as separator)
Wildcard Searches
Some DBs allow you to initiate wildcard searches. If supported, you can for example search for all contacts with names containing 'ller' (e.g. Miller, Mueller, etc.) by typing: %ller
WARNING: wildcard searches can be very time-consuming if the DB is not tuned (full table scans)!


My dream job is to work for myself on my own time. I love problem solving and helping people, being the go to for my friends and family is the start of my network. I also don't like working nine to five and web development gives me the freedom to work on my own schedule. I can even work and travel sitting on the beach with my laptop isn't a total pipe dream. Inspired by my friend and mentor I’ve seen endless possibility for personal and professional growth with developing. I’d eventually love to develop my brand into a small group of like minded developers and help them succeed as freelancers. My Profile


Google Play Game Services for Android (MonkeyX module)
This guide will help you, to setup the Google Play Game Services Module for MonkeyX.
The Play Game Services SDK provides Game services that lets you easily integrate gaming features such as achievements, leaderboards and real-time multiplayer on Android. If you haven't heard of Google Play Game Services you can get an overview right here.
Before you begin
You should have your Android development environment set up. Also please check your Android target of MonkeyX.
You should have a physical device running Android 2.2 (Froyo) or higher for testing.
Step 1: Set up the game in the Google Play Developer Console
The Google Play Google Play Developer Console is where you manage Games services for your game, and configure metadata for authorizing and authenticating your game.
To set up your game in the Google Play Developer Console:
When asked if you use Google APIs in your app, select I don’t use any Google APIs in my game yet.
If you will use a game, which isn't published yet, you can change settings like name and icons later.
Make sure to record the following information for later:
Your application ID: This is a string consisting only of digits (typically 12 or more), at the beginning of your client ID.
 You should use the same certificate to sign your app when testing or releasing your app.
Configure achievements and/or leaderboards for your game. (Record those IDs, too)
Add test accounts for your game. This step is needed only for apps that have not yet been published in the Google Play Developer Console. Before the app is published, only the test accounts listed in the Google Play Developer Console can log in. However, once an application is published, everyone is allowed to log in.
Step 3: Copy resources
To run the module, you need to configure the application ID as a resource. Also, you have to prepare your Android target and copy various resource-files to your build dir.
Go to the module folder - MonkeyX-Path/modules/bbd/
Copy the bbd/Resources/res folder to your Android build dir. There should be an res folder already. Overwrite existing files.
Open res/values/ids.xml and replace the placeholder application ID in the app_id resource.
Now you're almost done.
Step 4: Add Gameservice to MonkeyX
Now you can open your project and import the module.
Import bbd.gameservice
This example will show you, how to use the module:
Import bbd.gameservices
Import mojo
Function Main()
New MyApp
End
Class MyApp Extends App
Field gameservice:GameService
Method OnCreate()
gameservice = New GameService ' Create GameService
SetUpdateRate(60)
End
Method OnUpdate()
If TouchHit() Then
If gameservice.isLoggedIn() = False Then
gameservice.beginUserSignIn() ' Log user into Game Services
Else
gameservice.signOut() ' Logout
EndIf
EndIf
End
Method OnRender()
Cls()
If gameservice.isLoggedIn() Then
DrawText("Logged in!", 10, 10)
Else
DrawText("Tap on the screen to login to game services", 10, 10)
EndIf
End
End
Admob and Google Play Game Services
The Admob classes are now contained within Google play Services. So if you attempt to add the Admob-6.4.1 lib (withone the Admob module from BRL does) to your project you will get dex error because of duplicate classes.
To get rid of them, the GameService module provides an own Admob integration, based on the BRL module of MonkeyX. Just replace the import:
Import brl.admob
with
Import bbd.gameservicesadmob
Next steps
Learn more about using Games services with MonkeyX:


public abstract class GoapPlanner extends java.lang.Object implements IGoapPlanner
| Modifier and Type | Field and Description |
|---|---|
private java.util.List<GraphNode> |
endNodes |
private IGoapUnit |
goapUnit |
private GraphNode |
startNode |
| Constructor and Description |
|---|
GoapPlanner() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addDefaultEdges(IWeightedGraph<GraphNode,WeightedEdge> graph,
java.util.Queue<GraphNode> nodesToWorkOn)
Function for adding the edges to the graph which are the connection from
the starting node to all default accessible nodes (= actions).
|
protected void |
addEdges(IWeightedGraph<GraphNode,WeightedEdge> graph)
Function for adding (all) edges in the provided graph based on the
GoapUnits actions and their combined effects along the way.
|
protected static <V,E extends WeightedEdge> |
addEgdeWithWeigth(IWeightedGraph<V,E> graph,
V firstVertex,
V secondVertex,
E edge,
double weight)
Convenience function for adding a weighted edge to an existing Graph.
|
protected static WeightedPath<GraphNode,WeightedEdge> |
addNodeToGraphPath(IWeightedGraph<GraphNode,WeightedEdge> graph,
WeightedPath<GraphNode,WeightedEdge> baseGraphPath,
GraphNode nodeToAdd)
Function for adding a new node to a given GraphPath.
|
protected void |
addVertices(IWeightedGraph<GraphNode,WeightedEdge> graph,
java.util.List<GoapState> goalState)
Function for adding vertices to a graph.
|
protected static boolean |
areAllPreconditionsMet(java.util.HashSet<GoapState> preconditions,
java.util.HashSet<GoapState> effects)
Function for testing if all preconditions in a given HashSet are also in
another HashSet (effects) with the same values.
|
protected IWeightedGraph<GraphNode,WeightedEdge> |
createGraph()
Convenience function for all current goalStates.
|
protected IWeightedGraph<GraphNode,WeightedEdge> |
createGraph(java.util.List<GoapState> goalState)
Function to create a graph based on all possible unit actions of the
GoapUnit for (a) specific goal/-s.
|
protected static java.util.Queue<GoapAction> |
extractActionsFromGraphPath(WeightedPath<GraphNode,WeightedEdge> path,
GraphNode startNode,
GraphNode endNode)
Function for extracting all Actions from a GraphPath.
|
protected java.util.HashSet<GoapAction> |
extractPossibleActions()
Needed to check if the available actions can actually be performed
|
protected abstract <EdgeType extends WeightedEdge> |
generateGraphObject() |
protected java.util.List<GraphNode> |
getEndNodes() |
protected IGoapUnit |
getGoapUnit() |
protected GraphNode |
getStartNode() |
java.util.Queue<GoapAction> |
plan(IGoapUnit goapUnit)
Generate a plan (Queue of GoapActions) which is then performed by the
assigned GoapUnit.
|
protected java.util.Queue<GoapAction> |
searchGraphForActionQueue(IWeightedGraph<GraphNode,WeightedEdge> graph)
Function for searching a graph for the lowest cost of a series of actions
which have to be taken to archive a certain goal which has most certainly
the highest importance.
|
protected java.util.List<GoapState> |
sortGoalStates()
Function for sorting a goapUnits goalStates (descending).
|
protected static void |
sortPathsLeadingToNode(GraphNode node)
Sorting function for the paths leading to a node based on their combined
edge weights (ascending).
|
protected boolean |
tryToConnectNode(IWeightedGraph<GraphNode,WeightedEdge> graph,
GraphNode node,
java.util.Queue<GraphNode> nodesToWorkOn)
Function for trying to connect a given node to all other nodes in the
graph besides the starting node.
|
private IGoapUnit goapUnit
private GraphNode startNode
private java.util.List<GraphNode> endNodes
protected abstract <EdgeType extends WeightedEdge> IWeightedGraph<GraphNode,EdgeType> generateGraphObject()
public java.util.Queue<GoapAction> plan(IGoapUnit goapUnit)
plan
in interface IGoapPlanner
goapUnit
- the GoapUnit the plan gets generated for.protected java.util.List<GoapState> sortGoalStates()
protected IWeightedGraph<GraphNode,WeightedEdge> createGraph()
createGraph(List goalState)
protected IWeightedGraph<GraphNode,WeightedEdge> createGraph(java.util.List<GoapState> goalState)
goalState
- list of states the action queue has to fulfill.protected void addVertices(IWeightedGraph<GraphNode,WeightedEdge> graph, java.util.List<GoapState> goalState)
graph
- the graph the vertices are being added to.goalState
- List of States the unit has listed as their goals.protected java.util.HashSet<GoapAction> extractPossibleActions()
protected void addEdges(IWeightedGraph<GraphNode,WeightedEdge> graph)
graph
- the graph the edges are being added to.endNodes
- the end nodes, to which paths inside the graph lead to.protected void addDefaultEdges(IWeightedGraph<GraphNode,WeightedEdge> graph, java.util.Queue<GraphNode> nodesToWorkOn)
graph
- the graph the edges are getting added to.nodesToWorkOn
- the Queue in which nodes which got connected are getting added
to.protected static boolean areAllPreconditionsMet(java.util.HashSet<GoapState> preconditions, java.util.HashSet<GoapState> effects)
preconditions
- HashSet of states which are present.effects
- HashSet of states which are required.protected static <V,E extends WeightedEdge> boolean addEgdeWithWeigth(IWeightedGraph<V,E> graph, V firstVertex, V secondVertex, E edge, double weight)
graph
- the Graph the edge is added to.firstVertex
- start vertex.secondVertex
- target vertex.edge
- edge reference.weight
- the weight of the edge being created.protected boolean tryToConnectNode(IWeightedGraph<GraphNode,WeightedEdge> graph, GraphNode node, java.util.Queue<GraphNode> nodesToWorkOn)
graph
- the graph in which the provided nodes are located.node
- the node which is being connected to another node.nodesToWorkOn
- the Queue to which any connected nodes are being added to work
on these connections in further iterations.protected static WeightedPath<GraphNode,WeightedEdge> addNodeToGraphPath(IWeightedGraph<GraphNode,WeightedEdge> graph, WeightedPath<GraphNode,WeightedEdge> baseGraphPath, GraphNode nodeToAdd)
graph
- the graph the path is located in.baseGraphPath
- the path to which a node is being added.nodeToAdd
- the node which shall be added.protected java.util.Queue<GoapAction> searchGraphForActionQueue(IWeightedGraph<GraphNode,WeightedEdge> graph)
graph
- the graph of GoapActions the unit has to take in order to
archive a goal.protected static void sortPathsLeadingToNode(GraphNode node)
node
- the node whose paths leading to it are being sorted.protected static java.util.Queue<GoapAction> extractActionsFromGraphPath(WeightedPath<GraphNode,WeightedEdge> path, GraphNode startNode, GraphNode endNode)
path
- the Path from which the actions are being extracted.startNode
- the starting node needs to be known as it contains no action.endNode
- the end node needs to be known since it contains no action.protected IGoapUnit getGoapUnit()
protected GraphNode getStartNode()
protected java.util.List<GraphNode> getEndNodes()


-
Professional Introduction
Hi, I am an experienced Data Scientist with expertise in building data-driven solutions that are fast, scalable, robust & generalizable. I have a strong ability to extract and triangulate insights from data by tearing the constructs of a problem to grasp the fundamentals. I am an effective communicator & efficient problem solver that articulates his thoughts and opinions concisely to formulate effective solutions.
Ever since my undergraduate, I have been involved in teaching & training. At IndiGo, I worked as a part of New Joiner's Training Program to teach fundamentals of Inventory Optimization, Demand Forecasting & Other RM concepts. At Cognilytics, I played a key role in training the US-Analytics team on Product Offer Optimization and Model Automation functionality using SAP Predictive Analytics. At IIT Delhi, I worked as a Mentor in the Student Mentorship Program & tutored underprivileged school students under the National Service Scheme.
Primary skills: Data Science , Decision Science , Operations Research , Strategy , Business Analytics , Revenue Management .
Academic & Industry Expertise: Statistics , Machine Learning , Econometrics , Deep Learning , Inventory Optimization , Demand Forecasting , Next Best Offer , Predictive Vehicle Maintenance .
Tools & Languages: R , Python , Git , SQL , Dash , Markdown , H2O , Excel , PowerPoint .
-
Education
Master of Data Science from University of British Columbia, Vancouver
(Sep'19 to Jun'20: 10 mos)
Labs: 96 | Courses: 24
In a fast-moving field like data science, it is critical to stay abreast of recent developments. The accelerated MDS program from UBC is enabling me to play an instrumental role in driving innovative data-science based initiatives in the real world and apply state-of-the-art techniques in data analysis.
-
Bachelor of Technology from Indian Institute of Technology, Delhi
(Jul'11 to May'15: 4 yrs)
CGPA: 7.955/10 | Scaled Score by ECE: 3.93/4 | Credits: 181 | Courses: 61
I come from a small city in India called Kanpur. Being an average student at school, studying from premier engineering institutes like IITs was a big dream just like for 468,240 other students who appeared in IITJEE 2011. Passing the test required Herculean effort but the reward was a dream come true when I got a chance to study at IIT Delhi by being in the top 0.7% students.
I attended various inter-departmental courses in subjects of my interest such as Mathematics, Computer Science, Finance, Economics, and Psychology. Apart from my academic curriculum, I was an active member of Training & Placement Cell(TnP), Textile Engineering Society (TES), Student Mentorship Program(SMP) & National Service Scheme(NSS).
-
Responsibilites held at Work
IndiGo Airlines
(Nov'16 to Jul'19: 2 yrs 9 mos)
- Statistical analysis in the areas of Revenue Management, productivity improvement, operational excellence, revenue maximization.
- Development of statistical models on demand forecasting, predictive analytics, machine learning, outlier identification, regression, and any other areas which may be required by the business.
- Formulation of hypotheses, validation using statistical analysis, and presentation of the findings to the Business Leaders.
- Field study and database mining by collating the data required for the analysis.
CenturyLink Congilytics
(Jul'15 to Sep'16: 1 yr 3 mos)
- Handled Analytics consulting projects that solved the client's business problems through descriptive, prescriptive & predictive analytical solutions.
- Researched potential consulting domains for analytics opportunities and developed Proof of Concept.
- Explored tools & platforms for big data-intensive machine learning tasks such as SAP Predictive Analytics, SAS, programming languages such as R & python, and database management systems such as SAP HANA & MySQL.


With environment you can create multiple environment for different projects with different packages and versions of these packages
Install Python > install pip > manage packages
Install Python >> virtualenv (package) >> manage packages
> Install Anaconda (Python DIstribution)
>> Conda (Package manage & Mange Virtual environment)


resource sqlite_query ( resource $dbhandle , string $query [, int $result_type = SQLITE_BOTH [, string &$error_msg ]] )
resource sqlite_query ( string $query , resource $dbhandle [, int $result_type = SQLITE_BOTH [, string &$error_msg ]] )
Object oriented style (method): SQLiteResult SQLiteDatabase::query ( string $query [, int $result_type = SQLITE_BOTH [, string &$error_msg ]] )
Executes an SQL statement given by the query against a given database handle.
This function will return a result handle or FALSE on failure. For queries that return rows, the result handle can then be used with functions such as sqlite_fetch_array() and sqlite_seek(). Regardless of the query type, this function will return FALSE if the query failed. sqlite_query() returns a buffered, seekable result handle. This is useful for reasonably small queries where you need to be able to randomly access the rows. Buffered result handles will allocate memory to hold the entire result and will not return until it has been fetched. If you only need sequential access to the data, it is recommended that you use the much higher performance sqlite_unbuffered_query() instead.


(#) Static Field Leaks !!! WARNING: Static Field Leaks This is a warning. Id : `StaticFieldLeak` Summary : Static Field Leaks Severity : Warning Category : Performance Platform : Android Vendor : Android Open Source Project Feedback : https://issuetracker.google.com/issues/new?component=192708 Affects : Kotlin and Java files Editing : This check runs on the fly in the IDE editor Implementation : [Source Code](https://cs.android.com/android-studio/platform/tools/base/+/mirror-goog-studio-main:lint/libs/lint-checks/src/main/java/com/android/tools/lint/checks/LeakDetector.kt) Tests : [Source Code](https://cs.android.com/android-studio/platform/tools/base/+/mirror-goog-studio-main:lint/libs/lint-tests/src/test/java/com/android/tools/lint/checks/LeakDetectorTest.kt) Copyright Year : 2016 A static field will leak contexts. Non-static inner classes have an implicit reference to their outer class. If that outer class is for example a `Fragment` or `Activity`, then this reference means that the long-running handler/loader/task will hold a reference to the activity which prevents it from getting garbage collected. Similarly, direct field references to activities and fragments from these longer running instances can cause leaks. ViewModel classes should never point to Views or non-application Contexts. (##) Example Here is an example of lint warnings produced by this check: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text src/test/pkg/LeakTest.java:18:Warning: Do not place Android context classes in static fields; this is a memory leak [StaticFieldLeak] private static Activity sField7; // LEAK! ------ src/test/pkg/LeakTest.java:19:Warning: Do not place Android context classes in static fields; this is a memory leak [StaticFieldLeak] private static Fragment sField8; // LEAK! ------ src/test/pkg/LeakTest.java:20:Warning: Do not place Android context classes in static fields; this is a memory leak [StaticFieldLeak] private static Button sField9; // LEAK! ------ src/test/pkg/LeakTest.java:21:Warning: Do not place Android context classes in static fields (static reference to MyObject which has field mActivity pointing to Activity); this is a memory leak [StaticFieldLeak] private static MyObject sField10; ------ src/test/pkg/LeakTest.java:30:Warning: Do not place Android context classes in static fields; this is a memory leak [StaticFieldLeak] private static Activity sAppContext1; // LEAK ------ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: `src/test/pkg/LeakTest.java`: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers package test.pkg; import android.annotation.SuppressLint; import android.app.Activity; import android.content.Context; import android.app.Fragment; import android.widget.Button; import java.util.List; @SuppressWarnings("unused") public class LeakTest { private static int sField1; private static Object sField2; private static String sField3; private static List sField4; private int mField5; private Activity mField6; private static Activity sField7; // LEAK! private static Fragment sField8; // LEAK! private static Button sField9; // LEAK! private static MyObject sField10; private MyObject mField11; @SuppressLint("StaticFieldLeak") private static Activity sField12; private static class MyObject { private int mKey; private Activity mActivity; } private static Activity sAppContext1; // LEAK private static Context sAppContext2; // Probably app context leak private static Context applicationCtx; // Probably app context leak } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ You can also visit the [source code](https://cs.android.com/android-studio/platform/tools/base/+/mirror-goog-studio-main:lint/libs/lint-tests/src/test/java/com/android/tools/lint/checks/LeakDetectorTest.kt) for the unit tests for this check to see additional scenarios. The above example was automatically extracted from the first unit test found for this lint check, `LeakDetector.testStaticFields`. To report a problem with this extracted sample, visit https://issuetracker.google.com/issues/new?component=192708. (##) Suppressing You can suppress false positives using one of the following mechanisms: * Using a suppression annotation like this on the enclosing element: ```kt // Kotlin @Suppress("StaticFieldLeak") fun method() { problematicStatement() } ``` or ```java // Java @SuppressWarnings("StaticFieldLeak") void method() { problematicStatement(); } ``` * Using a suppression comment like this on the line above: ```kt //noinspection StaticFieldLeak problematicStatement() ``` * Using a special `lint.xml` file in the source tree which turns off the check in that folder and any sub folder. A simple file might look like this: ```xml <?xml version="1.0" encoding="UTF-8"?> <lint> <issue id="StaticFieldLeak" severity="ignore" /> </lint> ``` Instead of `ignore` you can also change the severity here, for example from `error` to `warning`. You can find additional documentation on how to filter issues by path, regular expression and so on [here](https://googlesamples.github.io/android-custom-lint-rules/usage/lintxml.md.html). * In Gradle projects, using the DSL syntax to configure lint. For example, you can use something like ```gradle lintOptions { disable 'StaticFieldLeak' } ``` In Android projects this should be nested inside an `android { }` block. * For manual invocations of `lint`, using the `--ignore` flag: ``` $ lint --ignore StaticFieldLeak ...` ``` * Last, but not least, using baselines, as discussed [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html).


Parking.sg is a mobile application that allows drivers to pay for their parking sessions, receive reminders, and extend their parking sessions, straight from their mobile phones.
ScamShield is a mobile app that actively works in the background to filter scam messages and calls from numbers used in illegal activities, preventing scammers from contacting you.


JavaScript If...Else Statements
Conditional statements are used to perform different actions based on different conditions.
Conditional Statements
In JavaScript we have the following conditional statements:
- Use if to specify a block of code to be executed, if a specified condition is true
- Use else to specify a block of code to be executed, if the same condition is false
- Use else if to specify a new condition to test, if the first condition is false
- Use switch to specify many alternative blocks of code to be executed
The if Statement
Display "Good day!" if the hour is less than 18:00:
Good Evening!
The else Statement
Click the button to display a time-based greeting:
The else if Statement
Click the button to get a time-based greeting:


7kai Tasks Checker Options.
Notification
Notification off.
Auto close Notification after
sec. (0 is no auto close.)
save and close


import sys from typing import List, Optional, Tuple from pip._vendor.packaging.tags import Tag from pip._internal.utils.compatibility_tags import get_supported, version_info_to_nodot from pip._internal.utils.misc import normalize_version_info class TargetPython: """ Encapsulates the properties of a Python interpreter one is targeting for a package install, download, etc. """ __slots__ = [ "_given_py_version_info", "abis", "implementation", "platforms", "py_version", "py_version_info", "_valid_tags", ] def __init__( self, platforms=None, # type: Optional[List[str]] py_version_info=None, # type: Optional[Tuple[int, ...]] abis=None, # type: Optional[List[str]] implementation=None, # type: Optional[str] ): # type: (...) -> None """ :param platforms: A list of strings or None. If None, searches for packages that are supported by the current system. Otherwise, will find packages that can be built on the platforms passed in. These packages will only be downloaded for distribution: they will not be built locally. :param py_version_info: An optional tuple of ints representing the Python version information to use (e.g. `sys.version_info[:3]`). This can have length 1, 2, or 3 when provided. :param abis: A list of strings or None. This is passed to compatibility_tags.py's get_supported() function as is. :param implementation: A string or None. This is passed to compatibility_tags.py's get_supported() function as is. """ # Store the given py_version_info for when we call get_supported(). self._given_py_version_info = py_version_info if py_version_info is None: py_version_info = sys.version_info[:3] else: py_version_info = normalize_version_info(py_version_info) py_version = '.'.join(map(str, py_version_info[:2])) self.abis = abis self.implementation = implementation self.platforms = platforms self.py_version = py_version self.py_version_info = py_version_info # This is used to cache the return value of get_tags(). self._valid_tags = None # type: Optional[List[Tag]] def format_given(self): # type: () -> str """ Format the given, non-None attributes for display. """ display_version = None if self._given_py_version_info is not None: display_version = '.'.join( str(part) for part in self._given_py_version_info ) key_values = [ ('platforms', self.platforms), ('version_info', display_version), ('abis', self.abis), ('implementation', self.implementation), ] return ' '.join( f'{key}={value!r}' for key, value in key_values if value is not None ) def get_tags(self): # type: () -> List[Tag] """ Return the supported PEP 425 tags to check wheel candidates against. The tags are returned in order of preference (most preferred first). """ if self._valid_tags is None: # Pass versions=None if no py_version_info was given since # versions=None uses special default logic. py_version_info = self._given_py_version_info if py_version_info is None: version = None else: version = version_info_to_nodot(py_version_info) tags = get_supported( version=version, platforms=self.platforms, abis=self.abis, impl=self.implementation, ) self._valid_tags = tags return self._valid_tags


YAHOO is already on the page. We will instantiate a YUILoader instance to load additional components. Note that because YAHOO is already on the page, we are not able to take advantage of the automatic rollup capability (we load dom and event individually instead of yahoo-dom-event).


Merge sort is a divide and conquer algorithm which sorts a given array.
Merge sort divides the array into two halves, sorts the two halves recursively using merge sort and then merges the two halvs to form the final sorted array.
Some of the features of Merge sort algorithm are as follows :
The psuedocode for Merge sort is as follows :
MERGE-SORT(A,p,r) :
if p < r :
q = floor((p + r) / 2)
MERGE-SORT(A,p,q)
MERGE-SORT(A,q+1,r)
MERGE(A,p,q,r)
The above "MERGE-SORT" function uses a "MERGE" function to merge the arrays. The psuedocode for "MERGE" is as follows :
MERGE(A,p,q,r) :
n1 = q - p + 1
n2 = r - q
let L[0...n1] of length (n1 + 1) and R[0...n2] of length (n2 + 1) be two new arrays
for i = 0 to (n1 - 1) :
L[i] = A[p + i - 1]
for j = 0 to (n2 - 1) :
R[j] = A[q + j]
L[n1] = ∞ //Sentinal node
R[n2] = ∞ //Sentinal node
i = 0
j = 0
for k = p to r :
if L[i] <= R[j] :
A[k] = L[i]
i = i + 1
else :
A[k] = R[j]
j = j+1


{% extends 'base.html' %} {%block content%} {{ block.super}}
This is my gallery where you can view different images. You can search for images with diffrent to their names like food,Media,Flower,Vegetables,Family,Forest,Computer


Module: Enumerable
- Defined in:
- lib/spatial_stats/enumerable_ext.rb
Overview
Extension to the Enumerable module
Instance Method Summary collapse
-
#mean ⇒ Float
Mean works with a numeric array and returns the arithmetic mean.
-
#sample_variance ⇒ Float
Sample Variance works with a numeric array and returns the variance.
-
#standardize ⇒ Array
Standardize works with a numeric array and transforms each value so that the mean is 0 and the variance is 1.
Instance Method Details
#mean ⇒ Float
Mean works with a numeric array and returns the arithmetic mean.
31 32 33 |
# File 'lib/spatial_stats/enumerable_ext.rb', line 31 def mean sum / size.to_f end |
#sample_variance ⇒ Float
Sample Variance works with a numeric array and returns the variance. Formula for variance is (x - mean)**2/(n - 1)
44 45 46 47 48 |
# File 'lib/spatial_stats/enumerable_ext.rb', line 44 def sample_variance m = mean numerator = sum { |v| (v - m)**2 } numerator / (size - 1).to_f end |
#standardize ⇒ Array
Standardize works with a numeric array and transforms each value so that the mean is 0 and the variance is 1. Formula is (x - mean)/stdev
16 17 18 19 20 21 |
# File 'lib/spatial_stats/enumerable_ext.rb', line 16 def standardize # standardize is (variable - mean)/stdev m = mean std = Math.sqrt(sample_variance) map { |v| (v - m) / std } end |