Liberty BASIC Community Forum
« Search Results »

Welcome Guest. Please Login or Register.
Feb 13th, 2016, 02:42am


Rules|Home|Help|Search|Recent Posts|Notification

--Liberty BASIC Resources--
Liberty BASIC Community WikiSpace
Frequently Asked Questions
Bay Six Software Forum
Liberty BASIC Home Page

Official Liberty BASIC Support
Liberty BASIC Programmer's Encyclopedia
Liberty BASIC on Rosetta Code

Search Results

Total results: 10


 1   Novice / Re: How does KILL delete a file?  on: Today at 02:10am
Started by michael | Post by Dan Teel
on Today at 01:47am, michael wrote:
From what I have read, when a file is emptied from the recycle bin, windows says it would be permanently deleted.

But as I read further a file is never really deleted, because of the restore option.

So if you ever throw your computer away, or give it to charity or sell it to a pawn shop, a person could undelete your personal information even after it has been
deleted.

So... technically, if say you made a program that had your banking records that were put in a file and say you wanted to delete them, they would never be truly be gone.

One thing about a custom program and filing system is that some people may not know how it works, especially if the program is required to interpret and present the data into a meaningful presentation.
A password built into the custom program could prevent any intrusion.
But if your file is easy to understand then you would be SOL.

When you delete a file, it is only unlinked and freed to be over written later. To truly delete it you would have to overwrite the exact location with other data, and even then with computer forensics its possible they could determine what was their before. Im sure if you open the file as binary, and write a random character to each location a few times, and then delete it, it would be safe. I'm sure their is tons of articles that go into detail about this vulnerability.
 
  Reply Quote Notify of replies

 2   Novice / Re: How does KILL delete a file?  on: Today at 01:47am
Started by michael | Post by michael
From what I have read, when a file is emptied from the recycle bin, windows says it would be permanently deleted.

But as I read further a file is never really deleted, because of the restore option.

So if you ever throw your computer away, or give it to charity or sell it to a pawn shop, a person could undelete your personal information even after it has been
deleted.

So... technically, if say you made a program that had your banking records that were put in a file and say you wanted to delete them, they would never be truly be gone.

One thing about a custom program and filing system is that some people may not know how it works, especially if the program is required to interpret and present the data into a meaningful presentation.
A password built into the custom program could prevent any intrusion.
But if your file is easy to understand then you would be SOL.
 
  Reply Quote Notify of replies

 3   Hardware Interface Coding / Re: Video input  on: Yesterday at 10:51pm
Started by Rod | Post by mmiscool
There was a web cam video capture program that I used years agoe for making a rudimentary image recognition program. I think that if you search for image recognition on the just basic forums you might find a link to it.

Will have to look and see if I can dig up the code.this would be from around 2005 or 2006.
 
  Reply Quote Notify of replies

 4   Announcements, Software and Websites / Re: LBGfx, graphics box replacement  on: Yesterday at 10:31pm
Started by Dan Teel | Post by Chris Iverson
*facepalm*

I knew it was something simple.

Thank you!

It works amazingly, and it took very little effort to convert from regular LB.
 
  Reply Quote Notify of replies

 5   Announcements, Software and Websites / Re: LBGfx, graphics box replacement  on: Yesterday at 9:11pm
Started by Dan Teel | Post by Dan Teel
Its double buffered, you gotta do a call to flip.

Add this at the end of your render routine.
Code:
Call printCmds hLBGfx, "flip"
 

 
  Reply Quote Notify of replies

 6   Announcements, Software and Websites / Re: LBGfx, graphics box replacement  on: Yesterday at 9:00pm
Started by Dan Teel | Post by Chris Iverson
I don't know if I'm missing something, but I can't seem to get anything other than a black screen. I'm sure I'm missing something simple, but I don't know what it is.

Code:
   'Form created with the help of Freeform 3 v07-15-08
    'Generated on Sep 06, 2013 at 18:20:29

    'Constants needed


    dim boxes$(5)

    DEBUG = 1

    Global hLBGfx
    hLBGfx = 0


    TPS = 60             ' Number of game ticks per second
    secondLength = 1000  ' Based on milliseconds
    quantum = secondLength / TPS ' How much time alloted per tick
    'quantum = 1000 / TPS

    running = 1          'Game is currently running
    paused = 0           'Game is currently paused

    lastTime = 0         'Time count at last save, in ms
    timeDiff = 0         'Difference between time now and time at last point, in number of ticks
    now = 0              'Time count now, in ms
    deltaTime = 0        'Amount of time last frame took to complete, in seconds; this is used to handle framerate-independent math

    lastStat = 0         'Last time stats were printed
    tpsCount = 0         'Tick count for stat usage
    fpsCount = 0         'Frame count for stat usage


    'TESTING STUFF
    Force = 0            'Force applied
    Vy = 0               'Vertical velocity
    Vx = 0               'Horizontal velocity
    g = 10            'Gravity acceleration
    playerJumpHeight = 300  'Jump height
    jumpGravity = 800
    playerMass = 200      'Player mass



[setup.m.Window]

    '-----Begin code for #m

    'nomainwin
    WindowWidth = 640
    WindowHeight = 480
    UpperLeftX=int((DisplayWidth-WindowWidth)/2)
    UpperLeftY=int((DisplayHeight-WindowHeight)/2)


    '-----Begin GUI objects code

    'graphicbox #m.gb,   0,   0, 640, 480

    '-----End GUI objects code

    graphicbox #m.gb, -100, -100, 0, 0
    open "Graphics Test" for window as #m
    call InitLBGfx

    hLBGfx = CreateLBGfx(0, 0, WindowWidth, WindowHeight, hWnd(#m), hWnd(#m.gb))
    'print #m, "down; fill white; flush"
    'print #m, "font ms_sans_serif 10"
    Call printCmds hLBGfx, "font 10 'Times New Roman'"
    'call printCmds hLBGfx, "scrollxon ";DisplayWidth;";scrollyon ";DisplayHeight;";autosizeon;size 1;font 16 'arial';fill black"
    print #m, "trapclose [quit.m]"



    'print p.time.struct

    'print quantum

    lastStat = time$("ms")
    lastTime = lastStat

    boxes$(1) = "1 1 5 5 25 blue"
    boxes$(2) = "100 300 -5 -5 25 red"
    boxes$(3) = "50 50 10 10 50 green"
    boxes$(4) = "400 400 50 50 100 yellow"
    boxes$(5) = "60 30 1 -1 10 brown"

    boxX = 10
    floorY = 300
    boxY = floorY
    boxSize = 25
    boxDelta = 25

[m.inputLoop]   'wait here for input event

    while running = 1

        'Get the current time, and check if enough time has passed to
        'start a new frame
        now = time$("ms")
        timeDiff = timeDiff + ((now - lastTime) / quantum)
        lastTime = now

        'Run as many ticks as possible. If the last render stage went long,
        'this can do multiple ticks in a row without rendering.
        '
        'This will attempt to keep the game state updating at TPS speed, even
        'if the game isn't actually drawing at that speed.
        '
        'This also keeps track of the number of ticks we perform this cycle, for stat
        'tracking.
        while timeDiff >= 1 AND paused = 0

            tpsCount = tpsCount + 1
            gosub [tick]
            timeDiff = timeDiff - 1
        wend

        'Reset the tick counter if paused.  This is where you would implement pause code.
        if paused = 1 then
            timeDiff = 0
        end if

        'Another frame will be drawn, so increment and actually draw it.
        fpsCount = fpsCount + 1
        gosub [render]

        now = time$("ms")
        remaining = int(quantum - (now - lastTime))

        'If we have time left for this frame, sleep for the rest of it
        if remaining > 0 then
            Call Sleep remaining
        end if
        scan

        'This will update the stat display/printout every second, to keep an accurate count
        'of what's going on.
        if DEBUG = 1 then
            if time$("ms") - lastStat > secondLength then
                lastStat = lastStat + secondLength
                print tpsCount; " ticks, ";fpsCount;" fps, ";remaining;" remaining"
                tps = tpsCount
                fps = fpsCount

                tpsCount = 0
                fpsCount = 0
            end if
        end if

        deltaTime = (time$("ms") - lastTime) / secondLength
    wend

    'Do game cleanup here
    call DestroyLBGfx hLBGfx
    call EndLBGfx
    close #m
    end

[tick]
    for x = 1 to 5
        boxes$(x) = BoxTick$(boxes$(x))
    next x

    Force = 0

    'if (GetKeyState(_VK_UP) AND hexdec("8000")) then
    '    boxY = max(boxY - boxDelta, 0)
    'end if

    if (GetKeyState(_VK_LEFT) AND hexdec("8000")) then
        Force = -1
    end if

    'if (GetKeyState(_VK_DOWN) AND hexdec("8000")) then
    '    boxY = min(boxY + boxDelta, WindowHeight - boxSize)
    'end if

    if (GetKeyState(_VK_RIGHT) AND hexdec("8000")) then
        Force = 1
    end if

    if (GetKeyState(_VK_SPACE) AND hexdec("8000")) then
        Vy = playerJumpHeight
    end if

    if enableJoystick then
        readjoystick 1

        'Get the values as a floating point between -1 and 1
        'This way we can mutliply it with the movement delta to get
        'a movement speed that matches the amount of pressure on the stick
        joyX = (Joy1x / 32768) - 1
        joyY = (Joy1y / 32768) - 1


        'Dead zone compensation
        if joyX > -0.2 and joyX < 0.2 or Joy1x = 0 then joyX = 0
        if joyY > -0.2 and joyY < 0.2 or Joy1y = 0 then joyY = 0

        'Move the box, but keep it constrained on the window
        boxX = boxX + (boxDelta * joyX * deltaTime)
        boxX = max(0, boxX)
        boxX = min(WindowWidth - boxSize, boxX)

        boxY = boxY + (boxDelta * joyY * deltaTime)
        boxY = max(0, min(WindowHeight - boxSize, boxY))
    end if

    'Vy = Vy - (g * deltaTime)
    if Vy <> 0 then
        'We're probably jumping

        boxY = boxY - (Vy * deltaTime)
        Vy = Vy - (jumpGravity * deltaTime)
        if boxY > floorY then   'We've hit ground
            boxY = floorY
            Vy = 0
        end if
    end if
    'Vx = Vx + ((Force / playerMass) * deltaTime)

    if Vx < 0 then
        mult = 1
    else
        if Vx > 0 then
            mult = -1
        else
            mult = 0
        end if
    end if



    deltaG = g * deltaTime
    Vx = Vx + (mult * deltaG)
    Vx = Vx + (Force * boxDelta * deltaTime)

    Vx = max(boxDelta * deltaTime * -5, min(Vx, boxDelta * deltaTime * 5))
    if Vx > -1 * deltaG AND Vx < deltaG then Vx = 0

    boxX = boxX + Vx
    'boxY = boxY + Vy

    boxX = max(0, min(WindowWidth - boxSize, boxX))
    boxY = max(0, min(WindowHeight - boxSize, boxY))

    return

[render]
    '#m, "delsegment 1"
    call printCmds hLBGfx, "fill white"
    for x = 1 to 5
        boxes$(x) = BoxDraw$(boxes$(x))
    next x
    'call printCmds hLBGfx, "place ";boxX;" ";boxY
    call printCmds hLBGfx, "color blue;backcolor blue;boxfilled ";boxX;" ";boxY;" ";boxX + boxSize;" ";boxY + boxSize
    if DEBUG = 1 then
        'call printCmds hLBGfx, "place 10 10"
        'call printCmds hLBGfx, "\FPS: ";fps;"\TPS: ";tps
        call printCmds hLBGfx, "color blue;backcolor white;text 0 0 300 50 ";_DT_LEFT;" 'FPS: ";fps;"\nTPS: ";tps;"'"
    end if
    '#m, "flush"
    return

[quit.m] 'End the program
    running = 0
    goto [m.inputLoop]

Sub Sleep time
    CallDLL #kernel32, "Sleep",_
        time as long,_
        ret as void
End Sub

Function BoxTick$(box$)
    boxPositionX = val(word$(box$, 1))
    boxPositionY = val(word$(box$, 2))
    boxDeltaX = val(word$(box$, 3))
    boxDeltaY = val(word$(box$, 4))
    boxSize = val(word$(box$, 5))
    boxColor$ = word$(box$, 6)

    If (boxPositionX + boxDeltaX < 0) or (boxPositionX + boxDeltaX + boxSize > WindowWidth) then
        boxDeltaX = boxDeltaX * -1
    End If

    If (boxPositionY + boxDeltaY < 0) or (boxPositionY + boxDeltaY + boxSize > WindowHeight) then
        boxDeltaY = boxDeltaY * -1
    End If

    boxPositionX = boxPositionX + boxDeltaX
    boxPositionY = boxPositionY + boxDeltaY

    BoxTick$ = boxPositionX;" ";boxPositionY;" ";boxDeltaX;" ";boxDeltaY;" ";boxSize;" ";boxColor$
End Function

Function BoxDraw$(box$)
    boxPositionX = val(word$(box$, 1))
    boxPositionY = val(word$(box$, 2))
    boxDeltaX = val(word$(box$, 3))
    boxDeltaY = val(word$(box$, 4))
    boxSize = val(word$(box$, 5))
    boxColor$ = word$(box$, 6)

    'call printCmds hLBGfx, "place ";boxPositionX;" ";boxPositionY
    call printCmds hLBGfx, "color ";boxColor$;";backcolor ";boxColor$;";boxfilled ";boxPositionX;" ";boxPositionY;" ";boxPositionX+boxSize;" ";boxPositionY+boxSize

    BoxDraw$ = box$
End Function

Function GetKeyState(key)
    CallDLL #user32, "GetKeyState",key As Long, GetKeyState As Long
End Function

sub InitLBGfx
    Open "LBGfx.dll" for DLL as #lbgfx
end sub

sub EndLBGfx
    close #lbgfx
end sub 


I've only included my code; the wrappers included with the DLL were removed.
 
  Reply Quote Notify of replies

 7   Novice / Re: How does KILL delete a file?  on: Yesterday at 8:11pm
Started by michael | Post by Chris Iverson
Short answer: No.

Long answer: Depends on how you look at it.

The Recycle Bin is a convenience or safety measure afforded and implemented by Windows Explorer/File Explorer(also called the shell, the primary piece of GUI that the user interacts with).

When the user interacts with the shell to delete something, it will either actually remove it, or move it to the Recycle Bin, depending on the preferences of the user.

If the preference is to immediately delete files(Recycle Bin is disabled), or the user explicitly elects to permanent erase the file, it passes the file to the DeleteFile() Win32 API.

If the preference is to delete to the Recycle Bin, it moves it there (probably) using the MoveFile() Win32 API, as well as some bookkeeping to make sure it knows how and where to restore the file.



The KILL command appears to just be a wrapper for the DeleteFile() Win32 API, provided by the kernel(in kernel32.dll) which works at a lower level than the shell, and immediately deletes the file. The Recycle Bin is a convenience provided for users, not programs.


If you want to "delete" to the Recycle Bin instead, you can ask the shell to do it for you, using the SHFileOperation() API in shell32, making sure to pass the FOF_ALLOWUNDO flag.

I know I have example code somewhere using SHFileOperation(), I think it was used to be able to delete folders that aren't empty(delete a whole directory tree). It should be easy to set the FOF_ALLOWUNDO flag on that sample code and use it to non-permanently delete files.
 
  Reply Quote Notify of replies

 8   Novice / How does KILL delete a file?  on: Yesterday at 7:33pm
Started by michael | Post by michael
I recently was using Kill "filename.ext" to delete files.
This command doesn't send the file to the recycle bin.

Does it delete the file the same as windows?
 
  Reply Quote Notify of replies

 9   Liberty BASIC Code / Re: Programming in LB for blind users.  on: Yesterday at 1:32pm
Started by raymcal | Post by Alyce Watson
Ray has written two articles. One discusses programming for the blind. The other discusses how the blind can use Liberty BASIC to write programs. There is much sample code included.

Whether you are visually impaired or not, you'll get some good information from these. Thank you very much, Ray for these ground-breaking articles.

Articles for the Blind
 
  Reply Quote Notify of replies

 10   Announcements, Software and Websites / Re: LBGfx, graphics box replacement  on: Yesterday at 10:58am
Started by Dan Teel | Post by Dan Teel
on Yesterday at 10:00am, cundo wrote:
Dan, do I need to clear the memory after each drawbmp? Do I need to clear the memory at all? Will cls do that? Thanks in advance.

No, as rod mentioned, it simply blits it to the back buffer and doesnt use any more memory than what you had allocated before you called the drawbmp.

The only worry for you in regards to memory management is to unload or destroy the bitmap when youre done with it.
 
  Reply Quote Notify of replies


Rules|Home|Help|Search|Recent Posts|Notification



Donate $6.99 for 50,000 Ad-Free Pageviews!

| |

This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls