I really want to know popular opinion on controversial programming topics. Questions like:
Why do some people prefer vi over emacs (or vice versa)?
Is Java faster than C++?
Is Intel faster than AMD?
It seems SO discourages such conversions because of potential flamewars. So where do people go to discuss such matters? I'm especially interested in venues where people can "up vote" good comments and good questions.
How to Firefox 2.0 cross browser issues? When i make site using Firefox 3.6 then seee site in Firefox 2.0 some time it shows some layout problems.
for IE i can use conditional comments and different CSS but what to do for Firefox 2.0 issues
this is what i have so far
function contact() {
if (!empty($this->data)) {
$this-Contact-create();
if ($this-Contact-save($this-data)) {
if($this-data['Contact']['comments'] == ' website,newsleter etc '){
$this-Contact-saveField('webstuff', 1);
}
$this-Session-setFlash('done');
$this-redirect('/');
} else {
$this-Session-setFlash('faild');
}
}
}
I would like to start learning Java, but there are so many resources out there... I am having a hard time deciding which path to take. I saw a neat book, Objects First with Java, and I tested out Bluej and some tutorials. Anyone use this and have comments?
I am looking at some code that has a lot of sort calls using comparison functions, and it seems like it should be using key functions.
If you were to change seq.sort(lambda x,y: cmp(x.xxx, y.xxx)), which is preferable:
seq.sort(key=operator.attrgetter('xxx'))
or:
seq.sort(key=lambda a:a.xxx)
I would also be interested in comments on the merits of making changes to existing code that works.
I have lot of textarea fields to add comments and quotes. How can I validate these fields. I checked null validation other than null validation what validation I have to do?
I have this mysql table called comments which looks like this:
commentID parentID type userID date comment
The commentID is set as Primary key, but most of the time I fetch the data using the parentID. How should I set my indexes?
Should I just add an index on parentID and let commentID be the primary key?
I have a forum whereby links to a thread looks like
http://www.website.com/comments.php?topic_id=1
How can I make it look like this
http://www.website.com/1046302/some-link-desc#12154109
so that when such links are given out, the user is taken directly to that particular comment.
I'm particular about the #12154109 . The other part of the URL /1046302/some-link-desc is achieved through .htaccess configuration.
I am new to regular expressions. I want to use java's replaceAll() function to replace any CSS comments in a string.
Basically I want to use regex to search for anything that is surrounded by "/*" and "*/" and replace it with "".
After trying to find a reference to an API/tutorial to such thing, I have come here.
I would like to scan a specific group wall, pulling all posts from it, with PHP or C#.
In the end, I would like to have a nested-array containing each posts, with the next details:
An array of the related comments
Likes
Views
Obviously, I don't ask for any code, only a reference to the related API I will need to use.
EDIT: If this is not possible, should I consider cURL as an option?
I just want ask for your comments/suggestions on how to create a customized listview (if that's a good implementation) in WPF that displays images coming from a table from a database (more like a playlist) that rotates similar to a film (moving horizontally - on loop)
Any ideas?
I am newish to MVC and understand all the great things about it, including the reasons why voewstate isnt available, however there are some circumstances where I think having some kind of view state will be quite handy, In my case I am thinking about list pages with various search filters that can be applied to the list.
Would it be worthwhile implementing some kind of pseudo viewstate to hold this info in some cases? or is there a better solution?
Any examples out there?
Your comments appreciated.
Hi All
Currently developing a PHP framework and have ran into my first problem. I need to be able to drop the framework into any folder on a server, no matter how many folders deep, and need to find that directory to use as a base URL.
For example, it currently works if I put the framework in the root of the server (http://cms.dev/), but if I were to put it in http://cms.dev/folder/ it does not work.
Please advise, any comments welcome.
BenTheDesigner
class B {
public:
static int a;
}
class C:B {
}
I want to use a variable through any inherited classes but it has problem when I declare a.
B::B() {
a=1;
}
Do I do it right ?
Thanks for reading and waiting for your comments.
The Django documentation gives en example like so:
b = Blog.objects.get(id=1)
b.entry_set.all()
Which from what I understand results in 2 queries. What if I wanted to get the blog, the blog entries and all the comments associated with that entry in a number of queries that does not depend on the number of entries? Or do I have to drop down to SQL to do that?
Migrating from Subversion to Git using svn2git (which internally uses git-svn) I'd like to know how I can find a specific revision commit.
It is quite common to have issues tracker to have comments like:
"Fixed in r12345".
Given this, I'd like to be able, for example, to extract the diff corresponding to r12345.
Thanks in advance.
Regards
I saw some comments on forums, and it seems that people want to be able to inherit from multiple classes in c#. Why would you ever need this? I can't think of any use for this, but since there's people that want it, there's got to be some.
Hi there,
I would like to be advised on what would be better (in regards to performance)
A) 1 DATABASE with 4 tables
or
B) 2 DATABASES (same server), each with 2 tables.
The tables size and usage are more or less similar, so the 2 tables on Database 1 would be similar usage/size to the 2 tables on database 2
The tables could have +500,000 records and the 2 tables on each database are not related (no join queries etc between them)
Thanks in advance for your comments
Most often the cleanup rules (Preferences Java Code Style Clean Up) in Eclipse work perfectly and create nice-looking code.
But sometimes, especially with comments and concatenated string snippets (like inline SQL queries), the cleanup just messes things up, and destroys my formatting.
Is there a way to say to Eclipse "Don't touch this block of text! I have formatted it just the way I like, and you would make it just less readable"?
I've just inherited a large project previously coded by about 4-5 people. The documentation consists of comments, and is not very well written. I have to get up to date on this project. How do I start? It consists of many different source files. Do you just dig in? Are there tools that can help visualize the structure/flow?
I need to come with a strategy to use gather information about the health of my linux platform, hardware health such as high CPU temperature and may be disk space usage, etc... I know my examples are not very good ones.
Essentially, I have an SNMP agent running on Linux and I need it to provide platform specific health and state information. Are there any Linux packages that do this, what MIBs to use, Dell Open Manager functionality???
Any thoughts and comments are appreciated.
Maybe I've been working on my site for to long, but I can't get the following to work. I am having my textarea fire an onkeyup() event called limiter which is supposed to check the textarea and limit the text in the box, while updated another readonly input field that shows the amount of characters left.
This is the javascript code:
<script type="text/javascript">
var count = "500";
function limiter(){
var comment = document.getElementById("comment");
var form = this.parent;
var tex = comment.value;
var len = tex.length;
if(len > count){
tex = tex.substring(0,count);
comment.value =tex;
return false;
}
form.limit.value = count-len;
}
</script>
The form looks like this:
<form id="add-course-rating" method="post" action="/course_ratings/add/8/3/5/3"
accept- charset="utf-8"><div style="display:none;"><input type="hidden"
name="_method" value="POST" />
//Other inputs here
<div id="comment-name" style="margin-top:10px">
<div id="comment-name-text">
<b>Comments</b><br />
Please leave any comments that you think will help anyone else.
</div>
<style type="text/css">
.rating-form-box textarea {
-moz-border-radius:5px 5px 5px 5px;
}
</style>
<div class="rating-form-box">
<textarea name="data[CourseRatings][comment]" id="comment"
onkeyup="limiter()" cols="115" rows="5" ></textarea>
<script type="text/javascript">
document.write("<input type=text name=limit size=4
readonly value="+count+">");
</script>
</div>
<input type="submit" value="Add Rating" style="float: right;">
</form>
If anyone can help that would be great.