This page showcases some of my programming and development work. One of my hobbies is coding so I have generated a large list of accomplishments. I am currently employed as a junior web developer and I plan on using my coding ability if I do a course in engineering for University.
This was a game created using JavaScript canvas for our year 10 information technologies class. The game features the player who controls the North Korean Fighter Jet in order to chase down an elusive Donal Trump who is running from "Little Rocket Man" in a red pair of stiletto's. This game was created in collaboration with Benjamin Leembruggen and Tess Styles.
This was a platformer game I created throughout year 9 for my Personal Project. The goal is to defend yourself from waves of incoming aliens which have a tracking UI. As you progress the waves get harder and harder. I created this game in the program Unity and programmed it using the language C Sharp (C#).
This is a screenshot of the site that I created for my Computing 1/2 class in collaboration with Jake Adderly and Mitchell Henry. The site highlights data and issues regarding social media use in the current age and the graphs are created using charts.js, a javascript plugin for creating interactive charts.
This is a screenshot of the code for a javascript function that takes as many number inputs as the user wants and calculates the data associated with this. This function was created for my year 10 Information Technologies class.


This toolbox (MLT, or Machine Learning Toolbox) provides a number of essential functions for machine learning, especially for data clustering and pattern recognition. The full version of MLT is published by the Terasoft. You can download the complimentary demo version which has same functionality for a limited time.
After downloading the toolbox, you may want to try some of the interesting demos:gradientDescentDemo: Interactive demo of gradient descent over the peaks function
- gmmTrainDemo2dCovType01: Animation of GMM (Gaussian mixture models) training with isotropic covariance matrices
- gmmTrainDemo2dCovType02: Animation of GMM (Gaussian mixture models) training with diagonal covariance matrices
- gmmTrainDemo2dCovType03: Animation of GMM (Gaussian mixture models) training with full covariance matrices
- gmmGrowDemo: Animation of GMM (Gaussian mixture models) growing with center splitting
- hierClusteringPlot: Step-by-step hierarchical clustering
taylorExpansionDemo: Interactive demo of polynomial fit and taylor expansios lcs and editDistance: Visualize the result of dynamic programming for LCS (longest common subsequence) and ED (edit distance)
If you are using the toolbox for your research, please kindly give reference as follows:Jyh-Shing Roger Jang, "Machine Learning Toolbox", available at "http://mirlab.org/jang/matlab/toolbox/machineLearning", accessed on [date].
If you run into the problem of "Invalid MEX-file... The specified module could not be found" under MS Windows, please install Visual C++ runtime at http://www.microsoft.com/en-us/download/details.aspx?id=30679.


{{customization.plugins.core.title || 'Ajenti'}}
{{pageTitle|translate}}
{{identity.user[0].toUpperCase()}}
UID {{ identity.effective }}
{{ identity.user }}
{{ identity.machine.name }}
{{ item.name }}
Elevate
TFA
Log out
{{ identity.machine.name }}
Session time : {{ counter[0] }}:{{ counter[1] }}:{{ counter[2] }}
Shift - {{$index}}
Enter
{{result.title|translate}}
A bootstrap error has occurred
Please see browser console
Warning
The following plugin has failed to load:
. Please fix or uninstall it.


--- layout: paper headline: Publications title: 'Advisors for Incremental Propagation' authors: 'Mikael Z. Lagerkvist, Christian Schulte' howpublished: > In: Christian Bessière, editor, Thirteenth International Conference on Principles and Practice of Constraint Programming, Providence, RI, USA, volume 4741 of Lecture Notes in Computer Science, pages 409-422. Springer-Verlag, September, 2007. copyright: Copyright Springer-Verlag, the original publication is available at www.springerlink.com link: pdf bibtex: > @InProceedings{LagerkvistSchulte:CP:2007, Author = "Mikael Z. Lagerkvist and Christian Schulte", Title = "Advisors for Incremental Propagation", Editor = "Christian Bessière", Booktitle = "Thirteenth International Conference on Principles and Practice of Constraint Programming", Year = 2007, Month = sep, Address = "Providence, RI, USA", Publisher = "Springer-Verlag", Series = "Lecture Notes in Computer Science", Volume = "4741", Pages = "409--422", } relation: > Design, implementation, and evaluation of advisors for incremental propagation shorthowpub: > Thirteenth International Conference on Principles and Practice of Constraint Programming, 2007. ---
While incremental propagation for global constraints is recognized to be important, little research has been devoted to how propagator-centered constraint programming systems should support incremental propagation. This paper introduces advisors as a simple and efficient, yet widely applicable method for supporting incremental propagation in a propagator-centered setting. The paper presents how advisors can be used for achieving different forms of incrementality and evaluates cost and benefit for several global constraints.


Christchurch Bus Display
Education
University of Canterbury (Riccarton Road - Going East)
University of Canterbury (Ilam Road - Going West)
University of Canterbury (Ilam Road - Going East)
Shopping
Westfield Riccarton (Going East)
Westfield Riccarton (Going West)
Other
asd
Please Wait...
Route
Destination
ETA


Quite simply because Réunion is THE preeminent vacation destination. Also known as the France of the Indian Ocean, the island is a natural tropical paradise boasting an active volcano, majestic mountains, lush green valleys, tropical vegetation, rivers, white sand beaches, surfing, and so much more ! A veritable melting pot of cultures, Réunion abounds with French, Portuguese, Arabic, Chinese, Indian, and African influences.
This ethnic diversity is reflected in its warm and generous inhabitants, as well as its gastronomical delights. Whether you’re looking to simply unwind and relax or embark upon an exciting adventure, you’ll find it in Réunion! From the sea to the sky and everything in between, it’s an unforgettable destination.
Lorem ipsum dolor sit amet, consectetus adipiscing elit.
Lorem ipsum dolor sit amet, consectetus adipiscing elit.
Lorem ipsum dolor sit amet, consectetus adipiscing elit.
Lorem ipsum dolor sit amet, consectetus adipiscing elit. Aenean sed justo odio. Vivamus euismod vulputate metus.
Leave your name and email and we will contact you about all your inquiries.


2 references to ERROR_SERVICE_ALREADY_RUNNING
Microsoft.PowerShell.Commands.Management (2)
commands\management\Service.cs (2)
901
if (e.NativeErrorCode != NativeMethods.
ERROR_SERVICE_ALREADY_RUNNING
)
908
|| eInner.NativeErrorCode != NativeMethods.
ERROR_SERVICE_ALREADY_RUNNING
)


NSF NRI Authoring Environment
Save Plan
Load Plan
Physical
Cognitive
Cognitive and Physical
Upload Things
Save Things
Upload Positions
Save Positions
Upload Macros
Save Macros
+


Timeline of this fantastic inventor, engineer and dreamer.
1859
Born in Smiljan, a village in Croatia, on 28th July during a summer storm full of lightning. Tesla was nicknamed 'Child of the Storm', by his aunt. That said, his mother replied to that comment by calling him 'Child of the light'.
1881
Tesla began his career as chief electrical engineer of the BTS Company, introducing various operation upswings which improved the performance of the company.
1882
Tesla goes to work for Edison in the Continental Edison Company. He began working in a new industry by installing indoor lighting resources. In 1884 Tesla was realocated to the USA.
1885
Lemuel Serrel introduced Tesla to various businessmen, including Benjamin Vail and Robert Lane, to help finance a new light production company under Tesla Name. Tesla worked to acquire the patents for the company including developing an enhanced DC motor. His solutions gained attention from the mass media who sought his solutions.
1887
Tesla came up with an induction motor that was operated by alternating current. This innovative electric motor was patented in May 1988, and it comprised of a basic self-starting design that did not require the use of commutators. As a result, this reduced the occurrence of sparking the high maintenance that was associated with replacing mechanical brushes.
1890
After 1890, Tesla researched various approaches to transmitting power by inductive and capacitive coupling, through his famous 'Tesla coil'.
1891
In mid 1891, at the age of 35, he became a naturalized citizen of the US. In the same year, he also patented his famous Tesla Coil.
1943
In early 1943, at age 86, Tesla died in a Hotel Room in New York. He died alone, and his body was found by a maid who ignored a do not disturb sign on Tesla’s room. The assistant medical professional evaluated the body and determined the cause of death was related to coronary complications.


The first Sorrowful Mystery
The Agony of Jesus in the Garden
And his Sweat became as drops of blood running down upon the ground and rising from prayer he came to disciples and found them sleeping for sorrow. Luke 22:44-45
The Agony of Jesus in the Garden
And his Sweat became as drops of blood running down upon the ground and rising from prayer he came to disciples and found them sleeping for sorrow. Luke 22:44-45
The Scourging of Jesus at the pillar
Pilate then took jesus and had him scourged.John 19:1
The Crowning with thorns
And they stripped him and put on him a scarlet clothe and plating a crown of thorn they put it on his head and lean on his right head. Matthew 27:28-29
Carrying of the cross
And baring the cross for himself he went forth to the place called in hebrew. John 19:17
The Crucifixion and Death of Jesus
And jesus cried out with loud voice and said "Father in thy hands i commend my spirit" and having said this he expired Luke 23:46


As with buttons, you can choose one of the 7 different colors:
Hero title
Hero subtitle
Primary title
Primary subtitle
Light bold title
Light bold subtitle
Large title
Large subtitle
As with buttons, you can choose one of the 7 different colors:
By adding the is-bold
modifier, you can generate a subtle gradient
You can have even more imposing banners by using one of 3 different sizes
is-medium
is-large
is-fullheight
You can split the hero in 3 vertical parts:
hero
hero-head
(always at the top)hero-body
(always vertically centered)hero-foot
(always at the bottom)
By adding the has-background-fixed
modifier, you can generate a parallax


Renting a stand up paddle board to enjoy your balancing on the water and the beautiful landscape from water with the new feeling by your self or with your friends and family at the most populars beach on Koh Rong Sanleom. 10$/hour
Let's SUP together to some where else interesting for the island
We also offers any custom tours that you want to enjoy with your friends or family. Like SUP around the island, SUP and Snorkeling etc.


Circle drag in canvas.
Circle drag in svg with voronoi diagram. Dragging is applied to "voronoied" clipaths.
Circle drag in svg. Dragging is applied directly to the circles.
Circle drag and zoom in svg. Dragging is captured by a voronoi diagram but is computed by directly transforming each subject. Dragging is much quicker than example 13 with >1000 circles.
Quadtree search via brushing with circles of arbitrary sizes
Quadtree search via brushing with rectangles of arbitrary sizes


