Dsy Network www | forum | my | didattica | howto | wiki | el goog | stats | blog | dona | rappresentanti
Homepage
 Register   Calendar   Members  Faq   Search  Logout 
.dsy:it. : Powered by vBulletin version 2.3.1 .dsy:it. > Didattica > Corsi A - F > Fondamenti di architettura e programmazione > nuovo progetto : consigli
Pages (12): « 1 2 [3] 4 5 6 7 » ... Last »   Last Thread   Next Thread
Author
Thread    Expand all | Contract all    Post New Thread    Post A Reply
Collapse
Jaky
.grande:maestro.

User info:
Registered: Nov 2003
Posts: 703 (0.09 al dì)
Location: Milano
Corso: Comunicazione Digitale
Anno: laureando
Time Online: 5 Days, 1:02:58 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by jonny86
Secondo me la soluzione migliore è quella di lorux, perchè se no rischiate che se il file HTML è scritto tutto su un unica riga vi viene l'errore di overflow di lettura (cioè cercate di mettere in una stringa tutto il documento con readLine())


non credo che i prof abbiano previsto questa cosa, spesso ci facciamo + problemi noi di quanti se ne siano fatti loro nel pensare questo programma.....bisognerebbe chieder conferma..

25-01-2008 16:44
Click Here to See the Profile for Jaky Click here to Send Jaky a Private Message Find more posts by Jaky Add Jaky to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
il_gege
_Kantina27-PunkRock_

User info:
Registered: Oct 2006
Posts: 283 (0.04 al dì)
Location: Seregno
Corso: Comunicazione Digitale
Anno: Oramai fuori.
Time Online: 3 Days, 18:32:52 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Scusatemi una cosa, io sono MOLTO ignorante in java.

Di conseguenza vi pongo il mio problema:

Allora, usando il seguente codice

code:
FileReader doc = new FileReader("page.html"); BufferedReader bfr = new BufferedReader(doc); html = bfr.readLine();


mi viene ritornata solo la prima riga del sorgente; come mai?

Parte seconda:

code:
FileReader doc = new FileReader("page.html"); BufferedReader bfr = new BufferedReader(doc); html = bfr.read();


Invece così mi ritorna il numero di byte, ok, ma se poi io li volessi tramutare in stringhe?

__________________
Kantina27 - Punk Rock
MySpace Profile

26-01-2008 11:42
Click Here to See the Profile for il_gege Click here to Send il_gege a Private Message Visit il_gege's homepage! Find more posts by il_gege Add il_gege to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Nostrills
.cow.

User info:
Registered: Jan 2008
Posts: 40 (0.01 al dì)
Location:
Corso:
Anno:
Time Online: 10 Days, 16:17:09: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by il_gege


Allora, usando il seguente codice

code:
FileReader doc = new FileReader("page.html"); BufferedReader bfr = new BufferedReader(doc); html = bfr.readLine();


mi viene ritornata solo la prima riga del sorgente; come mai?



ciao
allora è giusto secondo me usare il readLine() del BufferedReader...però per leggere tutto il file devi mette il readLine() dentro un while con come condizione il fatto che nn legga stringhe nulle (il che significa che il file è stato letto tutto)..

26-01-2008 12:20
Click Here to See the Profile for Nostrills Click here to Send Nostrills a Private Message Find more posts by Nostrills Add Nostrills to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
il_gege
_Kantina27-PunkRock_

User info:
Registered: Oct 2006
Posts: 283 (0.04 al dì)
Location: Seregno
Corso: Comunicazione Digitale
Anno: Oramai fuori.
Time Online: 3 Days, 18:32:52 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Ok perfetto!
Grazie mille...

però se io volessi usare un array di stringhe, come faccio a sapere quanto è lungo il buffer??

Così almeno se ho un vettore riesco a facilitare i movimenti per andarmi a cercare i caratteri..

__________________
Kantina27 - Punk Rock
MySpace Profile

26-01-2008 13:31
Click Here to See the Profile for il_gege Click here to Send il_gege a Private Message Visit il_gege's homepage! Find more posts by il_gege Add il_gege to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Nostrills
.cow.

User info:
Registered: Jan 2008
Posts: 40 (0.01 al dì)
Location:
Corso:
Anno:
Time Online: 10 Days, 16:17:09: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

non saprei..magari prova a darti una guardata alle API's di BufferedReader che magari trovi qualche metodo utile...

26-01-2008 13:55
Click Here to See the Profile for Nostrills Click here to Send Nostrills a Private Message Find more posts by Nostrills Add Nostrills to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Deviling Master
.illuminato.

User info:
Registered: Oct 2007
Posts: 184 (0.03 al dì)
Location: Missaglia -LC-
Corso: Comunicazione Digitale
Anno: Primo
Time Online: 21:51:21 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Invece di complicarti la vita leggi linea x linea e "attaccala" a una stringa di supporto

Last edited by Deviling Master on 26-01-2008 at 15:12

26-01-2008 14:51
Click Here to See the Profile for Deviling Master Click here to Send Deviling Master a Private Message Find more posts by Deviling Master Add Deviling Master to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Nostrills
.cow.

User info:
Registered: Jan 2008
Posts: 40 (0.01 al dì)
Location:
Corso:
Anno:
Time Online: 10 Days, 16:17:09: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

si potrebbe essere una buona soluzione anche quella....

26-01-2008 15:21
Click Here to See the Profile for Nostrills Click here to Send Nostrills a Private Message Find more posts by Nostrills Add Nostrills to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
il_gege
_Kantina27-PunkRock_

