hericles 289 Master Poster Featured Poster

What is the query trying to do?
If it is returning a large record set, written bad or uses a large number of joins it could be hogging the resources.
Find a tool for analysing the query (MySQL Workbench or MS SQL Server Management Studio for example, depending on your database type) and check how the query performs.
Then either re-write if possible or make it return a smaller subset of rows (by using pagination)

hericles 289 Master Poster Featured Poster

It is an error.
var data {"id": id};
isn't valid javascript.
var data = {"id": id};

sahilmohile15 commented: Thanks +0
hericles 289 Master Poster Featured Poster

You're going to step too far with this line:
command = New SqlCommand(Query.Text, mysqlconn).ExecuteNonQuery

Instead of setting up your command object and storing it in the command variable you are trying to place the result of exectuting the command there.
Which can't be done of course, it's the wrong type.

Try:

command = New SqlCommand(Query.Text, mysqlconn)
Integer result = command.ExecuteNonQuery
hericles 289 Master Poster Featured Poster

Opacity affects the element it is being applied to (obviously) so adding opacity to the div will affect it's background image and everything else inside it, which includes the text.
But you have some options:
1) Use your favorite graphics software to make the image itself transparent and don't use opacity at all
2) Restructure your div to include two other divs, positioned absolutely over each other with differing z-indexes, the top with the text and bottom one with the image and some opacity
3) add a pseudo element (:after) that holds the image and apply opacity to that.

example:

div {
  width: 300px;
  height: 300px;
  position: relative;
}

div::after {
  background: url(background.jpg);
  opacity: 0.7;
  top: 0;
  left: 0;
  position: absolute;
  z-index: -1;   
}
hericles 289 Master Poster Featured Poster

First thing to check is whether your javascript function is appearing on the page.
Once the page is loaded in the browser, view the source and confirm the footer is loading correctly and that the detailsmodal function is part of the page source.

Are you getting any other errors from the page in the console?

hericles 289 Master Poster Featured Poster

Firstly, it looks like you need to use double quotes as you're including a variable in the file name name string.
file_put_contents("files/$file");
Single quotes are 'dumb' and don't parse variables to strings.

Secondly, file_put_contents uses a second parameter which is the data to put in the file.
file_put_contents("files/$file", $someData);
Without that it doesn't do anything (apart from logging an error).

hericles 289 Master Poster Featured Poster

This is hard to understand exactly what you want.
You have, for example, the name and id listed in list boxes 1 and 2, like so:

LB1            LB2
1                 Adam
2                Tony
3                Dave
4                Lisa

And then you want a third list box that gets the amount variable. Where does this value come from?
The only problem you have is how to create this value, after that you're just storing it in a database table.
Can you better explain that part?

hericles 289 Master Poster Featured Poster

That was popular in New Zealand about 2 years ago. The first couple of times I got called they always said it was 'Windows' calling about emails my computer was sending. They eventually realised that was incorrect and started saying they were Microsoft.
Each time I told them I worked in IT and knew they were bullshitting me but they kept calling back (weeks apart). The last time I unleashed a fake angry torrent of abuse I didn't even know I was capable of maintaining for as long as I did. Eventually the guy hung up and I guess I finally got added to their black list.
But for them to be so persistant it must be working enough of the time...

hericles 289 Master Poster Featured Poster

You haven't mentioned what problem you are having. Does the PHP script work by itself when you test it?
Does the AJAX request connect to it correctly? What exactly is the problem?

Also, you would benefit from using something newer like jQuery. I haven't seen that XMLHttpRequest code in years.

hericles 289 Master Poster Featured Poster

If it crashes the app, break point it and debug line by line. Knowing exactly which line causes the crash usually makes solving it quite easy.

hericles 289 Master Poster Featured Poster

I don't remember having any issues between the Java SDK and JDK with .Net.
I've had VS 2013 and 2015 on the same PC as the java dev tools, eclipse, netbeans and android studio without ever having a problem.
Just set your Java environment variables correctly during setup and everything should be fine.

hericles 289 Master Poster Featured Poster

Seeing as you're inserting or updating one row at a time simply include to variables, one for updated, one for inserted, and increment each other the respective database operation.
Once, you're done you have your two totals.
If the update could affect more than one row in the database, the update command returns the number of rows affected so catch the return in a variable.

hericles 289 Master Poster Featured Poster

So you don't want a static page at all. You want a template page that pulls through the data for the correct restaurant and displays it and styles the page.
You need a basic HTML layout in the format you like, a database that can hold the information for each restaurant and code that detects which restaurant is being requested (presumably from the URL), pulls it from the database and loads into the template.
You want something like Wordpress.

hericles 289 Master Poster Featured Poster

