Jump to content




[CC1.3]String Utils Api



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

#1 Xtansia

  • Members
  • 492 posts
  • LocationNew Zealand

Posted 07 February 2012 - 06:32 AM

This my String Utils API.

Stats:
-Function Count = 43
-Line Count = 953
-Character Count = 34110
-File Size = 34KB
-Local Functions/Variables(Used by string functions) = 45

Function Listing:
Spoiler

Example Output:
Spoiler

To install:
Spoiler

To use:
Spoiler

License:
Spoiler

If you need clarification on something just ask.
If you find any bugs or errors please report them.

Download:
GitHub
BitBucket
Projects:
GitHub
BitBucket

#2 FuzzyPurp

    Part-Time Ninja

  • Members
  • 510 posts
  • LocationHarlem, NY

Posted 07 February 2012 - 04:51 PM

Testing*

#3 Espen

    Curious Explorer

  • Members
  • 708 posts

Posted 07 February 2012 - 07:28 PM

@tomass1996:
These are some very useful functions.
But why did you hide their source as bytecode? Don't you want other people to understand the inner workings?
Don't get me wrong, I'm not trying to get at you or sth. I'm just genuinely curious as to why you would hide these algorithms, most of which are already known anyway?

#4 Xtansia

  • Members
  • 492 posts
  • LocationNew Zealand

Posted 08 February 2012 - 02:53 AM

View PostEspen, on 07 February 2012 - 07:28 PM, said:

@tomass1996:
These are some very useful functions.
But why did you hide their source as bytecode? Don't you want other people to understand the inner workings?
Don't get me wrong, I'm not trying to get at you or sth. I'm just genuinely curious as to why you would hide these algorithms, most of which are already known anyway?

There is no real reason as such.
The only functions that would have a legit reason for hiding is the encryption and decryption algorithms,
I will probably end up posting it as standard code eventually anyway.

#5 Casper7526

    OG of CC

  • Members
  • 362 posts

Posted 08 February 2012 - 03:04 AM

Basically he just learned about compiled bytecode and wanted to play with it and use it in an application :P/>

#6 Xtansia

  • Members
  • 492 posts
  • LocationNew Zealand

Posted 08 February 2012 - 03:12 AM

View PostCasper7526, on 08 February 2012 - 03:04 AM, said:

Basically he just learned about compiled bytecode and wanted to play with it and use it in an application :P/>

That too...

#7 Xtansia

  • Members
  • 492 posts
  • LocationNew Zealand

Posted 08 February 2012 - 03:51 AM

Just realised there was an error in the API file where the path for the lib was rom/libs/StringUtils.lib instead of rom/libs/StringUtil.lib

So put up a new zip ppl may have gotten this error if you did just change the path in StrUtil file.

#8 Xtansia

  • Members
  • 492 posts
  • LocationNew Zealand

Posted 08 February 2012 - 08:29 AM

Another quick patch,
Minor stuff.

#9 Espen

    Curious Explorer

  • Members
  • 708 posts

Posted 08 February 2012 - 11:58 AM

View Posttomass1996, on 08 February 2012 - 02:53 AM, said:

View PostEspen, on 07 February 2012 - 07:28 PM, said:

@tomass1996: These are some very useful functions. But why did you hide their source as bytecode? Don't you want other people to understand the inner workings? Don't get me wrong, I'm not trying to get at you or sth. I'm just genuinely curious as to why you would hide these algorithms, most of which are already known anyway?
There is no real reason as such. The only functions that would have a legit reason for hiding is the encryption and decryption algorithms, I will probably end up posting it as standard code eventually anyway.

View PostCasper7526, on 08 February 2012 - 03:04 AM, said:

Basically he just learned about compiled bytecode and wanted to play with it and use it in an application :P/>
*Understanding nod* .. as I said I was just curious and thought as much (it being programming exercise). Thanks for clarifying!

View Posttomass1996, on 08 February 2012 - 08:29 AM, said:

Another quick patch, Minor stuff.
Hehe, and as long as the source is closed you're the only person able to both notice and fix these things.
That (and my general curiosity of how things work) is the main reason why I asked in the first place. :P/>

But I have to respectfully disagree on what you said about the encryption code needing obfuscation.
The security of an encryption algorithm should never hinge on the obscurity of its inner workings, but on the key you use to encrypt a message with it.
Well, only if you want to be as secure as possible in principle as well.
Practically though, I can't really imagine anyone encrypting serious data. Most will use it for RPG reasons, so the real security might not be of major concern.^^

But If you're interested, here's some more interesting info about it:
http://en.wikipedia....fs%27_principle
http://en.wikipedia....ty_by_obscurity

One can never know enough. :D/>
Thanks again for clarification, take care!

#10 Xtansia

  • Members
  • 492 posts
  • LocationNew Zealand

Posted 09 February 2012 - 08:05 AM

Yay Open Source!

#11 Xtansia

  • Members
  • 492 posts
  • LocationNew Zealand

Posted 16 February 2012 - 09:51 AM

Added More functions,
Spoiler

Zipfile now also contains a function listing for quick reference.

#12 MewK

    RWTK Developer

  • Members
  • 44 posts
  • LocationGermany

Posted 01 March 2012 - 09:48 AM

Hey tomass,

I'm planning to include your library in one of my projects. That's why I wanted to ask if you have any problems with that and furthermore under what kind conditions/license have you released this lib? My plan is to release my project under the MIT license with full credits. Would that be okay with you?

-MewK

#13 ThePH

  • Members
  • 31 posts

Posted 01 March 2012 - 10:03 AM

NOOOOO !
You outran me, I was gonna post something similar B)/>
nice work though :unsure:/>

Can I use some of it in my encoder API? (I will give you credit B)/> )

#14 Xtansia

  • Members
  • 492 posts
  • LocationNew Zealand

Posted 01 March 2012 - 12:15 PM

View PostMewK, on 01 March 2012 - 09:48 AM, said:

Hey tomass,

I'm planning to include your library in one of my projects. That's why I wanted to ask if you have any problems with that and furthermore under what kind conditions/license have you released this lib? My plan is to release my project under the MIT license with full credits. Would that be okay with you?

-MewK

Hey that would be fine with me,
I need to update the op but it's effectively the same license as here http://www.computerc...__fromsearch__1
It's a slightly altered mit license, basicly just that you can't sell my stuff.
BTW what's your project?

#15 Xtansia

  • Members
  • 492 posts
  • LocationNew Zealand

Posted 01 March 2012 - 12:23 PM

View PostThePH, on 01 March 2012 - 10:03 AM, said:

NOOOOO !
You outran me, I was gonna post something similar B)/>
nice work though :unsure:/>

Can I use some of it in my encoder API? (I will give you credit B)/> )

Thnx.
Same as above read the license in that post I'm going to update this op in the morning. Aslong as I am credited and you list/mark/flag the functions that are from mine.

#16 MewK

    RWTK Developer

  • Members
  • 44 posts
  • LocationGermany

Posted 01 March 2012 - 01:24 PM

View Posttomass1996, on 01 March 2012 - 12:15 PM, said:

Hey that would be fine with me,
I need to update the op but it's effectively the same license as here http://www.computerc...__fromsearch__1
It's a slightly altered mit license, basicly just that you can't sell my stuff.
BTW what's your project?

My main project is still the Midcraft Commander.

However I'm working on a API project right now. It will be called rwtk (Redworks Toolkit) and my plan is to integrate and replace the RW API.
The API will include an event-driven-application-framework for GUI based apps, a basic drawing lib that will be used by the app-framework, a small core framework for basic stuff like class-handling. To add more functionality I'm looking for good libraries to add. your string lib would be the first candidate, a proper turtle lib would be a next candidate. I will port Midcraft Commander to the new API and step by step all Redworks programs. A long term goal would be to implement a rwtk.netfs lib, that will allow to do file system actions across the network.

