Version History

From Sputnik Wiki
(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
== Sputnik 0.22 @ 003-21-2014 05:54 AM ==
+
== Sputnik 0.23 @ 08-11-2014 05:54 AM ==
 +
 
 +
=== Whats New ===
 +
* Added IsDivisible() to check if an expression is divisible by a given divisor optionally comparing as double/int64
 +
* Ord renamed to OrdW (Converts a char to UNICODE code)
 +
* Added Ord() handles converting a char to ASCII code
 +
* New Binary variable system for all Binary____() functions the change does not break any older scripts but it does improve how binary data is handled in Sputnik quite a bit.
 +
* Sputnik now uses a tweaked Mersenne Twister for random number generation
 +
* Added BinaryRandom() so you can randomize a binary variable
 +
* Added RandomVar() to generate random Int32, UInt32 etc etc and so on
 +
* Added RandomSeed() to generate pretty good random seeds
 +
* Say() and Println() can now be used with no params to insert a blank line into console
 +
* Added BinaryExpand() it can expand the bytes of a binary variable into a string along with the text they match up to so you can convert binary into something human readable which is excellent when making a network client/server
 +
* Added BinaryStartsWith()
 +
* Added BinaryEndsWith()
 +
* Added BinaryHash() to get a unique Hash of the bytes of a binary variable
 +
* Added BinaryIndexOf() Find the first occurrence of the needle
 +
* Added BinaryIndexOfAny() Find the first occurrence of any of the needles
 +
* Added BinaryLastIndexOf() Find the last occurrence of the needle
 +
* Added BinaryLastIndexOfAny() Find the last occurrence of any of the needles
 +
* Added Byte() and SByte() not sure why they were not already added...
 +
* Added BinaryJoin() to join together a ton of Binary variables in an extremely fast and efficient way
 +
* Changed BinaryCompare() to now support offset of the needle and ability to ignore case (ASCII)
 +
* Fixed (binary) cast it now works
 +
* Binary variables now serialize and unserialize their internal variables (in addition to the binary array they already did) -- this will make anything serialized in byte form impossible to unserialize
 +
* BinaryLen() can now be used to set a binary variables length (ontop of its usual get the length) you can also optionally set a fill with for the new bytes
 +
* Vec() no longer uses strings but instead uses the same binary that all Binary___() functions use so now you can can use Binary and Vec interchangeably.
 +
* Binary variables (including Vec now that its a binary variable) can now use all the operators that bit strings can use logical operators |, &, ^, and ~.
 +
* SocketConnected() fixed
 +
* Added JsonEncode() it works the same as PHP's and can produce the same output as the PHP version if you so wish it
 +
* Added JsonDecode() it works the same as PHP's and can produce the same output as the PHP version if you so wish it
 +
* MySQL is now working again.
 +
* Added NewClassFromArray() it can be used to spawn a new class and set its internal values to that of an array such as one returned from a JSON Decode.
 +
* $this is now correctly set on Unserialize()
 +
* Arrays can now be defined with [ ] example $a = ["One", "Two"]; as well as the usual array() function
 +
* Casting a null as an array like (array)null or (array)$null will now return an empty array instead of an array with a single element (null)
 +
* Added SocketIP() to get the local or remote IP of a socket
 +
* Fixed a rare glitch that could deadlock threads
 +
* Added a new param to Eval() that lets you decide to cause all print/say etc statements to print to the return value instead of the console
 +
* Offset param added to SocketSend()
 +
* Eval flag 4 now supports the clean up if specified
 +
* Added EvalCreate() it lets you spawn an Eval object that you can execute code with similar to Eval flag 4 but it wont go away until you unset it
 +
* Added EvalSet() it can be used to set variables inside an object made from EvalCreate()
 +
* Added Bin() it works similar to Array() but it produces binary instead example my $A = bin(1, 2, 3, 4, 5, 6, 0xFF, 0x42);
 +
* BinaryInsert() overwrite is now working properly
 +
* BinaryGet() now returns NULL on failure so it is possible to know it failed
 +
* Added CGIConsole() it changes the way Sputnik prints to console so it works better when used as CGI
 +
* Added BinaryPadLeft() -- it can add padding or make sure the binary is a fixed size and pad it to make it so
 +
* Added BinaryPadRight() -- it can add padding or make sure the binary is a fixed size and pad it to make it so
 +
* Sputnik is now better at handling more instances of Sputnik running in its ram
 +
* Added BinaryTrim() -- trims whitespace or you can provide it a byte array of stuff to trim
 +
* Added BinaryTrimLeft() -- trims whitespace or you can provide it a byte array of stuff to trim
 +
* Added BinaryTrimRight() -- trims whitespace or you can provide it a byte array of stuff to trim
 +
* Added BinaryToLower() -- makes ASCII chars in the binary go lowercase
 +
* Added BinaryToUpper() -- makes ASCII chars in the binary go uppercase
 +
* Added BinaryRemove() -- similar to substr() but removes the section from the binary
 +
* Added BinaryMidReplace() -- similar to BinaryRemove() but instantly inserts something into the replaced part
 +
* Added BinaryContains() -- To check if a binary variable contains a given byte or contains another binary variable
 +
* Added ConvertClass() -- It will create a new instance of a class by its name and copy the values from another class useful with JSON decode to convert StdClass back into something useful
 +
* Binary is no longer an object but is instead a core datatype just like String and Int32 this means Binary benefits from all the core stuff like String does
 +
* Added IsPrime() to check if a number is prime or not
 +
* Fixed qq() and qqw() operators they was allowing a blank space to enter the array
 +
* Added new flag 'S' to sprintf and printf it works similar to 's' (string) but it will force a string instead of printing each element (Which in case of 's' is disastrous for a binary trying to print as string)
 +
* No longer need to make a key called "fmtSeparator" it is replaced with @Sep now (for sprintf/printf)
 +
* No longer need to make a key called "fmtBegin" it is replaced with @Begin now (for sprintf/printf)
 +
* No longer need to make a key called "fmtEnd" it is replaced with @End now (for sprintf/printf)
 +
* Override rule on Functions will now delete an existing custom function by same name when adding the new one
 +
* Override rule now works on Enums just like it does on Functions
 +
* Added new rule AddOnce for Enums it will only allow the enum with that name to add once and ignore the rest however it wont error
 +
* AddOnce rule now works on Functions like it does on Enums
 +
* Added new macro @IsLittleEndian
 +
* Added new macro @IsBigEndian
 +
* Fixed a bug where Byte and SByte could become a short (2 bytes) before converting to Binary
 +
* Improved Sputniks arrays a bit (internally) should be a tad bit faster
 +
* Vec() operations like += |= etc are now significantly faster since it no longer rebuilds the string/binary each time an operation is done and will instead modify them in place (Unless of course the size of the other is larger than source then it has no choice but to recreate the source to fit) which makes it extremely fast
 +
* Fixed a bug in Vec() that would make it fail to extract bytes properly when it received a binary variable with NOT normal size (1,2,4,8) instead of an integer such as vec($foo, 0, 64) = bin(10, 20, 30, 40, 2) it now correctly builds the integer result
 +
* Improve Array compares like == etc
 +
* Fixed Sort() and Walk() they were broken since the change to return values
 +
* Added new Regex flag 'z' for Match it works the same as flag 'a' but this will return an array of the index and length of the whole match if it cant find any group matches
 +
* Fixed bug in BinaryCompare() that would fail if the start offset was higher than needle length
 +
* Made BinaryCompare() significantly better it now handles start/lengths in same way substr() does individually for both binary and needle
 +
* Added usleep() it can sleep the script for a given number of microseconds
 +
* Added Find() it is the same as the LUA String.Find() it can use a patterns to find stuff inside a string and return its position and even group capture
 +
* Match() renamed to CSetMatch()
 +
* MatchDel() renamed to CSetDel()
 +
* Added GSub() it is the same as the LUA String.GSub() it returns a copy of the string in which all occurrences of the pattern have been replaced by a replacement string (Or fills an array/callback function).
 +
* The -> can no longer be used to place a variable as the first argument in a function like "test"->Substr(1, 3) instead you must use ->> so "test"->>Substr(1, 3) is what you use now this change was done to make the classes/objects -> look entirely different from the force variable as first item in a function.
 +
* Added new operator =>> it works similar to ->> but it will immediately place the return value into the variable so $a=>>substr(1); this will cause $a to become the result of the substr operation
 +
* Fixed bitshift <<< and >>> they were converting values to an UInt32 which would destroy a lot of information now it correctly uses UInt64
 +
* Operators + - / * % & | ^ << >> <<< >>> now do bit operations on strings and binary (of both params are string or binary not just one) just like += -= etc do this is a change from which which only does this when using += this means you be careful when doing these operators since if both variables are strings (yet contain numbers in text) they will be treated as bitstrings and the binary operations will take place on each individual char. To avoid this problem either make sure you are using integers/floating points or cast to be sure you only need one of them not to be a string
 +
* Direct memory pointer read such as $PTR[12]:i can now use a direct offset instead of data type offset by doing :: instead : example $PTR[12]::i
 +
* Embedded functions in variables etc when called now take place in local scope instead of their own so they get to use all local variables you have in the area
 +
* List ( ) now sets all variables to null if it cant place stuff into them
 +
* Added Sub() it works almost identical to SubStr() with only one change instead of taking the start position + length it takes a start position + end position this is useful for any functions that return start+end positions such as find() etc
 +
* Changed ?? and !! to only check if the variable really is NULL instead of just *not true* so $a ?? "test" will use "test" if and only if $a really is NULL
 +
* When checking if a string is TRUE Sputnik will now try convert to a double so that "0.1" etc will return true where as before it would have said false
 +
* Removed the array pointer functions Each(), Reset(), Next(), Prev(), Cur() since they are pointless and served no good purpose
 +
* Removal of array pointer (not to be confused with ref) will make unserialize unable to open a serialized array from an older sputnik version however to avoid such issues in future you could always use the json encode/decode (which never changes).
 +
* LINQ functions deleted pending a full remake
 +
* Add new FROM and TO for the foreach loop example foreach($a as $c from 1) starts looping from index 1 and foreach($a as $c from 1 to 3) starts from index 1 and ends at index 3
 +
* Operator To example 10 to 20 has now been renamed to <-> so it is now 10 <..> 20
 +
* All .NET array[] types are supported in Foreach now
 +
* .NET array[] types can be refed in a foreach and have their value modified in real time
 +
* Strings in a foreach can now be refed and have their chars modified in real time
 +
* Foreach has been fixed so if you do a foreach with a ref "as" then do one without a ref below it using same variable name it no longer uses a ref when it shouldnt
 +
* Foreach can now handle List<> on both regular objects and dotnetObj
 +
* Foreach can now handle IEnumerable on both regular objects and dotnetObj
 +
* Added Assert() function it takes one or two arguments the first is a value to check is true (if so returns it) if it is not true then an exception is thrown with a default or user provided (second argument) error message
 +
* Added BitSwap() it can byte-swap little-endian <-> big-endian in any int/float etc variable
 +
* Added U for unsigned to hex literals example: 0x325U
 +
* Added U for unsigned to binary literals example: 0b10101010101U
 +
* Added U for unsigned to octal literals example: 063634U
 +
* Added IsList() to check if an array is a proper list
 +
* Added @GUIDBin it generates the GUID same as @GUID but returns it a binary instead of string
 +
* Added @GUIDZeroBin it generates the Zero GUID same as @GUIDZero but returns it a binary instead of string
 +
* Removed macros @Error, @ErrorCode and @ErrorMsg it was pointless and only a few functions actually used it
 +
* Fixed an issue where almost all static variable types such as 100 'Test' etc could get modified if they were passed as a ref
 +
* Added ContainsAny() works like Contains() but accepts an array of needles
 +
* When doing divide by NULL in Sputnik it now returns zero instead of the original value
 +
* You can now do stuff like foreach(array("One", "Two", "Three", "Four") as list($k, $j)) to get a given number of elements from array and put them into variables at each iteration
 +
* The operator => has been given higher precedent so when you do stuff like array("Cat" => $flag & 1); it no longer fails to work
 +
* Added ldexp()
 +
* Added frexp()
 +
* Added @TwoPI
 +
* Added @ZeroTolerance
 +
* Added Clamp()
 +
* Added Lerp()
 +
* Added Mod2PI()
 +
* Added Wrap()
 +
* Added Gauss()
 +
* Added Barycentric()
 +
* Added CatmullRom()
 +
* Added RandomSeedSet()
 +
* Added Angle2D()
 +
* Added Distance()
 +
* Added Distance2D()
 +
* Added Distance3D()
 +
* Added Hermite()
 +
* Added SmoothStep()
 +
* Added DegreesToRadians()
 +
* Added RadiansToDegrees()
 +
* Added @CaseState the @CaseState stores whether the current case was a true/false when it was checked even if you used goto to get into the case (For use with Select statement).
 +
* Added RevolutionsToDegrees()
 +
* Added RevolutionsToRadians()
 +
* Added RevolutionsToGradians()
 +
* Added DegreesToRevolutions()
 +
* Added RadiansToRevolutions()
 +
* Added RadiansToGradians()
 +
* Added GradiansToRevolutions()
 +
* Added GradiansToDegrees()
 +
* Added GradiansToRadians()
 +
Removed the -> from modifying strings in place since the new =>> handles modifying values now
 +
* Added BinaryReplace() to search and replace the needle
 +
* You can now use all the usual assignment operators such as +=, -=, *=, %=, ^=, &=, |= etc etc when using a binary variable in array form like $data[3] += 3
 +
* You can now use all the usual assignment operators such as +=, -=, *=, %=, ^=, &=, |= etc etc when using a CharPtr in array form like $charptr[3] += 3
 +
* Vec was somehow missing /=
 +
* Vec can now use ||=, &&=, **=
 +
* Byte type was broken when trying to do & with it
 +
* Foreach when used on a string now sets the "as" to a char instead of a string with one char in it
 +
* $var[index] when used on CharPtr and String returns a char instead of string now
 +
 
 +
== Sputnik 0.22 @ 03-21-2014 05:54 AM ==
  
 
=== Whats New ===
 
=== Whats New ===

Revision as of 21:56, 11 August 2014

Contents

Sputnik 0.23 @ 08-11-2014 05:54 AM

Whats New

Removed the -> from modifying strings in place since the new =>> handles modifying values now

Sputnik 0.22 @ 03-21-2014 05:54 AM

Whats New

Sputnik 0.21 @ 09-28-2013 05:26 PM

Whats New

Sputnik 0.20 @ 09-19-2013 10:58 PM

Whats New

Sputnik 0.19 @ 09-16-2013 10:25 PM

Whats New

Sputnik 0.18 @ 09-12-2013 01:42 AM

Whats New

>>> Read about Sprintf here <<<

$a = array(); $a[0] = "blah"; $a[1] = $a;

println("C:\\"); // Where as this would fail <-- No longer fails

Added new LINQ function From() Added new LINQ function AndFrom() Added new LINQ function NotFrom() Added new LINQ function Where() Added new LINQ function WhereNot() Added new LINQ function AndWhere() Added new LINQ function AndWhereNot() Added new LINQ function Size() Added new LINQ function OrderBy() Added new LINQ function OrderByDescending() Added new LINQ function OrderByAscending() Added new LINQ function First() Added new LINQ function FirstOrDefault() Added new LINQ function Last() Added new LINQ function LastOrDefault() Added new LINQ function Any() Added new LINQ function All() Added new LINQ function Invert() Added new LINQ function Select() (Note - The LINQ stuff is just a test and may or may not be removed later and/or moved to the Lib folder who knows)

Sputnik 0.17 @ 08-29-2013 05:49 PM

Whats New

Sputnik 0.16 @ 08-25-2013 07:56 AM

Whats New

Sputnik 0.15 @ 08-25-2013 01:15 AM

Whats New

(Since arrays in Sputnik are dynamic like PHP you could have a LBound at 6 and UBound at 200 however running Order() function will move the indexes to start from 0 alternatively Unshift() will also do that and of course Count() will return the total amount of elements)

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox