Jump to content




BrineUtil


  • You cannot reply to this topic
24 replies to this topic

#1 TheZen

  • Members
  • 65 posts
  • LocationHoquiam Wa

Posted 05 December 2017 - 12:36 AM

BrineUtil 5.5
This is where I will post my APIs which will all be a part of BrineUtil.


The APIs in BrineUtil currently are:
  • BrineMath 4.2
  • BrineText 4.0
  • BrinePic 1.0
  • BrineFormat 2.6
  • BrinePeripheral 1.0
BrineUtil Functions

Note: These are loaded when you run LoadAPIS.

BrineUtil.Update()

Update to the latest version of BrineUtil.

BrineUtil.Uninstall()

Uninstall BrineUtil. (Please don't go!)

BrineUtil.VersionCheck()

Lists the versions of all the APIS and BrineUtil that you have installed.


BrineMath Functions

BrineMath.Average(T)

T is many arguments no longer in the form of a table. (Thank You! Luca_S)

Ex: BrineMath.Average(5,7,6,8,9,10)

Returns NOT 38.3333333 but rather 7.5 ( Thank you Stekeblad for fixing probably the dumbest typo! )

BrineMath.CircArea( R )

R represents radius

Ex: BrineMath.CircArea(3)

Returns 28.274334

BrineMath.Root(R, N)

R represents the root you're looking for (Square = 2, Cubic = 3, 4th root, 5th root...)

N represents the number you are finding the root of

Ex: BrineMath.Root(7,128)

returns the 7th root of 128 which is 2

BrineMath.Circumference®

R represents Radius

Ex: BrineMath.Circumference(5)

Returns 31.415926

BrineMath.InjectMath()

Inserts these functions directly into the math API (undone once shutdown)

reversible using BrineMath.ExtractMath()


BrineText Functions

BrineText.WritePos(T, X, Y)

Writes T at X,Y on the terminal


BrinePic Functions

BrinePic.Draw(I, X, Y)

Draws the Image I at X, Y on the terminal

BrinePic.CenterImage(I)

Centers The Image I on the terminal


BrineFormat Functions

BrineFormat.TextBin(C, S)

S = a series of 1 character long strings Ex: C,"B","a","c","o","n"

C = whether or not to concatinate (true/false) Ex: true,"B","a","c","o","n"

Converts a set of characters to binary and returns them as either a table of strings or a single string.

If the second argument is a table that will be used rather than the other arguments.

BrineFormat.BinText(C, B )

B = one or more sets of 8 digits either 1's or 0's that represent a binary character Ex: C,01000010,01100001,01100011,01101111,01101110

C = whether or not to concatenate (true/false) Ex: true,01000010,01100001,01100011,01101111,01101110

Convert one or more sets of 8 binary digits to a single character and returns them as either a table of strings or a singular string.

If the second argument is a table that will be used rather than the other arguments.

BrineFormat.TblStr(...)

... = multiple Tables

Combines all values in the tables into 1 string.

BrineFormat.StrTbl(S, L)

S = String

L = Output String Legnth

Separates S into a table with stings with length L.

BrineFormat.SwapVars(V1,V2)

Swaps the values of 2 variables.

Usage: V1, V2 = BrineFormat.SwapVars(V1, V2)


BrinePeripheral Functions

BrinePeripheral.ListType(T)

T = Peripheral type you are searching for.

Creates a table of all connected L peripherals

Usage: Monitors = BrinePeripheral.ListType("monitor")


Have any suggestions for a new API? Or for a new function in an existing API? I consider everything and credit those who contribute!

I am accepting new conversion Ideas for BrineConvert! Suggest them in a reply and they could be featured in BrineConvert! Credit will be given to those who contribute!

Download by using the command below!
pastebin run t0aw2K2m <Optional Install Directory>
Load all the APIs at once by running LoadAPIS (accessible from anywhere by typing /YOURINSTALLDIRECTORY/LoadAPIS)

The installer was made using Packager! you should go check it out!

Edited by KidBrine, 03 March 2018 - 06:16 PM.


#2 TheZen

  • Members
  • 65 posts
  • LocationHoquiam Wa

Posted 05 December 2017 - 11:13 PM

Added LoadAPIS for loading all the APIs at once!

#3 TheZen

  • Members
  • 65 posts
  • LocationHoquiam Wa

Posted 06 December 2017 - 05:50 AM

BrineConvert has been added to the API list! Suggest a conversion we need for BrineConvert!

#4 Luca_S

  • Members
  • 407 posts
  • LocationGermany

Posted 06 December 2017 - 04:20 PM

I would suggest using varargs for the average function.

#5 TheZen

  • Members
  • 65 posts
  • LocationHoquiam Wa

Posted 06 December 2017 - 09:57 PM

View PostLuca_S, on 06 December 2017 - 04:20 PM, said:

I would suggest using varargs for the average function.
Implemented! Thanks for the suggestion! You are also now the first on the Contributors list!
Edit: also going to make my BrineConvert convert using the same system!

Edited by KidBrine, 06 December 2017 - 10:45 PM.


#6 CLNinja

  • Members
  • 191 posts

Posted 06 December 2017 - 10:57 PM

Instead of making these comments "contributers" why not use VCS like mercurial or github?

#7 TheZen

  • Members
  • 65 posts
  • LocationHoquiam Wa

Posted 07 December 2017 - 01:28 AM

View PostCLNinja, on 06 December 2017 - 10:57 PM, said:

Instead of making these comments "contributers" why not use VCS like mercurial or github?
Because i don't want to have the suggestions and the program separate.

#8 CLNinja

  • Members
  • 191 posts

Posted 07 December 2017 - 01:37 AM

View PostKidBrine, on 07 December 2017 - 01:28 AM, said:

View PostCLNinja, on 06 December 2017 - 10:57 PM, said:

Instead of making these comments "contributers" why not use VCS like mercurial or github?
Because i don't want to have the suggestions and the program separate.

People can post "issues" on github which could very well include suggestions.

#9 TheZen

  • Members
  • 65 posts
  • LocationHoquiam Wa

Posted 07 December 2017 - 02:15 AM

View PostCLNinja, on 07 December 2017 - 01:37 AM, said:

View PostKidBrine, on 07 December 2017 - 01:28 AM, said:

View PostCLNinja, on 06 December 2017 - 10:57 PM, said:

Instead of making these comments "contributers" why not use VCS like mercurial or github?
Because i don't want to have the suggestions and the program separate.

People can post "issues" on github which could very well include suggestions.
If they can post the issues here I see no point in having them post issues on GitHub.

#10 CLNinja

  • Members
  • 191 posts

Posted 07 December 2017 - 02:41 AM

View PostKidBrine, on 07 December 2017 - 02:15 AM, said:

View PostCLNinja, on 07 December 2017 - 01:37 AM, said:

View PostKidBrine, on 07 December 2017 - 01:28 AM, said:

View PostCLNinja, on 06 December 2017 - 10:57 PM, said:

Instead of making these comments "contributers" why not use VCS like mercurial or github?
Because i don't want to have the suggestions and the program separate.

People can post "issues" on github which could very well include suggestions.
If they can post the issues here I see no point in having them post issues on GitHub.
Lets say i have a change i want to recommend to you. I can take your code, clone the repo, and make the change in my code and pull request yours. If you like it, you can merge it easily.

#11 Saldor010

  • Members
  • 467 posts
  • LocationThe United States

Posted 07 December 2017 - 03:29 AM

View PostCLNinja, on 07 December 2017 - 02:41 AM, said:

Lets say i have a change i want to recommend to you. I can take your code, clone the repo, and make the change in my code and pull request yours. If you like it, you can merge it easily.

Not everyone wants to have other people touching their code. There's a difference between someone suggesting a change, and someone overwriting work you did to make that change.

#12 CLNinja

  • Members
  • 191 posts

Posted 07 December 2017 - 03:55 AM

View PostSaldor010, on 07 December 2017 - 03:29 AM, said:

View PostCLNinja, on 07 December 2017 - 02:41 AM, said:

Lets say i have a change i want to recommend to you. I can take your code, clone the repo, and make the change in my code and pull request yours. If you like it, you can merge it easily.

Not everyone wants to have other people touching their code. There's a difference between someone suggesting a change, and someone overwriting work you did to make that change.
Thats why pull requests exist? You can either merge or not, at the discretion of the owner of the repo.

#13 TheZen

  • Members
  • 65 posts
  • LocationHoquiam Wa

Posted 07 December 2017 - 06:11 AM

View PostCLNinja, on 07 December 2017 - 02:41 AM, said:

View PostKidBrine, on 07 December 2017 - 02:15 AM, said:

View PostCLNinja, on 07 December 2017 - 01:37 AM, said:

View PostKidBrine, on 07 December 2017 - 01:28 AM, said:

View PostCLNinja, on 06 December 2017 - 10:57 PM, said:

Instead of making these comments "contributers" why not use VCS like mercurial or github?
Because i don't want to have the suggestions and the program separate.

People can post "issues" on github which could very well include suggestions.
If they can post the issues here I see no point in having them post issues on GitHub.
Lets say i have a change i want to recommend to you. I can take your code, clone the repo, and make the change in my code and pull request yours. If you like it, you can merge it easily.
If you run the Pastebin program you have a full copy that you can modify on your own and then suggest that I use the modified code.

View PostCLNinja, on 07 December 2017 - 03:55 AM, said:

View PostSaldor010, on 07 December 2017 - 03:29 AM, said:

View PostCLNinja, on 07 December 2017 - 02:41 AM, said:

Lets say i have a change i want to recommend to you. I can take your code, clone the repo, and make the change in my code and pull request yours. If you like it, you can merge it easily.
If you run the Pastebin program you have a full copy that you can modify on your own and then suggest that I use the modified code.

Not everyone wants to have other people touching their code. There's a difference between someone suggesting a change, and someone overwriting work you did to make that change.
Thats why pull requests exist? You can either merge or not, at the discretion of the owner of the repo.
Then this quote above is true but not through GitHub.

If you want I can send you the code I use to combine everything into one file.

Edited by KidBrine, 07 December 2017 - 06:13 AM.


#14 CLNinja

  • Members
  • 191 posts

Posted 07 December 2017 - 06:38 AM

My point isn't the fact that your code is impossible to edit, its that providing suggestions/issues here as well as potentially showing you code would get annoying.

#15 TheZen

  • Members
  • 65 posts
  • LocationHoquiam Wa

Posted 07 December 2017 - 03:19 PM

View PostCLNinja, on 07 December 2017 - 06:38 AM, said:

My point isn't the fact that your code is impossible to edit, its that providing suggestions/issues here as well as potentially showing you code would get annoying.
What's the difference between showing me suggestions here and showing me suggestions on GitHub?

#16 CLNinja

  • Members
  • 191 posts

Posted 07 December 2017 - 08:52 PM

View PostKidBrine, on 07 December 2017 - 03:19 PM, said:

View PostCLNinja, on 07 December 2017 - 06:38 AM, said:

My point isn't the fact that your code is impossible to edit, its that providing suggestions/issues here as well as potentially showing you code would get annoying.
What's the difference between showing me suggestions here and showing me suggestions on GitHub?
A merge button to make it easy on you, organization, and easy to look at source code.

#17 SquidDev

    Frickin' laser beams | Resident Necromancer

  • Members
  • 1,427 posts
  • LocationDoes anyone put something serious here?

Posted 07 December 2017 - 09:23 PM

View PostCLNinja, on 07 December 2017 - 08:52 PM, said:

A merge button to make it easy on you, organization, and easy to look at source code.
If KidBrine is happy with their current system, I don't think there's much point in this discussion. Honestly, for a project this small GitHub does feel overkill.

#18 TheZen

  • Members
  • 65 posts
  • LocationHoquiam Wa

Posted 07 December 2017 - 10:51 PM

View PostSquidDev, on 07 December 2017 - 09:23 PM, said:

View PostCLNinja, on 07 December 2017 - 08:52 PM, said:

A merge button to make it easy on you, organization, and easy to look at source code.
If KidBrine is happy with their current system, I don't think there's much point in this discussion. Honestly, for a project this small GitHub does feel overkill.
I have my own system for merging things. SquidDev is right if someone is happy with the way they do something leave it alone.

#19 CLNinja

  • Members
  • 191 posts

Posted 08 December 2017 - 12:11 AM

View PostKidBrine, on 07 December 2017 - 10:51 PM, said:

View PostSquidDev, on 07 December 2017 - 09:23 PM, said:

View PostCLNinja, on 07 December 2017 - 08:52 PM, said:

A merge button to make it easy on you, organization, and easy to look at source code.
If KidBrine is happy with their current system, I don't think there's much point in this discussion. Honestly, for a project this small GitHub does feel overkill.
I have my own system for merging things. SquidDev is right if someone is happy with the way they do something leave it alone.
You said make suggestions and i made a suggestion. Tadah.

#20 TheZen

  • Members
  • 65 posts
  • LocationHoquiam Wa

Posted 15 January 2018 - 03:32 AM

Update notes:
  • BrineConvert has been renamed to BrineFormat.
  • BrineFormat can now convert Strings to tables and back.
  • BrineFormat Can Now Swap 2 Variables
New function usage can be found in the first post.





3 user(s) are reading this topic

0 members, 3 guests, 0 anonymous users