It is important to me that the new API is good enough to be the defacto standard for CC software development. But to achieve that I have to get as many ppl on board as possible. The project will be hosted on GitHub, will have a full documentation and I hope that a few ppl want to help developing it.

#17 Xtansia

  • Members
  • 492 posts
  • LocationNew Zealand

Posted 01 March 2012 - 06:46 PM

View PostMewK, on 01 March 2012 - 01:24 PM, said:

View Posttomass1996, on 01 March 2012 - 12:15 PM, said:

Hey that would be fine with me.
I need to update the op but it's effectively the same license as here http://www.computerc...__fromsearch__1
It's a slightly altered mit license, basicly just that you can't sell my stuff.
BTW what's your project?

My main project is still the Midcraft Commander.

However I'm working on a API project right now. It will be called rwtk (Redworks Toolkit) and my plan is to integrate and replace the RW API.
The API will include an event-driven-application-framework for GUI based apps, a basic drawing lib that will be used by the app-framework, a small core framework for basic stuff like class-handling. To add more functionality I'm looking for good libraries to add. your string lib would be the first candidate, a proper turtle lib would be a next candidate. I will port Midcraft Commander to the new API and step by step all Redworks programs. A long term goal would be to implement a rwtk.netfs lib, that will allow to do file system actions across the network.

It is important to me that the new API is good enough to be the defacto standard for CC software development. But to achieve that I have to get as many ppl on board as possible. The project will be hosted on GitHub, will have a full documentation and I hope that a few ppl want to help developing it.

Cool,
I'm going to do a few wee updates to this,
And I'll be hosting it on github for easier updating.

#18 Biohazard

  • New Members
  • 2 posts
  • LocationIllegalLocationException

Posted 01 March 2012 - 08:34 PM

Looks useful :unsure:/>. I'm downloading it, and good luck with extending it B)/>

#19 FuzzyPurp

    Part-Time Ninja

  • Members
  • 510 posts
  • LocationHarlem, NY

Posted 01 March 2012 - 08:54 PM

View PostMewK, on 01 March 2012 - 01:24 PM, said:

View Posttomass1996, on 01 March 2012 - 12:15 PM, said:

Hey that would be fine with me,
I need to update the op but it's effectively the same license as here http://www.computerc...__fromsearch__1
It's a slightly altered mit license, basicly just that you can't sell my stuff.
BTW what's your project?

My main project is still the Midcraft Commander.

However I'm working on a API project right now. It will be called rwtk (Redworks Toolkit) and my plan is to integrate and replace the RW API.
The API will include an event-driven-application-framework for GUI based apps, a basic drawing lib that will be used by the app-framework, a small core framework for basic stuff like class-handling. To add more functionality I'm looking for good libraries to add. your string lib would be the first candidate, a proper turtle lib would be a next candidate. I will port Midcraft Commander to the new API and step by step all Redworks programs. A long term goal would be to implement a rwtk.netfs lib, that will allow to do file system actions across the network.

It is important to me that the new API is good enough to be the defacto standard for CC software development. But to achieve that I have to get as many ppl on board as possible. The project will be hosted on GitHub, will have a full documentation and I hope that a few ppl want to help developing it.

Sweet, i hope tomass can get on board with us :unsure:/>

#20 Xtansia

  • Members
  • 492 posts
  • LocationNew Zealand

Posted 02 March 2012 - 03:37 AM

Another wee update:
Added:
toCharTable(string) --Returns table of @string's chars
toByteTable(string) --Returns table of @string's bytes
fromCharTable(chars) --Returns string made of chracters in @chars
fromByteTable(bytes) --Returns string made of bytes in @bytes

Now hosted on GitHub.
Added license to op.

View PostFuzzyPurp, on 01 March 2012 - 08:54 PM, said:

Spoiler

Sweet, i hope tomass can get on board with us :unsure:/>

Yeh I'm all for it,
I'm not the most amazing at lua but I support it and the use of my api,
I'll contribute whatever I can.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users