Search Results

Search found 37183 results on 1488 pages for 'string conversion'.

Page 196/1488 | < Previous Page | 192 193 194 195 196 197 198 199 200 201 202 203  | Next Page >

  • ASP.NET MVC File Upload Error - "The input is not a valid Base-64 string"

    - by Justin
    Hey all, I'm trying to add a file upload control to my ASP.NET MVC 2 form but after I select a jpg and click Save, it gives the following error: The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or a non-white space character among the padding characters. Here's the view: <% using (Html.BeginForm("Save", "Developers", FormMethod.Post, new {enctype = "multipart/form-data"})) { %> <%: Html.ValidationSummary(true) %> <fieldset> <legend>Fields</legend> <div class="editor-label"> Login Name </div> <div class="editor-field"> <%: Html.TextBoxFor(model => model.LoginName) %> <%: Html.ValidationMessageFor(model => model.LoginName) %> </div> <div class="editor-label"> Password </div> <div class="editor-field"> <%: Html.Password("Password") %> <%: Html.ValidationMessageFor(model => model.Password) %> </div> <div class="editor-label"> First Name </div> <div class="editor-field"> <%: Html.TextBoxFor(model => model.FirstName) %> <%: Html.ValidationMessageFor(model => model.FirstName) %> </div> <div class="editor-label"> Last Name </div> <div class="editor-field"> <%: Html.TextBoxFor(model => model.LastName) %> <%: Html.ValidationMessageFor(model => model.LastName) %> </div> <div class="editor-label"> Photo </div> <div class="editor-field"> <input id="Photo" name="Photo" type="file" /> </div> <p> <%: Html.Hidden("DeveloperID") %> <%: Html.Hidden("CreateDate") %> <input type="submit" value="Save" /> </p> </fieldset> <% } %> And the controller: //POST: /Secure/Developers/Save/ [AcceptVerbs(HttpVerbs.Post)] public ActionResult Save(Developer developer) { //get profile photo. var upload = Request.Files["Photo"]; if (upload.ContentLength > 0) { string savedFileName = Path.Combine( ConfigurationManager.AppSettings["FileUploadDirectory"], "Developer_" + developer.FirstName + "_" + developer.LastName + ".jpg"); upload.SaveAs(savedFileName); } developer.UpdateDate = DateTime.Now; if (developer.DeveloperID == 0) {//inserting new developer. DataContext.DeveloperData.Insert(developer); } else {//attaching existing developer. DataContext.DeveloperData.Attach(developer); } //save changes. DataContext.SaveChanges(); //redirect to developer list. return RedirectToAction("Index"); } Thanks, Justin

    Read the article

  • JRuby wrong element type class java.lang.String(array contains char) related to JAVA_HOME

    - by Daryl
    I am on Ubuntu x64 bit running: java version "1.6.0_18" OpenJDK Runtime Environment (IcedTea6 1.8) (6b18-1.8-0ubuntu1) OpenJDK 64-Bit Server VM (build 14.0-b16, mixed mode) and jruby 1.4.0 (ruby 1.8.7 patchlevel 174) (2010-02-11 6586) (OpenJDK 64-Bit Server VM 1.6.0_18) [amd64-java] I have this code running on my Windows 7 computer at home. I recently copied over my whole folder over to Ubuntu, installed java, jruby, and associated gems but I get this error when I run my main file: jruby run.rb test =================Processing FREDERICKSBURG_1.1======================= ERROR IN TESTING wrong element type class java.lang.String(array contains char) /home/daryl/Desktop/work/Code/geografikos/lib/sentence_splitter/splitter.rb:21:in `to_java' /home/daryl/Desktop/work/Code/geografikos/lib/sentence_splitter/splitter.rb:21:in `split' /home/daryl/Desktop/work/Code/geografikos/lib/models/page.rb:103:in `sentences' /home/daryl/Desktop/work/Code/geografikos/lib/extractor/lingpipe_svm.rb:34:in `extract' /home/daryl/Desktop/work/Code/geografikos/lib/extractor/geo_controller.rb:9:in `process' /home/daryl/Desktop/work/Code/geografikos/lib/extractor/geo_controller.rb:8:in `each' /home/daryl/Desktop/work/Code/geografikos/lib/extractor/geo_controller.rb:8:in `process' /home/daryl/Desktop/work/Code/geografikos/lib/extractor/geo_controller.rb:6:in `each' /home/daryl/Desktop/work/Code/geografikos/lib/extractor/geo_controller.rb:6:in `process' /home/daryl/Desktop/work/Code/geografikos/lib/statistics.rb:111:in `generate_all' /home/daryl/Desktop/work/Code/geografikos/lib/statistics.rb:105:in `each' /home/daryl/Desktop/work/Code/geografikos/lib/statistics.rb:105:in `generate_all' run.rb:56 The focus of the error is: ERROR IN TESTING wrong element type class java.lang.String(array contains char) Everything works fine on my windows machine. I figured I was getting this error because I did not have JAVA_HOME set however I added this to bashrc as: export JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk and have confirmed: echo $JAVA_HOME /usr/lib/jvm/java-1.6.0-openjdk I can produce a similar error by removing my JAVA_HOME variable on windows: =================Processing FREDERICKSBURG_1.3======================= ERROR IN TESTING cannot convert instance of class org.jruby.RubyString to char C:/work/Code/geografikos/lib/sentence_splitter/splitter.rb:21:in `to_java' C:/work/Code/geografikos/lib/sentence_splitter/splitter.rb:21:in `split' C:/work/Code/geografikos/lib/models/page.rb:103:in `sentences' C:/work/Code/geografikos/lib/extractor/lingpipe_svm.rb:34:in `extract' C:/work/Code/geografikos/lib/extractor/geo_controller.rb:9:in `process' C:/work/Code/geografikos/lib/extractor/geo_controller.rb:8:in `each' C:/work/Code/geografikos/lib/extractor/geo_controller.rb:8:in `process' C:/work/Code/geografikos/lib/extractor/geo_controller.rb:6:in `each' C:/work/Code/geografikos/lib/extractor/geo_controller.rb:6:in `process' C:/work/Code/geografikos/lib/statistics.rb:111:in `generate_all' C:/work/Code/geografikos/lib/statistics.rb:105:in `each' C:/work/Code/geografikos/lib/statistics.rb:105:in `generate_all' run.rb:56 It is obviously not exactly the same but I have a feeling this has to do with the java path. You can probably derive from the error that I am just trying to convert a ruby variable to java using to_java. This works fine on my windows machine and I have confirmed the gems are the same but I don't think this has to do with gems. I lied. I changed my JAVA_HOME back on my windows machine and this error still occurs. So now the code doesn't run on either machine. I recently installed git on my windows machine and added the code to a repository. But I haven't really done anything with it. All it said was it will convert all LF to CRLF...That shouldn't change anything though should it? Any ideas on why I am now getting these errors? I haven't changed anything on my windows machine in months except for installing git.

    Read the article

  • Warning: comparison with string literals results in unspecified behaviour

    - by nunos
    So I starting the project of writing a simplified sheel for linux in c. I am not at all proficient with c nor with Linux that's exactly the reason I decided it would be a good idea. Starting with the parser, I have already encountered some problems. The code should be straightforward that's why I didn't include any comments. I am getting a warning with gcc: "comparison with string literals results in unspecified behaviour" at the lines commented with "WARNING HERE" (see code below). I have no idea why this causes an warning, but the real problem is that even though I am comparing an "<" to an "<" is doesn't get inside the if... I am looking for an answer for the problem explained, however if there's something that you see in the code that should be improved please say so. Just take in mind I am not that proficient and that this is still a work in progress (or better yet, a work in start). Thanks in advance. #include <stdio.h> #include <unistd.h> #include <string.h> typedef enum {false, true} bool; typedef struct { char **arg; char *infile; char *outfile; int background; } Command_Info; int parse_cmd(char *cmd_line, Command_Info *cmd_info) { char *arg; char *args[100]; int i = 0; arg = strtok(cmd_line, " \n"); while (arg != NULL) { args[i] = arg; arg = strtok(NULL, " \n"); i++; } int num_elems = i; cmd_info->infile = NULL; cmd_info->outfile = NULL; cmd_info->background = 0; int iarg = 0; for (i = 0; i < num_elems; i++) { if (args[i] == "&") //WARNING HERE return -1; else if (args[i] == "<") //WARNING HERE if (args[i+1] != NULL) cmd_info->infile = args[i+1]; else return -1; else if (args[i] == ">") //WARNING HERE if (args[i+1] != NULL) cmd_info->outfile = args[i+1]; else return -1; else cmd_info->arg[iarg++] = args[i]; } cmd_info->arg[iarg] = NULL; return 0; } void print_cmd(Command_Info *cmd_info) { int i; for (i = 0; cmd_info->arg[i] != NULL; i++) printf("arg[%d]=\"%s\"\n", i, cmd_info->arg[i]); printf("arg[%d]=\"%s\"\n", i, cmd_info->arg[i]); printf("infile=\"%s\"\n", cmd_info->infile); printf("outfile=\"%s\"\n", cmd_info->outfile); printf("background=\"%d\"\n", cmd_info->background); } int main(int argc, char* argv[]) { char cmd_line[100]; Command_Info cmd_info; printf(">>> "); fgets(cmd_line, 100, stdin); parse_cmd(cmd_line, &cmd_info); print_cmd(&cmd_info); return 0; }

    Read the article

  • how to pass a string value from one controller to another

    - by shreedevi
    I have a login controller ,and after the successful login i want to pass some string value to the menu page.however it does not work.the application crashes. I have tried possible suggesstion of Ihuk and SAM from the link below http://stackoverflow.com/questions/1685964/how-to-pass-a-string-value-from-one-view-controller-to-another-view-controller loginController.h: #import <UIKit/UIKit.h> @class RootViewController; @class Menu; @interface LoginController : UIViewController { UIButton *login_Button; UITextField *username_TextField; UITextField *password_TextField; RootViewController *mc1; UINavigationController *navigationController; Menu *mv1; } @property(nonatomic,retain) IBOutlet UIButton *login_Button; @property(nonatomic,retain) IBOutlet UITextField *username_TextField; @property(nonatomic,retain) IBOutlet UITextField *password_TextField; @property(nonatomic,retain) RootViewController *mc1; @property (nonatomic, retain) IBOutlet UINavigationController *navigationController; @property(nonatomic,retain)Menu *mv1; - (IBAction)Login_Method:(id)sender; -(id)initWithUserName:(NSString *)name ; @end loginController.m #import "LoginController.h" #import "Menu.h" #import "ViewController.h" #import "RootViewController.h" @implementation LoginController @synthesize mc1,mv1; @synthesize login_Button,username_TextField,password_TextField; @synthesize navigationController; // Implement viewDidLoad to do additional setup after // loading the view, typically from a nib. - (void)viewDidLoad { if (![self.navigationController isNavigationBarHidden]) [self.navigationController setNavigationBarHidden:YES animated:NO]; //[self presentModalViewController:navigationController animated:YES]; } - (void)didReceiveMemoryWarning { // Releases the view if it doesn't have a superview. [super didReceiveMemoryWarning]; // Release any cached data, images, etc that aren't in use. } - (void)viewDidUnload { // Release any retained subviews of the main view. // e.g. self.myOutlet = nil; } - (IBAction)Login_Method:(id)sender { Menu *mv2 = [[Menu alloc] initWithUserName:@"Menu" bundle:nil]; //mv2.l1.text=@"aa"; //i tried this, but not work,so created initWithUserName self.mv1=mv2; [self presentModalViewController:mv1 animated:YES]; // [RootViewController release]; } -(id)initWithUserName:(NSString *)name { self = [super init]; if (nil == self) { return nil; } // display or store login info somewhere [mv1.l1 setText:name]; return self; } -(BOOL)textFieldShouldReturn:(UITextField *)theTextField { [theTextField resignFirstResponder]; return YES; } - (void)dealloc { [username_TextField release]; [password_TextField release]; [super dealloc]; } @end Menu.h #import <UIKit/UIKit.h> @class Menu; @interface Menu : UIViewController { UILabel *l1; UIButton *AccountSummary_Button; UIButton *PayOffQuote_Button; UIButton *PayBill_Button; UIButton *Logout_Button; UINavigationController *nv1; } @property(nonatomic,retain) IBOutlet UILabel *l1; @property(nonatomic,retain) IBOutlet UIButton *AccountSummary_Button; @property(nonatomic,retain) IBOutlet UIButton *PayOffQuote_Button; @property(nonatomic,retain) IBOutlet UIButton *PayBill_Button; @property(nonatomic,retain) IBOutlet UIButton *Logout_Button; @property (nonatomic, retain) IBOutlet UINavigationController *nv1; -(IBAction)ViewAccountSummary_method:(id)sender; -(IBAction)ViewPayOffQuote_method:(id)sender; -(IBAction)ViewPayBill_method:(id)sender; -(IBAction)Logout_method:(id)sender; @end Menu.m

    Read the article

  • Applying ServiceKnownTypeAttribute to WCF service with Spring

    - by avidgoffer
    I am trying to apply the ServiceKnownTypeAttribute to my WCF Service but keep getting the error below my config. Does anyone have any ideas? <object id="HHGEstimating" type="Spring.ServiceModel.ServiceExporter, Spring.Services"> <property name="TargetName" value="HHGEstimatingHelper"/> <property name="Name" value="HHGEstimating"/> <property name="Namespace" value="http://www.igcsoftware.com/HHGEstimating"/> <property name="TypeAttributes"> <list> <ref local="wcfErrorBehavior"/> <ref local="wcfSilverlightFaultBehavior"/> <object type="System.ServiceModel.ServiceKnownTypeAttribute, System.ServiceModel"> <constructor-arg name="type" value="IGCSoftware.HHG.Business.UserControl.AtlasUser, IGCSoftware.HHG.Business"/> </object> </list> </property> Error thrown by a dependency of object 'HHGEstimating' defined in 'assembly [IGCSoftware.HHG.WebService, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null], resource [IGCSoftware.HHG.WebService.Resources.Spring.objects.xml] line 46' : '1' constructor arguments specified but no matching constructor found in object 'System.ServiceModel.ServiceKnownTypeAttribute#25A5628' (hint: specify argument indexes, names, or types to avoid ambiguities). while resolving 'TypeAttributes[2]' to 'System.ServiceModel.ServiceKnownTypeAttribute#25A5628' defined in 'assembly [IGCSoftware.HHG.WebService, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null], resource [IGCSoftware.HHG.WebService.Resources.Spring.objects.xml] line 46' Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: Spring.Objects.Factory.ObjectCreationException: Error thrown by a dependency of object 'HHGEstimating' defined in 'assembly [IGCSoftware.HHG.WebService, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null], resource [IGCSoftware.HHG.WebService.Resources.Spring.objects.xml] line 46' : '1' constructor arguments specified but no matching constructor found in object 'System.ServiceModel.ServiceKnownTypeAttribute#25A5628' (hint: specify argument indexes, names, or types to avoid ambiguities). while resolving 'TypeAttributes[2]' to 'System.ServiceModel.ServiceKnownTypeAttribute#25A5628' defined in 'assembly [IGCSoftware.HHG.WebService, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null], resource [IGCSoftware.HHG.WebService.Resources.Spring.objects.xml] line 46' Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [ObjectCreationException: Error thrown by a dependency of object 'HHGEstimating' defined in 'assembly [IGCSoftware.HHG.WebService, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null], resource [IGCSoftware.HHG.WebService.Resources.Spring.objects.xml] line 46' : '1' constructor arguments specified but no matching constructor found in object 'System.ServiceModel.ServiceKnownTypeAttribute#25A5628' (hint: specify argument indexes, names, or types to avoid ambiguities). while resolving 'TypeAttributes[2]' to 'System.ServiceModel.ServiceKnownTypeAttribute#25A5628' defined in 'assembly [IGCSoftware.HHG.WebService, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null], resource [IGCSoftware.HHG.WebService.Resources.Spring.objects.xml] line 46'] Spring.Objects.Factory.Support.ObjectDefinitionValueResolver.ResolveInnerObjectDefinition(String name, String innerObjectName, String argumentName, IObjectDefinition definition, Boolean singletonOwner) in l:\projects\spring-net\trunk\src\Spring\Spring.Core\Objects\Factory\Support\ObjectDefinitionValueResolver.cs:300 Spring.Objects.Factory.Support.ObjectDefinitionValueResolver.ResolvePropertyValue(String name, IObjectDefinition definition, String argumentName, Object argumentValue) in l:\projects\spring-net\trunk\src\Spring\Spring.Core\Objects\Factory\Support\ObjectDefinitionValueResolver.cs:150 Spring.Objects.Factory.Support.ObjectDefinitionValueResolver.ResolveValueIfNecessary(String name, IObjectDefinition definition, String argumentName, Object argumentValue) in l:\projects\spring-net\trunk\src\Spring\Spring.Core\Objects\Factory\Support\ObjectDefinitionValueResolver.cs:112 Spring.Objects.Factory.Config.ManagedList.Resolve(String objectName, IObjectDefinition definition, String propertyName, ManagedCollectionElementResolver resolver) in l:\projects\spring-net\trunk\src\Spring\Spring.Core\Objects\Factory\Config\ManagedList.cs:126 Spring.Objects.Factory.Support.ObjectDefinitionValueResolver.ResolvePropertyValue(String name, IObjectDefinition definition, String argumentName, Object argumentValue) in l:\projects\spring-net\trunk\src\Spring\Spring.Core\Objects\Factory\Support\ObjectDefinitionValueResolver.cs:201 Spring.Objects.Factory.Support.ObjectDefinitionValueResolver.ResolveValueIfNecessary(String name, IObjectDefinition definition, String argumentName, Object argumentValue) in l:\projects\spring-net\trunk\src\Spring\Spring.Core\Objects\Factory\Support\ObjectDefinitionValueResolver.cs:112 Spring.Objects.Factory.Support.AbstractAutowireCapableObjectFactory.ApplyPropertyValues(String name, RootObjectDefinition definition, IObjectWrapper wrapper, IPropertyValues properties) in l:\projects\spring-net\trunk\src\Spring\Spring.Core\Objects\Factory\Support\AbstractAutowireCapableObjectFactory.cs:373 Spring.Objects.Factory.Support.AbstractAutowireCapableObjectFactory.PopulateObject(String name, RootObjectDefinition definition, IObjectWrapper wrapper) in l:\projects\spring-net\trunk\src\Spring\Spring.Core\Objects\Factory\Support\AbstractAutowireCapableObjectFactory.cs:563 Spring.Objects.Factory.Support.AbstractAutowireCapableObjectFactory.ConfigureObject(String name, RootObjectDefinition definition, IObjectWrapper wrapper) in l:\projects\spring-net\trunk\src\Spring\Spring.Core\Objects\Factory\Support\AbstractAutowireCapableObjectFactory.cs:1844 Spring.Objects.Factory.Support.AbstractAutowireCapableObjectFactory.InstantiateObject(String name, RootObjectDefinition definition, Object[] arguments, Boolean allowEagerCaching, Boolean suppressConfigure) in l:\projects\spring-net\trunk\src\Spring\Spring.Core\Objects\Factory\Support\AbstractAutowireCapableObjectFactory.cs:918 Spring.Objects.Factory.Support.AbstractObjectFactory.CreateAndCacheSingletonInstance(String objectName, RootObjectDefinition objectDefinition, Object[] arguments) in l:\projects\spring-net\trunk\src\Spring\Spring.Core\Objects\Factory\Support\AbstractObjectFactory.cs:2120 Spring.Objects.Factory.Support.AbstractObjectFactory.GetObjectInternal(String name, Type requiredType, Object[] arguments, Boolean suppressConfigure) in l:\projects\spring-net\trunk\src\Spring\Spring.Core\Objects\Factory\Support\AbstractObjectFactory.cs:2046 Spring.Objects.Factory.Support.DefaultListableObjectFactory.PreInstantiateSingletons() in l:\projects\spring-net\trunk\src\Spring\Spring.Core\Objects\Factory\Support\DefaultListableObjectFactory.cs:505 Spring.Context.Support.AbstractApplicationContext.Refresh() in l:\projects\spring-net\trunk\src\Spring\Spring.Core\Context\Support\AbstractApplicationContext.cs:911 _dynamic_Spring.Context.Support.XmlApplicationContext..ctor(Object[] ) +197 Spring.Reflection.Dynamic.SafeConstructor.Invoke(Object[] arguments) in l:\projects\spring-net\trunk\src\Spring\Spring.Core\Reflection\Dynamic\DynamicConstructor.cs:116 Spring.Context.Support.RootContextInstantiator.InvokeContextConstructor(ConstructorInfo ctor) in l:\projects\spring-net\trunk\src\Spring\Spring.Core\Context\Support\ContextHandler.cs:550 Spring.Context.Support.ContextInstantiator.InstantiateContext() in l:\projects\spring-net\trunk\src\Spring\Spring.Core\Context\Support\ContextHandler.cs:494 Spring.Context.Support.ContextHandler.InstantiateContext(IApplicationContext parentContext, Object configContext, String contextName, Type contextType, Boolean caseSensitive, String[] resources) in l:\projects\spring-net\trunk\src\Spring\Spring.Core\Context\Support\ContextHandler.cs:330 Spring.Context.Support.ContextHandler.Create(Object parent, Object configContext, XmlNode section) in l:\projects\spring-net\trunk\src\Spring\Spring.Core\Context\Support\ContextHandler.cs:280 [ConfigurationErrorsException: Error creating context 'spring.root': Error thrown by a dependency of object 'HHGEstimating' defined in 'assembly [IGCSoftware.HHG.WebService, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null], resource [IGCSoftware.HHG.WebService.Resources.Spring.objects.xml] line 46' : '1' constructor arguments specified but no matching constructor found in object 'System.ServiceModel.ServiceKnownTypeAttribute#25A5628' (hint: specify argument indexes, names, or types to avoid ambiguities). while resolving 'TypeAttributes[2]' to 'System.ServiceModel.ServiceKnownTypeAttribute#25A5628' defined in 'assembly [IGCSoftware.HHG.WebService, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null], resource [IGCSoftware.HHG.WebService.Resources.Spring.objects.xml] line 46'] System.Configuration.BaseConfigurationRecord.EvaluateOne(String[] keys, SectionInput input, Boolean isTrusted, FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentResult) +202 System.Configuration.BaseConfigurationRecord.Evaluate(FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentResult, Boolean getLkg, Boolean getRuntimeObject, Object& result, Object& resultRuntimeObject) +1061 System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject) +1431 System.Configuration.BaseConfigurationRecord.GetSection(String configKey, Boolean getLkg, Boolean checkPermission) +56 System.Configuration.BaseConfigurationRecord.GetSection(String configKey) +8 System.Web.Configuration.HttpConfigurationSystem.GetApplicationSection(String sectionName) +45 System.Web.Configuration.HttpConfigurationSystem.GetSection(String sectionName) +49 System.Web.Configuration.HttpConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection(String configKey) +6 System.Configuration.ConfigurationManager.GetSection(String sectionName) +78 Spring.Util.ConfigurationUtils.GetSection(String sectionName) in l:\projects\spring-net\trunk\src\Spring\Spring.Core\Util\ConfigurationUtils.cs:69 Spring.Context.Support.ContextRegistry.InitializeContextIfNeeded() in l:\projects\spring-net\trunk\src\Spring\Spring.Core\Context\Support\ContextRegistry.cs:340 Spring.Context.Support.ContextRegistry.GetContext() in l:\projects\spring-net\trunk\src\Spring\Spring.Core\Context\Support\ContextRegistry.cs:206 Spring.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(String reference, Uri[] baseAddresses) in l:\projects\spring-net\trunk\src\Spring\Spring.Services\ServiceModel\Activation\ServiceHostFactory.cs:66 System.ServiceModel.HostingManager.CreateService(String normalizedVirtualPath) +11687036 System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath) +42 System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +479 [ServiceActivationException: The service '/HHGEstimating.svc' cannot be activated due to an exception during compilation. The exception message is: Error creating context 'spring.root': Error thrown by a dependency of object 'HHGEstimating' defined in 'assembly [IGCSoftware.HHG.WebService, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null], resource [IGCSoftware.HHG.WebService.Resources.Spring.objects.xml] line 46' : '1' constructor arguments specified but no matching constructor found in object 'System.ServiceModel.ServiceKnownTypeAttribute#25A5628' (hint: specify argument indexes, names, or types to avoid ambiguities). while resolving 'TypeAttributes[2]' to 'System.ServiceModel.ServiceKnownTypeAttribute#25A5628' defined in 'assembly [IGCSoftware.HHG.WebService, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null], resource [IGCSoftware.HHG.WebService.Resources.Spring.objects.xml] line 46'.] System.ServiceModel.AsyncResult.End(IAsyncResult result) +11592858 System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +194 System.ServiceModel.Activation.HostedHttpRequestAsyncResult.ExecuteSynchronous(HttpApplication context, Boolean flowContext) +176 System.ServiceModel.Activation.HttpModule.ProcessRequest(Object sender, EventArgs e) +275 System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +68 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

    Read the article

  • Pass variable to regular expression pattern string in jquery

    - by phil
    Is that possible to pass variable into regular expression pattern string in jquery ( or javascript)? For example, I want to validate a zip code input field every time while user type in a character by passing variable i to the regular expression pattern. How to do it right? $('#zip').keyup( function(){ var i=$('#zip').val().length for ( i; i<=5; i++){ var pattern=/^[0-9]{i}$/; if ( !pattern.test( $('#zip').val() ) ) {$('#zip_error').css('display','inline');} else {$('#zip_error').css('display','none');} } })

    Read the article

  • XML parsing error: 'A string literal was expected' when inserting values into table

    - by Christian
    In Microsoft Sequel Server 2008 I am attempting to insert values into an sql table with the columns type_id of datatype int and xml_info of datatype XML. I am using the following query: INSERT INTO tbl_applied_devices ([type_id],[xml_info]) VALUES (1,'<Profile ID=99><Server><ID>BC4A18CA-AFB5-4268-BDA9-C990DAFE7783</ID> <Name>localhost</Name><Services></Services></Server></Profile>') But I keep getting this error: Msg 9413, Level 16, State 1, Line 4 XML parsing: line 1, character 13, A string literal was expected What am I doing incorrectly? Thank you for the help. EDIT: I found that the source of the error is the xml element's ID attribute, where seems to be what is causing the error. How can I correctly insert xml with an attribute ? Do I need to somehow escape one of the characters?

    Read the article

  • jQgrid Pagination with query string

    - by bsreekanth
    Hello, I recently started experimenting with jQgrid, and much appreciate for any guidance on the below use case. I need to implement a (advanced)search functionality, and the results are loaded in the jQgrid. When use pagination, how to specify a complex query in the post data? In the serverside (grails) it it represented as an object, which is mocked below class searchCommand { String val1 List<long> ids //from the multiple selection } the above members can be null, if the user doesn't select any. Without saving the state at the server, I guess the only way to make the pagination work is to pass the query object back and forth with the correct offset, index etc. if that is the case, how best to represent it in jQgrid side. I saw a parameter postData to set additional values, but not sure how to represnt the data (JSON??). Any code snippet on (retaining) converting it from the last result to postData would be helpful. thanks in advance.

    Read the article

  • windows authentication vs sql server authentication for asp.net forms authentication site

    - by Brij
    I have a database and a site having forms authentication. It is working fine with VS2008. This time, I am using "Trusted_connection =True". But when it is opened from outside or directly from browser then I am getting error "Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'." I know this is due to permission. SQL server is based on windows authentication. What is the best approach to manage user to connect sql server? Should I enable sql server authentication? Let me know what to do so that it makes the production feel and there wouldn't be any problem during deployment. Note: Sql server is installed on domain server.

    Read the article

  • Compiled Linq & String.Contains

    - by sharru
    i'm using linq-to-sql and i'm use complied linq for better performance. I have a users table with a INT field called "LookingFor" that can have the following values.1,2,3,12,123,13,23. I wrote a query to return the users based on the "lookingFor" column i want to return all users that contains the "lookingFor" value (not only those equal to it). In example if user.LookingFor = 12 , and query paramter is 1 this user should be selected. private static Func<NeDataContext, int, IQueryable<int>> MainSearchQuery = CompiledQuery.Compile((NeDataContext db, int lookingFor) => (from u in db.Users where (lookingFor == -1 ? true : u.LookingFor.ToString().Contains(lookingFor) select u.username); This WORKS on non complied linq but throws error when using complied. How do i fix it to work using complied linq? I get this error: Only arguments that can be evaluated on the client are supported for the String.Contains method.

    Read the article

  • Facebook connect - api_client->users_getInfo throws error Cannot use string offset as an array

    - by Gublooo
    Hey guys I have this piece of code which works 90% of the time: $user_details=$fb-api_client-users_getInfo($fb_user, array('last_name','first_name','proxied_email')); $firstName=$user_details[0]['first_name']; But sometimes I get this error: Fatal error: Cannot use string offset as an array for line $firstName=$user_details[0]['first_name']; I have read several people report the same issue - but I'm still not clear as to what is the reason - Am I getting this error because facebook is not returning any results or am I getting because it is returning only a single array instead of array of arrays. This is the fix I'm thinking of: if (!is_array($user_details)) { $firstName=''; } else { $firstName = ($user_details[0]) ? $user_details[0]['first_name'] : $user_details['first_name']; } Also if I'm not getting the name - is it because of a timeout issue or something else? Thanks

    Read the article

  • DLLImport error: System.AccessViolationException with Manifest file and c#

    - by RP
    When trying to call (DLLImport) an external c++ dll from a .net application that has a manifest file with requireAdministrator, I get this error trying to call function from the C++ dll in Windows 7 with UAC enabled. Method I am calling: EnCrypts System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. public class BlowFish { [DllImport("BlowfishTool.dll", CharSet = CharSet.Auto)] public static extern String EnCrypt(String strData, String strPassword); [DllImport("BlowfishTool.dll", CharSet = CharSet.Auto)] public static extern String EnCrypt(String strData, String strPassword, bool doNotUsePassChecking); [DllImport("BlowfishTool.dll", CharSet = CharSet.Auto)] public static extern String DeCrypt(String strData, String strPassword, bool doNotUsePassChecking); [DllImport("BlowfishTool.dll", CharSet = CharSet.Auto)] public static extern String DeCrypt(String strData, String strPassword); public static String EnCrypts(String strData, String strPassword) { return EnCrypt(strData, strPassword, true); } } }

    Read the article

  • MDDR in user agent string

    - by Joakim Backman
    What do MDDR means in a user agent string? Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; MDDR; InfoPath.1; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; OfficeLiveConnector.1.4; OfficeLivePatch.1.3)

    Read the article

  • ODBC Connection String Problem

    - by Brett
    Hi there, I am having major trouble connecting to my database via ODBC. The db is local (but I have a mirror on a virtual machine), so I am trying to use the connectionstring: Dsn=MonetDB;host=TARBELL where TARBELL is the name of my computer. However, it doesn't connect. BUT, this string does: Dsn=MonetDB;host=localhost as does Dsn=MonetDB Can anyone explain this? I am at a complete loss. I have taken down my firewalls (at least until I get this figured out), so that can't be the problem. I eventually want to change the TARBELL to the mirrored virtual machine running another instance of the database. Many thanks, Brett

    Read the article

  • The web publishing extension is not installed which is required to publish

    - by Chong Wang
    I was tring to deploy an ASP.NET Web Application to a Windows Azure Web Site by following the tutorial through this link: https://www.windowsazure.com/en-us/develop/net/tutorials/get-started/ After download the public profile, which is a ".PublishSettings" file, I go back to Visual Studio and right-click the project in Solution Explorer and select Publish from the context menu as the tutorial said. However, a warning box jumped up and it showed me that "The Web Publishing extension is not installed which is required to publish. You can install it from http://go.microsoft.com/fwlink/?LinkID=208120." I already installed "Windows Azure SDK for .NET (VS 2012)" and I also tried to uninstall this and install again, but the same problem is still there. Anyone knows how to solve this? I am really appreciated.

    Read the article

  • Why allow concatenation of string literals?

    - by Caspin
    I recently got bit by a subtle bug. char ** int2str = { "zero", // 0 "one", // 1 "two" // 2 "three",// 3 nullptr }; assert( values[1] == "one"_s ); // passes assert( values[2] == "two"_s ); // fails If you have godlike code review powers you'll notice I forgot the , after "two". After the considerable effort to find that bug I've got to ask why would anyone ever want this behavior? I can see how this might be useful for macro magic, but then why is this a "feature" in a modern language like python? Have you ever used string literal concatenation in production code?

    Read the article

  • Load CoreData objects' string property into UIPickerView

    - by OscarTheGrouch
    Hello Currently I have an entity named "Events" in a CoreData app. "Events" has one string property named "eventName". In the -(void)viewDidLoad I am trying to Fetch all the "Events" objects and load their "eventName" by alphabetical order into a UIPickerView. The ultimate end goal is through the use of a textField, buttons and the pickerView being add new objects in and remove unwanted objects out. Basically turning the UIPickerView into a UITableView. Currently I am able to save objects to the CoreData store, but am not able to pull them/their properties out into the UIPickerView. I am willing and able to share the project source code to anyone who wants it, or is willing to look at it to help out. thanks Chris

    Read the article

  • Convert xml as string

    - by hakish
    i have a scenario where in i need to send an xml as a tag content in a SOAP request message to a webservice for example <arg_1><xml version="1.0" encoding="UTF-8"?><sometag><somemoretag>abcd</somemoretag></sometag></arg_1></code> arg_1 happens to be an String parameter to a webservice. So i bring in a CDATA section for this <arg_1><![CDATA[<xml version="1.0" encoding="UTF-8"?><sometag><somemoretag>abcd</somemoretag></sometag>]]></arg_1> But this keeps throwing me an exception org.xml.sax.SAXException: WSWS3084E: Error: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize. Message being parsed: I keep getting this exception. Has anyone seen this before??

    Read the article

  • MASM StrCmp Undefined?

    - by Yvan JANSSENS
    Hi, If I try to assemble the following code, I get a A2006 error ( error A2006: undefined symbol : StrCmp). Here's my code: .386 .model flat,stdcall option casemap:none include \masm32\include\windows.inc include \masm32\include\kernel32.inc include \masm32\include\masm32.inc include \masm32\include\user32.inc includelib \masm32\lib\kernel32.lib includelib \masm32\lib\masm32.lib includelib \masm32\lib\stdlib.lib includelib \masm32\lib\user32.lib .data YvanSoftware db "(c) YvanSoftware - ALL RIGHTS RESERVED", 13 ,10 ,0 EnterYourName db "Please enter your name: ", 0 CRLF db 13,10,0 TheHolyMan db "Yvan", 0 Seriously db "Seriously? You're the MAN!", 13,10,0 LoserName db "What a loser name.", 13,10 .data? buffer db 100 dup(?) .code start: invoke StdOut,addr YvanSoftware invoke StdOut, addr EnterYourName invoke StdIn, addr buffer, 100 invoke StdOut, addr CRLF invoke StrCmp,addr buffer, addr TheHolyMan ;error fires here je HolyMan IfNotHolyMan: invoke StdOut, addr LoserName jmp EndIfHolyMan HolyMan: invoke StdOut, addr Seriously jmp EndIfHolyMan EndIfHolyMan: invoke ExitProcess,0 END start I'm a complete n00b at assembler, and I'm trying to learn it. ;) Yvan

    Read the article

  • Forcing a mixed ISO-8859-1 and UTF-8 multi-line string into UTF-8

    - by knorv
    Consider the following problem: A multi-line string $junk contains some lines which are encoded in UTF-8 and some in ISO-8859-1. I don't know a priori which lines are in which encoding, so heuristics will be needed. I want to turn $junk into pure UTF-8 with proper re-encoding of the ISO-8859-1 lines. Also, in the event of errors in the processing I want to provide a "best effort result" rather than throwing an error. My current attempt looks like this: $junk = &force_utf8($junk); sub force_utf8 { my $input = shift; my $output = ''; foreach my $line (split(/\n/, $input)) { if (utf8::valid($line)) { utf8::decode($line); } $output .= "$line\n"; } return $output; } While this appears to work I'm certain this is not the optimal solution. How would you improve my force_utf8(...) sub?

    Read the article

  • Unexpected result in .NET 4 DirectoryInfo.EnumerateFiles(string)

    - by xkingpin
    It seems that the following code is not working as expected. I would assume that the following call to EnumarateFiles would only return files that match the filename pattern of c* ... however, filenames with H* are still getting returned. For example... the following file will get deleted in the following code (HNNN09060900932.xml). What's the issue? This is a major bug in my application. string searchPattern = "C*"; // get each file in this directory that is less than a given date var files = from file in SubDir.EnumerateFiles(searchPattern) where file.LastWriteTime < KeepDate select file; foreach (var file in files) { file.Delete(); }

    Read the article

  • C++ Preprocessor string literal concatenation

    - by ezpz
    I found this regarding how the C preprocessor should handle string literal concatenation (phase 6). However, I can not find anything regarding how this is handled in C++ (does C++ use the C preprocessor?). The reason I ask is that I have the following: const char * Foo::encoding = "\0" "1234567890\0abcdefg"; where encoding is a static member of class Foo. Without the availability of concatenation I wouldnt be able to write that sequence of characters like that. const char * Foo::encoding = "\01234567890\0abcdefg"; Is something entirely different due to the way \012 is interpreted. I dont have access to multiple platforms and I'm curious how confident I should be that the above is always handled correctly - i.e. I will always get { 0, '1', '2', '3', ... }

    Read the article

  • Updating onclick's string value with Greasemonkey

    - by Devin McCabe
    I'm trying to write a Greasemonkey script to update the onclick value of a bunch of links on a page. The HTML looks like this: <a onclick="OpenGenericPopup('url-99.asp','popup',500,500,false)" href="javascript:void(0)">text</a> I need to update the url-99.asp part of the Javascript into something like urlB-99.asp. In my script, I'm collecting all the links with an XPath expression and iterating through them: var allEl = document.evaluate( 'td[@class="my-class"]/a', document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); for (var i = 0; i < allEl.snapshotLength; i++) { var el = allEl.snapshotItem(i); //something here; } If I try to alert(el.onclick), I get an error in the console: Component is not available I've read up on unsafeWindow and other Greasemonkey features, and I understand how to set an event handler for that link with a new onClick event, but how do I read the current onclick value into a string so I can manipulate it and update the element?

    Read the article

  • the best way to connect sql server (Windows authentication vs SQL Server authentication) for asp.net

    - by Brij
    I have a database and a site having forms authentication. It is working fine with VS2008. This time, I am using "Trusted_connection =True". But when it is opened from outside or directly from browser then I am getting error "Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'." I know this is due to permission. SQL server is based on windows authentication. What is the best approach to manage user to connect SQL Server? Should I enable SQL Server authentication? Let me know what to do so that it makes the production feel and there wouldn't be any problem during deployment. Note: SQL Server is installed on domain server.

    Read the article

< Previous Page | 192 193 194 195 196 197 198 199 200 201 202 203  | Next Page >