I have this scenario: I have a chain of query handlers, the first is to query the cache, if the cache can't answer it or the answer is stale, then hit a database, if it can't find the answer or the answer is stale again, then query a remote web service.
But I am not sure if this is the right way to use this pattern, since the work flow is pretty…
I have an array that I have to add a new value to array value. I am new to arrays.
how do I loop thru the array and add to the value in the existing array.
Using SQL profiler, I was able to find the query generated from Nhibernate was executed in the
EXEC sp_executesql N'select ...'
fashion.
I am wondering if there is any way to force Nhibernate to generate the plain
Select ...
statement instead.
The reason I want this is because apparently SQL Server generated different execution plans for…
I am pretty new to Django and I met a problem in handling image upload using ModelForm.
My model is as following:
class Project(models.Model):
name = models.CharField(max_length=100)
description = models.CharField(max_length=2000)
startDate = models.DateField(auto_now_add=True)
photo = models.ImageField(upload_to="projectimg/", null=True,…
I need to change the emulator's default time zone. It worked in command line with -timezone option. But when I tried it in eclipse android's launch options. it didn't work. I set it in Window-preferences-android-launch-default emulator options. Am I setting it in a wrong place?
I used this query URL
http://maps.google.com/maps?q=from+A+to+B&output=kml
,which is given in the answer to this question. But after I tried it, it doesn't work with coordinates. It works with address names tho. I guess I could use google's geocoding to get the addresses first. But I wonder if there is another way to get the…
I am using rails beta 3 and I have a erb page named index.html.erb for discussions controller. In that page, I have a link as following:
<%= link_to 'Delete', {:action='destroy', :id=@discussion}, :confirm="Are you sure", :method='post' %
Which is supposed to generate a link to delete a discussion, however, the generated html is …
I'm wondering if it is possible to rerender just one element in a listview? I assume by calling notifyDatasetChanged() is gonna rerender the whole list?
Thanks,
I have a wide variety of locations stored in my persistent object that contain latitudes and longitudes in double(43.7389, 7.42577) format. I need to be able to grab the user's latitude and longitude and select all items within, say 1 mile. Walking distance.
I have done this in PHP so I snagged my PHP code and transferred it to Java,…
I came across an interesting issue today when playing around with the Silverlight Data Form control. I wanted to change the visibility of a particular control inside the bound edit template.. see xaml below.
<df:DataForm x:Name="NoteFormEdit" ItemsSource="{Binding Mode=OneWay}" AutoGenerateFields="True"
…
Gaffer on Games has a great article about using RK4 integration for better game physics. The implementation is straightforward but the math behind it confuses me. I understand derivatives and integrals on a conceptual level but I haven't manipulated equations in a long time.
Here's the brunt of Gaffer's implementation:
…
This is probably got a simple answer to it, but I am having problems just formatting the date for a dataform field..
<df:DataForm x:Name="Form1" ItemsSource="{Binding Mode=OneWay}" AutoGenerateFields="True"
AutoEdit="True" AutoCommit="False"
CommitButtonContent="Save"
…
Hi,
I have a web application with bunch of HTML code. There are some style-attributes that I can't get rid of, but I was wondering if it's worth the cleanness to get rid of class-names and use CSS selectors instead. Do CSS selectors perform slowly?
Does anybody know how to make a dialog that looks a bit like the firefox-addon dialog. especially the list/gridview style...
I'm using WinForms with C#
Hello.
I've started using jQuery and am wondering how to call functions in an anonymous function dynamically from String.
Let's say for instance, I have the following functions:
function foo() {
// Being in the global namespace,
// this function can be called with window['foo']()
alert("foo");
}
…
I'm having an interesting anomaly when displaying a listfield on the blackberry simulator:
The top item is the height of a single line of text (about 12 pixels) while the rest are fine.
Does anyone know why only the top item is being drawn this way? Also, when I add an empty venue in position 0, it…
Hi guys,
I have a question about asp.net mvc-2 strongly typed partial views, and view models.
I was just wondering if I can (or should) have two strongly typed partial views on one page, without implementing a whole new view model for that page.
For example, I have a page that displays profiles,…
I have an interesting issue today!! Basically I have two classes.
public class A : B
{
public virtual new ISet<DifferentItem> Items {get;set;}
}
public class B
{
public virtual int Id {get;set;}
public virtual ISet<Item> Items {get;set;}
}
The subclass A hides the base class…
This may sound very noobish, but I can't seem to get my app to my blackberry.
I was trying to follow the beginning blackberry development book's guide, but maybe I just missed the point somewhere.
For remote download, Is it really as simple as drop the COD and JAD files in the same folder on your…
In this post, asynchronous .js file loading syntax, someone said, "If the async attribute is present, then the script will be executed asynchronously, as soon as it is available."
(function() {
var d=document,
h=d.getElementsByTagName('head')[0],
s=d.createElement('script');
…
I've been trying to modify a rich text field to display correctly in its half of the horizontal field.
The goal is this:
---------------------------
| address is | ***********|
| very long | ** IMAGE **|
| state, zip | ***********|
---------------------------
Where address is a…
Creating a Drawable that is completely empty seems like a common need, as a place holder, initial state, etc., but there doesn't seem to be a good way to do this... at least in XML. Several places refer to the system resource @android:drawable/empty but as far as I can tell (i.e.,…
I have read a lot of questions about Visual Studio 2008 crashing on viewing some source files. However, I still can't fix this problem.
Visual Studio (SP1) runs fine until I try and view .aspx source files with the lines
<style type="text/css">
</stlye>
anywhere in…
My script fetches xml via httpConnection and saves to persistent store. No problems there.
Then I loop through the saved data to compose a list of image url's to fetch via queue.
Each of these requests calls the httpConnection thread as so
...
public synchronized void run()
{ …