import org.mortbay.jetty.*;
Server svc = new Server();
svc.addListener( ":7501" );
svc.addRootWebApp("example.war");
svc.start();
What should happen?
- example.war being deployed in jetty
- http://localhost:7501
bundle this with:
- k-meleon; OR
- Adobe Apollo; OR
- Portable Firefox
and we will get a stand-alone version of our favourite web-app. All from the comfort of your USB drive..
Isn't life great? :lol:
of javax.swing
src: catalysoft | uselesspython
Create a (rather useless) jython application in (at most) 1 day:
0. download & install java SDK + jython
1. add /java/bin and /jython to the system path
2. save this snippet into test.py (e.g d:\test.py)
jythonc -c -j nuo.jar test.py
3a. I got this error 'ERROR DURING JAVA COMPILATION... EXITING', means the compiler can't locate javac.exe, so include javac.exe full path and (in this case) execute this instead
jythonc -C C:\j2sdk1.4.2_12\bin\javac.exe -c -j nuo.jar test.py
4. Doubleclick the resulting nuo,jar, a simple swing application came to life!!
explanation
- consider this real java code
- the above jythonc command means compile the python code into java bytecode (.class)
- the -c switch means includes all (OR relevant??) the jython library into the jar
- the -j switch means creates executable jar file, with the relevant manifest file
- a 455 bytes script (test.py) results in a 755 KB (nuo.jar) executable :lol:
Create a (rather useless) jython application in (at most) 1 day:
0. download & install java SDK + jython
1. add /java/bin and /jython to the system path
2. save this snippet into test.py (e.g d:\test.py)
import javax.swing as swing3. open a command prompt (drop to dos) in d:\ and execute this:
def printMessage(event):
print "Ouch!"
if __name__== "__main__":
frame=swing.JFrame(title="My Frame", size=(300,300))
frame.defaultCloseOperation=swing.JFrame.EXIT_ON_CLOSE;
button=swing.JButton("Push Me!", actionPerformed=printMessage)
frame.contentPane.add(button)
frame.visible=1
jythonc -c -j nuo.jar test.py
3a. I got this error 'ERROR DURING JAVA COMPILATION... EXITING', means the compiler can't locate javac.exe, so include javac.exe full path and (in this case) execute this instead
jythonc -C C:\j2sdk1.4.2_12\bin\javac.exe -c -j nuo.jar test.py
4. Doubleclick the resulting nuo,jar, a simple swing application came to life!!
explanation
- consider this real java code
import javax.swing.JFrame;it's python counterpart is smaller = faster development time..
import javax.swing.JButton;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class MyExample
implements ActionListener {
public void actionPerformed(ActionEvent e) {
System.out.println("Ouch!");
}
public static void main(String[] args) {
JFrame frame = new JFrame("My Frame");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(300,300);
JButton button = new JButton("Push Me!");
frame.getContentPane().add(button);
ActionListener listener = new MyExample();
button.addActionListener(listener);
frame.setVisible(true);
}
}
- the above jythonc command means compile the python code into java bytecode (.class)
- the -c switch means includes all (OR relevant??) the jython library into the jar
- the -j switch means creates executable jar file, with the relevant manifest file
- a 455 bytes script (test.py) results in a 755 KB (nuo.jar) executable :lol:
Papa Roach - Between Angels & Insects
There's no money there's no possessions
Only obsession I don't need that shit
Take my money take my obsession
I just want to be heard loud and clear are my words
Coming from within man tell them what you heard
It's about a revolution in your heart and in your mind
Till you find a conclusion lost out in obsession
Diamond rings get you nothing but a life long lesson
And your pocketbooks stressing
You're a slave to the system working jobs that you hate for that shit you don't need
It's too bad the world is based on greed
Step back and see
Stop thinking about yourself start thinking about
There's no money there's no possession only
Obsession I don't need that shit
Take my money take my possession take my obsession
I don't need that shit
Because everything is nothing
And emptiness isn't everything
This reality is really just a fucked up dream
With the flesh and the blood that you call your soul
Flip it inside out its a big black hole
Take your money burn it up like an asteroid
Possession though you're never gonna feel the void
Take it away and learn your best lesson
The heart the soul the life the passion
There's no money there's no possession
Only obsession I don't need that shit
Take my money take my possession take my obsession
I don't need that shit
Money possession obsession
Present yourself press your clothes comb your hair
And clock in
You just can't win just can't win
And the things you own own you
No..............
Take my money take my possession take my obsession
I don't need that shit
Fuck your money fuck your possession fuck your
Obsession I don't need that shit
Money possession obsession I don't need that shit
Only obsession I don't need that shit
Take my money take my obsession
I just want to be heard loud and clear are my words
Coming from within man tell them what you heard
It's about a revolution in your heart and in your mind
Till you find a conclusion lost out in obsession
Diamond rings get you nothing but a life long lesson
And your pocketbooks stressing
You're a slave to the system working jobs that you hate for that shit you don't need
It's too bad the world is based on greed
Step back and see
Stop thinking about yourself start thinking about
There's no money there's no possession only
Obsession I don't need that shit
Take my money take my possession take my obsession
I don't need that shit
Because everything is nothing
And emptiness isn't everything
This reality is really just a fucked up dream
With the flesh and the blood that you call your soul
Flip it inside out its a big black hole
Take your money burn it up like an asteroid
Possession though you're never gonna feel the void
Take it away and learn your best lesson
The heart the soul the life the passion
There's no money there's no possession
Only obsession I don't need that shit
Take my money take my possession take my obsession
I don't need that shit
Money possession obsession
Present yourself press your clothes comb your hair
And clock in
You just can't win just can't win
And the things you own own you
No..............
Take my money take my possession take my obsession
I don't need that shit
Fuck your money fuck your possession fuck your
Obsession I don't need that shit
Money possession obsession I don't need that shit
6 Year Old Python
Found a post about a 6 years old, learning to program a simple game in a few days (old one tho, 2005)
The Chronicle:
1. Intro (BASIC programming)
2. CLI basic guess-a-number
3. added sound
4. graphics & packaging
using Python (of course), pygame, audacity, and Google :lol:
The Chronicle:
1. Intro (BASIC programming)
2. CLI basic guess-a-number
3. added sound
4. graphics & packaging
using Python (of course), pygame, audacity, and Google :lol:
of FMA & k750i
Fma: FloAt's Mobile Agent
Opera Mini
Finally, got my hand on k750i :lol: it seems to have a recent price drop, got it for only rm570 (and around that price in other shops).
Day 1
So, I try it immediately with FMA on the 1st day, and it doesn't work.. A few googling results in no complaints on connecting fma with k750 through the usb cable so why can't I?
Then tried installing the supplied software, and got me an error..
OK, doesn't matter that it can't install, the new hardware wizard took care the usb+card part, results in a removable drive.. Good enough :D
Time for Opera Mobile, and I left wondering how to install it (there are no application/games folder visible inside the usb card). But there's an Other folder, so in there it goes :lol:
yet can't find it inside when trying to install it, damn.. Tried again after unplugging the phone and there it is :P heck, can even send it (not possible with k300i)
Day 2
Tried again with FMA, yet failed.. Then looking through the setting, no USB mentioned anywhere, COM port only.. Aah My Computer | Properties | Hardware | Device Manager | Port, mentioning USB (COM 13 & 14), so that's how..
restarting fma and there it is, SE 750.
So, why am I making such a fuss over fma? because it rocks, sending SMS thru PC, answering calls (via headphone+speaker), etc..
Then I lived happily ever after :lol:
p/s: unfortunately, its no s60 series phone
Opera Mini
Finally, got my hand on k750i :lol: it seems to have a recent price drop, got it for only rm570 (and around that price in other shops).
Day 1
So, I try it immediately with FMA on the 1st day, and it doesn't work.. A few googling results in no complaints on connecting fma with k750 through the usb cable so why can't I?
Then tried installing the supplied software, and got me an error..
OK, doesn't matter that it can't install, the new hardware wizard took care the usb+card part, results in a removable drive.. Good enough :D
Time for Opera Mobile, and I left wondering how to install it (there are no application/games folder visible inside the usb card). But there's an Other folder, so in there it goes :lol:
yet can't find it inside when trying to install it, damn.. Tried again after unplugging the phone and there it is :P heck, can even send it (not possible with k300i)
Day 2
Tried again with FMA, yet failed.. Then looking through the setting, no USB mentioned anywhere, COM port only.. Aah My Computer | Properties | Hardware | Device Manager | Port, mentioning USB (COM 13 & 14), so that's how..
restarting fma and there it is, SE 750.
So, why am I making such a fuss over fma? because it rocks, sending SMS thru PC, answering calls (via headphone+speaker), etc..
Then I lived happily ever after :lol:
p/s: unfortunately, its no s60 series phone
Subscribe to:
Posts (Atom)