Bind form input field to CodeIgniter query
I am trying to do query binding using CodeIgniter, and for the value in my
array I want to reference a form input element. What is the correct syntax
to do this?
Here is the current query binding:
$sql = "SELECT * FROM myTable WHERE Municipality = ?";
$myQuery = $this->db->query($sql, array('Windsor'));
Rather than have this query filtered on the value 'Windsor', I want to
refer to the value of myCity in the form called myForm. Here is the form:
<form name="myForm">
<fieldset>
<label>Average Sale Prices per SF
<input type="text"
id="myCity" />
</label>
</fieldset>
</form>
So, how do I substitute the array value 'Windsor' for the form input field
'myCity'?
Friday, 13 September 2013
App crashes at DidSelectRowAtIndexPath in xcode
App crashes at DidSelectRowAtIndexPath in xcode
My app crashes when I click on a record that sets text value in a text
label and when the value passed is empty.
- (void) tableView: (UITableView *)itemTableView didSelectRowAtIndexPath:
(NSIndexPath *)indexPath{
NSDictionary *obj = [self.dataCustomerDetailRows
objectAtIndex:indexPath.row];
self.textfieldCustomerName.text = [obj objectForKey:@"Name"];
self.textfieldCustomerPhoneNumber.text = [obj objectForKey:@"Phone"];
self.textfieldCounty.text = [obj objectForKey:@"Name"];
The record that causes the error is one that has no value returned in the
"Phone" obj, how can I code to handle this, e.g., where value is NULL,
replace with 0.
My app crashes when I click on a record that sets text value in a text
label and when the value passed is empty.
- (void) tableView: (UITableView *)itemTableView didSelectRowAtIndexPath:
(NSIndexPath *)indexPath{
NSDictionary *obj = [self.dataCustomerDetailRows
objectAtIndex:indexPath.row];
self.textfieldCustomerName.text = [obj objectForKey:@"Name"];
self.textfieldCustomerPhoneNumber.text = [obj objectForKey:@"Phone"];
self.textfieldCounty.text = [obj objectForKey:@"Name"];
The record that causes the error is one that has no value returned in the
"Phone" obj, how can I code to handle this, e.g., where value is NULL,
replace with 0.
Find all upstream callers of a .NET/CLR method
Find all upstream callers of a .NET/CLR method
I'd like to find out all of the upstream callers of a particular method,
over multiple assemblies.
I don't need to resolve late-bound references or virtual method calls,
simple straightforward CIL call references are fine.
I've looked at several options:
Reflector: the Analyzer portion of the tool is not exposed as an extension
point.
FxCop: the CallGraph class requires an FxCop context to run in.
Roslyn: I've no idea where to begin, but anyway I'm not interested in
starting from source, I want to give it an assembly and work with the
bytecode and metadata instead.
VS Add-in: As with Reflector, the Call Hierarchy tool is not exposed to
add-ins.
I guess my only solution is to work-backwards by iterating through every
method in an assembly, looking for call instructions to my source method,
then recursively repeating the process for each caller method.
Assuming my proposed solution is the way to go, what is the best way of
doing it? MethodInfo.GetMethodBody().GetILAsByteArray() seems a bit
hardcore. Are there any libraries that make it simple to work with CIL
(like ASM for Java)?
I'd like to find out all of the upstream callers of a particular method,
over multiple assemblies.
I don't need to resolve late-bound references or virtual method calls,
simple straightforward CIL call references are fine.
I've looked at several options:
Reflector: the Analyzer portion of the tool is not exposed as an extension
point.
FxCop: the CallGraph class requires an FxCop context to run in.
Roslyn: I've no idea where to begin, but anyway I'm not interested in
starting from source, I want to give it an assembly and work with the
bytecode and metadata instead.
VS Add-in: As with Reflector, the Call Hierarchy tool is not exposed to
add-ins.
I guess my only solution is to work-backwards by iterating through every
method in an assembly, looking for call instructions to my source method,
then recursively repeating the process for each caller method.
Assuming my proposed solution is the way to go, what is the best way of
doing it? MethodInfo.GetMethodBody().GetILAsByteArray() seems a bit
hardcore. Are there any libraries that make it simple to work with CIL
(like ASM for Java)?
Instance method not found (return type defaults to 'id')
Instance method not found (return type defaults to 'id')
I am taking a warning from Xcode :
Instance method '-presentModalViewController:animated:completion:' not
found (return type defaults to 'id')
Here is the code:
NewsWebViewController *sampleView = [[[NewsWebViewController alloc]
init] autorelease];
[self presentModalViewController:sampleView animated:YES completion:nil];
}
I try your different solution before to you contact, Please considerate my
apology, i'm french and i translate with google translate.
In you thanking by advance.
I am taking a warning from Xcode :
Instance method '-presentModalViewController:animated:completion:' not
found (return type defaults to 'id')
Here is the code:
NewsWebViewController *sampleView = [[[NewsWebViewController alloc]
init] autorelease];
[self presentModalViewController:sampleView animated:YES completion:nil];
}
I try your different solution before to you contact, Please considerate my
apology, i'm french and i translate with google translate.
In you thanking by advance.
Size of images in imageview android
Size of images in imageview android
I have an imageView inside a listView. Set up like this: main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<ListView
android:id="@+id/listView2"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
</ListView>
</LinearLayout>
image.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:scaleType="center"
android:src="@drawable/ic_launcher" />
</RelativeLayout>
This works great, filling in many images from url with http request. But I
have a problem with the size of the images. I want them to fill the screen
regardless the resolution or size. Tried with different layout hight,
width and scaleType but cant get it to work properly.
First image is how it looks now, second image is how i want it to look.
EDIT: tried with scaleType="fitXY" that gave me 100% width, but a bad
hight on the longer images.
I have an imageView inside a listView. Set up like this: main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<ListView
android:id="@+id/listView2"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
</ListView>
</LinearLayout>
image.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:scaleType="center"
android:src="@drawable/ic_launcher" />
</RelativeLayout>
This works great, filling in many images from url with http request. But I
have a problem with the size of the images. I want them to fill the screen
regardless the resolution or size. Tried with different layout hight,
width and scaleType but cant get it to work properly.
First image is how it looks now, second image is how i want it to look.
EDIT: tried with scaleType="fitXY" that gave me 100% width, but a bad
hight on the longer images.
Remove trailing spaces in visual studio 2012
Remove trailing spaces in visual studio 2012
I want to remove trailing spaces of each line from a text file, keeping
the line breaks intact. I am using Visual studio 2012's Regex feature for
this.
When I am trying to find \s*\r?\n and replace with \r\n it is also
stripping out all the empty lines, which is not expected.
Is there anything that I am missing?
I want to remove trailing spaces of each line from a text file, keeping
the line breaks intact. I am using Visual studio 2012's Regex feature for
this.
When I am trying to find \s*\r?\n and replace with \r\n it is also
stripping out all the empty lines, which is not expected.
Is there anything that I am missing?
Thursday, 12 September 2013
untitled
untitled
How can I declare a string within a comma-separated value, if the string
itself contains a comma?
The following example uses {} to show you the string I'd like to parse as
"one string":
<xsl:variable name="var_c_lang"
select="'Canada,China,Europe,France,{Japan, USA}'"/>
Would it be allowed to nest 's, like: ?
<xsl:variable name="var_c_lang"
select="'Canada,China,Europe,France,'Japan, USA''"/>
or to escape them individually:?
<xsl:variable name="var_c_lang"
select="'Canada','China','Europe','France','Japan, USA'"/>
thanks, Alex
How can I declare a string within a comma-separated value, if the string
itself contains a comma?
The following example uses {} to show you the string I'd like to parse as
"one string":
<xsl:variable name="var_c_lang"
select="'Canada,China,Europe,France,{Japan, USA}'"/>
Would it be allowed to nest 's, like: ?
<xsl:variable name="var_c_lang"
select="'Canada,China,Europe,France,'Japan, USA''"/>
or to escape them individually:?
<xsl:variable name="var_c_lang"
select="'Canada','China','Europe','France','Japan, USA'"/>
thanks, Alex
Subscribe to:
Posts (Atom)