I want to fetch some information from my mysql database in a class, so I'm passing in the PDO object into a __construct function, and working from there. However, what's an elegant way of checking to see if the PDO object was correctly created, and that the connection is open when the Table class is instantiated?
class Table{
public function…
Hi,
I want to display a "Go to top"-Link on my website.
This link should only be visible, if the vertical scrollbar is visible.
How can I do this using JavaScript?
Thanks
The title says it all.
Since, it's possible for anyone to name an assembly starting with 'System', checking for 'System' is not a satisfactory solution.
Alternatively, if that's not possible, how about checking the modules in an assembly?
hi,
I am here to find and suppy smtp credentials if required to the mail server. But how can i know whether my server requires it or not?
I am scripting in PHP and using PHPMailer
This is about as beginner as it gets regarding AJAX, but here it goes.
I want to have one checkbox somewhere on an ASP.NET web form (ASPX).
When the user clicks the checkbox, I want one of those spinning indicators to show.
While that spinning indicator is showing, I want an update operation to occur in the database to reflect that the user has…
I have the following model
@Entity
class Element {
@Id
int id;
@Version
int version;
@ManyToOne
Type type;
}
@Entity
class Type {
@Id
int id;
@Version
int version;
@OneToMany(mappedBy="type")
Collection<Element> elements;
@Basic(optional=false)
boolean disabled;
}
and would…
Hi,
I have a ugly piece of code that adds event handlers. The problem is, if the code is called multiple times, the event handlers are called multiple times.
To solve the problem, I remove the event handler first and then add it.
Now I've seen the following behaviour:
Some event handlers can be checked like:
if (object.event == null) {
…
I remember when I was developing in C++ or Java, the compiler usually complains for unused methods, functions or imports. In my Django project, I have a bunch of Python files which have gone through a number of iterations. Some of those files have a few lines of import statement at the top of the page and some of those imports are not used…
Lets say I have an employees relationship in an Company entity, and it's to-many. And they're really many. Apple in 100 years, with 1.258.500.073 employees.
Could I simply do something like
NSInteger numEmployees = [apple.employees count];
without firing 1.258.500.073 faults? (Well, in 100 years, the iPhone will easily handle so many…
Hi,
I have an input text field which has
style: "visibility: visible"
or
style: "visibility: hidden"
What is the easiest way to find out if it is visible or not ?
Suppose the input text field is E. What should be the condition here:
if <something with E> {
alert("The text filed is visible !!");
}
?
Thanks in advance…
I'm trying to learn and hopefully use regular expression with Qt.
I found that some patterns cause handler to fall into loop. for example searching \b\b in a text, never will terminate. and number of these expressions is infinite (\b\b\b,\b\b\b\b and so on).
I'd like to determine and control all invalid expressions.
Is there an…
I have a exception to prevent inserting same records on my oracle.
I've haerd that COUNT(*) has lots of cost which I don't want to use.
Is there any alternative way to make it at least cost?
im having a combo box in which i have to display dates from database...user have to select a date from the combo box to proceed further...but im not able to make the user aware of selecting the item from the combo box first to proceed further...what is the process so that a user can get a message if he has not selected the date from…
I want to use a method of an object.
Like $myObject->helloWorld().
However there are a couple of methods so I loop through an array of method names and call the method like this:
my $methodName ="helloWorld";
$myObject->$methodNames;
This works quite nice but some objects don't have all methods.
How can I tell whether…
I have a table with start and finish datetimes that I need to determine if any overlap and not quite sure the best way to go.
Initially I was thinking of using a nested cursor as shown below which does work, however I'm checking the same records against each other twice and I'm sure it is not very efficient.
eg: this table…
I am trying to test if the uploaded file is the image type I want. If it isn't a gif,jpeg, png, it should echo "Problem". But when I execute this code, it always says there's a problem. What's wrong with my if statement?
$uploadfile_type=$_FILES['userfile']['type'];
if ( ($uploadfile_type !='image/gif') ||…
How can I programmatically retrieve the current connection type (eg. LAN or Direct connection)?
InternetGetConnectedState() isn't very reliable.
For instance, I'm connected to a wireless network, but ConTypeRet is 18, which is INTERNET_CONNECTION_LAN & INTERNET_RAS_INSTALLED. Isn't there any way to make…
Hello all,
I want to know what's api support checking if BB maps be installed or not on BB device.
Because I have an application on BB and I want call BB map from this application, throw error if BB map hasn't been installed yet.
Thank you.
Hello,
My source table looks like this
Id StartDate
1 (null)
2 12/12/2009
3 10/10/2009
I want to create a select statement, that selects the above, but also has an additional column to display a varchar if the date is not null such as :
Id StartDate StartDateStatus
1 …
How to make this method return boolean value, depending on query return. False - nothing, True - data exists. Before i just returned int from uniqueQuote.Count() but does not look like great method. Thank you!
private bool CheckEnquiryUser(int enquiryId, Guid userId)
{
int…