Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sat 25 Oct 2014, 08:25
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Java
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 4 of 4 Posts_count   Goto page: Previous 1, 2, 3, 4
Author Message
jpeps

Joined: 31 May 2008
Posts: 3220

PostPosted: Fri 05 Apr 2013, 04:06    Post_subject:  

MyLibrary3 saves all data to a single (and small) xml file. This seems to be an economical way of creating a database ...with the advantage of being able to easily read (and edit) the file itself. I also included both author and title search buttons with "next" capability.


http://murga-linux.com/puppy/viewtopic.php?p=673898#673898

updated: smaller size
Back to top
View user's profile Send_private_message 
jpeps

Joined: 31 May 2008
Posts: 3220

PostPosted: Sun 07 Apr 2013, 19:53    Post_subject:  

Another version of MyLibrary using serialized data, which takes it down to only 24K. Interestingly, you can still edit the MyLibrary.ser data file using a text editor (not geany). This puts a database app in the acceptable range for puppy.
MyLibrary4.tar.gz
Description  MyLibrary4.jar
gz

 Download 
Filename  MyLibrary4.tar.gz 
Filesize  22.14 KB 
Downloaded  137 Time(s) 
Back to top
View user's profile Send_private_message 
jpeps

Joined: 31 May 2008
Posts: 3220

PostPosted: Tue 09 Apr 2013, 01:51    Post_subject:  

Updated MyLibrary4 to include File menu with a "Make Report" option. This produces a MyLibrary.txt file with all the books info; added mnemonics.
MyLibrary4.png
 Description   
 Filesize   12.55 KB
 Viewed   363 Time(s)

MyLibrary4.png

Back to top
View user's profile Send_private_message 
01micko


Joined: 11 Oct 2008
Posts: 7836
Location: qld

PostPosted: Sat 10 Aug 2013, 17:31    Post_subject:  

Hi jpeps

I hope you don't mind but I soft coded your get jre script, with basic instructions in the comments. Added some basic error checks.

Code:
#!/bin/sh

# http://javadl.sun.com/webapps/download/AutoDL?BundleId=78695 (example: for 1.7-u25)
# go to http://java.com/en/download/linux_manual.jsp?locale=en to find url similar to above
# get java tar.gz link to get the end number, 5 digits

# run with (example: name the script "get_jre")
#----------------------------
# get_jre jre1.7.0_25 78695
#----------------------------

jre="$1" #name it with "jre1_________" fill in the blank # eg: jre1.7.0_17
NUMBER="$2" #NEEDED it's the number on the end of the url
temp="${jre}_001"

mkdir -p "/tmp/${temp}/usr/local/bin"
mkdir -p "/usr/local/${jre}/bin"

##  GET PACKAGE
wget -O "/tmp/${jre}.tar.gz" http://javadl.sun.com/webapps/download/AutoDL?BundleId=${NUMBER}
[ $? != 0 ] && echo error && exit

## UNPACK AND MOVE TO NEW FOLDER
cd /tmp
tar -xvzf "/tmp/${jre}.tar.gz"
[ $? != 0 ] && echo error && exit
  mv  "${jre}"    "${temp}/usr/local"

## COPY JAVA FILES FOR LINKING

cd "${temp}/usr/local"
cp   "${jre}/bin/java"  "/usr/local/${jre}/bin"     

cd "/tmp/${temp}/usr/local/bin"
ln -sf "/usr/local/${jre}/bin/java" .


## CHANGE NAME FOR SFS BUILD
cd /tmp
mv "${temp}" "${jre}"

dir2sfs "$jre"

## Change name and CLEAN UP
 
name="$(ls | grep jre*sfs | grep -v "txt")"

mv "$name"  ${jre}.sfs

rm -r "/usr/local/${jre}"
rm -r "/tmp/${jre}"
rm  "/tmp/${jre}.tar.gz"
rm /tmp/jre*txt

echo  "${jre}.sfs is in /tmp"



Working Cool
Code:
java -jar addstuff.jar
Enter your name
Name : Mick
Enter your age
Age : 150
Seriously Mick? You're either lying to me or you're a freakin' vampire!
..just some of my uni homework from the start of the course.
addstuff.zip
Description  java archive, the homework i did, simple stuff
zip

 Download 
Filename  addstuff.zip 
Filesize  1.7 KB 
Downloaded  99 Time(s) 

_________________
Woof Mailing List | keep the faith Cool |
Back to top
View user's profile Send_private_message Visit_website 
jpeps

Joined: 31 May 2008
Posts: 3220

PostPosted: Sat 10 Aug 2013, 19:39    Post_subject:  

01micko wrote:
.just some of my uni homework from the start of the course.


Great to see the serious devs studying java. Keep up the good work!
Back to top
View user's profile Send_private_message 
01micko


Joined: 11 Oct 2008
Posts: 7836
Location: qld

PostPosted: Mon 19 Aug 2013, 16:55    Post_subject:  

A very basic CLI game

http://01micko.com/packages/punchkickblock.zip ~28k

source and java archive included

_________________
Woof Mailing List | keep the faith Cool |
Back to top
View user's profile Send_private_message Visit_website 
jpeps

Joined: 31 May 2008
Posts: 3220

PostPosted: Tue 20 Aug 2013, 01:06    Post_subject:  

01micko wrote:
A very basic CLI game

http://01micko.com/packages/punchkickblock.zip ~28k

source and java archive included


Graphics and sound...next quarter?

Just read an interesting article in slate

http://www.slate.com/articles/technology/future_tense/2013/08/everybody_does_not_need_to_learn_to_code.html?wpisrc=most_viral


Quote:

This is my nightmare vision—“everyone” approaches programming as a set of arbitrary technical details just because he or she should. With only bits and pieces, users can’t appreciate the ways that languages are designed to solve problems, and they are left with an even larger black box.
This can be avoided if you have concrete problems to solve.
Her knowledge comes from a focused learning of the topics or a language that is specialized for her application. She doesn’t just “learn Python.”


My first program was multiple regression analysis written in Basic for the Atari. I needed it for a study I was working on.
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 4 of 4 Posts_count   Goto page: Previous 1, 2, 3, 4
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Off-Topic Area » Programming
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0654s ][ Queries: 13 (0.0095s) ][ GZIP on ]