Having just one line to look out a complete answer is impossible but the line of code gets the size of the account object, uses the static_cast method to convert it to an int (which it was already but is probably used to avoid any unsafe type issues).
Then it's multiplied by -1 and stored in the pos variable.
So, basically, it is the negative size of the account object.

What happens with it then is anyone's guess.

hericles 289 Master Poster Featured Poster

You can do it with a couple of SQL statements. First create your new tables if you haven't already then fill the cities table by doing:
INSERT INTO city(city_name) select distinct city from old_employee;

Then fill the new employee table by doing:

INSERT INTO new_employee(first_name, last_name, city_id)
SELECT e.first_name, e.last_name, c.city_id FROM old_employee e
JOIN city c ON c.city = e.city;
hericles 289 Master Poster Featured Poster

File.ReadAllLines(Filename).Length() will give you how many lines are in the file. Then generate a random number with that as the upper bound and read the first column of that row.

hericles 289 Master Poster Featured Poster

There isn't a special case with fingerprint templates at all. As @ryantroop tried to explain you're trying to compare two images as exactly the same when they won't be.
This is a brief explanation of finger print scanning taken from the net:
"When a computer checks your fingerprints, there obviously isn't a little person with a magnifying glass sitting inside, comparing your fingerprints with all the hundreds or thousands stored in the database! So how can a computer compare prints? During enrollment or verification, each print is analyzed for very specific features called minutiae, where the lines in your fingerprint terminate or split in two. The computer measures the distances and angles between these features—a bit like drawing lines between them—and then uses an algorithm (mathematical process) to turn this information into a unique numeric code. Comparing fingerprints is then simply a matter of comparing their unique codes. If the codes match, the prints match, and the person gains access."

Taking an image of a finger print and hoping to get an exact match with a second image of the same finger print when they're both converted to bytes is hopelessly simplistic. Even the smallest change will cause the select to fail.
You need a better process for recording the fingerprints, like the one above.

hericles 289 Master Poster Featured Poster

Firstly, it sounds as if you typed your UPDATE command directly into the command line rather than a Mysql client. That's why you got the "'UPDATE' is not recognized as an internal or external command" message.
Go back to basics. Open the command line and type mysql -u root -p hit enter and then type in your password (if you set one up).
Did that give you access to MySql? If not then something is wrong with MySql itself.

If it did work make sure the same credentials are supplied in the config.inc.php file for PhpMyAdmin.

hericles 289 Master Poster Featured Poster

Without more exact information as to the database schema I don't know what you want us to do. How can we write a query without knowing the tables names and structure?
Also, show us what you've tried, that can help us help you.

hericles 289 Master Poster Featured Poster

Limit 2 won't skip the first two IDs. It will mean the query only returns 2 rows.
You do a subquery, selecting all IDs in ascending order limit 2 and then use the NOT IN selector to return the rest of the rows.
Depending on the size of your table that could have a performance affect though.
I've assumed client_id is the id you are referring to

select group_concat(id) as ids from private_tuition_teacher_pdf 
where 
client_id NOT IN (select client_id from private_tuition_teacher_pdf order by client id asc limit 2)
and client_id = 14 and teacher_id = 15 
order by id desc
limit 2 
hericles 289 Master Poster Featured Poster

Have you actually checked the connections details? That is the more likely cause of the problem.

hericles 289 Master Poster Featured Poster

You can use HTML/javascript/css for the client side but if you want to send emails you'll need to involve some server side code eventually.
I'd recommend PHP if you just want to send emails. The code for that isn't complicated and you should pick it up pretty quick and there are plenty of tutorials online to help.

hericles 289 Master Poster Featured Poster

The DBNull is a special case and you'll need to do a check for it with:
If Not IsDBNull(dr(0))
and contine from there.

hericles 289 Master Poster Featured Poster

Learning to code takes practise, you won't learn just by reading a book.
Find a book that is for beginners e.g. https://it-ebooks.info/book/4941/ and work along. Download an IDE like netBeans or eclipse and try some very basic examples and work from there.
You'll want to start off with either a book or online tutorial that explains writing the code, how to compile and then execute your project.
Once you can write a simple project that runs without errors you can look into different data structures and basic methods, adding them into your basic project.
Just take little steps for a while and you'll start to get a grasp of it.

hericles 289 Master Poster Featured Poster

In other words you have had an idea but don't know how to implement it?
You say you have a problem with the logic but you don't even tell us what that is. How are we to help you wth that?

hericles 289 Master Poster Featured Poster

If you only want to print the first row each time then the second loop isn't needed. You can target sublist[0] immediately, or whatever column you do want.
If the column will change then you need to determine which one you want prior to the foreach and set a variable e.g.

int col = 2;
foreach(List<float> sublist in myList) {
    // access sublist[col]
}
hericles 289 Master Poster Featured Poster

I think your problem is here:

If (newpage) Then
                        e.Graphics.DrawString(dgvreciept.Columns(cell.ColumnIndex).HeaderText, .Font, Brushes.Black, rc, fmt)
                    Else
                        e.Graphics.DrawString(dgvreciept.Rows(cell.RowIndex).Cells(cell.ColumnIndex).FormattedValue.ToString(), .Font, Brushes.Black, rc, fmt)

On the first row to be processed (whether set to 0 or 1) newPage is true but inside that if you only draw the header if new page is true. You also need to draw the string with the row data. This is better:

If (newpage) Then
     e.Graphics.DrawString(dgvreciept.Columns(cell.ColumnIndex).HeaderText, .Font, Brushes.Black, rc, fmt)
      // you'll need to recalculate rc of course if newPage is true
End If
// now draw string for cell regardless of newPage state
e.Graphics.DrawString(dgvreciept.Rows(cell.RowIndex).Cells(cell.ColumnIndex).FormattedValue.ToString(), .Font, Brushes.Black, rc, fmt)

It's a bit concerning that you even attempted a value of -1 when trouble shooting. Any index check would immediately fail with such a value:
.Rows(mRow) // with mRow = -1, out of bounds error
but you live and you learn :)

hericles 289 Master Poster Featured Poster

That code works as is for me. I added a console.writeLine into your inner foreach and all of the values got output.
What is happening when you run it?

hericles 289 Master Poster Featured Poster

