Introduction
P4Lua, a Lua interface to the Perforce API, enables you to write Lua code that interacts with a Perforce server. P4Lua enables your Lua scripts to:
- Get Perforce data and forms in Lua tables
- Edit Perforce forms by modifying Lua tables
- Provide optional exception-based error handling and optionally ignore warnings
- Issue multiple commands on a single connection (performs better than spawning single commands and parsing the results)
System Requirements
P4Lua is supported on Windows.
To build P4Lua from source, your development machine must also have:
- Lua 5.1.4 development files
- The 2008.2 Perforce C/C++ API for your target platform
- The same C++ compiler used to build the Perforce C++ API on your target platform. (If you get “unresolved symbol” errors when building or running P4Lua, you probably used the wrong compiler or the wrong Perforce API build. )
Credits
The primary contents of this document come from Perforce 2008.2 APIs for Scripting.
Programming with P4Lua
P4Lua provides an object-oriented interface to Perforce that is intended to be intuitive for Lua programmers. Data is loaded and returned in Lua tables. Each P4 object represents a connection to the Perforce Server.
When instantiated, the P4 instance is set up with the default environment settings just as the command line client p4, that is, using environment variables, the registry on Windows and, if defined, the P4CONFIG
file. The settings can be checked and changed before the
connection to the server is established with the connect()
method. After your script connects, it can send multiple commands to the Perforce Server with the same P4 instance. After the script is finished, it should disconnect from the Server by calling the
disconnect()
method.
The following example illustrates the basic structure of a P4Lua script. The example establishes a connection, issues a command, and tests for errors resulting from the command.
require 'p4' -- Import the module p4 = P4.P4() -- Create the P4 instance p4.port = "1666" p4.user = "fred" p4.client = "fred-ws" -- Set some environment variables ret, err = pcall( function() -- Catch exceptions p4:connect() -- Connect to the Perforce Server info = p4:run("info") -- Run "p4 info" (returns a table) for key, value in pairs(info[1]) do -- and display all key-value pairs print(key .. '=' .. value) end p4:run("edit", "file.txt") -- Run "p4 edit file.txt" end) for _, e in ipairs(p4.errors) do -- Display errors print(e) end p4:disconnect() -- Disconnect from the Server
This example creates a client workspace from a template and syncs it:.
require 'p4' template = "my-client-template" client_root = "c:\\work\\my-root" p4 = P4.P4() pcall(function() p4:connect() -- Convert client spec into a Lua dictionary client = p4:fetch_client("-t", template) client._root = client_root p4:save_client(client) p4:run_sync() end)
Submitting a Changelist
This example creates a changelist, modifies it and then submits it:
require 'p4' p4 = P4.P4() p4:connect() change = p4:fetch_change() -- Files were opened elsewhere and we want to -- submit a subset that we already know about. myfiles = { '//depot/some/path/file1.c', '//depot/some/path/file1.h' } change._description = "My changelist\nSubmitted from P4Lua\n" change._files = myfiles -- This attribute takes a Lua list p4:run_submit(change)
Logging into Perforce using ticket-based authentication
On some servers, users might need to log in to Perforce before issuing commands. The following example illustrates login using Perforce tickets.
require 'p4' p4 = P4.P4() p4.user = "Sven" p4.password = "my_password" p4:connect() p4:run_login() opened = p4:run_opened() [...]
Changing your password
You can use P4Lua to change your password, as shown in the following example:
require 'p4' p4 = P4.P4() p4.user = "Joshua" p4.password = "MyOldPassword" p4:connect() p4:run_password("MyOldPassword", "MyNewPassword") -- p4.password is automatically updated with the encoded password
P4Lua Classes
The P4 module consists of several public classes:
- P4
- DepotFile
- Revision
- Integration
- MergeData
- Spec
The following tables provide more details about each public class.
P4
Perforce client class. Handles connection and interaction with the Perforce server. There is one instance of each connection.
The following table lists attributes of the class P4
in P4Lua. The attributes are read- and writable unless indicated otherwise. The attributes can be strings, objects, or integers.
| Attribute | Description |
|---|---|
| api_level | API compatibility level. (Lock server output to a specified server level.) |
| charset | Charset for Unicode servers. |
| client | P4CLIENT, the name of the client workspace to use. |
| cwd | Current working directory |
| errors | An array containing the error messages received during execution of the last command |
| exception_level | The exception level of the P4 instance. Values can be
|
| host | P4HOST, the name of the host used |
| input | Input for the next command. Can be a string or a table. |
| keepalive | Early abort running Perforce commands. |
| maxlocktime | MaxLockTime used for all following commands |
| maxresults | MaxResults used for all following commands |
| maxscanrows | MaxScanRows used for all following commands |
| os | Returns the OS (read-only) |
| output | An array containing the output messages received during execution of the last command |
| p4config_file | The location of the configuration file used (`P4CONFIG`). This attribute is read-only. |
| password | P4PASSWD, the password used. |
| port | P4PORT, the port used for the connection |
| prog | The name of the script |
| server_level | Returns the current Perforce server level |
| tagged | To disable tagged output for the following commands, set the value to 0 or false. By default, tagged output is enabled. |
| ticket_file | P4TICKETS, the ticket file location used |
| user | P4USER, the user under which the connection is run |
| version | The version of the script |
| warnings | An array containing the warning messages received during execution of the last command |
The following table lists all public methods of the class P4
. Many methods are wrappers around P4:run()
, which sends a command to the Perforce Server. Such methods are provided for your convenience.
| Method | Description |
|---|---|
| connect() | Connects to the Perforce Server. |
| connected() | Returns true if connected and the connection is alive, otherwise false. |
| delete_spectype() | Deletes the spec spectype. Equivalent to the command P4:run("spectype", "-d"). |
| disconnect() | Disconnects from the Perforce Server. |
| env() | Get the value of a Perforce environment variable, taking into account P4CONFIG files and (on Windows) the registry. |
| identify() | Returns a string identifying the P4Lua module. |
| fetch_spectype() | Fetches the spec spectype. Equivalent to the command P4:run("spectype", "-o"). |
| format_spectype() | Converts the spec spectype into a string. |
| parse_spectype() | Parses a string representation of the spec spectype and returns a table. |
| run() | Runs a command on the server. Needs to be connected, or an exception is raised. |
| run_command() | Runs the command command. Equivalent to P4:run("command"). |
| run_filelog() | This command returns a list of DepotFile objects. Specialization for the run() command. |
| run_login() | Logs in using the specified password. |
| run_password() | Convenience method: updates the password. Takes two arguments: oldpassword, newpassword |
| run_resolve() | Interface to p4 resolve. |
| run_submit() | Convenience method for submitting changelists. When invoked with a change spec, it submits the spec. Equivalent to :
p4.input = myspec p4:run("submit", "-i") |
| save_spectype() | Saves the spec spectype. Equivalent to the command: P4:run("spectype", "-i").
|
P4.DepotFile
Container class returned by P4:run_filelog()
. Contains the name of the depot file and a
list of P4.Revision
objects.
| Attribute | Description |
|---|---|
| depotFile | Name of the depot file |
| revisions | Table of Revision objects |
P4.Revision
Container class containing one revision of a DepotFile
object.
| Attribute | Description |
|---|---|
| action | Action that created the revision |
| change | Changelist number |
| client | Client workspace used to create this revision |
| desc | Short change list description |
| depotFile | The name of the file in the depot |
| digest | MD5 checksum of the revision |
| fileSize | File size of this revision |
| integrations | List of `P4.Integration` objects |
| rev | Revision |
| time | Timestamp (as datetime.datetime object) |
| type | File type |
| user | User that created this revision |
P4.Integration
Container class containing one integration for a Revision object
| Attribute | Description |
|---|---|
| how | Integration method (merge/branch/copy/ignored) |
| file | Integrated file |
| srev | End revision |
| erev | Start revision |
P4.Map
A class that allows users to create and work with Perforce mappings without requiring a connection to the Perforce Server.
| Method | Description |
|---|---|
| P4.Map() | Construct a new Map object (class method) |
| P4.Map_join() | Joins two maps to create a third (class method) |
| clear() | Empties a map |
| count() | Construct a new Map object (class method) |
| is_empty() | Tests whether or not a map object is empty |
| insert() | Inserts an entry into the map |
| translate() | Translate a string through a map |
| includes() | Tests whether a path is mapped |
| reverse() | Returns a new mapping with the left and right sides reversed |
| lhs() | Returns the left side as an array |
| rhs() | Returns the right side as an array |
| as_array() | Returns the map as an array |
P4.Spec
Class allowing access to the fields in a Perforce specification form.
| Attribute | Description |
|---|---|
| spec._fieldname | Value associated with the field named fieldname. |
| spec.permitted_fields | Array containing the names of the fields that are valid for this spec object |
Class P4
Description
Main interface to the Lua client API.
This module provides an object-oriented interface to the Perforce SCM system. Data is returned in Lua tables and input can also be supplied in these formats.
Each P4
object represents a connection to the Perforce Server, and multiple commands
may be executed (serially) over a single connection (which of itself can result in
substantially improved performance if executing lots of perforce commands).
- Instantiate your
P4
object - Specify your Perforce client environment:
client
,host
,password
,port
,user
- Set any options to control output or error handling:
exception_level
- Connect to the Perforce Server
- Run your Perforce commands
- Disconnect from the Perforce Server
Instance Attributes
p4.api_level -> int
Contains the API compatibility level desired. This is useful when writing scripts using
Perforce commands that do not yet support tagged output. In these cases, upgrading to a
later server that supports tagged output for the commands in question can break your
script. Using this method allows you to lock your script to the output format of an older
Perforce release and facilitate seamless upgrades. Must be called before calling
P4:connect()
.
For the API integer levels that correspond to each Perforce release, see: http://kb.perforce.com/?article=512.
require 'p4' p4 = P4.P4() p4.api_level = 57 p4:connect() ... p4:disconnect()
p4.charset -> string
Contains the character set to use when connect to a Unicode enabled server. Do not use
when working with non-Unicode-enabled servers. By default, the character set is the
value of the P4CHARSET
environment variable. If the character set is invalid, this method
raises an exception.
require 'p4' p4 = P4.P4() p4.client = "www" p4.charset = "iso8859-1" p4:connect() p4:run_sync() p4:disconnect()
p4.client -> string
Contains the name of your client workspace. By default, this is the value of the P4CLIENT
taken from any P4CONFIG
file present, or from the environment according to the normal
Perforce conventions.
p4.cwd -> string
Contains the current working directly. Can be called prior to executing any Perforce command. Sometimes necessary if your script executes a chdir() as part of its processing.
require 'p4' p4 = P4.P4() p4.cwd = "/home/sven"
p4.errors -> list (read-only)
Returns an array containing the error messages received during execution of the last command.
require 'p4' p4 = P4.P4() pcall(function() p4:connect() p4.exception_level = 1 -- ignore "File(s) up-to-date" files = p4:run_sync() end) for _, e in ipairs(p4.errors) do print(e) end p4:disconnect()
p4.exception_level -> int
Configures the events which give rise to exceptions. The following three levels are supported:
- 0 disables all exception handling and makes the interface completely procedural; you
are responsible for checking the
p4.errors
andp4.warnings
arrays. - 1 causes exceptions to be raised only when errors are encountered.
- 2 causes exceptions to be raised for both errors and warnings. This is the default.
For example
require 'p4' p4 = P4.P4() p4.exception_level = 1 p4:connect() -- Exception on failure p4:run_sync() -- File(s) up-to-date is a warning - no exception raised p4:disconnect()
p4.host -> string
Contains the name of the current host. It defaults to the value of P4HOST
taken from any
P4CONFIG
file present, or from the environment as per the usual Perforce convention.
Must be called before connecting to the Perforce server.
require 'p4' p4 = P4.P4() p4.host = "workstation123.perforce.com" p4:connect() ... p4:disconnect()
p4.input -> string | table
Contains input for the next command.
Set this attribute prior to running a command that requires input from the user. When the
command requests input, the specified data is supplied to the command. Typically,
commands of the form p4 cmd -i
are invoked using the P4:save_spectype
methods,
which retrieve the value from p4.input
internally; there is no need to set p4.input
when
using the P4:save_spectype
shortcuts.
You may pass a string, a hash table, or (for commands that take multiple inputs from the user) an array of strings or hash tables. If you pass an array, note that the first element of the array will be popped each time Perforce asks the user for input.
For example, the following code supplies a description for the default changelist and then submits it to the depot:
require 'p4' p4 = P4.P4() p4:connect() change = p4:run_change( "-o" )[1] change.Description = "Autosubmitted changelist" p4.input = change p4:run_submit( "-i" ) p4:disconnect()
p4.keepalive -> function
In order to early abort a Perforce command run, a keep alive function must be set. Returning
true
from the keep alive function will allow the Perforce command to continue running.
Returning false
will abort the command. The keep alive function is called every 0.5 second.
This example will abort the sync command immediately.
require 'p4' p4 = P4.P4() p4:connect() p4.keepalive = function(self) -- abort immediately return false end files = p4:run_sync('...') p4.keepalive = nil -- Remove the keep alive function for future commands p4:disconnect()
This example uses two additional Lua modules, the multithreading Lanes and the GUI library wxWidgets, to allow an early abort of the user's sync by pressing a button on a dialog.
require 'lanes' require 'wx' -- This is our communications pipeline with the thread. It is inherited -- as an upvalue for the runp4 lane. local linda = lanes.linda() -- Create the lane, giving it full access to all the standard libraries. runp4 = lanes.gen('*', function() require 'p4' p4 = P4.P4() pcall(function() p4:connect() p4.keepalive = function() -- If the linda receives the finished message, then abort. if linda:receive(0, "finished") then return false end return true end files = p4:run{ 'sync', '...', OutputText = function(info) print(info.clientFile) end } p4.keepalive = nil end) for _, w in ipairs(p4.warnings) do print(w) end for _, e in ipairs(p4.errors) do print(e) end p4:disconnect() end) -- Start the thread. p4result = runp4() -- Pop up the dialog. wx.wxMessageBox("Press OK to cancel sync.") -- After the dialog OK button has been pressed, send the finished message. linda:send('finished', true) -- Wait for the thread to exit. p4result:join()
p4.maxlocktime -> int
Limit the amount of time (in milliseconds) spent during data scans to prevent the server from locking tables for too long. Commands that take longer than the limit will be aborted. The limit remains in force until you disable it by setting it to zero. See `p4 help maxlocktime` for information on the commands that support this limit.
p4.maxresults -> int
Limit the number of results Perforce permits for subsequent commands. Commands that
produce more than this number of results will be aborted. The limit remains in force until
you disable it by setting it to zero. See p4 help maxresults
for information on the
commands that support this limit.
p4.maxscanrows -> int
Limit the number of database records Perforce scans for subsequent commands.
Commands that attempt to scan more than this number of records will be aborted. The
limit remains in force until you disable it by setting it to zero. See p4 help maxscanrows
for information on the commands that support this limit.
p4.os -> string
Returns one of UNIX
, vms
, NT
, Mac
, or nil
.
p4.output -> list (read-only)
Contains the array of output messages (either string or tables) that arose during execution of the last command.
require 'p4' p4 = P4.P4() pcall(function() p4:connect() files = p4:run_sync() end) for _, o in ipairs(p4.output) do print(o.clientFile) end p4:disconnect()
p4.p4config_file -> string (read-only)
Contains the name of the current P4CONFIG
file, if any. This attribute cannot be set.
p4.password -> string
Contains your Perforce password or login ticket. If not used, takes the value of P4PASSWD
from any P4CONFIG
file in effect, or from the environment according to the normal
Perforce conventions.
This password is also used if you later call p4:run_login()
to log in using the 2003.2 and
later ticket system. After running p4:run_login()
, the attribute contains the ticket the
allocated by the server.
require 'p4' p4 = P4.P4() p4.password = "mypass" p4:connect() p4:run_login()
p4.port -> string
Contains the host and port of the Perforce server to which you want to connect. It defaults
to the value of P4PORT
in any P4CONFIG
file in effect, and then to the value of P4PORT
taken
from the environment.
require 'p4' p4 = P4.P4() p4.port = "localhost:1666" p4:connect() ...
p4.prog -> string
Contains the name of the program, as reported to Perforce system administrators running
p4 monitor show -e
. The default is unnamed p4lua script
.
require 'p4' p4 = P4.P4() p4.prog = "sync-script" print( p4.prog ) p4:connect()
p4.server_level -> int (read-only)
Returns the current Perforce server level. Each iteration of the Perforce Server is given a level number. As part of the initial communication this value is passed between the client application and the Perforce Server. This value is used to determine the communication that the Perforce Server will understand. All subsequent requests can therefore be tailored to meet the requirements of this Server level.
This attribute is 0 before the first command is run, and is set automatically after the first communication with the server.
For the API integer levels that correspond to each Perforce release, see: http://kb.perforce.com/?article=571
p4.tagged -> int
If true
, p4.tagged
enables tagged output. By default, tagged output is on.
require 'p4' p4 = P4.P4() p4.tagged = false print(p4.tagged)
p4.ticket_file -> string
Contains the location of the P4TICKETS
file
p4.user -> string
Contains the Perforce username. It defaults to the value of P4USER
taken from any
P4CONFIG
file present, or from the environment as per the usual Perforce convention.
require 'p4' p4 = P4.P4() p4.user = "sven" p4:connect() ... p4:disconnect()
p4.version -> string
Contains the version of the program, as reported to Perforce system administrators in the server log.
require 'p4' p4 = P4.P4() p4.version = "123" print(p4.version) p4:connect()
p4.warnings -> list (read-only)
Contains the array of warnings that arose during execution of the last command
require 'p4' p4 = P4.P4() pcall(function() p4:connect() p4.exception_level = 2 -- File(s) up-to-date warning files = p4:run_sync() end) for _, w in ipairs(p4.warnings) do print(w) end p4:disconnect()
Class Methods
P4.P4()
Construct a new P4 object. For example:
require 'p4' p4 = P4.P4()
P4.identify()
Return the version of P4 that you are using.
lua -e "require 'p4'; print(P4.identify())"
Instance Methods
p4:connect()
Initializes the Perforce client and connects to the server.
If the connection is successfully established, returns true
. If the connection fails and
exception_level
is 0
, returns nil
and an error message, otherwise raises an exception. If already
connected, returns true
and a message.
require 'p4' p4 = P4.P4() p4:connect()
p4:connected() -> boolean
Returns true
if connected to the Perforce Server and the connection is alive, otherwise
false
.
require 'p4' p4 = P4.P4() print(p4.connected()) p4:connect() print p4:connected()
p4:delete_<spectype>( [ options ], name ) -> list
The delete_spectype methods are shortcut methods that allow you to delete the definitions of clients, labels, branches, etc. These methods are equivalent to:
p4:run( <spectype>, '-d', [options], <spec name> )
The following code uses delete_client
to delete client workspaces that have not been
accessed in more than 365 days:
require 'p4' p4 = P4.P4() now = os.time() pcall(function() p4:connect() for i, client in ipairs(p4:run_clients()) do -- If the client has not been accessed for a year, delete it if client.Access + 365 * 24 * 60 * 60 < now then print("Deleting client " .. client.client) p4:delete_client( '-f', client[ "client" ] ) end end end) for i, e in ipairs(p4.errors) do print(e) end p4:disconnect()
This code deletes all labels:
require 'p4' p4 = P4.P4() p4:connect() for i, label in ipairs(p4:run_labels()) do print("Deleting label " .. label.label) p4:delete_label( '-f', label.label ) end p4:disconnect()
p4:disconnect()
Disconnect from the Perforce Server. Call this method before exiting your script.
require 'p4' p4 = P4.P4() p4:connect() ... p4:disconnect()
p4:env( var, [value] )
If value
isn't specified, get the value of a Perforce environment variable, taking into account
P4CONFIG
files and (on Windows) the registry.
require 'p4' p4 = P4.P4() print( p4:env( "P4PORT" ) )
If value
is specified, sets the Perforce environment variable var
with value
.
require 'p4' p4 = P4.P4() p4:env( 'P4CONFIG', 'p4.ini' )
p4:fetch_<spectype>() -> P4.Spec
The fetch_spectype methods are shortcuts for running
p4:run("spectype", "-o")[1].
For example:
label = p4:fetch_label(labelname) change = p4:fetch_change(changeno) clientspec = p4:fetch_client(clientname)
are equivalent to
label = p4:run("label", "-o", labelname)[1] change = p4:run("change", "-o", changeno)[1] clientspec = p4:run("client", "-o", clientname)[1]
p4:format_spec( <spectype>, table ) -> string
Converts the fields in the table containing the elements of a Perforce form (spec) into the
string representation familiar to users. The first argument is the type of spec to format: for
example, client
, branch
, label
, and so on. The second argument is the hash to parse.
There are shortcuts available for this method. You can use p4:format_spectype( table )
instead of
p4:format_spec( spectype, table )
where spectype
is the name of a Perforce spec, such as
client
, label
, etc.
p4:format_<spectype>( table ) -> string
The format_spectype methods are shortcut methods that allow you to quickly fetch the definitions of clients, labels, branches, etc. They're equivalent to:
p4:format_spec( spectype, table )
p4:parse_spec( <spectype>, string ) -> P4.Spec
Parses a Perforce form (spec) in text form into a Lua table using the spec definition
obtained from the server. The first argument is the type of spec to parse: client
, branch
,
label
, and so on. The second argument is the string buffer to parse.
There are shortcuts available for this method. You can use p4:parse_spectype( buf )
instead of
p4:parse_spec( spectype, buf )
where spectype is one of client
, branch
, label
, and so on.
p4:parse_<spectype>( string ) -> P4.Spec
This is equivalent to parse_spec( spectype, string )
.
For example, parse_job(myJob)
converts the String representation of a job spec into a
Spec object.
To parse a spec, P4 needs to have the spec available. When not connected to the Perforce
Server, P4 assumes the default format for the spec, which is hardcoded. This assumption
can fail for jobs if the Server’s jobspec has been modified. In this case, your script can load
a job from the Server first with the command fetch_job(’somename’)
, and P4 will cache
and use the spec format in subsequent parse_job()
calls.
p4:run(cmd, [arg, ...])
Base interface to all the run methods in this API. Runs the specified Perforce command
with the arguments supplied. Arguments may be in any form as long as they can be
converted to strings by tostring()
.
The p4:run()
method returns a list of results whether the command succeeds or fails; the
list may, however, be empty. Whether the elements of the array are strings or
dictionaries depends on
(a) server support for tagged output for the command, and
(b) whether tagged output was disabled by calling p4.tagged = false
.
In the event of errors or warnings, and depending on the exception level in force at the
time, run()
raises an exception. If the current exception level is below the threshold for
the error/warning, run()
returns the output as normal and the caller must explicitly
review p4.errors
and p4.warnings
to check for errors or warnings.
require 'p4' p4 = P4.P4() p4:connect() spec = p4:run( "client", "-o" )[1] p4:disconnect()
Shortcuts are available for p4:run
. For example, p4:run_command( args )
is equivalent
to p4:run( "command", args )
.
There are also some shortcuts for common commands such as editing Perforce forms and submitting. For example, this:
require 'p4' p4 = P4.P4() p4:connect() clientspec = p4:run_client( "-o" )[1] clientspec.Description = "Build client" p4.input = clientspec p4:run_client( "-i" ) p4:disconnect()
...may be shortened to
require 'p4' p4 = P4.P4() p4:connect() clientspec = p4:fetch_client() clientspec.Description = "Build client" p4:save_client( clientspec ) p4:disconnect()
The following are equivalent:
| Shortcut | Equivalent to |
|---|---|
| p4:delete_spectype | p4:run( "spectype", "-d ") |
| p4:fetch_spectype | p4:run( "spectype", "-o ")[1] |
| p4:save_spectype( spec ) | p4.input = spec; p4:run( "spectype", "-i" ) |
As the commands associated with fetch_spectype
typically return only one item, these
methods do not return an array, but instead return the first result element.
For convenience in submitting changelists, changes returned by fetch_change()
can be
passed to run_submit()
. For example:
require 'p4' p4 = P4.P4() p4:connect() spec = p4:fetch_change() spec.Description = "Automated change" p4:run_submit(spec) p4:disconnect()
p4:run{cmd, [arg, ...]}
p4:run()
, as described above, performs the Perforce operation, collecting all output, warnings, and errors, and then returns that information to the user. It is suited for short-run commands or those where user interface is not an issue. Additionally, for large operations, exorbitant amounts of memory may be used by the mass collection process.
The table constructor form of p4:run{}
allows for all the functionality above but with the ability to patch into and receive information from the output, warning, or error streams as it becomes available.
P4 command arguments are specified as in p4:run()
. Additional table constructor function entries are as follows:
OutputText( info )
- Called whenever regular output is received, generally a string or table.OutputWarning( info )
- Called whenever a warning is received.OutputError( info )
- Called whenever an error is received.
If a function is not specified, the related p4.output
, p4.warnings
, or p4.errors
tables continue to fill. If this is not desirable, specify the function and make it empty.
require 'p4' p4 = P4.P4() p4:connect() p4:run{ 'sync', OutputText = function(info) print( 'Synced: ' .. info.depotFile ) end, OutputWarning = function(info) print(info) table.insert(p4.warnings, info) end } p4:disconnect()
p4:run_cmd([arg, ...])
Shorthand for p4:run("cmd", arguments... )
.
p4:run_filelog(<fileSpec>) -> list
Runs a p4 filelog
on the fileSpec
provided and returns an array of P4.DepotFile
results (when executed in tagged mode), or an array of strings when executed in
nontagged mode. By default, the raw output of p4 filelog
is tagged; this method
restructures the output into a more user-friendly (and object-oriented) form.
For example:
require 'p4' p4 = P4.P4() p4:connect() files = p4:run_filelog('index.html') print(files[1]) for _, r in ipairs(files[1].revisions) do print(r) for _, i in ipairs(r.integrations) do print(i) end end
p4:run_login( arg... ) -> list
Runs p4_login
using a password (or other arguments) set by the user.
p4:run_password( oldpass, newpass ) -> list
A thin wrapper to make it easy to change your password. This method is (literally) equivalent to the following:
p4:input( [ oldpass, newpass, newpass ] ) p4:run( "password" )
For example
require 'p4' p4 = P4.P4() p4.password = "myoldpass" pcall(function() p4:connect() p4:run_password( "myoldpass", "mynewpass" ) end) for i, e in ipairs(p4.errors) do print(e) end p4:disconnect()
p4:run_resolve( [resolver], [arg...] ) -> list
Run a p4 resolve
command. Interactive resolves require the resolver parameter to be
an object of a class derived from P4.Resolver
. In these cases, the resolve method of this
class is called to handle the resolve. For example:
p4:run_resolve()
To perform an automated merge that skips whenever conflicts are detected:
require 'p4' p4 = P4.P4() p4:connect() MyResolver = {} function MyResolver.resolve(self, mergeData) print(mergeData.your_name, mergeData.their_name, mergeData.base_name, mergeData.your_path, mergeData.their_path, mergeData.base_path, mergeData.result_path, mergeData.merge_hint) if not mergeData.merge_hint == "e" then return mergeData.merge_hint else return "s" -- skip the resolve, there is a conflict end end p4:run_resolve { resolver = MyResolver } p4:disconnect()
In non-interactive resolves, no P4.Resolver
object is required. For example:
p4:run_resolve ( "-at" )
p4:run_submit( [ hash ], [ arg... ] ) -> list
Submit a changelist to the server. To submit a changelist, set the fields of the changelist as required and supply any flags:
You can also submit a changelist by supplying the arguments as you would on the command line:
change = p4:fetch_change() change._description = "Some description" p4:run_submit( "-r", change ) p4:run_submit( "-d", "Some description", "somedir/..." )
p4:save_<spectype>()
The save_spectype
methods are shortcut methods that allow you to quickly update the
definitions of clients, labels, branches, etc. They are equivalent to:
p4.input = dictOrString p4:run( spectype, "-i" )
For example:
require 'p4' p4 = P4.P4() pcall(function() p4:connect() client = p4:fetch_client() client.Owner = p4.user p4:save_client( client ) end) for i, e in ipairs(p4.errors) do print e end p4:disconnect()
Class P4.DepotFile
Description
Utility class providing easy access to the attributes of a file in a Perforce depot. Each
P4.DepotFile
object contains summary information about the file and a list of revisions
(P4.Revision
objects) of that file. Currently, only the P4:run_filelog
method returns a
list of P4.DepotFile
objects.
Instance Attributes
df.depotFile -> string
Returns the name of the depot file to which this object refers.
df.revisions -> list
Returns a list of P4.Revision objects, one for each revision of the depot file.
Class Methods
None.
Instance Methods
None.
Class P4.Revision
Description
Utility class providing easy access to the revisions of P4.DepotFile
objects. Created by
P4:run_filelog()
.
Instance Attributes
rev.action -> string
Returns the name of the action which gave rise to this revision of the file.
rev.change -> int
Returns the change number that gave rise to this revision of the file.
rev.client -> string
Returns the name of the client from which this revision was submitted.
rev.depotFile -> string
Returns the name of the depot file to which this object refers.
rev.desc -> string
Returns the description of the change which created this revision. Note that only the first
31 characters are returned unless you use p4 filelog -L
for the first 250 characters, or `p4
filelog -l` for the full text.
rev.digest -> string
Returns the MD5 checksum of this revision.
rev.fileSize -> string
Returns this revision’s size in bytes.
rev.integrations -> list
Returns the list of P4.Integration objects for this revision.
rev.rev -> int
Returns the number of this revision of the file.
rev.time -> datetime
Returns the date/time that this revision was created.
rev.type -> string
Returns this revision’s Perforce filetype.
rev.user -> string
Returns the name of the user who created this revision.
Class Methods
None.
Instance Methods
None.
Class P4.Integration
Description
Utility class providing easy access to the details of an integration record. Created by
P4:run_filelog()
.
Instance Attributes
integ.how -> string
Returns the type of the integration record - how that record was created.
integ.file -> string
Returns the path to the file being integrated to/from.
integ.erev -> int
Returns the end revision number used for this integration.
integ.srev -> int
Returns the start revision number used for this integration.
Class Methods
None.
Instance Methods
None.
Class P4.Map
Description
The P4.Map
class allows users to create and work with Perforce mappings, without
requiring a connection to a Perforce server.
Instance Attributes
None
Class Methods
P4.Map( [ table ] ) -> P4.Map
Constructs a new P4.Map
object.
P4.Map_join ( map1, map2 ) -> P4.Map
Join two P4.Map
objects and create a third.
The new map is composed of the left-hand side of the first mapping, as joined to the right- hand side of the second mapping. For example:
-- Map depot syntax to client syntax client_map = P4.Map() client_map:insert( "//depot/main/...", "//client/..." ) -- Map client syntax to local syntax client_root = P4.Map() client_root:insert( "//client/...", "/home/tony/workspace/..." ) -- Join the previous mappings to map depot syntax to local syntax local_map = P4.Map_join( client_map, client_root ) local_path = local_map:translate( "//depot/main/www/index.html" ) # local_path is now /home/tony/workspace/www/index.html
Instance Methods
map:clear()
Empty a map.
map:count() -> int
Return the number of entries in a map.
map:is_empty() -> boolean
Test whether a map object is empty.
map:insert( string ... )
Inserts an entry into the map.
May be called with one or two arguments. If called with one argument, the string is assumed to be a string containing either a half-map, or a string containing both halves of the mapping. In this form, mappings with embedded spaces must be quoted. If called with two arguments, each argument is assumed to be half of the mapping, and quotes are optional.
-- called with two arguments: map:insert( "//depot/main/...", "//client/..." ) -- called with one argument containing both halves of the mapping: map:insert( "//depot/live/... //client/live/..." ) -- called with one argument containing a half-map: -- This call produces the mapping "depot/... depot/..." map:insert( "depot/..." )
map:translate ( string, [ boolean ] )-> string
Translate a string through a map, and return the result. If the optional second argument is 1, translate forward, and if it is 0, translate in the reverse direction. By default, translation is in the forward direction.
map:includes( string ) -> boolean
Tests whether a path is mapped or not.
if map:includes( "//depot/main/..." ) then ...
map:reverse() -> P4.Map
Return a new P4.Map
object with the left and right sides of the mapping swapped. The
original object is unchanged.
map:lhs() -> list
Returns the left side of a mapping as an array.
map:rhs() -> list
Returns the right side of a mapping as an array.
map:as_array() -> list
Returns the map as an array.
Class P4.MergeData
Description
Class containing the context for an individual merge during execution of a p4 resolve
.
Instance Attributes
md.your_name -> string
Returns the name of “your” file in the merge. This is typically a path to a file in the workspace.
md.their_name -> string
Returns the name of “their” file in the merge. This is typically a path to a file in the depot.
md.base_name -> string
Returns the name of the “base” file in the merge. This is typically a path to a file in the depot.
md.your_path -> string
Returns the path of “your” file in the merge. This is typically a path to a file in the workspace.
md.their_path -> string
Returns the path of “their” file in the merge. This is typically a path to a temporary file on your local machine in which the contents of their_name have been loaded.
md.base_path -> string
Returns the path of the base file in the merge. This is typically a path to a temporary file on your local machine in which the contents of base_name have been loaded.
md.result_path -> string
Returns the path to the merge result. This is typically a path to a temporary file on your local machine in which the contents of the automatic merge performed by the server have been loaded.
md.merge_hint -> string
Returns the hint from the server as to how it thinks you might best resolve this merge.
Instance Methods
md.run_merge() -> boolean
If the environment variable P4MERGE
is defined, run_merge() invokes the specified
program and returns a boolean based on the return value of that program.
Class P4.Resolver
Description
P4.Resolver
is a class for handling resolves in Perforce. It is intended to be subclassed,
and for subclasses to override the resolve()
method. When P4:run_resolve()
is called
with a P4.Resolver
object, it calls the resolve()
method of the object once for each
scheduled resolve.
Instance Attributes
None
Class Methods
None
Instance Methods
resolver.resolve(self, mergeData) -> string
Returns the resolve decision as a string. The standard Perforce resolve strings apply:
| String | Meaning |
|---|---|
| ay | Accept Yours |
| at | Accept Theirs |
| am | Accept Merge result |
| ae | Accept Edited result |
| s | Skip the merge |
| q | Abort the merge |
By default, all automatic merges are accepted, and all merges with conflicts are skipped.
The resolve
method is called with a single parameter, which is a reference to a
P4.MergeData
object.
Class P4.Spec
Description
Utility class providing easy access to the attributes of the fields in a Perforce form.
Only valid field names may be set in a P4.Spec
object. Only the field name is validated,
not the content. Attributes provide easy access to the fields.
Instance Attributes
spec._<fieldname> -> string
Contains the value associated with the field named <fieldname>.
spec.permitted_fields -> dict
Contains an array containing the names of fields that are valid in this spec object. This does not imply that values for all of these fields are actually set in this object, merely that you may choose to set values for any of these fields if you want to.
Class Methods
P4.Spec.new( dict ) -> P4.Spec
Constructs a new P4.Spec
object given an array of valid fieldnames.
Instance Methods
None.


