Omnimaga: The Coders Of Tomorrow
Welcome, Guest. Please login or register.
 
Omnimaga: The Coders Of Tomorrow
25 May, 2013, 19:46:28 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   home   news downloads projects tutorials misc forums rules new posts irc about Login Register  
+-OmnomIRC

You must Register, be logged in and have at least 40 posts to use this shout-box! If it still doesn't show up afterward, it might be that OmnomIRC is disabled for your group or under maintenance.

Note: You can also use an IRC client like mIRC, X-Chat or Mibbit to connect to an EFnet server and #omnimaga.

Pages: 1 [2]   Go Down
  Print  
Author Topic: Lua code optimizer for pc -  (Read 1893 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
Jim Bauwens
Lua! Nspire! Linux!
Editor
LV10 31337 u53r (Next: 2000)
*
Online Online

Gender: Male
Last Login: Today at 19:28:54
Date Registered: 28 February, 2011, 22:32:12
Location: Belgium
Posts: 1733


Total Post Ratings: +180

View Profile WWW
« Reply #15 on: 06 January, 2012, 11:43:33 »
0

Yes, that should do Smiley
Logged

Nick
LV9 Veteran (Next: 1337)
*********
Offline Offline

Gender: Male
Last Login: Today at 15:20:51
Date Registered: 05 June, 2011, 20:01:07
Location: 51° 12′ 34″ N, 3° 13′ 31″ E
Posts: 1179


Topic starter
Total Post Ratings: +158

View Profile WWW
« Reply #16 on: 06 January, 2012, 11:47:45 »
0

thanks, changed it Smiley
Logged

Jim Bauwens
Lua! Nspire! Linux!
Editor
LV10 31337 u53r (Next: 2000)
*
Online Online

Gender: Male
Last Login: Today at 19:28:54
Date Registered: 28 February, 2011, 22:32:12
Location: Belgium
Posts: 1733


Total Post Ratings: +180

View Profile WWW
« Reply #17 on: 06 January, 2012, 11:52:26 »
0

This is a bit more trickier, but it should work too.
Escape sequences like "\012" or "\002" don't need the 0's too. But of course you must be sure they aren't followed by a normal character.
I suppose you might need some regular expressions for this.
Logged

Nick
LV9 Veteran (Next: 1337)
*********
Offline Offline

Gender: Male
Last Login: Today at 15:20:51
Date Registered: 05 June, 2011, 20:01:07
Location: 51° 12′ 34″ N, 3° 13′ 31″ E
Posts: 1179


Topic starter
Total Post Ratings: +158

View Profile WWW
« Reply #18 on: 06 January, 2012, 11:55:24 »
0

hmm, that's indeed a bit tricky xp

but i'll try it

are there any other optimizations in the code itself?
what is the default setting for text-align? since that default can be removed too..
Logged

Jim Bauwens
Lua! Nspire! Linux!
Editor
LV10 31337 u53r (Next: 2000)
*
Online Online

Gender: Male
Last Login: Today at 19:28:54
Date Registered: 28 February, 2011, 22:32:12
Location: Belgium
Posts: 1733


Total Post Ratings: +180

View Profile WWW
« Reply #19 on: 06 January, 2012, 11:56:38 »
0

Don't remove it, you need it for compatibility in newer versions AFAIK.
Logged

Nick
LV9 Veteran (Next: 1337)
*********
Offline Offline

Gender: Male
Last Login: Today at 15:20:51
Date Registered: 05 June, 2011, 20:01:07
Location: 51° 12′ 34″ N, 3° 13′ 31″ E
Posts: 1179


Topic starter
Total Post Ratings: +158

View Profile WWW
« Reply #20 on: 11 January, 2012, 20:36:23 »
0

UPDATE!!!

include external .lua files by using %, followed by the name of the file (without the .lua)

example main file:

1
2
3
4
function on.create()
%varsinit
end


varsinit.lua file:

1
2
3
4
5
menu = true
game = false
highscore = (var.recall("HS")  or 0)
score = 0

results in:

1
2
3
4
5
6
7
function on.create()
menu = true
game = false
highscore = (var.recall("HS")  or 0)
score = 0
end
« Last Edit: 11 January, 2012, 22:21:54 by Nick » Logged

adriweb
Editor
LV9 Veteran (Next: 1337)
*
Offline Offline

Gender: Male
Last Login: 23 May, 2013, 12:02:44
Date Registered: 13 April, 2011, 18:42:59
Location: South of France
Posts: 1197


Total Post Ratings: +185

View Profile WWW
« Reply #21 on: 11 January, 2012, 21:23:25 »
0

UPDATE!!!

include external .lua files by using #, followed by the name of the file (without the .lua)

example main file:

1
2
3
4
function on.create()
#varsinit
end


What ??

#varsinit returns the number of elements in the "varsinit" table ...
You've overriden the metatables ?
« Last Edit: 12 January, 2012, 00:01:35 by adriweb » Logged


TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation
Nick
LV9 Veteran (Next: 1337)
*********
Offline Offline

Gender: Male
Last Login: Today at 15:20:51
Date Registered: 05 June, 2011, 20:01:07
Location: 51° 12′ 34″ N, 3° 13′ 31″ E
Posts: 1179


Topic starter
Total Post Ratings: +158

View Profile WWW
« Reply #22 on: 11 January, 2012, 21:26:24 »
0

oh, forgot about that.. thanks for reminding me Ö i feel quite ashamed right now for not having thought of it myself  Embarrassed


i changed it to %<filename>

i hope this isn't a problem?
« Last Edit: 11 January, 2012, 22:47:48 by Nick » Logged

Jim Bauwens
Lua! Nspire! Linux!
Editor
LV10 31337 u53r (Next: 2000)
*
Online Online

Gender: Male
Last Login: Today at 19:28:54
Date Registered: 28 February, 2011, 22:32:12
Location: Belgium
Posts: 1733


Total Post Ratings: +180

View Profile WWW
« Reply #23 on: 11 January, 2012, 22:53:48 »
0

You should make that it only works in the beginning of the file, since % is used for modulus and stuff.
But nice idea anyway.
Logged

Nick
LV9 Veteran (Next: 1337)
*********
Offline Offline

Gender: Male
Last Login: Today at 15:20:51
Date Registered: 05 June, 2011, 20:01:07
Location: 51° 12′ 34″ N, 3° 13′ 31″ E
Posts: 1179


Topic starter
Total Post Ratings: +158

View Profile WWW
« Reply #24 on: 11 January, 2012, 22:57:14 »
0

nah, i want to make it work through the whole file, since it might be useful to make whole parts in different files, and then paste them together.
i did not only do it to include initializations, but for functions and other stuff too

so maybe §<filename> ? i guess that's not used?

and just to be clear, it only adapts those who are at the total left border of the page, it does not change the ones that are in formulas or so..
« Last Edit: 11 January, 2012, 22:58:57 by Nick » Logged

epic7
Chopin!
LV11 Super Veteran (Next: 3000)
***********
Offline Offline

Gender: Male
Last Login: Today at 04:47:54
Date Registered: 22 October, 2011, 01:45:43
Location: Northeast US
Posts: 2172


Total Post Ratings: +122

View Profile
« Reply #25 on: 12 January, 2012, 01:22:01 »
0

I don't have that wierd S-like symbol on my keyboard, and I have no clue what it means Tongue

Is it some foreign (to me Tongue) currency?
Logged



Current Projects:
TitleLanguageProgressStatus
DrillMiner    C (ndless)   35%         Active
?     C (ndless)   0%        Unconfirmed

Spoiler for Programming languages I currently know:
Java (Learning in AP Comp Sci)
C (Specifically Ndless)
Unity JavaScript
LabView (For FIRST robotics)
z80 ASM (Just a little bit Tongue)
Nick
LV9 Veteran (Next: 1337)
*********
Offline Offline

Gender: Male
Last Login: Today at 15:20:51
Date Registered: 05 June, 2011, 20:01:07
Location: 51° 12′ 34″ N, 3° 13′ 31″ E
Posts: 1179


Topic starter
Total Post Ratings: +158

View Profile WWW
« Reply #26 on: 12 January, 2012, 08:02:43 »
0

no, it's  a paragraph sign.. well, if you don't have it, then i won't take it, maybe & or @ ?

aaargh, i really need to find a symbol for it Smiley
Logged

Nick
LV9 Veteran (Next: 1337)
*********
Offline Offline

Gender: Male
Last Login: Today at 15:20:51
Date Registered: 05 June, 2011, 20:01:07
Location: 51° 12′ 34″ N, 3° 13′ 31″ E
Posts: 1179


Topic starter
Total Post Ratings: +158

View Profile WWW
« Reply #27 on: 12 January, 2012, 18:16:17 »
0

UPDATE!!

now it saves settings to an external file, possible settings:
  • Optimize the file (get rid of comments, whitespaces etc)
  • include the needed files
  • save made file automatically with adaptable suffix
  • suffix for the savename, changes to optimized if nothing
  • copy file to clipboard, i don't really see the point of it yet, but it might be useful (?)

Possibilities for include file:
  • %
  • &
  • ~
  • @
  • °
  • £
  • µ

in fact, i like the second one the most, maybe that one?

the lay-out of the program itself changed too, but not that much to upload a new screenie

this is the settings pop-up screen:


* settings.gif (8.44 KB, 300x270 - viewed 62 times.)
« Last Edit: 12 January, 2012, 18:18:26 by Nick » Logged

epic7
Chopin!
LV11 Super Veteran (Next: 3000)
***********
Offline Offline

Gender: Male
Last Login: Today at 04:47:54
Date Registered: 22 October, 2011, 01:45:43
Location: Northeast US
Posts: 2172


Total Post Ratings: +122

View Profile
« Reply #28 on: 14 January, 2012, 04:43:37 »
0

UPDATE!!!

include external .lua files by using #, followed by the name of the file (without the .lua)

example main file:

1
2
3
4
function on.create()
#varsinit
end


What ??

#varsinit returns the number of elements in the "varsinit" table ...
You've overriden the metatables ?

Does that mean
table={1,2,3,4,5,6,7,8,9}
x=#table
And x would equal 9?
That would be useful to use Tongue
« Last Edit: 14 January, 2012, 04:43:56 by epic7 » Logged



Current Projects:
TitleLanguageProgressStatus
DrillMiner    C (ndless)   35%         Active
?     C (ndless)   0%        Unconfirmed

Spoiler for Programming languages I currently know:
Java (Learning in AP Comp Sci)
C (Specifically Ndless)
Unity JavaScript
LabView (For FIRST robotics)
z80 ASM (Just a little bit Tongue)
Nick
LV9 Veteran (Next: 1337)
*********
Offline Offline

Gender: Male
Last Login: Today at 15:20:51
Date Registered: 05 June, 2011, 20:01:07
Location: 51° 12′ 34″ N, 3° 13′ 31″ E
Posts: 1179


Topic starter
Total Post Ratings: +158

View Profile WWW
« Reply #29 on: 14 January, 2012, 23:46:55 »
0

yeah, that means that Smiley
« Last Edit: 14 January, 2012, 23:47:02 by Nick » Logged

Pages: 1 [2]   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Powered by MySQL Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Powered by PHP
Page created in 0.202 seconds with 31 queries.
Skin by DJ Omnimaga edited from SMF default theme with the help of tr1p1ea.
All programs, games and songs avaliable on this website are property of their respective owners.
Best viewed in Opera, Firefox, Chrome and Safari with a resolution of 1024x768 or above.