If you wanrt to go cross-platform you would probably want cordova or xamarin. These let you build one app that builds for iOS, android and windows phone (with restrictions if you're doing something really cutting edge).
If you wanted to target just android or iOS I'd still consider using one of the cross platform options.
I find cordova much easier to work with than Apple's XCode and Objective C.

Should you use internal storage? Depends on what your app does. I would imagine you'd at least want to use internal storage if not an on-device database (sqlite or similar).

hericles 289 Master Poster Featured Poster

Welcome Maikel,
You'll find there is a good range of skilled programmers on here, Python isn't my thing (beyond the basics) so you might not hear from me too often.
But, regardless, welcome. It's good to have you.

hericles 289 Master Poster Featured Poster

The wordpress docs for get_the_category says:
"Note: This function only returns results from the default “category” taxonomy. For custom taxonomies use get_the_terms()."

So you might want to try that as an alternative. Otherwise, after the call to get_the_category, add:
var_dump($subaut); die();
This will kill the page generation (die) but dump out the result of the method call onto the screen. You can then check that it is something rather than nothing.
The result of get_the_category is an array rather than an actual category name so
<a href="'.$subaut.'"
won't work anyway as $subaut isn't a string of text that can be placed into an anchor link. It might be something like $subaut->name instead. Again, looking at the dumped result should make it apparent what part of $subaut you actually need.

hericles 289 Master Poster Featured Poster

To 'refresh' a page is to reload it, generally in a browser window.
It sounds like you want to call a page to make some code run. This means your code should be in a script technically, not part of a webpage but you can still achieve what you need.
You'll need access to your cron tab if you are on a linux server or the scheduled tasks manager on windows.
In linux you would enter this command into the cron tab
* * * * * wget -O - http://your-website-page/some-page.php >/dev/null 2>&1
The asterixs define at what time it runs, from left: minutes, hours, day of month, month, day of week. So you can use those to set exactly when and how often it runs.
The stuff at the end just makes sure the output isn't written any where

On windows using scheduled tasks, set up the task to run whenever you need and in the trigger section specify that it calls powershell and enter this as the argument:
-ExecutionPolicy unrestricted -Command "(New-Object Net.WebClient).DownloadString(\"http://your-website-page/some-page.php\")"

hericles 289 Master Poster Featured Poster

We'd need a lot more information to help you. Are you using a platform (wordpress, Joomla, etc) or is this a custom coded project?
Are you using a shared hosting environment? You haven't even given us the URL.

hericles 289 Master Poster Featured Poster

You've given us nothing to go on really but is the message too long for the area provided for it? It's possible that it is being stretched due to the overlong content and other elements need to move around it.

hericles 289 Master Poster Featured Poster

The usual response I give here (and hopefully most others do too) is to say that you need to show us your work.
You say you have tried a few things so show us you best effort. We can hopefully guide from there.

hericles 289 Master Poster Featured Poster

Maybe some code to view? It's a bit tough to give advice otherwise.

hericles 289 Master Poster Featured Poster

Hi divinity,
You read my reply but I don't think you understood it. The issue wasn't that the variables were zero to begin with. It was that you never changed them from zero to anything else.
You get the hrswrk from user input but that is all. If you intend to use those variables mathmatically they need to be actual numbers (zero is a valid value but you need to realise that multiplying anything by zero gives zero as the result).

hericles 289 Master Poster Featured Poster

If the username is unique (which it should be) you can do a SELECT first with the username as the parameter. If the result contains a row the user already exists, if it's empty then the user is not already in the table.
You could also execute the insert if the username column is set to be unique and if the insert fails you know it probably failed because the users exists. But the first way is better.

hericles 289 Master Poster Featured Poster

Key is a reserved word in MySQL. You need to use back ticks to escape it rather than quotes.
Backticks are the key to the left of the 1 on most keyboards, with the tilde character: ~ as the shift option.

hericles 289 Master Poster Featured Poster

I'd say your problem is here:

int randomInteger = random.nextInt();    
randomInteger [i] = MaxInteger;

You declare randomInteger as an int then in the line treat it as an array.
In anwser to your max and min question, once you have your random numbers, loop through them and compare them to the current highest and low variables (intially set to 0 for the maxInteger and some over the top value for the minInteger say 99999). If the random value is higher than the maxInteger, store it in maxInteger. And do the same for minInteger. After one loop through the array you have your highest and lowest values.

hericles 289 Master Poster Featured Poster

You create a range of variables:
double fed_tax = 0, state_tax = 0, hrswrk, payrate=0, gross_salary = 0; double hrlyrate=0;
But never change their values. For example, you get the user to enter a value for hrswrk but then times that by hrlyrate.

0 x anything = 0. All of the other calculations are similarly zeros get added and multipled together.

hericles 289 Master Poster Featured Poster

What do you mean by handle it manually? One of the benefits of an auto-incrementing ID column is that you don't have to look after it yourself, you can let it automatically adjust for new entries.
But if you want to make that column not a primary key you can run this command in SQL:
ALTER TABLE <table name> MODIFY COLUMN empid int;

And it'll just become a plain int column with no unique constraints on it.
But, there is also a good chance I've failed to understand what you really mean.

hericles 289 Master Poster Featured Poster

It's skipping the last item because, for the last item in the list, top.next == null. Therefore the final print loop isn't actioned.
You'll need another way of determining when you're at the end of the list, using an index or moving onto the next item and checking if it is null (rather than it's next sibling).

hericles 289 Master Poster Featured Poster

How much do you know about facial recognition software and algorithms needed to accurately detect parts of the face?
To be honest this isn't an easy project and without skills in the correct, and reasonably advanced, fields you're going to struggle.

hericles 289 Master Poster Featured Poster

You need at least the standard edition to have integration services. It isn't included in the express version.

hericles 289 Master Poster Featured Poster

From what you said in your second comment my response still stands.
You will need to target each row individually to prevent all user's getting the same password. You say you don't need to target a specific individual but you do, to give them an individual password.

hericles 289 Master Poster Featured Poster

Why are you deleting and inserting just to do an update? Simply update, that's what it is there for. Without knowing your database schema I would think that by deleting the record you're breaking some relations. Are there other tables that refer to the E_ID or E_CODE? If that is the case and you have foreign key relations in place that is why you would be getting the error.

hericles 289 Master Poster Featured Poster

Each of the updates is working correctly it's that the third one runs last and is therefore the one you see. You're problem is this:
echo $k = "UPDATE details SET password = '$random_string'";

This updates the password column in all records of the table as you're not targeting a particular row, like this:
echo $k = "UPDATE details SET password = '$random_string' WHERE id = SOME_ID";
You need to make each update statement target a particular row, presumably by including that row's ID (or other unique value) in a WHERE statement.

For the second question, use CONCAT:
echo $k = "UPDATE details SET password = CONCAT($prefix, '$random_string') WHERE id = SOME_ID";

Hope that helps.

hericles 289 Master Poster Featured Poster

You can use something similar to this to determine when you're close to the bottom:

if  ( ($(document).height() - $(window).height()) - $(window).scrollTop() < 300 ){
    //code
}

You can alter the 300 part to trigger the code at different places. From there you just need to add in the code that will diplay the next piece of content, presumably an AJAX call to retrieve the next set of data.
If you intend on having a lot of content getting added several times then the 300 will need to be a variable that you can increase after each AJAX call as the document.height keeps increasing.

hericles 289 Master Poster Featured Poster

HttpServerUtility.MapPath will return a string which is the physical path to the application, which will be the actual location of your web app (e.g. C:\inetpub\www\website\ for example).
You can append onto that to navigate into sub folders in your project.

Is that what you mean?