429
> ERROR CODE: "HTTP 429 Too Many Requests"
> ERROR DESCRIPTION: "The origin server requires the request to be conditional."
> _


First of all, apologies for lack of precise timescales and dosages. I did not originally approach this undertaking with the intention of writing a report. However, after seeing how few trip reports on crack there were on Erowid I felt compelled to sumit my own.
Well, anyway...
The other night, I tried crack cocaine for the first time. I 'cooked up' the crack myself, using baking soda and cocaine HCl (obtained through not entirely honest means). The equipment was rudimentary - a spoon, a glass of water, some aluminium foil. I was unsure of the total weight of my HCl coke, but it looked about half a gram, give or take a bit. I took half of this and placed it on the spoon, mixing it with about half as much baking soda, then added just enough water to cover the pile. Seeing good cocaine mixed into that murky little concoction made me glad I had saved the other half - if things didn't go to plan at least I hadn't pissed all of it away.
I held the spoon over a candle until the mixture started bubbling. I was unsure when it was ready (it just looked like a blob of spit), so kept it there until most of it was gone, and there was only a little yellow puddle left. I let this cool and harden, and scraped it off the spoon. Reminded me somewhat of DMT crystals...
Being the perpetually unprepared type, I did not have a glass pipe in my possession, so I had to make do with a straw and aluminum foil. This proved to be frustrating. The first time I tried inhaling I heated the foil over a candle, and most of the smoke escaped.  I was close to retching, such was the awful taste.
Later on, I tried a different method. I put a small pile of crack on some foil which I placed over the mouthpiece of an upside-down cup. This way I could trap the smoke in the cup, turn it the right way up, pierce a hole in the foil and smoke it with a straw from the cup (look out for these at your local Starbucks). It worked as well...I exhaled big plumes of smoke, and within seconds was feeling the effects. First of all I got a bit heady, like if I'd stood up too fast. Then my digits had a warm 'buzz' to them. My lips were numb. I felt very stoned, but at the same time energised, and had a wonderful feeling of contentment. I also noticed my mood was lifted considerably (I had a massive grin on my face). Not so great was the heavy breathing and racing heartbeat, but it was no worse than if I'd just done some light jogging. The high was not as intense as it is generally made out to be, but it was very pleasant nevertheless.
I spent the rest of the evening wasting most of the crack through ineffective smoking techniques involving aluminium foil. The next day I finished off the rest of the coke, and that's when I discovered the drug's dark side. After having smoked all that I had, I started picking tiny bits of crack out of the carpet, smoking already burned bits of crack on the foil, etc. It was never enough to get me high, and I dread to think what it did to my throat (I finally admitted defeat after holding in a hit of what was probably burnt lint and feeling like I'd ripped the lining of my throat - not a pleasant experience). I do not purport to be addicted after only half a gram of pre-basified coke, but I know that if I had some crack here now, it would be gone in minutes.
Peace.
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


Bursa Malaysia remains lower at mid-afternoon
KUALA LUMPUR, Nov 8 — Bursa Malaysia remained in the red as profit-taking continues to persist in selected heavyweights.
At 3.20pm, the benchmark index was 1.34 points lower at 1,607.99 against Thursday’s close of 1,609.33.
The key index opened 2.24 points lower at 1,607.09.
On the broader market, losers outpaced gainers 427 to 345 with 420 counters unchanged, 801 untraded and 16 others suspended.
Turnover amounted to 2.21 billion shares worth RM1.23 billion.
An analyst said generally investors are currently on a profit-taking mode and foreign investors are still waiting on the sidelines for key economic data that will be released next week.
As for heavyweights, IOI Corporation was flat at RM4.34, Maxis and Sime Darby dipped six sen each to RM5.43 and RM2.29, Hong Leong Financial declined 20 sen to RM17.28 and Petronas Gas slipped two sen to RM16.58.
Of the actives, Sapura Energy was up 2.5 sen to 29.5 sen, market debutant Spring Art, Trive Property and NETX were all flat at 25 sen, 1.5 sen, and two sen respectively.
For top gainers, Vstecs was up 14 sen to RM1.20, KESM gained 12 sen to RM8.27 and Sarawak Consolidated gained up 11 sen to RM1.82. The top losers were led by United Plantation which declined 88 sen to RM25.00 and Nestle dipped 80 sen to RM146.10.
The FBM Emas Index was 5.32 points lower at 11,384.06, the FBMT 100 Index dipped 6.04 points to 11,196.01 and the FBM Emas Shariah Index decreased 7.15 points to 11,912.65.
The FBM Ace declined 26.61 points to 4,960.17 and the FBM 70 was 5.85 points firmer at 14,093.07.
Sector-wise, the Financial Services Index lost 10.67 points to 15,680.74, the Industrial Products & Services Index edged up 0.44 of-a-point to 155.33 and the Plantation Index slid 36.06 points to 6,862.69. — Bernama


Module mutex
Mutex operations.
Mutexes are used to ensure portions of code are accessed by a single task at a time. Said portions are called "critical sections", and are delimited by a lock acquisition at the beginning, and a lock release at the end. Only one task can acquire a lock at a time, so there is only one task inside the critical section at a time. Notice that Lumen being a cooperative scheduler, it will never preempt control from a task. Thus mutexes can be needed only if the fragment of code being locked contains a call that explicitly relinquish control, such as sched.sleep(), sched.signal() or sched.wait().
Usage:
local mutex = require 'lumen.mutex' ocal mx = mutex.new() ocal function critical() mx:acquire() ... mx:release() nd ocal critical = mx:synchronize(function() ... end) --other method
Functions
| new () | Create a new mutex. |
| acquire (mutexd) | Acquire a lock. |
| release (mutexd) | Releases a lock. |
| synchronize (mutexd, f) | Generate a synchronizzed version of a function. |
Functions
- new ()
-
Create a new mutex.
Returns:
-
a mutexd object.
- acquire (mutexd)
-
Acquire a lock.
If the lock is already acquired, this call will block until the task that
holds it releases the lock or finishes. Can be invoked in OO fashion
as mutexd:acquire().
Parameters:
- mutexd a mutexd object.
- release (mutexd)
-
Releases a lock.
A task can only release a lock it acquired before, otherwise a
error is triggered. If a task finishes or is killed, all locks it held will be released automatically.
Can be invoked in OO fashion as mutexd:release().
Parameters:
- mutexd a mutexd object.
- synchronize (mutexd, f)
-
Generate a synchronizzed version of a function.
This is a helper that takes a function, and returns a wrapper that is locked with
the mutex.
Can be invoked in OO fashion as mutexd:synchronize(f).
Parameters:
- mutexd a mutexd object.
- f function to be locked.


Taeyeon states she would die before busking alone
by sl278Taeyeon revealed her sadness at the fact that her last busking performance would be coming up on 'Begin Again 3'.
She appeared on the November 8th broadcast of the popular show where she has been busking in Berlin and Amsterdam for six days. On the morning of her last performance, she stated: "Honestly, busking can feel difficult. But after I do it, I feel accomplished. I would die before trying to do it by myself."
She continued stating: "At first, I found it somewhat burdensome but now that it became fun you guys are telling me to go home", causing laughter among the members.
Do you want to see Taeyeon go busking again in the future?


{% extends "base.html" %} {% load i18n %} {% block nav-invite %}active{% endblock %} {% block content %}
{% trans "Your previous search result is remembered and you can select to which users you would like to send invitation tokens." %}
{% if form.non_field_errors %}


Sequence ✦ Selection ✦ Looping
Input/Output ✦ Calculation ✦ Declaring/Initializing Variables
if statements ⛄ if/else statements ⛄ switch statements
Dual-alternative selection structure
int numOne = 2; int numTwo = 5;
if(numOne >= numTwo){
System.out.println("2 is greater than 5");
}else{
System.out.println("2 is not greater than 5");
}
Single-alternative selection structure
int numOne = 2; int numTwo = 5;
if(numOne <= numTwo){
System.out.println("5 is greater than 2");
}
Iterations ✦ Repetition
One Entry Point
Every Structure should have one entry point and one exit point.
No Crossed Lines
Lines should never cross each other
Continous Flow
There should be a continuous flow to the program that makes logical sense.
Stacking Structures
Attaching structures end-to-end
Nesting Structures
Placing one structure within another
//Write pseudocode here
int x = 1;
int y = 4;
if(x == 1){
for(int i = 0; i < 3; i++){
x++;
}
if(x >= 4){
System.out.println("x has changed values to");
}else{
System.out.println("x has not changed values");
}
}
Given the code above, how many total structures are presented?
Given the unstructured program to the left, once structured, how many selection structures will be needed?
Compound Condition
Asks multiple questions before an outcome is determined
AND decision
Requires that both of two tests evaluate to true.
Requires a nested decision or a cascading if statement
Conditional AND operator
Ask two or more questions in a single comparison.
Each Boolean expression must be true for entire expression to evaluate to true
Compound Condition
Asks multiple questions before an outcome is determined
OR decision
Take action when one or the other of two conditions is true
Example - “Are you free for dinner Friday or Saturday?”
Conditional OR operator
Ask two or more questions in a single comparison.
Only one Boolean expression in an OR selection must be true to produce a result of true
Complete the following activity using the diagram below
int x = 1;
int y = 4;
if(x == 1){
if(x >= 4 && y == x ){
System.out.print("Yup ");
}else{
System.out.print("Nope ");
}
}
System.out.print("Ok");
Given the code to the left, select the option that outputs to the console.
Range Check - Compare a variable to a series of values between limits
Use the lowest or highest value in each range
Adjust the question logic when using highest versus lowest values
Consider if end points of the range should be included
Yes: use >=or <=
No: use < or >
int LOWER_DRIVER_AGE = 16, UPPER_DRIVER_AGE = 120, age = 22;
if(age >= LOWER_DRIVER_AGE && age <= UPPER_DRIVER_AGE){
System.out.println("Able to rent car for Harvey Car Rental");
}else{
System.out.println("Not able to rent car from Harvey Car Rental");
}
int day = 2;
switch (day) {
case 1:
System.out.println("Monday");
break;
case 2:
System.out.println("Tuesday");
break;
case 3:
System.out.println("Wednesday");
break;
case 4:
System.out.println("Thursday");
break;
case 5:
System.out.println("Friday");
break;
case 6:
System.out.println("Saturday");
break;
case 7:
System.out.println("Sunday");
break;
default:
System.out.println("Invalid input");
}
Similar to nested if/else statments, but some would consider a simpler syntax.
Consider using switch when making few comparison and data you deciding doesn't change often. Such as:
Days of week, Meal selection, Calendar months, etc..
The break keyword allows you to immediately break out of the structure
The default keyword specifies some code to run if there is no case match
Ternary Operator
double studentLoanSingle = 1250000.00;
double studentLoanJoint = 250000.00;
double singleAnnualSalary = 120000.00;
double jointAnnualSalary = 255000.00;
//Determine deduction if Single
String singleQualify = singleAnnualSalary <= studentLoanSingle ? "$10,000 deduction " : "$0 deduction";
//Determine deduction if Joint income
String jointQualify = jointAnnualSalary <= studentLoanJoint ? "$10,000 deduction " : "$0 deduction";
System.out.println("If single, based on Annual Salary you will receive " + singleQualify);
System.out.println("If joint, based on Annual Salary you will receive " + jointQualify);
Ternary Operator: Simlar to if/else structure but simpler syntax
final double STUDENT_LOAN_SINGLE = 1250000.00;
double singleAnnualSalary = 125000.00;
//Determine deduction if Single
String sQualify = singleAnnualSalary > STUDENT_LOAN_SINGLE ? "$10,000 deduction " : "$0 deduction";
System.out.println("If single, based on Annual Salary you will receive " + sQualify);
Given the code above, which option will output to the console?
final int LOWER_DRIVER_AGE = 16, UPPER_DRIVER_AGE = 120;
int age = 22;
if(age < LOWER_DRIVER_AGE || age >= UPPER_DRIVER_AGE){
System.out.println("Not able to rent car");
}else{
System.out.println("Able to rent car");
}
Given the code above, which of the statments provides the correct output given the age?
Learning Activity
1) Identify all possible structures
Comment each section of your code
2) Code in Java
Import Random Class Library; use only sequence and selection structures
Initial loop control variable initialized before entering loop
Loop control variable tested
Body of loop must alter value of loop control variable
int initialValue = 0; //Initial Value for Control variable
int endValue = 7;
String topics [] = { "Structures", "Decision Making", "Looping",
"Arrays", "Modularization", "Object-Oriented Design", "UML"};
while(initialValue < endValue){ //Control variable tested
System.out.println("Week " + (initialValue + 1) + " is " + topics[initialValue]);
initialValue++; //Control Variable altered
}
System.out.println("Finished");
Step 1
Look up the formula for the fibonacci sequence and do research on this mathematical phenomenon
Step 2
Think through and apply the correct structures to fulfill the requirements of the sequence.
Step 3
Code the program in Java. Ask the user for how many iterations and ouput the sequence of numbers given the number provided
Nested Loop
loops within loops
Outer Loop
the loop that contains the other loop
Inner Loop
the loop that is contained
String days [] = {"Mon.", "Tue", "Wed.", "Thur", "Fri"};
String meals [] = {"Breakfast", "Lunch", "Dinner"};
String breakfastItems [] = {"OJ","Toast", "Banana"};
String lunchItems [] = {"Juice","Pizza", "Pear"};
String dinnerItems [] = {"Hi-C","Ribs", "Apple"};
int firstIterator = 0, secondIterator = 0, thirdIterator = 0;
System.out.println("Weekly Menu \n");
while(firstIterator < 5){
System.out.println(days[firstIterator]);
secondIterator = 0;
while(secondIterator < 3){
System.out.println(" " + meals[secondIterator]);
thirdIterator = 0;
while(thirdIterator < 3){
if(secondIterator == 0){
System.out.println(" " + breakfastItems[thirdIterator]);
}else if(secondIterator == 1){
System.out.println(" " + lunchItems[thirdIterator]);
}else{
System.out.println(" " + dinnerItems[thirdIterator]);
}
thirdIterator++;
}//End of inner most loop
secondIterator++;
}//end of second inner loop
firstIterator++;
}//End of first loop
System.out.println("Weekly Menu has been outputted");
Nested loops never overlap. An inner loop is always completely contained within an outer loop
The total number of iterations executed by a nested loop is the number of inner loop iterations times the number of outer loop iterations
An inner loop goes through all of its iterations each time its outer loop goes through just one iteration
Step 1
Observe the diagram above and declare variables for the data you will use in program
Step 2
Think through and apply the correct structures to fulfill the requirements of the program.
Step 3
Code the program in Java and output the month day along with the correct number of days for each month.
In the previous practice problem, we created the logic for a guessing game in which the application generated three random numbers and assigned a monetary value based on the correct numbers guessed. For this program, you will create a similar game in which the player tries to guess the one random number in the fewest attempts as possible. After each guess, display a message indicating whether the player’s guess was correct, too high, or too low. When the player eventually guesses the correct number, display a count of the number of guesses that were required. Your program will also need to enforce that the end-user can only enter a number between 1 - 9.
1) Identify all possible structures
Comment each section of your code
2) Code in Java
Import Random Class Library; use sequence, selection and looping structure
The statement while temperature remains below 60, leave the furnace on is an example of a __________
int x = 1;
int y = 4;
if(x == 1){
for(int i = 0; i < 3; i++){
x++;
}
if(x == 4){
System.out.println("x is now 4");
}else{
System.out.println("x is not 4");
}
}
Given the code above, what outputs to the console?
if(x > 10){
if(y > 10){
System.out.print("X");
}
}
Given the code above, Which of the lettered choices is equivalent to the following decision?
When you __________, you make sure data items are the correct type and fall within the correct range?
int x = 2;
int y = 3;
while(x < y){
while(x < 4){
System.out.println("Hi");
x++;
}
x++;
}
Given the code above, how many times do "Hi" output to the console?


This block samples the input signal, calculates the Fast Fourier Transform by function Math.realFFT, and (when simulation terminates) writes the output to result file resultFileName by function Math.realFFTwriteToFile.
The number of sampling points as well as the samplePeriod is calculated from desired maximum frequency f_max and frequency resolution f_res.
The user has to take care that enough points can be sampled before the simulation ends: startTime + (ns - 1)*samplePeriod <= stopTime.
The result file is written as mat, first column = frequency, second column = amplitudes, third column = phases. The frequency points are separated by rows with amplitude and phase = 0, so one can plot the result directly as frequency lines.


TIP CALCULATOR
Bill Amount
₹
How was the service ?
Select
20% - Excellent
15% - Good
10% - Bad
Total number of persons
Calculate
Tip Amount
0
₹
each


Some Default installed .EXE with DLL hijacking have been identified. See child pages.
You can read more about what DLL hijacking is under Privilege Escalation > Windows > DLL Hijacking
Another tool that can help identify DLL hijacking opportunities is Siofra


Solar Observations
Double-click to mark a sunspot group.
This tool calculates the Wolf Number, an indicator of Solar activity based on the number and grouping of sunspots.
Double-click to add a new group, click-and-drag to move groups around.
Use the plus and minus buttons to add or remove sunspots from each group and calculate the Wolf Number.


