Help With Source Code
Heya,
I have a small problem with my source code and I can't seem to figure out where the problem is.
Description of problem:
String getTracks(String artist) in class TrackList displays the tracks in an album in numerical order. For instance:
The tracks are:
1. xxxxxxxxxx
2. xxxxxxxxxx
3. xxxxxxxxxx
4.
The problem is, an additional number would appear after all the tracks have been displayed. In this case, 3 tracks are displayed and a redundant number (4.) appears below. And if there are 4 tracks to be displayed, a (5.) would appear and so on. Does anybody know where the source of the problem is?
My source code for class TrackList is as follows:
import java.util.ArrayList;
public class TrackList
private ArrayList trackList;
public TrackList()
trackList = new ArrayList();
public void add(String artist, String album, String tracks)
trackList.add(new Artist(artist,album,tracks));
public void remove(String artist)
for (int n = 0 ; n < trackList.size() ; n++)
Artist a = (Artist)trackList.get(n);
if (a.getArtist().toLowerCase().equals(artist.toLowerCase()))
trackList.remove(n);
public String getAlbum(String artist)
for (int n = 0 ; n < trackList.size() ; n++)
Artist a = (Artist)trackList.get(n);
if (a.getArtist().toLowerCase().equals(artist.toLowerCase()))
return a.getAlbum();
return "";
public String getTracks(String artist)
String tracksToReturn = "";
int trackNumber = 1;
for (int n = 0 ; n < trackList.size() ; n++)
Artist a = (Artist)trackList.get(n);
if (a.getArtist().toLowerCase().equals(artist.toLowerCase()))
tracksToReturn += trackNumber + ". " + a.getTracks() + "\n";
trackNumber++;
return tracksToReturn;
public void writeToFile(FileOutput file)
for (int n = 0 ; n < trackList.size() ; n++)
Artist a = (Artist)trackList.get(n);
file.writeString(a.getArtist());
file.writeNewline();
file.writeString(a.getAlbum());
file.writeNewline();
public void readFromFile(FileInput file)
String artist = file.readString();
String album = file.readString();
String tracks = file.readString();
while (!file.eof())
add(artist,album,tracks);
artist = file.readString();
album = file.readString();
tracks = file.readString();
Not sure if this other class has an impact on this. It's class Catalogue. Look at void TrackList(String artist).
public class Catalogue
private KeyboardInput in;
private TrackList trackList;
public Catalogue()
in = new KeyboardInput();
trackList = new TrackList();
public void go()
boolean quit = false;
while (!quit)
System.out.println("\nCatalogue");
System.out.println("1. Search artist, album and tracks");
System.out.println("2. Add new artist, album and tracks");
System.out.println("3. Remove artist, album and tracks");
System.out.println("4. Save entry to a file");
System.out.println("5. Add an entry from a file");
System.out.println("6. Quit");
System.out.print("\nSelect an option from the menu: ");
int option = in.readInteger();
switch (option)
case 1 :
searchForEntry();
break;
case 2 :
addEntry();
break;
case 3 :
removeEntry();
break;
case 4 :
saveList();
break;
case 5 :
loadList();
break;
case 6 :
quit = true;
break;
default :
System.out.println("\nThat option is invalid. Please try again.");
public void addEntry()
System.out.println("\nAdd entry to catalogue");
System.out.print("Enter the artist's name: ");
String artist = in.readString();
System.out.print("Enter the artist's album: ");
String album = in.readString();
System.out.println("Enter the track names and enter when done: ");
int trackNumber = 1;
String tracks;
do
System.out.print("Enter track " + trackNumber + ": ");
tracks = in.readString();
trackList.add(artist,album,tracks);
trackNumber++;
while (!tracks.equals(""));
public void removeEntry()
System.out.println("\nRemove entry from catalogue");
System.out.print("Enter the artist's name: ");
String artist = in.readString();
trackList.remove(artist);
public void searchForEntry()
System.out.println("\nSearch catalogue");
System.out.print("Enter the artist's name: ");
String artist = in.readString();
String album = trackList.getAlbum(artist);
if (album.equals(""))
System.out.println("\nThere were no matches for your search. Please try again.");
else
System.out.println("The album is: " + album);
boolean quit = false;
while (!quit)
System.out.println("\nSelect an option: ");
System.out.println("1. Display the tracks for this album");
System.out.println("2. Back");
int option = in.readInteger();
switch (option)
case 1 :
trackList(artist);
break;
case 2 :
quit = true;
break;
default :
System.out.println("\nThat option is invalid. Please try again.");
public void trackList(String artist)
String tracks = trackList.getTracks(artist);
if (tracks.equals(""))
System.out.println("\nThere were no tracks entered for this album.");
else
System.out.println("\nThe tracks are:");
System.out.println(tracks);
public void saveList()
System.out.println("\nSave catalogue to a file");
System.out.print("Enter the file name: ");
String fileName = in.readString();
FileOutput out = new FileOutput(fileName);
trackList.writeToFile(out);
out.close();
public void loadList()
System.out.println("\nAppend catalogue from a file");
System.out.print("Enter the file name: ");
String fileName = in.readString();
FileInput fileIn = new FileInput(fileName);
trackList.readFromFile(fileIn);
fileIn.close();
public static void main(String[] args)
Catalogue catalogue = new Catalogue();
catalogue.go();
Thank you very much indeed!
Sincerely,
e360
This is not about JavaHelp technology. Please use another forum, thank you.
/M
Similar Messages
-
Hi,
Does anyone an easy way of downloading weblogs with source codes?
If I select all/copy&paste into Microsoft Word 2000 (SP3), the source codes get this "nice" frame, where they are scrollable. When I save it and open it again, the source code is not scrollable, so I can only diplay the part of it:-(
Is there a way of avoid it from my side?
I know from the composer side it can be done, as foir example Sergei did in his weblog:
/people/sergey.korolev/blog/2005/03/14/the-time-for-me-to-have-a-badi-of-my-own
Or is it planned to change this annoying scrollable code frame?
Thanks,
PeterPrinting of Weblogs
Take a look at that thread for some possible help.
As for the "annoying scrollable code frame" well we've been doing it for awhile now and nobody has been complaining too loudly.
If the thought of everyone is to be rid of the textarea then I suppose I wouldn't have a problem using the styles instead. -
Can you help with the code to publish Flash to my own domain.
Thank you for your help, I publish the my site to my own domain, I do not use .Mac, I tested your code and ity works well on .Mac, can you help with the code to publish to my own domain.
Thank you againYou appear to have just collected a variety of code snippets and thrown them together, including a section of AS2 code ( gage.onRelease = function() {... )
The suggestion I offered yesterday still stands. You should find a tutorial regarding AS3 and the atan2 function. Beyond that, what you show suggests this is a school assignment. You should seek help from your fellow students and instructor if that is the case. -
I need help with this code error "unreachable statement"
the error_
F:\Java\Projects\Tools.java:51: unreachable statement <-----------------------------------------------------------------------------------------------------------------THIS
int index;
^
F:\Java\Projects\Tools.java:71: missing return statement
}//end delete method
^
F:\Java\Projects\Tools.java:86: missing return statement
}//end getrecod
^
3 errors
import java.util.*;
import javax.swing.*;
import java.awt.*;
public class Tools//tool class
private int numberOfToolItems;
private ToolItems[] toolArray = new ToolItems[10];
public Tools()//array of tool
numberOfToolItems = 0;
for(int i = 0; i < toolArray.length; i++)//for loop to create the array tools
toolArray[i] = new ToolItems();
}//end for loop
}//end of array of tools
public int search(int id)//search mehtod
int index = 0;
while (index < numberOfToolItems)//while and if loop search
if(toolArray[index].getID() == id)
return index;
else
index ++;
}//en while and if loop
return -1;
}//end search method
public int insert(int id, int numberInStock, int quality, double basePrice, String nm)//insert method
if(numberOfToolItems >= toolArray.length)
return 0;
int index;
index = search(id); <-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------HERE
if (index == -1)
toolArray[index].assign(id,numberInStock, quality, basePrice,nm);
numberInStock ++;
return 1;
}//end if index
}//end if toolitem array
return -1;
}//end insert method
public int delete(/*int id*/)//delete method
}//end delete method
public void display()//display method
for(int i = 0; i < numberOfToolItems; i++)
//toolArray.display(g,y,x);
}//end display method
public String getRecord(int i)//get record method
// return toolArray[i].getName()+ "ID: "+toolArray[i].getID()
}//end getrecod
}//end class
Edited by: ladsoftware on Oct 9, 2009 6:08 AM
Edited by: ladsoftware on Oct 9, 2009 6:09 AM
Edited by: ladsoftware on Oct 9, 2009 6:10 AM
Edited by: ladsoftware on Oct 9, 2009 6:11 AMladsoftware wrote:
Subject: Re: I need help with this code error "unreachable statement"
F:\Java\Projects\Tools.java:51: unreachable statement <-----------------------------------------------------------------------------------------------------------------THIS
int index;
^
F:\Java\Projects\Tools.java:71: missing return statement
}//end delete method
^
F:\Java\Projects\Tools.java:86: missing return statement
}//end getrecod
^
3 errorsThe compiler is telling you exactly what the problems are:
public int insert(int id, int numberInStock, int quality, double basePrice, String nm)//insert method
if(numberOfToolItems >= toolArray.length)
return 0; // <<== HERE you return, so everyting in the if block after this is unreachable
int index;
index = search(id); //< -----------------------------------------------------------------------------------------------------------------HERE
if (index == -1)
toolArray[index].assign(id,numberInStock, quality, basePrice,nm);
numberInStock ++;
return 1;
}//end if index
}//end if toolitem array
return -1;
}//end insert method
public int delete(/*int id*/)//delete method
// <<== HERE where is the return statement?
}//end delete method
public String getRecord(int i)//get record method
// return toolArray.getName()+ "ID: "+toolArray[i].getID() <<== HERE you commented out the return statement
}//end getrecod
}//end class -
Need help with WMI code that will send output to db
'm new to WMI code writing, so I need some help with writing code that we can store on our server. I want this code to run when a user logs into their computer
and talks to our server. I also want the code to:
* check the users computer and find all installed patches
* the date the patches were installed
* the serial number of the users computer
* the computer name, os version, last boot up time, and mac address
and then have all this output to a database file. At the command prompt I've tried:
wmic qfe get description, hotfixid
This does return the patch information I'm looking for, but how do I combine that line of code with:
wmic os get version, csname, serialnumber, lastbootuptime
and
wmic nicconfig get macaddress
and then get all this to output to a database file?Thank you for the links. I checked out http://technet.microsoft.com/en-us/scriptcenter/dd793612.aspx and
found lots of good information. I also found a good command that will print information to a text file.
Basically what I'm trying to do is retrieve a list of all installed updates (Windows updates and 3rd party updates). I do like that the below code because it gives me the KB numbers for the Windows updates. I need this information so my IT co-workers &
I can keep track of which of our user computers need a patch/update installed and preferably which patch/update. The minimum we want to know is which patches / updates have been installed on which computer. If you wondering why we don't have Windows automatic
updates enable, that's because we are not allowed to.
This is my code so far.
#if you want the computer name, use this command
get-content env:computername
$computer = get-content env:computername
#list of installed patches
Get-Hotfix -ComputerName $computer#create a text file listing this information
Get-Hotfix > 'C:\users\little e\Documents\WMI help\PowerShell\printOutPatchList.txt'
I know you don't want to tell me the code that will print this out to a database (regardless if it's Access or SQL), and that's find. But maybe you can tell me this. Is it possible to have the results of this sent to a database file or do I need to go into
SQL and write code for SQL to go out and grab the data from an Excel file or txt file? If I'm understanding this stuff so far, then I suspect that it can be done both ways, but the code needs to be written correctly for this to happen. If it's true, then which
way is best (code in PowerShell to send information to SQL or SQL go get the information from the text file or Excel file)? -
I need help with my code..
hi guys. as the subject says I need help with my code
the Q for my code is :
write a program that reads a positive integer x and calculates and prints a floating point number y if :
y = 1 ? 1/2 + 1/3 - ? + 1/x
and this is my code
This program that reads a positive integer x and calculates
and prints a floating point number y if :
y = 1 - 1/2 + 1/3 - ? + 1/x
import java.util.Scanner; // program uses class Scanner
class Sh7q2
// main method begins execution of Java application
public static void main( String args[] )
// create Scanner to obtain input from command window
Scanner input = new Scanner( System.in );
int i = 1; // i is to control the loop
int n = 2; // n is suppose to control the number sign
int x; // a positive integer entered by the user
int m;
System.out.println("Enter a positive integer");
x = input.nextInt();
do
m = (int) Math.pow( -1, n)/i;
System.out.println(m);
n++;
i++;
while ( m >= 1/x );
} // end method main
} // end class Sh7q2 when I compile it there is no error
but in the run it tells me to enter a positive integer
suppose i entered 5
then the result is 1...
can anyone tell me what's wrong with my codeThis program that reads a positive integer x and calculates
and prints a floating point number y if :
y = 1 - 1/2 + 1/3 - ? + 1/x
import java.util.Scanner; // program uses class Scanner
class Sh7q2
// main method begins execution of Java application
public static void main( String args[] )
// create Scanner to obtain input from command window
Scanner input = new Scanner( System.in );
int i = 1; // i is to control the loop
int n = 1; // n is suppose to control the number sign
int x; // a positive integer entered by the user
double m;
int a = 1;
double sum = 0;
System.out.println("Enter a positive integer");
x = input.nextInt();
for ( i = 1; a <= x; i++)
m = Math.pow( -1, n+1)/i;
sum = sum + m;
n++;
a++;
System.out.print("y = " + sum);
} // end method main
} // end class Sh7q2is it right :S -
Help with abap code in Transformation
Hi Experts,
we have a scenario where we load delta data from an DSO into a Cube.
The records in the DSO looks like below.
Location as (L)
WorkOrder as (W)
Startdate(DDMMYYYY)/time (HH:MM:SS) as (S)
Finishdate/time as (F)
L1
W1
21/04/2009/10:00:00
21/04/2009/12:00:00
L1
W2
21/04/2009/14:00:00
21/04/2009/23:00:00
|| L1 ||W3|| 21/04/2009/16:00:00 ||21/04/2009/20:00:00 ||
Total time ( April 2009 ) for above Location L1 should be calculated as a difference between W1 and W2 since W3 is a overlapping record. So the result would be 13 Hrs. Work Orders are summarised, so we dont need work order info in the output.
Can you experts help me with the code to implement??
Thanks,
DVFor each location, for example L1, move the records to an internal table itab.
sort itab by startdate.
read table itab index 1.
You will get the first value.
sort itab by finishdate descending.
read table itab index 1.
you will get the second value.
Calculate the difference and populate it to the internal table.
finally modify the source package.
I have just given the logic. I hope you can build upon this.
I hope it helps.
Thanks. -
Sry about this amount of code lines.... but i realy need help...
I must insert into a table, the date, like 10/12/2009, and the time, like 22:34:12... but, when i select the date from a datepicker, and insert the time into a text field... i got this result:
if the date inserted was 12/12/2009 and the time 22:34:12
result is.......................12/12/0922 34:12:00 <<<<< it´s getting just the two lasts number of the year and inserting the two firsts number of the time into the year, like year 0922 ....
I´m using a javascript source to create a datepicker......
and that is the procedure to insert into the table.......
PROCEDURE set_atendimento(
p_id_chamado_atendimento IN chamado_atendimento.id_chamado_atendimento%TYPE,
p_id_chamado IN chamado_atendimento.id_chamado%TYPE,
p_informacao IN chamado_atendimento.informacao%TYPE,
p_datahora_inicio IN chamado_atendimento.datahora_inicio%TYPE,
p_datahora_fim IN chamado_atendimento.datahora_fim%TYPE,
p_hora_inicio IN VARCHAR2,
p_hora_fim IN VARCHAR2
IS
v_inicio DATE;
v_fim DATE;
BEGIN
v_inicio := TO_DATE(TO_CHAR(p_datahora_inicio || p_hora_inicio), 'DD/MM/YYYY HH24:MI:SS');
v_fim := TO_DATE(TO_CHAR(p_datahora_fim || p_hora_fim), 'DD/MM/YYYY HH24:MI:SS');
UPDATE
chamado_atendimento
SET
informacao = UPPER(p_informacao)
WHERE
id_chamado_atendimento = p_id_chamado_atendimento;
IF SQL%NOTFOUND THEN
INSERT INTO
chamado_atendimento
(id_chamado_atendimento, id_chamado, id_operador, datahora_inicio, datahora_fim, informacao)
VALUES
(SEQ_CHAMADO_ATENDIMENTO.nextval, p_id_chamado, pkg_operador.get_id_operador, v_inicio, v_fim, UPPER(p_informacao));
END IF;
END;
that is the JAVASCRIPT
<script language="JavaScript" type="text/JavaScript">
$(function(){
$.datepicker.setDefaults({
showOn: 'button',
buttonImage: '/i/themes/fwsac/includes/jquery/images/calendario.gif',
buttonImageOnly: true,
closeText: 'Fechar',
prevText: '<Anterior',
nextText: 'Próximo>',
currentText: 'Hoje',
monthNames: ['Janeiro','Fevereiro','Março','Abril','Maio','Junho','Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'],
monthNamesShort: ['Jan','Fev','Mar','Abr','Mai','Jun','Jul','Ago','Set','Out','Nov','Dez'],
dayNames: ['Domingo','Segunda-feira','Terça-feira','Quarta-feira','Quinta-feira','Sexta-feira','Sabado'],
dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','Sab'],
dayNamesMin: ['Dom','Seg','Ter','Qua','Qui','Sex','Sab'],
dateFormat: 'dd/mm/yy',
firstDay: 0,
isRTL: false,
showAnim: 'slide'
$('#P5004_DATAHORA_INICIO , #P5004_DATAHORA_FIM').datepicker({ beforeShow: fdateRange });
function fdateRange(input){
return {
minDate: (input.id == "P5004_DATAHORA_FIM" ? $("#P5004_DATAHORA_INICIO").datepicker("getDate") : null),
maxDate: (input.id == "P5004_DATAHORA_INICIO" ? $("#P5004_DATAHORA_FIM").datepicker("getDate") : null)
</script>
what i must change to get the 4 numbers of the year and all numbers of the time and conca " || " with the date??
can someone help with this, pls??Hello brugo,
Try this:
v_inicio := to_nchar((to_date(p_datahora_inicio || p_hora_inicio , 'DD/MM/YYYY HH24:MI:SS')), 'DD/MM/YYYY HH24:MI:SS');
v_inicio := to_nchar((to_date(p_datahora_fim || p_hora_fim , 'DD/MM/YYYY HH24:MI:SS')), 'DD/MM/YYYY HH24:MI:SS');When I substitute strings: '10/12/2009' for p_datahora_inicio and '22:30:05' for p_hora_inicio, using this format string, I get: 10/12/2009 22:30:05 as a result.
Don.
You can reward this reply by marking it as either Helpful or Correct :) -
What is wrong with this code? It does not play. It should play in Windows-7 and XP with IE8.
Also, on the screen there is a large white area where the <video> code is. Why?
How do I get rid of it?
Thanks.
<!DOCTYPE HTML>
<html>
<head>
<title>video testing</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body>
<p>Click the <a href="Download" _mce_href="http://www.amelox.com/Media/UX-CT-Tour-Short-1024d12db.mp4">Download">http://w ww.amelox.com/Media/UX-CT-Tour-Short-1024d12db.mp4">Download mp4 </a> button to start video.</p>
<p>Click the <a href="Download" _mce_href="http://www.amelox.com/Media/UX-CT-Tour-Short-1024d12db.webm">Download">http:// www.amelox.com/Media/UX-CT-Tour-Short-1024d12db.webm">Download webm </a> button to start video.</p>
<p>Click the <a href="Download" _mce_href="http://www.amelox.com/Media/UX-CT-Tour-Short-1024d12db.ogg">Download">http://w ww.amelox.com/Media/UX-CT-Tour-Short-1024d12db.ogg">Download ogg </a> button to start video.</p>
<p>Click the <a href="Download" _mce_href="http://www.amelox.com/Media/UX-CT-Tour-Short-1024d12db.flv">Download">http://w ww.amelox.com/Media/UX-CT-Tour-Short-1024d12db.flv">Download flv </a> button to start video.</p>
<video width="480" height="270" controls="controls">
<source media="all" src="rtp:UX-CT-Tour-Short-1024d12db.mp4" type='video/mp4; codecs="vp8, vorbis"' />
<source media="all" src="rtp:UX-CT-Tour-Short-1024d12db.webm" type='video/webm; codecs="avc1.42E01E, mp4a.40.2"' />
<source media="all" src="rtp:UX-CT-Tour-Short-1024d12dB.ogg" type="video/ogv; codecs="theora, vorbis"" />
<object data="id=player1" width="480" height="270">
<param name="classid" value="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" />
<param name="movie" value="player.swf" />
<param name="flashvars" value="UX-CT-Tour-Short-1024d12db.flv & autostart=true" />
<param name="allowfullscreen" value="false" />
<param name="quality" value="high" />
<param name="wmode" value="opaque" />
<param name="allowscriptaccess" value="always" />
<embed flashvars="file=UX-CT-Tour-Short-1024d12db.flv & autostart=true" id="player1" src="player.swf"
allowfullscreen="true" allowscriptaccess="always" width="480" height="270" />
</object>
</video>
<p>here is some more text</p>
</body>
</html>Data load? Did it pass a syntax check?
Anyway, maybe this will help:
DATA: create_date TYPE sy-datum,
update_date TYPE sy-datum,
number_of_days_closed(4) TYPE c,
alert_close_flag(1) TYPE c,
result LIKE number_of_days_closed.
IF alert_close_flag EQ 'Y'.
number_of_days_closed = update_date - create_date .
ELSE.
CLEAR number_of_days_closed.
ENDIF.
result = number_of_days_closed.
Rob -
Eclipse - debug step is not synchronise with source code.
Hi,
I have an web application witch run on tomcat, when Idebug the application, the debug steps are not synchronize with the source code. Same thing when I change the code , after making the jar file and putting it in the WEB-INF/lib of the web application, the modifications didn't take place. It seem that the old code always remains. I looked at the compile class in the jar file and the modifications have been taken in to account.
what can cause this kind of behavior ? I relaunch tomcat many times without succes ?
any help ? thanks a lot.Can it be the case that you compile your JAR optimized, i.e. without debug information? Then your classes are also without debug information.
This sounds very likely as a refresh problem. Be sure that both source files in Eclipse and class files in Tomcat have the same version (e.g. with simple system.out). -
Noob needs help with this code...
Hi,
I found this code in a nice tutorial and I wanna make slight
adjustments to the code.
Unfortunately my Action Script skills are very limited... ;)
This is the code for a 'sliding menue', depending on which
button u pressed it will 'slide' to the appropriate picture.
Here's the code:
var currentPosition:Number = large_pics.pic1._x;
var startFlag:Boolean = false;
menuSlide = function (input:MovieClip) {
if (startFlag == false) {
startFlag = true;
var finalDestination:Number = input._x;
var distanceMoved:Number = 0;
var distanceToMove:Number =
Math.abs(finalDestination-currentPosition);
var finalSpeed:Number = .2;
var currentSpeed:Number = 0;
var dir:Number = 1;
if (currentPosition<=finalDestination) {
dir = -1;
} else if (currentPosition>finalDestination) {
dir = 1;
this.onEnterFrame = function() {
currentSpeed =
Math.round((distanceToMove-distanceMoved+1)*finalSpeed);
distanceMoved += currentSpeed;
large_pics._x += dir*currentSpeed;
if (Math.abs(distanceMoved-distanceToMove)<=1) {
large_pics._x =
mask_pics._x-currentPosition+dir*distanceToMove;
currentPosition = input._x;
startFlag = false;
delete this.onEnterFrame;
b1.onRelease = function() {
menuSlide(large_pics.pic1);
b2.onRelease = function() {
menuSlide(large_pics.pic2);
b3.onRelease = function() {
menuSlide(large_pics.pic3);
b4.onRelease = function() {
menuSlide(large_pics.pic4);
I need to adjust five things in this code...
(1) I want this menue to slide vertically not horizontally.
I changed the 'x' values in the code to 'y' which I thought
would make it move vertically, but it doesn't work...
(2) Is it possible that, whatever the distance is, the
"sliding" time is always 2.2 sec ?
(3) I need to implement code that after the final position is
reached, the timeline jumps to a certain movieclip to a certain
label - depending on what button was pressed of course...
I tried to implement this code for button number two...
b2.onRelease = function() {
menuSlide(large_pics.pic2);
if (currentPosition = finalDestination) {
this.large_pics.pic2.gotoAndPlay("s1");
--> sliding still works but it doesn't jump to the
appropriate label...
(4) I wanna add 'Next' & 'Previous' buttons to the slide
show - what would be the code in this case scenario ?
My first thought was something like that Flash checks which
'pic' movieclip it is showing right now (pic1, pic2, pic3 etc.) and
depending on what button u pressed u go to the y value of movieclip
'picX + 1' (Next button) or 'picX - 1' (Previous button)...
Is that possible ?
(5) After implementing the Next & Previous buttons I need
to make sure that when it reached the last pic movieclip it will
not go further on the y value - because there is no more pic
movieclip.
Options are to either slide back to movieclip 'pic1' or
simply do nothing any more on the next button...
I know this is probably Kindergarten for you, but I have only
slight ideas how to do this and no code knowledge to back it up...
haha
Thanx a lot for your help in advance !
Always a pleasure to learn from u guys... ;)
MikeHi,
I made some progress with the code thanx to the help of
Simon, but there are still 2 things that need to be addressed...
(1) I want the sliding time always to be 2.2 sec...
here's my approach to it - just a theory but it might work:
we need a speed that changes dynamically depending on the
distance we have to travel...
I don't know if that applies for Action Scrip but I recall
from 6th grade, that...
speed = distance / time
--> we got the time (which is always 2.2 sec)
--> we got the disctance
(currentposition-finaldestination)
--> this should automatically change the speed to the
appropriate value
Unfortunately I have no clue how the action script would look
like (like I said my action script skills are very limited)...
(2) Also, one other thing I need that is not implemented yet,
is that when the final destination is reached it jumps to a certain
label inside a certain movieclip - every time different for each
button pressed - something like:
if (currentPosition = finalDestination) {
this.large_pics.pic2.gotoAndPlay("s1");
that statement just doesn't work when I put it right under
the function for each button...
Thanx again for taking the time !!!
Mike -
Help with html code - inserting video into Muse
I am seeking help writing the code to insert a video into Muse. I uploaded video into my Business Catalyst hosting. I need it to autoplay, loop and not show any controls or frames.
When I host video on Vimeo or YouTube, I see markings on the video that is why I am trying to just host in the same place that the files are stored for my website. If there is a way to host on youtube with out any markings showing up on the video I would be open to that too.
I don't want to see any play button or time bar.
Thanks in advance!!Hello,
Just as an FYI - we also have an HTML5 video tool over at MuseThemes.com that achieves this, but works on mobile devices as well. The link above looks like it uses Flash, which isn't common anymore since the release of HTML5 based video.
Simply drag the widget out onto your canvas, and link up your videos / set options like loop, controls visible, etc. It's quite a flexible widget, and there's a complete training video included so you don't get stuck
Check out the widget here
Just wanted to provide another alternative that could be helpful. Cheers!
Steve Harris
MuseThemes.com -
Parse Timestamp with source code
Somebody help me, how can i convert Date to Timestamp. i want to parse
the Timestamp. but the parse method only return Date.
Please help.
Here are the source code
Date mydate;
String myString;
Timestamp myTime = new Timestamp(mydate.getTime());
myString = DateFormat.getDateTimeInstance().format(myTime);
try {
DateFormat df = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT,Locale.US);
myTime = df.parse(myString);
catch (ParseException e) {}
best regards
NauI little chnage your example
String myString;
java.util.Date mydate = new java.util.Date();
Timestamp myTime = new Timestamp(mydate.getTime());
System.out.println("before " + myTime);
myString = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.FULL, Locale.US).format(myTime);
try {
DateFormat df = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.FULL, Locale.US);
myTime.setTime(df.parse(myString).getTime());
System.out.println("after " + myTime);
} catch (ParseException e) {
e.printStackTrace();
or yous form
String myString;
java.util.Date mydate = new java.util.Date();
Timestamp myTime = new Timestamp(mydate.getTime());
System.out.println("before " + myTime);
myString = myTime.toString();
myTime = Timestamp.valueOf(myString);
System.out.println("after " + myTime); -
RFC-XI-JDBC Scenario: Help with RFC code
HI,
I am doing RFC-XI-JDBC Scenario, where I have to poll the contents of my Ztable in SAP to Oracle.
The appraoach i am using here is :
1. Created a FM with import parameters as the fields of my Ztable and without any export parameter or source code.
2. Created a report to call that FM in background. The code of my report is as follows :
************************REPORT***********************************************************
Data: it_zrfc_read_table type table of zrfc_read_table,
wa_zrfc_read_table like line of it_zrfc_read_table.
PARAMETERS: tab_name like DD02L-TABNAME.
Data: l_tabname type DD02L-TABNAME.
At selection-screen.
select single tabname from DD02L into l_tabname where tabname = tab_name.
if sy-subrc <> 0.
message 'incorrect table name' type 'E'.
endif.
start-of-selection.
select * from (tab_name) into corresponding fields of table it_zrfc_read_table.
loop at it_zrfc_read_table into wa_zrfc_read_table.
CALL FUNCTION 'ZRFC_READ_TABLE2XI'
IN BACKGROUND TASK DESTINATION 'ORACLEGIS_RFC_SENDER'
EXPORTING
valve_id = wa_zrfc_read_table-valve_id
equnr = wa_zrfc_read_table-equnr
ernam = wa_zrfc_read_table-ernam
invnr = wa_zrfc_read_table-invnr
groes = wa_zrfc_read_table-groes
elief = wa_zrfc_read_table-elief
gwlen = wa_zrfc_read_table-gwlen
gwldt = wa_zrfc_read_table-gwldt
serge = wa_zrfc_read_table-serge
typbz = wa_zrfc_read_table-typbz.
endloop.
commit work.
NOw my problem is that although I am able to send a table with a single record, but when my records > 1, it is not able to poll.
Please guide me what can be altered in the code or any other suggestion.
Thanks,
PuneetHi,
Instead of calling RFC many times I would:
1) create RFM with only one import parameter
TYPE your_table type
2) call only once RFM in the report:
CALL FUNCTION 'ZRFCNAME'
IN BACKGROUND TASK
DESTINATION 'RFCDEST'
EXPORTING
pt_table = i_table.
COMMIT WORK AND WAIT.
This will also improve the performance.
Regards,
Jakub -
Help with html code. not running properly once on server
The video works fine in captivate and works once i publish it, but when I try to upload it onto the server it does not. This is my first time using captivate 4, and when I matched the codes from my old movies they were quite different. So I just messed with the code I had and made it lok like the old vodes and it runs fine on the server.
I was wondering if anyone had any ideas on what is going on with the code that it does not work on the server?
Thank you!!!!!
-danielleHello Sue. It's very easy actually.
If you have the lastest update of Muse CC from Nov 2013, there is a FREE Muse Library by musegrid.com that you can download from the Adobe Muse Exchange page that does this specifically using Google Analytics. Here is the direct link should you like to check it out:
http://muse.adobe.com/exchange-library/add-google-analytics
Start by "Right Clicking" on the "Master Page Icon" in the "Plan View" and choose "Page Properties" from the list of menu options available.
This will open up the "Page Properties Dialog Box" for the entire site. Once that dialog box is open, paste your code into the "Metadata" tab section (I believe that tab is displayed at default - at least on the Mac it is - I'm pretty sure it's the same on the Windows platform).
All anaytics embed code goes in the <head> tag of an html page (note: it actually says "HTML for <head>" at the top of the embed window area - making it helpful to know you're in the right area). This is also where you would add any <meta> tags too like facebook's OpenGraph code etc.
If using more than one master, included it to all masters. If just using it on a specific page - say like a landing page, just go to that particular page in your site's "Plan View" and paste it there instead.
Incase i get too "wordy" i've attached screen shots of what these should look like.
Good luck Sue!
And congratulations on a nice new computer too - its got "juice".
Maybe you are looking for
-
Hello all, I could use some help with my iPhone 4, I hope this is the best place to ask! The Problem: I want to do a full backup of my iphone to either itunes or to icloud. Unfortunately the iphone got wet and isn't working properly. The phone turns
-
Windows 7 Boot Camp Color Scheme Issues
Hi. I just recently installed Windows 7 Ultimate on my Boot Camp, and the first thing I noticed was the poor resolution that was stuck to 1600x1200 pixels. The Display Adapter used is listed as "Generic Non-PnP Monitor on Standard VGA Graphics Adapte
-
I have a 3rd party connection in my car that allows me to play my iPod through the car stereo. With my old 5th generation, I was able to make selections right from the iPod when it was connected to the system through the dock connector. When my iPod
-
Feedback about backuping up iPhoto Library
I am trying to come up with a good plan for backing up my iPhotos. I keep my photos in "Events" in iPhoto, and in the past exported and burned them to a CD when my drive got too full. I recently got a huge external drive to store photos on and am try
-
Earpiece & Speeaker won't work.
After using the headset jack, External speaker and earpiece on the Treo650 stopped working. I have tried soft reset and all posible things. But, nothing is helping. Someone, please advise me to sovle this problem. Post relates to: Treo 650 (Cingular)