I have a UTF-8 encoded char*.
Is there a standard function to calculate the number of visible characters represented by the byte array?
I'm on Red Hat (RHEL 5).
I am trying to write a custom select statement in Hibernate using the getHibernateTemplate() method. I am having problems with the resulting mapping.
Example Code:
List<User> users = getHibernateTemplate().find("Select user, sysdate as latestPost from User as user");
for (User user : users) {
assertNotNull(users.name);
}
The goal of the…
I have a UIImageView inside of a UIScrollView. The parent scroll view allows zooming and panning. When the user taps a point in the scroll view, I want to find the location in the raw image inside the UIImageView - i.e. I want the point after including any zooming and panning the user has done in the scroll view.
Right now, I have a…
Hi All,
I have a bunch of Views in a default folder that represent single "static" pages.
Everything works as advertised except i tried adding a new page yesterday.. using the exact same routing syntax and cannot for the life of me get it to work.
here's is an example of a working route:
routes.MapRoute(
"OurProgram", …
Hi All,
i am trying to figure out how to write a linq query that will return a child collections "name" property as a string.
I have a BO that has a "options" property where the options are the "name" property of each option in an "order" object.
I would like the result to look something like
order.id = 12312
order.date = 12/03/10…
Hi ive got an mvc form with a fileupload functionality. Ive got an action that accepts an file and extracts thumbnails from it, after which the user can select the images and then proceed to submit the form. How can post the initial file via ajax, bearing in mind, this is not the final submission on the form and I want to retain user…
I am parameterizing my web app's ad hoc sql. As a result, I expect the query plan cache to reduce in size and have a higher hit ratio. Perhaps even other important metrics will be improved.
Could I use perfmon to track this? If so, what counters should I use? If not perfmon, how could I report on the impact of this change?
I'm creating a simple monitoring tool in Silverlight. It talks to a web service to retrieve the status information and store it in the ViewModel. This needs to happen once per minute so I'm going to add a timer for this purpose (probably a DispatcherTimer).
My question is, where should the timer go in an M-V-VM architecture? In the…
I need write a live messenger plugin which periodically read messages from a remote http server, and then change my signature(the short message after my name) accordingly.
Can anyone point me to any open source project or materials where I can get started?
Thanks.
I'm completely new to M-V-VM and very new to Silverlight, just reading about it for the first time today. As a sample, I am creating a model containing a list of items. My (Silverlight 4) View contains a listbox and my ViewModel will look to the model to retrieve the collection that the listbox will bind to.
My question is this. I…
Hi All, i have a "questionairre" that is made up of a series of select boxes.
i need to use two properties in the options. For each selected option i need the value (which i know how to get and is working fine) but i also need to store an additional value which represents the id of the specific option in a DB.
One solution would…
When I attempt to count the number of items in a group I get the total number of items in the collection. How do you get the number of items in each group?
I am trying to create an outlook distribution list with php but I am having a hard time finding any resources or instructions on how to do so. Is it even possible to do this?
I have two arrays of strings that I would like to compare for equality:
my @array1 = ("part1", "part2", "part3", "part4");
my @array2 = ("part1", "PART2", "part3", "part4");
Is there a built-in way to compare arrays like there is for scalars?
I tried:
if (@array1 == @array2) {...}
but it just evaluated each array in scalar…
This code, when built in .Net for Any CPU platform and running on a 64-bit machine, simply returns a DialogResult of Cancel without showing the expected dialog box.
Dim dlg As New System.Windows.Forms.PrintDialog
If dlg.ShowDialog() = Windows.Forms.DialogResult.OK Then
'... print the document '
End If
However, it works…
In Xcode 4, I can press Ctrl-6 to get a list of all the methods in the current file.
The problem is, if I have private methods declared at the top of my implementation file, say:
@interface Foo ()
-(void)tap:(id)sender;
@end
@implementation Foo
...
-(void)tap:(id)sender
{
...
}
then starting to type "tap" while the…
I maintain a product that is installed at multiple locations which as been haphazardly upgraded. Unique constraints were added to a number of tables, but I have no idea what the names are at any particular instance. What I do know is the table/columnname pair that has the unique constraints and I would like to write a script…
I'm confused about the errors generated by the following code.
In Derived::doStuff, I can access Base::output directly by calling it.
Why can't I create a pointer to output() in the same context that I can call output()?
(I thought protected / private governed whether you could use a name in a specific context, but…
I am trying to make use of session data in my application and for some reason I don't have something setup right.
The code:
session[:key] = some_value
Generates the following error:
The error occurred while evaluating nil.[]
Other controllers don't have an issue with the session, so I am guessing I missed some…
I would lean towards
if (object == nil)
but I've noticed in some tutorials the use of
if (nil == object)
Is this just a style thing, or is there some justified rationale for using either format?
This is probably a really basic (no pun intended) question, but I can't seem to find an answer anywhere. Why does the result of func1 return False and func2 returns True? On every other test I have done, integer 1 is converted to boolean true and 0 to false. Works ok if I just set rtnValue to 1 or 0.
Public…
Possible Duplicates:
Whats the worst piece of code you have come across?
Examples of some of the worst code you’ve had to manage?
This mess reminded of some of the stuff I've had to work on. I was wondering if anyone else had nasty refactoring war stories and especially if you found unique or helpful…
As we mentioned a few posts ago we are working to bring Oracle Technology Network members NEW benefits each month. Listed below are several discounts on technology books brought to you by Apress, Pearson, CRC Press and Packt Publishing. Happy reading!!!
Apress Offers -
Get 50% off the eBook below using…
I’ve been doing a series of talks across Florida regarding Windows Phone 7 Design using Microsoft Expression Blend 4. I discuss the WP7 phone and application experience; show how to use Expression Blend toolset to effectively design such apps. Next presentation is on 5/4/2010 at 6:30PM EST will be a…
BI Architect Bill Pearson continues his examination of the general characteristics and properties of the Tablix data region, which debuts in Reporting Services 2008. Here, we discuss further concepts, and begin our hands-on examination of a Tablix data region in a working sample report.