Lorem ipsum dolor sit, amet consectetur adipisicing elit. Excepturi neque, ipsa animi maiores repellendu distinctioaperiam earum dolor voluptatum consequatur blanditiis inventore debitis fuga numquam voluptate architecto itaque molestiae.
Lorem ipsum dolor sit, amet consectetur adipisicing elit. Excepturi neque, ipsa animi maiores repellendu distinctioaperiam earum dolor voluptatum consequatur blanditiis inventore debitis fuga numquam voluptate architecto itaque molestiae.
View Resume Social MediaThis project was created using ReactJS. Coded along from Web Developer Zero to Mastery by Andrei on Udemy. This will temporarily be here until I figure out what I'd like to build.
Check out my Github Page! I will be leaving this here until I start working on new personal projects. Some ideas are put into Progress repository under 'Thoughts.'
(978) 935-8860
<EMAIL_ADDRESS>Social Media:


"Display" in CSS can be a very useful tool for styling in CSS if you understand how to use it correctly. The basic values for how to display an element seem simple on the surface: display: block display: inline display: inline-block But each one has a different function, and which one you need will depend both on how you want it to display what kind of HTML element you are styling so that its behavior (or the behavior you expect from it) doesn't conflict with HTML syntax. While a block has some white space above and below and can be styled with margins and padding, it forces a line break after using it. A "div" is an example of a block object. An inline element, on the other hand, does not force a break, allowing elements to site next to each other "in line." They can have margins & padding on the sides to regulate the space between other inline elements, but not top or bottom and they cannot have a width or height. A navigation bar often uses an inline element to display the main site links. Inline-block elements are hybrids of these; they have all the behavior properties of a block, but they can be placed inline. This allows for things like using divs in place of tables when structuring a website. Here's a great visual example (and further reading) from Dustwell.com:


