src.resource_ops package¶
Submodules¶
src.resource_ops.exception module¶
@author: Jatin Goel
src.resource_ops.output_formatter module¶
File for handling the output received from executing the PowerShell / Shell Script.
An object of Output will be returned for each response received.
Instance of the Output class has the following attributes:
output – raw output received from the script
formatted_output – list of the formatted output
same as output, if the output received is one-line, or not in a tabular formatcolumns – list of columns, if the output returned was of table type
exit_code – exit code received from the script execution
exception – raw exception message, if an exception was raised by the script
exception_code – exception error code for the exception raised by the script
exception_message – exception error message for the exception raised by the script
The Output class currently supports 2 types of outputs that it can format, and generate simplified output object for:
Tabular output
The output from the script which is in the form of a table.
e.g.:
COLUMN1 COLUMN2 COLUMN3 COLUMN4
——- ——- ——- ——-
value01 value02 value03 value04
value11 value12 value13 value14
String output
The output from the script which has both the column and values in the type of a string.
e.g.:
@{COLUMN1=value1;COLUMN2=value2;COLUMN3=value3;COLUMN4=value4}
This file has 3 classes: Output, UnixOutput, and WindowsOutput.
Output: Base class for both UNIX and Windows Output result.
UnixOutput: Derived class from Output, which handles output received from executing Shell scripts / commands.
WindowsOutput: Derived class from Output, which handles output received from executing PowerShell scripts / commands.
Output:
__init__() – initializes the attributes and properties of the Output class
_extract_output() – extracts the output from the raw output received
_extract_exception() – extracts the exception from the raw error received
WindowsOutput:
get_rows() – returns the list of rows that match the given filter
get_column() – returns the list of values for the given column
get_columns() – returns the list of all values for the given columns
-
src.resource_ops.output_formatter.
GET_COLUMNS_FROM_STRING_REGEX
= '@{(.*?)}'¶ str: Module level regular expression to column names from a string.
This regular expression is used to get the column names from a PowerShell string of type
@{COLUMN1=value1;COLUMN2=value2;COLUMN3=value3;COLUMN4=value4}
-
src.resource_ops.output_formatter.
GET_COLUMNS_FROM_TABLE_REGEX
= '(.*?)--'¶ str: Module level regular expression to get the column names from a PowerShell table.
This regular expression is used to get the column names from a PowerShell table
COLUMN1 COLUMN2 COLUMN3 COLUMN4
——- ——- ——- ——-
value01 value02 value03 value04
value11 value12 value13 value14
-
src.resource_ops.output_formatter.
GET_ERROR_CODE_REGEX
= '(\\d\\w[\\d\\w]*) '¶ str: Module level regular expression to get the error code.
This regular expression is used to get the error code from the exception raised from executing a PowerShell script.
-
src.resource_ops.output_formatter.
GET_VALUES_FROM_STRING_REGEX
= '=([\\w\\d\\.\\s\\(\\)-\\:\\\\@]*)'¶ str: Module level regular expression to get the values in a string.
This regular expression is used to get the values from a PowerShell string of type
@{column1=VALUE1;column2=VALUE2;column3=VALUE3;column4=VALUE4}
-
src.resource_ops.output_formatter.
GET_VALUES_FROM_TABLE_REGEX
= '--([-\\\\\\.:\\"\\#\\%\\_\\(\\)\\s\\w\\$\\=,]*)'¶ str: Module level regular expression to get all the values from a PowerShell table.
This regular expression is used to get the values from a PowerShell table
Column1 Column2 Column3 Column4
——- ——- ——- ——-
VALUE01 VALUE02 VALUE03 VALUE04
VALUE11 VALUE12 VALUE13 VALUE14
-
class
src.resource_ops.output_formatter.
Output
(exit_code, output, error)[source]¶ Bases:
object
Base class for the handling the output received from executing the script.
-
columns
¶ Returns the columns received from the script.
-
exception
¶ Returns the raw exception message received from the script.
-
exception_code
¶ Returns the exception error code received from the script.
-
exception_message
¶ Returns the exception message received from the script.
-
exit_code
¶ Returns the exit code received from the script
-
formatted_output
¶ Returns the output formatted into a list of lists received from the script.
-
output
¶ Returns the raw output received from the script.
-
-
class
src.resource_ops.output_formatter.
UnixOutput
(exit_code, output, error)[source]¶ Bases:
src.resource_ops.output_formatter.Output
Class for the handling the output received from executing the Shell script for UNIX machines.
-
class
src.resource_ops.output_formatter.
WindowsOutput
(exit_code, output, error)[source]¶ Bases:
src.resource_ops.output_formatter.Output
Class for the handling the output received from executing the PowerShell script for Windows machines.
-
get_column
(column)[source]¶ Returns the list of value for the column given.
- Args:
- column (str) – column name to get the values of
- Returns:
None - if the type of formatted output attribute is not list
list - list consisting of values for the given column
-
get_columns
(columns)[source]¶ Returns the list of values for the columns in the input columns list.
- Args:
- columns (list) – list of columns whose values should be returned
- Returns:
None - if the type of formatted output attribute is not list
list - list consisting of all lists which matched the filter
- Raises:
- Exception - if type of columns is not list
-
get_rows
(keys, match_all_values=False)[source]¶ Filters the output based on the keys and their given values.
- Args:
- keys (dict) – dictionary consisting of the keys as the column name
- and the value as the value of the column
- match_all_values (bool) – boolean to specify whether to return the row
- that matches all the values or the rows where any of the value matches
default: False
- e.g.:
True - return the row where all key and values match
False - return the rows where any of the key or value match
- Returns:
None - if the type of formatted output attribute is not list
list - list consisting of dicts which matched the filter
- Raises:
- Exception - if type of keys is not dict
-
src.resource_ops.pyping module¶
@author: Jatin Goel
A pure python ping implementation using raw sockets.
Note that ICMP messages can only be send from processes running as root (in Windows, you must run this script as ‘Administrator’).
This is a copy of the PyPI package: pyping
But due to some import errors, it is not able to execute on Python 3, out of the box.
So I’ve copied the its source here directly.
-
class
src.resource_ops.pyping.
Ping
(destination, timeout=1000, packet_size=55, own_id=None, quiet_output=True, udp=False, bind=None)[source]¶ Bases:
object
Ping a machine, and store its response in a Response object.
-
header2dict
(names, struct_format, data)[source]¶ unpack the raw received IP and ICMP header informations to a dict
-
print_success
(delay, ip_addr, packet_size, ip_header, icmp_header)[source]¶ Print if the Reponse was Success.
-
-
src.resource_ops.pyping.
calculate_checksum
(source_string)[source]¶ A port of the functionality of in_cksum() from ping.c Ideally this would act on the string as a series of 16-bit ints (host packed), but this works. Network data is big-endian, hosts are typically little-endian
-
src.resource_ops.pyping.
is_valid_ip4_address
(addr)[source]¶ Checks if the add is a valid IP4 address or not.
src.resource_ops.resource module¶
@author: Jatin Goel
File for performing operations on a resource.
This file consists of a class: Resource, which can connect to the remote machine, using PowerShell for Windows, and SSH for UNIX.
The instance of this class can be used to perform various operations on a machine, like,
- Check if a Directory Exists or not
- Create a new Directory
- Rename a File / Folder
- Remove an existing Directory
- Get the Size of a File / Folder
- Check if a Registry exists or not
- Add / Update a Registry Key / Value
- Get the Value of a Registry Key
- Delete a Registry Key / Value
- Compare the contents of 2 Files / Folders
Resource¶
__new__() – pings the resource, to get the OS details, whether Windows / UNIX, and initialize the class instance accordingly
__init__() – initializes an instance of the Resource class
_login() – creates a connection to the remote client
_convert_size() – converts the given float size to appropriate size in B / KB / MB / GB, etc.
_get_client_ip() – gets the ip address of the machine
execute() – execute an operation on the client
execute_command() – executes a command on the machine
execute_script() – executes a script on the machine
get_storage_details() – returns the storage details of this machine
join_path() – joins the path using the separator based on the OS of the Machine
reboot_client() – reboots the machine
kill_process() – terminates a running process on the client machine either with the given process name or the process id
disconnect() – disconnects the session with the machine
Attributes¶
os_info – returns the OS details of the client (Windows / UNIX)
os_sep – returns the path separator based on the OS of the Machine
ip_address – returns IP address of the machine
Usage¶
For creating an object of any resource, i.e., Windows / UNIX, the user should only initialize an object of the Resource class, which internally takes care of detecting the OS of the machine, and initializes the appropriate object.
Resource class object can be initialized in 2 ways:
If the resource is a Remote Machine:
>>> resource = Resource(hostname, username, password)If the resource is the Local Machine:
>>> resource = Resource(local_machine_hostname)OR
>>> resource = Resource()
-
class
src.resource_ops.resource.
Resource
(hostname=None, username=None, password=None)[source]¶ Bases:
object
Class for performing operations on a remote client.
-
disconnect
()[source]¶ Disconnects the current session with the resource.
Deletes the object’s attributes.
Removes the Credentials File as well, if it was created.
-
execute
(script, script_arguments=None)[source]¶ Execute the script remotely on a client using the credentials provided.
- Args:
script (str) – path of the script file to execute on the remote client
script_arguments (str) – arguments to be passed to the script.
default: None- Returns:
- object - instance of Output class
-
execute_command
(command)[source]¶ Executes a command on the resource.
An instance of the Output class is returned.
Output / Exception messages received from command execution are available as the attributes of the class instance.
output_instance.output – raw output returned from the command
output_instance.formatted_output – o/p received after parsing the raw output
output_instance.exception – raw exception message
output_instance.exception_message – parsed exception message from the raw o/p
- Args:
- command (str) – command to be executed on the resource
- Returns:
- object - instance of Output class
-
execute_script
(script_path, data=None)[source]¶ Executes the script at the given script path on the resource.
- Args:
script_path (str) – PowerShell / UNIX shell/bash script to be executed on the resource
script should be of same format as other PowerShell / UNIXShell scripts present in:
- PowerShell - ..\Scripts\Windows\
- UNIX shell / bash - ..\Scripts\UNIX\
data (dict) – dictionary consisting of the variables and its values, to be substituted in the script
- Returns:
- object - instance of Output class corresponding to WindowsOutput for WindowsResource and UnixOutput for UnixResource
-
get_storage_details
(root=False)[source]¶ - Gets the details of the Storage on the Client.
- Returns the details of all paths, if root is set to the default value False. If root is set to True, it returns the details of only /
- Args:
- root (bool) – boolean flag to specify whether to return details of all paths,
- or the details of the path mounted on root(/)
- Returns:
dict - dictionary consisting the details of the storage on the client (in MB)
- {
‘total’: size_in_MB,
‘available’: size_in_MB,
- ‘drive’: {
‘total’: size_in_MB,
‘available’: size_in_MB,
}
}
-
ip_address
¶ Returns the IP address of the Resource.
-
is_healthy
()[source]¶ Checks if the resource is healthy or not.
A resource health check can be done using various parameters.
Here, we’ll be doing a very basic check using the below parameters:
- Network Check: check if the machine has internet connectivity
- Disk space check: check whether the resource has at least 1 GB free space
in C:(for Windows) or /root (for UNIX)
- Args:
- None
- Returns:
- bool: boolean value specifying whether the resource is healthy or not
-
join_path
(path, *args)[source]¶ - Joins the paths given in the args list with the given path using the os separator based
- on the OS / Type of the Resource
- Args:
path (str) – root path to join the rest of the elements to
*args (tuple) – list of the elements of path to join to the root path
- Returns:
- str - full path generated after joining all the elements using the OS sep
-
kill_process
(process_name=None, process_id=None)[source]¶ Terminates a running process on the client machine either with the given process name or the process id.
- Args:
process_name (str) – name of the process to be terminate
process_id (str) – ID of the process ID to be terminated
- Returns:
- object - instance of the Output class
- Raises:
- Exception:
if neither the process name nor the process id is given
if failed to kill the process
-
os_flavour
¶ Returns the OS flavour of this resource.
-
os_info
¶ Returns the OS Info of this resource.
-
os_sep
¶ Returns the path separator based on the OS of the resource.
-
reboot_client
()[source]¶ Reboots the Resource.
Please NOTE that the connectivity will go down in this scenario, and the Resource class may not be able to re-establish the connection to the Machine.
In such cases, the user will have to initialize the Resource class instance again.
- Args:
- None
- Returns:
- object - instance of the Output class
- Raises:
- Exception:
- if failed to reboot the client
-
src.resource_ops.script_generator module¶
@author: Jatin Goel
Helper File to generate the PowerShell / UNIX Shell script to be executed on the remote client.
- This file takes the raw script path as the value for the script attribute
- Substitutes the values in the script, with the values given by the user
- Appends the footer script (for PowerShell Scripts only)
- Returns / Writes the final script to a temp file, based on the options selected by the User
- Machine class takes care of executing the final script on the client
Any variable in the PowerShell / Shell script should be in the format:
##HealthChecker–VARIABLE_NAME–HealthChecker##
For PowerShell scripts, the main function name should be in this format:
Function FUNCTION_NAME() {
Do Something…}
, and should be present at top of the PowerShell script file.
PowerShell Function
keyword should always be used in this format only for the main function
that should be executed from the script, and not like function
.
In Windows, this script must be ran as ‘Administrator’
Usage¶
Initialize object of the ScriptGenerator class with the machine name, and credentials file path:
>>> script_generator = ScriptGenerator(resource_name, credentials_file)
If Machine name, and Credentials file are set to None, default value $null will be set
Provide the path of the raw script, i.e., set the attribute script to the path of the raw file:
>>> script_generator.script = PATH_OF_THE_RAW_SCRIPT_FILE
Call the method run() with the dictionary consisting of the values to be substituted
To return the contents of the script:
>>> script_generator.run( data={ 'argument1': 'value1', 'argument2': 'value2' }, return_script=True )
To write the script into a file, and return path of the file:
>>> script_generator.run( data={ 'argument1': 'value1', 'argument2': 'value2' }, return_script=False )
To further select columns from the output of the Invoke-Command cmdlet (For Windows)
>>> script_generator.run( data={ 'argument1': 'value1', 'argument2': 'value2' }, select_columns=[column1, column2] )
Note: Key in the dictionary should be the same name as the argument in the Script.
-
class
src.resource_ops.script_generator.
ScriptGenerator
(resource_name=None, credentials_file=None)[source]¶ Bases:
object
Generates the PowerShell / UNIX Shell script to be executed on the remote client.
-
final_script
¶ Returns the value of the final script attribute(Footer script for PowerShll scripts).
-
generate_script
(add_final_script, select_columns=None)[source]¶ Generates the script to be executed on the client after adding the Arguments:
$ComputerName
$CredentialsFile
to the script, and the Footer script if the add_final_script flag is set to True.
- Args:
add_final_script (bool) – boolean flag to specify whether the footer part must be added to the script or not
Only applicable for PowerShell scripts for Windowsselect_columns (list) – list of columns to be further selected from the output of the Invoke-Command cmdlet
Only applicable for PowerShell scripts for Windows
default: None
- Returns:
- str - script content after adding the arguments, and the footer script
-
run
(data, return_script=False, add_final_script=True, select_columns=None)[source]¶ Generates and Returns the final script / path of the final script based on the user inputs.
- Args:
data (dict) – dictionary consisting of the variables in the script as its keys, and their data is it’s value
return_script (bool) – boolean flag specifying whether to return the contents of the final script as a string OR write the script to a file, and return the file path
default: Falseadd_final_script (bool) – boolean flag to specify whether the footer part must be added to the script or not
Only applicable for PowerShell scripts for Windows
default: True
select_columns (list) – list of columns to be further selected from the output of the Invoke-Command cmdlet
Only applicable for PowerShell scripts for Windows
default: None
- Returns:
- str - string value consisting of either the script contents / full path of the script file
- Raises:
- Exception:
if an argument is missing in the data dict
if type of the value in the data dict is not supported
-
script
¶ Returns the script currently loaded into the instance of this class.
-
script_name
¶ Returns the name of the script file currently loaded into the instance of this class.
-
static
substitute_arguments
(script, data)[source]¶ Parses through the final script.
Gets the list of all arguments to be substituted in the script.
Substitutes the value of the argument with the value given in the data dict.
- Args:
script (str) – raw script consisting of the arguments to be substituted
data (dict) – dictionary consisting of the Script Arguments as key, and its value to be substituted
- Returns:
- str - final script with the values set for the Script Arguments
- Raises:
- Exception:
if any argument in the script is missing in the data dict
if the type of the value is not supported
-
src.resource_ops.scripts_defines module¶
@author: Jatin Goel
File for storing all the scripts paths.
src.resource_ops.unix_resource module¶
@author: Jatin Goel
File for performing operations on a resource.
This file consists of a class: UnixResource, which can connect to the remote UNIX Machine, using SSH via Paramiko.
The instance of this class can be used to perform various operations on a machine, like,
- Check if a Directory Exists or not
- Create a new Directory
- Rename a File / Folder
- Remove an existing Directory
- Get the Size of a File / Folder
- Check if a Registry exists or not
- Add / Update a Registry Key / Value
- Get the Value of a Registry Key
- Delete a Registry Key / Value
- Compare the contents of 2 Files / Folders
UnixResource¶
__init__() – initializes an instance of the Resource class
_login() – creates a connection to the remote client
_get_client_ip() – gets the ip address of the machine
execute() – execute an operation on the client
execute_command() – executes a command on the machine
get_storage_details() – returns the storage details of this machine
reboot_client() – reboots the machine
kill_process() – terminates a running process on the client machine either with the given process name or the process id
disconnect() – disconnects the session with the machine
Attributes¶
os_info – returns the OS details of the client
os_sep – returns the path separator based on the OS of the Machine
ip_address – returns IP address of the machine
Usage¶
For creating an object of any resource, i.e., Windows / UNIX, the user should only initialize an object of the Resource class, which internally takes care of detecting the OS of the machine, and initializes the appropriate object.
Resource class object can be initialized in 2 ways:
If the resource is a Remote Machine:
>>> resource = Resource(hostname, username, password)If the resource is the Local Machine:
>>> resource = Resource(local_machine_hostname)OR
>>> resource = Resource()
-
class
src.resource_ops.unix_resource.
UnixResource
(hostname=None, username=None, password=None)[source]¶ Bases:
src.resource_ops.resource.Resource
Class for performing operations on a UNIX client.
-
disconnect
()[source]¶ Disconnects the current session with the resource.
Deletes the object’s attributes.
Removes the Credentials File as well, if it was created.
-
execute
(script, script_arguments=None)[source]¶ Execute the script remotely on a client using the credentials provided.
- Args:
script (str) – path of the script file to execute on the remote client
script_arguments (str) – arguments to be passed to the script.
default: None- Returns:
- object - instance of Output class
-
execute_command
(command)[source]¶ Executes a command on the resource.
An instance of the UnixOutput class is returned.
Output / Exception messages received from command execution are available as the attributes of the class instance.
output_instance.output – raw output returned from the command
output_instance.formatted_output – o/p received after parsing the raw output
output_instance.exception – raw exception message
output_instance.exception_message – parsed exception message from the raw o/p
- Args:
- command (str) – command to be executed on the resource
- Returns:
- object - instance of UnixOutput class
-
get_storage_details
(root=False)[source]¶ Gets the details of the Storage on the Client. Returns the details of all paths, if root is set to the default value False. If root is set to True, it returns the details of only /
- Args:
- root (bool) – boolean flag to specify whether to return details of all paths,
- or the details of the path mounted on root(/)
- Returns:
dict - dictionary consisting the details of the storage on the client (in MB)
- {
‘total’: size_in_MB,
‘available’: size_in_MB,
- ‘drive’: {
‘total’: size_in_MB,
‘available’: size_in_MB,
}
}
-
get_uname_output
(options='-s')[source]¶ Gets the uname output from the machine
- Args:
options (str) – options to uname command
default: “-s”- Returns:
- str - uname output
- Raises:
- Exception:
- if any error occurred while getting the uname output.
-
is_healthy
()[source]¶ Checks if the resource is healthy or not.
A resource health check can be done using various parameters.
Here, we’ll be doing a very basic check using the below parameters:
- Network Check: check if the machine has internet connectivity
- Disk space check: check whether the resource has at least
1 GB free space in /root
- Args:
- None
- Returns:
- bool: boolean value specifying whether the resource is healthy or not
-
kill_process
(process_name=None, process_id=None)[source]¶ Terminates a running process on the client machine either with the given process name or the process id.
- Args:
process_name (str) – name of the process to be terminate
process_id (str) – ID of the process ID to be terminated
- Returns:
- object - instance of the Output class
- Raises:
- Exception:
if neither the process name nor the process id is given
if failed to kill the process
-
os_sep
¶ Returns the path separator based on the OS of the resource.
-
reboot_client
()[source]¶ Reboots the Resource.
Please NOTE that the connectivity will go down in this scenario, and the Resource class may not be able to re-establish the connection to the Machine.
In such cases, the user will have to initialize the Resource class instance again.
- Args:
- None
- Returns:
- object - instance of the Output class
- Raises:
- Exception:
- if failed to reboot the client
-
src.resource_ops.windows_resource module¶
@author: Jatin Goel
File for performing operations on a resource.
This file consists of a class: WindowsResource, which can connect to the remote Windows Machine, using PowerShell Remoting.
The instance of this class can be used to perform various operations on a machine, like,
- Check if a Directory Exists or not
- Create a new Directory
- Rename a File / Folder
- Remove an existing Directory
- Get the Size of a File / Folder
- Check if a Registry exists or not
- Add / Update a Registry Key / Value
- Get the Value of a Registry Key
- Delete a Registry Key / Value
- Compare the contents of 2 Files / Folders
WindowsResource¶
__init__() – initializes an instance of the Resource class
_login() – creates a connection to the remote client
_get_client_ip() – gets the ip address of the machine
execute() – execute an operation on the client
execute_command() – executes a command on the machine
get_storage_details() – returns the storage details of this machine
reboot_client() – reboots the machine
kill_process() – terminates a running process on the client machine either with the given process name or the process id
disconnect() – disconnects the session with the machine
Attributes¶
os_info – returns the OS details of the client
os_sep – returns the path separator based on the OS of the Machine
ip_address – returns IP address of the machine
Usage¶
For creating an object of any resource, i.e., Windows / UNIX, the user should only initialize an object of the Resource class, which internally takes care of detecting the OS of the machine, and initializes the appropriate object.
Resource class object can be initialized in 2 ways:
If the resource is a Remote Machine:
>>> resource = Resource(hostname, username, password)If the resource is the Local Machine:
>>> resource = Resource(local_machine_hostname)OR
>>> resource = Resource()
-
class
src.resource_ops.windows_resource.
WindowsResource
(hostname=None, username=None, password=None)[source]¶ Bases:
src.resource_ops.resource.Resource
Class for performing operations on a Windows client.
-
disconnect
()[source]¶ Disconnects the current session with the resource.
Deletes the object’s attributes.
Removes the Credentials File as well, if it was created.
-
execute
(script, script_arguments=None)[source]¶ Execute the script remotely on a client using the credentials provided.
- Args:
script (str) – path of the script file to execute on the remote client
script_arguments (str) – arguments to be passed to the script.
default: None- Returns:
- object - instance of WindowsOutput class
-
execute_command
(command)[source]¶ Executes a PowerShell command on the resource.
An instance of the WindowsOutput class is returned.
Output / Exception messages received from command execution are available as the attributes of the class instance.
output_instance.output – raw output returned from the command
output_instance.formatted_output – o/p received after parsing the raw output
output_instance.exception – raw exception message
output_instance.exception_message – parsed exception message from the raw o/p
- Args:
- command (str) – PowerShell command to be executed on the machine
- Returns:
- object - instance of WindowsOutput class
-
get_storage_details
()[source]¶ Gets the details of the Storage on the Client.
- Returns:
dict - dictionary consisting the details of the storage on the client (in MB)
- {
‘total’: size_in_MB,
‘available’: size_in_MB,
‘drive’: {
‘total’: size_in_MB,
‘available’: size_in_MB,
}
}
- Raises:
- GetStorageFailedException(Exception_Code, Exception_Message):
- if failed to get the storage details for the machine
-
is_healthy
()[source]¶ Checks if the resource is healthy or not.
A resource health check can be done using various parameters.
Here, we’ll be doing a very basic check using the below parameters:
- Network Check: check if the machine has internet connectivity
- Disk space check: check whether the resource has at least
1 GB free space in C:
- Args:
- None
- Returns:
- bool: boolean value specifying whether the resource is healthy or not
-
kill_process
(process_name=None, process_id=None)[source]¶ Terminates a running process on the client machine either with the given process name or the process id.
- Args:
process_name (str) – name of the process to be terminate
process_id (str) – ID of the process ID to be terminated
- Returns:
- object - instance of the WindowsOutput class
- Raises:
- Exception:
if neither the process name nor the process id is given
if failed to kill the process
-
os_sep
¶ Returns the path separator based on the OS of the resource.
-
reboot_client
()[source]¶ Reboots the Resource.
Please NOTE that the connectivity will go down in this scenario, and the Resource class may not be able to re-establish the connection to the Machine.
In such cases, the user will have to initialize the Resource class instance again.
- Args:
- None
- Returns:
- object - instance of the WindowsOutput class
- Raises:
- Exception:
- if failed to reboot the client
-
Module contents¶
@author: Jatin Goel