Simple Zoomer Demo
Main Features
- Smooth zooming in and out.
- Scrolling and swiping supported.
- Directly and also can be used in lightsbox, gallery and photo projects.
- Fully customizable with css.
- Easy to use and implement.
How to Implement
Nothing to do tough in order to get it working, just attach the zoomer();
with the selector img
in DOM ready function. An example below:
$(document).ready(function(){ $("#your-img-id").zoomer(); });Note:
- No need to create anything for zoomer, it will automatically create all necessary things in HTML document.
- Must include "simple-zoomer.css" file to your website/app.
- You can customize styles, placement & other relevant things in css.
To change zooming limit and origin, update the following options.
$(function(){ $(".myimage").zoomer({ maxLimit: 100, //default value zoomingOrigin: (0, 0), //default value }); });


The category
typeclass is defined in category_theory/default.lean.
It depends on the type of the objects, so for example we might write category (Type u)
if we're talking about a category whose objects are types (in universe u
).
Functors (which are a structure, not a typeclass) are defined in category_theory/functor.lean, along with identity functors and functor composition.
Natural transformations, and their compositions, are defined in category_theory/natural_transformation.lean.
The category of functors and natural transformations between fixed categories C
and D
is defined in category_theory/functor_category.lean.
Cartesian products of categories, functors, and natural transformations appear in category_theory/products/basic.lean. (Product in the sense of limits will appear elsewhere soon!)
The category of types, and the hom pairing functor, are defined in category_theory/types.lean.
We use the ⟶
(\hom
) arrow to denote sets of morphisms, as in X ⟶ Y
.
This leaves the actual category implicit; it is inferred from the type of X
and Y
by typeclass inference.
We use 𝟙
(\b1
) to denote identity morphisms, as in 𝟙 X
.
We use ≫
(\gg
) to denote composition of morphisms, as in f ≫ g
, which means "f
followed by g
".
You may prefer write composition in the usual convention, using ⊚
(\oo
or \circledcirc
), as in f ⊚ g
which means "g
followed by f
". To do so you'll need to add this notation locally, via
local notation f ` ⊚ `:80 g:80 := category.comp g f
We use ≅
for isomorphisms.
We use ⥤
(\func
) to denote functors, as in C ⥤ D
for the type of functors from C
to D
.
(Unfortunately ⇒
is reserved in logic.relator
: https://github.com/leanprover-community/mathlib/blob/master/src/logic/relator.lean, so we can't use that here.)
We use F.obj X
to denote the action of a functor on an object.
We use F.map f
to denote the action of a functor on a morphism`.
Functor composition can be written as F ⋙ G
.
We use τ.app X
for the components of a natural transformation.
Otherwise, we mostly use the notation for morphisms in any category:
We use F ⟶ G
(\hom
or -->
) to denote the type of natural transformations, between functors
F
and G
.
We use F ≅ G
(\iso
) to denote the type of natural isomorphisms.
For vertical composition of natural transformations we just use ≫
. For horizontal composition,
use hcomp
.


2 Kings 24:17
And the king of Babylon made Mattaniah his father's brother king in his stead, and changed his name to Zedekiah.


Having considered the current codebase of _tsolve
function, I find the following few points considered while implementing the new solver:
- modularise the code for various classes of equations(LambertW,
bivariate
equation type, logarithmic, exponential). - using SymPy
Set
objects internally, instead of using the built-in Pythonlists
. - use of
decompogen
function to check for possible decomposition of the given expression into simpler functions. - handle the case where the given equation has no closed-form solution and infinite recursion occurs.
These are just a handful of strategies that I intend to use. However, the whole process of development is going to a lot more complex and might need some more considerations from my side.
Task : Implement transolve
function.
Link to heading
My plan is to do a test-driven development for this solver.
For this, I will start by porting the relevant tests present in test_solvers.py
module to the test_solveset.py
.
Following this, I will start the developement process of the transolve
solver.
I aim to accomplish a major portion of this task by the end of this week.
Thats all for now. And the coding begins !


Author: Joshua Jensen<EMAIL_ADDRESS>The LuaPlus distribution contains some modifications to the core Lua code base. As such, it is not an official distribution of Lua 5.1 (which may be found at http://www.lua.org/), nor does it intend to represent itself as one. Most modifications are superficial, but some, such as the wide character string type, end up touching a great deal of source files. Any references to Lua in this document refer specifically to the modified Lua code contained herein, unless otherwise stated.
The LuaPlus distribution provides the following functionality.
LUA_TSTRING
in the Lua core code base was supplemented with an
equivalent wide character LUA_TWSTRING
.The LuaPlus Visual Studio LuaWatchAddin provides facilities whereby the Watch window
will show the contents of a LuaObject
, LuaTableIterator
,
LuaStackObject
, LuaStackTableIterator
, or
TString
(when
stepping inside Lua internals). The LuaWatchAddin does not expand Lua
tables, but an additional add-in does.
Program Files/Microsoft Visual
Studio .NET/Common7/IDE
.Program Files/Microsoft
Visual Studio .NET/Common7/Packages/Debugger/autoexp.dat
:; LuaPlus LuaPlus::LuaObject=$ADDIN(LuaWatchAddin.dll,AddIn_LuaObject) LuaPlus::LuaStackObject=$ADDIN(LuaWatchAddin.dll,AddIn_LuaStackObject) LuaPlus::LuaStackTableIterator=$ADDIN(LuaWatchAddin.dll,AddIn_LuaStackTableIterator) LuaPlus::LuaTableIterator=$ADDIN(LuaWatchAddin.dll,AddIn_LuaTableIterator) TString=$ADDIN(LuaWatchAddin.dll,AddIn_TString)
LuaPlus::LuaObjects
, LuaPlus::StackObjects, LuaPlus::LuaTableIterators
,
LuaPlus::StackTableIterators
and
TStrings
will expand in the watch
window.
The LuaWatchAddin does not provide expansion for Lua tables, although the LuaPlus Debugger Add-in does.
The ManagedLuaPlus Watch window support currently only works for
LuaObject
.
Program Files/Microsoft
Visual Studio .NET/Common7/Packages/Debugger/mcee_cs.dat
:; LuaPlus <ManagedLuaPlus.LuaObject>=<WatchType>
The LuaPlus Visual Studio .NET Debugger add-in allows viewing of Lua tables in a tree fashion. Currently, there is no installer for this.
To manually install:
regsvr32
c:\LuaPlus\Bin\LuaPlusDebuggerAddin\LuaPlusDebuggerControls.dll
regsvr32
c:\LuaPlus\Bin\LuaPlusDebuggerAddin\LuaPlusDebuggerAddin.dll
All LuaPlus functionality is encapsulated in the LuaPlus
namespace. Any
references to LuaPlus classes and types in this documentation assume the LuaPlus::
qualifier.
LuaPlus is an experimental C++ wrapper, and as such, there are sometimes multiple techniques for accomplishing the same result. Usually, the multiple techniques need to stay around, as some of the more advanced ones employ C++ templates and are not conducive to implementation in Managed C++.
All LuaPlus.NET functionality is encapsulated in the ManagedLuaPlus
namespace. Any
references to LuaPlus classes and types in this documentation assume the
ManagedLuaPlus.
qualifier. For the sake of this document, C# will
be used as the language accessing ManagedLuaPlus
functionality.
LuaState
is the C++ form of a lua_State
. Most C functions that accessed
a lua_State
are inlined functions in LuaState
. As far as efficiency goes,
LuaState
is equally as fast as the C
low-level counterparts for most operations.
LuaPlus is set up to work in DLL or LIB form, therefore, special
functions are provided for creating and destroying LuaState
objects. It is
not possible to new
a LuaState
object, because it is
necessary to ensure all allocation and deallocation is done within the same
memory management system. It is also not possible to call the core Lua
lua_open()
function and use a lua_State
pointer from
it.
| Unmanaged |
The static function An alternate approach to creating and destroying a LuaState* state = LuaState::Create(); |
| Managed |
A LuaState object is created no differently than any other .NET object. LuaState state = new LuaState(); Currently, the majority of the Lua standard library is initialized per LuaState, too, which consists of the auxiliary, base, debugging, I/O, math, ANSI string, wide string, and table libraries. |
LuaState
Thread Instance| Unmanaged | To add another state, typically for coroutine purposes, to an existing LuaState
instance, use the LuaState::CreateThread() static function.LuaObject threadObj = LuaState::CreateThread(state); |
| Managed | Not possible at this time. |
LuaState
Instance| Unmanaged | Calling the LuaState::Destroy() function runs all final garbage collection
processes and frees any memory associated with the LuaState object.LuaState::Destroy(state); |
| Managed | No explicit destruction of a LuaState object is needed. The .NET garbage collector will kick in and take care of clean up. |
lua_State
Pointer to a LuaState
Instance
(Unmanaged Only)A special function called LuaState::CastState()
exists for purposes of
changing an underlying lua_State*
to a LuaState*
. Note that
CastState()
can only be used if the lua_State
pointer was originally from a
LuaState::Create()
call. This separation may occur with certain Lua
callbacks.
LuaState* castedState = LuaState::CastState(regular_lua_State);
DoFile(const char* fileName)
is used to load and execute scripts
from disk. It mirrors lua_dofile()
in functionality.
UCS-2 files are handled automatically as are standard 8-bit files.
There is an alternate version of DoFile()
taking a second
parameter, a LuaObject
describing the function environment for the
block being loaded.
LoadFile()
is used to load a .lua
script file from
disk and store the compiled byte code as the top stack element. It does
not execute the chunk. That must be performed via a call to Call()
or PCall()
. Code loaded in this matter can be dumped to disk
via the LuaState::Dump()
command.
DoString()
and DoBuffer()
are used to load and
execute scripts from memory. They mirror lua_dostring()
and
lua_dobuffer()
in functionality.
There are alternate version of DoString()
and DoBuffer()
taking a second parameter, a LuaObject
describing the function
environment for the block being loaded.
LoadString()
and LoadBuffer()
are used to load Lua
scripts from memory and store the compiled byte code as the top stack element.
It does not execute the chunk. That must be performed via a call to
Call()
or PCall()
. Code loaded in this matter can be
dumped to disk via the LuaState::Dump()
command.
Finally, there are lua_WChar wide character equivalents of the above
functions: DoWString()
, LoadWString()
, DoWBuffer()
,
and LoadWBuffer()
.
Global variables in a LuaState
instance may be retrieved by one of a couple
methods.
LuaObject obj = state->GetGlobal("MyGlobalVariable");
Alternatively, the basic LuaObject::operator[]
referencing or
the LuaObject::GetByName()
functions may be used in conjunction
with LuaState::GetGlobals()
. (Both functions are described in
greater detail below, in the LuaObject
section.)
LuaObject globalsObj = state->GetGlobals(); LuaObject obj = globalsObj["MyGlobalVariable"];
You can also use a shortened form:
LuaObject obj = state->GetGlobals()["MyGlobalVariable"];
Note that some functions are for retrieval of LuaStackObjects
. These
function names are usually followed with _Stack
.
LuaStackObject obj1 = state->GetGlobals_Stack(); LuaStackObject obj2 = state->GetGlobal_Stack("MyGlobalVariable");
LuaObject obj = state->GetRegistry(); LuaStackObject obj2 = state->GetRegistry_Stack();
Any stack object can be retrieved via the Stack()
function.
LuaStackObject obj = state->Stack(1);
The StackTop()
function will return a LuaStackObject
representing the current top of the stack.
LuaStackObject obj = state->StackTop();
GetTop()
- Mirrors lua_gettop()
.SetTop(int index)
- Mirrors lua_settop()
.PushValue(int index)
- Mirrors lua_pushvalue()
.PushValue(LuaStackObject& object)
- Mirrors
lua_pushvalue()
.Remove(int index)
- Mirrors lua_remove()
.Insert(int index)
- Mirrors lua_insert()
.Replace(int index)
- Mirrors lua_remove()
.CheckStack(int size)
- Mirrors lua_checkstack()
.XMove(LuaState* to, int n)
- Mirrors lua_xmove()
.Equal(int index1, int index2)
- Mirrors lua_equal()
.RawEqual(int index1, int index2)
- Mirrors
lua_rawequal()
.LessThan(int index1, int index2)
- Mirrors
lua_lessthan()
.Pushing values to the stack is accomplished via the following functions.
PushNil()
- Mirrors lua_pushnil()
.PushInteger(int n)
- Mirrors lua_pushinteger()
.PushNumber(lua_Number n)
- Mirrors lua_pushnumber()
.PushLString(const char* s, size_t len)
- Mirrors
lua_pushlstring()
.PushLWString(const lua_WChar* s, size_t len)
- Mirrors
lua_pushlwstring()
.PushString(const char* s)
- Mirrors lua_pushstring()
.PushWString(const lua_WChar* s)
- Mirrors lua_pushwstring()
.PushBoolean(bool value)
- Mirrors lua_pushboolean()
.PushLightUserData(void* p)
- Mirrors
lua_pushlightuserdata()
.Pushing a closure to the stack has several overloads:
PushCClosure(lua_CFunction fn, int n)
- Mirrors
lua_pushcclosure()
.PushCClosure(function, n)
- Pushes a C callback function
taking a LuaState*
argument. It can be either a global
function, static function, or member function.PushCFunction(lua_CFunction fn)
- Pushes a C function to
the stack. No upvalues.TypeError(narg, tname)
- Mirrors luaL_typerror()
.ArgError(narg, extramsg)
- Mirrors luaL_argerror()
.CheckLString(numArg, len)
- Mirrors luaL_checklstring()
.OptLString(numArg, def, len)
- Mirrors
luaL_optlstring()
.CheckNumber(numArg)
- Mirrors luaL_checknumber()
.OptNumber(nArg, def)
- Mirrors luaL_optnumber()
.ArgCheck(condition, numarg, extramsg)
- Mirrors
luaL_argcheck()
.CheckString(numArg)
- Mirrors luaL_checkstring()
.OptString(numArg, def)
- Mirrors luaL_optstring()
.CheckInt(numArg)
- Mirrors luaL_checkint()
.CheckLong(numArg)
- Mirrors luaL_checklong()
.OptInt(numArg, def)
- Mirrors luaL_optint()
.OptLong(numArg, def)
- Mirrors luaL_optlong()
.CheckStack(int sz, const char* msg)
- Mirrors
luaL_checkstack()
.CheckType(narg, t)
- Mirrors luaL_checktype()
.CheckAny(int narg)
- Mirrors luaL_checkany()
.CheckUData(int ud, const char* tname)
- Mirrors
luaL_checkudata()
.The following mirror the standard C Lua APIs for stack table manipulation.
It is highly recommended LuaObject
is used instead, as it provides
a much better C++ alternative than the Lua stack.
SetTable(int index)
- Mirrors lua_settable()
.RawSet(int index)
- Mirrors lua_rawset()
.RawSetI(int index, int n)
- Mirrors lua_rawseti()
.SetMetaTable(int index)
- Mirrors lua_setmetatable()
.SetGlobals(int index)
- Mirrors lua_setfenv()
.
Backward compatible.SetFEnv(int index)
- Mirrors lua_setfenv()
.SetGlobal(const char *name)
- Mirrors lua_setglobal()
.Ref(int lock)
- Mirrors luaL_ref()
.Unref(int ref)
- Mirrors luaL_unref()
.SetDefaultMetaTable(int type)
- Sets the default meta table
for the given type with the table at the stack top.LuaPlus provides a comprehensive serialization facility for Lua data. It is described in detail in the Serialization section below.
LuaStateAuto
is an auto pointer encapsulation for a LuaState
pointer.
When the LuaStateAuto
goes out of scope, LuaState::Destroy()
is
automatically called on the contained state. In a Release build, LuaStateAuto
's
accessors are inlined, and code generation is as if the LuaStateAuto
object did not even
exist.
Using LuaStateAuto
is illustrated below:
{ LuaStateAuto stateOwner; // The state is automatically set to NULL. stateOwner = LuaState::Create(); stateOwner->PushNil(); // LuaState::Destroy() is automatically called here. }
LuaStateOwner
is derived from LuaStateAuto
.
LuaStateOwner
can automatically create the LuaState
through the function call LuaState::Create
.
{ LuaStateOwner stateOwner; // Automatically calls LuaState::Create(). stateOwner->PushNil(); // LuaState::Destroy() is automatically called here. }
Since a LuaStateAuto
object merely encapsulates the LuaState
pointer, it is
possible to retrieve that pointer by just assigning it.
LuaState* state = stateOwner;
LuaPlus provides an API extension over the core of Lua wrapped in the class
LuaObject
. A LuaObject
gives the full functionality of core Lua's stack
entities, but it does so without involving the stack at all. In general,
LuaObjects
tend to run a little faster than the core Lua stack equivalent.
A LuaObject
should be used for all communication with LuaPlus that is
external to a callback function. LuaStackObjects
, described
below, are used in conjunction with callback functions, but the same functional
interface is provided for consistency.
LuaObjects
store a pointer to the parent LuaState
. In part, this
is what makes the LuaWatchAddin work. Most importantly, LuaObjects
can
just be passed around without any regard for the LuaState they came from.
It is also important to note LuaObject
s are scope-driven.
So long as the LuaObject
is in scope, the object is valid.
When it goes out of scope, the contents of the LuaObject
will be
garbage collected. There is no need to run commands like lua_ref()
to keep an object around. Merely holding onto the LuaObject
instance, be it as a member variable, global variable, or even local variable
within a block of code is enough to ensure the LuaObject
's
existence.
A Reset()
function is also provided. It resets the
LuaObject
back to a default state where no Lua state is pointed to internally.
The sample code TestSuite performs an in-depth test of LuaObject
and is a
useful supplement to this documentation. The sample TestScript is
also used as a test bed for LuaObject
concepts.
A LuaObject
contains an object of one of several different types. These
types are described in the Lua manual with
the exception of the wide string type, a
LuaPlus added type.
There are several ways to retrieve the type of the LuaObject
. To test
for a specific type, one of the following functions may be called:
IsNil()
- Tests if the object is nil. Mirrors lua_isnil()
.IsTable()
- Tests if the object is a table. Mirrors
lua_istable()
.IsUserData()
- Tests if the object is userdata (including
light userdata). Mirrors lua_isuserdata()
.IsCFunction()
- Tests if the object is a C function.
Mirrors lua_iscfunction()
.IsInteger()
- Tests if the exact type of the object is a
number. See IsConvertibleToNumber()
for the LuaObject
equivalent of
lua_isnumber()
.IsNumber()
- Tests if the exact type of the object is a
number. See IsConvertibleToNumber()
for the LuaObject
equivalent of
lua_isnumber()
.IsString()
- Tests if the exact type of the object is a
string. See IsConvertibleToString()
for the LuaObject
equivalent of
lua_isstring()
.IsWString()
- Tests if the exact type of the object is a wide
string. See IsConvertibleToWString()
for the wide string equivalent of
lua_isstring()
.IsConvertibleToInteger()
- Tests if the object is convertible
to a number. The object being tested can be a number, string, or wide
string. Mirrors lua_isnumber()
.IsConvertibleToNumber()
- Tests if the object is convertible
to a number. The object being tested can be a number, string, or wide
string. Mirrors lua_isnumber()
.IsConvertibleToString()
- Tests if the object is convertible to a string.
The object being tested can be a number or a string. Mirrors lua_isstring()
.IsConvertibleToWString()
- Tests if the object is convertible to a wide
string. The object being tested can be a number or a wide string.
Mirrors lua_iswstring()
, the wide character equivalent of lua_isstring()
.IsFunction()
- Tests if the object is a function.
Mirrors lua_isfunction()
.IsNone()
- Tests if the object is out of range on the stack.
Mirrors lua_isnone()
.IsLightUserData()
- Tests if the object is specifically light
user data.IsBoolean()
- Tests if the object is a boolean. Mirrors
lua_isboolean()
.Generically, the type may be retrieved via the Type()
function. It returns a value from the LuaState
class's
enumeration of Types:
The actual string name of the type can be retrieved through LuaObject
's
TypeName()
function.
After testing the LuaObject
for the desired type, the stored
value may be retrieved using one of LuaObject
's Get*()
functions. All Get*()
functions assert on the wrong type in
Debug builds.
int ToInteger()
- Mirrors lua_tonumber()
.
Attempts to retrieve a numeric value from the object, even if the object is
a string.lua_Number ToNumber()
- Mirrors lua_tonumber()
.
Attempts to retrieve a numeric value from the object, even if the object is
a string.const char* ToString()
- Mirrors lua_tostring()
.
Attempts to retrieve a string from the object. If the object is a
number, the object is converted to a string.const lua_WChar* ToWString()
- Mirrors lua_towstring()
.
Attempts to retrieve a wide string from the object. It the object is a
number, the object is converted to a wide character string.int GetInteger()
- Retrieves the integer the object
represents. Asserts if the object is not of a numeric type.float GetFloat()
- Retrieves the float the object
represents. Asserts if the object is not of a numeric type.double GetDouble()
- Retrieves the double the object
represents. Asserts if the object is not of a numeric type.lua_Number GetNumber()
- Retrieves the lua_Number the
object represents. Asserts if the object is not of a numeric type.const char* GetString()
- Retrieves the string the object
represents. Asserts if the object is not a single byte string type.const lua_WChar* GetWString()
- Retrieves the wide string the
object represents. Asserts if the object is not a double byte string
type.lua_CFunction GetCFunction()
- Retrieves the C function
pointer the object represents. Asserts if the object is not a C
function.void* GetUserData()
- Retrieves the userdata or light
userdata the object represents. Asserts if the object is not a userdata.void* GetLightUserData()
- Retrieves the light userdata the
object represents. Asserts if the object is not a light userdata.bool GetBoolean()
- Retrieves the boolean the object
represents. Asserts if the object is not a boolean convertible type.If the LuaObject
is an ANSI or wide character string, the length
of the string in characters may be retrieved via StrLen()
.
The function ToStrLen()
may be used to automatically convert
numbers up to strings and retrieve the length. ToStrLen()
's
behavior is a mirror of lua_strlen()
.
For objects of type table, function, userdata, or light userdata, the
internal Lua storage pointer can be retrieved via the function
GetLuaPointer()
.
LuaObject obj = state->GetGlobal("SomeVariable"); if (obj.IsString()) { const char* str = obj.GetString(); }
For a stack Lua value, the programmer uses Push*()
functions to
get user values on the stack. Since LuaObjects
aren't stack
based, an alternate scheme was devised.
To assign a value to any LuaObject
, use one of the
Assign*()
functions.
AssignNil(LuaState* state)
AssignBoolean(LuaState* state, bool value)
AssignInteger(LuaState* state, int value)
AssignNumber(LuaState* state, double value)
AssignString(LuaState* state, const char* value)
AssignWString(LuaState* state, const lua_WChar* value)
AssignUserData(LuaState* state, void* value)
AssignLightUserData(LuaState* state, void* value)
AssignObject(LuaState* state, LuaObject& value)
AssignNewTable(LuaState* state, int narray = 0, int nhash = 0)
For example, to assign the string "Hello, world!"
to a
LuaObject
:
LuaObject strObj; strObj.AssignString(state, "Hello, world!");
There are two approaches for table creation built into LuaObject. The first is provided through the CreateTable() suite of functions. CreateTable() works similarly to the Set*() functions described below in that it is assumed the current LuaObject is a table. The first argument to CreateTable() is a table key. The key is used to make a new entry in the current LuaObject table and assign its value as an empty table.
The second approach to table creation is via the AssignNewTable() function. When called, an empty Lua table is created in the current LuaObject.
LuaObject globalsObj = state->GetGlobals(); LuaObject myArrayOfStuffTableObj = globalsObj.CreateTable("MyArrayOfStuff"); LuaObject aStandaloneTableObj; aStandaloneTableObj.AssignNewTable(state);
When the LuaObject
is a table, the functions for manipulating
tables become available. A few functions exist for retrieving various
types of table counts.
For the following table:
MyTable = { WindSpeed = 50, Value = 'Hello', 10, 20, 30 }
Calling GetN()
returns 3. GetN()
uses Lua's
table.getn()
function internally to retrieve the count.
table.getn()
only considers contiguous numeric keys starting at 1 to be
the count.
GetCount()
also only considers contiguous numeric keys starting
at 1. It would also return 3 for the table above. However, for one
shot table counts, GetCount()
generally runs much faster.
Finally, GetTableCount()
exists to return the actual number of
(non-contiguous) keys in the table. For MyTable
above, the table count would
be 5.
When the LuaObject
is a table, the functions for manipulating
tables become available. If the LuaObject
is not a table and
those functions are used, they will assert.
operator[]
has been overloaded to accept a key type of
const char*
, int
, LuaStackObject
, or LuaObject
. Using
operator[]
allows lookups to be very naturally represented, much
like using Lua script code.
state->DoString("MyTable = { WindSpeed = 50, Value = 'Hello', 10, 20, 30 }"); LuaObject myTableObj = state->GetGlobals()["MyTable"]; LuaObject windSpeedObj = myTableObj["WindSpeed"]; LuaObject is20Obj = myTableObj[2]; LuaObject keyObj; keyObj.AssignString(state, "Value"); LuaObject valueObj = myTableObj[keyObj];
Although not usually needed, spelled out forms of the table retrieval functions are:
GetByName(const char* key)
GetByIndex(int index)
GetByObject(const LuaObject& obj)
GetByObject(const LuaStackObject& obj)
The LuaObject
table setting functions all start with
Set*()
.
There are 3 overloaded Set*()
functions per value type.
Each takes one of three key types for the key-value pair arguments.
const char*
.int
).LuaObject
.The Set*()
functions are listed below. key
is
one of the 3 types listed above.
SetNil(key)
SetBoolean(key, bool value)
SetInteger(key, int value)
SetNumber(key, double value)
SetString(key, const char* value)
SetWString(key, const lua_WChar* value)
SetUserData(key, void* value)
SetLightUserData(key, void* value)
SetObject(key, LuaObject& value)
Each Set*()
function returns a reference to the current object,
allowing chaining of multiple Set*()
functions in a single
statement.
Example:
LuaObject tableObj; tableObj.AssignNewTable(state); tableObj.SetString("MyKey", "Hello, world!"); LuaObject globalsObj = state->GetGlobals(); globalsObj.SetBoolean("InUse", true).SetNumber(5, 2000);
The Lookup() function provides a simple method of recursively looking up a table entry by string. It accepts period separated string key entries.
LuaObject globalsObj = state->GetGlobals(); LuaObject valueObj = globalsObj.Lookup("Child1.Child2.Value1");
Some of the calls provided through the table library of functions are more simply encapsulated in LuaObject. The current set of functions are Insert() (mirroring table.insert), Remove() (mirroring table.remove), and Sort() (mirroring table.sort).
Another LuaObject
method, Clone()
, allows simple
cloning of a LuaObject
. The clone operation is a deep clone
for Lua tables, but for any other values, a simple clone is performed.
This should be fine for most needs, especially where values like userdata can
just be a simple pointer copy.
The Clone()
method does not handle cyclic tables. You will
either run out of memory or stack overflow if you attempt a clone operation on a
cyclic table.
Two LuaObjects
may be compared by using the ==
or
<
operators. The internal comparisons are done through
lua_equal()
and lua_lessthan()
, which is equivalent to their
Lua counterparts.
On many occasions, it is still necessary to access an object on the Lua
stack. Callback functions receive an array of LuaStackObjects
as arguments. Generally, the APIs for a LuaStackObject
and a
LuaObject
are similar enough to not be an issue when writing code.
LuaObjects
are, however, the preferred way of accessing objects
maintained by Lua, since the stack doesn't need to be taken into consideration.
Turning a LuaStackObject
into a LuaObject
is as
simple as making an assignment:
LuaStackObject stack1Obj(state, 1); LuaStackObject stack2Obj(state, 2); LuaObject nonStack1Obj(stack1Obj); // or LuaObject nonStack2Obj = stack2Obj;
The cases where you would need to push a LuaObject
onto the Lua
stack are rare. Nonetheless, the facility is provided through
LuaObject
's PushStack()
function.
LuaObject tableObj(state); tableObj.AssignNewTable(); tableObj.SetString("Key", "My String"); // It's often good practice to use a LuaAutoBlock here. tableObj.PushStack(); // Be sure to clean it up when you're done!
| Unmanaged | Proper LuaPlus callbacks are of the function signature:int Callback(LuaState* state); As a convenience mechanism, the Lua stack is available through a class called
LuaPlus's callbacks use a simple functor mechanism that masks away the differences between global functions, non-virtual member functions, and virtual member functions. Lua standard C-style callbacks can also be used, although they aren't as functionally robust as LuaPlus callbacks. An example follows: static int LS_LOG(LuaState* state) { printf("In static function\n"); return 0; } class Logger { public: int LS_LOGMEMBER(LuaState* state) { LuaStack args(state); printf("In member function. Message: %s\n", args[1].GetString()); return 0; } virtual int LS_LOGVIRTUAL(LuaState* state) { printf("In virtual member function\n"); return 0; } }; LuaObject globalsObj = state->GetGlobals(); globalsObj.Register("LOG", LS_LOG); state->DoString("LOG()"); Logger logger; globalsObj.Register("LOGMEMBER", logger, &Logger::LS_LOGMEMBER); state->DoString("LOGMEMBER('The message')"); globalsObj.Register("LOGVIRTUAL", logger, &Logger::LS_LOGVIRTUAL); state->DoString("LOGVIRTUAL()"); Callback functions are registered with the void Register( const char* funcName, lua_CFunction function, int nupvalues = 0 ); void Register( const char* funcName, int (*func)(LuaState*), int nupvalues = 0 ); void Register( const char* funcName, const Callee& callee, int (Callee::*func)(LuaState*), int nupvalues = 0 );
|
| Managed | Proper LuaPlus callbacks are of defined through the Managed C++
delegate:public __delegate int LuaPlusCallback(LuaState* state); An example follows: public int LS_LOG(LuaState state) { Console.WriteLine("In member function. Message: {0}\n", state.Stack(1).GetString()); return 0; } LuaObject globalsObj = state.GetGlobals(); globalsObj.Register("LOG", new LuaPlusCallback(Logger.LS_LOG)); state->DoString("LOG()"); |
| Unmanaged | Even though Register() can dispatch to C++ member functions, it
uses a 'this' pointer as provided by the second argument passed to the function.
The 'this' pointer is constant, and Register() is not suited for
mirroring class hierarchies in Lua.The solution to the 'this' pointer issue is through
As an example, we want to mirror a class called MultiObject: class MultiObject { public: MultiObject(int num) : m_num(num) { } int Print(LuaState* state) { printf("%d\n", m_num); return 0; } void Print2(int num) { printf("%d %d\n", m_num, num); } protected: int m_num; }; The best way to implement C++ objects mirrored in Lua is through metatables. We'll start by creating a metatable and adding the MultiObject::Print() function to it. LuaObject metaTableObj = state->GetGlobals().CreateTable("MultiObjectMetaTable"); metaTableObj.SetObject("__index", metaTableObj); metaTableObj.RegisterObjectFunctor("Print", &MultiObject::Print); Now, we'll give two C++ objects implementations in Lua called MultiObject obj1(10); LuaObject obj1Obj = state->BoxPointer(&obj1); obj1Obj.SetMetaTable(metaTableObj); state->GetGlobals().SetObject("obj1", obj1Obj); MultiObject obj2(20); LuaObject obj2Obj = state->BoxPointer(&obj2); obj2Obj.SetMetaTable(metaTableObj); state->GetGlobals().SetObject("obj2", obj2Obj); Everything is set up to handle proper dispatching now. To
illustrate, a few state->DoString("obj1:Print()"); state->DoString("obj2:Print()");
LuaObject table1Obj = state->GetGlobals().CreateTable("table1"); table1Obj.SetLightUserData("__object", &obj1); table1Obj.SetMetaTable(metaTableObj); LuaObject table2Obj = state->GetGlobals().CreateTable("table2"); table2Obj.SetLightUserData("__object", &obj2); table2Obj.SetMetaTable(metaTableObj); state->DoString("table1:Print()"); state->DoString("table2:Print()"); Above, two Lua tables called |
| Unmanaged | LuaPlus supports registration of C++ functions directly through the
RegisterDirect() function.float Add(float num1, float num2) { return num1 + num2; } LuaStateOwner state; state->GetGlobals().RegisterDirect("Add", Add); state->DoString("print(Add(10, 5))"); Any functions registered in this fashion automatically receive built-in type checking for the incoming arguments. If an argument is not valid, luaL_argassert is called. For instance, in the above example, if Add was called with a non-numeric string, there would be a failure. state->DoString("print(Add(10, 'Hello'))"); Just as global functions can be registered, member functions can be registered, also. void LOG(const char* message) { printf("In global function: %s\n", message); } class Logger { public: void LOGMEMBER(const char* message) { printf("In member function: \n", message); } virtual void LOGVIRTUAL(const char* message) { printf("In virtual member function: %s\n", message); } }; LuaObject globalsObj = state->GetGlobals(); globalsObj.RegisterDirect("LOG", LOG); Logger logger; globalsObj.RegisterDirect("LOGMEMBER", logger, &Logger::LOGMEMBER); globalsObj.RegisterDirect("LOGVIRTUAL", logger, &Logger::LOGVIRTUAL); state->DoString("LOG('Hello')"); state->DoString("LOGMEMBER('Hello')"); state->DoString("LOGVIRTUAL('Hello')"); The implementation built into LuaPlus in this version supports up to 7 parameters in the registered function. Note: This direct registration of C++ functions and the recommended style for calling Lua functions are based around techniques presented in LuaBind (http://luabind.sourceforge.net/). LuaBind provides a much more powerful function dispatching mechanism, including inheritance for classes. I am not interested in making LuaPlus dependent on another library, and LuaBind is dependent on Boost (http://www.boost.org/). Also, LuaPlus has no issue with making extensions to the core Lua code base to achieve the end result more efficiently. LuaBind is built directly on top of the unmodified Lua 5.0 core. |
| Managed | The support for direct registration of .NET functions is incomplete and slow at this time. Hopefully, future improvements will bring it up to the usability level of the C++ counterpart. |
| Unmanaged | Even though RegisterDirect() can dispatch directly to C++ member functions, it
uses a 'this' pointer as provided by the second argument passed to the function.
The 'this' pointer is constant, and RegisterDirect() is not suited for
mirroring class hierarchies in Lua.The solution to the 'this' pointer issue is through
Using the above MultiObject sample, we'll add support for a directly called C++ member function to the metatable. metaTableObj.RegisterObjectDirect("Print2", (MultiObject*)0, &MultiObject::Print2);
All that needs be done at this point are some calls to state->DoString("obj1:Print2(5)"); state->DoString("obj2:Print2(15)"); state->DoString("table1:Print2(5)"); state->DoString("table2:Print2(15)"); |
Unregistering a callback is as simple as setting its table entry to nil.
globalsObj.SetNil("LOG");
LuaObject attempts to simplify the function calling interface of the core Lua API. It does so by completely masking away the stack management. Often, Lua function calls with arguments can be performed in a single line of code.
| Unmanaged | By taking advantage of some C++ template tricks, we can directly call a Lua
function as if it was C++ function.LuaStateOwner state; state->DoString("function Add(x, y) return x + y end"); LuaFunction<float> Add = state->GetGlobal("Add"); printf("Add: %d\n", Add(2, 7)); The template LuaStateOwner state; state->DoString("function Print(str) print(str) end"); LuaFunction<> Print = state->GetGlobal("Print"); Print("Hello, world!"); The built-in types LuaPlus understands for functions are:
A more detailed discussion of the function dispatching mechanism may be found in the Lua Callback Dispatcher section below. The implementation built into LuaPlus in this version supports up to 7 arguments. |
| Managed | An experimental form of .NET to Lua function calling has been
implemented for the .NET implementation.LuaStateOwner state; state->DoString("function Print(x, y) print(x, y) end"); LuaObject printObj = state->GetGlobal("Print"); printObj.Call(2, "Hi"); The types this technique understands is limited for now:
An unlimited number of arguments may be passed to the Call() function. |
| Unmanaged | LuaPlus also employs a convention similar to the Standard C++
library's iostream functionality. A simple example follows:LuaStateOwner state; state->DoString("function Add(x, y) return x + y end"); LuaObject funcObj = state->GetGlobal("Add"); { LuaAutoBlock autoBlock(state); LuaCall call = funcObj(); LuaStackObject retObj = call << 2 << 7 << LuaRun(); printf("Add: %d\n", retObj.GetInteger()); } The function call starts by "calling" the It can't be avoided that a Lua function call puts return values on the stack.
The
LuaObject funcObj = state->GetGlobal("PrintIt"); LuaCall call = funcObj; LuaStackObject retObj = call << "String" << LuaArgNil() << LuaRun();
LuaObject funcObj = state->GetGlobal("ThreeReturnValues"); LuaCall call = funcObj; LuaStackObject retObj = call << LuaRun(1); // Only accept one return value. |
| Managed | No implementation exists for this at this time. |
The metatable for a LuaObject
is retrieved via
GetMetaTable()
. Every table and userdata has a unique metatable.
The metatable for a basic type is shared. See the
Metatable Enhancements section.
A metatable can be changed for a LuaObject
via the
SetMetaTable()
function. If the LuaObject
represents a
table or userdata, the metatable change is as per standard Lua. If the
LuaObject
is a basic type, the metatable is changed for all basic
types.
LuaPlus provides a class called LuaTableIterator
to ease the table iteration
process. Its use is far simpler, safer, and more natural looking than the
standard Lua table iteration function (lua_next()
/lua_pop()
). The iterator
is not STL compliant in its current form.
LuaStateOwner state; state.DoString( "MyTable = { Hi = 5, Hello = 10, Yo = 6 }" ); LuaObject obj = state.GetGlobals()[ "MyTable" ];for ( LuaTableIterator it( obj ); it; it.Next() ) { const char* key = it.GetKey().GetString(); int num = it.GetValue().GetInteger(); }
If the LuaWatchAddin is installed, the key and value portions of the
LuaTableIterator
object will be displayed as it is traversed.
LuaTableIterator
is fully documented in LuaPlus.h
.
LuaPlus does not use integers to represent stack objects. Instead,
those stack indices are wrapped in a LuaStackObject
. LuaStackObjects
can be passed
directly to a Lua C function, if needed, but it is advised to go through the
LuaPlus version of the function.
Using a LuaObject
is usually the better way to go, since a LuaObject
relieves
the user of any stack management at all. LuaStackObjects
are available for
use in callback functions or in special case stack management scenarios.
LuaStackObjects
also store a pointer to the parent LuaState
. In part, this
is what makes the LuaWatchAddin work. Most importantly, LuaStackObjects
can
just be passed around without any regard for the LuaState
they came from.
Most LuaStackObject
functions mirror LuaObject
functions of the same name, so
see the section above for more detail.
(Note: Using LuaObject, there is no need to use this class.)
LuaPlus enhances the Lua ref table facility by allowing ref'ed objects to be
used without using GetRef()
to push them onto the stack.
LuaRefObject
encapsulates this new functionality. Assigning a LuaObject
(or another
LuaRefObject
) to a LuaRefObject
instance will cause a
lua_ref()
to occur.
When the LuaRefObject
goes out of scope, lua_unref()
is called.
LuaRefObject
is derived from LuaObject
and can operate on ref'ed objects without
issue.
The LuaWatchAddin displays the contents of LuaRefObjects
.
A LuaStackTableIterator
is almost identical to the LuaTableIterator
above,
except it provides support for iterating using the stack, similar to how core
Lua does it.
LuaStackTableIterator
is fully documented in LuaPlus.h
.
Nothing can be more frustrating than paying attention to stack management.
Which function allocates which entry on the stack? How many entries?
Did it get popped? Where is that stack leak at? LuaAutoBlock
serves
as a fairly useful approach to solving these problems.
LuaAutoBlock
is a C++ class whose constructor stores the index of the stack
top. At destruction time, it sets the stack top to the stored index.
By providing this functionality as an object, the stack is guaranteed to be
restored, regardless of exit points from a function or loop block.
Note: When using the LuaObject class, there is no need to worry about stack management, and so LuaAutoBlock provides no benefits in that situation.
{ LuaAutoBlock autoBlock(state); LuaStackObject testObj = state->GetGlobals_Stack()["Test"]; // Does this allocate a stack item? state->PushString["A string"]; // Does this? testObj.SetNumber("Value", 5); // Does this? // Who cares? LuaAutoBlock automatically cleans it up. }
LuaStateOutFile
and derived classes are used in conjunction with
LuaState::DumpObject()
. When a LuaStateOutFile
object is passed to
DumpObject()
, that object is used for writing the Lua dump file.
The application can derive from LuaStateOutFile
to change the
default dumping behavior.
The LuaHelper namespace contains some useful helper functions for retrieving values from LuaObjects. The helper functions perform a lookup into a table for a certain key. If the key is required to be found and is not present, an assertion is triggered. Otherwise, the found value or a default value is returned.
The following helper functions are available:
GetBoolean()
GetFloat()
GetLightUserData()
GetString()
GetTable()
The LuaPlus distribution can write a Lua table into a nicely formatted text file. All data types are handled, although some write themselves out as comments (functions, userdata, threads).
A table can be written both from Lua and C++. The C++ LuaState function prototypes are:
bool DumpObject(const char* filename, const char* name, LuaObject& value, unsigned int flags = DUMP_ALPHABETICAL, int indentLevel = 0, unsigned int maxIndentLevel = 0xffffffff); bool DumpObject(const char* filename, LuaObject& key, LuaObject& value, unsigned int flags = DUMP_ALPHABETICAL, int indentLevel = 0, unsigned int maxIndentLevel = 0xffffffff); bool DumpObject(LuaStateOutFile& file, const char* name, LuaObject& value, unsigned int flags = DUMP_ALPHABETICAL, int indentLevel = 0, unsigned int maxIndentLevel = 0xffffffff); bool DumpObject(LuaStateOutFile& file, LuaObject& key, LuaObject& value, unsigned int flags = DUMP_ALPHABETICAL, int indentLevel = 0, unsigned int maxIndentLevel = 0xffffffff); bool DumpGlobals(const char* filename, unsigned int flags = DUMP_ALPHABETICAL, unsigned int maxIndentLevel = 0xFFFFFFFF); bool DumpGlobals(LuaStateOutFile& file, unsigned int flags = DUMP_ALPHABETICAL, unsigned int maxIndentLevel = 0xFFFFFFFF);
filename
- The name of the file to
write to disk or a "@"
string for logging
to OutputDebugString (in Windows).file
- A LuaStateOutFile instance. name
- The name of the initial Lua table to write to
disk.key
- The key name of the initial Lua table to write to disk.
This is usually a string, but it could be a number, too.value
- The value to write.flags
- One of three flags may be intermixed with each other:DUMP_ALPHABETICAL
- Alphabetize the keys when writing to the
file.DUMP_WRITEALL
- Write all Lua objects out, including function
and user data information.DUMP_WRITETABLEPOINTERS
- If DUMP_WRITEALL
is
specified, the actual memory addresses of tables are written in comment form.indentLevel
- The number of tabs to indent each line.maxIndentLevel
- The maximum number of nested tables allowed
in the write. If this value is exceeded, then no carriage returns are
inserted.The Lua functionality is very similar in form.
function LuaDumpObject(file, key, value, alphabetical, indentLevel, maxIndentLevel, writeAll) function LuaDumpGlobals(file, alphabetical, maxIndentLevel, writeAll)
file
- The name of the file to
write to disk, a "@"
string for logging
to OutputDebugString (in Windows), or a FILE* user data (say, from io.open()
), key
- The key name of the initial Lua table to write to disk.
This is usually a string, but it could be a number, too.value
- The value to write.alphabetical
- If true, each table's keys are sorted.
(Optional: Defaults to true.)indentLevel
- The number of tabs to indent each line.
(Optional: Defaults to 0.)maxIndentLevel
- The maximum number of nested tables allowed
in the write. If this value is exceeded, then no carriage returns are
inserted. (Optional: Defaults to 0xFFFFFFFF.)writeAll
- If true, writes all Lua objects out, including
function and user data information. (Optional: Defaults to false.)So, in a C++ application, an example usage of the serialization APIs might be:
LuaStateOwner state(false); state->DoString("GlobalTable = { 1, 2, 3, 4 }"); state->DoString("GlobalValue = 5"); state->DumpGlobals("c:\\dump.lua");
or like:
LuaStateOwner state; state->DoString("Table = { 0, 1, 2, 'Hello', nil, 'Hi', Yo = 'My Stuff', NobodysHome = 5, NestedTable = { 1, 2, 3, { 'String', }, { 'Table2' } }, { 'String1' } }"); state->DumpObject("c:\\dump.lua", "Table", state->GetGlobals()["Table"]);
Wide character support is built-in as a native LuaPlus type. While it is entirely possible to represent a wide character string using a regular Lua 8-bit clean string, there is no way of determining whether the given string is wide or not. The secondary problem involves the use of standard string functionality, such as the concatenation operator. If a wide character string is represented as a normal 8-bit Lua string, special functions would have to be written to perform operations on the string (i.e. concatenation of two Lua 8-bit clean strings which represent wide characters). Rather than require the user to keep track, a wide character string type is available.
Wide character strings can be entered into Lua script similar to the approach used by C code.
L"Wide characters"
By inserting an L
in front of the quote, the LuaPlus lexer creates a wide character
representation of the above string. If the string was entered as a regular Lua string,
the Unicode equivalent would be simulated as follows, and the string below
assumes a certain architecture's endianness.
"W\000i\000d\000e\000 \000c\000h\000a\000r\000a\000c\000t\000e\000r\000s\000\000\000"
In the event it is necessary to insert wide character codes in the wide
character string, an additional property of the L""
approach may be
used. 16-bit characters may be entered using hexadecimal notation, in the
same way as C:
L"Wide characters: \x3042\x3043"
A new Lua library, located in lwstrlib.c, has been added for the new functionality. In most respects, it mirrors the ANSI string library, lstrlib.c.
LUA_TWSTRING
type added. Mirrors
LUA_TSTRING
.print()
has been upgraded to take Unicode strings as input.tonumber()
can take a Unicode string as a parameter.tostring()
receives a Unicode string as input, it converts it to ANSI
and returns it.towstring()
added. If
towstring()
receives an ANSI string as input,
it converts it to Unicode and returns it.fh:read()
can read Unicode files/strings if the input string is Unicode.
The file must be opened in binary mode.fh:write()
can write Unicode strings.Much like wide character string, ANSI strings can use the hexadecimal character notation to insert bytes into the string:
str = "Hel\x80o"
This distribution replaces the #define
approach to memory allocation within Lua with a callback mechanism, where the memory allocators can be replaced on a
per Lua state basis. This allows a powerful mechanism to be employed to
adjust memory allocation strategies on a per state basis.
For purposes of better memory tracking, the realloc()
callback allows a void
pointer of user data, an allocation name, and allocation flags to be passed
along. All of these arguments are optional, but they are available if the
memory allocation callback needs them.
The only allocation flag available is LUA_ALLOC_TEMP
. A
memory manager could react to the LUA_ALLOC_TEMP
flag, for instance, by allocating
the code for the main function of a Lua file at the top of the heap. If
all other Lua allocations happen at the bottom of the heap, no holes will be
left in memory when the LUA_ALLOC_TEMP
flagged allocation is garbage collection.
The callbacks look like:
static void* luaHelper_ReallocFunction(void* ptr, int oldsize, int size, void* data, const char* allocName, unsigned int allocFlags) { return realloc(ptr, size); } static void luaHelper_FreeFunction(void* ptr, int oldsize, void* data) { free(ptr); }
The allocation functions must be assigned before a Lua global state is created, in a fashion similar to below. It is good practice to restore the previous callbacks.
lua_ReallocFunction oldReallocFunc; lua_FreeFunction oldFreeFunc; void* oldData; lua_getdefaultmemoryfunctions(&oldReallocFunc, &oldFreeFunc, &oldData); lua_setdefaultmemoryfunctions(MyReallocFunction, MyFreeFunction, myUserData); LuaStateOwner state; lua_setdefaultmemoryfunctions(oldReallocFunc, oldFreeFunc, oldData);
lua_boxpointer() and lua_unboxpointer() have the unfortunate disadvantage of decoupling their behavior from the lua_touserdata() call. If you box a pointer, you have to unbox the pointer. In the past, a boxed pointer was retrievable through lua_touserdata.
To that end, an implementation of the old lua_newuserdatabox() is included in the LuaPlus distribution as LuaPlus::NewUserDataBox(). Its value is retrieved via LuaObject::GetUserData() (or lua_touserdata()).
This section is out of date!
A whole host of functionality has been added to facilitate the optimization of memory usage in a tight memory environment.
luaM_setname()
macro added and is used internally to name groups of
allocations. The name is passed into the realloc()
callback
function and may be used to better categorize allocations.This section is out of date!
Basic type metatables are based heavily on Edgar Toernig's Sol implementation of unified methods.
In addition to standard Lua supporting metatables for tables and
userdata, a metatable per Lua's simple types (nil
,
boolean, number
,
string
, wstring
, and
function
) has been added. A string
and
wstring
, for instance, have indistinguishable len()
functions.
str = "Hello" wstr = L"Hello" print(str:len()) print(wstr:len())
The default method tables have been put into global names for convenience.
They are named like the type but with a capital first letter (Nil
,
Number
,
String
, WString
,
Function
, Table
,
Userdata
).
Method tables may be accessed from within Lua using the
getmethodtable()
function.
mytable = {} -- Save the old methods. tableMethods = getmethodtable(mytable) newMethods = { doNothing = function(self) end } -- Set the new methods. setmethodtable(mytable, newMethods) mytable:doNothing()
In C, methods may be retrieved using the following functions:
LUA_API void lua_getmethods(lua_State *L, int index); LUA_API void lua_getdefaultmethods(lua_State *L, int type); LUA_API void lua_setmethods(lua_State *L, int index);
A detailed discussion of the LuaPlus Call Dispatcher is found in this document.
Has functions for retrieving and setting text from/to the clipboard.
clipboard.gettext()
Retrieves the text from the clipboard and returns it as a string.
clipboard.puttext(text)
Adds the text string text
to the clipboard.
Heavily based on the LuaCom 1.0 (beta) implementation by Vinicius Almendra and Renato Cerqueira. For the moment, the original LuaCom.pdf file is in the Docs/ directory. There are a whole bunch of samples in the Test/ directory showing how some of the facilities of the COM module are used.
com.CreateObject(progID)
com.GetActiveObject(progID)
com.SafeArray()
Some basic file finding facilities. Usually, glob
is
sufficient for any file finds you might need.
FileFind.First(wildcard)
Returns a handle representing the first file matching wildcard.
FileFind.Next(self)
Retrieves the next file matching wildcard.
FileFind.Close(self)
Closes the file search.
FileFind.GetFileName(self)
Retrieves the file name of the currently matched file.
FileFind.GetLastWriteTime(self)
Retrieves the last write time as a time_t for the currently matched file.
FileFind.GetFileSize(self)
Retrieves the file size of the currently matched file.
FileFind.IsDirectory(self)
Determines if the currently matched entry is a directory.
More advanced I/O operations than the basic io library.
io.readall(fileName)
Returns a buffer containing the contents of fileName
.
If there was an error reading the file, [nil, errorMessage] is returned.
io.writeall(fileName, buffer)
Writes buffer
to fileName
.
If there was an error writing the file, [nil, errorMessage] is returned.
iox.access(fileName [, mode])
Returns 0
if the file has the given mode or -1
if
it does not. mode
can be one of the following:
mode
not specified - Does the file exist?r
- Is the file read-only?w
- Is the file write-only?rw
- Is the file readable and writable?iox.CopyFile(existingFileName, newFileName)
Copies existingFileName
to newFileName
.
Returns true
if the copy succeeded, false
otherwise.
iox.CreateDirectory(path)
Creates the specified path. All portions of the path up through the last backslash are created.
iox.DeleteFile(fileName)
Deletes the file specified by fileName
. Returns true
if the deletion was successful, false
otherwise.
iox.FileTimeToTime_t(arg1 [, arg2])
If arg1
and arg2
are specified and both are
integers, then they are assumed to be the low and high date/times of a
FILETIME
structure.
If arg1
is a string, it is assumed to be in a format scannable
by %I64u and will be put into the 64-bit component of the FILETIME
structure.
Returns an integer describing the time_t
representing the passed
in FILETIME
information.
iox.FindFirstFile(wildcard)
***
iox.FindNextFile()
***
iox.FindClose()
***
iox.FindGetFileName()
***
iox.FindIsDirectory()
***
iox.FindGetLastWriteTime()
***
iox.GetCurrentDirectory()
Retrieves the current working directory as a string.
iox.GetFileSize()
***
iox.GetWriteTime()
***
iox.MakeWritable()
***
iox.PathAddBackslash(path)
Adds a backslash to path
, if necessary, and returns the new path
string.
iox.PathAddExtension(path, extension)
Adds the extension
to path
, if path does not
already have an extension. Returns the new path as a string.
iox.PathAppend(path, extraPath)
Appends extraPath
to path
and returns the resulting
path as a string. A backslash is added between the two paths, if
necessary.
iox.PathBuildRoot(driveNumber)
Returns a root path from the given driveNumber
(where 0
is A:\
and 25
is Z:\
).
iox.PathCanonicalize(path)
Returns a string describing the canonicalized version of path
.
iox.PathCombine(path1, path2)
Returns a string describing the combined paths, path1
and
path2
. Relative paths are resolved in this function.
iox.PathCommonPrefix(path1, path2)
Returns a string describing the common prefix of paths path1
and
path2
.
iox.PathCreate(path)
Creates the specified path. All portions of the path up through the last backslash are created.
iox.PathDestroy(path)
Destroys the specified path removing all files in each destroyed directory.
iox.PathFileExists(path)
Returns true if the file exists, false otherwise.
iox.PathFindExtension(path)
Returns the numeric index of the '.' in the path's extension. Returns
nil
if nothing found.
iox.PathFindFileName(path)
Returns the numeric index of the beginning of the file name in the path.
Returns nil
if nothing found.
iox.PathFindNextComponent(path)
Returns the numeric index of the next component of the path (directory name
or file name). Returns nil
if nothing found.
iox.PathFindOnPath(path)
Returns the numeric index of the next component of the path (directory name or file name).
iox.PathIsDirectory(path)
Returns true
if the path is a valid directory, otherwise
false
.
iox.PathIsDirectoryEmpty(path)
Returns true
if the path is a completely empty directory,
otherwise false
.
iox.PathIsFileSpec(path)
Returns true
if the path has no path delimiting characters (a
colon or backslash), otherwise false
.
iox.PathIsHTMLFile(path)
Returns true
if the path's extension is a known HTML file
extension, otherwise false
.
iox.PathIsLFNFileSpec(path)
Returns true
if the path is not in 8.3 letter format, otherwise
false
.
iox.PathIsNetworkPath(path)
Returns true
if the path is a network path, otherwise
false
.
iox.PathIsPrefix(path)
***
iox.PathIsRelative(path)
***
iox.PathIsRoot(path)
***
iox.PathIsSameRoot(path)
***
iox.PathIsSystemFolder(path)
***
iox.PathIsUNC(path)
***
iox.PathIsUNCServer(path)
***
iox.PathIsUNCServerShare(path)
***
iox.PathIsUNC(path)
***
iox.PathIsURL(path)
***
iox.PathMakeAbsolute(path)
***
iox.PathMakeBackSlash(path)
***
iox.PathMakeForwardSlash(path)
***
iox.PathMakePretty(path)
***
iox.PathMakeSystemFolder(path)
***
iox.PathMatchSpec(path)
***
iox.PathQuoteSpaces(path)
***
iox.PathRelativePathTo(path)
***
iox.PathRemoveArgs(path)
***
iox.PathRemoveBackslash(path)
***
iox.PathRemoveBlanks(path)
***
iox.PathRemoveExtension(path)
***
iox.PathRemoveFileSpec(path)
***
iox.PathRenameExtension(path)
***
iox.PathSearchAndQualify(path)
***
iox.PathSkipRoot(path)
***
iox.PathStripPath(path)
***
iox.PathStripToRoot(path)
***
iox.PathUndecorate(path)
***
iox.PathUnExpandEnvStrings(path)
***
iox.PathUnmakeSystemFolder(path)
***
iox.RemoveDirectory(path)
Destroys the specified path removing all files in each destroyed directory.
iox.SetCurrentDirectory(path)
Sets the current working directory.
iox.SetWriteTime()
***
iox.Sleep()
***
Glob is a file globbing (matching) facility described in detail at http://www.codeproject.com/file/fileglob.asp. The files found are returned in a table at completion.
table = glob.match("**")
Even though popen() is available under Windows, it is horribly broken, is only unidirectional, and only works for a command-line app. The pipe module provides a facility whereby applications may use pipe facilities without these limitations.
pipe.popen(commandLine)
Returns a table with entries for stdin, stdout, and stderr. These file handles work as if they were opened through the io library.
pipe.pclose(popenTable)
Immediately closes the stdin, stdout, and stderr pipes. Normally, these
would just be garbage collected, but if the application needed them to be shut
down early, pipe.pclose()
is the way to do it.
pipe.lines(commandLine)
Similar to the io.lines()
facility. Used in a for loop to simplify
retrieving all the lines in a file (or in this case, pipe).
for line in pipe.lines("dir") do print(line) end
The windows module contains functions for manipulating the Microsoft Windows windowing system. Documentation will be forthcoming.
This section has been missing forever, and although all copyright headers were left in the source code from the people who wrote them, it is nicer to list everybody here.
Credit goes out to:


{% extends "base.html" %} {% block title %}
Medieval catalogues > UNIVERSITY AND COLLEGE LIBRARIES OF CAMBRIDGE > Donor documents > Will of Hugh Trotter, 31 August 1503; various
{% endif %}10 identified entries found.
All data was derived from the List of Identifications by Professor Richard Sharpe.
{% if not printing %}
A key to codes used in the List is available (opens in new tab).{% endif %}


Gateway
BOT
24-Jul-18 05:47 PM
[dscrdeql] <CombatWombat> @MySoulisNotForSale you got most of them look again
[dscrdeql] <CombatWombat> Well my ones anyway
[dscrdeql] <CombatWombat> Rains are good but this project is better
[dscrdeql] <CombatWombat> Rocky start with the exchange but the goals of this project are
(edited)
[dscrdeql] <CombatWombat> We should be much more excited about that
[dscrdeql] <MassimoStyle> Hello
[dscrdeql] <beastMode> good convo
[dscrdeql] <AndronicusBass-Founder> Anyone heard of the Australian bank commission investigation?
[dscrdeql] <AndronicusBass-Founder> us Aussies get shit done. Investigate the banks.
[dscrdeql] <NWhiskeyTango> Lol
[dscrdeql] <Jonathan> Nope, that's good though they should. Here in the states we just bailed the banks out with little to no stipulations
[dscrdeql] <CombatWombat> in reality the system isn't bad the problem is the system is corrupt and and people don't see how the system is actually going against what the system is supposed to do
[dscrdeql] <CombatWombat> from what I know pretty much every American president has broken the american constitution
[dscrdeql] <Jonathan> hard to have a good system if the fail point is always people
[dscrdeql] <Jonathan> true @CombatWombat
[dscrdeql] <CombatWombat> the system is far from perfect but the bigger problem is the people in power don't really follow it if that makes sense
[dscrdeql] <Jonathan> it does and it's the main problem with all hierachy systems, top rarely cares about what's below. It's why I really believe in decentralization (KMD, EQL, etc)
[dscrdeql] <c2k> yup
[dscrdeql] <AndronicusBass-Founder> It is possible to decentralise a government.
[dscrdeql] <Jonathan> Governments are good for country infrastructure (roads, bridges, parks, etc) and defense from the crazies but I don't think they should touch monetary policy. Here wallstreet wants capitalism when things are going well and socialism when things are going not so well
[dscrdeql] <c2k> agreed, it certainly is possible. but eventough its possicle, there needs to be a desire to do it...or a revolution. and it takes tiiiiimmmmmeeee. davinci knew it was possible to fly but it didnt come to fruition for quiet a while
[dscrdeql] <c2k> from the 1400's! lol
[dscrdeql] <CombatWombat> the people should have more power over the government
[dscrdeql] <CombatWombat> :EQLI:
[dscrdeql] <CombatWombat> haha
[dscrdeql] <Jonathan> one of my favorite movie quotes "People should not be afraid of their government, governments should be afraid of their people"
[dscrdeql] <AndronicusBass-Founder> @Jonathan Governments are perceived by people that infrastructure is a product of taxes. Taxes pay the interest that governments owe to central banks. You're not aware of that?
[dscrdeql] <Jonathan> I am but they don't spend that money on those things, at least here they don't
[dscrdeql] <AndronicusBass-Founder> True that bro. all gov is the same.
[dscrdeql] <Jonathan> Listened to that banking commission video @AndronicusBass-Founder - crazy but sounds very familiar
[dscrdeql] <AndronicusBass-Founder> no it's not my voice if that's what you may think.
[dscrdeql] <AndronicusBass-Founder> its a similar position for everyone
[dscrdeql] <Jonathan> sounds familiar meaning that the greed mentality happens here and appearently everywhere
[dscrdeql] <AndronicusBass-Founder> In developed countries we pay taxes to service the debt that governments increase consistently.
[dscrdeql] <AndronicusBass-Founder> loans and mortgages increase the broad money supply which is why groceries are damn expensive.
[dscrdeql] <AndronicusBass-Founder> fact! bank of England defined, and parliament debated it officially.
[dscrdeql] <CombatWombat> yep
[dscrdeql] <CombatWombat> how much does a house cost were you are bass?
[dscrdeql] <AndronicusBass-Founder> how many rooms?
[dscrdeql] <CombatWombat> say 3
[dscrdeql] <AndronicusBass-Founder> what land size?
[dscrdeql] <Jonathan> damn that's crazy
[dscrdeql] <CombatWombat> just a normal basic house nothing small nothing too big
[dscrdeql] <AndronicusBass-Founder> Liveable and no need for aircon or heater? or you want sub surface heating or your choice of colour exterior? Questions you need to have answered if you plan on building with equaliser. We got your back.
[dscrdeql] <donaldmathers> Hi there
[dscrdeql] <Jonathan> Hey @donaldmathers
[dscrdeql] <CombatWombat> a normal house in melb if you are lucky you could get one in a decent price for about 500k but in a good area prob about 600-800k
[dscrdeql] <CombatWombat> a normal house would be three bedroom garade air con heating small back yard and front yard
[dscrdeql] <beastMode> sry
[dscrdeql] <Jonathan> In australia dollars? @CombatWombat
[dscrdeql] <CombatWombat> obviously better areas more expensive
[dscrdeql] <CombatWombat> yeah Jonathan
[dscrdeql] <AndronicusBass-Founder> prices are goin up in south auz
[dscrdeql] <AndronicusBass-Founder> rent wise
[dscrdeql] <Jonathan> oh ok, was gonna say 500k usd here would get you a freakin mansion
[dscrdeql] <x2maano> dinner time
[dscrdeql] <x2maano>
[dscrdeql] <CombatWombat> @Jonathan houses are cheaper in America my uncle and aunty live in Mitchigun they came here for a visit few months ago
[dscrdeql] <CombatWombat> houses, petrol, smokes and food more expensive
[dscrdeql] <CombatWombat> bills are roughly the same
[dscrdeql] <CombatWombat> my aunty was saying the house we live in would go for about 200k in american in a decent area
[dscrdeql] <c2k> @Jonathan it always has been and always will be about location
[dscrdeql] <CombatWombat> here would be about 600+
[dscrdeql] <CombatWombat> oh yeah the poshy areas are real expensive average price in toorak for a house is 4mil lol
[dscrdeql] <MassimoStyle> Darn I missed the rain should have been more active
[dscrdeql] <SwimedDragon> Don't worry there's plenty enough
[dscrdeql] <CombatWombat> hey dragon
[dscrdeql] <c2k> its his first day in the room. i guess he doesnt know how much it rains in here. lol
[dscrdeql] <c2k> sweeeeeeet
[dscrdeql] <CombatWombat> level up
[dscrdeql] <c2k>
[dscrdeql] <donaldmathers> How’s everyone doing
[dscrdeql] <donaldmathers> Another long day at work for me
[dscrdeql] <NWhiskeyTango> Good here
[dscrdeql] <NWhiskeyTango> Except had to fisit the dentist this morning
[dscrdeql] <NWhiskeyTango> Vist
[dscrdeql] <NWhiskeyTango> Forget it lol
[dscrdeql] <c2k>
[dscrdeql] <NWhiskeyTango> Going to paint some metal.


Note: Listing branches or pull requests for a commit in the Commits API is currently available for developers to preview. See the blog post for more details. To access the new endpoints during the preview period, you must provide a custom media type in the Accept
header:
application/vnd.github.groot-preview+json
Warning: The API may change without advance notice during the preview period. Preview features are not supported for production use. If you experience any issues, contact your GitHub Enterprise site administrator.
Returns all branches where the given commit SHA is the HEAD, or latest commit for the branch.
GET /repos/:owner/:repo/commits/:commit_sha/branches-where-head
Status: 200 OK
[
{
"name": "branch_5",
"commit": {
"sha": "c5b97d5ae6c19d5c5df71a34c7fbeeda2479ccbc",
"url": "https://api.github.com/repos/octocat/Hello-World/commits/c5b97d5ae6c19d5c5df71a34c7fbeeda2479ccbc"
},
"protected": "false"
}
]


| Package | Description |
|---|---|
| org.drip.spline.params | |
| org.drip.spline.segment |
| Modifier and Type | Method and Description |
|---|---|
SegmentBestFitResponse |
SegmentStateCalibration.bestFitResponse()
Retrieve the Segment Best Fit Response
|
static SegmentBestFitResponse |
SegmentBestFitResponse.Create(double[] adblPredictorOrdinate,
double[] adblResponseValue)
Construct the SegmentBestFitResponse Instance from the given Predictor Ordinate/Response Pairs, using
Uniform Weightings.
|
static SegmentBestFitResponse |
SegmentBestFitResponse.Create(double[] adblPredictorOrdinate,
double[] adblResponseValue,
double[] adblWeight)
Construct the SegmentBestFitResponse Instance from the given Inputs
|
SegmentBestFitResponse |
StretchBestFitResponse.sizeToSegment(InelasticConstitutiveState ics)
Generate the Segment Local Best Fit Weighted Response contained within the specified Segment
|
| Constructor and Description |
|---|
SegmentStateCalibration(double[] adblPredictorOrdinate,
double[] adblResponseValue,
double[] adblLeftEdgeDeriv,
double[] adblRightEdgeDeriv,
SegmentBasisFlexureConstraint[] aSBFC,
SegmentBestFitResponse sbfr)
SegmentStateCalibration Constructor
|
| Modifier and Type | Method and Description |
|---|---|
double |
ConstitutiveState.bestFitDPE(SegmentBestFitResponse sbfr)
Retrieve the Segment Best Fit DPE
|
boolean |
ConstitutiveState.calibrate(ConstitutiveState csPrev,
double dblRightStateValue,
double dblRightStateQuoteSensitivity,
SegmentBestFitResponse sbfrState,
SegmentBestFitResponse sbfrQuoteSensitivity)
Calibrate the coefficients from the prior Segment and the Response Value at the Right Predictor
Ordinate
|
boolean |
ConstitutiveState.calibrate(ConstitutiveState csPrev,
SegmentResponseValueConstraint srvcState,
SegmentResponseValueConstraint srvcQuoteSensitivity,
SegmentBestFitResponse sbfrState,
SegmentBestFitResponse sbfrQuoteSensitivity)
Calibrate the coefficients from the prior Predictor/Response Segment, the Constraint, and fitness
Weights
|
boolean |
ConstitutiveState.calibrate(double dblLeftValue,
double dblLeftQuoteSensitivity,
double dblLeftSlope,
double dblLeftSlopeQuoteSensitivity,
double dblRightValue,
double dblRightQuoteSensitivity,
SegmentBestFitResponse sbfrState,
SegmentBestFitResponse sbfrQuoteSensitivity)
Calibrate the Coefficients from the Edge Response Values and the Left Edge Response Slope
|
boolean |
ConstitutiveState.calibrate(SegmentResponseValueConstraint wrvcStateLeft,
SegmentResponseValueConstraint wrvcStateLeftQuoteSensitivity,
double dblLeftSlope,
double dblLeftSlopeQuoteSensitivity,
SegmentResponseValueConstraint wrvcStateRight,
SegmentResponseValueConstraint wrvcStateRightQuoteSensitivity,
SegmentBestFitResponse sbfrState,
SegmentBestFitResponse sbfrQuoteSensitivity)
Calibrate the coefficients from the Left Edge Response Value Constraint, the Left Edge Response Value
Slope, and the Right Edge Response Value Constraint
|
WengertJacobian |
ConstitutiveState.jackDCoeffDEdgeParams(ConstitutiveState csPrev,
double dblRightStateValue,
double dblRightStateQuoteSensitivity,
SegmentBestFitResponse sbfrState,
SegmentBestFitResponse sbfrQuoteSensitivity)
Calibrate the coefficients from the prior Segment and the Response Value at the Right Predictor
Ordinate and calculate the Jacobian of the Segment's Response Basis Function Coefficients to the Edge
Parameters
|
WengertJacobian |
ConstitutiveState.jackDCoeffDEdgeParams(double[] adblPredictorOrdinate,
double[] adblResponseValue,
double[] adblLeftEdgeDeriv,
double[] adblRightEdgeDeriv,
SegmentBasisFlexureConstraint[] aSIBC,
SegmentBestFitResponse sbfr)
Calibrate the segment and calculate the Jacobian of the Segment's Response Basis Function Coefficients
to the Edge Parameters
|
WengertJacobian |
ConstitutiveState.jackDCoeffDEdgeParams(double dblLeftValue,
double dblLeftQuoteSensitivity,
double dblLeftSlope,
double dblLeftSlopeQuoteSensitivity,
double dblRightValue,
double dblRightQuoteSensitivity,
SegmentBestFitResponse sbfrState,
SegmentBestFitResponse sbfrQuoteSensitivity)
Calibrate the Coefficients from the Edge Response Values and the Left Edge Response Value Slope and
calculate the Jacobian of the Segment's Response Basis Function Coefficients to the Edge Parameters
|
| Constructor and Description |
|---|
BestFitFlexurePenalizer(InelasticConstitutiveState ics,
SegmentFlexurePenaltyControl sfpcCurvature,
SegmentFlexurePenaltyControl sfpcLength,
SegmentBestFitResponse sbfr,
BasisEvaluator lbe)
BestFitFlexurePenalizer constructor
|


| Class | ThoughtBot::Shoulda::Controller::ClassMethods::ResourceOptions |
| In: |
vendor/plugins/shoulda/lib/shoulda/controller_tests/controller_tests.rb
|
| Parent: | Object |
A ResourceOptions object is passed into should_be_restful in order to configure the tests for your controller.
Example:
class UsersControllerTest < Test::Unit::TestCase load_all_fixtures def setup ...normal setup code... @user = User.find(:first) end should_be_restful do |resource| resource.identifier = :id resource.klass = User resource.object = :user resource.parent = [] resource.actions = [:index, :show, :new, :edit, :update, :create, :destroy] resource.formats = [:html, :xml] resource.create.params = { :name => "bob", :email =><EMAIL_ADDRESS>:age => 13} resource.update.params = { :name => "sue" } resource.create.redirect = "user_url(@user)" resource.update.redirect = "user_url(@user)" resource.destroy.redirect = "users_url" resource.create.flash = /created/i resource.update.flash = /updated/i resource.destroy.flash = /removed/i end end
Whenever possible, the resource attributes will be set to sensible defaults.
| parent | -> | parents |
| parent= | -> | parents= |
| actions | [RW] |
Actions that should be tested. Must be a subset of VALID_ACTIONS (default).
Tests for each actionw will only be generated if the action is listed here.
The special value of :all will test all of the REST actions.
Example (for a read-only controller): resource.actions = [:show, :index] |
| create | [RW] | ActionOptions object specifying options for the create action. |
| denied | [RW] | DeniedOptions object specifying which actions should return deny a request, and what should happen in that case. |
| destroy | [RW] | ActionOptions object specifying options for the desrtoy action. |
| formats | [RW] |
Formats that should be tested. Must be a subset of VALID_FORMATS (default).
Each action will be tested against the formats listed here. The special
value of :all will test all of the supported formats.
Example: resource.actions = [:html, :xml] |
| identifier | [RW] | Name of key in params that references the primary key. Will almost always be :id (default), unless you are using a plugin or have patched rails. |
| klass | [RW] | Name of the ActiveRecord class this resource is responsible for. Automatically determined from test class if not explicitly set. UserTest => :user |
| object | [RW] | Name of the instantiated ActiveRecord object that should be used by some of the tests. Defaults to the underscored name of the AR class. CompanyManager => :company_manager |
| parent | [RW] |
Name of the parent AR objects.
Example: # in the routes... map.resources :companies do map.resources :people do map.resources :limbs end end # in the tests... class PeopleControllerTest < Test::Unit::TestCase should_be_restful do |resource| resource.parent = :companies end end class LimbsControllerTest < Test::Unit::TestCase should_be_restful do |resource| resource.parents = [:companies, :people] end end |
| update | [RW] | ActionOptions object specifying options for the update action. |


The actor shared his late mother had been discharged from St Helens Whiston hospital on November 13.
Patricia had major surgery in the first week of November before she was discharged from the hospital.
It is not known what she had surgery for in early November.
Johnny broke the news of her death on his Twitter account with his 410.4K followers on Tuesday, days after her death.
As he shared the news, the comedian paid tribute to his late mother as he admitted he was "incapable of processing" her death.
In a loving tribute, he described his late mother as a "bit of a character" and "the best".
The funnyman said he was "incapable of processing" her death.
He wrote: "With a kind of deep regret that I’m still incapable of processing, I have to confirm that Ma Vegas, Patricia, passed away last Sunday, peacefully in her sleep.
"To say she was a bit of a character would be too huge an underestimation. As a Mum I dare to argue I had the best x."
Johnny had a very close relationship with his late mother Patricia.


Local debugging for Python in PyCharm requires PyCharm's remote debugging functionality, which is only available in PyCharm Professional. After making sure you are running the Professional edition, follow these steps to start local debugging for Python in PyCharm:
lean backtest
command with the --debug pycharm
option.
$ lean backtest "My Project" --debug pycharm 20210322 18:58:23.355 TRACE:: Engine.Main(): LEAN ALGORITHMIC TRADING ENGINE v<IP_ADDRESS> Mode: DEBUG (64bit) 20210322 18:58:23.360 TRACE:: Engine.Main(): Started 6:58 PM


2006-12-25
2006-01-01
xforms-insert
4.4.1.a xforms-insert event
Activate the Insert A Date trigger below to fire the xforms-insert event. You must see an
xforms-insert message and the correct values must be output below.
Insert A Date
You must see the value "before" :
You must see the value "2006-01-01" :


{{todo.user}}'s To Do List
{{incompleteCount()}}
Add
Description
Done
Buy Flowers
Get Shoes
Collect Tickets
Call Joe
Show Complete


The highest proportion of student loan debt (the amount of debt held per student) is held by students at for-profit colleges [9.11.145], which are colleges that are not funded by taxes but instead depend on federal student aid (guaranteed by the government) and the tuition dollars that students pay to attend, often backed up by federal student aid. Contrast this situation with the vast majority of colleges and universities in the U.S., which are nonprofit institutions, which are usually run by a not-for-profit institution, religious organization, or government and hence often receive funding from taxes or a particular religious group.
in-context


|
|
|
|
|
|
|
SUM |
|---|---|---|---|---|---|---|
| {{oncomine_control_panel_summary.lrp1 | dashify}} | {{oncomine_control_panel_summary.lmna | dashify}} | {{oncomine_control_panel_summary.tbp | dashify}} | {{oncomine_control_panel_summary.myc | dashify}} | {{oncomine_control_panel_summary.hmbs | dashify}} | {{oncomine_control_panel_summary.itgb7 | dashify}} | {{sum | dashify}} |
| No Oncomine Control Panel data |


A Sweet (Potato+ Black Bean) Burger Recipe
Swwet baby potatos
I used to pay $12 for a vegan burger when I went out. Now, I can make it at home for a much cheaper price. Eating healthy and affordable :) — just what my college self loves(needs!).
Ingredients :
-2 tsp of salt -1 tbsp of dry garlic powder -1 tsp of dry parsley -1 tsp of black pepper -1/4 tsp of cayenne pepper -1/4 tsp of dry ginger -1/4 tsp of dry cumin powder -1 tsp of dry coriander powder -16 oz of dry black beans -1 small onion -1 small red pepper -Sweet potatoes
Directions:
- Soak the dry black beans in water overnight
- Turn on the stove + Put the beans in a pot with 3 cups of water for an hour until it’s cooked
- Drain excess water out
- Take the beans and add the ingredients listed in green
- Chop the onion + red pepper into little pieces
- Sauté the onion and pepper into a pan for 5 minutes
- SWEET POTATO TIME: Take how many sweet potatoes you want(I chose 2)
- Boil sweet potatoes in water for 15 minutes
- Peel skin
- Cut into tiny pieces
- Take the black beans and add the sautéd mixture and the sweet potatoes
- Mash the newly created mixture
- Make burger patties + cook on a pan


Unofficial WAD3 File Spec
Table of content
Introduction
The following file specification concerns the WAD3 file format used Valve's famous GoldSrc Engine. The file extension is ".wad". Contrary to the BSP v30 file format that has been derived from the Quake 1 BSP (v29) format, the WAD3 format is tecnically fully compatible with Quake's WAD2 files. WAD files are used to store game related files in some kind of archive. Somehow they seem to contain only textures, although they are capable of holding different kinds of data.
This file spec uses constructs from the C programming language to describe the different data structures used in the WAD file format. Architecture dependent datatypes like integers are replaced by exact-width integer types of the C99 standard in the stdint.h header file, to provide more flexibillity when using x64 platforms. Basic knowledge about textures in the BSP file is recommended.
#include <stdint.h>
Header
Like almost every file also a WAD file (WAD3) starts with a specific file header which is constucted as follows:
typedef struct _WADHEADER
{
char szMagic[4]; // should be WAD2/WAD3
int32_t nDir; // number of directory entries
int32_t nDirOffset; // offset into directory
} WADHEADER;
The first 4 bytes of a WAD archive identify the file (the so-called magic number) with the 3 character string "WAD" followed by a version numer as ASCII char. Compatible formats include "WAD3" as well as "WAD2". As with the BSP file also a WAD file starts with some kind of directory containing entries similar to the lumps of the BSP file. The major difference is that a WAD file may have an arbitrary number of entries. This value is stored in the nDir member of the header followed by the offset to the array of directory entries within the file, which is usually located somewhere at the ned of the WAD file.
Directory entries
The directory of a WAD file is basically an array of structures. Every archived file has an associated entry in this directory:
#define MAXTEXTURENAME 16
typedef struct _WADDIRENTRY
{
int32_t nFilePos; // offset in WAD
int32_t nDiskSize; // size in file
int32_t nSize; // uncompressed size
int8_t nType; // type of entry
bool bCompression; // 0 if none
int16_t nDummy; // not used
char szName[MAXTEXTURENAME]; // must be null terminated
} WADDIRENTRY;
The first value is the offset of the raw data of the archived file within the WAD file followed by the size of data used by the it in its current form. Additionally nSize stores the size of original file, if it has been compressed. This is indicated by the bCompression boolean value. If it is false, no compression is used which is mostly the case. The nType member would give as information about the type of file, that is associated with this entry. As WAD files usually contain only textures, this information may be ignored. The nDummy short integer is not used when loading textures and i have not found any information about this member. Finally the entry contains a name for the file which can be a string of maximum 16 chars including the zero termination. In case of textures, this is the name referred by the BSPMIPTEX structs of the BSP file.
Files in a WAD File - Textures
The actual files in the WAD archive, the textures, also start with a file header which may look familiar:
#define MAXTEXTURENAME 16
#define MIPLEVELS 4
typedef struct _BSPMIPTEX
{
char szName[MAXTEXTURENAME]; // Name of texture
uint32_t nWidth, nHeight; // Extends of the texture
uint32_t nOffsets[MIPLEVELS]; // Offsets to texture mipmaps BSPMIPTEX;
} BSPMIPTEX;
This struct equals the one of the BSP file exactly. The name of the texture as not needed actually, as it equals the file name in the directory entry. The next members are of particular interest. They give the size of the texture in pixel as well as the offsets into the raw texture data. The first value of the offset array points to the beginning of the original texture relativly to the local header (the BSPMIPTEX struct). From this point follows a nWidth * nHeight bytes long array of indexes (0-255) pointing to colors in a color table. The other three offsets are used the same way, but with the diference that the width and height of the image are cut in half with every further offset. These represent the so-called mipmap levels of the original image. After the last byte of the fourth mipmap there are two dummy bytes followed by the actual color table consisting of an array of triples of bytes (RGB values) with 256 elements. The indexes of the image are plugged into the color table array to receive the corresponding RGB color value for the pixel.


Exercise tracker
Create a new user
POST /api/exercise/new-user
Name
Submit
send
Add exercises
POST /api/exercise/add
userId
description
duration(mins.)
Submit
send