Jump to content


Lemmmy's Content

There have been 154 items by Lemmmy (Search limited from 10-February 22)


By content type

See this member's


Sort by                Order  

#256207 CC-SQL | A bridge between Lua and MySQL

Posted by Lemmmy on 15 July 2016 - 05:07 PM in APIs and Utilities

View PostGorzoid, on 15 July 2016 - 04:23 PM, said:

Just remember you are doing this all through bluebirds websites so you are trusting him with your database info. So you know, don't use any important databases.

i can see this being a major no-thank-you - thanks for bringing this to attention



#256206 SimSoft Yellow - A Simple And Fast OS

Posted by Lemmmy on 15 July 2016 - 05:05 PM in Operating Systems

View PostSimlor, on 15 July 2016 - 02:08 PM, said:

View PostLemmmy, on 13 July 2016 - 04:05 PM, said:

update the version number in the op

I changed the headline of screenshots, or what do you mean?
ok good



#256076 SimSoft Yellow - A Simple And Fast OS

Posted by Lemmmy on 13 July 2016 - 04:05 PM in Operating Systems

update the version number in the op



#256075 [Results in!] CCJam 2016

Posted by Lemmmy on 13 July 2016 - 03:57 PM in General

is jamrogue epic



#255779 View Current Crafting in ME Network

Posted by Lemmmy on 08 July 2016 - 05:27 PM in Ask a Pro

Try having a look at the methods available to you by using opdoc when your computer is placed next to (or connected to via a Wired Modem) a Crafting CPU.



#255778 How can I create a progress bar?

Posted by Lemmmy on 08 July 2016 - 05:24 PM in Ask a Pro

term.setBackgroundColour(colours.white)
term.write((" "):rep(math.floor(progress / maxProgress) * barWidth))



#255766 Circles 2 - A Simple API that draws circles

Posted by Lemmmy on 08 July 2016 - 03:27 PM in APIs and Utilities

View PostEtzGamer, on 08 July 2016 - 02:28 PM, said:

-Used Pythagorean Theorem to replace existing drawCircle() algorithm (it's more efficient and accurate)

I said it wasn't, and it isn't - implement Bresenham's Midpoint Circle Algorithm instead.



#255765 RandString - a random string generator API

Posted by Lemmmy on 08 July 2016 - 03:22 PM in APIs and Utilities

stringtable[math.random(#stringtable)] is not secure random. Do not use it for encryption, passwords or the likes. Here is a program which can generate cryptographically secure random numbers - it is an API therefore you could interface it with RandString by using stringtable[csrng.random(1, #stringtable)] instead, or write your own implementation of a cryptographically secure random number generator algorithm.

View PostElvishJerricco, on 26 May 2013 - 10:07 AM, said:

To be secure, the generator cannot be predictable. With linear random number generators (the fast ones like math.random in lua) you can see the previous value and determine what the next one will be. With this algorithm, and with all cryptographically secure generators, even if you've seen all the numbers emitted so far, you cannot predict the next number. You have to know the seed, which is usually a well kept secret from hackers.



#255717 [Results in!] CCJam 2016

Posted by Lemmmy on 07 July 2016 - 03:50 PM in General

excellent guidelines oeed, they seem appropriate for all future ccjam's imo

View PostCrazedProgrammer, on 07 July 2016 - 01:43 PM, said:

Can the README.md link to the forum topic of the project like I did?

should be ok



#255676 What are you listening to right now?

Posted by Lemmmy on 07 July 2016 - 12:22 AM in Forum Games

xiao mei mei music is my favourite music



#255600 Monitors are Excessively hard on FPS

Posted by Lemmmy on 05 July 2016 - 11:58 PM in Media

View Postjv110, on 05 July 2016 - 08:23 PM, said:

Anyway, the resolution is too high. Isn't that obvious? CC isn't the best at speed either.

this post was originally in bug reports/suggestions to show that some speed improvement may need to be made.



#255597 Smallet | Lightweight basic computer compatible wallet for krist!

Posted by Lemmmy on 05 July 2016 - 10:52 PM in Programs

Looks awesome! One bug I noticed is going from T to N gives this error:

Posted Image

Edit: Looks like its because you're calling names() before it was defined - you can solve this by forward declaring the functions.



#255595 What are you listening to right now?

Posted by Lemmmy on 05 July 2016 - 10:49 PM in Forum Games

the sound of death



#255569 How to download a webpage source

Posted by Lemmmy on 05 July 2016 - 05:54 PM in Ask a Pro

View Postthecrimulo, on 05 July 2016 - 05:44 PM, said:

I'm on a server with a version that doesn't have builtin wget, so i tried http://www.computercraft.info/forums2/index.php?/topic/22036-wget-program-file-downloader-gui-much-wow/

then that's a problem with the program itself



#255567 "Go to top" button contains a dead image

Posted by Lemmmy on 05 July 2016 - 05:42 PM in Forum Discussion

Posted Image

http://www.computerc...erCraft/top.png



#255566 How to download a webpage source

Posted by Lemmmy on 05 July 2016 - 05:38 PM in Ask a Pro

View Postthecrimulo, on 05 July 2016 - 05:37 PM, said:

I was testing with two pages, https://google.com, a complex one and unindented, and https://example.org, which is simple and indented

exactly what command were you typing?



#255564 How to download a webpage source

Posted by Lemmmy on 05 July 2016 - 05:36 PM in Ask a Pro

View Postthecrimulo, on 05 July 2016 - 05:33 PM, said:

I was testing with two pages, https://google.com, a complex one and unindented, and https://example.org, which is simple and indented

exactly what command were you typing?



#255561 How to download a webpage source

Posted by Lemmmy on 05 July 2016 - 05:33 PM in Ask a Pro

View Postthecrimulo, on 01 July 2016 - 07:55 PM, said:

It errors for me. event = "key_up", eUrl = 28, content=""

if it helps, you need to pass in a URL like this (though this is probably unrelated to your error):
https://raw.githubus...branch/file.ext



#255537 Circles 2 - A Simple API that draws circles

Posted by Lemmmy on 05 July 2016 - 12:18 PM in APIs and Utilities

View PostBomb Bloke, on 05 July 2016 - 11:39 AM, said:

View PostEtzGamer, on 05 July 2016 - 09:16 AM, said:

Also, could you emphasize on 'allowing the user to pass in their own term objects to draw the circles with'?

Allow this sort of thing:

local mon = peripheral.wrap("right")

local oldTerm = term.redirect(mon)

circles.drawCircle(5, 10, 10, colours.yellow)

term.redirect(oldTerm)

... to instead be performed via this sort of thing:

local mon = peripheral.wrap("right")

circles.drawCircle(5, 10, 10, colours.yellow, mon)

More common usages include redirecting to a framebuffer from Lyqyd's framebuffer API, a surface from CrazedProgrammer's Surface API, windows from ComputerCraft's window API, windows from Bomb Bloke's BLittle API and more.



#255520 Circles 2 - A Simple API that draws circles

Posted by Lemmmy on 05 July 2016 - 12:15 AM in APIs and Utilities

View PostEldidiStroyrr, on 04 July 2016 - 11:24 PM, said:

The characters for ComputerCraft are not square, they are 5x7. So, like, this new circle render function would make the circle 7/5 of the radius wider.

what are you on, characters are 1:1.5 w:h ratio, so they are 6x9 not 5x7

standard text characters are 5:7 though but regular drawing chars don't include that whitespace of course



#255515 Circles 2 - A Simple API that draws circles

Posted by Lemmmy on 04 July 2016 - 10:52 PM in APIs and Utilities

For filled circles, you can use the Pythagoras Theorem. However, this algorithm draws a few extra pixels, but it shows one of the ways you can draw them.

for y = -radius, radius do
    for x = -radius, radius do
        if x * x + y * y <= radius * radius then
            --# draw pixel at x + originX, y + originY
        end
    end
end

Another method, and this is the method I would recommend you use for both non-filled and filled, is Bresenham's Midpoint Circle Algorithm. This is the most accurate way to draw a circle, and it is fairly fast. I'd suggest reading up on how it works. Wikipedia shows you an implementation for outlined circles in C and JavaScript, which should be easy to port to Lua.

In order to draw filled circles, you can change the algorithm slightly, so instead of:
plot(x0 + x, y0 + y)
plot(x0 - x, y0 + y)
and similar lines, you instead do:
paintutils.drawLine(x0 - x, y0 + y, x0 + x, y0 + y)

Generally, I would also suggest allowing the user to pass in their own term objects to draw the circles with, instead of having to redirect to the term object just to use paintutils. This means you need to implement line drawing. Luckily, Bresenham also came up with a line drawing algorithm. Allowing users to pass in their own term object would let them use your API in a buffer such as a framebuffer, or BLittle's drawing buffer.



#255512 [Results in!] CCJam 2016

Posted by Lemmmy on 04 July 2016 - 09:49 PM in General

View PostChecco2212, on 04 July 2016 - 08:59 PM, said:

For me the website is down... Is it also for you?

Update on ccjam.ceriat.net - 3d6 is attempting to bring the ccjam site back as soon as possible

Edit: The site should be back up - give it an hour for DNS changes to apply though



#255498 [Relaunched] [1.12.2] SwitchCraft [Survival] [Krist] [CC:Tweaked1.80p...

Posted by Lemmmy on 04 July 2016 - 06:43 PM in Servers

View PostCrazedProgrammer, on 04 July 2016 - 06:32 PM, said:

Good post Lemmy, very constructive!

thank you i really worked hard on it i had to type and stuff



#255492 [Relaunched] [1.12.2] SwitchCraft [Survival] [Krist] [CC:Tweaked1.80p...

Posted by Lemmmy on 04 July 2016 - 06:30 PM in Servers

i like the server because you can survive in it



#255490 Nova Labs Logo

Posted by Lemmmy on 04 July 2016 - 06:29 PM in Media

i like the colours except maybe you should change the colours