hericles 289 Master Poster Featured Poster

We don't do homework but we do help when you've tried and get stuck. You shouldn't be stumped if this is homework because you would have done course work leading up to this.
Have you even managed to create the BankAccount class?
Post up hwat you've done so far and then, maybe, someone will help.

hericles 289 Master Poster Featured Poster

Compared to some more modern languages (like PHP, .net and ruby) C/C++ can be difficult. I would suggest learning something simple but still OOP so you can learn good basics and techniques and get to understand the principles involved, then tackle C/C++ if that is what you want to do.
I would suggest that PHP and vb.net are good starting points, slightly harder is java,c# and ruby

hericles 289 Master Poster Featured Poster

I'm not an expert on Python but I do know it has some advantages for this type of problem but to do this trivally in PHP:
Loop through the lines in the csv file (or whatever array you've loaded them into first).
Append each line to a variable (so it becomes line 1 + line 2 + line 3) and then do a modulo check on the loop counter + 1 (because it starts at 0 not 1), if it is evenly divisible by 3, pass the built up string to whatever is storing the final result, reset the variable and loop again.

hericles 289 Master Poster Featured Poster

Compare what data type the cid column in the database is to what the cid variable holds after the line: cid = Request.Form("customerID").
Data type erros normally mean you are passing in the wrong type against what is expected (string vs int for example).

hericles 289 Master Poster Featured Poster

Without knowing exactly how you code works, maybe...
The methods of a dll become available to your code once it is added but if it requires things like displaying text then there is an visual element that needs to be taken into account.

hericles 289 Master Poster Featured Poster

To build a dll, type this from the command line
csc /target:library /out:<dll_name>.dll <list of .cs files to make up dll>

After that just add the dll to your upcoming projects

hericles 289 Master Poster Featured Poster

CONCAT_WS stands for concatenate with separator. It takes three parameters, the seperator, string1 and string 2. So in your case you told CONCAT_WS that "$dstart' is the separator rather than a value to concat. So either use
CONCAT_WS(' ', '$dstart', '$tstart') to separate by a space or just use CONCAT.

hericles 289 Master Poster Featured Poster

Well, there is the basic advice: go to your lectures, go to all the tutorials/labs, don't get behind.
On a more specialised note, from my own experience when I was at uni, don't try to learn it all. With subjects like computer science, you can get surrounded by coding languages, frameworks, databases, etc and want to dive right in. That is a mistake. The IT field is HUGE and the amount of information staggering. Make sure you pass your exams first and if you have time, self study somethng related e.g. learn MS SQL or MYSQL if you aren't doing a database course (but don't try to learn MyQSL, MSSQL and Hadoop all at once).
So, relax, follow your teaching outline, be consistent and remember to take time out:) Enjoy!

ddanbe commented: Good advise! +0
hericles 289 Master Poster Featured Poster

One will be for mic, the other for sound. The single plug on your computer will be for headphones (vs head set). How old is the computer and have you plugged a mike into it before?

hericles 289 Master Poster Featured Poster

Ayrton, what does that have to do with finding duplicates in the table as the post title mentions?

hericles 289 Master Poster Featured Poster

It isn't clear exactly what you're after here (based your sample output anyway). If you want duplicate names to be listed together you just need to use 'ORDER BY name' at the end of your query and it will be listed in alphabetical order by the name column.

hericles 289 Master Poster Featured Poster

It sounds like you are passing the object itself around rather than the text it holds. Got some code you can post up?

hericles 289 Master Poster Featured Poster

Codeigniter is a PHP framework though. Are you asking if PHP is better than PHP?
Having said that: if you use a framework you can be limited by the functionality that framework exposes. Coding a solution yourself does give you complete control but at the tradeoff of simplicity or efficiency (as you don't need to do as much background coding yourself).
Is that what you were asking?

hericles 289 Master Poster Featured Poster

What the hell was that? I don't get it...

hericles 289 Master Poster Featured Poster

You say you haven't got the OFFSET clause in your query to work but you have another query using that exact format in your GetClientListMembers() method. Is that not working either?
To me the offset method works quite well, simply calling and displaying the next set of 100 when the button is clicked.

hericles 289 Master Poster Featured Poster

memory? Have you checked the memory usage on the task manager? While you'r there check nothing really hogs the CPU.

hericles 289 Master Poster Featured Poster

You can add the data to the confirmation message by appending it as text.
Use standard javascript or jquery in your confirmDelete function to get the text of "id".

JQuery example:

var data = $('#id').val();
if(confirm("Are you sure want to delete this record:  " + data))
            {
                return true;
            }
hericles 289 Master Poster Featured Poster

As always, have a go and post up your code when you get stuck. We like to help those that are willing to try and fail (thats how you learn)

hericles 289 Master Poster Featured Poster

One of the quickest ways is to check if n divided by 2....sqrt(n) results in an even number. If any of them do the number is not prime.
so:
detemine square root of n (rounded up)

loop through 2 to square root of n, dividing n by number. If even division occurs (modulo) n is not prime.

hericles 289 Master Poster Featured Poster

This kind of functionality would normally involve AJAX as each selection causes a post back to get the values that are now needed for the next selection controls.
If the data isn't extensive you could get it all on page load, populate list 1 and use javascript/jquery to alter the 2nd/3rd lists as the first one is changed.

hericles 289 Master Poster Featured Poster

Are you referring to the last variable as being @gt_analyticsLink in your column list? Because you don't have a matching SET statement for it.
Or do you mean you remove the SET line for gt_rankingLink and it works?

hericles 289 Master Poster Featured Poster

Android is the OS for android phones/tablets and its based on java. PHP is a programming language for developing websites.
So Android is only good if you want to develop for Android mobile devices and nothing else.
PHP lets you work as a web developer so the scope is much larger.
Of course, the real question is why pick one? Most developers know several languages after they've been working or studying for a while. I would suggest starting out with PHP as it is pretty easy to start with and picking up Android later, or java or .net or ruby...

hericles 289 Master Poster Featured Poster

This should probably be in the PHP forum as it isn't really a database question but never mind that...
You can use javascript to show a confirm window and if the action is confirmed call the relevant page with a parameter set. The called php page then reads the parameter on page load and acts accordingly.
You can pass data into the confirm box so it can show the data being deleted.
Or you can create a confirm box yourself with CSS and javascript if you want something more stylised.
Here's a forum question with an answer

hericles 289 Master Poster Featured Poster

Given that an int can hold a maximum value of 2,147,483,647 the maximum number that could be entered is 12 as 13 gives an overflow. Your example uses long so maybe you should be using that too.

I'm not a mathmatician but I'm not sure what your instructor's check code would achieve. A times B is not the same as A!.

hericles 289 Master Poster Featured Poster

Micrsoft compatibility guide says yes, with no action required.
View it here

hericles 289 Master Poster Featured Poster

That is a lot of constraints for one table and, without knowing your exact intention, I do have to say I'm unsure about it.
Is the part ID really going to be unique across all rows?

And having a line_type column that can only ever equal 'part' seems like a waste of a column.

hericles 289 Master Poster Featured Poster

Xcode is the main Apple IDE for coding in Objective-C.
There are frameworks for coding in C# (such as Xamarin) that allow you to convert your code to Objective C but you still need a Mac machine to compile the code (I believe - that used to be the case and I doubt it has changed).

hericles 289 Master Poster Featured Poster

That is correct. PRIMARY KEY (column1, column2...) will create a primary key using the columns specified.

hericles 289 Master Poster Featured Poster

So context to that sentence would be beneficial...

hericles 289 Master Poster Featured Poster

Well, you are opening your connection before you have defined it, and in the code segment you aren't specifying the connection string for the connection.
So as it stands the code won't run. Line 15 needs to be at line 10 and include the connection 'usersConnectionString'.

As for building from the command line, all the info you could need is over at MSDN

hericles 289 Master Poster Featured Poster

Are you worried about the number of elements that could be in the $vip_users array? Or about storing the return value of a function?
A little more information would help...

hericles 289 Master Poster Featured Poster

What language are you using for the backend? PHP, java, C# or vb.net, something else? All you have here is HTML and javascript. Its pretty hard for us to give advice when we don't even know what language you intend on using...

hericles 289 Master Poster Featured Poster

Are you using jquery? If you were it would be as easy as
$('#parent .1')

hericles 289 Master Poster Featured Poster

Relationships between tables can help with data consistency, such as having a foreign key on a table helps keep the rows connected to the referenced table.
For example, having foreign keys with cascading deletes helps keep the referencing table accurate when the referenced table is changed.
Indexs aid in efficiency, although a case could be made for relationshsips I guess, like in the example above if enough deletes are made.
I've always thought of relationships are a way to more accurately model the data.

hericles 289 Master Poster Featured Poster

Yes, it would. If you don't want to include empty values then either option would still work but you would add a acheck to see if a particular textbox was empty before appending it to the sql string (option 1) or running the command (option 2);

hericles 289 Master Poster Featured Poster

Its not really a hover menu. Its just a normal div set to not display until the login button is clicked.
The scrolling appearance is probably done in jquery (or something very similar).
To mimic this, simply create your login div, set it to display: none.
Then add a javascript function to the login button that makes the div appear. After that, adding visual animation effects is just the icing on the cake.
This would take you maybe half an hour to learn off the web. It would be good practise :)

hericles 289 Master Poster Featured Poster

If the code runs when it is inline but not when it is separated the <link> must be the problem. Can you confirm the file name, bground.css, is correct.
The only think left must be a simple mistake.

hericles 289 Master Poster Featured Poster

You only create one Supplies object and then proceed to make it equal to product1, then product2, then product3, etc. At no time in your code do you have two Supplies objects in existence, you just keep resetting the one.
This is why item 7 works, it is the only one that survives your set up.

You probably need a loop that creates items 1 (through to 7), outputs its values then loops around creating the next item up - although this depends on what exactly it is you need to achieve.
Does that make sense?

hericles 289 Master Poster Featured Poster

You could specify your SQL command with a parameter and then, in the loop, set the parameter to each text box. Or you can build up a long SQL string, separating the individual commands with semi-colons (;).
Your code is a bit jumbled as you set your sql variable to include textbox1, then textbox2, then textbox2 etc. At the end it is only containing the code to insert textbox4. And you then use a loop to insert textbox4 5 times.

Either:
sql = "INSERT INTO table ('name') VALUES ('" & TextBox1.Text & "');INSERT INTO table ('name') VALUES ('" & TextBox2.Text & "');INSERT INTO table ('name') VALUES ('" & TextBox3.Text & "');INSERT INTO table ('name') VALUES ('" & TextBox4.Text & "');"

Or:
sql = "INSERT INTO table ('name') VALUES (?textbox);"
This would involve including a command parameter into your code which you don't have yet. And in the loop setting the parameter to the value of each textbox.

hericles 289 Master Poster Featured Poster

But you can code right? You need tips on the site design or are you looking for someone who can build it for you?
If the second option, its a lot of work - I don't think 'seeking help from an experienced person' will be enough.

hericles 289 Master Poster Featured Poster

I referred to autocomplete because any autocomplete tutorial explains the same concept - getting data and showing a response without refreshing the page.
Break the task down:
1) learn how to do an AJAX request
2) pass value to AJAX and server side code
3) get response and show on the page.

