What is the difference between HTML tags and
?
I would like to ask for some simple examples showing the uses of <div>
and <span>
. I've seen them both used to mark a section of a page with an id
or class
, but I'm interested in knowing if there are times when one is preferred over the other.
Source: (StackOverflow)
I've heard of a few ways to implement tagging; using a mapping table between TagID and ItemID (makes sense to me, but does it scale?), adding a fixed number of possible TagID columns to ItemID (seems like a bad idea), Keeping tags in a text column that's comma separated (sounds crazy but could work). I've even heard someone recommend a sparse matrix, but then how do the tag names grow gracefully?
Am I missing a best practice for tags?
Source: (StackOverflow)
I am creating my first project in Subversion. So far I have
branches
tags
trunk
I think I immediately need to make branches singular and start over. Update branches is the norm.
I have been doing work in trunk and moving the contents to tags as follows.
mkdir tags/1.0
cp -rf trunk/* tags/1.0
svn add tags/1.0
svn commit -m " create a first tagged version"
My gut tells me this is totally wrong, and I should maintain some relationship between the files using svn copy
. The files I create in this way will have no relationship to each other, and I am sure I will miss out on Subversion features. Am I correct?
Should I use svn copy for the individual files?
mkdir tags/1.0
svn add tags/1.0
svn copy trunk/file1 tags/1.0
svn copy trunk/file2 tags/1.0
svn copy trunk/file3 tags/1.0
svn commit -m " create a first tagged version"
Should I use svn copy on the entire directory?
svn copy cp -rf trunk tags/1.0
svn commit -m " create a first tagged version"
Source: (StackOverflow)
I switched from Subversion to Git as my day-to-day VCS last year and am still trying to grasp the finer points of "Git-think".
The one which has been bothering me lately is "lightweight" vs. annotated vs. signed tags. It seems pretty universally accepted that annotated tags are superior to lightweight tags for all real uses, but the explanations I've found for why that's the case always seem to boil down to either "because best practices" or "because they're different". Unfortunately, those are very unsatisfying arguments without knowing why it's best practices or how those differences are relevant to my Git usage.
When I first switched to Git, lightweight tags seemed to be the best thing since sliced bread; I could just point at a commit and say "that was 1.0". I'm having trouble grasping how a tag could ever need to be more than that, but I certainly can't believe that the Git experts of the world prefer annotated tags arbitrarily! So what's all the hubbub about?
(Bonus points: Why would I ever need to sign a tag?)
EDIT
I've been successfully convinced that annotated tags are a Good Thing — knowing who tagged and when is important! As a follow-up, any advice on good tag annotations? Both git tag -am "tagging 1.0" 1.0
and trying to summarize the commit log since the previous tag feel like losing strategies.
Source: (StackOverflow)
At work I've been tasked with turning a bunch of HTML
files into a simple JSP
project. It's really all static, no serverside logic to program. I should mention I'm completely new to Java. JSP files seem to make it easy to work with common includes and variables, much like PHP
, but I'd like to know a simple way to get something like template inheritance (Django
style) or at least be able to have a base.jsp file containing the header and the footer, so I can insert content later.
Ben Lings seems to offer some hope in his answer here:
JSP template inheritance
Can someone explain how to achieve this?
Given that I don't have much time I think dynamic routing is a little much, so I'm happy to just to have URLs map directly onto .jsp
files, but I'm open to suggestion.
Thanks.
edit: I don't want to use any external libraries, because it would increase the learning curve for myself and others who work on the project, and the company I work for has been contracted to do this.
Another edit: I'm not sure if JSP tags
will be useful because my content doesn't really have any template variables. What I need is a way to be able to do this:
base.html:
<html><body>
{ content.body }
</body></html>
somepage.html
<wrapper:base.html>
<h1>Welcome</h1>
</wrapper>
with the output being:
<html><body>
<h1>Welcome</h1>
</body></html>
I think this would give me enough versatility to do everything I need. It could be achieved with includes
but then I would need a top and a bottom include for each wrapper, which is kind of messy.
Source: (StackOverflow)
I have a web application on a Linux server which starts with <?
I needed to copy this application to a windows environment and everything is working fine except that an SQL statement is being rendered differently. I don't know if this has to do with the script beginning with <?php
instead of <?
because I don't know from where to enable the <?
from the PHP.ini
so I changed it to <?php
I know that these 2 statements are supposed to mean the same but I need to test it with <?
in order to ensure that the application is exactly the same. This way I can eliminate another possibility.
Thanks
Source: (StackOverflow)