Showing posts with label use. Show all posts
Showing posts with label use. Show all posts

Tuesday, November 1, 2016

Posters for Computer Science Careers that use Computer Science

These posters are from the Otronicon Science Center in Orlando, FL. Forget Harry Potter World, we are definitely putting that on the list for our next Florida trip. I am sure this kids wont mind.

Anyhoo, I am fascinated that a science museum has done such a thorough job of including computational thinking and computer science topics in their materials.



Anyway, the posters are free to print and use. They include writing, architecture, linguistics - some fields we dont traditionally associate with computer science.

Some of the other pages have some good resources too. The Medical Sim City page (tagged: See how simulation technology is being used to create better doctors, nurses and other medical professionals) looks like it has some interesting things to help cover the modeling and simulation info in the APCS Principles course, for example.
Read More..

Saturday, July 26, 2014

Use The Best Legal System Software

By Mia McCall


It is quite mesmerizing to see these days just how many computer packages are available for people to make use of. Irrespective of the business you are in or what you do on your private computer there are many programs that are very effective to make your life very easy. Should you have a law firm, it would be great to have legal system software that would eliminate a lot of unnecessarily manual work.

In years gone by, everything had to be done manually. This took a lot of time and many folk had to be employed to perform only small tasks. This meant that the work that had to be done took a long time and there was always place for human error.

The main objective when it comes to running any company is to have a few overheads as possible. One does not want to spend all your profits on staff and overheads. The fewer of these you have, the more money your business will be making.

Something to remember when it comes to this is that when you are dealing with manpower, there is always the possibility of human error. With computers, there is very little chance of this happening unless the computer is misinformed. This would also then be human error but is easy to fix and usually one adjustment will make an entire problem simply vanish.

Should you be looking to optimize your business, you may want to seriously consider getting in a few computers and some suitable programs to make your business flow without a problem. There are programs for absolutely any business and you only need to call in the experts to help you decide which one is best for your company.

Many programs come with instruction manuals but the best thing to do is to attend a few training sessions for hands-on training. This is usually a lot easier as this way you can get the instruction you need in a quicker way. The trainers that do this type of training are usually experts in the packages that they instruct and you would do well attending these in order to learn the full function of the package you want to implement in your business.

The great thing about this is that if you are the one that does the work, you will be able to be on top of things at all times. Even if you need to employ one more person in order to run the program, you would still only have one other person that will be responsible for helping you instead of many others who will know what is going on. Many folk do not like the idea of everyone knowing what is going on in the business but need them for the work that they do.

The fewer people in the business the easier it is to operate. Should you have a computer program that does most of the work, you would only need one or two folk to help you run the business smoothly. This eliminates the possibility of human error which is great as where there are many folk working on a project, there are many opportunities for things to go wrong. Should you have a legal company, you should seriously consider one of the new legal system software packages.




About the Author:



Read More..

Friday, July 4, 2014

How to Use ViewModel with ASP NET MVC


What is a Model ?

  • Parts of the application that implement the domain logic
  • also known as business logic
  • Domain logic handles the data that is passed between the database and the UI
  • For example, in an inventory system, the model keeps track of the items in storage and the logic to determine whether an item is in stock
  • In addition, the model would be the part of the application that updates the database,when an item is sold and shipped out of the warehouse
  • Often, the model also stores and retrieves model state in a database.

What is a ViewModel ?
  • Allow you to shape multiple entities from one or more data models or sources into a single object
  • Optimized for consumption and rendering by the view

It shows below image :


ViewModel

Why We Use ViewModel ?

1. If you need to pass more than one thing to a strongly-typed view (which is best practice),
    you will generally want to create a separate class to do so.

2. This allows you to validate your ViewModel differently than your domain model for
    attribute-based validation scenarios

3. Can be used to help shape and format data.
    e.g: need a date or money value formatted a particular way?
          ViewModel is the best place to do it.

4. The use of a ViewModel can make the interaction between model and view more simple

             ViewModel Interaction with Model and View :

ViewModel Interaction with Model and View


Where Should We Create ViewModel (physically) ?

1. In a folder called ViewModels that resides in the root of the project. (small applications)

ViewModels that resides in the root of the project

2. As a .dll referenced from the MVC project (any size applications)

3. In a separate project(s) as a service layer, for large applications that generate
    view/content specific data. (enterprise applications)

Best Practices When Using ViewModels

1. Put only data that youll render (use in View) in the ViewModel

2. The View should direct the properties of the ViewModel, this way it fits better for rendering
    and maintenance

3. Use a Mapper when ViewModels become Complex ( How to Use ValueInjecter ? )


Lets Try with Simple Example

        - C#,MVC 3 and Visual Studio 2010 has been used.
        - Please follow an Inline Comments on Code. 
        - Simple application with product category drop down list, product name text box
          and Save button   

Our Domain Models Look Like Below

 public class Product
    {
        public Product() { Id = Guid.NewGuid(); Created = DateTime.Now; }
        public Guid Id { get; set; }
        public string ProductName { get; set; }
        
        public virtual ProductCategory ProductCategory { get; set; }
    }

 public class ProductCategory
    {
        public int Id { get; set; }
        public string CategoryName { get; set; }

        public virtual ICollection<Product> Products { get; set; }
    }


Our ViewModel Looks Like Below

 public class ProductViewModel
    {
        public Guid Id { get; set; }

        [Required(ErrorMessage = "required")]
        public string ProductName { get; set; }
        
        public int SelectedValue { get; set; }
    
        public virtual ProductCategory ProductCategory { get; set; }

        [DisplayName("Product Category")]
        public virtual ICollection<ProductCategory> ProductCategories { get; set; }
    }

