Today i finally set some time aside to fix my friends site a bit and make some visual changes.
The changes made are really cosmetic but they make in a way big differences.
For example the usage of border radius. this simple css addition changes the presentation with minimal code change.
-moz-border-radius: 10px; -webkit-border-radius: 10px;
or
-moz-border-radius: 1em; -webkit-border-radius: 1em;
also you have khtml for the Konqueror on KDE
-khtml-border-radius: 3px;
they all work mostly the same
but whats great about the radius kit is that it can be applied to anything
for example below is a little css snippet that will make your wordress calender link with curves
#wp-calendar tbody tr td a {
background-color: #566460;
padding: 4px;
-moz-border-radius: 3px;
-khtml-border-radius: 3px;
-webkit-border-radius: 3px;
}
so go ahead and checkout the differences between the original eGamer theme by Elegant Themes
and the revamped version by me
original
revamped
so i had table that was filled with spam after ID 22, meaning i wanted to delete everything after ID 22
here is the a simple line you can query to delete them all
DELETE FROM `volunteers` WHERE `volunteers`.`id` >22 LIMIT 1000 ;
so my table is called volunteers, and the controlling field is id,
the greater than 22 means to delete everything that has a id greater than 22
the limit part controls how many rows the query will effect
originally taken from here
http://jquery-howto.blogspot.com/2009/02/how-to-get-youtube-video-screenshot.html
A great little way of getting the any video link from a youtube video
cool uses
<script type="text/javascript"> function getScreen( url, size ) {
if(url === null){
return ""; } size = (size === null) ? "big" : size; var vid; var results;
results = url.match("[\\?&]v=([^&#]*)");
vid = ( results === null ) ? url : results[1];
if(size == "small"){
return "http://img.youtube.com/vi/"+vid+"/2.jpg"; }
else {
return "http://img.youtube.com/vi/"+vid+"/0.jpg"; }
}
</script>
<?php $message = "http://www.youtube.com/watch?v=iIp7OnHXBlo";
echo $message;
?>
<script type="text/javascript">
var imgUrl_big = getScreen("<?php echo $message ?>");
var imgUrl_small = getScreen("<?php echo $message ?>", 'small');
document.write('<img src="' + imgUrl_big + '" />');
document.write('<img src="' + imgUrl_small + '" />');
</script>
http://cis.poly.edu/cs220/DM-Java/DM-Java.html
For ech listener the input is:
listener’s name
song title
length
song title
length
song title
length
and there can be any number of them.
For each listener, state their average song length
After looping thorugh all the input and at the end state the average song length.
Also state the longest and shorted song (assume no duplicates).
Time is in seconds (for now - think about how to do minutes and seconds).
Use the sentinel method to gather data.
Use the Buffered Reader.
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class songUser
{
public static void main(String[] args) throws Exception
{
final String SENTINAL = "STOP";
final int SENTINAL_VALUE = 3;
final double MIN_SEC = 60;
String name;
String songName, shortestName = null, longestName = null;
String shortestNameAll = null, longestNameAll = null;
String songMinutesInput, songSecondsInput;
double songMinutes, songSeconds;
double songSum2, shortest = -1, longest = -10;
double shortestAll = 0, longestAll = 0;
int counter = 0;
double songMin, songMax;
int songAvgmin;
int songAvgsec = 0;
double songCounter = 0;
double songSum = 0, songTotalSum = 0;
boolean once = true;
int songTotalAvgMin, songTotalAvgSec;
int counterAll = 0;
BufferedReader ConsoleKeyboardIn = new BufferedReader(new InputStreamReader(System.in));
System.out.print("Enter your name, or [stop] to end program: ");
name = ConsoleKeyboardIn.readLine();
while(!(name.equalsIgnoreCase(SENTINAL))) {
shortest = 999;
shortestAll = 999;
for (int i = 0; i < SENTINAL_VALUE; i++){
System.out.print("Enter the name of your song: ");
songName = ConsoleKeyboardIn.readLine();
System.out.print("Enter the minutes in the length of your song: ");
songMinutesInput = ConsoleKeyboardIn.readLine();
songMinutes = Double.parseDouble(songMinutesInput);
System.out.print("Enter the seconds in the length of your song: ");
songSecondsInput = ConsoleKeyboardIn.readLine();
songSeconds = Double.parseDouble(songSecondsInput);
songSum2 = ((songMinutes * MIN_SEC) + songSeconds);
songSum += ((songMinutes * MIN_SEC) + songSeconds);
if (songSum2 < shortest) {
shortest = songSum2;
shortestName = songName;
}
if (songSum2 < shortestAll)
{
shortestAll = songSum2;
shortestNameAll = songName;
}
if (songSum2 > longest) {
longest = songSum2;
longestName = songName;
}
if (songSum2 > longestAll) {
longestAll = songSum2;
longestNameAll = songName;
}
counter++;
counterAll++;
}
if(counter == SENTINAL_VALUE) {
counter = 0;
}
System.out.print("Longest Song: " + longestName);
System.out.println();
System.out.print("Shortest Song: " + shortestName);
System.out.println();
songAvgmin = (int) ((songSum / 60) / 3.0);
songAvgsec = (int) ((songSum / 3.0) % 60);
if (songAvgsec < 10) {
System.out.println("Song Average: " + songAvgmin + ":0"+ songAvgsec);
} else {
System.out.println("Song Average: " + songAvgmin + ":"+ songAvgsec);
}
songTotalSum += songSum;
songSum = 0;
System.out.print("Enter your name, or [stop] to end program: ");
name = ConsoleKeyboardIn.readLine();
}
songTotalAvgMin = (int) ((songTotalSum / 60) / counterAll);
songTotalAvgSec = (int) ((songTotalSum / counterAll) % 60);
System.out.println("----------------");
if (songTotalAvgSec > 10) {
System.out.println("Average of all songs: " + songTotalAvgMin + ":" + songTotalAvgSec);
} else {
System.out.println("Song Average of all songs: " + songTotalAvgMin + ":0" + songTotalAvgSec);
}
System.out.println("Longest Song of all songs: " + longestNameAll);
System.out.println("Shortest Song of all songs: " + shortestNameAll);
System.exit(0);
}
}