PDO apparently has no means to count the number of rows returned from a select query (mysqli has the num_rows variable).
Is there a way to do this, short of using count($results->fetchAll()) ?
I have gcc installed in c:/programfiles (also set as a path variable), and i have all the necessary files for gtk from http://www.gtk.org/download-windows.html, glib,gtk,pango,atk and cairo. Although I have no clue as to how to compile a c program using gtk with the gcc compiler. How do I set everything up so that it works?. (I don't know where each zip file goes.?) basically I don't really know where start.
Hi,
I have a Window handle Picker and it says my handle is 0094167C.
When I declare the variable in c# the letter in this code gives an error.
How to declare?
public const IntPtr WinHandle = 0094167C;
On a standard linux set up, where can I add a directory to the @INC variable?
In the /etc/profile file, I added:
export PERLLIB=$PERLLIB:/foo/bar
export PERL5LIB=$PERL5LIB:/foo/bar
Thanks
How to set the Height and width of a WPF application on maximise?
Problem I face is because of variable height of the windows taskbar in different computers
Presently, I am doing it like this. Please suggest any better technique
if (this.WindowState == WindowState.Maximized)
{
this.Height = primaryScreenHeight - 10 - System.Windows.Forms.SystemInformation.SizingBorderWidth;
this.Width = primaryScreenWidth + 2 * System.Windows.Forms.SystemInformation.FrameBorderSize.Width;
}
Yes, I know you need a unique resource id when calling the version of these functions that requires a key, but I cannot for the life of me figure out how to create a resource id that can be used in this way. A final variable in my class wont work and neither will a hard coded value. Both threw an IllegalArgumentException. So what gives, how do you use these methods?
Spara
Hello,
I'd like to include a config file in my bash script with 2 conditions:
1) the config file name is constructed on-the-fly and stored in variable, and 2) in case if config file doesn't exist, the script should fail:
config.cfg:
CONFIGURED=yes
test.sh:
#!/bin/sh
$CFG=config.cfg
echo Source command doesn't work here:
[ -f $CFG ] && ( source $CFG ) || (echo $CFG doesnt exist; exit 127)
echo $CONFIGURED
echo ... but works here:
source $CFG
echo $CONFIGURED
What's wrong in [...] statement?
I have a private method in my controller. which is used for some database update. this method i am calling from another controller method. and it works fine.
But when i am trying to write a test case for that method then It is tripping on accessing (session variable and params) in my functional all other methods are working fine the problem is only with private method?
In my setup method in functional test, I am setting session also.?
Hello All,
Let's say i have the Following,
Vegetable=Potato ( Kind of vegetable that i have )
Potato=3 ( quantity available )
If i wanna know how many vegetables i have (from a script where i have access only to variable Vegetable), i do the following:
Quantity=${!Vegetable}
But let's say i take one Potato then i want to update the quantity, i should be able to do the following:
${Vegetable}=$(expr ${!Vegetable} - 1)
It does not work !!
Any clues to realize this
Thanks
Hello Colleagues,
I want to output single quote around $ID variable in the below xsl:value-of xsl statment.
<xsl:value-of select="concat('process[@Ref=',$ID,']')"></xsl:value-of>
currently it prints
process@Ref=87799989
Please let me know how can i achieve this.
Thanks in advance,
Keshav
Hi,
I noticed that in MySQL, both VARCHAR and TEXT offer variable-sized data. Well, VARCHAR is a bit more efficient in data storage, but still, TEXT MEDIUMTEXT and LONGTEXT offer a lot more potential. So, what are the real uses of VARCHAR?
For a simple simulation in C, I need to generate exponential random variables. I remember reading somewhere (but I can't find it now, and I don't remember why) that using the rand() function to generate random integers in a fixed range would generate non-uniformly distributed integers. Because of this, I'm wondering if this code might have a similar problem:
//generate u ~ U[0,1]
u = ( (double)rand() / ((double)(RAND_MAX));
//inverse of exponential CDF to get exponential random variable
expon = -log(1-u) * mean;
Thank you!
I am still not sure in that matter. While turned on we're quite safe but some other problems appear (with passing template variables or counting characters). On the other hand we have magic turned off, everything is clear, but we have to manually escape every variable (that come from untrusted source) in templates. By the way, non-magic solution is used in Ruby-on-Rails.
So the question is: when starting a new project in symfony do you disable escaping_strategy and why?
I need to see the contents of a std::map variable while debugging. However, if i click on it in the Autos/Locals Tab, I see implementation specific stuff, instead of the keys and its contents which I want to look at. Is there a work-around i'm missing ?
hello!
has somebody from you followed this tutorial?
link text
I really don´t now why, but I got following fault, when I went through the tutorial word by word:
@album[photo_attributes]‘ is not allowed as an instance variable name
somebody an idea why?
I set my NLS_LANG variable as 'AMERICAN_AMERICA.AL32UTF8' in the perl file that connects to oracle and tries to insert the data.
However when I insert a record with one value having this 'ñ' character the sql fails.
But if I use 'Ñ' it inserts just fine.
What am I doing wrong here?
I need my class to create a new blank record when the page opens up the problem I am having is when the page refreshes it keeps incrementing by 1, if I write a session to keep the variable the next time I go back it does not increment. Any ideas?
if(!isset($_POST['record_no'])) {
echo $_POST['record_no'] =
$projects->insert__blank_project(); }
else { print "already Set";
}
I have a situation where my subclass is not seeing the superclass' instance variable x. The ivar is obviously @protected by default, so why do I get a compiler error "x undeclared"?
- (CGSize)hitSize
{
// Compiler error
return size;
}
EDIT: hitSize is a property of a protocol my subclass is conforming to. The problem was that I had hitSize @synthesized, which was the culprit. The question then is why can't the synthesized getter see the ivar?
I think I encountered something extraordinary strange in VS 2008.
All the array values are 0x00, but why it is displayed 0x00000008 at the start of the variable?
I am trying to connect to ldap with a php web application. If the username/password is correct everything works fine however if the username/password is incorrect I get the following error:
PHP Warning: ldap_bind() [function.ldap-bind]: Unable to bind to server: Invalid credentials
for some reason I am not able to look at the errorno or the state of the bind variable afterwards to print the appopriate user friendly error message.
any ideas?
Hello i have implemented the following code:
- (void) mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)annView calloutAccessoryControlTapped:(UIControl *)control {
name = annView.annotation.title;
NSLog(name, [annView description]);
}
and how can I use the variable name in another class?
can you please help me, i am new in iphone developing!
Am I right in thinking I can't put an if-statement and the corresponding else-statement on one line in Python?
NB:
variable = value1 if condition else value2
is NOT two statements. It's one statement which can take the value of one of two expressions.
I want to do something like
if condition a=value else b=value
Am I right in thinking this requires a full if-else in Python? Like
if condition:
a=value
else:
b=value
Thanks,
Louise
I've made a new class in my Xcode project which is derived from UITableView
I then drag a UITableView from in the interface builder onto my view and change the class of the object to my derived class. Then I drag the outlet from the table to the files owner and hook it up to an outlet variable in my main view, which is of the same type as my derived class.
How do I also set up the datasource and delegate so that they belong to the derived class?