Search Results

Search found 6735 results on 270 pages for 'pre commit'.

Page 17/270 | < Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >

  • svn: trying to commit after remove a folder and create it again (with the same name)

    - by user248959
    Hi, imagine i have made a co. Then if I remove a folder and create another one with the same name. Then if i try to ci I get: svn: Commit failed (details follow): svn: Directory '/opt/lampp/htdocs/prueba4/apps/frontend/modules/moto/.svn' containing working copy admin area is missing laptop@laptop:/opt/lampp/htdocs/prueba4$ sudo svn st ~ apps/frontend/modules/moto If i tried to add that folder i get: svn: warning: 'apps/frontend/modules/moto' is already under version control What should i do? Regards Javi

    Read the article

  • Adding Client Validation To DataAnnotations DataType Attribute

    - by srkirkland
    The System.ComponentModel.DataAnnotations namespace contains a validation attribute called DataTypeAttribute, which takes an enum specifying what data type the given property conforms to.  Here are a few quick examples: public class DataTypeEntity { [DataType(DataType.Date)] public DateTime DateTime { get; set; }   [DataType(DataType.EmailAddress)] public string EmailAddress { get; set; } } .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } This attribute comes in handy when using ASP.NET MVC, because the type you specify will determine what “template” MVC uses.  Thus, for the DateTime property if you create a partial in Views/[loc]/EditorTemplates/Date.ascx (or cshtml for razor), that view will be used to render the property when using any of the Html.EditorFor() methods. One thing that the DataType() validation attribute does not do is any actual validation.  To see this, let’s take a look at the EmailAddress property above.  It turns out that regardless of the value you provide, the entity will be considered valid: //valid new DataTypeEntity {EmailAddress = "Foo"}; .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } Hmmm.  Since DataType() doesn’t validate, that leaves us with two options: (1) Create our own attributes for each datatype to validate, like [Date], or (2) add validation into the DataType attribute directly.  In this post, I will show you how to hookup client-side validation to the existing DataType() attribute for a desired type.  From there adding server-side validation would be a breeze and even writing a custom validation attribute would be simple (more on that in future posts). Validation All The Way Down Our goal will be to leave our DataTypeEntity class (from above) untouched, requiring no reference to System.Web.Mvc.  Then we will make an ASP.NET MVC project that allows us to create a new DataTypeEntity and hookup automatic client-side date validation using the suggested “out-of-the-box” jquery.validate bits that are included with ASP.NET MVC 3.  For simplicity I’m going to focus on the only DateTime field, but the concept is generally the same for any other DataType. Building a DataTypeAttribute Adapter To start we will need to build a new validation adapter that we can register using ASP.NET MVC’s DataAnnotationsModelValidatorProvider.RegisterAdapter() method.  This method takes two Type parameters; The first is the attribute we are looking to validate with and the second is an adapter that should subclass System.Web.Mvc.ModelValidator. Since we are extending DataAnnotations we can use the subclass of ModelValidator called DataAnnotationsModelValidator<>.  This takes a generic argument of type DataAnnotations.ValidationAttribute, which lucky for us means the DataTypeAttribute will fit in nicely. So starting from there and implementing the required constructor, we get: public class DataTypeAttributeAdapter : DataAnnotationsModelValidator<DataTypeAttribute> { public DataTypeAttributeAdapter(ModelMetadata metadata, ControllerContext context, DataTypeAttribute attribute) : base(metadata, context, attribute) { } } .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } Now you have a full-fledged validation adapter, although it doesn’t do anything yet.  There are two methods you can override to add functionality, IEnumerable<ModelValidationResult> Validate(object container) and IEnumerable<ModelClientValidationRule> GetClientValidationRules().  Adding logic to the server-side Validate() method is pretty straightforward, and for this post I’m going to focus on GetClientValidationRules(). Adding a Client Validation Rule Adding client validation is now incredibly easy because jquery.validate is very powerful and already comes with a ton of validators (including date and regular expressions for our email example).  Teamed with the new unobtrusive validation javascript support we can make short work of our ModelClientValidationDateRule: public class ModelClientValidationDateRule : ModelClientValidationRule { public ModelClientValidationDateRule(string errorMessage) { ErrorMessage = errorMessage; ValidationType = "date"; } } .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } If your validation has additional parameters you can the ValidationParameters IDictionary<string,object> to include them.  There is a little bit of conventions magic going on here, but the distilled version is that we are defining a “date” validation type, which will be included as html5 data-* attributes (specifically data-val-date).  Then jquery.validate.unobtrusive takes this attribute and basically passes it along to jquery.validate, which knows how to handle date validation. Finishing our DataTypeAttribute Adapter Now that we have a model client validation rule, we can return it in the GetClientValidationRules() method of our DataTypeAttributeAdapter created above.  Basically I want to say if DataType.Date was provided, then return the date rule with a given error message (using ValidationAttribute.FormatErrorMessage()).  The entire adapter is below: public class DataTypeAttributeAdapter : DataAnnotationsModelValidator<DataTypeAttribute> { public DataTypeAttributeAdapter(ModelMetadata metadata, ControllerContext context, DataTypeAttribute attribute) : base(metadata, context, attribute) { }   public override System.Collections.Generic.IEnumerable<ModelClientValidationRule> GetClientValidationRules() { if (Attribute.DataType == DataType.Date) { return new[] { new ModelClientValidationDateRule(Attribute.FormatErrorMessage(Metadata.GetDisplayName())) }; }   return base.GetClientValidationRules(); } } .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } Putting it all together Now that we have an adapter for the DataTypeAttribute, we just need to tell ASP.NET MVC to use it.  The easiest way to do this is to use the built in DataAnnotationsModelValidatorProvider by calling RegisterAdapter() in your global.asax startup method. DataAnnotationsModelValidatorProvider.RegisterAdapter(typeof(DataTypeAttribute), typeof(DataTypeAttributeAdapter)); .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } Show and Tell Let’s see this in action using a clean ASP.NET MVC 3 project.  First make sure to reference the jquery, jquery.vaidate and jquery.validate.unobtrusive scripts that you will need for client validation. Next, let’s make a model class (note we are using the same built-in DataType() attribute that comes with System.ComponentModel.DataAnnotations). public class DataTypeEntity { [DataType(DataType.Date, ErrorMessage = "Please enter a valid date (ex: 2/14/2011)")] public DateTime DateTime { get; set; } } .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } Then we make a create page with a strongly-typed DataTypeEntity model, the form section is shown below (notice we are just using EditorForModel): @using (Html.BeginForm()) { @Html.ValidationSummary(true) <fieldset> <legend>Fields</legend>   @Html.EditorForModel()   <p> <input type="submit" value="Create" /> </p> </fieldset> } .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } The final step is to register the adapter in our global.asax file: DataAnnotationsModelValidatorProvider.RegisterAdapter(typeof(DataTypeAttribute), typeof(DataTypeAttributeAdapter)); Now we are ready to run the page: Looking at the datetime field’s html, we see that our adapter added some data-* validation attributes: <input type="text" value="1/1/0001" name="DateTime" id="DateTime" data-val-required="The DateTime field is required." data-val-date="Please enter a valid date (ex: 2/14/2011)" data-val="true" class="text-box single-line valid"> .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } Here data-val-required was added automatically because DateTime is non-nullable, and data-val-date was added by our validation adapter.  Now if we try to add an invalid date: Our custom error message is displayed via client-side validation as soon as we tab out of the box.  If we didn’t include a custom validation message, the default DataTypeAttribute “The field {0} is invalid” would have been shown (of course we can change the default as well).  Note we did not specify server-side validation, but in this case we don’t have to because an invalid date will cause a server-side error during model binding. Conclusion I really like how easy it is to register new data annotations model validators, whether they are your own or, as in this post, supplements to existing validation attributes.  I’m still debating about whether adding the validation directly in the DataType attribute is the correct place to put it versus creating a dedicated “Date” validation attribute, but it’s nice to know either option is available and, as we’ve seen, simple to implement. I’m also working through the nascent stages of an open source project that will create validation attribute extensions to the existing data annotations providers using similar techniques as seen above (examples: Email, Url, EqualTo, Min, Max, CreditCard, etc).  Keep an eye on this blog and subscribe to my twitter feed (@srkirkland) if you are interested for announcements.

    Read the article

  • php frameworks - build your own vs pre-made

    - by christopher-mccann
    Hi, I am building an application currently in PHP and I am trying to decide on whether to use a pre-existing framework like codeigniter or build my own framework. The application needs to be really scalable and I want to be completely in control of it which makes me think I should build my own but at the same time I dont want to reinvent the wheel if I dont have to. Any advice greatly appreciated. Thanks

    Read the article

  • Pre-drawing a UIView

    - by LK
    There is information that is only available after drawRect that I need to access when loading a UIView. Is there any way to do a "pre-draw" or offscreen in order to get this information earlier?

    Read the article

  • How to pre-populate the Facebook status message through an URL similar to pre-populating a tweet?

    - by Crashalot
    This question has been asked before on SO, but most of those questions were asked a long time ago. Essentially, we want a simple way to pre-populate the Facebook status message through the URL much like you can with Twitter. We're aware of the Facebook APIs, but are wondering if there is a more lightweight approach. We don't need programmatically to post a message, but just provide some default text that the user can edit before sharing.

    Read the article

  • post increment vs pre increment [closed]

    - by mousey
    Possible Duplicate: Difference between i++ and ++i in a loop? Hi, Can some one please help me when to use pre increment or post increment in a for loop. I am getting the same results for both the loops! I also would like to know when and where to choose one between the two. Thanks in advance.

    Read the article

  • android - pre-allocate space for a file before downloading it

    - by android developer
    how can i create a pre-allocated file on android? something like a sparse file ? i need to make an applicaton that will download a large file , and i want to avoid having an out-of-space error while the download is commencing . my solution needs to support resuming and writing to both internal and external storage. i've tried what is written here: Create file with given size in Java but none of the solutions there didn't work for some reason.

    Read the article

  • No pre-built ActionBar for Android pre-3.0?

    - by Ollie C
    I note the release a few days ago of the static library bringing fragments to Android versions prior to 3.0, but does this library include the ActionBar? I suspect not. I assume that for an app that will work on pre-3.0 versions, that it needs a hand-built ActionBar implementation for versions up to 2.3 and then to use the OS default ActionBar in v3.0? for some reason I assumed the library had ActionBar in it, but as I dig further I'm not finding any evidence of its presence.

    Read the article

  • Git pre-receive hook to lunch PHP CodeSniffer

    - by Ralphz
    Hey. I'd like to check code committed to my remote git repository with PHP CodeSniffer and reject it if there are any problems code standards. Does anyone have an example how to use it on git remote repository or maybe example how to use it with pre-receive hook? Thanks.

    Read the article

  • pdf <pre> equivalent

    - by ddowns
    I'm trying to put some code examples in a pdf, but copying them out messes up the formatting and rearranges the lines, there's a lot of manual cleanup needed after pasting. Is there a equivalent to html's pre for PDFs? For "this" block of text respect line breaks, spacing, and copy as plain text like its shown. The closest thing I can see is adding note annotations next to every code example.

    Read the article

  • Subsonic3 pre-generate code files

    - by silverfox1948
    I need to pre-generate my active record files, rather than have subsonic build them dynamically. I used to be able to do this using SubSonicCentral in SubSonic 2.x. How do I do this in SubSonic 3? I don't see a generator executable when I download the 3.0.0.4 zip file.

    Read the article

  • pre-update svn script to filter what get

    - by DrLuk
    Imagine a repository with many kind of files. Then, I want to get from this repository just some kind of files in a "filter process". I mean ALL FILES are versioned. But to my local work, I just wanna i.e get *.php files, ignoring download *.jpg instead. I think about client-site hook script (pre-update). Anyone know if is it possible? Thanks!

    Read the article

  • Pass pre-requisite check information from Config file in InstallShield

    - by sameer
    Hi, I'm trying to achieve a requirement in Pre-requisites part of my package: The package should be able to check for the presence of a specific Operating System or Microsoft Patch on the target machine and block installation if the specified OS&patch is not found. I want to pass this information from Configuration xml or ini file, so that installer need not to be edited and build again for changes in requirements. Any ideas on how to achieve this!!

    Read the article

  • Review before or after code commit, which is better?

    - by fifth
    Traditionally we performed code review before commit, I had an argument with my colleague today, who preferred code review after commit. First, here's some background, we got some experienced developers and we also got new hires with almost zero programming practice. we'd like to perform fast and short iterations to release our product. we all team members locate at same site. The advantages of code review before commit I've learned, mentor new hires try to prevent errors, failures, bad designs in early developing cycle learn from others knowledge backup if someone quits But I also got some bad experience, like low efficiency, some changes may be reviewed over days hard to balance speed and quality, especially for newbies some guy felt distrust As to post-review, I just knew little about this, but the most thing I worried about is the risk of losing control, people never review. Any opinions?

    Read the article

  • What is the term for a really BIG source code commit?

    - by Ida
    Sometimes when we check the commit history of a software, we may see that there are a few commits that are really BIG - they may change 10 or 20 files with hundreds of changed source code lines (delta). I remember that there is a commonly used term for such BIG commit but I can't recall exactly what that term is. Can anyone help me? What is the term that programmers usually use to refer to such BIG and giant commit? BTW, is committing a lot of changes all together a good practice? UPDATE: thank you guys for the inspiring discussion! But I think "code bomb" is the term that I'm looking for.

    Read the article

  • Delivery of JMS message before the transaction is committed

    - by ewernli
    Hi, I have a very simple scenario involving a database and a JMS in an application server (Glassfish). The scenario is dead simple: 1. an EJB inserts a row in the database and sends a message. 2. when the message is delivered with an MDB, the row is read and updated. The problem is that sometimes the message is delivered before the insert has been committed in the database. This is actually understandable if we consider the 2 phase commit protocol: 1. prepare JMS 2. prepare database 3. commit JMS 4. ( tiny little gap where message can be delivered before insert has been committed) 5. commit database I've discussed this problem with others, but the answer was always: "Strange, it should work out of the box". My questions are then: How could it work out-of-the box? My scenario sounds fairly simple, why isn't there more people with similar troubles? Am I doing something wrong? Is there a way to solve this issue correctly? Here are a bit more details about my understanding of the problem: This timing issue exist only if the participant are treated in this order. If the 2PC treats the participants in the reverse order (database first then message broker) that should be fine. The problem was randomly happening but completely reproducible. I found no way to control the order of the participants in the distributed transactions in the JTA, JCA and JPA specifications neither in the Glassfish documentation. We could assume they will be enlisted in the distributed transaction according to the order when they are used, but with an ORM such as JPA, it's difficult to know when the data are flushed and when the database connection is really used. Any idea?

    Read the article

  • Determining URLs updated via a series of commit logs

    - by adamrubin
    I'm working on a project where I programmatically need to know when a URL has been changed by a developer, post or during deploy. The obvious answer may be to curl the URL one day, save the output, then curl and in x days then do a diff. That won't work in my case, as I'm only looking for changes the developer mande. If the site is a blog, new comments, user submitted photos, etc would make that curl diff useless. RoR example, using github. Let's assume I have access to the entire repository and all commit logs between iterations. Is there a way I could see that "/views/people/show.html.erb" was commited, then backtrack from there (maybe by inspecting routes.rb), to come up with the URL I can then hit via a browser?

    Read the article

  • Git pre-receive hook

    - by Ralphz
    Hi When you enable pre-receive hook for git repository: It takes no arguments, but for each ref to be updated it receives on standard input a line of the format: < old-value SP < new-value SP < ref-name LF where < old-value is the old object name stored in the ref, < new-value is the new object name to be stored in the ref and is the full name of the ref. When creating a new ref, < old-value is 40 0. Does anyone can explain me how do I examine all the files that will be changed in the repository if i allow this commit? I'd like to run that files through some scripts to check syntax and so on. Thanks.

    Read the article

  • Subversion: Ignore a Directory in the Repo on Commit

    - by Charles
    I have all the boost header files in this repository and when I do a check in it takes a really long time to scan all those files that will never change. Because I want users that checkout the project to be able to compile without installing boost I am in a pickle. I want to checkout everything, and then ignore updates (there will never be any) on a directory. Tortoise svn has a ignore-on-commit change list, but I cannot find anyway to add an entire directory to this list, and I do not fancy the idea of 'modifying' all the boost files so I can add them to this change list. Is there a simple solution?

    Read the article

  • SQLAlchemy automatically converts str to unicode on commit

    - by Victor Stanciu
    Hello, When inserting an object into a database with SQLAlchemy, all it's properties that correspond to String() columns are automatically transformed from <type 'str'> to <type 'unicode'>. Is there a way to prevent this behavior? Here is the code: from sqlalchemy import create_engine, Table, Column, Integer, String, MetaData from sqlalchemy.orm import mapper, sessionmaker engine = create_engine('sqlite:///:memory:', echo=False) metadata = MetaData() table = Table('projects', metadata, Column('id', Integer, primary_key=True), Column('name', String(50)) ) class Project(object): def __init__(self, name): self.name = name mapper(Project, table) metadata.create_all(engine) session = sessionmaker(bind=engine)() project = Project("Lorem ipsum") print(type(project.name)) session.add(project) session.commit() print(type(project.name)) And here is the output: <type 'str'> <type 'unicode'> I know I should probably just work with unicode, but this would involve digging through some third-party code and I don't have the Python skills for that yet :)

    Read the article

  • Forbid developer to commit code because of making weekly build

    - by Xinwang
    Our development team (about 40 developers) has a formal build every two weeks. We have a process that in the "build day", every developers are forbiden to commit code into SVN. I don't think this is a good idea because: Build will take days (even weeks in bad time) to make and BVT. People couldn't comit code as they will, they will not work. People will comit all codes in a hurge pack, so the common is hard to write. I want know if your team has same policy, and if not how do you take this situation. Thanks

    Read the article

< Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >