I have a large Monorail project that we have decided we are going to move over to ASP.NET MVC. Most of the underlying system will likely be reusable, but the Controllers will of course have to be rewritten, and proabably at least some of the views.
It strikes me that a low risk avenue for this is gradually convert well defined sections of the system to MVC, and perhaps as MVCContrib Portable Areas. Does anyone know if there are any non-obvious gotchas that I am likely to run into with this approach?
Thanks for your input,
Matthew
I am using Ghostscript to convert a multi-page pdf to individual jpg files and can get it to output the files numbered like page_%03d.jpg but it always starts at page_001.jpg and i need it to start numbering the output files starting from page_000.jpg.
Is there a setting i can use to get Ghostscript to start at zero or am i going to have to rename all the files after processing?
I'm new to Pascal and FastReport. This question can probably be answered without knowledge of FastReport. Pascal is Delphi. FastReport4.
I have a text box accepting an 8 character string as input. Each character should be numeric. I'm attempting to validate each character as numeric. I've tried using the val function...
Procedure Val(S : String; var R: Real; Code : Integer);
begin
end;
procedure thisinputOnChange(Sender: TfrxComponent);
var
S : String;
error : Integer;
R : Real;
begin
S := thisinput.lines.text;
Val (S, R, error);
If error > 0 then
Button2.enabled := False;
end;
I got this code online. The explanation says that the function will return an error with a code greater than zero if the character cannot be converted to an integer. Is that explanation correct? Am I misinterpreting?
Right now I am trying to set a button's enabled property to false if the validation fails. I might change that to a message. For now, I would like to get it to work by setting the button property.
I'm not sure if I should be using the onChange event or another event. I'm also not sure if I need to send the input to the val function in a loop. Like I said, I'm just learning how to use this function.
I am able to validate the length. This code works...
procedure thisinputOnChange(Sender: TfrxComponent);
begin
if length(thisinput.lines.text) = 8 then
Button2.enabled := True;
end;
Any suggestions? Should I use the val function or something else? Let me know if I need to provide more info. I might not be able to check back until later, though.
Thanks for any help.
Hi,
Let's say I have a string or array which represents a number in base N, N1, where N is a power of 2. Assume the number being represented is larger than the system can handle as an actual number (an int or a double etc).
How can I convert that to a decimal string?
I'm open to a solution for any base N which satisfies the above criteria (binary, hex, ...).
Hi,
I'm using Jersey (jax-rs), to build a REST rich application.
Everything is great, but I really don't understand how to set in JSON Marshalling and Unmarshalling converting option for dates and numbers.
I have a User class:
@XmlRootElement
public class User {
private String username;
private String password;
private java.util.Date createdOn;
// ... getters and setters
}
When createdOn property is serialized, a string like this: '2010-05-12T00:00:00+02:00', but I need to choose date Pattern both, to marshall and unmarshall.
Someone knows hot to do that?
Thank's a lot,
Davide.
I have found several open-source/freeware programs that allow you to convert .doc files to .pdf files, but they're all of the application/printer driver variety, with no SDK attached.
I have found several programs that do have an SDK allowing you to convert .doc files to .pdf files, but they're all of the proprietary type, $2,000 a license or thereabouts.
Does anyone know of any clean, inexpensive (preferably free) programmatic solution to my problem, using C# or VB.NET?
Thanks!
I have a table in which there are two columns : 1. import type, 2. Excel import template.
The second column - "Excel import template" should store the whole excel file.
How would I save excel file in databse...can I use binary datatype column, convert excel file to bytes and save the same ?
Thanks in advance !
Hello, I've been trying to make a for loop that will iterate based off of the length of a network packet. In the API there exists a variable (size_t) by event.packet-dataLength. I want to iterate from 0 to event.packet-dataLength - 7 increasing i by 10 each time it iterates but I am having a world of trouble.
I looked for solutions but have been unable to find anything useful. I tried converting the size_t to an unsigned int and doing the arithmetic with that but unfortunately it didn't work. Basically all I want is this:
for (int i = 0; i < event.packet->dataLength - 7; i+=10) { }
Though every time I do something like this or attempt at my conversions the i < # part is a huge number. They gave a printf statement in a tutorial for the API which used "%u" to print the actual number however when I convert it to an unsigned int it is still incorrect. I'm not sure where to go from here. Any help would be greatly appreciated :)
I want to use JAX-RS REST services as a back-end for a web application used directly by humans with browsers. Since humans make mistakes from time to time I want to validate the form input and redisplay the form with validation message, if something wrong was entered. By default JAX-RS sends a 400 or 404 status code if not all or wrong values were send.
Say for example the user entered a "xyz" in the form field "count":
@POST
public void create(@FormParam("count") int count) {
...
}
JAX-RS could not convert "xyz" to int and returns "400 Bad Request".
How can I tell the user that he entered an illegal value into the field "count"? Is there something more convenient than using Strings everywhere and perform conversation by hand?
Is there a web site or tool that will convert a piece PHP code to C#?
something similar to
http://converter.telerik.com/
or
http://www.developerfusion.com/tools/convert/csharp-to-vb/
Hi, I'd like to set a property of an object through reflection, with a value of type string.
So, for instance, suppose I have a Ship class, with a property of Latitude, which is a double.
Here's what I'd like to do:
Ship ship = new Ship();
string value = "5.5";
PropertyInfo propertyInfo = ship.GetType().GetProperty("Latitude");
propertyInfo.SetValue(ship, value, null);
As is, this throws an Argument exception (Object of type 'System.String' cannot be converted to type 'System.Double').
How can I convert value to the proper type, based on propertyInfo?
I have done partial views in ASP.NET MVC but now I want to convert it to ASP.NET. I have used AJAX and JavaScript. How can I convert the following:
<a href="#" onclick="LoadPartialView('#MainContentDiv', '<%=Url.Action("AdminHome", "Admin")%>')">Home</a> ,
<input type="button" value="Submit" onclick="LoadPartialViewPost('#MainContentDiv', '<%=Url.Action("ViewPage", "Controller")%>', $('form').serialize())" />
to ASP.NET, or in other words, how can I load a partial view in ASP.NET?
The selector expression for LoadProperty must be a MemberAccess for the property.
I'm converting some C# to VB, this is the C# line:
entities.LoadProperty((MyType)MyTargetObject, c => c.MyProperty);
I convert it to VB like so:
entities.LoadProperty(DirectCast(MyTargetObject, MyType), Function(c) c.MyProperty)
However I get the error above. I don't understand what the code is doing, or anything at all, I am simply converting it line by line into Visual Basic. When I run the project, the error I get is the one above.
All I can see is that Entities is a class that inherits ObjectContext, which might mean something.
Any help would be soooo good because I am stressing out big time. Thanks.
I want to convert an int to a byte[2] array using BCD.
The int in question will come from DateTime representing the Year and must be converted to two bytes.
Is there any pre-made function that does this or can you give me a simple way of doing this?
example:
int year = 2010
would output:
byte[2]{0x20, 0x10};
Hi,
In our project we are consuming WCF webservices exposed at Central location as services with basicHttpBinding.
In client desktop application we need consume those webservices. I am able to generate proxy class using WSDL.exe.
But, I need to convert data/class given by the webservice into my local class, for that now I am xmlserialzing those class/objects given by webservice and deserializing into my local classes as both classes schema matches exactly same.
Is there any better way that I can follow?
or
Do I need to assign each property from one class to another?
thanks
nRk.
how to convert a String type to a Int
i have a tuple and i want to convert it to a tuple which has different types
tupletotuple :: (String,String,String) ->(String,Int,Int)
tupletotuple (a,b,c) = (a,read(b),read(c))
i get this Error Msg
Project tupletotuple ("cha",4,3)
ERROR - Cannot infer instance
* Instance : Num [Char]
* Expression : tupletotuple ("cha",4,3)
When using the .ToList() extension method on a Stack<T>, is the result the same as popping each element and adding to a new list (reverse of what was pushed)?
If so, is this because it really is iterating over each element, or does it store the elements in reverse internally and slip the array into a new List<T>?
There is Page Viewer Web Part which can display HTML page. Is there another webpart that can display the content of the Word document or alternatively a way to convert a Document from inside OOTB Sharepoint?
I have a string in "dd-MM-yyyy HH:mm" and need to convert it to a date object in the format
"yyyy-MM-dd HH:mm".
Below is the code I'm using to convert
oldScheduledDate = "16-05-2011 02:00:00";
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date oldDate = (Date)formatter.parse(oldScheduledDate);
Now when I print oldDate, i get
Sat Nov 01 02:00:00 GMT 21, which is completely wrong, what am I doing wrong here?
I have a custom TrueType font (TTF) that consists of a bunch of icons, which I'd like to render as individual bitmaps (GIF, PNG, whatever) for use on the Web. You'd think this is a simple task, but apparently not? There is a huge slew of TTF-related software here:
http://cg.scs.carleton.ca/~luc/ttsoftware.html
But it's all varying levels of "not quite what I want", broken links and/or hard to impossible to compile on a modern Ubuntu box -- eg. dumpglyphs (C++) and ttfgif (C) both fail to compile due to obscure missing dependencies. Any ideas?