is it possible to cache form contents on client side? Like maintaining state even if the form is un-saved and the user moves to a new page then returns back to the form?
Hello All
I have a class ClientState
Class ClientState
{
Public int ID{get;set;}
public string State{get;set;}
}
List<ClientState> listClientState which contain all states of USA, Now may problem is listClientState contain some objects which have duplicates states.
How can i filter listClientState to remove duplicate record
I have this script that calls a .net WebService
msg = $.toJSON(
$.ajax({
type: "POST",
url: "http://[url]/ETS.UI/WebServices/LocationService.asmx/GetMappingLocationDetails",
contentType: "application/json; charset=utf-8",
data: $.toJSON({'componentId':994}),
dataType: "json",
async: false
}).responseText
);
And I recieve the following value in the msg variable:
""{\"d\":\"{\\"ComponentId\\":994,\\"Latitude\\":32.219627009236405,\\"Longitude\\":-110.96843719482422,\\"LocationName\\":\\"Tucson\\",\\"StreetAddress\\":\\"7201 E 22nd Street \\",\\"City\\":\\"Tucson\\",\\"State\\":\\"AZ\\",\\"PostalCode\\":null}\"}""
I have no idea why this would format this way, seems to only do this in responseText.
Does anyone have any ideas?
Maybe I am having a moment of 'afternoon', but can anyone explain why I get
Msg 102, Level 15, State 1, Line 2
Incorrect syntax near ')'.
When running
CREATE PROC DisplayDate
(
@DateVar DATETIME
) AS
BEGIN
SELECT @DateVar
END
GO
EXEC DisplayDate GETDATE();
Hi,
I intend to perform some automated integration tests. This requires the db to be put back into a 'clean state'. Is this the fastest/best way to do this:
var cfg = new Configuration();
cfg.Configure();
cfg.AddAssembly("Bla");
new SchemaExport(cfg).Execute(false, true, false);
Thanks.
Christian
Hi
I asked this question in SuperUser, posting here as well (http://superuser.com/questions/225671/windows-media-center-setting-referer-header).
Is there a way to add REFERER header for any RTSP streams within Windows Media Center, I learned that REFERER header is only added when Windows Media Player is in a embed state. But I want to know that's true and also is there any plugin/addon.
Thanks in advance.
Magento database name convention is not trivial. How to get these fields below for last 7 days?
Last Name
First Name
Address
City
State
Zip
Phone
Email
Amount
Order #
Item #
Dear friends
I try to use system.form_status state,but when i check it after I change some texts or my list item,there is no changes in system.form_status ,I just receive "query" message but I must receive "changed" message.
So how I can solve my problem?has it any precondition?
For various complicated annoying reasons which I won't go into here I need to track a project in both JIRA and SourceForge EE. Because I don't want people to have maintian trackers/issues in two places I was wondering if there is a way to automatically sync the two systems.
The syncing would need to reflect changes in state as well as creation of new issues.
I have the following code
class Transcription(object):
WORD = 0
PHONE = 1
STATE = 2
def __init__(self):
self.transcriptions = []
def align_transcription(self,model,target=Transcription.PHONE):
pass
The important part here is that I would like to have a class member as default value for a variable. This however gives the following error:
NameError: name 'Transcription' is not defined
Why is this not possible and what is the right (pythonic) way to do something like this.
I am reluctant to say I can't figure this out, but I can't figure this out. I've googled and searched Stack Overflow, and come up empty.
The abstract, and possibly overly vague form of the question is, how can I use the traits-pattern to instantiate non-virtual member functions? The question came up while modernizing a set of multivariate function optimizers that I wrote more than 10 years ago.
The optimizers all operate by selecting a straight-line path through the parameter space away from the current best point (the "update"), then finding a better point on that line (the "line search"), then testing for the "done" condition, and if not done, iterating.
There are different methods for doing the update, the line-search, and conceivably for the done test, and other things. Mix and match. Different update formulae require different state-variable data. For example, the LMQN update requires a vector, and the BFGS update requires a matrix. If evaluating gradients is cheap, the line-search should do so. If not, it should use function evaluations only. Some methods require more accurate line-searches than others. Those are just some examples.
The original version instantiates several of the combinations by means of virtual functions. Some traits are selected by setting mode bits that are tested at runtime. Yuck. It would be trivial to define the traits with #define's and the member functions with #ifdef's and macros. But that's so twenty years ago. It bugs me that I cannot figure out a whiz-bang modern way.
If there were only one trait that varied, I could use the curiously recurring template pattern. But I see no way to extend that to arbitrary combinations of traits.
I tried doing it using boost::enable_if, etc.. The specialized state information was easy. I managed to get the functions done, but only by resorting to non-friend external functions that have the this-pointer as a parameter. I never even figured out how to make the functions friends, much less member functions. The compiler (VC++ 2008) always complained that things didn't match. I would yell, "SFINAE, you moron!" but the moron is probably me.
Perhaps tag-dispatch is the key. I haven't gotten very deeply into that.
Surely it's possible, right? If so, what is best practice?
Hi,
I am working on an iphone application in which I am consuming a webservice.
So i am parsing the XML file data. any idea about how to parse self closing tag
like: State/ and how to read data of self tag like: Contact Email="[email protected]" Name="PhD" Phone="123-521-3388" Source="location"/
I am parsing xml file using NSXMLPARSER class methods and library
Thanks,
Is it possible to still play sound / music even if audio has been interrupted, or more precisely: even if MyInterruptionListener got called from the OS with the interruption state kAudioSessionBeginInterruption ?
Yeah I know that's not good idea to do. But want to know anyways.
Hello,
I have a UIElement that I want to capture a snapshot of when a user clicks a button. When a user clicks the button, I want to take the UIElement and load it's current state into an Image element. How do I render a UIElement as an Image?
Thank you!
Why does an HTTP PUT request have to contain a representation of a 'whole' state and can't just be a partial?
I understand that this is the existing definition of PUT - this question is about the reason(s) why it would be defined that way.
i.e:
What is gained by preventing partial PUTs?
Why was preventing idempotent partial updates considered an acceptable loss?
I've to forms frmPrint & frmEmail and a dataset(MyDataset) with some DataTable and DataTable Adapters. In frmPrint I've the following Sub
Public Sub StartPrinting()
try
adapterLettersInSchedules.Fill(ds.LettersInSchedules)
adapterLetters.Fill(ds.Letters)
adapterClients.Fill(ds.Clients)
adapterPrintJobs.GetPrintJobsDueToday(ds.PrintJobs, False, DateTime.Today)
For Each prow As MyDataSet.PrintJobsRow In ds.PrintJobs
Dim lisrow As MyDataSet.LettersInSchedulesRow = ds.LettersInSchedules.FindByID(prow.LetterInScheduleID)
If lisrow.Isemail = False Then
Dim clientrow As MyDataSet.ClientsRow = ds.Clients.FindByClientID(prow.ClientID)
Dim letterrow As MyDataSet.LettersRow = ds.Letters.FindByID(lisrow.LetterID)
'prow.
'lisrow.is
Label1.SuspendLayout()
Label1.Refresh()
Label1.Text = "Printing letter"
txt.Rtf = letterrow.LetterContents
txt.Rtf = txt.Rtf.Replace("<%Firstname%>", clientrow.FirstName)
txt.Rtf = txt.Rtf.Replace("<%Lastname%>", clientrow.LastName)
txt.Rtf = txt.Rtf.Replace("<%Title%>", clientrow.Title)
txt.Rtf = txt.Rtf.Replace("<%Street%>", clientrow.Street)
txt.Rtf = txt.Rtf.Replace("<%City%>", clientrow.City)
txt.Rtf = txt.Rtf.Replace("<%State%>", clientrow.State)
txt.Rtf = txt.Rtf.Replace("<%Zip%>", clientrow.Zip)
txt.Rtf = txt.Rtf.Replace("<%PhoneH%>", clientrow.PhoneH)
txt.Rtf = txt.Rtf.Replace("<%PhoneW%>", clientrow.PhoneW)
txt.Rtf = txt.Rtf.Replace("<%Date%>", DateTime.Today.ToShortDateString)
Try
PDoc.PrinterSettings = printDlg.PrinterSettings
PDoc.Print()
prow.Printed = True
adapterPrintJobs.Update(prow)
Catch ex As Exception
End Try
End If
Next prow
ds.PrintJobs.Clear()
Catch ex As Exception
MessageBox.Show(ex.Message, "Print", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End Sub
And in frmEmail i've the Following Sub
Public Sub SendEmails()
try
adapterLettersInSchedules.Fill(ds.LettersInSchedules)
adapterLetters.Fill(ds.Letters)
adapterClients.Fill(ds.Clients)
adapterEmailJobs.GetEmailJobsDueToday(ds.EmailJobs, False, Today)
Dim ls_string As String
For Each prow As MyDataSet.EmailJobsRow In ds.EmailJobs
Dim lisrow As MyDataSet.LettersInSchedulesRow = ds.LettersInSchedules.FindByID(prow.LetterInScheduleID)
If lisrow.Isemail = True Then
Dim clientrow As MyDataSet.ClientsRow = ds.Clients.FindByClientID(prow.ClientID)
Dim letterrow As MyDataSet.LettersRow = ds.Letters.FindByID(lisrow.LetterID)
txt.Rtf = letterrow.LetterContents
ls_string = RTF2HTML(txt.Rtf)
ls_string = Mid(ls_string, 1, Len(ls_string) - 176)
If ls_string = "" Then Throw New Exception("Rtf To HTML Conversion Failed")
Label1.SuspendLayout()
Label1.Refresh()
Label1.Text = "Sending Email"
If SendEmail(clientrow.Email, ls_string, letterrow.EmailSubject) Then
Try
prow.Emailed = True
adapterEmailJobs.Update(prow)
Catch ex As Exception
End Try
Else
prow.Emailed = False
adapterEmailJobs.Update(prow)
End If
End If
Next prow
Catch ex As Exception
MessageBox.Show(ex.Message, "Email", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End Sub
I'm running this two subs using two different Threads.
Public th As New Thread(New ThreadStart(AddressOf StartFirstPrint))
Public th4 As New Thread(New ThreadStart(AddressOf sendFirstEmail))
Here is the code of StartFirstPrint and sendFirstEmail
Public Sub StartFirstPrint()
Do While thCont
Try
Dim frm As New frmPrint()
'frm.MdiParent = Me
frm.StartPrinting()
Catch ex As Exception
End Try
Loop
End Sub
Public Sub sendFirstEmail()
Do While thCont
Try
Dim frmSNDEmail As New frmEmail
frmSNDEmail.SendEmails()
Catch ex As Exception
End Try
Loop
End Sub
the thCont is a public boolean variable that specifies when to shop those threads.
Most Of the time this works very well. But some times it gives errors Like the following image
I don't know why is this occurring. Please help me.
Hey,
Don't find any good answer to this simple question about helper/utils classes:
Why would i create a singleton (stateless) rather than static methods?
Why an object instance could be needed while the object has no state?
Sometimes i really don't know what to use...
I had a windows service relying on EF, and it was running fine until the server went down. The problem was after the server went up again, it didn't fix itself and still threw the error:
INTERNAL ERROR: Execution of the command requires an open and available connection. The connection's current state is broken.
Not being very proficient in EF I'm not aware of how I could recover from such a scenario, and why it occurred in the first place? Anyone had this happen before?
messagecontroller is nothing but object of initialize nib file.
[self.navigationController pushViewController:messageController animated:YES];
this statement executes in normal condition
this statement also works on state maintainace testing ,
this line executes properly but not open new view ,why?
How can I search the memory state of an process in Linux? Specifically I wish to identify certain regions of interest, and peek at them at regular intervals, possibly occasionally poking new values.
I suspect an answer may involve calls to ptrace(), and reading /proc/[pid]/mem, but need more to go on.
I would like to write a query like the following
select
username,
(select state from addresses where addresses.username = users.username) email
from users
This works in Oracle (assuming the result from the inner query is unique). However, is there a performance penalty associated with this style of writing query?
I've performed the "Replace Method with Method Object" refactoring described by Beck.
Now, I have a class with a "run()" method and a bunch of member functions that decompose the computation into smaller units. How do I test those member functions?
My first idea is that my unit tests be basically copies of the "run()" method (with different initializations), but with assertions between each call to the member functions to check the state of the computation.
(I'm using Python and the unittest module.)
what is the best way to extract last 2 characters of a string using regular expression.
For example, I want to extract state code from the following
"A_IL"
I want to extract IL as string..
please provide me C# code on how to get it..
string fullexpression = "A_IL";
string StateCode = some regular expression code....
thanks
Hi
Is there a simple way of tracking the change of an Mdi's children i.e. when they are created and closed, something like an event OnMdiChildListChanged (I realise this doesn't actually exist).
I am also aware that I could have a method within my Mdi that handles the creation of child forms and logs the state of them or even create an Interface that defines that a child form has a "NotifyParent" method that is then called on close of the form, but i was wondering if there was any built in events that i could plumb into?
Thanks
I'm new to unit testing, and I'm learning how to use NUnit and Moq. NUnit provides Assert syntax for testing conditions in my unit tests, while Moq provides some Verify functions. To some extent these seem to provide the same functionality.
How do I know when it's more appropriate to use Assert or Verify?
Maybe Assert is better for confirming state, and Verify is better for confirming behavior (Classical versus Mockist)?