Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Munchor

Pages: 1 ... 4 5 [6] 7 8 ... 20
76
Humour and Jokes / POKÉMON IN REAL LIFE!
« on: June 19, 2011, 04:05:02 pm »
I found these videos, epic awesome:





What do you think?

77
Lua / Setting up Nspire Lua on Linux
« on: June 19, 2011, 03:00:41 pm »
I just made a very quick and simple video on how to compile and make Nspire Lua programs on Linux.



I hope you like it ;) Any questions just post.

78
Humour and Jokes / Linux Screen Capturer - Epic Fail
« on: June 19, 2011, 12:57:32 pm »
Just found an epic fail here.

Good luck finding it.

79
Computer Programming / Java - Load Images on Screen Display
« on: June 19, 2011, 11:17:04 am »
I was trying to load 2 images in a display screen I made (inside a JFrame), but the screen appears empty and no images :/

Screen.java
Code: [Select]
import java.awt.*;
import javax.swing.JFrame;

public class Screen {

private GraphicsDevice vc; //Allows access to Graphics Card

public Screen() {
GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
vc = env.getDefaultScreenDevice();
}

public void setFullScreen(DisplayMode dm, JFrame window) {
window.setUndecorated(true);
window.setResizable(false);
vc.setFullScreenWindow(window);

if (dm != null && vc.isDisplayChangeSupported()) {
try {
vc.setDisplayMode(dm);
} catch(Exception ex) {

}
}

}

public Window getFullScreenWindow() {
return vc.getFullScreenWindow();
}

public void restoreScreen() {
Window w = vc.getFullScreenWindow();
if (w != null) {
w.dispose();
}
vc.setFullScreenWindow(null);
}

}

Images.java
Code: [Select]
import java.awt.*;
import javax.swing.ImageIcon;
import javax.swing.JFrame;


public class Images extends JFrame {
public static void main(String[] args) {
DisplayMode dm = new DisplayMode(800,600,16,DisplayMode.REFRESH_RATE_UNKNOWN);
Images i = new Images();

i.run(dm);

}

private Screen s;
private Image bg;
private Image pic;
private boolean loaded;

//run method
public void run(DisplayMode dm) {
setForeground(Color.WHITE);
setFont(new Font("Arial", Font.PLAIN, 24));

loaded = false;

s = new Screen();

try {
s.setFullScreen(dm, this);
loadpics();
try {
Thread.sleep(5000);
} catch (Exception ex) {}
} finally {
s.restoreScreen();
}
}

public void loadpics() {
bg = new ImageIcon("background.jpeg").getImage();
pic = new ImageIcon("face.png").getImage();
loaded = true;
repaint();
}

public void paint(Graphics g) {
if (g instanceof Graphics2D) {
Graphics2D g2 = (Graphics2D)g; //Typecasting g to Graphics2D
g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
}

if (loaded) {
g.drawImage(bg,0,0,null);
g.drawImage(pic,170,180,null);
}
}
}

I got this from one of thenewboston's tutorials and my code is supposedly equal to his, but it doesn't really work for me.

The images are saved in the same folder as the .class files, with the same names as in the code.

Thanks in advance.

80
OmnomIRC Development / OmnomIRC on Chromium
« on: June 18, 2011, 06:06:45 am »
I am using 12.0.742.91 (87961) Built on Ubuntu 10.10, running on Linux Mint 10, 64 bit, and I can't use OmnomIRC.

In fact, I can type and send messages, but I can't see the chat, below is a screenshot:


81
Computer Programming / Factorial Output
« on: June 16, 2011, 05:38:03 pm »
I was trying to make a C Program that returns the factorial of a given number without using any libraries (besides stdio.h).

Code: [Select]
#include <stdio.h>

int main();
int factorial(int n);

int main() {
   
    int n;
   
    scanf("%d",&n);
   
    int i;
    for (i=0;i<n;i++)
    {
        int x;
        scanf("%d",&x);
        printf("%i\n",factorial(x));
    }
   
    return 0;
}

int factorial(int n)
{
    if (n==0)
    {
        return 1;
    }
    int sum = 1;
    int i;
    for (i=n;i>0;i--)
    {
        sum = sum*i;
    }
    return sum;
}

That's my code, the first line of input is supposed to be the number of inputs. Then for each input I output its factorial.

It works fine for me. However, this won't accept it. Any ideas?

82
Music Showcase / DJ Scout - MultiRoll'D
« on: June 15, 2011, 04:47:10 pm »
I just made my first song, even though it's not mine.

What do you think? Sorry about the bad quality :/

84
Lua / on.up() Event
« on: June 15, 2011, 09:43:30 am »
Inspired-Lua.org Wiki predicted that the function on.up() worked for when the moving the touchpad up.

I read it here: [lua]Category:Events[/lua]

So I decided to try it on real hardware with the following code:

Code: [Select]
draw_text = false

function on.paint()
    if draw_text then
        gc:drawString("Hello", 5, 5, "top")
    end
end

function on.up()
    draw_text = true
end

