Function values have the following methods defined for them:
| partialInverse | Returns the inverse or partial-inverse of the function. If the function cannot be fully inversed for a given input to the inverse-function, running the inverse-function will return the partial-inverse of the function for that input. The partial-inverse of a function uses a well-defined, tho arbitrary, method for choosing one original-input for a given original-output in the case where there is a one-to-many relationship from outputs to inputs. If the function cannot be fully or partially inversed for a given input, an exception will be thrown. |
| sci | This returns the number as a scientific notation string (e.g. '4.334*10^6') |
| engr | This returns the number as an engineering notation string. Uses the character 'e' to represent base-10 exponentiation (e.g. '4.334e6'). |
| roman | This returns the number as a roman numeral string. |
| english | This returns the number as a plain english string. |
| engOrdinal | This returns the number as an english ordinal string. |
| sep | num character | Returns the number modified so that its string representation has separaters every num digits.
character is optional, but if included sets the separater character. The default character is a comma.
For example: wout 1000000.sep[3] would print 1,000,000 and wout 11110001.sep[4 "'"] would print 1111'0001 .
|
| base | num | Returns the number modified so that its string representation is in base num .
For example, wout 7.base[2] prints 111
|
| places | num | Returns the number modified so that its string representation has a maximum of num decimal places.
|
| fpad | num | "Front padding". Returns the number modified so that its string representation has at least num digits, padded with 0s if neccessary.
|
| bpad | num | "Back padding". Returns the number modified so that its string representation has at least num digits, padded with 0s if neccessary.
|
A complex number.
Methods:
|
|||
| The type for a window. Used to access window functions. | |||
| An acyclic graph. Inherits from graph, but ensures that the data structure remains free of cycles and ensures that each node (other than the head) has one parent and one parent only. It has a member called root that points to the root/head of the tree. | |||
A data structure that can be used to represent complex relationships between data. Nodes must have a value or type associated with them. It has the following members:
|
| tuple |
|
| screens | A list of visual output devices (monitors). Each element in the list has the following members:
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| win | Object for creating windows. Has the following method:
The
win objects have the following method:
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| view | Object for creating 2d projections of a set of 3d shapes. Has the following method:
The
view objects have the following method:
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| color | An object for handling colors. Has the following members:
Color objectsA color object represents a single color. Color objects have the following members:
Color objects have the following methods:
Color spacesA color space is a mathematical describing how to represent colors. Lima supports arbitrary color spaces and allows seamless use of color spaces while maintaining a single unambiguous color representation.
RGB members of color-objects:
|
| red | Represents the red portion of the color (a value between 0 and 1) in the RGB color model. |
| green | Represents the green portion of the color (a value between 0 and 1) in the RGB color model. |
| blue | Represents the blue portion of the color (a value between 0 and 1) in the RGB color model. |
Note that modifying any of these members modifies the object they came from.
color.cs['cmyk']
| cyanPart magentaPart yellowPart keyPart | Returns a color made from the passed color values. |
colorObject.cs['cmyk']
| cyan | Represents the cyan of the color (a value between 0 and 1) in the CMYK color model. |
| magenta | Represents the magenta of the color (a value between 0 and 1) in the CMYK color model. |
| yellow | Represents the yellow of the color (a value between 0 and 1) in the CMYK color model. |
| key | Represents the key (blackness) of the color (a value between 0 and 1) in the CMYK color model. |
color.cs['hsl']
| huePart saturationPart lightnessPart | Returns a color made from the passed color values. |
colorObject.cs['hsl']
| hue | Represents the hue of the color (a value between 0 and 360) in the HSL color model. |
| sat | Represents the saturation of the color (a value between 0 and 1) in the HSL color model. |
| light | Represents the lightness of the color (a value between 0 and 1) in the HSL color model. |
Object for representing color patterns like images.
Has the following method:| binaryData params | Creates a texture from binary data (like a bmp file). Params describes how blend each pixel, and how to extend the image in places where it doesn't have any more binary data (ie where it goes off the bit map - clamp,repeat,transparent,etc?) |
The view
object returned by the bracket-operator above has the following members:
| image | params | Params should contain some way to map a texture object to pixels - a discrete matrix of colors |
A shape with color.
Inherits from shape
.
| aShape startingPoint texture blendingOptions |
What blending options can there be? |
string
variable, sain will parse it according to the type.
It ignores characters that don't match the form of the given variable type, then starts inputing when the characters match, then stops inputing when the characters don't match, and goes on to the next variable.
Default input is stdin. "sain" stands for "Safe in".
| the regular sizeof() function in C. Returns the static size in bytes of a variable, array, or type. | ||
| Returns the size in bytes of a variable, array, or type including its static size and the dynamic size of any memory pointed to by a ref member. | ||
| listset | int[min max step] | Returns a list of all values between and min and max. The first value in the list is min, the second value is min+step, the third is min+2*step etc. No value above max is included in the list, although max may be included as the last in the list (if the step lands exactly on max). This can be used to make custom types with special ranges of values, for example listset[0 9 1].enum is a the natural number type - values 0 through 9, or listset[0 1 1/00] is the set of all possible values for probability (ie 0 to 100%) (the 1/00 indicates infinite precision - in other words, an infinitesimal step ). |
| floatset | fracVals expVals base | Returns a list of floating point values.
fracVals is the list of possible mantissa values (the value multiplied by the power of the base),
expVals is the list of possible exponents, and
base is the base for the exponent.
This is loosely based on and is an extension of the ieee single-precision and double-precision floating point standards.
For example, floatset[listset[-2+1/00 2-1/00 1/2^23] listset[0 2^8-1 1] 2] is the single-precision standard (omitting special values like NaN, infinity, and denormal floating point numbers).
|
| joinDimension | n list1 list2 | If list is a matrix or multidimensional array then joinDimension is a function that joins another multidimensional array at a specific dimension.
and |
| cartesian | lists.. | Cartesian product.
This returns the list of all possibilities for combining elements of all the input lists in the order they appear.
The cartesian product is not commutative. This function is useful for creating tuples and other arrays.
For example, |
| recartesian | cartesianLists.. | Combines the cartesianLists into new cartesian lists of combinations.
For example, recartesian[cartesian[x y] cartesian[z z2 z3]] is the same as cartesian[x y z z2 z3] .
This allows you to easily recombine already-computed cartesian lists with new dimensions.
To combine a single list of values into a cartesian list, do something like this:
recartesian[cartesianList cartesian[regularList]] .
|
| chooset | n list | If n is an integer, returns the number of combinations of list for choosing n (non-replaceable) elements of list .
Is the physical manifestation of the Choose Function in that
the Choose Function counts the number of elements in the list returned by chooset .
If n is a list of integers, returns a concatenation of the chooset for each integer in n .
|
| rchooset | n list | Like chooset but allows elements to repeat.
|
| comboset | places list | If places is an integer, returns a list of all the unique ordered combinations of each element of list, for the given number of places.
If places is a list of integers, returns a concatenation of the comboset for each integer in places
(a list of all the unique ordered combinations of each element of the list for each value in places ).
comboset[3 L] is the same thing as cartesian[L L L] .
|
| powerset | list | Returns the powerset of the list.
Same as comboset[0..list.len list]
|
| assarray | typeTupleList | Used for defining the possible values of arrays where certain keys can only take on certain values (defined by each type tuple in typeTupleList). |
| massarray | outType keys | Used for defining the possible values of arrays where multi-dimensional associative array, where outType is the classic "type" of the multi-dimensional array (the innermost type in the system of arrays), and keys is a list of types where each type in the list is the key-type for a given dimension of the multi-dimensional array. |
| derivative | ||
| partial derivative | ||
| limit | ||
Declares the input set of variable names as constants and initializes them with different values in order. The type is determined by the value assigned to the first defined constant. If no value is assigned, the default type is int, and the default value is 0. The difference between the value assigned to the second constant and the first constant determines the amount added to every subsequent constant (using the + operator: overloaded or not). If the second constant is not assigned to, the default increment is 1 (if the type being enumerated isn't compatible with adding 1 to it, then the second constant must be assigned to). Any subsequent constant may be assigned to, and incrementing will continue from that value. If two consecutive constants are assigned to, the increment amount is changed accordingly. The type of the enumName is the typeset[list] of all the constants enumerated in that type. (for example, a pn enum is: "typeset[{0 1 2 3 4 5}]".
|
| unReado | This allows you to use the variable as if it were not . |
| unConst | This allows you to use the variable as if it were not . This is like a "const_cast" in c++. |
| pi | Pi to a given number of digits .
For example, 50pi is pi to 50 digits.
If no integer is given, pi is the closest flo value to pi.
|
| e | Euler's number to a given number of digits .
If no integer is given, e is the closest flo value to Euler's number.
|
| intBitlist | There are no bitwise operators in standard Lima.
If you need/want to do them for some reason, you need to convert the numbers you want to operate on into bit lists.
Bit lists are always in little endian form (index 0 is the least significant byte).
var bitlist = 234.bitlist
bitlist.insert[0 0] ;; bitwise left logical shift
bitlist.cut[0] ;; bitwise right logical shift
Extra members in a bitlist:In addition to the regular members and operators in an object, there are a couple additional ones for a bitlist.
|
||||||
| floatBitlist | |||||||
| doubleBitlist |
| { } | An object literal. Members available by default for any object:Special members only available inside object literals:Operators defined for objects:
Methods available by default for any object:
Custom methods available by default for any object:
Special constructs that can be used inside the of an object: |
| compile | targets string | Compiles a string to a given set of targets. It returns an associative array associating each target with a byte string containing code for the target. |
| parse [parameters: statements cull [(wordform): statements wordform-blocks else: statements ] statements and cull blocks ] | Creates a parser function.
It has A matches the sequence to a wordform.
Inside the , the The parens around the wordform are optional if there is only one piece to the wordform. If one of the If more than one wordform matches, the longest wordform is taken.
If there are more than one matching wordforms with the same length, the first one is taken (looking from top to bottom).
If nothing matches, the function throws a |
| parseShort | Exactly like a normal , but looks for the shortest match in each (rather than the longest). |
| parseEager | Exactly like a normal , but accepts the first match it finds in each (trying each wordform from top to bottom). |
| parse.mismatch | Pseudo member that throws a parser mismatch exception to indicate the cull option didn't match. |
| parse.if | Custom function that acts just like a regular if statement,
but if none of the if 's conditionals match then a mismatch exception is called.
|
| parse.n | Convenience function that parses a string repeated a range of a number of times.
cull
[x=parse.n['rr' 0 5]:
]
;; matches 'rr', 'rrrr', '', but not 'rrr' among other things
;; and is the same as
cull
[@x: parse.if
[rchooset[0...5 'rr']:
]
]
|
| every | |
| tween |
Roman numeral example:
var romanNumeralToInt = parse[
var result=0
cull x=parse.n['M' 0 3]:
result += 1000*x.len
cull:
'CM': result += 900
'CD': result += 400
x=parse.n['D' 0 1] y=parse.n['C' 0 3]:
result += 500*x.len + 100*y.len
cull:
'XC': result += 90
'XL': result += 40
x=parse.n['L' 0 1] y=parse.n['X' 0 3]:
result += 50*x.len + 10*y.len
cull:
'IX': result += 9
'IV': result += 4
x=parse.n['V' 0 1] y=parse.n['I' 0 3]:
result += 5*x.len + y.len
ret result
]
// scratchpad test
var romanNumeralToInt = parse[
n["M" 0..3]
("CM" | "CD" | n["D" 0..1] n["C" 0..3])
("XC" | "XL" | n["L" 0..1] n["C" 0..3])
("IX" | "IV" | n["D" 0..1] n["C" 0..3])
]
romanNumeralToInt['MCXXIV'].result
In regex using javascript, this would be:
function romanNumeralToInt(romanNumeral) {
var match = romanNumeral.match(
'^(M?M?M?)'+
'((CM)|(CD)|((D?)(C?C?C?)))'+
'((XC)|(XL)|((L?)(X?X?X?)))'+
'((IX)|(IV)|((V?)(I?I?I?)))$'
)
var result=1000*match[1].length
if(match[3].length != 0) result += 900
if(match[4].length != 0) result += 400
if(match[5].length != 0) result += 100*match[7].length + 500*match[6].length
if(match[9].length != 0) result += 90
if(match[10].length != 0) result += 40
if(match[11].length != 0) result += 10*match[13]) + 50*match[12].length
if(match[15].length != 0) result += 9
if(match[16].length != 0) result += 4
if(match[17].length != 0) result += 1*match[19].length + 5*match[18].length;
return result
}
romanNumeralToInt('MCXXIV') // returns 1124
In PEG.js, this would be:
romanNumeralToIn = th:thousands h:hundreds t:tens o:ones {
return th + h + t + o
}
thousands = m:('M' 'M'? 'M'?) {
var ms = m.filter(function(m){return m!==null}).length
return 1000*ms
}
hundreds = 'CM' {return 900}
/ 'CD' {return 400}
/ d:'D'? c:('C' 'C'? 'C'?) {
var cs = c.filter(function(c){return c!==null}).length
return d?500:0 + 100*cs
}
tens = 'XC' {return 90}
/ 'XL' {return 40}
/ l:'L'? x:('X' 'X'? 'X'?) {
var xs = x.filter(function(x){return x!==null}).length
return l?50:0 + 10*xs
}
ones = 'IX' {return 9}
/ 'IV' {return 4}
/ v:'V'? i:('I' 'I'? 'I'?) {
var is = i.filter(function(i){return i!==null}).length
return v?5:0 + is.length
}
match
indexes?) and not much longer.
The gotchas and obscurities of regex make it a pain to use and a hazard to maintain, and there's absolutely not nice error messages in that parser without a lot of extra work.
By contrast, the PEG parser will give nicer error messages, but has limited means of specifying repeated clauses and no parameterization.
Also, in Lima all this symmetry could be combined into logical parts:
var romanNumeralPlaces = {
1000:{primary='M' fiveTimesPrimary='' tenTimesPrimary=''} ;; thousands
100: {primary='C' fiveTimesPrimary='D' tenTimesPrimary='M'} ;; hundreds
10: {primary='X' fiveTimesPrimary='L' tenTimesPrimary='C'} ;; tens
1: {primary='I' fiveTimesPrimary='V' tenTimesPrimary='X'} ;; ones
}
var romanNumeral = parse[
int result:
result=0
var sum
df romanNumeralPlaces place weight: ;; loop through each decimal place
cull[
romanNumeralPlace[place... sum]:
result += weight*sum;
]
]
var romanNumeralPlace = parse[
primary fiveTimesPrimary tenTimesPrimary result:
var[lowerChar primaryString]
cull[
primary tenTimesPrimary: result += 9
primary fiveTimesPrimary: result += 4
y=parse.n[fiveTimesPrimary 0 1] x=parse.n[primary 0 1]:
result += x.len + 5*y.len
]
]
parse
can allow for much shorter (and more readable) code than either regex or even a full-fleged parser generator like YACC/Lex or PEG.
Tho some of these things would be better to be done in more than one line, this demonstrates how Lima uses some basic constructs to describle an infinity of possibilities.  A translator is a function that takes one input - a value, to translate - and returns a value in another language. The value would be in some standard format, say a string in english or an integer. The translator function itself could be as simple as a map that can only translate specific phrases (similar to localized property files in Java), or can be as complex as a full langauge translator able to translate arbitrary structures.
dateTranslator.from['en'].to['en'].translate['monday']
dateTranslator.from['en'].to['en'].translate['am']
var spanishTranslator = translatorFactory.from['en'].to['es']
spanishTranslator.translate['one'] ;; would return 'uno'
var romanjiTranslator = translatorFactory.from['en'].to['ja' 'romanji']
romanjiTranslator.translate['one'] ;; would return 'ichi'
var smartTranslator = englishTranslatorFactory.context['businessMumboJumbo']
smartTranslator.translate["Let's discuss that later"] ;; might return "Let's table that for now" or "Lets put a pin in that"
smartTranslator.translate["What is your request?"] ;; might return "Whats the ask?"
They don't have to neccessarily be just for words, you could use them for time formats or other locale-specific formats for things.
translator.translate[5] ;; could return "five"
translator.translate[{animal="dog" feet=4}] ;; could return "perro tiene cuatro patas"
currencyTranslator.lang['en' 'US'].translate[400345000.045] ;; would return "400,345,000.45"
currencyTranslator.lang['en' 'CA'].translate[400345000.045] ;; would return "400,345,000.45"
currencyTranslator.lang['no'].translate[400345000.045] ;; would return "4.294.967.295,000"
moneyTranslator.lang['en'].currency['eur'].translate[500.34] ;; would return "�500.34"
moneyTranslator.lang['lt'].currency['eur'].translate[500.34] ;; would return "500,34 �"
== FEATURE FREEZE (things to think about, but not to implement in the first version) ==
Make sure you're doing characters/graphemes correctly:
* site.icu-project.org/home
* http://userguide.icu-project.org/intro
* https://en.wikipedia.org/wiki/International_Components_for_Unicode
An alternative object creation macro that allows property reordering so you can define things in logical groupings
without worrying about where their dependencies are defined. This requires an explicity way to figure out which
properties each statement is defining (which isn't generally possible in a normal object). Eg every defined property
is defined with a bare colon (no macro wrappings or anything):
configObject[
rightMargin: width-leftMargin+position.x
leftMargin: width/10
position: {x=30 y=40}
width: 50
height: 100
]
Maybe make a typecond macro that matches types (that then can be used during static analysis), or maybe just use cond:
cond typematch[v]
a: ...
b: ...
Have a way to bind an attribute for a whole module (rather than just setting for a particular call-stack).
== interface-locked objects ==
interface-locked objects - have a way to lock an object into a particular interface, so that even if that object has additional functionality, it can't be accessed through the interface-locked reference. This is so you can ensure strict adherance to interfaces (like you're forced to in java). Example:
var x = {
var[a = 5 b = 10]
}
var interface = {var a}
var lockedX = interface.lock[x]
lockedX.a ; 5
lockedX.b ; error
lockedX.a = 8
x.a ; 8
This could be called 'downcast' (vs a normal cast which is an upcast)
== rethinking generics ==
Would it be possible to have capture types from parameters in Lima? Eg:
int x = 5
frac y = 3.4
var f = fn list[?] x ? y:
x.=ins[y]
fn![getType[a]][a:] = fn a:
ret
Could use a macro:
fn ptype[T list[T] x T y]:
x.=ins[y]
ptype T:
fn![T] x = fn T a T b:
ret a+b
Except how does it then know what T will be? Maybe you can grab the type off any object:
fn! x = fn a b:
assert[meta[a].type.values.has[b] & meta[b].type.values.has[a]]
var result = a+b
assert[meta[a].type.values.has[result]
However, this won't affect dispatch.. maybe you need a way to relate types within dispatch.
type.cond[meta[a].type.values.has[b]
== debugger UI ==
Highlight the whole statement that is currently being executed (which might be part of a line or more than one line) *and* the operation/function currently being executed in a different color, so you can easily see where things are at.
== other ==
Maybe pull the number formatting into a standard number formatting module
Maybe allow overriding ~ and ~> if you inherit from a reference: {mix[someRef~]}
Question: what do you do about attribute name collisions?
* Eg. What if a submodule requires a same-named attribute that a supermodule defines
Answer: The supermodule should be aware of the submodule's required attributes and shouldn't use that name
* Eg. But what if the submodule changes later to require that name?
Answer: Perhaps there can be some module upgrading analysis that can warn the programmer about a case like that.
When you build, it could analyze the modules that directly use attributes and complain if a module that wasn't using an attribute starts using it?
* Eg. What if an objects methods are given a different attribute value than the object's constructor?
Answer: The object should grab a copy of that attribute's value in the constructor
* What do you do about running module definitions? Do you have to surround the module loading in an attribute block as well?
* probability and value duality/multiplicity - maybe call it something like unsurity or .. i like multiplicit value
* how do you describe a probability map that doesn't have full information?
* Like lets say you know that a value from 0 to 3 is returned 90% of the time, but you're not sure what happens the other 10% of the time
* It might have to provide a range of possibilities, especially if you want the probabilities over a range that covers
some knowns and some unknowns, for example (using the same 90% 10% example) if you want to know the probability that you get
a value from 0 to 5, the answer would be between 90% and 100%.
* this goes back to an object representing a set of values
* numbers could be extended to be sets, and operations like + and * can operate on all the members,
while testing operations like < and == can mean "are all the members less than?" or "are all the members equal to?"
and you'd have to have separate operations to describe "are some of the members less than" etc.
* A scratchpad example of what it might look like for you to "know that a value from 0 to 3 is returned 90% of the time, but you're not sure what happens the other 10% of the time":
probability.mass[
ret {
0 .. 3 : .9 ... 1
else : 0 ... .1
}
]
or maybe
probability.mass[
ret {
0 .. 3 : .9
else : 0 .1
}
]
* You should be able to get an AST representation of any lima object, as well as be able to get a string representation
* maybe remove con.cr and con.bs and add an encoding object for ASCII that has those available
* why?
* Think about how you would be able to put in dependency constraints into a system, something like private/public kinds of things in classes, but at a higher level.
Like saying that a particular module can access some set of other modules, but not others. Strong coupling is a huge problem in programming
* If we remove the restriction that binary operators can't return macros, how will lima decide how to execute an expression
that has a macro as the second operand of a binary operator?
* eg a^macroB:{macroArgument1}*macroC:{macroArgument2}+d
since macroC needs to be evaluated before we can know whether the * has a higher or lower precedence than ^,
if ^ returns a macro, macroC might not ever be evaluated at all
* The best answer is to run the macro as an isolate and evaluate the result
* Nixed ideas:
* This could be resolved if a constraint was introduced: macros can't mutate outside state (so that it can be evaluted and disgarded)
* The answer is: if you can't resolve it, ask the programmer
* Maybe stack traces should shorten paths (eg base everything on the main executable path
* think about whether to add a function 'guarantee' (maybe with an easier to type name) that allows you to do things like
put time constraints on a block of code (say, to guarantee that the time between an event happening and outputting of
something takes between x and y milliseconds)
* Lima probably needs a way to query the system for available resources (cores, cpu availability, memory availability, power avilability, etc)
* look at Closure Protocols and protocol-based inheritance/polymophism
* badly written article: http://jeditoolkit.com/2012/03/21/protocol-based-polymorphism.html
* consider adding a timeout function:
timeout 0.03: ;; 30 milliseconds
;; do something
else:
;; timeout handling
* Think about what DNS features are available (http://www.xbill.org/dnsjava/dnsjava-current/examples.html)
* getting the current computer's ip address and/or name
* setting(?) MX records
* getting the version of the remote server
* zone transfer
* DNS dynamic update (?)
* think about using objects' identies as enums and other things that need a unique identifier
* objects' identies as in ??
* That way you can ask if something is actually the specific error you're looking for (for example) instead of just an error that looks the same
* revisit enums (in the concepts section) with this in mind
* possibly note that lima does *not* use delegation although it does use prototypical inheritance
* Despite many stupid things in ambienttalk, they describe prototypical inheritance well:
AmbientTalk�s object instantiation protocol closely corresponds to class instantiation in class-based languages.
The major difference lies in the evaluation context of the init method: in a class-based language,
the constructor is ran in the context of an empty object, freshly allocated from the class blueprint.
In AmbientTalk, the init method is ran in the context of a shallow copy of an original object.
Hence, in the init method, fields do not necessarily contain nil values: they have the value of the clonee.
This can sometimes be useful to express the state of a clone as a delta w.r.t. the state of its clonee.
* lime (lima's package manager) should have the following functionality (commandline or as a module):
* check what libraries are out of date (and what the version differences are)
* automatically update to the highest version in the same major version number for each module
* e.g. if a module has the versions: 1.0.0, 1.0.1, 1.1.0, 2.0.0, 2.0.1, and the current version is 1.0.0, doing this will upgrade to version 1.1.0
* consider adding a method v and changing keys to be k on lists that would be used like this:
x = {1 2 3}
x.v[0] == 1 & x[[v==2]][0] == nil & x[[v==2]].v[0] == 2
* this would be so that things like filter and find that return keys unmodified can be used more easily
x.v[y] == x[x.k[y]]
The alternative is to sort by key: x[[v==2]].sort[k][0] - which isn't sooo bad
* for the package management system, allow people to sign up to receive updates on modules that *their* modules require - so people can be alerted to update appropriately
* lima - maybe have every try-catch automatically roll back everything that happened inside it if an exception happens
* think about this more
make a crypto library that doesn't suck for lima:
* Look at how its done here: https://github.com/cryptosphere/rbnacl - particularly useful is the "what this does/what it expects from you" parts
Should have the basic parts:
* SecretKeyCryptor
* nonce
Scratchpad:
salt - needed for password protection (different value stored with each password hash)
nonce - needed for any encryption (there to ensure every message is reasonably unique)
* Make sure you give clear options for cipher modes for algorithms that can use multiple cipher modes
* look up key derivation techniques and evaluate whether any are standard enough to include in the library.
* Also need to pay attention to message padding or key padding.
* Having something like the randomizer specified using parameters indicating how random you need/want it to be may not work with encryption. It would only work if all encryption and decryption is done only using the program at hand (which is probably not a good assumption).
* Maybe have something like:
crypto.enc[message nonce "m+n"]
where
"m+n" is a pattern indicating where the nonce goes.
This would allow flexibility and preciseness of nonce placement while ensuring there *is* in fact a nonce.
You could always get around this by passing a blank nonce. Not sure how reasonable this is
* Make lima's package format available as easy libraries for all popular languages so they will use it too.
Then make a translator into lima for some of them - which means you could load say ruby or c or python source
files and use them in a lima program for free
* What texture params are there?
* what texture.image params are there?
* What cshape blending options are there?
* what about alpha channels on colors?
* organize your list of custom functions (and other things) into sections
* or possibly get rid of the custom function section and just have cateogries like you already do for
* functins and methods
* operators
* etc
* probably implement atomic blocks using software transactional memory (as at least one possible piece)
* This is where statements are executed optimistically logging all state changes and
consistency is checked at the end (to make sure no other source has Fd with the state during that time)
and if something has Fd with it, then everything is rolled back
* apparently this requires that all the statements only have revokable actions
* but maybe you can make everything revokable by waiting to execute output until the end of the atomic block
* while this restricts what can be done in atomic block, maybe it simply doesn't make sense to have
temporally sequential activity executed "atomically"
- since its technically not possible to send a request and receive a response at the same time (atomically)
* write a conecpt for inaccuracy optimizations
* consider the idea that lima doesn't need any syntactic sugar - in fact syntactic sugar might indicate a problem in a langauge.
It also creates a problem - redundant ways to define things
* Lima doesn't need syntactic sugar because it has semantic sugar - ie arbitrary custom functions that can be defined by the user
* maybe Note that lima's mix and use inclusions and exclusions are a lot like trait imports in AmbientTalk http://soft.vub.ac.be/amop/at/tutorial/modular
* Think about ambienttalk's concept of object "tagging" (like empty interfaces in java) - might be a good concept for certain constraints in Lima
* http://soft.vub.ac.be/amop/at/tutorial/modular
* this could be implemented by requiring that an object explicitly inherit from a particular object somehow
More precisely define interface typing so that an object that had a function that will take a var matches the interface of A function that takes an int
* Possibly when two operators conflict and can't be proven one way or the other to have the same affect,
Run them both in isolation and if they both produce the same result, do it
If they don't, or if they create messages to outside the system that might change the state of the outside world,
then fail.
* robbert suggested giving the programmer some control over whether they want an operator to fail if it can't prove the functions are equal or whether they want to run both functions and ensure that the result is equal (which would be pretty non-performant)
* write a copyright license that allows lima to be freely used, but stipulates that
A. I be given credit for the language design
B. To be called Lima or anything like Lima, the implementation must match the spec (including giving the correct output for a test program), and
C. may not introduce any language extensions to the core language - any construct must be buildable from lima's core constructs
* Should be able to specify external costs as well as internal costs.
* e.g. if you call a mysql server, depending on the size of hte table it might have a different cost. This cost would be invisible to the system unless you explicitly include it.
* maybe functions used to create a probability map need to be integratable too so they can calculate percentile
* maybe just throw an exception when something is requested that can't be calculated (like an inverse or an integral)
* (Scratch this) Lima should have annotations for where the compiler should focus its time (the bottlenecks)
* Question: is there some way a compiler can *always* identify bottlenecks better than the programmer?
Seems like the answer should be yes for the same reason the answer is yes to
"can the compiler always be better at optimizing than the programmer?"
- anything you can do yourself, you can tell your compiler to do.
* Seems like the language needs to have an easier way to override inherited methods
For example, this is how you'd have to do it today:
object = {
fn! method = fn:
;; do something
}
object2 = {use[object[method:objectMethod]]
fn! method = fn:
objectMethod[]
;; do more stuff
}
but i really want something like:
object2 = {use[object]
override fn! method = fn:
thisfn.parent.object[]
;; do more stuff
}
or maybe:
object2 = {use[object]
// first two arguments are passed to the overridden function
override fn! method = fn thisfn.parent.object[2] c d:
;; do more stuff
}
* Haskell has three exponentiation operators! This is because there�s a difference in what the three of them mean in some cases, so you get your choice.
* Mention that lima is conducive to Language Oriented Programming as described here: http://www.onboard.jetbrains.com/articles/04/10/lop/6.html
* conceptually an object keeps track of the identies of what objects' interfaces it implements
* You might be able to statically map javascript exceptions to lima exceptions (ie leveraging the underlying system to generate lima exceptions much faster)
* http://helephant.com/2007/05/12/diy-javascript-stack-trace/ - for browsers that don't do exceptions well
* rhino doesn't support function.callee or function.caller but it should be easy to add in there in generated code (just set those values on the function before you call it, or pass in a variable or something)
* Link to this somewhere in your docs as to why dogma is stupid, and so are idioms: http://learncodethehardway.org/blog/AUG_19_2012.html
* Should be able to specify output ability as well as input behavior for optimizations
* what does output ability mean?
Lima oips contest - obfuscated in plain sight. rules: standard indentation and formatting.
* function inverse (quote from an earlier spec):
May optionally take additional parameters which define some or all of the input parameters
as they would be after completion of the original function
(this may be neccessary for functions that mutate their inputs).
* A meta function (meta[object]) can be used to grab an object's meta data
* this meta data can contain the members an object should have and their constraints (among other things)
* interfaces would have the meta data for members, but wouldn't neccessarily have the members themselves
anti aliasing blockyness should probably be described as a number from 0 to 00, where 0 is 100% blocky and 00 is 100% smooth.
* a value of 2 indicates that each dimension is split into two parts - meaning that you get 4 subpixels per pixel
* a value of 10 would mean you have 100 subpixels
* a value of 00 effectively makes it continuous which makes coloring 100% precise
Still confused as to how you describe color blending
* to be 100% precise, you need to split each pixel into exact proportions and then blend each color with that proportion
* you can describe this process to be less precise by only choosing a minumum number of colors to blend,
or maybe choosing a minimum proportion of the pixel that needs to be covered before blending
* but this kind of describes a process *across* objects
* is there any way to describe this in each object individually?
* seems like you'd have to do it on a per-pixel basis - not per object
* For optimization plugins:
* have a hook for meta-information gatherers that scan the (Lima) program and can set arbitrary describing attributes on a variable
* when an optimizer transforms something using a higher-level construct
(something that isn't in the basic syntax and functionality), have it somehow describe the parts of that
higher-level construct in terms of basic functionality, so that other optimizers can still re-optimize it if
it fits a pattern that can optimize further
* consider changing the color objects to use wavelengths or something rather than rgb values
* also figure out how you can incorporate different color spaces (similar to incorporating different encodings?)
* Window anti aliasing - so from what I can gather, this has to do with how pixles are created from a downsampled image
(e.g. when an image is farther away in a 3d scene) when a single pixel has multiple colors in it.
Open question: is there a standard way to measure the realism? I kinda doubt it.
Since there probably is no way to measure how "real" a rendering should look, we'd have to fall back on simply choosing the algorithm ourselves - ie when we create a view or something.
* Ask holmes if there's any way to measure anti-aliasing realism
* holmes mentioned looking up error metrics around cublic splines
* If not, might just have to specify a specific sampling function
* maybe you can describe attributes you want the sampling function to have
* inaccuracy optimization where object's positions are rounded to the nearest pixel - or something like that
* have boundaries like "shape's position can error at most x" or "shape's rotation can error at most x"
* this can potentially depend on the object's distance from view positions
* possibly describe an anti-aliasing algorithm with the range 0 to 1 where 0 is fully 'blocky' and 1 is fully 'smooth'
* note that blocky has the most contrast and smooth has the least
* How do you describe that your circle, for example, can be drawn with at most a certain precision
* which would allow it to actually draw the circle using less polygons than would allow your screen to have the maximum precision
* Maybe have a minimum number of polygons you use
* Or maybe maximum difference in volume is a better metric
* Possibly describe optimization ability of certain shapes (allowing the shapes to be modified to be easier to draw)
by indicating reduced monitor resolution - ie allowing the drawing of a particular shape to pretend that
the monitor is at a lower resolution that it really is.
This way it could draw more choppily than it would otherwise.
However, I'm thinking this doesn't seem like it would work to specify the reduction of verticies
(and thus polygons) in a shape necessarily. Maybe there'd be two types of specification -
you could say "for simplifying verticies, pretend monitor is this resolution" and for choppyness
say "for simplifying pixel output, pretend monitor is this resolution" - not sure how encompassing that is
* should be able to specify output ability as well as input behavior for optimizations
* e.g. monitor will have resolution beween x and y
* when describing optimization stuff, you should be able to create arbitrary variables you want to optimize
* be able to weight them differently so your compiler can make appropriate trade offs
* speed, memory, and power aren't the only things - a user could specify other things like maximum cpu usage (vs program speed),
readability of output (if you're compiling into another language), or cost, "complexity" (defined in some user-specific way), or number of components (if you're compiling into say a schematic that uses physical components,
so you don't have to do as much work to put it together)
* modular optimization tagless-final DSLs: http://okmij.org/ftp/tagless-final/course/optimizations.html
* "Modular, composable, typed optimizations in the tagless-final style"
* Potentially useful for modular optimization (behind a pay wall): http://www.tandfonline.com/doi/abs/10.1080/03052158508902511
* "THE USE OF MODULAR PROGRAMMING IN OPTIMIZING COMBINED SYSTEMS" by J. N. SIDDALL & CHEN ZEHONG
* Examples of optimizations that should be modularized: https://www.youtube.com/watch?v=TH9VCN6UkyQ
Think about how to do something like what CSS does, but in an application programming interface.
This would require having some kind of hooks in objects that change when you change your "style sheet".
Is this even necessary? It sounds useful, for sure.
* add to pack:
* Some ability to check if there are newer major or minor versions for a library.
* Think about having the safe-navigation operator return a nil with an 'app' method, so you can create new lists from nil
* e.g.
var x = nil
x.app[1 2 3] ;; x now is {1 2 3}
* split up sections into Basic Lima and Lima's Standard Library, as well as probably making a separate section for
the "Concepts"
* need to come up with equivalents for php functions:
* checkdnsrr
* dns_get_record
* getmxrr (what are the weights? no equivalent with dns_get_record?)
* consider a method like map and join that operates on sequences
* so you can go through every match of a sequence or something
* this would replace the 'replace', 'find', and 'ins' methods
* Note that if a lima object uses two objects that have the same member,
they must be explicitly disambiguated *even if they are not conflicting types*
* the reason for this is related to the reason C# uses "explicit interfaces"
- so that multiple interface members that have the same name but different purposes are brought the the programmer's attention
* Wherever there is an operator for merging types, an error should happen
* how would you easily dedupe this
* In a function, what variables can you access?
* What if that function's copied somewhere?
* Need some rules for what meta information is inherited when you mix or use an object in a new one
* Need to flesh out what meta information there needs to be for objects
* object.reflect
* public fields
* public const fields
* public read-only fields
* private fields
* aliasing fields (fields that alias something in a higher scope)
* addField
* metadata
* make sure the reflection stuff provides a way to access the 'this' of a container class from a nested class.
* make sure theres a way to query the platform the code is running on
* self - the object itself
* stack.reflect
* levels - a list of the stack levels currently active
* current level - the current stack level (also tells you how many levels there are, since you are always in the deepest level)
* stack level
* name - name of the function
* file - what file the source was defined in
* source - string source of the object (as much as possible)
* line - what line of the source file where the object was defined
* self - the function itself
* getlocals[level] - gets a list of the local variables inside the function at the given 'level' (where level represents a level in the call stack)
* getUpvalues - gets a list of values in a higher scope that the function uses (ie closes over - since functions are closures)
* theoretically this could even be variables the function doesn't use, but has access to
* hooks - things triggered on certain events
* function call
* function return
* exception thrown out of function
* statement execution (in lua this is a "line" event, but why pretend code is always in the form of lines?)
* reflection should be able to see where methods come from (what objects they were originally from if inherited)
*I'm unsure if htis is actually possible
* organize concepts by type so they're more easily searchable
* have a with statement so you can do stuff like
* doSomething[x[4].moose.with[ v.a==5 & v.b == 6] ] - so that you don't have to duplicate x[4].moose everywhere
* Note that this is not really like python's with
* also not really like javascript's with, since that unload the entire namespace of an object into a block, whereas this would just create one variable (v) inside an expression
* maybe allow an attribute to change external inputs somehow, instead of creating mock objects, create mock input
have a combine method for lists where
* list.combine[expression]
is the same as:
* list.map[expression.map[v2: {v v2}]].join[{} a.cat[b]
eg
(1..n).combine[1..(v-1)]
.map[{v.0 v.1 v.0+v.1}]
[prime[v.2]]
This has a need for a recombine method that takes a list of lists of values instead of a simple list of values so you can do something like:
(1..n).combine[1..(v-1)].recombine[v.1..v.0]
Is there a simpler way to do this?
Can we defined combine in such a way that it will work in either case?
* Can you describe an API - like a web API, using lima? You'd say stuff like it needs to be an http request that has these possible requests and responses. There should be some way to do it.
* Make it so "custom operator" can define any operators to be custom functions
* This would mean that "[" is really the custom operator, and it just happens to be eneded with a close bracket
* split should be able to split by more arbitrary sequences
* probably requires a parser to be passed in to parse delimiters
* consider adding value-pattern matching to lima - like this:
fn.string[int] sayMe = fn
1: ret "one"
2: ret "two"
3: ret "four"
x: "not between 1 and 3"
;; would be otherwise done as
fn.string[int] sayMe = fn x:
if x == ?0::
1: ret "one"
2: ret "two"
3: ret "four"
else: "not between 1 and 3"
Slow Lima contest - a contest for people to write two Lima programs with exactly the same results/effects but run with very difference performance characteristics.
A requirement here would be that the same input assertions be used in both programs.
This can be done in conjunction with an optimization contest intended to incentivize fixing those performance holes.
The optimization contest would probably be tricker, since to be good optimizations, they should be general, and yet a more specific one would perform better (be faster etc).
Maybe you'd just have to have standard benchmarks it has to test well for.
Or maybe there will be a secret modification to the original
program to make it do something basically the same but have a slightly different output.
* Maybe allow 'mix' to work inside a function, to unroll a bunch of properties (similar to 'with' in javascript)
NO (since mix works on `this` rather than `thisfn`, but maybe something like it?
how do you do self-types in lima? Probably don't need them actually, since values aren't typed, but..
public abstract class BaseDate {
withYear(int year);
}
public final class ZonedDate extends BaseDate {
// withYear removed as now correctly in superclass
}
public final class LocalDate extends BaseDate {
// withYear removed as now correctly in superclass
}
Lima:
BaseDate = {
fn.[this!] withYear = fn int year:
...
}
ZonedDate = { mix[BaseDate] }
LocalDate = { mix[BaseDate] }
staticSize and dynamicSize should probably be in meta data
* look into event syntax in Trellis: http://peak.telecommunity.com/DevCenter/Trellis#toc
* Got like halfway through
* Got stuck on "Creating Generic Controllers by Sharing Cells" and resseting rules..
* maybe the resetting rules stuff can be done using atomic blocks
* For probabilityMap.sum, what about probability densities? Do you need infinitesimals to describe pmap.sum as the
summed slice pmap[[20?
* I think you kinda do
* implement types with event semantics (e.g. types would put a watch on a variable and "check" that its the right type every time it changes)
* possibly have the realCustom function return two things - the lima to run, and the result to put in its place
(so that a type function can operate on a variable while leaving the variables behind for other type functions to operate on)
* might wanna keep things simple here
* get rid of the concept of 'raised' exceptions (or whatever you want to call them) that get answered by an "answer" block
* instead use the attribute concept to set a method that can be called somewhere within (effectively getting an "answer" that way)
* write a concept about this (mentioning that raise-answer was a feature i had originally considered)
Dev resource bundle:
* source map
* exception messages - anything from an exception that's not switched off of but instead printed out to the screen. Messages sent to a server could process the messsages using the dev bundle.
* maybe for pack, some kind of public key or other identifying information should be saved with the executable so that the
canonical source can be validated (authenticated) when its downloaded by the end user
* how do you determine that for pack, that the package you download is correct
* have a checksum to verify the contents
* have some way to validate the check sum (authentication)
* http://guide.macports.org/#development
* does gems do something about this?
* yes, PKI: http://docs.rubygems.org/read/chapter/21
* this works using a web-of-trust style public key infrastructure
* This allows one repository to endorse another
* why would they do this?
* maybe this is built in
* a distribution server could simply accept trust requests
* that server would check their chain of trust (or a portion of it) to determine
that the requester's request is valid
* valid requests might be
* ones that haven't requested too much trust (from to many other distro servers)
* ones that haven't revoked their key recently (or something like that)
* ones that don't lie about who they've requested trust from (would require them to send a list of who they've requested trust from)
* how do you revoke endorsement?
* possibly the endorsement can be revoked either
* with a properly signed message, or
* this would be useful if you lost your domain
* from the expected address with a handshake ensuring a proper send receive path
* this would be useful if you lost your private key
--nix: this is already done using attributes, but write a concept about it-- Hooks for intercepting output and injecting input (from the console, network, OS, etc)
* this is so you don't have to do as much mock-object bullshit, you can simply test inputs and outputs
* For graphics, I like the setup of objects having subobjects, and when you draw one object, it automatically draws all
that object's subobjects.
But what do you do in cases like you find in html, where you have some image or something inside a div,
but now want it to be relative to an outter node instead of the node its in.
This just needs something thinking of the direct object model and other drawing schemes
{} should be an operator you can define/redefined
* need a {}= operator to define destructuring assignments
* seems like less of a good idea now - I kind of determined that destructuring assignments need to be a language construct
slima - simple lima. Modularize lima into two parts, slima and full lima which is defined in terms of slima
* Have the symbol be a smashed lima bean
* Have a custom function called "makeObject" that simply defines a bunch of operators that define the object
* This is the equivalent of the way data can be defined in lisp using closures - closures can do the same work in lima
* It's actually even more basic than lisp, since even the syntax for combination can be defined through the language (ie the operators - in lisp there's only one operator: parentheses)
* examples:
* functions are makeObject with some code-text passed in, and define a bracket operator that runs that code
* normal objects are makeObject with some member definitions passed in and defines a dot operator that returns a memeber based on the name passed into it
* list objects are makeObject with some elements passed in, and defineds a bracket operator that returns an element based on the index passed in
* Lima should be able to use libraries from theoretically any language - all mixed together.
It would translate those languages into lima, and then use them as normal.
It should theoretically be able to do this even for compiled libraries.
The only problem is features that a library might use that aren't compatible with the system you're in
- but that has a standard way of being dealt with - just thrown an unsupported exception.
There are things, tho, like the dom with javascript stuff, and graphics output stuff on OSs,
that could be translated between eachother with a little work.
Even some things like writing to the windows registry could be translated into writing cookies to a person's browser.
* Should the random functionality be able to specify probabalistic behavior between different seeds
(like, a generator might generate random values for any given seed, but it might generate pretty similar sequences between seeds)
* Idea: How can you make Lima 100% portable?
* Disallowing the program to know what system its operating on, and disallowing non-portable built-in functionality
would make every program portable.
* However, this would limit many things
* A way to get around this: feature querying
* Another way to get around this: have a special control flow operator that only takes in discrete
* What was I going for??? I never finished this thought.
* for system calls:
* You should be able to pass in a window object or a window attribute object so you can
give the process a window it controls (ie if the parent process stops running, that window will still exist)
* these cover some of the startupinfo and creationgflags stuff
* How do you run a command in a specific shell? Open the shell program itself and pass in the right commands.
* python popen replacement (http://docs.python.org/release/2.5.2/lib/module-subprocess.html)
* pid - need some way to get that
* do echoless input via input events (with an object like you'd use to check the state of the mouse or keyboard)
instead of through the console
* python split path and splitext are just helper functions, idk why i told myself to look at them.
* Yes they're useful, but so what? maybe just add these convenient functions to lima's path stuff
* os.stat - http://docs.python.org/library/os.html
Just gets some file attributes (more stuff to add to the lima path interface)
* http://ofps.oreilly.com/titles/9780596155957/DomainSpecificLanguages.html
* idea hidden parameter (a parameter that must be named or defaults). Why? If you want varargs and optional parameters
* note the impossibility of using varargs with optional parameters in normal cases
* think about adding in concepts of non-standard calculus and hyperreal fields into lima
* These are different values of 0 (infintesimals) and inifinity
* Not entirely sure about this, but it seems like 00 would be defined as 1/0 and 0 would be 1/00 - zero and 00 being treated as positive values
* to express this, the solution to x*0 = 5 would be 5/0 or 5*00
* look into documentation generation and how to facilitate this in lima. for example:
* http://sphinx.pocoo.org/tutorial.html
* look at google's Noop language to get some ideas about documentation (and potentially other things):
* http://code.google.com/p/noop/wiki/ProposalForDocumentation
* Output-agnostic: no HTML markup in the documentation!
* Support for example code blocks
* Support for having example code verified
* Would be nice if such a system could be integrated with version control so it could know who modified the source of a function / object when
(without storing all that info in source itself)
* Usual wiki rules apply, including auto-linking CamelWords
* Perhaps other wiki syntax like ==headers== and [[links]]
* Function output specifications that can propogate up functions
(so that you don't have to document things by hand that the compiler can generate)
* Think about have a 'meta' attribute that describes members as metadata
- then you'd be able to add metadata to objects exactly like you add normal members
* One use i can think for this is that meta data wouldn't appear in IterLists (and thus wouldn't appear in toString methods)
* they'd only be accessible directly (or via reflection) (just like you could do with @Retention(RUNTIME) in java)
* Have three ways to add documentation on a function:
* comments after the parameters
* a custom function that provides a way to add lots of meta data without using quotes and such
* add info directly onto the object with the attribute 'meta'
* how to extend an object with read-only members after its been created
* probably need two methods: one that adds a method only on that object,
and one that retroactively adds it to all objects that inherited from that object as well
* Revisiting this, why would someone want to do this? Why not extend the object via inhertiance as normal?
* the problem with doing this is its hard to maintain the namespace
- what if a modules tries to add a read-only member of the same name as another module.
I can't see a way of disambiguating that.
* The way to disambiguate it would be the same way that use and herit use to disambiguate
* So this would have to be built into the way that use and herit work,
where if theres a conflict, the member is renamed
* obviously, just like in regular inheritance member renaming, the original module
still uses the same name for that member
* I was thinking this couldn't be a dynamic feature, because it would mean
if you extended an object midway through a program, some objects that should be the same type,
wouldn't have the extended members. But if theres a way to retroactively adding the extention to all object
that inherited (directly or indirectly) from the extended object, then it would work.
* There should be some way in lima to specify that some data fudging is ok (particularly in the case of threading).
For example, if you have a shared variable that is being incremented or something by multiple threads potentially,
then you should have the option to not synchronize that variable and allow some inaccuracy in the amount that variable is actually being counted.
Maybe this can be a 'volatile' attribute.
* reversing functions should be able to treat upvalues the same as mutatable inputs
(you should be able to specify them)
* you should also be able to specify that upvalues should be used *as they are*
- which could make for interesting possibilites
* Should be able to grab the output-set from a function and use it as an enum
* Read this: http://www.codecommit.com/blog/scala/the-magic-behind-parser-combinators
and this: https://github.com/fab13n/parsec-coffee-script/blob/master/doc/parsec.txt
got it from here (for reference): https://github.com/jashkenas/coffee-script/wiki/List-of-languages-that-compile-to-JS
* for the parse function, allow writing arbitrary code, but spoof all external variables
(variables not declared inside the parse function) until the whole
parse function is determined. Then go through the cull "winners" and manifest the changes to those outside variables.
This way you can write arbitrary code inside the parse function, but make sure that only the cull winners' code
affects the outside program.
* date parsing stuff should be full fledged parser combinators
* parsers should be able to be combined
* you should be able to partially parse a string (so that you can have junk on the end that remains unparsed)
* how do you make reversible parsers
* maybe this can be extended to reversible functions overall
* a function is always reversible if it only uses reversible operations
* a function may be reversible even if it uses non-reversible operations
* idea: for some functions that can return multiple results (especially mathematical results),
return a set object that interacts identically as the values it holds, but can collapse to one primary value when neccessary
* Example: square root
* x/0 is not undefined (see the idea about hyperreal fields and infintesimals below)
*
set
The (infinite) list of numbers definable in a int, from smallest to greatest.
Note that because of the order, the index of the value 0 is at 00 (infinity),
the index of the value 1 is at 00+1, etc.
set
The (infinite) list of numbers definable in a fra, from smallest to greatest.
In other words, all the real numbers.
Note that because of the nature of the set, the index of the value 0 is at 00 (infinity),
the index of the value 1 is at 00+1, etc.
* consider allowing shadowed variable names in functions separated by an object nesting (e.g. if a function contains an object which has a method that aliases a variable, it should be ok). This would mean that any function could shadow any standard name (like 'if' or 'time')
* consider having a separate module or object for everything related to a specific language
* number to word translation (to and from)
* date translation (months, days of the week)
* For custom function calls, have a way to specify the length of the body of the call,
so the compiler can tell if you have a syntax error in your custom functin (if it runs over or under)
* maybe i wrote this before but have a match method that uses simple regex that returns whether or not a string matches
* var line = stdin.cut[v.match['.*/n']]
* looks like you need to add a function for splitting a string - tho maybe the parser function covers it (but does it cover it easily enough?).
* Similarly for some way of dicing up an array into parts (ie putting every 50 items into a new array).
* maybe have a regex split method that takes regex and returns a list
* probably a regex match method too (possibly nix the regex split method, and just have a method that splits on an expression,
where you can use the regex match method)
* Also a find method that returns all the matches (?) n a string / list
* var words = line.find['%w+'] ;; returns a list of words
* Think about dart generics and how Lima generics can mesh with it
* Consider an exception coelescense operator (like the nil coelescense operator)
which would discard exceptions from the left operand and use the right operand.
* Think about Lua's rejection of regex: http://www.lua.org/pil/20.1.html
* Full regex is apparently gigantic
* Think about delgation in the prototype-based way, where an object can have a number
of delegate objects that dynamically define inheritance
* eg:
a = {
x = 5
y = 5
}
Add = {
do = fn:
ret thiself.x + thiself.y
}
Multiply = {
do = fn:
ret thiself.x * thiself.y
}
a.delegates.app[Add]
wout[a.do] ;; prints 10
a.delegates.cut[[v == Add]]
a.delegates.app[Multiply]
wout[a.do] ;; prints 25
* I think this could be accomplished through the use of the reflection system (if thats designed properly)
* It could also be pretty easily done on a per method basis
(but it would be more cumbersome if it needed to be done a lot)
* maybe allow extending the general object by treating {} like a variable - ie you can set new values on it:
{}.s = 5
x = {}
wout[x.s] ;; outputs 5
;; not sure if this is at all desirable, but it seems to make sense with the semantics of the language
* need some way of ensuring the garbage collector doesn't fk things up.
* So lima needs some way of saying "this block shouldn't have the GC run" or (hopefully) a more general solution for
describing runtime requirements
* The always function can take in a function-value and executes it surpressing side-affects.
* if you're going to allow this, there should be a more general way to surpress side-affects (probably an attribute)
* Have some way to write optimizations as a matching statement (so you can say, for example, if it matches this pattern, then transform it into something else)
* for asfn and asobj, - thats still a danger if the user uses reflection - there should be some permissions around this)
* This might not be super neccessary in some situations tho, since copies of objects are usually sent
* Maybe only allow reflection for things in the same module (and asfn and asobj are considered outside the module)
* think about other "composition operations" you can do with objects other than simple "everything".
* you already have explicit stating of members to include, explicit alisasing, and grabbing all but certain members
* also suggeted is the ability to grab all members except the ones with conflicting names
* Prolima - name for prolog lima custom function
* think about returning by reference
* with return by value it is as easy as saying ret x~ to return by reference... so maybe its no big deal?
* consider an accessor 'acc' extention to the object's access definition (so that you can define setting and getting at the same time)
* it would return a reference to something
* consider allowing the access definition thing to override the brakcet operator too
* I dunno if this is really neccessary
* https://github.com/tolmasky/language
* Think about serialization issues
* maybe have an attribute you put on members to mark them as transient (like in hibernate)
* You still have to have designated functions that serialize and espeically unserialize (an object can serialize itself, but
a *different* object must unserialize it - usually this is its prototype/parent)
* auto serialization/unserialization methods would be ideal (and i think very doable with a transient attribute - overridable of course)
* note that this doesn't work for objects with nested pointers to other objects
* For those you need a way to keep track of cycles, which is easy enough for one save, but tricky for multiple saves
* Perhaps allow objects to have an id field much like a database would (or a unique field - but then you need to define over what that field is unique)
* overview of this in the context of lua http://www.lua.org/pil/12.1.2.html
* Make a note in the concepts section about putting lima code into config files like in lua: http://www.lua.org/pil/12.html
Entry[ a b c d]
Entry[ a b d c]
local count = 0
function Entry (b) count = count + 1 end
dofile("data")
print("number of entries: " .. count)
int count=0
Entry = fn: count++
parseMethod[file['data'] Entry][]
wout['number of entries: 'count]
* Sain should check the type of the variable being passed in, to figure out how to parse the input
* Add whatever constructs are neccessary to do this into the reflection system
* Maybe have an operator (or function) for a sub-set like comparison that checks to make sure the
subset-object has as many or fewer of every object than the superset-object has
* e.g. {1 2 3 3} would be a regular subset of {1 2 3}, but would not be this special-subset.
* another e.g. for {1 1 2 2 3}, {1 2 3} is a special-subset, {1 1 2 3} is too, but {1 1 1 2 3} is not.
* This is applicable to the chooseset function
* In the documentatin about operator overlaoding it says
"Just like for methods, when an operator is redefined on an object, only that definition is used -
it doesn't retain inherited operator definitions, even if those definitions could handle arguments that the new definition can't handle."
* How can you easily extend a multimethod with another set of valid parameters without rewriting all of the parameters? There should be a way
* ;; right now we have simple group:
object.group[v.productId].map[{ v[0].productId v.join[v.price+v2.price] }]
;; change to more complex but still relatively simple:
object.group v.productId[price.join[v+v2]]
;; simple:
var x = {{a=1 b=2} {a=3 b=5} {a=1 b=9}}
x.group[v.a].map[ v.join[v.b+v2.b] v[0].a] ;; returns {1:11 3:5}
;; new:
x.group a[b.join[v+v2] a] ;; bracket part is kinda like map
;; simple:
var x2 = { 1 2 3 4 5 4 3 2 }
x2.group[v] ;; returns { {1} {2 2} {3 3} {4 4} {5 5} }
;; new:
x2.group v: v[v] ;; returns { {1} {2 2} {3 3} {4 4} {5 5} }
;; or
x2.group v[v]
* Specifying runtime behavior contracts
*during
* over the whole program
* over a program block
* conditionally (if certain inputs are certain values, etc)
* constraints
* max memory usage
* absolute (bytes)
* percentage (of system)
* max cpu usage (percentage)
* max execution time
* maybe allow syntax for typing arbitrary keys like this:
object = {
int[0:4 'hi':45]
string[1:'one' 2:'two']
}
* For event semantics, you should have separate events for "clicked within boundaries" and "clicked the object itself"
- the second is basically what you have as onclick in javascript - it should be able to propogate the event if it wants to.
* consider removing the ability to specify the return type of a function in a function-type
* its kind of awkward because dynamic inputs could make it difficult to determine whether or not the function could violate its return value constraint
* it could error if it ever returns something that violates the constraint,
* but what if the function is set, and then passed to a less constraining variable - its just super awkward
* possibly make it so the input needs to be properly constrained so that the return value can be constrained
* ie if you can have any input, you can have any return value
* Another possibility is that you can function values that themselves contain the constraints to error if an invalid value is returned
* it could be specified like fn.int[ ;;[ statements ;;] ] - which would mean that the type form for this would have to be fn.int![...]
* what i'm thinking here is that it shouldn't really matter, the compiler should be able to tell if it can violate its contract
* probably need a method to get collation from the locale
* Maybe compiler.line and compiler.char should be replaced with some more generalized stack refelction construct,
which would be able to know not only the currenctly running line, but the line/character numbers of calling
statements higher in the stack.
* [X+Y+Z || X <- [1,2], Y <- [3,4], Z <- [5,6]]
vs
{1 2}.map[{3 4}.map[v2: {5 6}.map[v3:v+v2+v3]].join[a.cat[b]]].join[a.cat[b]]
Look at your comboset function
this might be done like this: comboset[{1 2} {3 4} {5 6}].map[v[0]+v[1]+v[2]]
* I think I've stumbled upon this concept before, but shared libraries should *not* be
different from static libraries and executables - they really contain the same information.
They're all binaries. The difference is in how you use them.
The compiler should figure out which way is best to use them, tho. So you really need only
one function: lib[whatever] - uses either a static library or shared library
- whichever it deems best (probably usually the dll)
* Investigate the lithe programming language - which I was never able to find any real information on: http://en.wikipedia.org/wiki/Lithe_(programming_language)
* There is a paper you have to *pay* for which seems to be the only source of information for this language
* there may be a similarity between lima's custom functions and the syntax-directed translation concept in lithe


We are a group of students from the King Juan Carlos University who are developing games, with a focus on online mutiplayer.
Our first game, Improvinci, is a party game that's perfect for playing with your family or your friends.
Our second game, Eldritchess, is a competitive strategy game with familiar pieces and exciting strategies.


<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier<EMAIL_ADDRESS>* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */
namespace Symfony\Component\HttpKernel;
/** * Contains all events thrown in the HttpKernel component. * * @author Bernhard Schussek<EMAIL_ADDRESS>*/ final class KernelEvents { /** * The REQUEST event occurs at the very beginning of request * dispatching. * * This event allows you to create a response for a request before any * other code in the framework is executed. * * @Event("Symfony\Component\HttpKernel\Event\RequestEvent") */ const REQUEST = 'kernel.request'; /** * The EXCEPTION event occurs when an uncaught exception appears. * * This event allows you to create a response for a thrown exception or * to modify the thrown exception. * * @Event("Symfony\Component\HttpKernel\Event\ExceptionEvent") */ const EXCEPTION = 'kernel.exception'; /** * The VIEW event occurs when the return value of a controller * is not a Response instance. * * This event allows you to create a response for the return value of the * controller. * * @Event("Symfony\Component\HttpKernel\Event\ViewEvent") */ const VIEW = 'kernel.view'; /** * The CONTROLLER event occurs once a controller was found for * handling a request. * * This event allows you to change the controller that will handle the * request. * * @Event("Symfony\Component\HttpKernel\Event\ControllerEvent") */ const CONTROLLER = 'kernel.controller'; /** * The CONTROLLER_ARGUMENTS event occurs once controller arguments have been resolved. * * This event allows you to change the arguments that will be passed to * the controller. * * @Event("Symfony\Component\HttpKernel\Event\ControllerArgumentsEvent") */ const CONTROLLER_ARGUMENTS = 'kernel.controller_arguments'; /** * The RESPONSE event occurs once a response was created for * replying to a request. * * This event allows you to modify or replace the response that will be * replied. * * @Event("Symfony\Component\HttpKernel\Event\ResponseEvent") */ const RESPONSE = 'kernel.response'; /** * The TERMINATE event occurs once a response was sent. * * This event allows you to run expensive post-response jobs. * * @Event("Symfony\Component\HttpKernel\Event\TerminateEvent") */ const TERMINATE = 'kernel.terminate'; /** * The FINISH_REQUEST event occurs when a response was generated for a request. * * This event allows you to reset the global and environmental state of * the application, when it was changed during the request. * * @Event("Symfony\Component\HttpKernel\Event\FinishRequestEvent") */ const FINISH_REQUEST = 'kernel.finish_request'; }


--- layout: post title: "Stunning HD images show the largest canyon in our solar system on Mars" subtitle: "Ten times longer than the Grand Canyon, and three times as deep, the Valles Marineris (The Mariner Valley) cuts through the surface of Mars." date: 2021-01-11 18:31:13 +0530 background: '/assets/images/space.jpg' published: true categories: [ Science ] tags: [ technology, hd, canyon, space, solar system, mars, spacecraft] ---
This grandest canyon in the Solar System stretches 4,000 km (2,500 miles) across the Red Planet — nearly covering a quarter of the circumference of that ruddy world. Now, images released on Christmas Day, utilizing the HiRISE (High Resolution Imaging Science Experiment) onboard the Mars Reconnaissance Orbiter, show this mighty rift in stunning detail.
More than five million years ago, the Grand Canyon in Arizona was slowly carved out by the flow of water in the Colorado River. But, despite the presence of large quantities of water on Mars in the ancient past, it is unlikely water was the primary cause responsible for the formation of its counterpart on Mars.
Billions of years ago, the eruption of Martian volcanoes in the Tharsis region near the present-day canyon erupted, ripping the crust.
This material then fell, forming the valley, researchers suggest. Over the ensuing eons, landslides and magma flows (together with water) may have helped shape the site we know today.
The movement of magma would have resulted in a swelling of ground near the Tharsis region would have lifted the Martian crust, resulting in fractures in the ground. This would have allowed subsurface water to escape, growing the canyon.


Find in the title only
Home
Site Map
Home
Featured Artist
About Us
About the Arts
Funding
Research
Compliance
Freedom of Information
Governance and Accountability
News
Publications
Useful Links
Mailing List


Define layouts, wizards, controls declaratively, easily manage input's complex behaviour
Define lists, filters and their properties such as exapndable and selectable rows declaratively
Modals, overlays and over utilities


"BETH-PEOR "house of Peor; i.e., “temple of Baal-peor”, a place in Moab, on the east of Jordan, opposite Jericho. It was in the tribe of Reuben(Joshua 13:20; Deuteronomy 3:29; 4:46). In the “ravine” or valley over against Beth-peor Moses was probably buried (Deuteronomy 34:6).
"BETH-PEOR "house of Peor; i.e., “temple of Baal-peor”, a place in Moab, on the east of Jordan, opposite Jericho. It was in the tribe of Reuben(Joshua 13:20; Deuteronomy 3:29; 4:46). In the “ravine” or valley over against Beth-peor Moses was probably buried (Deuteronomy 34:6).


HOME
DESIGN
LOGIN
Choose Shirt
Add Text
Add Image
Save
Design by your style
Select color:
All image types accepted
200.000d


{{> head}}
http4k Hotwire demo
http4k Hotwire demo
Underlying concept shamelessly stolen from
Josh Graham's awesome post
, this app shows how to server
Hotwire
applications from an
http4k
backend.
Time - via Turbo Stream SSE (WebSocket also available)
waiting...
Hello World!
Turbo Drive
Link without progress bar (fast)
Link with progress bar (slow)
Replace content with a wrapped Turbo Frame
Replace this content with link content
Disabling Turbo Frames with
data-turbo="false"
Regular links
Disabled Turbo Flame link without progress bar (fast)
Disabled Turbo Flame link without progress bar (slow)
Click times
Link via Regular Form
Click!
Append content via Turbo Stream Form
Click!


• Develop, code, and maintain programs and applications using .Net(C#) and Java framework; translate software program requirements into workable programming code; update, modify, and expand existing programs and applications; and provide developing support to supervisor as needed.
• Test and troubleshoot company's programs and applications, providing client services to correct any encountered problems during systems operations; develop enhancements; document all technical issues, progress, and resolutions, and communicate to supervisor; make approved changes by amending flow charts, developing detailed programming logic, and coding changes; and process testing and troubleshooting data to format and generate reports.
• A portfolio website for a designer from Los Angeles in USA.
https://jiyeonchoi.github.io/yunichoi/
• A music website for a band from Hamilton in Canada
https://jiyeonchoi.github.io/redanda/
• A photography website for a photographer from South Korea
https://jiyeonchoi.github.io/celinefilm/
• A sample wedding website
https://jiyeonchoi.github.io/justinbieber/
GPA: 4.1/4.5
HTML
CSS
JavaScript
C#
.NET
SQL


Home
Profile
Profile
Welcome back {{username}}!
Favorite teams
No favorites yet. Go to
Teams
and add your favorites there.
{{f.team.name}}


Am I sitting in a tin can. Far above the world. Planet Earth is blue. And there's nothing I can do.
Though
I'm past one hundred thousand miles. I'm feeling very still.
And I think my spaceship. knows which way to go.
Tell my wife I love her very much she knows.
Ground Control to Major Tom. Your circuit's dead, there's something wrong. Can you hear me, Major Tom? Can
you hear me, Major Tom? Can you hear me, Major Tom? Can you "Here am I floating 'round my tin can.
Far above the moon
Planet Earth is blue
And there's nothing I can do
Read more about Major Tom →


This component is intended to be used when an action is running in background (e.g. an API call) and we need to render the result of the action inside the page.
This component should be instantiated only once per application, so it can be easily controlled by an Application Controller.
By default, the loader will be hidden.
This component has no HTML children.


×
Pincident
Name of establishment
e.g. "Joe's Diner"
Type of Incident
Gender
Race
Nationality
Religion
Sexuality
Add a new Pin!
Your pin was added to our database!
☰
Search by number of incidents:
None Selected
All reports
2 - 5 reports
5 - 10 reports
10 - 20 reports
20 and more reports
Toggle dark mode
✕


In this first part of the assignment we will take a look at the incidences of prostitution and vehicle theft in the different districts of San Francisco in the years 2003 and 2015.
To make this visualization we used a JSON file generated with Python. You can see the file here:
JSON fileClick on the buttons to see the evolution of the crimes
If the axes changed with the data, it would be difficult to compare how the values evolved during the years. Since we maintain the same axes for both, it is really easy to notice how the cases of prostitution and vehicle theft have decreased from 2003 to 2015.


This document illustrates the use cases a mechanism to control the power-saving state of a device would enable on the Web platform.
Status of This Document
This section describes the status of this document at the time of its publication.
Other documents may supersede this document. A list of current W3C publications and the
latest revision of this technical report can be found in the W3C technical reports index at
http://www.w3.org/TR/.
This is a work in progress. You can contribute to this specification by
contributing additional use cases through our GitHub
repository.
Publication as an Interest Group Note does not imply endorsement by the W3C
Membership. This is a draft document and may be updated, replaced or obsoleted by other
documents at any time. It is inappropriate to cite this document as other than work in
progress.
The disclosure obligations of the Participants of this group are described in the
charter.
The web platform currently lacks a means to prevent a device from
entering a power-saving state (i.e., some means that prevents an aspect
of the system from "going to sleep"). As this document tries to
demonstrate, there are strong use cases where applications need to
temporarily prevent some aspect of the device from entering a
power-saving state. As this functionality is common on other platforms,
this document tries to make the case that this functionality should
also be made available to the web platform.
To understand the use cases that motivate an application from
preventing a device from entering a power-saving state we examined a
set of applications running on iOS, Android, and Firefox OS. By looking
at these native applications, and the conditions under which they
prevent a device from entering a power-saving state, we've come up with
a set of requirements. We hope that the web community can
address these requirements by creating a specification that affords
similar functionality to the web platform.
2.
Why we need wake locks on the Web
For tasks such as watching a video full-screen user agents have, for a
long time now, prevented the screen from going to sleep automatically.
Naturally users would be annoyed if they were watching a movie and
constantly needed to move a mouse or poke at the screen of a device to
stop the screen from going black.
2.1
Keeping the screen awake
As computing devices have become increasingly mobile, users find
themselves relying on mobile devices to assist them with everyday
tasks where it is not always practical or desirable to touch the
device to keep it "awake". These can be simple things, like using the
phone as a flashlight, to complex tasks such as cooking or allowing
the phone to navigate us to some destination while driving. In
addition, touch enabled devices have become commodified enough that
they can be used as interactive signage. Some of these use cases are
illustrated in the figure below.
2.2
Keeping the system awake
On the flip-side, keeping the screen on is not the only kind of "wake
lock" applications require. There is also use cases that there needs
to be a kind of lock that also keeps the system awake for a short
amount of time to allow arbitrary tasks to complete. It is well-known
that, under normal conditions, the display of a device consumes a
high percentage of a device's battery. Only keeping the screen on
when absolutely necessary can greatly assist in prolonging the
battery life of a device throughout a day.
As mobile devices are generally not as powerful as desktop class
machines, and because of the uncertain network conditions under which
these devices operate, some tasks can take a long time to complete -
longer than users are willing to wait before putting their device
back into their pocket, or sometimes longer than the default timeout
most devices have to put the screen to sleep (e.g., 1 minute or there
abouts). Consider importing and processing a set of contacts over a
slow network connection, which can sometimes take minutes. It would
be unrealistic to expect the user to hold their phone in their hand
while they wait for a synchronization task to complete: users should
be able to switch off the screen of a device and trust that an
application will do its best to complete a certain task in the
background.
In other words the user shutting off the screen doesn't mean that an
application must stop running and have the device enter a low-power
state. An application may need to intervene and finish what it's
doing or it risks data-loss. In another concrete example a user may
compose an email with a large photo attachment. When they press send
they just as quickly press the power button to turn off the screen
and put the phone back in their pocket. In such a situation, as
happens with iOS's mail app, the application continues to run by
sending the email before putting the phone in a low-power state. Note
that this system level lock includes keeping the WiFi and cellular
radio from also shutting down or entering a low power state while
some task is being performed.
2.3
Potential for abuse
As with any device API on the Web, there is the risk that this API
could be intentionally or unintentionally abused by developers.
Abuse cases include, but are not limited to:
Requesting a wake lock on the system and/or the screen and then
not releasing it. For the screen wake lock, if the user does not
themselves power off the screen, this would cause the user's battery
to be drained more quickly than normal. Likewise with the system
lock.
Requesting a system lock, and then exploiting it to perform
computationally expensive operations without the user's consent while
the screen is off (e.g., mining crypto-currencies and sending results
to a server).
Combining a system lock with an API like Geolocation could allow
an application to track a user while the screen is off: as the system
is not actually powered-down, it could continue sending information
to a server without the user's knowledge.
Ultimately, it will be up to user agents to mitigate these sorts of
abuse cases. However, the design of the API may also assist in
mitigating certain kinds of abuses.
2.4
Current workarounds
To overcome the lack of support for wake locks in the platform, there
is hearsay
evidence that …Developers are resorting to hacks like playing
hidden videos to prevent the screen from sleeping.
3.
Methodology and limitations
We used convenience
sampling to select the applications in this document. That is, we
selected applications that we knew prevented the screen from going to
sleep when the application was being used to perform some particular
action. We also reached out to people on twitter for suggestions as to
which applications we should look at. Suggestions were captured as
"issues"
in our GitHub repository.
As stated on Wikipedia's entry about convenience
sampling: "[one] cannot scientifically make generalizations about the
total population from this sample because it would not be representative
enough." Regardless, we view the range of applications we collected as
exemplifying common use cases for this kind of functionality. As such, we
still created requirements from what we observed across applications and
other platforms. We encourage the community to contribute more, or
contradictory/abuse-cases, examples to the Web and Mobile IG. You can do
this via a pull request to the screen-wake
repository on GitHub.
3.1
How we looked at the apps
For each application, we asked:
Why does the application need a wake lock?
How does the user benefit?
When is the wake lock applied and released?
4.
Support on various platforms
Below is a list of APIs from native platforms that developers can make
use of to prevent a device from going to sleep. The list shows that
this functionality is commonly available to developers without
significant security restrictions. It is important to note that some
platforms differentiate between putting the system to sleep and putting
the display to sleep. Requesting that the system (or "CPU") not sleep
while allowing the display to sleep allows long running tasks to
complete.
The application allows users to follow football matches in real-time:
receiving updates as the match is taking place. Allowing users to
follow the action in real-time seems to be the primary motivator.
How does the user benefit?
During a match, the user can simply place their device on a surface
for convenient viewing - or they can simply hold the device in their
hand. Without requiring any user interaction light-weight textual and
graphical information is streamed to the device and automatically
displayed on screen. This means that the user does not need to
interact directly with the device to receive updates of what is
happening during a match. Note that this application does not stream
live video.
When is the wake lock applied and released?
The wake lock is only applied when the user opens the "action" screen
of the application and if, and only if, a match is actually taking
place. The wake lock is released as soon as match is finished.
6.
Google Play Books
Why does the application need a wake lock?
The Screen stays 'awake' allowing users to continue reading and
e-book without having to continuously poke at the screen to keep the
device awake.
How does the user benefit?
Allows a user the read at their own pace without needing to
constantly poke the screen to keep it awake. It also means that users
can keep their hands away from the screen until they need to turn the
page.
When is the wake lock applied and released?
The lock is applied only once the user opens a book. It is released
once the user returns to the book selection menu. Additionally, if
the user doesn't turn the page of a book after about 5 minutes, the
application automatically releases the wake lock.
Applications that exhibit similar behavior:
FBReader on Android is
configurable. It default is to only prevent sleep when battery level
is greater than 50%.
7.
Nigela's quick collections
Why does the application need a wake lock?
Allowing users to prepare dishes while simultaneously interacting
with the recipes of the application (recipes are spread across
multiple screens and require multiple steps to be followed in order).
A user may find it annoying if the device went to sleep while they
were trying to follow a recipe (as this involves a lot of
multitasking on the side of the user, their hands might not be
available, or their hands might be dirty or wet).
How does the user benefit?
As the user's hands could be dirty or wet, the app keeps the screen
on and allows the user to navigate the application using voice
commands instead.
When is the wake lock applied and released?
The wake lock is only engaged when the user explicitly opens up a
recipe. When the user leaves a recipe and returns to, say, the main
screen, the wake lock is released.
Safety. Keeping the screen on allows the user to periodically glance
at their phone to get oriented while navigating to their destination.
On iOS, even if the user turns off the screen, the application
continues to run and notifies the when they need to make a turn.
How does the user benefit?
When in navigation mode, the screen will stay 'awake' so users do not
need to physically interact with the device when navigating.
When is the wake lock applied and released?
The screen lock is only applied when the user begins navigating. The
screen lock is released when the user stops navigating or reaches
their destination.
Other applications that exhibit similar behavior:
iOS Maps.
9.
Xee Photo Viewer
Why does the application need a wake lock?
The wake lock makes sure that the screen does not switch off in the
middle of the slideshow.
How does the user benefit?
Becasue the screen stays 'awake', users do not need to physically
interact with the device to ensure the slideshow continues running.
This leaves the user free to interact with others whom may also be
viewing the images in the same physical space.
When is the wake lock applied and released?
The screen lock is only applied when the user starts the slideshow.
The wake lock is released when the slideshow reaches the last photo
in a set or it gets interrupted by the user.
Other applications that exhibit similar behavior:
FastStone Image Viewer for Windows
iPhoto
10.
Firefox OS Contacts
Why does the application need a wake lock?
To be able to import contacts and performing long-lived tasks without
requiring the user to keep the screen on.
How does the user benefit?
The user is assured that importing contacts will complete without
needing to keep the screen on. This conserves battery.
When is the wake lock applied and released?
When the import task is complete.
11.
Other applications
A range of other applications benefit, or could benefit, from a wake
lock. For instance:
Google Cardboard needs to stay
awake since there's no direct user interaction with the screen. It
would benefit from having wake-lock functionality. Mozilla's
VR efforts, which rely on the Oculus Rift, would also benefit
from having this API.
The "AliveECG - Heart Monitor" for Android is an application that
monitors single-channel electrocardiogram (ECG) rhythm strips. The
screen that shows the beats per minute prevents the screen from
locking. This allows patients and medical professionals to monitor the
ECG input in real-time without needing to worry that the device will go
to sleep.
iOS's compass application uses a wake lock to prevent the screen
from going to sleep. This allows users to orient themselves without
needing to worry that the screen will power off unexpectedly.
12.
Requirements
Any specification seeking to address these requirements:
MUST support requesting a wake lock on at least the
system and on the display. The
display being the screen or primary output modality of the device. The
system meaning that the device can put the screen to sleep, but MUST
continue running a task until an application releases the lock on the
system. Keeping the screen awake MUST (obviously) also keep the system
awake.
MUST be extensible, allowing for new types of locks to be specified
in the future.
MUST support a way for user agents to support wake locks only under
specific security conditions (e.g., only in full screen).
MUST support a means for scripts to be notified if a request for a
lock fails to be granted. And if a lock request is not granted, the UA
SHOULD provide the developer and script with appropriate information
detailing why the request was not granted.
MUST allow developers to release a previously requested wake lock.
MAY allow scripts to check if an origin already holds a particular
kind of lock.
MUST make the user agent ultimately responsible for managing the
wake locks. The user agent MAY automatically release the lock for
security reasons, and MUST release all locks when an application is
closed or navigated to another origin. It MAY also release the lock
after some amount of inactivity.
MUST NOT be applied solely at the application level (e.g., just
once when the application starts).
MUST be possible for the end user to override the wake lock on the
screen (e.g., by pressing the power button on the device, which puts
the screen to sleep). Applications SHOULD be notified when such a thing
happens, so they can request a system lock if they need to complete
some task.
MAY allow a means to hint to the user agent how long a lock is to
be held (e.g., "keep the screen on for at least 5 mins").
MUST allow the end user to have ultimate control over which
documents have control over a wake locks (e.g., not allowing a page to
get get any kind of wake lock without user opt-in).
A.
Observations
The following are a set of related observation we made while we were
preparing this document.
In iOS, an orientation change can serve as a trigger to prevent the
screen from locking. However, this only works on apps that support
changes in orientation. This is not the case in Android, where changing
the orientation of the device has no effect - even if the application
supports multiple orientations.
B.
Acknowledgments
Huge thanks to Ehsan Akhgari, Seth Ladd, Ian Hickson, Boris Smus, Damon
Douglas, Ilya Bogdanovich, Tab Atkins, and Domenic Denicola.


--- extends: minimal.j2 default_block: main title: Jake VanderPlas description: Home page of Jake VanderPlas ---
Dose Meadows, Olympic National Park
I'm currently a software engineer at Google Research in Seattle, and developer on a number of open source Python projects.


t5/core/ajax
Exports a single function, that invokes t5/core/dom:ajaxRequest()
with the provided url
and a modified version of the
options
.
- options.method - “post”, “get”, etc., default: “post”.
- options.element - if provided, the URL will be treated as a server-side event name
and the actual URL to be used will be obtained from dom.getEventUrl(url, element)
- options.contentType - request content, defaults to “application/x-www-form-urlencoded”
- options.data - optional, additional key/value pairs (for the default content type)
- options.success - handler to invoke on success. Passed the ResponseWrapper object.
Default does nothing.
- options.failure - handler to invoke on failure (server responds with a non-2xx code).
Passed the response. Default will throw the exception
- options.exception - handler to invoke when an exception occurs (often means the server is unavailable).
Passed the exception. Default will generate an exception message and throw an
Error
.
Note: not really supported under jQuery, a hold-over from Prototype.
- options.complete - handler to invoke after success, falure, or exception. The handler is passed no
parameters.
It wraps (or provides) success
, exception
, and failure
handlers, extended to handle a partial page render
response (for success), or properly log a server-side failure or client-side exception, including using the
t5/core/exception-frame
module to display a server-side processing exception.
define ["./pageinit", "./dom", "./exception-frame", "./console", "underscore"],
(pageinit, dom, exceptionframe, console, _) ->
(url, options) ->
complete = ->
if options.complete
options.complete()
return
if options.hasOwnProperty 'element'
url = dom.getEventUrl(url, options.element)
newOptions = _.extend {}, options,


scroll image compare
css effects all in one
https://www.cnblogs.com/xgqfrms/p/13337924.html
https://cdn.xgqfrms/css-effects-all-in-one/index.html
Before & After
https://www.fika.io/