<style type="text/css">
#scroll {
position: relative;
width: 340px;
height: 270px;
overflow: auto;
}
</style>
<script type="text/javascript">
function displayMessage(message) {
var oScroll = document.getElementById("scroll");
// check if the scroll is down
var scrollDown = (oScroll.scrollHeight - oScroll.scrollTop <= oScroll.offsetHeight );
// display the message
oScroll.innerHTML += message;
// scroll down the scrollbar
oScroll.scrollTop = scrollDown ? oScroll.scrollHeight : oScroll.scrollTop;
}
</script>
<div id="scroll"> </div>Filter
2009-03-13
Rullande textruta
Css
2009-03-10
Versionshantering med subversion
Tips & tricks
Följande utförs på servern:
Om inte servern är startad starta den med:
svnserve -d
Skapa ett repository:
svnadmin create myrepository
Konfigurera åtkomst mm genom att redigera filerna i conf-mappen.
Följande kommandon utförs på klienten:
import - kopiera in (ett träd) av filer som inte tidigare finns till ett repository. Ingen working copy behövs för att göra detta.
Ex: svn import mytree svn://svn.example.com/repos/project -m "Initial import"
(mytree betyder att alla filer som ligger i mappen mytree ska kopieras till repositoryt. Om ingen mapp anges kopieras alla filer i den mapp man står.) För att sedan börja jobba med filerna behöver de checkas ut.
checkout - Hämtar filer från ett repository
Ex: svn checkout http://svn.example.com/repos/calc
Ex2: svn checkout svn://svn.example.com/repos/calc
Ex3: svn checkout svn+ssh://svn.example.com/repos/calc
update - Hämtar uppdateringar från repositoryt om någon annan redigerat filer sedan du checkat ut den
Ex: svn update
status - Kollar i vilket, av fyra lägen som filer befinner sig i, vilken revision de har mm
Ex: svn status stuff/fil.txt
Ex2: svn status -v
revert - Återgå till tidigare version
Ex: svn revert fil.txt
resolve - Används för att lösa en konflikt om någon har uppdaterat en fil på samma plats som du själv. En konflikt kan uppstå vid en update. Välj vilken version som ska användas (din -mf, deras -tf, eller redigera manuellt och spara en working copy). Kör commit efter en resolve för att ladda upp till repositoryt.
Ex: svn resolve -mf fil.txt
Ex2: svn resolve -tf fil.txt
Ex3: svn resolve --accept working fil.txt
commit - Checkar in filer tillbaks till ett repository så att ändringar man gjort blir tillgängliga för andra
Ex: svn commit fil.txt -m "Fixade ett stavfel."
Ex2: svn commit
(Innan man gör en commit kan det vara bra att göra en update
för att ställa alla filerna till samma revision)
The typical work cycle looks like this:
1. Update your working copy.
• svn update
2. Make changes.
• svn add
• svn delete
• svn copy
• svn move
• svn mkdir
3. Examine your changes.
• svn status
• svn diff
4. Possibly undo some changes.
• svn revert
5. Resolve conflicts (merge others' changes).
• svn update
• svn resolve
6. Commit your changes.
• svn commit
cat - Läser en fil
Ex: svn cat -r 2 rules.txt
Ex2: svn cat -r 2 rules.txt > rules.txt.v2
list - Visar en lista av filer
Ex: svn list http://svn.collab.net/repos/svn
Ex2: svn list -v http://svn.collab.net/repos/svn
export - Hämtar en "release" utan .svn-filerna
Ex: svn export http://svn.example.com/svn/project
Ex2: svn export http://svn.example.com/svn/project -r 1729
cleanup - Tar bort ev lock-filer som finns kvar efter en crash
Ex: svn cleanup
2009-03-02
Prioritetsordning för stilmallar
Css
Specificity allows browsers a way to determine which styles to apply when multiple, conflicting styles point to the same element.
The general rule of thumb is that the more specific - another way to put it might be the more precise - a selector is about what it's targeting, the higher it's specificity and therefor the greater the chance that it will override other styles.
When considering how specific a selector is, remember that css simply does not get any more specific than the ID selector. It targets a single, specific element, after all. The only thing more specific than that is an inline style applied directly to the tag.
Technically speaking, calculating specificity involves numbers. Each selector gets a value for a,b,c,d, following these rules:
1)If the element has an inline style declaration, a=1. Otherwise, a=0.
2)B= the number of ID selectors.
3)C= the number of other attributes and pseudoclasses (including class names)
4)D= the number of element names
5) Concatenate the four numbers together. The resulting 4 digit number is the specificity for that selector.
So, calculating your selector specificity clearly shows why the #div_main one wins...
#div_main table th has a specificity of 0102.
table.myTable th has a spcificity of 0012.
The first selector is far more specific, targeting th's in only tables that are located in the #div_main div. The second is far more general, targeting th's in all tables in the Mytable class.
Make sense?
2009-01-08
On line radio i linux
Linux
# Som root:
apt-get remove totem-mozilla mozilla-plugin-vlc
apt-get install mozilla-mplayer
apt-get install ubuntu-retricted-extras
wget http://www.medibuntu.org/sources.list.d/hardy.list -O /etc/apt/sources.list.d/medibuntu.list
apt-get update
apt-get install medibuntu-keyring
apt-get update
apt-get install w32codecs libdvdcss2
# 64 bitars system: apt-get w64codecs libdvdcss2