Easter eggs are a thing.
Backlinks
Drink; drink and be merry. Have an easter egg, or eat some other food.
These are some fake notes. Feel free to poke around. You may spot an easter egg or two! Also, I like food.


Version Control to Major Tom:
A Stellar Coding Adventure
Back to Blog
More About Me
Back to Home Page
Nov. 2: Regular Regex
Among the many very very ultra essential important things that one must know about Ruby is a tool that hides under a rather benign name: Regular Expressions, or Regex.
Even a newbie like me has hear of those objects, and shuddered at the thought of grappling with them. But grapple one must if one is to enter Dev Bootcamp's hallowed Phase 1. So there goes...
While they do come preceded with a rather sinister reputation, regexes are "simply" tools that provide away of finding, replacing or specifying a pattern of characters in a strong. The slash / character signals a regex.
At its most simple, a regex can help you find and replace frequently misspelled words in a long text ("thier" instead of "their"), or clean up an unruly table, such as a list of countries by population:
Rank Country Population Date % of world population
1 China[Note 2] 1,372,940,000 November 1, 2015 18.9%
2 India 1,279,410,000 November 1, 2015 17.6%
3 United States[Note 3] 322,142,000 November 1, 2015 4.42%
4 Indonesia 255,461,700 July 1, 2015 3.51%
5 Brazil 205,127,000 November 1, 2015 2.82%
6 Pakistan 188,925,000 July 1, 2015 2.59%
7 Nigeria 182,202,000 July 1, 2015 2.5%
8 Bangladesh 159,292,000 November 1, 2015 2.19%
9 Russia[Note 4] 146,422,030 November 1, 2015 2.01%
A simple, compact regular expression such as "\[\d+\]" would get rid of the distracting footnote brackets. Another, the disarmingly brief "^ +", would remove leading white spaces.
Regex in Ruby
In Ruby, regexes are instances of the Regexp class and provides ready methods to manipulate data.
One such method is gsub, which stands for global substitution, meaning it finds and replaces all instances of a given pattern. For instance, how many times have you seen the Oracle of Omaha's name misspelled?
str="Warren Buffet declined to answer audience questions at a Jimmy Buffet concert"
puts str.gsub("Buffet", "Buffett")
# => Warren Buffett declined to answer audience questions at a Jimmy Buffett concert
Other regex methods of note: the string method Match, which can zero in on a portion of data and deliver essential information such as a dollar amount.
Back to Home Page
Let's say you have an hour-long mayoral speech on New York City's fiscal 2016. You turn the speech into an array, and try to find DOLLAR AMOUNTS in this endless jumble of words:
budget_arr = ["Again, the executive budget for Fiscal 2015 will be $73.9 billion. We arrived at this budget with really a fantastic partnership from the City Council, from Speaker Mark-Viverito and all of her colleagues, and from working with elected officials and community leaders all over the city as we developed a number of our initiatives."
"Again, we’ve talked about the UFT budget. We’ve also talked about the fact that those healthcare savings are extrapolated over all the municipal contracts that would amount to $3.4 billion in healthcare savings over the term of these contracts."
"Now, looking ahead, we continue to face multi-billion dollar budget gaps in the out years. This is the structural deficit that we know we still face. The good news is these are manageable deficits. We’re confident that we will be able to handle them in time and they’re well below the deficits that we’ve seen in the last decade or so.
"Let me indicate here, this is Fiscal ’16, just over $2 billion; Fiscal ’17, just over $2 billion, Fiscal ’18 just over $3 billion. And again, you’ll see the comparison to the average over the previous 12 years. The average for what would be the third year of the budget, $3 billion, $3.7 billion. So in comparison, we feel that we’re in a strong position, but we know we have real work to do to close those deficits going forward."
You just want to collect the dollar amounts mentioned by Hizzoner, you simply type:
budget_arr.each do |budget|
mtch = budget.match(/\$[\d,]+/)
puts mtch
end
Some colorful characters in the regex family:
* The greedy operator, which you just saw: the "+" sign will match the pattern that precedes it as many times as necessary, meaning it can return 73.9 , 3.7 or a nice round 3.
* The dot character, the Leatherman multitool of the regex world, which matches anything -- symbols, letter, number.
* The lazy dot, aka the question mark, which can grab the smallest part of a given pattern, thereby widening the search.
* The ^ and $ Anchors : They match a position instead of a character. The caret matches at the start of the string, and the dollar sign at the end of the string.
* The Pipe , which is the equivalent of "or". War|Peace matches War in "War and Peace", and if applied again it matches Peace. Pipes can be combined for even more matches.
TEMPORARY CONCLUSION: Entire books can be written about regular expressions, but the one thing to know about them is that they're there to help you.
Back to Home Page


About me
More about me?
I am an Android and Web Developer, residing in Nairobi, Kenya.I did my bachelor at Baraton University and am currently at Moringa school persuing software development courses. I enjoy learning new things and implementing them on the exciting projects based on personal initiative . When not immersed in code and some chillhop music, you'll find me reading ebooks, rugby and watching football. Want to work together? I'd love to hear from you.
ContactTechnical Skills
Web Applications
Github search
Github Search is a web application that is aimed at speeding up the process of searching different github handlers.
View projectMobile Applications
Donate Blood Save Blood
An app that connect Blood donors from various location with blood seekers.
View projectEvent Organizer
Mobile app containing various events where one is able to subscribe from the API
View projectGet in Touch
-
Nairobi, 00100, Kenya
-
+<PHONE_NUMBER>81
-
Calvince.Omonge@kra.go.ke


Grammy nominations: Nipsey Hussle nominated for 3 posthumous Grammy awards 8 months after murder
by WABCLOS ANGELES -- The Grammy nominees have been announced and it's a bittersweet honor for murdered rapper Nipsey Hussle.
He received three posthumous nominations.
His song "Racks In the Middle" is up for best rap performance and best rap song.
"Higher" - a collaboration with DJ Khaled and John Legend that was one of the last songs Hussle recorded - is nominated for best rap/sung performance.
Nipsey was shot and killed outside his clothing store in Los Angeles' Hyde Park neighborhood on March 31.
Police later arrested Eric R. Holder, Jr.
Holder and Hussle allegedly had a discussion or argument in front of the store that day, and Holder returned a short time later and started shooting, according to police.
A judge earlier this month confirmed Holder will go to trial, rejecting a defense motion to dismiss the case.
MORE: Murals in Los Angeles breathe life into rapper's legacy


--- layout: single title: Contact permalink: /contact ---
If you have any general questions, comments, or suggestions, please feel free to get in touch with us as we would love to hear from you!


Blogging
Building my own site has been very rewarding. I have built sites in the past and actually building a website was what initially got me into being more interesting in programming. I did more work in the past with frameworks such as wordpress, tweaking those templates and playing around with that. But doing it from scratch not only gives you a lot of opportunities for creativity, but also great experiences for learning new skills.
I have to say that hard coding html, especially blog posts can be a bit of a pain. I am looking forward to in the future using different kinds of frameworks and template engines to make things better and easier to use. Actually building a blog app that other people can use is one of the projects I want to accomplish while at Dev Bootcamp.


You can obtain the source code for the programs presented in this book from O'Reilly & Associates through their Internet server. The example programs in this book are available electronically in a number of ways: by FTP, Ftpmail, BITFTP, and UUCP. The cheapest, fastest, and easiest ways are listed first. If you read from the top down, the first one that works for you is probably the best. Use FTP if you are directly on the Internet. Use Ftpmail if you are not on the Internet, but can send and receive electronic mail to Internet sites (this includes CompuServe users). Use BITFTP if you can send electronic mail via BITNET. Use UUCP if none of the above works.
To use FTP, you need a machine with direct access to the Internet. A sample session is shown, with what you should type in boldface.
$ftp ftp.oreilly.com
Connected to ftp.oreilly.com. 220 FTP server (Version 6.21 Tue Mar 10 22:09:55 EST 1992) ready. Name (ftp.oreilly.com:yourname):anonymous
331 Guest login ok, send domain style e-mail address as password<EMAIL_ADDRESS>(Use your user name and host here) 230 Guest login ok, access restrictions apply. ftp>cd /published/oreilly/nutshell/sedawk_2
250 CWD command successful. ftp>binary
(Very important! You must specify binary transfer for compressed files.) 200 Type set to I. ftp>get progs.tar.gz
200 PORT command successful. 150 Opening BINARY mode data connection for progs.tar.gz. 226 Transfer complete. ftp>quit
221 Goodbye.
The file is a gzip compressed tar archive; extract the files from the archive by typing:
$gzcat progs.tar.gz | tar xvf -
System V systems require the following tar command instead:
$gzcat progs.tar.gz | tar xof -
If gzcat is not available on your system, use separate gunzip and tar commands.
$gunzip progs.tar.gz
$tar xvf progs.tar
Ftpmail is a mail server available to anyone who can send electronic mail to and receive it from Internet sites. This includes any company or service provider that allows email connections to the Internet. Here's how you do it. You send mail to<EMAIL_ADDRESS>In the message body, give the FTP commands you want to run. The server will run anonymous FTP for you and mail the files back to you.  The following is a sample mail session that should get you the examples. This command sends you a listing of the files in the selected directory and the requested example files. The listing is useful if there's a later version of the examples you're interested in.
$mail<EMAIL_ADDRESS>Subject:reply-to
<EMAIL_ADDRESS>(Where you want files mailed) open cd /published/oreilly/nutshell/sedawk_2 dir mode binary uuencode get progs.tar.gz quit .
A signature at the end of the message is acceptable as long as it appears after "quit."
BITFTP is a mail server for BITNET users. You send it electronic mail
messages requesting files, and it sends you back the files by electronic mail.
BITFTP currently
serves only users who send it mail from nodes that are directly on
BITNET, EARN, or NetNorth. To use BITFTP, send mail containing your
ftp commands to BITFTP@PUCC. For a complete help file, send
HELP
as the message body. The following is the
message body you send to BITFTP:
FTP ftp.oreilly.com NETDATA USER anonymous PASS<EMAIL_ADDRESS>Put your Internet email address here (not your BITNET address) CD /published/oreilly/nutshell/sedawk_2 DIR BINARY GET progs.tar.gz QUIT
Once you've got the desired file, follow the directions under FTP to extract the files from the archive. Since you are probably not on a UNIX system, you may need to get versions of uudecode, gunzip, atob, and tar for your system. VMS, DOS, and Mac versions are available.
UUCP is standard on virtually all UNIX systems and is available for IBM-compatible PCs and Apple Macintoshes. The examples are available by UUCP via modem from UUNET; UUNET's connect-time charges apply. If you or your company has an account with UUNET, you have a system somewhere with a direct UUCP connection to UUNET. Find that system, and type:
uucp uunet\!~/published/oreilly/nutshell/sedawk_2/progs.tar.gz yourhost\!~/yourname/
The backslashes can be omitted if you use a Bourne-style shell (sh, ksh, bash, zsh, pdksh) instead of csh or tcsh. The file should appear some time later (up to a day or more) in the directory /usr/spool/uucppublic/yourname. If you don't have an account, but would like one so that you can get electronic mail, contact UUNET at<PHONE_NUMBER>. It's a good idea to get the file /published/oreilly/ls-lR.Z as a short test file containing the filenames and sizes of all the files available. Once you've got the desired file, follow the directions under FTP to extract the files from the archive.


Hawaiian (SIL) is a Unicode keyboard with compatible fonts, included with permission from Hale Kuamo'o.
HI Kakuhihewa Unicode, HI Keawe Unicode, HI Manokalanipo Unicode and HI Pi'ilani Unicode fonts have been installed with this keyboard package and are recommended for use with Hawaiian.
These fonts are all Copyright © 2002 Hale Kuamo'o and are distributed with this keyboard with permission from Hale Kuamo'o.
| Key | Output |
|---|---|
| RightAlt+a | ā |
| RightAlt+e | ē |
| RightAlt+i | ī |
| RightAlt+o | ō |
| RightAlt+u | ū |
| RightAlt+' | ʻ |
You can access the capital letter versions of these vowels with Caps Lock or Shift.
This package does not include fonts for the Hawaiian ANSI keyboard ("HI Fonts"). ANSI fonts can be downloaded from http://www.olelo.hawaii.edu/
© 2008-2020 SIL International


Let's Play Battleship!
Mission Brief: Sink the enemy in as few guesses as possible.
Click anywhere onscreen to play.


"x" "1" "WEYAND,EH, GEDDIE,N, RICE,JE, CZECH,A, AMIN,S AND LAVOIE,EJ,METABOLISM AND MUTAGENIC ACTIVITY OF BENZO[K]FLUORANTHENE AND 3-,8- AND9-FLUOROBENZO[K] FLUORANTHENE, CARCINOGENESIS 9(7):1277-1281, 1988"


Hello World!
event zeek_init() { print "Hello, World!"; }
Hello and goodbye!
event zeek_init() { print "Hello, World!"; } event zeek_done() { print "Goodbye, World!"; }


Overview
The purpose of this portfolio is to document my contributions to PalPay, a software engineering project under the module CS2103T - Software Engineering. PalPay is a personal finance management application. It is mostly written in Java and has roughly 15,000 Lines of Code (LoC). Being a Command Line Interface (CLI) application, it is controlled mainly through the Command Line in the app, while displaying output through a Graphical User Interface (GUI) written in JavaFX.
My main role within the team was to implement the Projection feature, which utilizes a machine learning algorithm to predict the user’s account balance and budget statuses at a specified point of time in the future. I was also in charge of implementing the Display feature, which further enhances the Projection feature by providing users with a graphical representation of their balance and budget states.
Summary of contributions
-
Code contributed: My contributions to PalPay can be viewed here - RepoSense
-
Major enhancement: Implemented the
Projection
feature, along with various functions associated with it.-
What it does:
-
Uses Gradient Descent to project the user’s account balance in the future
-
Allows users to predict whether they will meet their budget goals based on past income/outflow trends
-
-
Justification: While most finance tracking applications have relatively robust income/outflow tracking functions, few offer the ability to project future financial states - something which is sorely needed for effective financial planning
-
Highlights: By utilizing the Gradient Descent algorithm, the
Projection
feature is guaranteed to find the best-fit projection line graph based on past transactions, with an extremely minute error tolerance (= 1E-11). The feature also automatically adjusts all relevant projections whenever transactions or budgets are added, deleted or updated, offering considerable convenience to the user, who thus does not need to update them manually.
-
-
Minor enhancement: Developed the
display
feature, which offers an elegant, graphical representation of the user’s projections. -
Other contributions:
-
Project management:
-
Enhancements to existing features:
-
Refactor
AddressBook
intoBankAccount
andAddCommand
intoInCommand
, such that PalPay had its first entry point. (Pull requests: #27) -
Refactor various JSON-adapted files and enabled PalPay’s
Storage
functionality. (Pull request: #27) -
Extended Java’s in-build Date class to support parsing and comprehensive checking, which currently supports all commands in PalPay (Pull request: #86)
-
-
Documentation:
-
Wrote comprehensive documentation for the following commands in both the User Guide and the Developer Guide:
-
project
-
display
-
-
Created UML diagrams to help in the explanation of the
project
anddisplay
commands in the Developer Guide.
-
-
Community:
-
Reported bugs and suggestions for other teams in the module. (Examples: W13-4 #147, W13-4 #148, W13-4 #149, )
-
-
Contributions to the User Guide
Given below are sections I contributed to the User Guide. They showcase my ability to write comprehensive and concise documentation for non-technical users. |
Projecting Future Balance and Budgets : project
Cast a projection on your future balance amount and budget statuses based on your transaction history.
Format: project d/DATE [c/CATEGORY]
|
Note
|
If a CATEGORY is not specified, it will be set as GENERAL by default. GENERAL projections project
upon ALL transactions, regardless of their categories.
|
Example Usage
-
project d/22072020
Projected balance: $955.80
-
project d/01012020 c/Food
Projected balance: $188.04 You are on track to meeting your budget of $600 by 08122019, with a surplus of $484.32!
Usage Constraints
Command Format
-
CATEGORY
must be preceded by its tagc/
. A violation of any of the above will produce the following error message:
Date Values
-
DATE
input must be set in the future. A violation of this constraint will produce the following error message:
-
DATE
cannot be more than 720 days from the day of projection.
A violation of this constraint will produce the following error message:
Minimum Number of Transactions
-
There must be a minimum of 5 transactions in total, or in the specified
CATEGORY
for a projection to be successfully cast. Should the requirement above be unmet, the following error message will be produced:
-
Should the number of transactions in a
projection
fall below 5, it will be automatically deleted, as shown below:-
Suppose there are 5 transactions, and a
GENERAL
projection, which projects upon them.Figure 1. Five transactions under the projection tabFigure 2. A projection which is cast based on the 5 transactions above -
If a transaction being deleted causes the number of transactions being projected upon to fall below 5, the corresponding projection will automatically be deleted.
Figure 3. The fifth transaction has been deleted.Figure 4. The project earlier seen in Figure 19 has been automatically deleted.
-
Valid Budget Start Dates and Deadlines
A projection will only project upon budgets with deadlines set before or equal to the projection DATE
. An example
is depicted below:
-
Suppose there is currently a general Budget with a deadline set for 28th November 2019
Figure 5. Two Budgets with dates 20112019 and 28112019 in the "GENERAL" category -
If a general Projection is cast to 20th November 2019, it will contain the Budget with deadline 20112019 but not 28112019, since the projection’s
DATE
is earlier than 28112019.Figure 6. The Projection only contains the Budget with deadline 20112019
Backward Projections
While it is possible in PalPay, projecting your balance amount backwards in time is not guaranteed to produce sensible results. It is generally not advisable to do so.
Display a Projection Graph: display
Display a graphical representation of a Projection in a new window.
Format: display PROJECTION_ID
Example Usage
-
Type display PROJECTION_ID into the command box and press Enter. For instance:
-
A new window containing a graphical representation of the specified projection will pop up.
If there are any budgets associated with the projection, a corresponding graphical representation of the budget will be additionally displayed.
Interpreting the Projection graph
-
The X-Axis
The X-Axis denotes your balance in dollars ($). -
The Y-Axis
The Y-Axis denotes the number of days from now, with today being Y = 0. -
Red Points
The red points on the graph each represent your account balance (denoted by the X-value) at a particular point of time (denoted by the Y-value). -
Blue Line Graph
The blue line graph represents the projection line, with each point along it representing a prediction of your account balance (denoted by the X-value) at a certain point of time (denoted by the Y-value). -
All Other Coloured Line Graphs
All other coloured line graphs represent various budgets which fall within theCATEGORY
andDATE
range of thePROJECTION
. Each of these line graphs have three parts:
Usage Constraints
Valid Projection Index
-
A
Projection
withPROJECTION_ID
must exist. Attempting to display a non-existentPROJECTION
will result in the following error message:
Static Graph Rendering
-
Projection
graphs do not update automatically when a newTransaction
orBudget
is added or removed. Instead, they are statically rendered upon thedisplay
command.NoteDue to the static nature of projection graphs, commands should NOT be executed while a projection graph is open, lest the behaviour of PalPay become unpredictable.
Consequently, adisplay
command should ALWAYS be followed by closing the projection graph window, before any other actions are performed within PalPay.
Contributions to the Developer Guide
_Given below are sections I contributed to the Developer Guide. They showcase my ability design and implement complex features through code, as well as my technical competencies in Java. |
Project Feature: project
This feature allows users to project their balance amount and budget statuses based on past income and outflows as manifest in their
TransactionHistory by using the command project DATE [CATEGORY]
.
Current Implementation
The project
command is facilitated by the Logic and Model components of the application, PalPay.
The sequence diagram below demonstrates how the project DATE [CATEGORY]
command is handled by the application.
If a CATEGORY
is not specified by the user, it will be set as GENERAL
by default.
Projection by Date
When projecting by date alone, all transactions in the user's transaction list will be taken into account,
regardless of their categories. On the other hand, only budgets without categories (thus belonging to the
GENERAL
category by default) will be projected upon.
Projection by Date and Category
When projecting by date and category, all transactions tagged by the specified category will be taken into account. Similarly, all budgets tagged with the specified category will be projected upon.
Budget Projections
Projections on budgets are made by first projecting the user's balance amount at the point when the budget was set. Then, it compares the user's projected balance amount at the point of the budget’s deadline, with the budget’s amount. A surplus is indicated when the former is greater than the latter, and a deficit is indicated when the former is smaller than the latter. ===== Activity Diagram
The activity diagram below depicts how a projection is made.
Graphical Representation
A graphical representation of the user's projections may be rendered using the display
command.
Future Enhancements
Polynomial Regression
For simplicity of logic and design, the current implementation performs linear regression (via gradient descent),
projecting user balance and budget states using a best-fit straight line. Ultimately, income and spending trends
may not be best represented by a straight line, but rather by a polynomial equation. In future updates, the projection
feature will choose a value, n, and perform a n-th degree polynomial regression, such that the user’s balance
and budget states can be more accurately projected.
|
Note
|
Currently, the GradientDescent class implements feature scaling and mean normalisation. Although this is not entirely necessary for the current implementation (which uses linear regression), it is meant for optimizing polynomial regression in future updates. |
Normal Equation
Currently, the gradient descent algorithm is used to plot the projection graph, which is used for predicting the user's balance and budget states at specified point in time. For smaller data sets, analytically computing the normal equation to find the best-fit line graph may have result in a faster runtime. In future updates, the normal equation method will be used in place of the gradient descent algorithm, for projections with less than a set number (e.g. 500) of transactions.
Design Considerations
Display Feature: display
This feature provides a graphical view of an existing projection to the user.
Current Implementation
The following activity diagram depicts how the display
command is executed.
For a more concrete illustration of how the display
command is handled by PalPay,
a sequence diagram is provided below.


Before Change
zipsafe_target_tmpl = "python_binary(sources=["main.py"], zip_safe={})"
with self.caching_config() as config, self.mock_buildroot() as buildroot, buildroot.pushd():
build = functools.partial(
self.run_pants_with_workdir,
command=["binary", test_project],
workdir=os.path.join(buildroot.new_buildroot, ".pants.d"),
config=config,
build_root=buildroot.new_buildroot,
)
buildroot.write_file(test_src, "")
// Create a pex from a simple python_binary target and assert it has zip_safe=True (default).
After Change
self.assert_pex_attribute(test_pex, "zip_safe", True)
// Simulate a user edit by adding zip_safe=False to the target and check the resulting pex.
with self.temporary_file_content(
test_build, zipsafe_target_tmpl.format("False").encode()
):
self.assert_success(build())
self.assert_pex_attribute(test_pex, "zip_safe", False)
// Simulate a user edit by adding zip_safe=True to the target and check the resulting pex.
with self.temporary_file_content(
test_build, zipsafe_target_tmpl.format("True").encode()
):
self.assert_success(build())


Fate/Zero servant audience poll for fans of the anime Name: Email: Rate Gilgamesh on a scale of 1-10 Who is your favorite servant from fate/zero? Archer Saber Lancer Caster Berserker Assassin Rider Do you like kiritsugu? Yes No What of kotomine? Like him?? Yes No Which of these had a valid reason for seeking the grail? Kotomine kiritsugu waver velvet Ryunosuke Uryu kayneth archibald tokiomi tohsaka Kariya Matou 😒 😕 🙁 🤨 😐 🙂 😀 😍 🥵 🔥 Submit


We are a non-profit helping promote animal adoption by working with local rescues. Save a life, adopt today.
Goldador
Male 2 months
Basset Hound
Male 11 months
Female 3 months
Interested in adoption? For more information please click here.


An Austrian composer of the Classical period, Wolfgang Amadeus Mozart is widely recognized as one of the greatest composers of Western music. He is the only composer to write and excel in all of the musical genres of his time. Rumored to have had the ability to play music at age three and to write music at age five, Mozart began his career as a child prodigy. Notable compositions include The Marriage of Figaro, Elvira Madigan, and Clarinet Quintet in A Major, K 581. Source


lseek
OS/161 Reference Manual
Name
lseek - change current position in file
Library
Standard C Library (libc, -lc)
Synopsis
#include <unistd.h>
off_t
lseek(int fd, off_t pos, int whence);
Description
lseek alters the current seek position of the file handle
filehandle, seeking to a new position based on pos
and whence.
If whence is
- SEEK_SET, the new position is pos.
- SEEK_CUR, the new position is the current position plus pos.
- SEEK_END, the new position is the position of end-of-file
plus pos.
- anything else, lseek fails.
Note that pos is a signed quantity.
It is not meaningful to seek on certain objects (such as the console
device). All seeks on these objects fail.
Seek positions less than zero are invalid. Seek positions beyond EOF
are legal.
Note that each distinct open of a file should have an independent seek
pointer.
Return Values
On success, lseek returns the new position. On error, -1 is returned,
and errno is set according to the error
encountered.
Errors
The following error codes should be returned under the conditions
given. Other error codes may be returned for other errors not
mentioned here.
| | |
| EBADF | fd is not a valid file handle. |
| ESPIPE | fd refers to an object which does
not support seeking. |
| EINVAL | whence is invalid. |
| EINVAL | The resulting seek position would be negative. |


DISCOVER
JORDAN
HOME
BOOKING
LOCATIONS
CONTACT US
Your Perfect Tour in Jordan Starts Here!
Click Me!


SVG Templates
Update the dimensions of these SVG images with the slider
Drag slider to update SVG size
These rectangles are SVG images rendered by a Truck view with data.


Graceful Matrix
问题描述 :
In Matrix Science, Unit Matrix (UM) is a matrix in which the elements on diagonal are all 1, while others are all 0.
Based on Unit Matrix, we define Basic Matrix and Graceful Matrix:
Based on Unit Matrix, we define Basic Matrix and Graceful Matrix:
1.Basic Matrix (BM), BM_i means swap the i-th rows and (i+1)-th rows in the Unit Matrix. (0 based)
2.Graceful Matrix (GM), means in every rows and every columns, there is one and only one 1, while others are all 0.
Now we also have a graceful problem, given a GM whose size is N, you need find a BM sequence. At first, the matrix is a UM, by multiplying the matrix one by one in the BM’s sequence order we can get the GM finally. You needn’t find the shortest sequence, but the sequence’s length can’t exceed the number of elements in GM.
输入:
The first line contains a single integer T, indicating the number of test cases.
Each test case begins with an integer N, indicating the GM’s size.
Then N lines follow, each line contains N integers, 1 or 0, indicating the GM.
You can assume the input Matrix is always graceful.
Each test case begins with an integer N, indicating the GM’s size.
Then N lines follow, each line contains N integers, 1 or 0, indicating the GM.
You can assume the input Matrix is always graceful.
Technical Specification
1. 1 <= T <= 50
2. 2 <= N <= 1000
输出:
The first line contains a single integer T, indicating the number of test cases.
Each test case begins with an integer N, indicating the GM’s size.
Then N lines follow, each line contains N integers, 1 or 0, indicating the GM.
You can assume the input Matrix is always graceful.
Each test case begins with an integer N, indicating the GM’s size.
Then N lines follow, each line contains N integers, 1 or 0, indicating the GM.
You can assume the input Matrix is always graceful.
Technical Specification
1. 1 <= T <= 50
2. 2 <= N <= 1000
样例输入:
3 2 1 0 0 1 2 0 1 1 0 4 0 1 0 0 1 0 0 0 0 0 0 1 0 0 1 0
样例输出:
Case 1: 0 Case 2: 1 0 Case 3: 2 0 2
#include<iostream> #include<vector> #include<cstdio> using namespace std; int a[1002], b; vector <int> ans; int main() { int test; scanf("%d", &test); for (int cas=1; cas<=test; cas++) { ans.clear(); int n; scanf("%d", &n); for (int i=0; i<n; i++) { for (int j=0; j<n; j++) { scanf("%d", &b); if (b==1) a[i]=j; } } for (int i=0; i<n; i++) { for (int j=i+1; j<n; j++) { if (a[j]==i) { for (int k=j-1; k>=i; k--) a[k+1]=a[k], ans.push_back(k); break; } } a[i]=i; // for (int j=0; j<n; j++) // printf("%d ", a[j]); // putchar(10); } printf("Case %d: %d\n", cas, (int)ans.size()); for (int i=0; i<ans.size(); i++) if (i==ans.size()-1) printf("%d", ans[i]); else printf("%d ", ans[i]); putchar(10); } return 0; }
(adsbygoogle = window.adsbygoogle || []).push({});
当年叫手贱，现在这叫真爱
当年叫手贱，现在这叫真爱
当年叫手贱，现在这叫真爱
当年叫手贱，现在这叫真爱
当年叫手贱，现在这叫真爱
当年叫手贱，现在这叫真爱
当年叫手贱，现在这叫真爱
当年叫手贱，现在这叫真爱
当年叫手贱，现在这叫真爱
当年叫手贱，现在这叫真爱
当年叫手贱，现在这叫真爱
我还有个问题想请教一下，就是感觉对于新手来说，递归理解起来有些困难，不知有没有什么好的方法或者什么好的建议？
秒！~
看似简单，还是不少坑的
为什么暴力求解方法循环到sqrt(n) 就可以了呢
很好的思路，可以借鉴
位运算真赞
这个也是算法导论的习题
使用ListNodeWrapper很蹩脚的感觉，没有更好的解决办法？
学习了
不考虑最后将结果排序的话，快排的时间复杂度是O(N) ，而堆排的是O(N*logK)
很全很强大！
代码可真够长的！
信息不全
很好的题，还是能做出几道的，嘿嘿


England
|
|
| Enclosed By |
|
|
| Place Encloses |
References
-
Forsyth, Alexander
(0000-00-00)
-
???, Margaret
(0000-00-00)
-
Family of Forsyth, Alexander and ???, Margaret
-
???, Margaret
-
Forsyth, Alexander
-
Harris, Sarah Ann
(1826-05-08)
-
Hayne, Philip Vaughan
(1835-01-01)
-
Ham, James
(1837-12-00)
-
Ransom, Emma
(1838-06-03)
-
Whiterod, Maria
(1856-12-25)
-
Family of Copeman, James and Whiterod, Maria
-
Copeman, James
-
Whiterod, Maria
-
Copeman, James
(1856-12-25)
-
Ransom, Emma
(1861-12-25)
-
Family of Ham, James and Ransom, Emma
-
Ransom, Emma
-
Ham, James
-
Ham, James
(1861-12-25)
-
Cambourn, Thomas Edward
(1864-12-21)
-
Crewe, Emily Jane
(1867-06-23)
-
Lock, Nicholas Parsons
(1871)
-
Collins, Frances
(1871)
-
Family of Lock, Nicholas Parsons and Collins, Frances
-
Lock, Nicholas Parsons
-
Collins, Frances
-
Orton, Henry
(1873-06-16)
-
Family of Lock, Nicholas Parsons and Miller, Mary
-
Lock, Nicholas Parsons
-
Miller, Mary
-
Lock, Nicholas Parsons
(1877)
-
Miller, Mary
(1877)
-
Orton, Samuel Jnr.
(1878-08-17)
-
Macarthur, George Hannibal Charles
(1900-09-08)
-
Maddocks, Eva Ellen
(1911-11-07)
-
Colbeck, Norman
(1985-04-01)
-
Willock, Dorothy Louise
(1987)
-
Callan, Annie Ruth
(c1860)
-
Cambourn, Albert John
(c1874)
-
Cambourn, James
(c1869)
-
Forsyth, Alexander Chisholm
(c1856)
-
Cambourn, John
(c1874)
-
Hutton, William
(about 1847)
-
Gazzard, Edward John
(about 1856)


<< Previous Session
|
Next Session >>
Assessment - Lecture Quiz
Lecture 4: Portfolio Diversification and Supportin
1
.
Reconsider the example from class, in which an investor borrows at the risk-free rate to invest in VOC. Assume that the risk-free rate is 5%, and that VOC has 20% expected return and 40% return standard deviation. How much leverage would an investor have to choose in order to attain 27.5% expected return and 60% return standard deviation?
Points = 2.0
2-for-1 leverage.
3-for-1 leverage.
1.5-for-1 leverage.
2.5-for-1 leverage.
2
.
Consider the Efficient Portfolio Frontier that arises for a given set of risky assets, and suppose that all portfolios on this frontier have strictly positive return standard deviation. Moreover, assume that there is a given risk-free rate. What is the Tangency Portfolio?
Points = 2.0
The Tangency Portfolio is exactly equal to the risk-free asset.
The Tangency Portfolio is the portfolio on the Efficient Portfolio Frontier that has the minimum standard deviation.
The Tangency Portfolio is the asset out of the original set of risky assets that has the highest expected return.
Out of all straight lines that connect the riskless asset with any portfolio along the Efficient Portfolio Frontier, the line that runs through the Tangency Portfolio has the highest expected return for a given level of standard deviation.
3
.
Within the framework of the Capital Asset Pricing Model, consider stocks A and B. Asset A's β is strictly bigger than asset B's β. Moreover, the expected market return exceeds the risk-free rate. Which of the two assets has a higher expected return?
Points = 2.0
The expected return for both assets is the same.
Asset A.
Asset B.
More information is needed to answer this question.
4
.
Consider an Efficient Portfolio Frontier that arises for a given set of risky assets, and assume that there is a given risk-free rate. How does the Sharpe-ratio change along the tangency line?
Points = 2.0
The Sharpe-ratio does not change along the tangency line, but is constant.
The Sharpe-ratio increases for higher expected returns.
The Sharpe-ratio decreases for higher expected returns.
The Sharpe-ratio is between 0 and 1 for the section of the tangency line between the risk-free asset and the tangency portfolio, and is strictly bigger than 1 beyond the tangency portfolio.
5
.
What ban has been introduced on the Amsterdam Stock Exchange from 1609 until 1611, and whose actions are considered responsible for this ban?
Points = 2.0
John Lintner traded too many shares on one day at the Amsterdam Stock Exchange, leading to a ban on big-sized trades (buying or selling more than 1000 shares a day).
Harry Markowitz purchased all shares of VOC, and was planning to shut down the company, leading to a ban for majority ownership (>50% of the shares) for any company on the Amsterdam Stock Exchange.
Isaac La Maire built massive short-interest in VOC, forcing down its price, which led to a ban of short-selling on the Amsterdam Stock Exchange from 1609 until 1611.
The Pope banned any trading on the Amsterdam Stock Exchange from 1609 until 1611, because he ruled that trading of stocks was un-Christian.
Status
Submit
Close


Nancy Pelosi: Trump's actions make Watergate cover-up look 'almost small' – video
by ReutersNancy Pelosi has said the alleged actions of Donald Trump in the Ukraine controversy are more alarming than those of president Richard Nixon, who resigned over the Watergate scandal. 'The cover-up makes what Nixon did look almost small,' the House speaker said of the president's actions. Nixon attempted to cover up the fact that five men connected to his re-election campaign broke into the headquarters of the Democratic National Committee


Block-level elements form a visible block on a page —
they will appear on a new line from whatever content went before it, and any content that goes after it will also appear on a new line.
Block-level elements tend to be structural elements on the page that represent, for example, paragraphs, lists, navigation menus, footers, etc.
A block-level element wouldn't be nested inside an inline element, but it might be nested inside another block-level element.
Inline elements are those that are contained within block-level elements and surround


Global Weather App
Enter Desired City:
Clear All Entries
Temperature:
Humidity:
Wind Speed:
UV index:
5 Day Future Forecast:
Temp:
Humidity:
Temp:
Humidity:
Temp:
Humidity:
Temp:
Humidity:
Temp:
Humidity:


Apportionment Simulator
Upload Custom Template
Export to Template
Clear
Number of Seats:
Number of Seats each District starts with
Apportion
Add New District
Load Data from Templates
2010 U.S. House of Representatives
2020 U.S. House of Representatives
World Populations


{% extends 'base.html' %} {% block title %}Register{% endblock title %} {% load staticfiles%} {% block content %}
You're already logged in. If you'd like, you can logout or head to your projects.
Your password should:


Press n or j to go to the next uncovered block, b, p or k for the previous block.
| File | Statements | Branches | Functions | Lines | |||||
|---|---|---|---|---|---|---|---|---|---|
| react-native-hash |
|
100% | 1/1 | 100% | 0/0 | 100% | 0/0 | 100% | 1/1 |
| react-native-hash/JSHash |
|
100% | 34/34 | 100% | 15/15 | 100% | 2/2 | 100% | 34/34 |
| react-native-hash/JSHash/lib |
|
96.37% | 558/579 | 100% | 62/62 | 82.35% | 28/34 | 96.38% | 532/552 |
| react-native-hash/JSHash/lib/core |
|
67.42% | 120/178 | 56.76% | 21/37 | 69.44% | 25/36 | 68.07% | 113/166 |
| react-native-hash/JSHash/lib/core/x64-core |
|
66.67% | 16/24 | 50% | 1/2 | 75% | 3/4 | 68.18% | 15/22 |
| react-native-hash/__tests__ |
|
100% | 14/14 | 100% | 0/0 | 100% | 0/0 | 100% | 14/14 |


Make good looking designs quickly. All without a single line of custom CSS.
Get the courseWe'll create BeginnerTailwind.com (it's the site you're on now)
We'll do it all without a single line of custom CSS!
Tailwind makes writing CSS easier and lets us customize our designs faster than any other CSS framework. If you want a CSS framework that has pre-built components, then Tailwind may not be for you. If you want a CSS framework that lets you design quickly and customize your site, then Tailwind is gonna be a lot of fun.
After using Bulma to build Scotch.io, my CSS files
became littered with my own important
classes to
override
the
framework's styles. Tailwind doesn't have the !important
problem
since all our elements are designed on the
fly.
Important Note: Tailwind lets us design quickly, but this doesn't mean
that you don't need CSS knowledge
however. To use
Tailwind, you need to have a good understanding of CSS properties. In this course, we will learn Tailwind
and we'll also
learn CSS conceptsto create good looking designs. Tailwind is the ultimate CSS
shorthand, but we still need
to learn the
CSS, which we'll do in this course.
" This isn't just a Tailwind course. This is also a "learn how to design with CSS" course.
The hardest things about learning Tailwind is memorizing the classes and also knowing which classes go well together. We'll be writing a lot of Tailwind in this course so that the repetition will help us commit Tailwind classes to memory.
Hey there! My name is Chris Sev and I founded a web dev tutorial site Scotch.io. We were able to grow to 4M monthly pageviews and $300,000 yearly revenue. Scotch.io was acquired by DigitalOcean in November 2019. Nowadays I'm in search of the best ways to develop and design a business. Hope you enjoy this course and my other one MakeReactApps.com.
I have a Getting started with Tailwind article on scotch.io and a 15 minute starter YouTube video.
I did a Build Your 1st Tailwind Site for Traversy Media on YouTube also.
We'll dive into the most important Tailwind classes and use them a TON. There are a lot of useful classes like spacing, backgrounds, borders, shadows, and typography. We'll type the Tailwind classes many times over to ensure that repeitition is our greatest learning tool.
There's a certain process to designing with Tailwind that we'll take to make our designs look good. Some easy to remember rules are all it takes to get a good design. We'll also talk about ideas and action items to take a good design and make it great.
To be completely honest, I didn't like Tailwind at first. It felt like inline styles to me (and maybe still does). After using it more and more though, I've come to absolutely love it. I dread jumping into a project without Tailwind now.
The site you're on (BeginnerTailwind.com) is built with Tailwind and has 0 custom css.
You can take all of the code from this site and use it for your own landing pages or sites! All the code is available to you with course purchase.
I struggle with making things look good and don't consider myself a designer. What I try to do is have a formula for making things look good. I focus on design in this order: spacing, box properties, typography, fun element to pop. We'll talk about this all throughout the course.
One of the first things we want to do when using Tailwind is to create components like cards, buttons, and forms. We'll build these out and see how Tailwind compares to CSS frameworks like Bootstrap.
We'll also build out navigation, hero, pricing, newsletter, and footer components in this course.
Tailwind comes with so many classes. It doesn't make sense to send all of those to our users' browsers. With PostCSS and PurgeCSS, we can shrink the amount of CSS we send to our users.
We'll learn how to only send the classes that we actually use so that our bundle sizes can drop to even below 10kb!
Tailwind's benefits really shine when you pair it with a JavaScript library/framework. Extracting classes into components is the recommended way to keep Tailwind DRY (don't repeat yourself).
While we could use the @apply() or theme() functions, it forgoes some of the benefits of Tailwind. Namely we are once again creating a custom class and CSS.
Tailwind is easily configurable for our own projects using the tailwind.js config file. We'll explore changing out fonts, colors, sizes, and more so that our Tailwind setups are custom and tailored to our projects.
VS Code is my favorite editor and Tailwind works fantastically in it. There are some essential plugins and setup for using Tailwind in VS Code. We'll go over each and use VS Code heavily in this course.
Learning Tailwind is just the beginning. There are some great tools like Tailwind Typography, Tailwind UI, Tailwind Builder, and more. We'll talk about some ways to extend Tailwind and ways we can go further.
These components are things you'll have to create in every project.
75 videos at a smooth pace
9.25 hours of learning + building
Source code and CodePens
Use the code for your projects
Access to Discord for support
Lifetime refund guarantee
9.25 hours of Tailwind learning in 19 modules/75 videos.
This course is aimed at people that have some CSS knowledge and want to learn Tailwind. I do talk through CSS concepts and why we're using certain classes all throughout the course so you don't need to be a CSS expert.
You can email me directly at any time and we also have a Discord community where you gain exclusive channel access.
Definitely! All of the code in this course is yours to use in your sites, apps, projects, whatever.
I offer a lifetime refund policy. If you ever feel like you didn't gain value from this course, then you can request a refund from your course dashboard (totally automated process, no questions asked).
You can login at learn.better.dev. Use the login button in the top right.
Yup! 50% off! Email me at<EMAIL_ADDRESS>with your student id and I'll send you a discount code.
Yup! Email me at<EMAIL_ADDRESS>and I'll send you a purchase power parity code.
Yup! You get 50% of every sale that you bring in. You can sign up for a course and turn on affiliate mode from your dashboard at learn.better.dev. Or you can email me at<EMAIL_ADDRESS>Drop me an email at<EMAIL_ADDRESS>Let's chat.


{% extends 'swiftseqweb/base.html' %} {% load staticfiles %} {% block extra_js %} {% endblock extra_js %} {% block content %} {% if nodata %} No Data Received Uh-oh. Looks like something got disconnected. This most likely occurred because you came directly to this page without going through step 1 to generate a workflow. Try starting from the beginning by clicking Generate Workflow in the top right. {% else %} Generate Workflow Develop your workflow, then drop in place. Done. Questions and Answers {% for question_set in question_sets %} {{ question_set.question.name }} {{ question_set.answer.name }} {% endfor %} {% csrf_token %} Available Options: {% for step in steps %} {{ step.name }} {% if step.required %}{% endif %} {% endfor %} {% for step in steps %} {{ step.name }} {% if step.multiple_programs %} Add Program {% endif %} {% endfor %} Filename for download: Download Workflow {% for question_set in question_sets %} {% endfor %} {% endif %} {% endblock content %}
This most likely occurred because you came directly to this page without going through step 1 to generate a workflow. Try starting from the beginning by clicking Generate Workflow in the top right.


Otoroshi
Otoroshi is a layer of lightweight api management on top of a modern http reverse proxy written in Scala and developped by the MAIF OSS team that can handle all the calls to and between your microservices without service locator and let you change configuration dynamicaly at runtime.
The Otoroshi is a large hairy monster that tends to lurk on the top of the torii gate in front of Shinto shrines. It’s a hostile creature, but also said to be the guardian of the shrine and is said to leap down from the top of the gate to devour those who approach the shrine for only self-serving purposes.
Installation
You can download the latest build of Otoroshi as a fat jar, as a zip package or as a docker image.
You can install and run Otoroshi with this little bash snippet
curl -L -o otoroshi.jar 'https://github.com/MAIF/otoroshi/releases/download/v16.8.0-dev/otoroshi.jar'
java -jar otoroshi.jar
or using docker
docker run -p "8080:8080" maif/otoroshi:16.8.0-dev
now open your browser to http://otoroshi.oto.tools:8080/, log in with the credential generated in the logs and explore by yourself, if you want better instructions, just go to the Quick Start or directly to the installation instructions
Documentation
- About Otoroshi
- Architecture
- Features
- Getting started
- Install Otoroshi
- Main entities
- Detailed topics
- How to’s
- Plugins
- Admin REST API
- Deploy to production
- Developing Otoroshi
Discussion
Join the Otoroshi server Discord
Sources
The sources of Otoroshi are available on Github.
Logo
You can find the official Otoroshi logo on GitHub. The Otoroshi logo has been created by François Galioto (@fgalioto)
Changelog
Every release, along with the migration instructions, is documented on the Github Releases page. A condensed version of the changelog is available on github
Patrons
The work on Otoroshi was funded by MAIF with the help of the community.
Licence
Otoroshi is Open Source and available under the Apache 2 License


Coming Soon
This page is currently under development!
- Developer Ryan
GO BACK
YouTube
Twitter
Instagram


| Team | Parks on Bridge? | Detects IR? | Places Blocks? | Can Hang? | Raises Flag? |
|---|
| Team | Parks on Bridge? | Detects IR? | Places Blocks? | Can Hang? | Raises Flag? |
|---|
| Team | Parks on Bridge? | Detects IR? | Places Blocks? | Can Hang? | Raises Flag? |
|---|
| Team | Parks on Bridge? | Detects IR? | Places Blocks? | Can Hang? | Raises Flag? |
|---|


Jess Malesh
Biography
Jess is from Chicago, Illinois. They briefly lived in Pittsburgh, Pennsylvania before settling down in Seattle
The different places Jess lived are tattoo on their body!
Experience
- Codefellows 201
- Code Academy
- Treehouse Academy
Goals
- To learn how to write clean code
- To make an organizational app for non-traditional families
- To make some money


RUN-WITH-ASPELL(1) Aspell Abbreviated User's Manual RUN-WITH-ASPELL(1) NAME run-with-aspell - script to help use GNU Aspell as an ispell replacement SYNOPSIS run-with-aspell <command> DESCRIPTION The recommended way to use Aspell as a replacement for Ispell is to change the Ispell command from within the program being used. If that is not possible, the run-with-aspell script may be used instead. OPTIONS <command> is the name of the program with any optional arguments. The old method of mapping ispell to Aspell is discouraged because it can create compatibility problems with programs that actually require ispell such as ispell's own scripts. SEE ALSO aspell(1), aspell-import(1), word-list-compress(1) Aspell is fully documented in its Texinfo manual. See the `aspell' entry in info for more complete documentation. AUTHOR This manual page was written by Sudhakar Chandrasekharan <thaths@net‐ scape.com> and Brian Nelson<EMAIL_ADDRESS>GNU 2004-03-03 RUN-WITH-ASPELL(1)


HTML
Javascript
(external ,
inline )
CSS
(external ,
inline )
JSON
(external ,
inline )
Others
(external ,
inline )
Tips
- Shows current sources in the DOM.
- "INJECTED" nodes have been injected to DOM by Javascript after
initial page load.
- Press B to toggle beautifier.
- Press N to toggle line numbers.
- Adjust options of this extension.


Yes.
align
and cellpadding
| Monarch | Reign |
|---|---|
| William I | 1066-1087 |
| William II | 1087-1100 |
| Henry I | 1100-1135 |
| Stephen | 1135-1154 |
As with images, it is possible to position
a table to one side of page and have text
fill the remaining space.
Do this with the align="right"
Another useful attribute to include inside the table tag
is cellpadding="5"
Also, as with images, put space between the table and
the surrounding text using hspace="10"
vspace="10"
In the following table, experiment with different values for these attributes:


Class DataModifiedFilter
- java.lang.Object
-
- de.businesscode.bcdui.web.cacheControl.DataModifiedFilter
-
- All Implemented Interfaces:
javax.servlet.Filter
public class DataModifiedFilter extends java.lang.Object implements javax.servlet.Filter
Cache control based on requested binding set name and data from scope_last_modified If a request matches a certain scope, we check its last_refreshed and compare it against the request's If-Modified-Since-Header If possible according to that, we send a 304 instead of forwarding to get new data - If the scope was found in bcd_cache_scope, we are active, otherwise we do chain.doFilter - If If-Modified-Since was sent, we compare that with the scopes scope_last_modified - If If-Modified-Since was not sent or data was out-dated, we call chain.doFilter and set expires to earliest_next_modified if given See bcdui4.DataModifiedFilter in web.xml for how to use
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
DataModifiedFilter.ScopeInfo
Holds information about a scope like when data was actually refreshed last time and possibly when it may be refreshed earliest next time
-
Field Summary
Fields Modifier and Type Field Description protected long
lastRefreshedMs
protected org.apache.logging.log4j.Logger
logger
static int
REFRESH_PERIOD_DEFAULT
static java.lang.String
REFRESH_PERIOD_PARAM_NAME
protected long
refreshPeriodMs
protected java.util.Map<java.lang.String,DataModifiedFilter.ScopeInfo>
scopesLamos
protected static java.lang.String
selectSQL
protected java.util.Calendar
utcCal
-
Constructor Summary
Constructors Constructor Description DataModifiedFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
destroy()
protected boolean
didSend304(javax.servlet.ServletRequest req, javax.servlet.ServletResponse res)
Check whether we can send a 304 and do so of possible Will send "Last-Modified" header if the scope was found.void
doFilter(javax.servlet.ServletRequest req, javax.servlet.ServletResponse res, javax.servlet.FilterChain chain)
Handle the request brings 304 or operationprotected java.lang.String
getReqScope(javax.servlet.http.HttpServletRequest httpReq)
Derive the caching-scope from the request.protected java.lang.Long
getScopeLastModified(java.lang.String scope)
Check whether we have a a last-modified for the scope and return it.protected java.lang.String
getSelectSql()
The query to get the scops' datavoid
init(javax.servlet.FilterConfig filterConfig)
protected boolean
refreshNeeded(java.lang.String scope)
Check whether we need to refresh the scope's data from bcd_cache_scope That is the case if refreshPeriodMs has passed since last update and earliestNextModified is not in the futureprotected void
refreshScopes()
Read all scopes' information fresh from bcd_cache_scope
-
-
-
Field Detail
-
REFRESH_PERIOD_PARAM_NAME
public static final java.lang.String REFRESH_PERIOD_PARAM_NAME
- See Also:
- Constant Field Values
-
REFRESH_PERIOD_DEFAULT
public static final int REFRESH_PERIOD_DEFAULT
- See Also:
- Constant Field Values
-
scopesLamos
protected java.util.Map<java.lang.String,DataModifiedFilter.ScopeInfo> scopesLamos
-
logger
protected org.apache.logging.log4j.Logger logger
-
lastRefreshedMs
protected long lastRefreshedMs
-
refreshPeriodMs
protected long refreshPeriodMs
-
utcCal
protected java.util.Calendar utcCal
-
selectSQL
protected static final java.lang.String selectSQL
- See Also:
- Constant Field Values
-
-
Method Detail
-
doFilter
public void doFilter(javax.servlet.ServletRequest req, javax.servlet.ServletResponse res, javax.servlet.FilterChain chain) throws java.io.IOException, javax.servlet.ServletException
Handle the request brings 304 or operation- Specified by:
doFilter
in interfacejavax.servlet.Filter
- Throws:
java.io.IOException
javax.servlet.ServletException
-
didSend304
protected boolean didSend304(javax.servlet.ServletRequest req, javax.servlet.ServletResponse res)
Check whether we can send a 304 and do so of possible Will send "Last-Modified" header if the scope was found. That triggers "If-Modified-Since" to be sent next time by the client- Parameters:
req
-res
-- Returns:
- false if 304 is not sufficient
-
getReqScope
protected java.lang.String getReqScope(javax.servlet.http.HttpServletRequest httpReq)
Derive the caching-scope from the request. In this case we just use the BindingSet as the scope- Parameters:
httpReq
-- Returns:
-
getScopeLastModified
protected java.lang.Long getScopeLastModified(java.lang.String scope)
Check whether we have a a last-modified for the scope and return it. Returns -1 if there was no entry found- Parameters:
scope
-- Returns:
-
refreshNeeded
protected boolean refreshNeeded(java.lang.String scope)
Check whether we need to refresh the scope's data from bcd_cache_scope That is the case if refreshPeriodMs has passed since last update and earliestNextModified is not in the future- Parameters:
scope
-- Returns:
-
refreshScopes
protected void refreshScopes()
Read all scopes' information fresh from bcd_cache_scope
-
getSelectSql
protected java.lang.String getSelectSql()
The query to get the scops' data- Returns:
-
init
public void init(javax.servlet.FilterConfig filterConfig) throws javax.servlet.ServletException
- Specified by:
init
in interfacejavax.servlet.Filter
- Throws:
javax.servlet.ServletException
-
destroy
public void destroy()
- Specified by:
destroy
in interfacejavax.servlet.Filter
-
-


Student's login
Home
Event registration
Notes
Bonafide
Welcome
Let's
changethe World ,create the World,program the World
Get Permission for Your Events
click here
Get Your study material here
Check out
Bonafide Request
clickhere


Konbaung era monastery in Aunglan under repair
by Thet Paing (Aunglan)
Local residents are repairing an over-100-year-old monastery of Konbaung Era design in Aunglan Township, Magway Region, without harming the original architecture.
The monastery, built under the reign of King Thibaw in Letplanhla Village, is being repaired under the permission of the Department of Archaeology and National Museums.
"It is said that the abbot of this monastery was a novitiate together with King Thibaw. The monastery was built by the carpenters sent by the king. It is over 100 years old. Some parts of the building are in a state of ruin. This is why locals collected money to repair the monastery. Permission was sought from the department of archaeology and was granted permission. But there are rules and disciplines as well as dos and don'ts in order not to harm the original style in repair work," said the current abbot.
The ancient monastery is built of teak. The top of the roofing is designed with floral arabesques. There are also ancient cultural inscriptions and statues in the monastery.
Related Articles


Gawain and the Green Knight (1973) 93m.
You'll have to be in the right mood to enjoy this simple mediaeval fantasy, or at least acknowledge that it subdues the cinematic visual stylings we might expect from knights-on-horseback adventures. Although the poem, 'Sir Gawain and the Green Knight', is one of the best known British mediaeval epics outside of Beowulf, its central character is less a household name than other Arthurian champions such as Lancelot, Galahad, and Bedevere. Personally, I find this down-scaled approach more suitable for Gawain's tale than the kind of treatment usually afforded the aggrandized romances of his better-known contemporaries. Gawain is an ordinary man, not some superhero - when he gets in a fight he gets beaten up quite a bit, and has to struggle for the upper hand. The film opens with the mysterious Knight (played, appropriately enough, by Nigel Green) appearing before Arthur's court in the New Year and demanding the head of Gawain (played, appropriately enough, by Murray Head) as the prize in a bizarre game. Given a year's grace, Gawain immediately sets off in search of the Knight for a rematch.
Bearing only a passing resemblance to the epic poem (which is more a test of Gawain's character), Stephen Weeks' film is an amalgam of two standard motifs, the Quest and Damsel-in-Distress. Its indecisive narrative may cause some viewers to give up before the story is half over, but in an odd way it adds to the atmosphere of the picture. It seems as if Gawain is getting nowhere on his journey - he is sidetracked constantly and has no clear idea of where he is heading. We can never be sure where he is or where different places are in relation to each other. Characters keep dropping out of the story and then returning, further suggesting that Gawain is making little progress. The course of the journey is plotted chronologically (the passing of the seasons), not geographically. The inconclusive musical score sounds like it was recorded without any visual cues from the film and dropped in just anywhere. All of these things make Gawain's experiences seem like a dream, but his final revelation shows us that his journey was never intended to take place on land, but instead through time. The passage of his maturation over one year gives added significance to the colour green (not only marking the order of the natural world, but also his inexperience and youth) that appears throughout the story at crucial points to guide him onwards - note that director Weeks is otherwise careful to avoid using green in all sets, costumes, backdrops and props.
Weeks' own disastrous 1982 remake, SWORD OF THE VALIANT, only makes this simple version look better by comparison. Since he didn't really stick to the specifics of the poem in the first place (with the exception of the opening scene), you have to wonder why he even tried a second time.
<EMAIL_ADDRESS>Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


Class ReviewDetailModel
This class represents a review within the application.
Inheritance
Inherited Members
Namespace: Vasont.Inspire.Models.Reviews
Assembly: Vasont.Inspire.Models.dll
Syntax
public class ReviewDetailModel
Properties
| Improve this Doc View SourceArchived
Gets or sets a value indicating whether the review is archived.
Declaration
public bool Archived { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
CompletedDate
Gets or sets the date and time that the review was completed.
Declaration
public DateTime? CompletedDate { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Nullable<System.DateTime> |
Components
Gets or sets the review components detail associated with the review.
Declaration
public List<ReviewComponentDetailModel> Components { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.List<ReviewComponentDetailModel> |
Coordinator
Gets or sets the review coordinator user information.
Declaration
public MinimalUserModel Coordinator { get; set; }
Property Value
| Type | Description |
|---|---|
| MinimalUserModel |
CreatedBy
Gets or sets the user information about the user who created the review.
Declaration
public MinimalUserModel CreatedBy { get; set; }
Property Value
| Type | Description |
|---|---|
| MinimalUserModel |
CreatedDate
Gets or sets the date and time when the review was created.
Declaration
public DateTime CreatedDate { get; set; }
Property Value
| Type | Description |
|---|---|
| System.DateTime |
Description
Gets or sets the review description.
Declaration
public string Description { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
DueDate
Gets or sets the data and time the review is due.
Declaration
public DateTime? DueDate { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Nullable<System.DateTime> |
HasWorkflow
Gets or sets a value indicating whether the review is related to workflow.
Declaration
public bool HasWorkflow { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Interactive
Gets or sets a value indicating whether the review is interactive.
Declaration
public bool Interactive { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Reviewers
Gets or sets the reviewers associated with the review.
Declaration
public List<ReviewerModel> Reviewers { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.List<ReviewerModel> |
ReviewerState
Gets or sets the reviewer state information if the current user is a reviewer for this review.
Declaration
public ReviewerStateType ReviewerState { get; set; }
Property Value
| Type | Description |
|---|---|
| ReviewerStateType |
ReviewId
Gets or sets the identity of the review.
Declaration
public long ReviewId { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int64 |
StartDate
Gets or sets the date time when the review should be started.
Declaration
public DateTime? StartDate { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Nullable<System.DateTime> |
State
Gets or sets the review state information.
Declaration
public ReviewStateType State { get; set; }
Property Value
| Type | Description |
|---|---|
| ReviewStateType |
Title
Gets or sets the review title.
Declaration
public string Title { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
UpdatedBy
Gets or sets the user information about the user who last updated the review.
Declaration
public MinimalUserModel UpdatedBy { get; set; }
Property Value
| Type | Description |
|---|---|
| MinimalUserModel |
UpdatedDate
Gets or sets the date and time when the review was last updated.
Declaration
public DateTime UpdatedDate { get; set; }
Property Value
| Type | Description |
|---|---|
| System.DateTime |


LRS Password Reset Confirmation
{% if validlink %}Please enter your new password twice so we can verify you typed it in correctly
{% else %}Password reset unsuccessful
The password reset link was invalid, possibly because it has already been used. Please request a new password reset link.
{% endif %}


Hi guys! Everyone from my family, friends and educators are welcome to my party and thank you for being part of my 18th year stay here on our beautiful Mother Earth.
-Party Celebrant
Hi guys! Everyone from my family, friends and educators are welcome to my party and thank you for being part of my 18th year stay here on our beautiful Mother Earth.
-Party Celebrant