User info:
Registered: Oct 2006
Posts: 283 (0.04 al dì)
Location: Seregno
Corso: Comunicazione Digitale
Anno: Oramai fuori.
Time Online: 3 Days, 18:32:52 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Vabbè, ormai quella parte lì l'ho passata, visto che comunque sono riuscito a muovermi...

Ora debbo capire come muovermi nella classe Tag.

Penso che sia quella la peggiore...

__________________
Kantina27 - Punk Rock
MySpace Profile

26-01-2008 20:16
Click Here to See the Profile for il_gege Click here to Send il_gege a Private Message Visit il_gege's homepage! Find more posts by il_gege Add il_gege to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Deviling Master
.illuminato.

User info:
Registered: Oct 2007
Posts: 184 (0.03 al dì)
Location: Missaglia -LC-
Corso: Comunicazione Digitale
Anno: Primo
Time Online: 21:51:21 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Secondo me è una delle più facili. Classifica il Tag e lo manda "giù" alla relativa sottoclasse in base al tipo

__________________
Nel Software esiste sempre almeno un Bug, generalmente è localizzabile tra la tastiera e la sedia

http://img92.imageshack.us/img92/9409/firmadx9qiya9.gif

26-01-2008 20:17
Click Here to See the Profile for Deviling Master Click here to Send Deviling Master a Private Message Find more posts by Deviling Master Add Deviling Master to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Supernick
.tritagranchi.

User info:
Registered: Jan 2008
Posts: 323 (0.05 al dì)
Location: Albairate (MI)
Corso: Comunicazione Digitale
Anno:
Time Online: 1 Day, 17:31:17 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Scusate io ho provato uan cosa....

questo è il codice

import javax.swing.*;
import java.lang.*;
import java.io.*;

public static void main (String [] args)throws IOException{
String Name;
Name=JOptionPane.showInputDialog("Inserisci il nome del file");
FileReader frd = new FileReader(Name);
BufferedReader bfr = new BufferedReader(frd);

String html;

while ((html=bfr.readLine()) != null)

System.out.println(html);

bfr.close();
frd.close();

System.exit(0);

}
}

Devo per forza lanciare l'eccezzione IOException, altrimenti non mi compila...qualcuno sa dirmi il perchè?

27-01-2008 10:52
Click Here to See the Profile for Supernick Click here to Send Supernick a Private Message Find more posts by Supernick Add Supernick to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
il_gege
_Kantina27-PunkRock_

User info:
Registered: Oct 2006
Posts: 283 (0.04 al dì)
Location: Seregno
Corso: Comunicazione Digitale
Anno: Oramai fuori.
Time Online: 3 Days, 18:32:52 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Metti che non trova il file...

__________________
Kantina27 - Punk Rock
MySpace Profile

27-01-2008 14:19
Click Here to See the Profile for il_gege Click here to Send il_gege a Private Message Visit il_gege's homepage! Find more posts by il_gege Add il_gege to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Supernick
.tritagranchi.

User info:
Registered: Jan 2008
Posts: 323 (0.05 al dì)
Location: Albairate (MI)
Corso: Comunicazione Digitale
Anno:
Time Online: 1 Day, 17:31:17 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

giustamente...comunque purtroppo ho scoperto che va messo nel costruttore della classe HTMLPage.....

solo che così non mi funziona
cioè compila ma quando scrivo il nome del file non mi da niente come output........sigh...e spesso mi si riavvia il pc.......

27-01-2008 16:28
Click Here to See the Profile for Supernick Click here to Send Supernick a Private Message Find more posts by Supernick Add Supernick to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
ziplo
.fedelissimo.

User info:
Registered: Jan 2008
Posts: 56 (0.01 al dì)
Location: bg
Corso: com dig
Anno: 1
Time Online: 19:09:22 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

ma creando il metodo astratto updateStatistics nella classe tag anche la classe diventa astratta e non puo quindi essere istanziata?

28-01-2008 15:41
Click Here to See the Profile for ziplo Click here to Send ziplo a Private Message Find more posts by ziplo Add ziplo to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Deviling Master
.illuminato.

User info:
Registered: Oct 2007
Posts: 184 (0.03 al dì)
Location: Missaglia -LC-
Corso: Comunicazione Digitale
Anno: Primo
Time Online: 21:51:21 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Che novità.....

__________________
Nel Software esiste sempre almeno un Bug, generalmente è localizzabile tra la tastiera e la sedia

http://img92.imageshack.us/img92/9409/firmadx9qiya9.gif

28-01-2008 16:43
Click Here to See the Profile for Deviling Master Click here to Send Deviling Master a Private Message Find more posts by Deviling Master Add Deviling Master to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
giron
.primate.

User info:
Registered: Jun 2006
Posts: 62 (0.01 al dì)
Location:
Corso:
Anno:
Time Online: 16:21:30 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

scusate la domanda fuori luogo ma non volevo aprire un thread per una domanda stupida.
Per fare il progettino di gennaio a quale appello sul sifa dobbiamo iscriverci?

28-01-2008 21:51
Click Here to See the Profile for giron Click here to Send giron a Private Message Find more posts by giron Add giron to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
All times are GMT. The time now is 05:33.    Post New Thread    Post A Reply
Pages (12): « 1 2 [3] 4 5 6 7 » ... Last »   Last Thread   Next Thread
Show Printable Version | Email this Page | Subscribe to this Thread | Add to Bookmarks

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is ON
 

Powered by: vBulletin v2.3.1 - Copyright ©2000 - 2002, Jelsoft Enterprises Limited
Mantained by dsy crew (email) | Collabora con noi | Segnalaci un bug | Archive | Regolamento | Licenze | Thanks | Syndacate
Pagina generata in 0.169 seconds (66.72% PHP - 33.28% MySQL) con 24 query.