DTOP Cristallo
Contents:
Climb your curve
Get started
Project folders
Contribute to the DTOP project
Write more documentation
Web application
Scientific code library
DTOP Cristallo
»
Climb your curve
View page source
Climb your curve
¶
Get started
Project folders
Contribute to the DTOP project
Create your branch on GitHub
Clone our repository using:
Follow the steps in the README.md
Open your text editor (e.g. VS Code)
Write more documentation
What files can be documented?
Where should the documentation text go?
How is the text going to be formatted?


"""
def __init__(self, activation):
self.activation = activations.get(activation)
self.params = []
self.regularizer = []
self.constraint = []
def output(self, train):
X = self.get_input(train)
return self.activation(X)
"""
Apply an activation function to an output.
"""
def __init__(self, activation):
super(Activation,self).__init__()
self.activation = activations.get(activation)
def output(self, train):
X = self.get_input(train)


Favorite Toys
Here are some favorite toys and games with them!!!!
Tug with a rope
Bone
Bed
Barrrrkkk Baaaarrrrrkkkkkk!!!!! Bone Please!!!!!


Jenny
Lee
Enumerable Method
071315
What is an enumerable?
An enumerable basically allows us to count through a collection of data and sort it in some way.
The group_by method works by allowing you to form groups based on the rules that you decide.
It then returns a hash where the keys are the answer to the set rules and the values are arrays of elements from the original data that follow those rules, and therefore, are linked to the keys.
It's syntax looks like this:
group_by {|obj| block} --> a_hash
An example would be...
(1..6).group_by {|x| x % 3 }
will ouput...
{ 0 => [3,6], 1 => [1,4], 2 => [2,5] }
In the example above, the numbers 1 through 6 were grouped by the rule:
For every number in the set, group it by what the remainder is when that number is divided by 3
As the output reads, the key 0 is assigned the values 3 and 6. This means that the numbers 3 and 6, when divided by 3, give a remainder of 0, which is why they are both under the same key (0).
group_by is a great tool to use when you want to sort through a set of data and group it according to a set of rules that you choose!


{% extends "regapp/base.html" %} {% load i18n %} {% load staticfiles %} {% block title %} Lisplay - Confirm E-mail Address {% endblock %} {% block content %}
Please confirm that {{ confirmation.email_address.email }} is an e-mail address for user {{ confirmation.email_address.user }}.
{% else %}This e-mail confirmation link has expired or is invalid. Please issue a new e-mail confirmation request.
{% endif %}


Fort Myers man facing multiple charges after crashing into LCSO vehicle
by WFTX Digital TeamFORT MYERS, Fla. — According to Florida Highway Patrol, a Fort Myers man is facing DUI, and careless driving charges after he was involved in an accident with a Lee County Sheriff's Office marked patrol vehicle and another vehicle Sunday morning.
Gregory Caldwell, 50, of Fort Myers was traveling east on SR 80 in the outside lane. The marked Lee County Sheriff's Office patrol vehicle was stopped in the outside lane of SR 80 with emergency equipment performing a traffic stop on a driver in a 2002 GMC. Caldwell failed to stop, and struck the LCSO patrol vehicle. Subsequently, the patrol vehicle was pushed forward, hitting the GMC.
Caldwell is facing multiple charges, which include a DUI, property damage, and careless driving. The deputy is recovering from minor injuries.


Tribune travel writer Toni Salama recently spent a week at Orlando's Walt Disney World, seeing it all with an expert. For that report and more on other Orlando attractions, go to chicagotribune.com/orlando.
But Disney World is too big for one story. Starting today, and in coming weeks, we'll give you maps with hints for planning a better trip to each of the World's four theme parks--the Magic Kingdom, Epcot, Disney's Animal Kingdom and Disney-MGM Studios--and Downtown Disney.
Our World tour begins with the oldest park. See graphic.


Strength Training Workouts
Description
Cardio + Endurance Workouts
Speed + Agility Workouts
Flexibility Exercises
Meditation + Yoga Exercises
Workouts For General Health + Fitness


PANG PONG
Oops ... your browser doesn't support the HTML5 canvas element
Control :
W, Up : Move up
S, down : Move down
How To Play :
Collect rotated triangle as many as you can! If the ball reach the leftmost region, you lose :(
Current Score :
0
Start Game!


Proficient developer, bad designer (as you may have noticed)
Gustavo Avila
Bogotá, Colombia
LinkedIn
GitHub
<EMAIL_ADDRESS>I hold a Bachelor of Science in Systems and Computing Engineering.
I have nine years of professional experience developing software for millions of users across a wide range of companies from telecommunications and delivery services to social networks and banking. I am the main maintainer of an open source project used by tech companies and developers. In my free time I mentor developers.
I fell in love with computers at a very young age.
I remember writing shell scripts to bypass DRM protected software, installing DOOM using floppy disks on Windows 95, selling hacked CD's at school, using the Altavista search engine to create my first e-mail on Yahoo and messing up with the hardware of my family owned computer to play videogames at full speed.
I no longer write illegal code but code that adds value to millions of people.
1. Experience
Senior Software Engineer at Optimizely
Since February 2023
Senior Developer at Moove It
June 2019 - January 2023
- Development of a React app for a new business segment using technologies like Typescript, GraphQL, Storybook UI, Material UI, React Hook Form and React Router
- Full stack development of an existing SaaS solution built in Ruby on Rails, React, Redux, Mapbox, PostgreSQL, AWS Redshift and Rackspace
- Daily development and maintenance of a vanilla Ruby backend using technologies like Rack, Nginx, MySQL, in-house Debian machines and some internal tools
- Spot unnoticed bugs and performance bottlenecks using tools like Datadog, Monit, AWS CloudWatch, React Profiler and FullStory
- Responsible of the migration of an existing codebase into a monorepo using pnpm workspaces
- Setup and configure CI tools like Jenkins, CircleCI and Github Actions
- Automate functional testing using tools like Jest, React Testing Library, RSpec, Cucumber and Selenium
- Execute database migrations using either custom SQL scripts or Active Record migrations
- Carry on technical interviews of candidates
- Mentorships of junior and mid-level developers
Senior Developer at Nomo FOMO
February 2018 - May 2019
- Lead developer of an existing SaaS solution built with technologies like Ruby on Rails, AWS EC2, AWS S3, Docker, PostgreSQL and Google Maps API
- Responsible of the infrastructure migration from Dokku to AWS
- Refactor of the existing mobile API into a more flexible and robust solution following REST best practices
- Lead developer of a new customer-facing Android app in Kotlin
- Interview candidates from a technical perspective
Full Stack Developer at Genesistech
October 2017 - December 2017
- Development of custom software solutions in Ruby on Rails
- Part of the team that developed the first prototype of an in-house platform built in Ruby on Rails and Android
January 2016 - September 2017
- Lead developer of a stream processing platform built from scratch using Go, RethinkDB and WebSockets
- Lead developer of a migration from an Android app built in Ionic to a completely new native app written in Java
- Responsible of the development of a chat for Android using Intercom and WebSockets for the customer-facing app
- Provide technical support to the Android app
Junior .NET Developer at Mareigua
January 2015 - December 2015
- Development of a financial platform using technologies like C#, .NET, SQL Server, IIS, Team Foundation and Windows Server
- Development of stored procedures in SQL Server
- Create custom reports using SQL scripts
Junior Java Developer at Quality
July 2013 - June 2014
- Development of custom software solutions in Java EE, Oracle WebLogic and Oracle Database
2. Education
Bachelor of Science in Systems and Computing Engineering
January 2010 - December 2014
3. Projects and Open Source Collaborations
I developed a WebSocket client for Java / Android as defined in RFC 6455. The goal of this project is to provide a very lightweight WebSocket client for Java, with low overhead and high performance.
I developed an Android Voiding Diary for urology patients. Patients will be able to record their daily liquid intakes, voids and leaks of urine, and send a detailed report to their doctors.


Provision of a set of models and methods for use in the allocation and management of capital in financial portfolios.
| Version: | 1.5-3 |
| Depends: | R (≥ 2.10), methods, nloptr |
| Imports: | slam, Rglpk, quadprog, corpcor, parallel, truncnorm |
| Suggests: | xts, Rsymphony |
| Published: | 2016-08-25 |
| Author: | Alexios Ghalanos [aut, cre], Bernhard Pfaff [ctb], Miguel Sousa Lobo [ctb] (SOCP), Lieven Vandenberghe [ctb] (SOCP), Stephen Boyd [ctb] (SOCP), Herve Lebret [ctb] (SOCP) |
| Maintainer: | Alexios Ghalanos <alexios at 4dscape.com> |
| License: | GPL-3 |
| Copyright: | see file COPYRIGHTS |
| NeedsCompilation: | yes |
| Citation: | parma citation info |
| Materials: | README ChangeLog |
| In views: | Finance, Optimization |
| CRAN checks: | parma results |
| Reference manual: | parma.pdf |
| Vignettes: |
Portfolio Optimization in parma |
| Package source: | parma_1.5-3.tar.gz |
| Windows binaries: | r-devel: parma_1.5-3.zip, r-release: parma_1.5-3.zip, r-oldrel: parma_1.5-3.zip |
| OS X binaries: | r-release: parma_1.5-3.tgz, r-oldrel: parma_1.5-3.tgz |
| Old sources: | parma archive |
Please use the canonical form https://CRAN.R-project.org/package=parma to link to this page.


Lab 1 Assignment - Solution
Lab Instructor: Valeria Barra
Contents
DUE Tuesday 01/26/16
Exercise 1
Problem statement: Write a MATLAB program calculating
Solution:
n=100; % How far we’re summing up to S=0; % The sum variable S starts out at 0 for k = 0 : n % Loop over values of k from 1 to n if mod(k,2) == 0 % if k is even, the next line is executed S = S + 1 / factorial(k); else % otherwise, k is odd, the following line is executed: S = S - 1 / factorial(k); end % end of “if” statement end % end of the for loop % Show only the result, the last partial sum (so we put the display statement after the loop is over) disp( ['for k=', num2str(k), ': the last partial sum equals ', num2str(S) ]);
for k=100: the last partial sum equals 0.36788
Note: How do we check that this result is correct? Knowing from Calculus that the series represents the , in this case with x=1, ie .
CheckResult=exp(-1);
disp(['the actual sum up to 5 precision digits is: ',num2str(CheckResult)]);
the actual sum up to 5 precision digits is: 0.36788
Exercise 2
Problem statement: Write a MATLAB program calculating with an error tolerance of 10^(-6).
Solution:
tolerance = 1e-6; % Set the error tolerance to 10^(-4) S = 0; % The sum variable S starts out at 0 term = 1; % Set to high enough value k = 0; % first term corresponds to k=0 sgn = 1; while abs(term) > tolerance % repeat until the next term is less than the % error tolerance term = sgn / factorial(k); % calculate the next (k-th) term S = S + term; % add k-th term to the sum variable S k = k + 1; % increment summation index k (in a “for” loop, this is done % automatically) sgn = -sgn; % this assignment avoids the use of the "if-else" statement % used in the previous exercise end disp( ['for k=', num2str(k-1), ': the last partial sum equals ', num2str(S) ]); % Show the final result % show that we reached the desired tolerance fprintf(['And we have reched the desired tolerance because the next term '... 'would\n have been:%e. \n'],term); % Note: the three low dots serve to continue % any long matlab statement in multiple lines
for k=10: the last partial sum equals 0.36788 And we have reched the desired tolerance because the next term would have been:2.755732e-07.
Exercise 3
Problem statement: plot the function on the interval
Solution:
X = -pi:0.01:pi; % Create a set of x values between -1 and 1, with a step of 0.01 Y=sin(X)./(X.^2 + 1); % The period in “.^” ensures that the operation is performed %on each element figure(1) %opens a new figure plot(X,Y,'r','LineWidth',1); % Plot y against x, note the plot option for line color % and width box on % to put a nice frame around your plot axis([-pi pi -.5 .5]); % min and max delimiters for axes values to display xlabel('$x$','interpreter','latex','fontsize',14); % label the plot and use % math fonts in latex %(for nice visualization of math symbols!) ylabel('$y=\frac{\sin x}{x^2 +1}$','interpreter','latex','fontsize',14); legend({'$f(x)=\frac{\sin x}{x^2 +1}$'},'interpreter','latex','fontsize',12,... 'location','best'); title('Plot of function $f(x) = \frac{\sin x}{x^2 +1}$','interpreter','latex',... 'fontsize',14);
Exercise 4
Problem Statement: Calculate up to a tolerance of 10^(-6) and plot the values of the function for a set of 80 values of x on the interval [-1; 1]
Solution:
N = 80; % Number of points in the plot X = linspace(-1, 1, N); % Create a set of N values between -1 and 1 Y = zeros(N, 1); % create the corresponding Y array where we store the summation % for each value of little x tolerance= 1e-6; for i = 1 : N % Main part of the program: calculate the sum for each of the % N x-values x = X(i); % Assign the next x-value to the variable x S = 0; % initialize k = 0; % first term corresponds to k=0 sgn = 1; % initialize as positive for the first term in the series term=1; % initialize to a big enough value while abs(term) > tolerance % repeat until the next term is less than the % error tolerance % put here all commands needed to calculate the sum “S” for each value of x term = (sgn.*(x.^(k))) ./ factorial(k); % calculate the next (k-th) term % note: here little x is a scalar, so we don't actually need the . % operator, but it is a good practice S = S + term; % add k-th term to the sum variable S k = k + 1; sgn = -sgn; % this assignment avoids the use of the "if-else" statement % used in the previous exercise end Y(i) = S; %; store the result in the appropriate element of the y-array end figure(2) %opens a new figure plot(X,Y,'r','Linewidth',1) box on % to put a nice frame around your plot xlabel('$x$','interpreter','latex','fontsize',14); % label the plot and use % math fonts in latex ylabel('$y=\sum_{k=0}^{\infty}(-1)^k \frac{x^k}{k!}$','interpreter','latex',... 'fontsize',14); legend({'$f(x)=\sum_{k=0}^{\infty}(-1)^k \frac{x^k}{k!}$'},'interpreter','latex',... 'fontsize',12,'location','best'); title('Plot of function $f(x) =\sum_{k=0}^{\infty}(-1)^k \frac{x^k}{k!}$',... 'interpreter','latex','fontsize',14);


| 805 | (A) | a woman bundyn witħ barne was one the body hytt |
| 808 | (C) | A wommanne grette with chylde . was on þe bely hytte |
| 801 | (D) | A bierd boundyn with a barne was in þe body hit |
| 777 | (E) | ¶ A womman with chylde . was smeete on her woombe |
| (Ex) | ---- no text ---- | |
| 825 | (L) | a womman bounden with a barn was on þe body hytte |
| 749 | (P) | A woman b??den with berne was on þe bely hitt |
| 788 | (U) | ¶ A beern bounden witħ barn / was on the bely hitte |
| (V) | ---- no text ---- |


You are running in local mode
You need to configure DNS records. For Windows desktop users, a mapping of your website domain to <IP_ADDRESS> may be created on your system host file
Adding a domain to your account
Use below DNS server, all DNS records will be created automatically for you.
Or create your domain wildcard CNAME record to below domain. To use email service, also configure the Mx record to below domain.
Or create your domain wildcard A record to below IP address. This is not recommeneded because we may change our IP


Home
Welcome, to Self-Bot!
Self-Bot is a small bot that I've been working on for a while.
While it is only really advertised for its silly commands, there is some moderation commands and some economy commands as well.
Hope you all will enjoy!
Self-Bot is a small bot that I've been working on for a while.
While it is only really advertised for its silly commands, there is some moderation commands and some economy commands as well.
Hope you all will enjoy!


8.6. The Personal Recipe section¶
The $personal_recipe
section of the input file is generated by MAST and appears in the recipe-local input.inp
file in the recipe directory.
Here, any <S>, <N>, <B>, <E>, <B-E>, <Q>, and <P> tags are extracted from the input file and substituted into the recipe.
The personal recipe is a good way to check exactly which ingredients MAST is going to run.
If errors are spotted in this section once the recipe directory has been created, it is best to:
- Remove the entire new recipe directory from
$MAST_SCRATCH
- Examine the original input file’s
$recipe
section for errors and edit and save it - Re-run
mast -i <inputfile>.inp
to create a new recipe directory in$MAST_SCRATCH


Learn more about In History at our website
Learn more about BuildInTheCloud at our website
Have a suggestion or issue click here


{% extends 'timepiece/invoice/base.html' %} {% load timepiece_tags %} {% load bootstrap_toolkit %} {% load url from future %} {% block title %}Outstanding Hours{% endblock title %} {% block crumbs %} {{ block.super }}
Warning: The following users have unverified time during this period:
Warning: The following users have unapproved time during this period:
All time verified and approved
{% endif %}| Project | Active Contracts | Business | Status | Uninvoiced Hours | ||
|---|---|---|---|---|---|---|
| Billable | Non-billable | |||||
| {{ project.grouper }} |
{# FIXME: This generates a db query for each project; can we make it faster? #}
{% for contract in project.list.0.project.get_active_contracts %}
{{ contract.name }}
{% if not forloop.last %} {% endif %} {% endfor %} |
{{ project.list.0.project.business.get_display_name }} | {{ project.list.0.project.status.label|title }} | {% get_uninvoiced_hours project.list 'billable' %} | {% get_uninvoiced_hours project.list 'nonbillable' %} | {% if from_date %} Make Invoice {% else %} Make Invoice {% endif %} |
There are no outstanding hours which match your filter criteria.
{% endfor %}


## Effective Communication on the Whiteboard _By Daniel Scheufler_
## Overview * Course Structure * Topics: * Intro * Sign and Signified * Pictionary * Vocabulary * Abstraction
## Course Structure * ~ 2hours * 4x 30m Loops: * 10m Teach * 15m Do * 5m Review
## A Story without Words
## Story without Words ![alt text](../../img/talk/eff_comm/viz_story_1.jpg "Floating Cities")
## Story Telling without Words ![alt text](../../img/talk/eff_comm/viz_story_2.jpg "Boldly Flying into the storm")
## Story without Words ![alt text](../../img/talk/eff_comm/viz_story_3.jpg "Disaster")
## Story without Words Did the story end happily?
## Story without Words ![alt text](../../img/talk/eff_comm/viz_story_4.jpg "Exodus")
## The Sign and the Signified * [How Games Communicate without saying anything](https://youtu.be/Qr1SKlcBh4A) * [Part 2](https://youtu.be/Qr1SKlcBh4A?t=7m50s)
## The Sign and the Signified - Activity * Draw symbols for the following concpets: * Do _NOT_ look them up! * User, Danger, Email, Process, Database, Source, Idea, Machine, Sign, Calculation, Factory, Security
## Vocabulary * Signs = basic building blocks * No sign is universal! * Signs in combination change meeting * Combinations are not always 'direct'
## Vocab Activity * Find _a_ symbol for the following, and practice drawing it * _Bonus: find two for each._
## Vocab Activity * User, File/Document, Database, Server, Factory * Process, Setting, Service, Message, Security * Search, Find, Event, Warning, Error
## Context * Signs earn meaning from context * Context is not always implicit * Can be built * Can be shared
## Let's Pictionary
## Some Words * A Conversation/ Talking, Send an Email/Messsage, Buy Online * A Presentation, Running, Debugging, Sleeping * A Meeting, Find a Table in a Database, Confusion * Secure Messaging, Search Result, A Website
## Abstraction * Not all things fit into easy symbols, * Therefore need to use generic shapes/labels. * Most common in interaction charts
## Examples
## Activity * Draw an interaction chart for : * Improving's Hiring Process, An ECommerce Website, The Water Cycle * A Cell Phone Call, Sending a Postcard, A Search on Google * A Recent Client-Server app you worked on


Deployment using FAKE
This introduction assumes Fake.Deploy.exe is available in the current directory or path.
Introduction
The FAKE deployment tool allows users to deploy applications to remote computers and to run scripts on these remote agents. A typical scenario maybe as follows:
- Build an application -> run tests -> create artifacts and save on build server (Classical FAKE build workflow)
- Extract artifacts from build server and create a NuGet deployment package
- Push the NuGet package to the desired computer this will run the package's FAKE script on the remote machine
Installing Fake deployment services
In order to deploy application to a remote computer a deployment agent needs to be running on that server.
To run an agent in a console, simply run:
1:
|
Fake.Deploy |
To install a windows service on that agent:
- Open a command prompt with Administrator Priviledges
- Run Fake.Deploy /install
By default the service starts a listener on port 8080. This can however be configured by editing the Fake.Deploy.exe.config file and changing
1: 2: |
<add key="ServerName" value="localhost" /> <add key="Port" value="8080" /> |
to the desired value. If you use the asterisk as port no. then Fake.Deploy will assign the first open port behind of 8080.
To ensure the service is running you can navigate to http://{computer}:{port}/fake/ and you should be presented with a page giving the status if the service
Uninstalling Fake deployment services
To uninstall an agent
- Open a command prompt with Administrator Priviledges
- Run Fake.Deploy /uninstall
Running a FAKE Deployment Package
Getting help
If you want to learn about Fake.Deploy's command line switches then run:
1:
|
Fake.Deploy /help |
Creating a Deployment package
Since Fake.Deploy uses Nuget packages for deployment you only need to create one of those and include a .fsx file in the root folder of the package.
Instructions for creating nuget packages can be found at the NuGet document page
Running deployment
Fake deployment packages can be run manually on the current machine or they can be pushed to an agent on a remote machine.
To run a package on the local machine located at C:\Appdev\MyDeployment.nupkg you would run the following command:
1:
|
Fake.Deploy /deploy C: |
To run the same package on a remote computer (e.g. integration-1) you can run:
1:
|
Fake.Deploy /deployRemote http://integration-1:8080 C:\Appdev\MyDeployment.nupkg |
It's also possible to just make a HTTP-POST with the package to http://integration-1:8080/fake
This will push the directory to the given url. It is worth noting that the port may well be different, as this depends on the configuration of the listening agent (see. Installing Fake deployment service)
Getting information about the deployments
1:
|
The following assumes you have Fake.Deploy running. |
It's easy to get information about the deployments. Just make a HTTP request to server with:
1: 2: 3: 4: |
fake/deployments/ -> gives all releases fake/deployments?status=active -> gives all active releases fake/deployments/{app} -> gives all releases of app fake/deployments/{app}?status=active -> gives the active release of the app |
Rollback of releases
If you want to perform a rollback of a release so do a HTTP-PUT to:
1: 2: |
fake/deployments/{app}?version={version} -> rolls the app back to the given version fake/deployments/{app}?version=HEAD~2 -> relative rollback of the app (two versions earlier) |
Security
To turn on authentication in Fake.Deploy set the configuration value for 'Authorization' to 'On' (default is 'Off') in fake.deploy.config. When you set this value to 'On' you must also set the configuration key 'AuthorizedKeysFile' to point to a file that that contains the mapping between keys and usernames.
1: 2: |
<add key="Authorization" value="On" /> <add key="AuthorizedKeysFile" value="c:\fake_deploy\authorized_keys" /> |
If you deploy from a fake buildscript you need to make a call to FakeDeployAgentHelper.authenticate
before you perfrom any other call to the agent.
authenticate
takes 4 parameters, server
, userId
, pathToPrivateKey
and the password
for the private key
AuthorizedKeysFile
Is a rsa-pub key file where each line represents one user.
1:
|
ssh-rsa AAAAB3NzaC1yc2EAAAABJ_some_parts_removed_E91p+8JLFCaF3tLc8Aw==<EMAIL_ADDRESS>|
Each row has 3 values separated by space
1: 2: 3: |
* which type of key it is, it must be 'ssh-rsa' * public key in base64 format * username the key maps to. |
How to authorize against Fake.Deploy
First you must perform a HTTP-GET to: fake/login/yourUserId
From the response from this request, you take the body and base64 decode it, then you sign that value with your private key. Then you submit a HTTP-POST to /fake/login. There are 2 values you need to supply in the HTTP-POST.
challenge
which should have the same base64 encoded value you received in the body of get fake/login/userId.signature
which should contain the signature you created using thechallenge
value and your private key.
The body of the response from the HTTP-POST contains a guid, this guid should be passed in the header with the name AuthToken
.
To logout make a HTTP-GET to:
fake/logout
How do I generate a key on Windows?
Get PuTTYgen.
Run it.
Make sure the key is 'SSH-2 RSA' and number of bits is (at least) 2048.
Click Generate
and follow the instructions to genereate the key.
When the key is generated, change Key comment
to be your username and set a passphrase.
Then save the public key, you need to put this into Fake.Deploy's authorized keys file.
To save the private key, click Conversions
menu option and then click Export OpenSSH key
Linux
ssh-keygen -t rsa -b 2048 -N password


#include <resource.h>
Inheritance diagram for TStringCollection::
Public Methods | |
| TStringCollection (short aLimit, short aDelta) | |
Static Public Methods | |
| TStreamable* | build () |
Static Public Attributes | |
| const char* const | name |
Protected Methods | |
| TStringCollection (StreamableInit) |
Definition at line 24 of file resource.h.
|
|
Creates a TStringCollection object with the given values. |
|
|
Each streamable class needs a "builder" to allocate the correct memory for its objects together with the initialized virtual table pointers. This is achieved by calling this constructor with an argument of type StreamableInit. Definition at line 75 of file resource.h. |
|
|
Called to create an object in certain stream-reading situations. Reimplemented in TResourceCollection. |
|
|
Undocumented. Reimplemented from TSortedCollection. Reimplemented in TResourceCollection. Definition at line 80 of file resource.h. |


|
|||||||||
| PREV NEXT | FRAMES NO FRAMES |
| it.sauronsoftware.* |
|---|
| it.sauronsoftware.ftp4j.FTPClient | ||
|---|---|---|
public static final int |
MLSD_ALWAYS |
1 |
public static final int |
MLSD_IF_SUPPORTED |
0 |
public static final int |
MLSD_NEVER |
2 |
public static final int |
SECURITY_FTP |
0 |
public static final int |
SECURITY_FTPES |
2 |
public static final int |
SECURITY_FTPS |
1 |
public static final int |
TYPE_AUTO |
0 |
public static final int |
TYPE_BINARY |
2 |
public static final int |
TYPE_TEXTUAL |
1 |
| it.sauronsoftware.ftp4j.FTPCodes | ||
|---|---|---|
public static final int |
BAD_SEQUENCE_OF_COMMANDS |
503 |
public static final int |
CANNOT_OPEN_DATA_CONNECTION |
425 |
public static final int |
COMMAND_NOT_IMPLEMENTED |
502 |
public static final int |
COMMAND_OK |
200 |
public static final int |
COMMAND_PARAMETER_NOT_IMPLEMENTED |
504 |
public static final int |
CONNECTION_CLOSED |
426 |
public static final int |
DATA_CONNECTION_ALREADY_OPEN |
125 |
public static final int |
DATA_CONNECTION_CLOSING |
226 |
public static final int |
DATA_CONNECTION_OPEN |
225 |
public static final int |
DIRECTORY_STATUS |
212 |
public static final int |
ENTER_PASSIVE_MODE |
227 |
public static final int |
EXCEEDED_STORAGE_ALLOCATION |
552 |
public static final int |
FILE_ACTION_COMPLETED |
250 |
public static final int |
FILE_ACTION_NOT_TAKEN |
450 |
public static final int |
FILE_NAME_NOT_ALLOWED |
553 |
public static final int |
FILE_NOT_FOUND |
550 |
public static final int |
FILE_STATUS |
213 |
public static final int |
FILE_STATUS_OK |
150 |
public static final int |
FILE_UNAVAILABLE |
452 |
public static final int |
HELP_MESSAGE |
214 |
public static final int |
LOCAL_ERROR_IN_PROCESSING |
451 |
public static final int |
NAME_SYSTEM_TIME |
215 |
public static final int |
NEED_ACCOUNT |
332 |
public static final int |
NOT_LOGGED_IN |
530 |
public static final int |
PAGE_TYPE_UNKNOWN |
551 |
public static final int |
PATHNAME_CREATED |
257 |
public static final int |
PENDING_FURTHER_INFORMATION |
350 |
public static final int |
RESTART_MARKER |
110 |
public static final int |
SERVICE_CLOSING_CONTROL_CONNECTION |
221 |
public static final int |
SERVICE_NOT_AVAILABLE |
421 |
public static final int |
SERVICE_NOT_READY |
120 |
public static final int |
SERVICE_READY_FOR_NEW_USER |
220 |
public static final int |
STATUS_MESSAGE |
211 |
public static final int |
SUPERFLOUS_COMMAND |
202 |
public static final int |
SYNTAX_ERROR |
500 |
public static final int |
SYNTAX_ERROR_IN_PARAMETERS |
501 |
public static final int |
USER_LOGGED_IN |
230 |
public static final int |
USERNAME_OK |
331 |
| it.sauronsoftware.ftp4j.FTPFile | ||
|---|---|---|
public static final int |
TYPE_DIRECTORY |
1 |
public static final int |
TYPE_FILE |
0 |
public static final int |
TYPE_LINK |
2 |
|
|||||||||
| PREV NEXT | FRAMES NO FRAMES |


Id: 299
Name: Robot Rick
Status: unknown
Species: Robot
Type:
Gender: Male
OriginName: unknown
OriginUrl:
LocationName: Citadel of Ricks
LocationUrl: https://rickandmortyapi.com/api/location/3
Image: https://rickandmortyapi.com/api/character/avatar/299.jpeg
Episode: ['https://rickandmortyapi.com/api/episode/10']
Url: https://rickandmortyapi.com/api/character/299
Created: 2017-12-31T20:38:17.990Z


@* * Copyright 2010-2017 Artima, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *@ @import controllers.Application.scaladocsPageUrl @releaseNotesPage("ScalaTest Release Notes") {
ScalaTest 1.9.2 is a stepping-stone to help pave the way to upgrade from ScalaTest 1.9.1 to ScalaTest 2.0. Other than a few deprecations that were coming in 2.0 anyway, 1.9.2 removes the dependency on the deprecated Scala actors library, and refactors the ScalaTest style traits into classes.
Enhancements
Deprecations and removals
expectResult
in favor of assertResult
in org.scalatest.Assertions
.
MustMatchersForJUnit
in favor of ShouldMatchersForJUnit
in package org.scalatest.junit
.
Specs
in favor of Suites
in package org.scalatest
.
shouldEqual
to org.scalatest.matchers.ShouldMatchers
.
"be === "
matcher syntax in favor of shouldEqual
.
MustMatchers
in favor of ShouldMatchers
in package org.scalatest.matchers
. This will be a good, long
deprecation cycle, during which MustMatchers
will continue to work as before. But eventually MustMatchers
will be removed from
ScalaTest, after which must
will later return to serve a different purpose.
Spec
(renamed FunSpec
), and the long-deprecated MultipleFixture*
traits in org.scalatest.fixture
.


μPlot Demos
Multi time-series (two scales)
Areas chart
Grid over series
Axis positioning, metrics & style
Axis auto-size
Dependent scales
Function graphing & focus closest series
High/Low bands
Sparklines
Dynamic data update / streaming
Disable pixel alignment (avoid pixel jitter when streaming)
Sine wave stream (3,600 points lookback @ 60Hz)
Sync cursor, toggle & focus across multiple charts
Dynamically toggle cursor between select-and-zoom & select-only
Tooltips plugin (basic)
Tooltips plugin (placement.js for positioning & containment)
Tooltip on closest datapoint w/click, and moar!
Cursor hover nearest non-null
Proper timezone & DST handling
Missing data & gaps
Sparse data alignment & null fills
Variable month widths
Resize with window
Soft min/max
Compare several overlaid time periods & stacked legend
Logarithmic scales (log10, real data)
Logarithmic scales (log2, log10, axis formatters)
Inverse hyperbolic sine scales
Data smoothing (moving avg)
"Nice" scale
Scale padding test
No data
Y-shifted series
Points density control
Bars, stepped & smooth lines
Gradient fills & strokes (vt & hz, scale-affixed & data-relative)
Scale direction & orientation (e.g. rotation, inversion)
Russian month names on date/time axis
Dynamically add or delete series
Sync chart position when inside a scrollable container
Drawing
Trendlines from zoomed range & zoom snapping
OHLC plugin + legend-as-tooltip plugin
Box & whisker plugin + legend-as-tooltip plugin
Draw hooks & (custom points)
Multi-series bars plugin
Multi-series bars plugin (stacked)
Timeline/discrete state sequence plugin
Latency Heatmap
Scatter & Bubble
Measurement datums via keyboard
Wind direction renderer
Render to image/png
Zooming
Different zoom variants (adaptive, uni/omnidirectional)
Fetch & update data on zoom
Secondary sync'd overview chart for x-axis zoom ranging
Secondary sync'd overview chart for x-axis zoom ranging (with grips)
Secondary sync'd overview chart for x/y-axis zoom ranging
Pinch zooming/panning plugin
Mouswheel zooming plugin
Junk
Stacked series


Shiloh 2: Shiloh Season Reviewed by Eugene Novikov http://www.ultimate-movie.com Member: Online Film Critics Society
*** out of four
Starring Zachary Browne, Michael Moriarty, Rod Steiger, Scott Wilson. Rated PG.
Have parents not complained about the current lack of wholesome family entertainment? Have critics not bashed the film industry for not putting out movies that can entertain children without bombarding them with high-tech special effects? They have, making the fact that Shiloh 2: Shiloh Season wasn't a box office hit all the more a surprise. It went nowhere during its admittedly limited theatrical release which signifies a certain hypocrisy on the part of some parents: how can they rant that there isn't anything good for their children to watch and then when something good hits the screens not seek it out?
Shiloh Season is based on the novel of the same name by Phyllis Reynolds Naylor and it is a sequel to Shiloh, likewise both a novel and a movie. The first film had little Marty Preston attempting to save a mistreated beagle from Judd Travers, its cruel owner and the town drunk. He managed to get the dog and keep it but Judd isn't over it yet. He wants revenge and he wants the dog back.
Marty, I suspect, would rather give away his little sister than his beloved beagle so to him, giving the dog back to Judd to avoid trouble is out of the question. He blatantly refuses and his father (Michael Moriarty) supports him. But Judd isn't ready to give up so easily. He begins to blame Marty for various things that mysteriously happen around his residence, such as his mailbox being knocked over, his truck getting scratched and his dogs being set loose and biting Marty's sister. Marty insists that he didn't do any of those things; we, along with his parents, believe him.
Marty wants to see if he can change Judd; make him a better person by being nice to him. That's a refreshingly simple concept: here is a person deeply scarred by events of his childhood, so what better way is there to change him than to show him compassion? A little kindness, as opposed to a lot of therapy, goes a long way.
Inspector Gadget this ain't. In fact, Shiloh Season has an almost frustratingly no-frills attitude; in part, I'm sure, because of its limited budget but also because it is interested in emphasizing good values rather than cool effects. That's not to say that it doesn't entertain in the process: kids will love it and adults who allow themselves to be won over by it should not be squirming in their seats. It's a family film, not a kid flick; a movie that might be targeted at the young ones but can be enjoyed by the parents as well.
What this isn't is the story of a boy and his dog; it's a part of the plot but a minor one. You'll be hard-pressed to find a moment where director Sandy Tung tries to get an "Aaaaaaw" out of the audience with Shiloh's cuteness. Instead, it's a simple but sincere exploration of human nature. What makes "bad" people? Can we change them? If we can, how? These are questions that Shiloh Season tries to answer for kids while leaving enough open for discussions with parents. It's a fun movie, but it's also, in its own right, an important one.
Unfortunately, with all the big-budget "family" films around, not a lot of kids want to see stuff like this, and in accordance to the laws of supply and demand, not a lot of it is released. That is a reason why, now that Shiloh Season is on video, you should rent it. Don't deny yourself or your kids the experience of a moral, wholesome family film; now a rare breed. ©1999 Eugene Novikov
Sent via Deja.com http://www.deja.com/ Share what you know. Learn what you don't.
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