Our Controller Action Methods Look Like Below

        [HttpGet]
        public ActionResult AddProduct() //generate view with categories for enter product data
        {
            //for get product categories from database
            var prodcutCategories = Repository.GetAllProductCategories();

            //for initialize viewmodel
            var productViewModel = new ProductViewModel();
            
            //assign values for viewmodel
            productViewModel.ProductCategories = prodcutCategories;

            //send viewmodel into UI (View)
            return View("AddProduct", productViewModel);
        }

        [HttpPost]
        public ActionResult AddProduct(ProductViewModel productViewModel) //save entered data
        {
            //get product category for selected drop down list value
            var prodcutCategory = Repository.GetProductCategory(productViewModel.SelectedValue);
            
            //for get all product categories
       var prodcutCategories = Repository.GetAllProductCategories();

            //for fill the drop down list when validation fails 
             productViewModel.ProductCategories = prodcutCategories;

            //for initialize Product domain model
            var productObj = new Product
                                     {
                                         ProductName = productViewModel.ProductName,
                                         ProductCategory = prodcutCategory,
                                     };

            if (ModelState.IsValid) //check for any validation errors
            {
                //save recived data into database
                Repository.AddProduct(productObj);
                return RedirectToAction("AddProduct");
            }
            else
            {
                //when validation failed return viewmodel back to UI (View) 
                return View(productViewModel);
            }
        }

Our View Looks Like Below

Our View


AddProduct.cshtml

@model YourProject.ViewModels.ProductViewModel        //set your viewmodel here

 <div class="boxedForm">
  
@using (Html.BeginAbsoluteRouteForm("add", new { action = "AddProduct"},FormMethod.Post }))
         {
             <ul>
                     <li style="width: 370px">
                           @Html.LabelFor(m => m.ProductCategories)
   @Html.DropDownListFor(m => m.SelectedValue,new SelectList(Model.ProductCategories, "Id",
                                             "CategoryName"),"-Please select a category -")
                           @Html.ValidationMessageFor(m => m.ProductCategory.Id)
                    </li>
                    <li style="width: 370px">
                  @Html.CompleteEditorFor(m => m.ProductName, labelOverride: "Product Name")
                  @Html.ValidationMessageFor(m => m.ProductName) 
                    </li>
            </ul>
                    <div class="action">
                        <button class="actionButton" type="submit">
                            <span>Save</span></button>
                    </div>
         }
   </div>

Repository Methods by using the Entity Framework

--- GetProductCategory() ---

//for get product category
public ProductCategory GetProductCategory(int categoryId)
{
return (from productCategory in Catalog.ProductCategories
where (productCategory.Id == categoryId)
select productCategory).FirstOrDefault();
}

---GetAllProductCategories()---

//for get all product categories
public List<ProductCategory> GetAllProductCategories()
{
return (from productCategory in Catalog.ProductCategories
select productCategory)
.OrderBy(p => p.CategoryName)
.ToList();
}


Conclusion
  • ViewModels help you organize and manage data in MVC applications when you need to work with more complex data than the other objects allow.
  • Using ViewModels gives you the flexibility to use data as you see fit.
  • ViewModels are generally a more flexible way to access multiple data sources than domain models.
  • Even for simple scenarios always try to use ViewModel approach to maintain consistency in Your coding practices.

I hope this helps to You.Comments and feedback greatly appreciated.

Happy Coding.

Related Article

How to Use ValueInjecter with Asp.net MVC ViewModel ?
Read More..

Wednesday, May 21, 2014

How To Make Good Use Of Your IT Support Team

By Jason Whaley


In the early years of people using computers in the business environment the IT support was very limited. It usually comprised of a technician whose main task was to make sure that system backups were made. They would be located in a small room surrounded by broken computers and spare parts.

It was quite common in most companies for users to attempt to solve any problems themselves. This was usually quicker and easier than trying to get the attention of a team member to come and help them. Over time, this habit has changed. The introduction of networks, and server-based software, requires that the engineers supporting the system have to be specialists.

The complexity of these systems meant that the size of the team supporting them had to increase. As companies grew and the software systems they started to use needed to serve more functions, people with a variety of skills were required. However, as well as maintaining the new equipment, the legacy software still needed looking after.

The way that an IT support team operates has had to change to cope with the growth of multinational companies, all working in different time zones. The departments are normally open 24 hours a day throughout the week, especially if there is just one support team for the whole global network. This means that if a user wants to report a fault, it is typically done by raising a support ticket on the company intranet.

Some people question the value of working this way when the fault could just be on a single computer. However, this method is a good way to make sure that the correct person is tasked to deal with the problem. This means that they will have a better idea of the overall picture, and your report may help them prevent other users having the same problem in the future.

Taking what appears to be a simple e-mail problem as an example, many scenarios could be involved. It could be caused by a poor configuration on an individuals computer; a server might have a problem and needs to be taken off-line, or a number of users have reported the same fault and there is a problem with the software. Each of these scenarios would need investigating by a specialist.

Some businesses decide that their systems have become so complex, that instead of having an in-house team, they opt to use an external consultancy. These consultancies will use freelancers who are based locally to the company who is having the problem. Whether this is cost efficient is a matter for the business to decide on, however, you can be assured that the person who is tasked with the job has the precise experience required to solve that particular fault.

IT support has had to change a lot to keep pace with technology. It is unrecognizable from from its humble beginnings. It is looked upon in a different light by companies and their employees, and is no longer the butt of jokes. The engineers and technicians that work in these departments have to be highly skilled individuals, and up-to-date with the latest technologies.




About the Author:



Read More..