It didn't work, when I move the touchpad up (either by moving it or by pressing the key), the text "Hello" never appears.

Also, this didn't work either:

Code: [Select]
draw_text = false

function on.paint()
    if draw_text then
        gc:drawString("Hello", 5, 5, "top")
    end
end

function on.mouseUp()
    draw_text = true
    platform.window:invalidate()
end

85
Lua / Lua Routines
« on: June 15, 2011, 09:33:10 am »
It seems like there is no topic for us to group our TI-Nspire Lua routines. Feel free to post here your Lua routines, whether they are directly connected to Nspire or not. Don't forget to try and optimize other people's functions if you can.

To start, how about a function that checks if a number is prime or not? I tried to find one online but I couldn't, so I ended up making my own.

Check if a number is prime
Input:   One argument, an integer
Output: true or false, whether the argument is a prime or not

Code: [Select]
function isPrime(n)
    --[[Check if an integer n is a prime or not--]]
    if n==1 then return false end --1 is not a prime
    for i = 2, math.sqrt(n) do
    if n % i == 0 then
    return false
    end
    end
    return true
end

86
Lua / Smooth Key Input
« on: June 14, 2011, 04:50:08 pm »
I was wondering if it's possible to achieve this in Lua, as it's a high level language I'm not sure if we can.

In a Mario game for Nintendo Consoles, we press <RIGHT> and the sprite immediately goes right. However, in the Nspire if we press right the image will move once, pause for a bit and then start moving (and it won't pause again until we release key).

So, can it be done?

87
Art / [Request]16*16 or 32*32 Helicopter Sprite
« on: June 14, 2011, 04:24:53 pm »
I need a 16*16 or a 32*32 helicopter sprite for my new game.

You choose whether 16*16 or 32*32, both would be appreciated though ;)

You'll be credited in the release if I use your sprite :D

Position: Regular, turned right, as if flying to the right. Black and White, not animated, thanks.

88
Lua / Starting Nspire Lua
« on: June 13, 2011, 04:52:21 pm »
I just got OS 3 and tried a few Lua games and it was OK so I wanted to make some Lua games too.

There don't seem to be many articles on how to start on Lua, nor an SDK. So, can someone give me some starting tips.

What I need:
  • A Lua>TNS for Linux, a good one you recommend, since there are several (or so I think)
  • Hello World code please?
  • Routines

What I mean with routines is: are there pre-defined TI-Made Routines to display images and get key input? That sort of stuff that is not in Console Lua, but there should be in Nspire Lua.

Thanks a lot!

EDIT: Oh and I forgot, I know console Lua already :)

89
I would like to know how to open a binary file and then display the hexadecimal code in a text box.

Code: [Select]
void MainFrame::OpenFile(wxCommandEvent& WXUNUSED(event))
{
wxFileDialog *OpenDialog = new wxFileDialog(
this, _("Choose a file to open"), wxEmptyString, wxEmptyString,
_("All Files (*.*)|*.*"),
wxFD_OPEN, wxDefaultPosition);
 
// Creates a "open file" dialog with 4 file types
if (OpenDialog->ShowModal() == wxID_OK) // if the user click "Open" instead of "cancel"
{
CurrentDocPath = OpenDialog->GetPath();
 
// Sets our current document to the file the user selected
MainEditBox->LoadFile(CurrentDocPath); //Opens that file

SetTitle( wxString(OpenDialog->GetFilename()) );
}
}

I got that code in wxWidgets tutorial to open an ASCII file, but what if it is a binary data file and I want to display the hexadecimal code, or even better, save it as a wxString or a std::string.

Preferably, I want to display the hex code in the MainEditoBox textbox as if it were an hex editor.

Thanks in advance.

Note: I'm using wxWidgets GUI Toolkit.

90
Other Calculators / Kerm Martian Announced Gossamer
« on: June 09, 2011, 03:47:01 pm »
Kerm Martian announced today a Web Browser for TI Graphing Calculators (83/84+ (SE) Series).

Quoting him:

Quote from: Kerm Martian (adapted)
Long on my to-do list has been a web browser for TI graphing calculators. With the introduction of Doors CS 6 (and thence Doors CS 7's) GUI API features, then CALCnet protocol support, and finally the creation of globalCALCnet, this dream got incrementally closer to reality. Early yesterday morning, I decided to finally bite the bullet and throw together a CALCnet-based web browser. I first created a Python web clipping application employing Lynx that runs on the globalCALCnet metahub, then a calculator-side client named Gossamer. Gossamer can already request, receive, display, and scroll pages, maintain a page viewing history, and allow the user to click on links to visit pages. Coming soon will be a box to input arbitrary URLs as well as progress bars for page and reference loading.

A full version of Gossamer will be coming in the next few days, followed in the hopefully-near future by Doors CS 7.2, with the new and improved Direct USB CALCnet support that I demonstrate in the video below.


An image of this browser:



Luckily, Kerm Martian also made a video to show us how it looks in closer detail:



The original announcement on Cemetech can be found here.

Pages: 1 ... 4 5 [6] 7 8 ... 20