Dear all,
i´d like to update all NULL fields in one table to 0. Of course
UPDATE mytable SET firstcol=0 WHERE firstcol IS NULL
would do the job. But I wonder if there´s a smarter solution than just c&p this line for every column. Thx in advance for any suggestions
...
In my database, I have a lot of courses that are compulsory. Some are elective. However, there are courses of a third kind: A list from which you have to choose X courses. The list (and the number X) is different for each study program. How would you represent this relationally?
...
Trying to get a simple test perl script working. Have the following files/folder structure on a shared hosting service:
~/public_html/
.htaccess
~/public_html/lookup Permissions: "drwxrwxrwx 2 myusername myusername"
.htaccess
lookup.pl* Permissions: "-rwxr-xr-x myusername myusername"
The first .h...
In C, what is meant by "functions with a variable number of parameters"?
...
Hi,
I noticed a different when calling a function with empty parentheses, or without any parentheses at all.
I am not passing any arguments to the function so I wondered what would be the difference between:
window.onload = initAll();
and
window.onload = initAll;
Please explain the principle behind it.
Thanx in advance.
...
I wrote a piece of java code using threads, JDBC, Java Mail API etc. without using any of the frameworks (read Spring). I am frankly not too comfortable learning them first (lots of terminologies to remember!) and use them. So, please suggest me some ways to refine my existing code incorporating few of these framework concepts applicable...
What is the difference between this:
somefunction() {
...
char *output;
output = (char *) malloc((len * 2) + 1);
...
}
and this:
somefunction() {
...
char output[(len * 2) + 1];
...
}
When is one more appropriate than the other?
thanks all for your answers. here is a summary:
...
I have a bit of Flash experience, did a full featured movie player, other stuff in AS3 and got plenty of programming skills in other languages, BUT now I need to create a multi paged website. Quite easy, a few pages, some animations here and there, nothing fancy, got all the graphics. But time is short on this one, so I need some advice ...
Hi, I'm using Groovy and Grails and am trying to take a parameter passed to a controller, parse it, and add each individual element into a list. I thought this would work, but it is adding the whole string into the list, leaving me with only one element.
list = []
list.add(params["firstNames"].split())
is returning a list with size ...
Hello, I am using Grails in an application that allows the inline editing of data in a data grid. There are certain key fields that may be defined and should not be editable. Here is some example code from the tag lib that I am using
case "dropdown":
out << "<select id='"+prefix + id+"' name='" + fieldData.code + "'>"
...
Hi there!
I got a simple question about jQuery but rather javascript approaches in general...
Is it ok, to do this? :
this._checkedTexts.length = 0; // <- array belonging to "me"
var contextCheckedTexts = this._checkedTexts;
$('#valueContainer input:checked').each(function() {
contextCheckedTexts.push($(this).text());
});
Since '...
Hello,
I'm comparing values of an excel sheet to record values returned from a database and one record is passing through the if statement when it should fail the if statement.
The if statement looks like this:
if (record.value.equals(cellVal) == false)
{
record.value = cellVal
record.modifyUser = userId
...
Should functions always return something? I often write very basic functions which are used as shorthand to do things that happen a lot such as:
function formsAway() {
$("#login_form, #booking_form").slideUp();
}
Should this function exist - is there a better way, or is this fine?
...
Hey all, I have a friend who's going to jail on Wednesday, for about a year. I want him to utilize his time in county learning how to program and about the internet so I can help him land a job when he gets out. What are some of the best books that teach programming basics, which languages do what, how servers & databases work, how the...
For instance, a method returns an object of type List.
public List<Foo> bojangles ()
...
Some piece of code calls the method FooBar.bojangles.iterator();
I'm new to Java, but from what I can tell.. List is an interface, so the iterator method has to be implemented somewhere else. When digging for the source code for Java.Util and tha...
Hello,
Beginner question here. In the .h file of an objective c class..
If you have an @property int someVar; for example.. and you're actually going to write the setter method yourself in the .m file.. do you still have to declare that setter method in the .h file?
If you have some @property declarations in the .h file and you are w...
Some time ago I asked a question about the same issue, @BenAlabaster explained it thoroughly in his answer, I guess I am still missing a piece of logic here.
I tried to call functions that are assigned to variables like I've shown below, in the last function.
Well it didn't work. Assuming it happened because the variable functionThree i...
I have this on a javascript var: (it's a http returned data, and I don't know if it's an array or string - (how can we see that?) - Update: using typeof returned "string", so it's a string.
[{"nomeDominio":"gggg.fa"},{"nomeDominio":"rarar.fa"}]
How can we pass/transform that, into something like this:
["gggg.fa","rarar.fa"]
?
Than...
if (isset ($_POST['somethingA']))
{
//code for doing something A
}
elseif (isset ($_POST['somethingB']))
{
//code for doing something B
}
I will need to access some data from somethingA code, into somethingB code.
How can I do that in a proper way?
Should I declare a variable outside the conditionals, work inside th...
Hi there,
Forgive me if this has been covered before, I searched to no avail.
I have a script that looks into a directory to find the files inside. There is a conditional line that only looks for files with a certain extension:
if(strtolower(substr($file, -3)) == "mp4"){...
So that will only look for files with an 'mp4' extension.
...