That is what you are trying to do and that is exactly the same as any autocomplete example you'll see out there.

But seeing you can't find what you're looking for:
http://www.w3schools.com/ajax/ajax_database.asp
http://msdn.microsoft.com/en-us/library/bb398890(v=vs.90).aspx
http://www.ashishblog.com/calling-database-using-jquery-ajax-and-asp-net/

hericles 289 Master Poster Featured Poster

In your code smaple you have the start of the FOR loop but I can't see where it ends. Is you final echo ouside of the FOR loop? If it is then you should only see one echo which should, hopefully, be the total.

hericles 289 Master Poster Featured Poster

OK, I see now. In that case define $resultMax and $resultMin before the FOR loop, so they aren't reset/overwritten on subsequent loops, and use the if/else to tally up totals
$resultMax = $resultMax + ($vl_max x $pares);

That will give you a running total of $resultMax and $resultMin that can then be tallied at the end. I only just saw the FOR loop now.

hericles 289 Master Poster Featured Poster

Sorry, I may not be understanding exactly what you need then. In your initial post you said you needed to get 105.29, the sum of 55.14 & 50.15 (the max and min calculation I'm assuming).
But if you're getting just one value OR the other then you never have two values to total... So what am I missing?

hericles 289 Master Poster Featured Poster

You still have the if/else clause in there.
If $id_marca != 1 the resultMax is calculated otherwise it is 0.
If $id_marca = 1 then resultMin is calculated otherwise it is 0;

Take out that entire if/else block and just have the two calcualtion lines. Then $resultMax and $resultMin will both hold values and $result will be the sum of them both and not just one of them + 0;

hericles 289 Master Poster Featured Poster

After you've got your actual connections sorted you will need to extract the data from access (lets assume you only need one table), store it in memory and then do your checks for uniqueness before passing the results that are OK into the SQL database.
Depending on your data you could potentially handle the duplicates through the use of primary keys and unique constraints in the SQL database. That would speed things up a lot as you wouldn't need to write (and then run) code to check each row against every other row (which gets out of hand quickly as the number of rows increases).

hericles 289 Master Poster Featured Poster

You have an error in your SQL query, if what you have written above is an exact copy of your code.
You have "from project_table left join resource_request on resource_request.project_id = resource_request.project_id"

You haven't included project_table in the ON clause, instaed you have referenced resource_request twice. This will cause your query to give some unexpected results.

hericles 289 Master Poster Featured Poster

If you want both values totalled then you don't want the IF/ELSE structure because that is the reason only one calculation is running (whether $id_marca equals 1 or not).
Depending on your exact requirements you would be better off to store each calculation into two different result variables and then add them.

$resultMax = $vl_max*$pares; // id_marca = 22 [ 38 pares * 1.451 = 55.14 ]
$resultMin = $vl_min*$pares; ///id_marca = 1  [ 36 pares * 1.392 = 50.15 ]

$result = $resultMax + $resultMin;
hericles 289 Master Poster Featured Poster

Have you stepped through your code and checked your SQL query is correct and that InsertData() doesn't get called twice? Although I don't see how either of those things could happen, the code looks fine. The only other two options are that your click method is getting called twice or something is happening upstream.

hericles 289 Master Poster Featured Poster

Yeah, you need to change your onclick to = "blackbox();return false" to stop the link actually trying to fire. Its running the blackbox function and then reloading the href (the same page in this case).