Blog

  • How to Reset Form Unobtrusive jQuery?

    How to Reset Form Unobtrusive jQuery?

    I was looking around for a way to reset a form that was already validated by Unobtrusive jQuery Client Validation. JQuery validate doesn’t have any way to reset the UI after errors occur. However, you can safely use:

    var validator = $( "#myform" ).validate();
    validator.resetForm();

    The best example I found online was on John Culviner blog. It wasn’t exactly what I was looking for, but it was a good start. He resets the form by using a button and attributes, I need a function that does that, so I create a plugin that clears the form on demand.

    Clear Reset Form Unobtrusive jQuery validation part 2

    usage: $(“#signupform”).clearForm()

    (function ($) {
    
        $.fn.clearForm = function (options) {
    
            // This is the easiest way to have default options.
            var settings = $.extend({
                // These are the defaults.
    
                formId: this.closest('form')
    
            }, options);
    
            var $form = $(settings.formId);
    
            //reset jQuery Validate's internals
            $form.validate().resetForm();
    
            //reset unobtrusive validation summary, if it exists
            $form.find("[data-valmsg-summary=true]")
                .removeClass("validation-summary-errors")
                .addClass("validation-summary-valid")
                .find("ul").empty();
    
            //reset unobtrusive field level, if it exists
            $form.find("[data-valmsg-replace]")
                .removeClass("field-validation-error")
                .addClass("field-validation-valid")
                .empty();
    
            return $form;
        };
    
    }(jQuery));

    Good luck on your adventure! This should help a few people using unobtrusive Validation with MVC3.

  • How to use Data Annotations?

    How to use Data Annotations?

    Interesting snippet from C#, ASP.NET and MVC, that uses the ValidationAttribute

    Ever wanted to add validation to your MVC view, well look further for more details.

    The ValidationAttribute will help you validate your model and server-side properties. As a programmer, you will need to add certain rules or attributes to the properties, such as required, string length, range and change the display property name. The example has a special attribute that limits the amount of words the user can type into a field.

    You are required to inherit from ValidationAttribute, in order to use the error message and IsValid method of the attribute. Once you have those, you can set in the constructor, the message and max value. Then override the IsValid method and check the property for the amount of words. I used split and length methods to check against the max words.

    If all is fine, return success, otherwise give the user the error message you set in the constructor.

    The programmer will need a lot of flexibility in validating their model and view, this snippet can help you avoid writing a lot of extra client side code.

    A lot of the credit goes to Scott Allen course on Building Applications with ASP.NET MVC4.

    public class MaxWordsAttribute : ValidationAttribute
        {
            public MaxWordsAttribute(int maxWords)
                : base("{0} has too many words.")
            {
                _maxWords = maxWords;
            }
    
            protected override ValidationResult IsValid(
                object value, ValidationContext validationContext)
            {
                if (value != null)
                {
                    var valueAsString = value.ToString();
                    if (valueAsString.Split(' ').Length > _maxWords)
                    {
                        var errorMessage = FormatErrorMessage(validationContext.DisplayName);
                        return  new ValidationResult(errorMessage);
                    }
                }
                return ValidationResult.Success;
            }
    
            private readonly int _maxWords;
        }
    
        public class Reviews : IValidatableObject
        {
            [Range(1,10)]
            [Required]
            public int Rating { get; set; }
    
            [Required]
            [StringLength(1024)]
            public string Desc { get; set; }
    
            [Display(Name = "User Name")]
            [DisplayFormat(NullDisplayText = "anonymous")]
    
            [MaxWords(1)]
            public string UserName{ get; set; }
    
            public IEnumerable Validate(ValidationContext validationContext)
            {
                if (Rating < 2 && UserName.ToLower().StartsWith("cookies"))
                {
                    yield return new ValidationResult("Sorry, cookies, you can't do this");
                }
            }
        }
  • Summer Season – The season of flip-flops

    Summer Season – The season of flip-flops

    Summer Season

    “nature poems about summer”

    Summer season is starting, I found an interesting poem to start your season.

    Summer is the stuff of dreams. When adults sit at their desks, and children sit in school, they dream of summer. Summer is the time of infinite fun. The day seems to last forever, and the fun never stops. It is a time of romance, excitement and an enhanced enjoyment of life. Somehow summer never seems to last long enough. It is always over before we get a chance to fully experience its power. This is true of all things wonderful. They always seem too short.

    Read more at this Source.
    #FamilyFriendPoems

    Come over to the beach and take in a wave and enjoy the beautiful sun rays.

  • April and Spring with poetry

    April and Spring with poetry

    April welcome Spring.

    April Poetry.

    Spring is a miraculous experience. The whole world comes alive after the winter in which it seemed that everything was dead. The world comes filled with color and the scent of delicious greenery. The world that seemed so dull and cold has come alive once again. Little did we know that beneath the cold hard ground the plants and trees were preparing for rebirth. Spring gives us hope for rejuvenation in our own lives as well. Spring is a time to renew the excitement and zest for life that lives inside.

    The original poem is found at this Source.
    #FamilyFriendPoems

    This month brings flowers and bloom. Here are some holidays missing from the month of April:

    • National Humor Month
    • International Guitar Month
    • Keep America Beautiful Month
    • Lawn and Garden Month
    • National Poetry Month
    • National Pecan Month
    • National Welding Month
    • Records and Information Management Month
    • Stress Awareness Month

    You can find more holidays here.

  • Ruins Magic Growing with members

    Ruins Magic Growing with members

    [spb_column width=”1/4″ el_position=”first”] [/spb_column] [spb_column width=”1/2″] [spb_raw_js width=”1/1″ el_position=”first last”] JTNDc2NyaXB0JTIwYXN5bmMlMjBzcmMlM0QlMjIlMkYlMkZwYWdlYWQyLmdvb2dsZXN5bmRpY2F0aW9uLmNvbSUyRnBhZ2VhZCUyRmpzJTJGYWRzYnlnb29nbGUuanMlMjIlM0UlM0MlMkZzY3JpcHQlM0UlMEElM0MlMjEtLSUyMExlYWRlciUyMC0tJTNFJTBBJTNDaW5zJTIwY2xhc3MlM0QlMjJhZHNieWdvb2dsZSUyMiUwQSUyMCUyMCUyMCUyMCUyMHN0eWxlJTNEJTIyZGlzcGxheSUzQWlubGluZS1ibG9jayUzQndpZHRoJTNBNzI4cHglM0JoZWlnaHQlM0E5MHB4JTIyJTBBJTIwJTIwJTIwJTIwJTIwZGF0YS1hZC1jbGllbnQlM0QlMjJjYS1wdWItNjYyMjUxMjE3NzA2Nzg5NiUyMiUwQSUyMCUyMCUyMCUyMCUyMGRhdGEtYWQtc2xvdCUzRCUyMjcwMDM4MTE4NzAlMjIlM0UlM0MlMkZpbnMlM0UlMEElM0NzY3JpcHQlM0UlMEElMjhhZHNieWdvb2dsZSUyMCUzRCUyMHdpbmRvdy5hZHNieWdvb2dsZSUyMCU3QyU3QyUyMCU1QiU1RCUyOS5wdXNoJTI4JTdCJTdEJTI5JTNCJTBBJTNDJTJGc2NyaXB0JTNF [/spb_raw_js] [/spb_column] [spb_column width=”1/4″ el_position=”last”] [/spb_column] [blank_spacer height=”12px” width=”1/1″ el_position=”first last”] [spb_text_block title=”Note” icon=”fa fa-bell” pb_margin_bottom=”no” pb_border_bottom=”no” width=”3/4″ el_position=”first”]

    Ruins Magic and members runes of magic

    Muse
    Friend leaving Maintains
    Members
    Running instances
    Schedule
    Recruiting
    Reputation
    Why should somebody come here?
    Keeping people happy
    Accept the fact of people leaving

    [/spb_text_block] [spb_text_block title=”Game” icon=”fa fa-gamepad” pb_margin_bottom=”no” pb_border_bottom=”no” width=”1/4″ el_position=”last”]

    Play Runes of Magic

    [/spb_text_block] [blank_spacer height=”27px” width=”1/1″ el_position=”first last”] [spb_text_block title=”SoundCloud” icon=”fa fa-bell” pb_margin_bottom=”no” pb_border_bottom=”no” width=”1/1″ el_position=”first last”]

    Ruins Magic

    Back in the day when I was playing Ruins of Magic, I would imagine a routine that would become common out most MMO ( A massively multiplayer online game) life. The items I mentioned above are things you would be responsible for while being in a small guild. I would point to reputation because it’s something that branches off to recruiting and members. Guild mates must keep it professional and be polite. Many of my friends were older folks who had long stressful days, who worked and then came on to play the game. Nobody is looking for drama and hate.

    The key was not to think about these items as a task or job, but to tie in a fun factor and have some sort of reward system. Running instances (bosses areas and quests) for people who are doing well with their ranks. Giving out equipment and money to guild mates. Pointing out helpful hints and solutions to issues.  Ruins of Magic had many guilds that were able to maintain this, but if you were a smaller guild, then your resources were strained and it was hard to maintain this effort. Ultimately, a lot of people found themselves moving to other growing games.

    A guild master has to be able to answer the question about why this guild and not some other one. Bigger guilds mostly state facts clearly about the environment and the community.

    An example of a recruiting message in Runes of Magic:

    Our guild FreeDestiny is Recruiting players lvls 30-77.(If your lvl 1-29 we will inv if your active in the game)

    We have siege war every night and run dungeons everyday.
    We have Vent. nice people they will answer any questions you might have
    Run Goblin Games Every Day.

    If your Interested Msg “karinol”,”korilyn”,”Dorial”,”Ulamog” if all else fails msg “Ruskie” he’s on all night.
    he on from 10 am – 10 pm EST
    If you’re wondering if were a Nooby guild,
    Majority of our guild are/is lvl 50-77 and we have over 120 members
    I wouldn’t recommend staying to long in games like Runes of Magic and I would try not to get too attached to any guild. However, I understand that it is hard to play against friends and not helping them.

    Good luck on your adventure and your guild!

    [/spb_text_block] [blank_spacer height=”9px” width=”1/1″ el_position=”first last”] [spb_video title=”See Also” link=”https://www.youtube.com/watch?v=ky2wLl_A7RQ” full_width=”no” width=”1/1″ el_position=”first last”] [blank_spacer height=”30px” width=”1/1″ el_position=”first last”]

  • March As The Days Grow Longer

    March As The Days Grow Longer

    March

    March settles gently among us.

    Still cool and breezy, NY is so dizzy.

    March (i/mɑrtʃ/) is the third month of the year in both the Julian and Gregorian calendars. It is one of the seven months that are 31 days long.

    Remember Easter Sunday lands on March.

    Wishing you the best Happy Holidays!

    March images here.

  • Sign Language with Simsigns

    Sign Language with Simsigns

    Sign Language with Simsigns

    Ever since I got involved with programming I was always interested in learning new languages, but I didn’t get into all of them, like sign language. Then I met somebody who needed help getting her signs out into the world-wide-web. She sought to teach others through technology because everyone is moving toward web and mobile world.

    Every week or so, we sit down and draw up sign using the Paper App on the iPad and save them into simsigns. If we can’t draw them, we just shoot a quick picture and move on to the next letter of the alphabet. We are planning on teaching another app, so stay tuned.

    letter N
    letter N
  • PC Repair @ 360mobile

    PC Repair @ 360mobile

    pc repair @ 360mobile

    PC Repair is needed almost always. My friend and I worked on a side project but had nowhere to display our information, so we decided to turn it into a website. He wanted an area to show his repairs on iPhone’s and PC and the services he provides.

    360Mobile.wordpress.com

    Initial Setup

    We started by first brainstorming ideas on Skype and come up with a long list:

    1. Repairs
    2. Tutorials
    3. Video
    4. Keeping computers healthy
    5. Computer
    6. Overclock
    7. iPhone
    8. Virus
    9. iPad
    10. Networking
    11. Business
    12. Prices
    13. Games
    14. Entrepreneur
    15. General
    16. Mobile
    17. CdRom
    18. Computer case
    19. Cup
    20. Blackberry
    21. Mods
    22. Software
    23. Updates
    24. Hard drive
    25. Printers
    26. Troubleshooting
    27. Water cooling
    28. Sleeping
    29. GPU
    30. SSD
    31. PSU
    32. Fans
    33. Tubing
    34. Lighting
    35. Windows 7
    36. Windows 8
    37. Windows up
    38. Mac OS
    39. Microsoft software
    40. Adobe

    Afterword, we made a short list out of the above to represent categories:

    • Hardware
    • Software
    • Troubleshooting
    • Mods
    • Tutorials

    Template

    It was simple to choose a template, all we had in mind was the idea of it being mobile, so we choose a template that was responsive to any media.

    360Mobile
    360Mobile
  • How a Fire Destroyed my Personal Computer?

    How a Fire Destroyed my Personal Computer?

    Fire started unexpectedly

    Fire!!

    A fellow blogger (Dronstad) had told me not to go back and reedit my old content. Or at least I remember him saying that. Initially, I tried to get a writer for my blog, so I can draw. Nevertheless, I am writing a short story because I want to improve my writing. For example, WordPress sends out daily challenges to improve your writing. Therefore, I thought it would be a good idea to go back and see what needs an interesting perspective twist. When you are free, please read the following passage and then check out the new perspective.

    A fire started as a result of PSU wire, destroying my HDD and case components

    A fire started as a result of PSU wire, destroying my HDD and case components. Then, the smoke started filling my room, finally burning through most of the computer parts. I remember being shocked and excited about the event. Meanwhile, convinced that it could have resulted from a poorly sleeved wire. Already, I’m thinking that I will be throwing out my StrikeX (AeroCool) computer tower chassis. Now, who wouldn’t be upset? However, would you see an opportunity?

    Looking at a new Switch 810 computer case

    After some time, I started looking at a new Switch 810 computer case. Thus, I started looking online for assistance. After some time, I discovered overclock.net, a “Performance Computing Enthusiast Forum.” While absorbing everything like a sponge, I managed to create a shopping list on the forum. To sum up, I was Impressed. The community is friendly and eager to help me finish building my computer.

    Closing thoughts

    Meanwhile, I needed the chassis to support water-cooled components. Thus, I was worried about mounting my RX360 radiator because it’s thickness might not fit into the new frame. I plan to install it on the top. However, everything worked out. Though the computer case takes up a lot of space, and I’d prefer to use an in desk PC.

    Thank you for reading, if my writing helped you or you enjoyed the piece feel free to leave a comment below.

  • PC Fire started unexpectedly

    PC Fire started unexpectedly

    PC Fire started unexpectedly

    PC fire started as a result of PSU wire, destroying my HDD and case components. I was told it could have resulted from a sleeved wire, but I don’t believe that to be the case. I’m pretty upset and I have to buy new parts. My whole room was filled with smoke when the fire started.

    I’m not sure what to do, I need to replace my full tower case and other parts. I’m looking at the Switch 810, but I’m worried about mounting my RX360 Rad, it’s thickness will give me a lot of trouble near the drive bay.

    Not sure how I will mount EX Vertical Res, but the Switch 810 is a pretty big case.

    Anyone have any suggestions? This is going to be hard because I’m going to be moving from my StrikeX (AeroCool).

    HDD IO Damage
    HDD IO Damage

    Outer Case Damage
    Outer Case Damage

    HDD and Tray Damage
    HDD and Tray Damage

    CD ROM Burned
    CD ROM Burned

    Sata burned wires
    Sata Power and Trey Burned

    External Dock burned
    Upper Panel

     

  • Art Blog: What is the Best Platform?

    Art Blog: What is the Best Platform?

    Welcome, Masters, today, I want to tell you why I chose WordPress as the best art blog platform. You know the saying, “The journey is what counts and not the result.” What the heck does that even mean!? In other words, I want to guide you from an artistic point of view of my adventure through a few different content platforms. For example, it’s easy to share my artwork because I don’t need to code, what’s more, the importance of not spending time setting up the environment. In the end, I will share a link where you can get started on your blog.

    Journey Begins with a Scroll!

    The Journey to the Best Blogging Platform

    Before the end, you know about the countless sleepless nights spent on tinkering with new ideas or tools? Before I arrived at the best art blog platform, I had to journey through the following programs. For example, I used Azure or GoDaddy hosting with Umbraco or BetterCMS. After tinkering with these applications, I discovered that they take all my attention away from my primary goal. For instance, I spent several nights setting up the platform instead of drawing and writing. As can be seen, I decided that the content is more important then what goes on in the background.

    Tiger Art

    Earlier I spoke about the artwork that I would love to focus my attention. Today, I want to feature an image of a tiger. As a challenge, I would like you to describe a few attributes associated with that image. Then, try to list large and small things you see hidden in the image. My goal is to get you to see why I believe the image is a good fit for my art blog.

    Final thoughts

    Finally, thank you for reading art blog, if my writing helped you or you enjoyed the piece feel free to leave a comment below. As promised, here is the link to get started on your blog.