Forum Replies Created

Adelaid Member

As I have no idea what the error is stating and I have no idea what the rest of the code is, I know System.Windows.Forms.DataGridViewdoesn’t have a method DataBind().

The databinding happens automatically without calling the method (this method is only used in webforms’ version: GridView)

So, try without the method, just add the datasource and run the code:

projectentities ent = new projectentities();
DataGridView.DataSource = ent.teacher_table;
Adelaid Member
<% Dim objConn 
Dim connStr
Set objConn = Server.CreateObject("ADODB.Connection") 
connStr = "File Name=K:daconn.udl; "
objConn.Open(connStr) %>
Adelaid Member

Include the scripts in the order they are needed, so general and then addadmin.


The later scripts can then access the earlier included scripts using regular function calls.

Your snippet has AdAdmin redeclare the functions from General, not calling them btw.

Adelaid Member

You missed the final ;

javascript:document.body.contentEditable='true'; document.designMode='on'; void 0;

And with the ‘ it works fine here

I’d say it might just be dependant of the type and styles of the web-pages – I doubt it would edit html5 or some on-the-flu loading type pages..

Adelaid Member

“The bidding table has the seller id and buyer id; so you would just do a ‘join’ to the registered user table using this. You can have as many indexes as you want to help speed the queries. ”
Okay so can you do something like this then for example:

SELECT Bidding.SellingUser AS SellerID
FROM Bidding
INNER JOIN Users
ON Bidding.SellerID = Users.UserID

I’m just curious because I thought the values inside the ON statement had to be the same or am I wrong about that?

Thank you for the explanation and the example you gave, it’s starting to make much more sense. Yea, I also had always wondered why doing this doesn’t slow down the process of finding something since you have to look at multiple tables but I guess the computer is quick enough that doing this actually saves time.

Adelaid Member

Use Selenuim.

Adelaid Member

If the user doesn’t match your SQL statement, you won’t have any results in your ResultSet. In other words, you’ll need to do an if statement on the ResultSet object and if it is empty or null, show your error message.

Your query might be vulnerable to SQL injection (is viewEmployeeID a String or int?). It is recommended to use PreparedStatements to get around this, but also do validation on your input before sticking it into the query.

Adelaid Member

jQuery is good for what it does. While this is a good choice for production quality code, considering that you are learning, it would be better if you try to implement the jQuery’s feature you want, without using jQuery. In this way you will learn some really useful things and you will have the pleasure of not being a code monkey pasting only known solutions.

Inventing the solution will teach you a lot. If you don’t feel like doing it by yourself, even using jQuery is a skill that is good to have. Reinventing the wheel it’s not always a good choice when you are doing production code. A library that was developed for 10 years will be surely better than something you can do in a few days; using other people code is something you must be able to do and something you will do a lot if you want this career.

HTML and PHP will suffice, CSS and JavaScript, in your case, would be good additions. Maybe you won’t harness the power of CSS in this case but it will easier and speed up things in other situations.

This is what you need:
You should try doing it by reading the manual and trying to not rely too much on online tutorials. Getting used to manuals is very important.

http://php.net/manual/en/book.mysql.php

Adelaid Member

Remember that mysql_ functions are deprecated as of PHP5. If running PHP 5, use the following instead:


If you wanted to use OOP:

connect_errno){
die("Could not connect: " . $link->connect_error);
}
echo 'Connected successfully';
// $link->query("SELECT * FROM xyz WHERE 1") as opposed to mysqli_query($link, "SELECT * ...");
$link->close();
?>
Adelaid Member

Those company want success, there are branch where you need a computer scientist and you need to be academical in the interview. But for the vast majority of fields, computer science knowledge is not a good indicator of programming skills. If you are talking about fresh programmers, then yes, in the past they asked academic exercise because there weren’t other means. Nowadays the interview at Google tend to not revolve too much about computer science and tend to be focused on real programming. Is valued more an active github profile than a degree.

Times are changing and so has changed the interview process. Where the real talent is(people that got called appositely for their precedent works), there is near zero computer science theory. Google, etc. want to get things done. A freshman is not regarded anymore, I am in direct contact with one of those companies and they are changing the hiring process. The person with a degree in computer science that get hired is a thing of the past(when they need real talent they tend to overlook all the paper; when they need only to move money then a young student is enough). Startups are another example of how the hiring process is changing. A person with a math degree and a computer science one is good. A person with a computer science degree is also good. But you can’t say that a person without those is not good. Some of the best programmers around don’t even have/need a degree.

Adelaid Member

You don’t know what you are talking about. I don’t want revenge, I want that people contribute. You are not clearly contributing, you are only flaming and this will lead to you getting banned, if you don’t want to be banned, provide facts and be respectful. Where I said that it is too mathematical? Did you read my post? If I’m ignorant you are delusional, you are inventing things on the fly. Where did I say that is too mathematical?
Order and good practice here? If you tidy your room does this make you a good programmer? This exercise is programming like a simple multiplication in regards to mathematics. This is a simple exercise with array, you have an array, you work with an array and you use function with an array. Who is the ignorant?
The project euler questions are not all number theory.

I said academic, if you had work as a programmer you will surely know that those simple exercise are far from a real program. You know how successful companies interview? Do you think they want a monkey that do simple exercise or someone that really know to make a program? Can you post your github profile so that all the people on this forum can see your great skills and can see that you know how to make a real software? Do you think to be special?

There are other programmers in this forum, do you want to bet on what they will say?

Adelaid Member

You gave me good memories. The first time I made similar exercises. I now work as a programmer, and I do a lot of interviews. In the interviews I don’t ask this type of exercise because I think they are too academic and too distant from real programming. I’m not saying that they aren’t good for the mind, but I think that are not useful to know if someone is a good programmer. I tend to ask question to see their reasoning and then I ask something about their precedent programs like the ones on github. Do you feel offended if I don’t do this exercise? I fear that by doing it and posting a solution, I can spoil the fun of someone that need this exercise more than me.

Adelaid Member

Here is solution

#include 
#include 
using namespace std;
bool check_if_prime(int n);
int main()
{
unsigned int nth_prime, number_of_primes;
unsigned int test_int;

printf("Enter the nth_prime to find: ");
scanf("%u", &nth_prime);
test_int = 1;
number_of_primes = 0;

do
{
   test_int++;
   if (check_if_prime(test_int) == true)
      number_of_primes++;
}
while(number_of_primes < nth_prime);
printf("The %u Prime Number = %u\n", nth_prime,test_int);

return 0;
}
bool  check_if_prime(int n)
{
   bool isPrime = true;
   int divisor;
   for(divisor = 2; divisor < n; divisor++)
   {
      if(n % divisor == 0)
      {
         isPrime = false;
         break;
      }
   }
   return isPrime;
}
Adelaid Member

If you want to get serious don’t watch video tutorials but read a book and program.

accu.org/index.php?module=bookreviews&func=browse

I don’t know why you are choosing C but I can tell you that the only way to get good a programming is reading and programming. Stay away from video tutorial and read the books with the highest score on Accu and, most importantly, program as much as you can. Other great links for C

http://stackoverflow.com/questions/562303/the-definitive-c-book-guide-and-list
https://github.com/vhf/free-programming-books/blob/master/free-programming-books.md#c
Adelaid Member

Google MOOC EDX CS50 it’s a free video course and they teach C

Viewing 15 posts - 46 through 60 (of 69 total)
en_USEnglish