Showing posts with label how. Show all posts
Showing posts with label how. Show all posts

Wednesday, December 14, 2016

How you can Choose A Good Adware Blocker

          

The modern world lives on computers, which became an indispensable element of our society and everyday life. However viruses, spyware and adware often inflict irreparable damage to computers not only by erasing valuable data system but also by the crash of hard disk in some cases.

Adware is actually a software that displays advertisements in the form of pop ups, banners, pop-unders and promotional materials often with adult content. Some of these are extremely harmful adware as is often rummage through your browser that hinder the activity of your privacy to a large extent and cause more harm than just taking you to certain websites. Adware gathers information on websites youve visited, and slows your computer as a shipping line can become frustrating. They may even change the settings on your computer. A adware blocker can stop this situation.

Some of adware are so powerful that they often have control of your browser. May They even send you to another Web page without your permission of course. Often, adware add toolbars in the browser window you unintentionally. They use cookies to track your personal habits and sometimes even personal data such as credit card numbers, social security number, name and address and a host of other things.

Adware is blocking software that blocks adware jeopardize your privacy. There are different types of software blocking adware is available on the market. But when installing an adware blocker, you need to know to be appropriate for you. There are different magazines, websites and also experts who can give you information on apt the myriad types of adware blocking programs that can be purchased to protect your PC against the code of this vicious circle.

After acquiring a good adware blocker you must ensure that the software is updated regularly. Because blocking a adware fails to perform effectively if it is not updated on a regular basis. So get a adware blocker that you know will deliver results for you, and keep updating, and you can be sure that your computer is secure.
Read More..

Wednesday, November 9, 2016

How To Increase PC Speed


There are many ways you can increase the performance and make your computer runs faster. I used to come across a website which has around 100 ways to make a computer runs faster. Here’re 2 of the best programs I’ve found that is able to increase the speed of your website:


  1. PC Speed Doctor
  2. Overclock Your CPU


Instead of going through each of them, I’m going to share only the best ways to speed up computer. These methods are very easy to do and you can see a big difference after you have applied them.

Most of these methods can be categorized into: Looking Ugly, Cleaning Up and Overclocking. Looking ugly are techniques that reduces the visual effect of your windows. Instead of looking nice and cool, these techniques remove these effects and make your computer runs faster. Cleaning up is about removing files and programs that are slowing down your pc. Last but not least, overclocking is like hacking your own hardware such as processor and graphic cards to make them run faster.

You can start with the following tips!

Read More..

Monday, October 31, 2016

How To Increase Speed Of PC In 5 Minutes


If you want your PC to work faster right now, here’re 5 simple steps you can do to increase the performance of your PC. By applying these steps, your computer can start running faster right now:

Step 1: Remove visual effects

This is a step where you could remove all the fancy effects that make your windows look nice. These effects include fading, shadows and other animations. This step is similar to Windows XP, Vista and 7. The steps are:

Go to your Desktop
Right click "My Computer"
Left click "Properties"
Click on the "Advanced" tab
Under "Performance", click on "Settings"
Under the "Visual Effects" tab, click on "Adjust for best performance"
Click "Apply" and you’re done.


Now, you lose the fancy visual effects but your computer is able to run much faster. By removing all these effects, you will see a significant increase in speed.

Step 2: Use disk cleaner

Disk Cleaner is a free tool provided with Microsoft Windows. It is able to help you clear up to 2GB to 3 GB on your hard disk and speed it up.

"What does deleting temporary files have to do with speed up your computer?" you may ask.

Imagine you have a very messy room full of stuffs, do you think finding something that you want takes time. That is the same to every computer as well. When your computer helps you to store temporary files, they are basically stored in an unorganized way and mixed with important stuffs.

By throwing 10% of the garbage in your messy room, you can find the things you want much faster. That is the same for your computer as well. These are the steps to clean up your PC:

Click on the "Start Menu"
Select "All Programs"
Select "Accessories"
Select "System Tools"
Click on "Disk Cleanup"
Choose your drive that you want to clean (Hard Disk, normally C Drive)

Once you click on "Disk cleanup", the program will start calculating how much space you could free from cleaning some old stuffs. After few minutes of calculating, you will be able to see a list of stuffs you can delete. Check those that are unimportant and delete.

Step 3: Change display settings 

This is very similar to visual effects. Instead of using fancy and colorful backgrounds that waste lots of time and PC power to load, remove them to the basic will speed up your computer. The steps are:

Right click your "Desktop"
Left click "Properties"
Under "Themes" tab, click on the drop down menu and choose "Windows Classic"
Under "Desktop" tab, choose "None" for background.
Under "Appearance" tab, click on the drop down menu below "Windows and buttons".  Choose Windows Classic Style.
Under "Appearance" tab again, click on "Effects…" button, try to uncheck all of them and click "Ok".
Under "Settings" tab, click on the drop down menu below "Color Quality" and choose "16 Bit".
Finally, click on "Apply" and you’re done.

Step 4: Clear hidden Windows errors 

Around 90% of SLOW computers are cause by hidden Windows error. That’s one of the main reasons why your computer starts to slow down after using it for months. Unfortunately, cleaning this error manually is simply too technical. To clean these errors effectively, you can use the help with a program automatically called PC Speed Doctor.

Step 5: Overclocking

Overclocking is a nasty way of improving the performance of your hardware. I don’t recommend you this step if you are using a new PC. This technique is able to boost the performance of your processor and force your computer to run faster. On the other hand, it will generate more heat. Overclocking is quite technical as well. I highly recommend you to learn from an ebook called Overclock Your CPU. The author is able to increase the performance of a processor from 1.9GHz to 3.5Ghz and has helped many people to do so.

Read More..

Friday, July 15, 2016

How does Computer Science fit with No Screens Week


You know how we all have that one Facebook friend, the one that is all granolier than thou about everything? I recently got into one of those discussions about kids and screens.

No screen week is April 29 - May 5 this year.

We are not a big TV family. I spent a good chunk of my childhood in Germany where we had one channel that showed American soap operas, but totally out of order. So TV was never a big thing for me. I just dont like the passive consumption of that much media, especially for small kids.

We currently do not have cable, and the kids watch in short spurts using Netflix. So we usually celebrate no-screens week at our house by turning of Netflix for a week and spending a few more minutes outside with the chickens.

Some things have changes in the last year. My girls are now 10 and 12. They have Kindle Fires and my oldest saved up this fall to buy her own Chromebook this fall. Technically these are all screens...so what to do?

After much discussion we have decided to draw a line between consuming and creating with technology. No Goodluck Charlie or Webkins, but CodeAcademy is OK. For us the kids are outside running around plenty, so more fresh air really isnt the point.

But is does make me think about the role of computer science in our relationships with screens. For too many kids in our country their entire relationship with screens is a passive one. Really, that is the magic of computer science. Like any art, it takes you from being a consumer of a product and puts you on stage as a creator.

And really, that is the point. With computer science, the screen becomes a tool for expression. There is a huge power in that.

Read More..

Wednesday, June 15, 2016

How to Choose a Good Computer




Keyboard computer is a very important part of the system. It allows you to communicate with the computer. In the absence of a computer keyboard, computer, even with the best configuration is also equivalent to a useless piece of metal.

If you use the computer for everyday normal word processor or email reading, then keyboard is sufficient and it is advisable to obtain the cheapest around. However, if you use it for gambling but when you spend hours to beat on this subject, it is worthwhile to spend a little time and effort to finding the best keyboard around.

Most keyboards use PS2 connection. Some of the latest model uses USB 2.0. Even if it does not make much difference, using a keyboard PS2 can release your USB2.0 slot for other devices. If you always go around your keyboard, then the wireless keyboard might be appropriate for you.

Keyboards computers come in various shapes and sizes. Choose the one that best suits your needs. Keys was ergonomically designed to bring comfort to the user. They come with the natural alignment wrist rest for your wrist in a more comfortable position. If you are a computer user, you can consider making an ergonomic keyboard.

For Thursday Indeed, it is advisable to get a game pad. That observation is the in-game control buttons and programming. A good game such as the keyboard Logitech G15 Gaming Keyboard gives you much control over the execution of games. It has 18 keys keyboard programming and also comes with an LCD screen to give you a clearer idea of the game information.

Zboard Gaming Keyboard is also another good Gaming Keyboard comes with an additional set keys to the first person shooting and action games. The different function keys can also be used to program different commands in a button. Its ease of use allows players to get used to it in a very short time.

Frequent multimedia user can also benefit from different types of multimedia keyboard available on the market. These keyboards have extra shortcut keys to give you full control of your favorite media player or video. Logitech Media Keyboard is a set of multimedia shortcut keys that gives you convenient access to all your favorite player. I am quite surprised that a keyboard with such functions is as cheap as a simple keyboard.

The choice of a computer keyboard is actually a very fun thing. Take your time to review the various keyboards and youll be able to find the most appropriate for you in no time.
Read More..

Saturday, April 30, 2016

How to Teach the Internet Dont

Today my Computer Science Principles classes are starting Unit 2: The Internet Unplugged.

So rather than a terrible exciting lecture on the structure of the Internet - translation "Heres what I think you should care about" - we started with questions.

Telegraph Lines


They were asked to write their own definition of the Internet, and share at least three questions they have about it.

Really, we all use it daily, so we should all have our own working understanding of what it is. By starting with their understanding I can see where we need to add information and what the emphasis should be.

The questions help me plan our activities. By the end of the chapter I want them to understand that the Internet is a physical thing, and be able to describe how it works. I want them understanding how content is posted and to discuss the implications ethically of its content. I want them to know a little HTML and CSS and have the confidence to look up what they need.

But first, I want them thinking.

Questions they asked:
  • How is it possible that the internet can be censored in some countries?
  • Who owns the internet?
  • Who made the internet?
  • How does it actually work?
  • Why was it originally created?
  • When did personal computers have access to it?
  • Who owns data on the internet?
  • Why is internet copyright so important?
  • How hard is it to break the internet?
Right now some of my favorites are Who owns the internet? and  How is it possible that the internet can be censored in some countries? 

Frankly we could start by investigating those two things and cover everything we need to know.

Bookshelf:

  • Tubes by Andrew Blum
    • Story of how theInternet is constructed - I summarized it here
  • As We May Think by Dr. Vannevar Bush
    • Originally published in 1945 this is the first description of linked text - "Thus he builds a trail of his interest through the maze of materials available to him." Really, read section 7 if you are short on time.
  • Blown to Bits by Hal Abelson (also available free here)
    • Good reading for students, especially the appendix
  • Stuck in the Shallow End by Jane Margolis
    • Also read this by Jane - great food for thought in this era of "tech fixes everything"
Some Lessons Well do:
  • Cups and Strings
  • Mapping the Internet
  • Underwater Cables
  • Why do HTML
Read More..

Monday, April 25, 2016

Binary Flippy Do How To

Today in AP Computer Science Principles we made the Analog Binary Calculator. We have been working up towards binary. I do not start them with the big explanation of This Is Binary.

Instead I do a series of puzzles as warm ups and exit tickets for the week or so before the actual lesson. That way by the time we get to full scale binary they have had some positive experiences and built their own understanding of how binary works.

(Why do I even do Binary? Here you go)

So for example I show them a picture of two light switches and point out they can either be on or off. Working with a partner they have to figure out how many numbers they can store using the light switches. What if we add a third switch, how many then? Without listing all the combinations can you predict how many numbers you could represent with 4 switches? This makes a great warm up activity.

The great thing about the flippy do is it is super easy to translate numbers back and forth. My stronger math kids pick up the number theory behind it quickly, while my weaker math students are successful so they will stick with it rather than tuning out.

If you also cover the full twos comp representation it is also an incredibly easy way to teach the steps.



Materials:
  • Index cards - 4x6 or larger
  • Markers
  • Scissors 
  • Rulers - helpful, but not necessary


Steps:

First you fold up the bottom 1/4, draw 8 columns, and cut the bottom flippy things like this:

Can you tell this is my white board?

Second, you label the powers of two. Then put 1s on the back of the flaps and zeros underneath as shown:



Then I have them do a few puzzles:
  • How may ways can you represent 13? 3? 15?
  • Count from 0 to 13. Any pattern with even/odd numbers?
  • What is the largest number this can store?
  • What is 01111111? 00111111? 00011111? - what is the pattern here?
The point here is, if I just tell them that there is only one way to make any base ten number in binary it goes in one ear and out the other. Snore.

If instead they are doing a puzzle, and after a few realize THEMSELVES that there is only one combo per number, they internalize that at a different level. They dont forget it.


After all this we do the algorithm to change from binary to base ten and back. The best part is when the kid in the back, the one that hates math, tells their neighbor "Hey, I actually get this".
Read More..

Saturday, April 2, 2016

How Do I Overclock My CPU


Overclocking could be both exciting and dangerous. The exciting thing about overclocking is that you could improve the computer’s performance up to 50%. This includes your processors, graphic cards and RAM. The dangerous part of overclocking is that it might damage your hardware permanently if you are not careful.

To learn how to overclock effectively and safely, I highly recommend you to download Overclock Your CPU.



Overclocking is basically like forcing your computer to work faster. Instead of walking, you are asking them to run. If you are careless in monitoring the heat, you might toast your hardware. Fortunately, there are programs that are able to monitor the heat and alert you if they are overheated. Some programs might automatically shut down your PC.

Personally, I have never done overclocking because I treat them as babies. Before you start, you should make sure you have good cooling hardware and heat monitoring programs for your computer.

So, how do I overclock my cpu?

Most overclocking works are done on BIOS. Before your computer reaches Window, you need to access the BIOS and configure the settings for your CPU, RAM and Graphic Cards.

Here’re 2 important tips while you overclock your CPU:

Don’t increase your performance 50% suddenly. It is dangerous to do so. Increase 10% and slowly move up.

Always search for opinions and reviews from people who had overclock their CPU and hardware on forums or search engines.

Click Here To Learn How To Overclock From The Professional

Read More..

Saturday, March 19, 2016

How GIRLS Hold Themselves Back from Pursuing Computer Science

Full disclosure - this is a rant. If you are not in the mood, keep browsing.

First, the facts here are a-OK.

"Changing the World Starts with Changing your Perception". Quote from the bottom. I couldnt agree more.

I can only hope the rest of this was created innocently and the blame the victim tome in unintentional. Because really, it is the girls fault that they experience these misconceptions?

So a little back story, I was one of these girls. I had programmed as a hobby for 5 years by the time our AP Computer Science teacher showed up to recruit in my precalc class. In fact I was probably one of the only kids in my school that had programmed at all - it was the early 90s and my coding was definitely odd.

So why didnt I sign up? Honestly it wasnt any of what is listed below. I was a smart kit, a nerd. I went on to major in math in college - a predominantly male field. I had professors that openly said that girls didnt understand math, and yet I stayed, because I am rather stubborn like that.

I remember sitting there thinking - theres a class about this? Cool. Then he said the magic words "if you are good at math then youll be good at this".

And that did it, I was out. At 17 I didnt see myself as good at math, even though my 99% was one of the highest grades in the class. I studied hard, did my homework, therefore I had a high grade. It wasnt innate ability, I just worked hard.

And this perception wasnt my fault. Just like the stereotypes in this infographic are not the fault of the girls who internalize them.

And in full fairness it was in no way the fault of the CS teacher. I had him in AP Calculus the following year and he is a large part of my confidence in overcoming these stereotypes and becoming a math major in college. He was just doing what we did back then. I did it too when I started teaching cs, good at math = good at programming. We didnt know better.

The saddest part is that I am not the only girl I know with a story like this. I have sent girls off to college, recently even, to hear them have the same experiences in their computer science courses. To be the one girl sitting in an auditorium and have a professor turn around and say to the group "Dont worry, girls never get this" is inexcusable.

So, how can you really help? Lets start by not blaming the girls.

  How Girls Hold Themselves Back from Pursuing Computer Science [INFOGRAPHIC]
This infographic by Play-i. Play-i is creating a programmable robot that teaches computer science to kids ages 5+ in a fun, accessible way. To get updates, sign up here.
Read More..

Tuesday, February 23, 2016

How To Run Php In Your System

Normally we cannot run php program in our system,becoz php is client and server program.
So we need a server to run the php program,becoz server can evaluate the php program code...
To availl server you need to install for that click here to download server for 32 bit os. and click here to download server for 64 bit os.

FILE SIZE:19MB

After you downloaded just install like normall exe file...after completing installation...
Just type localhost in your browser...if its says It work or wampp splash page...
your installation is sucessfull....

Now to run php program or check php program working or not,
open notepad type   <? phpinfo() ?>   and save it as arunji.php.
then paste this file in c:wampphtdocs....

then open browser type   localhost/arunji.php
then it will show php information....now your ready run ur system as server......
Read More..

Tuesday, July 29, 2014

Object Data getting it and using it how

DO you ever have the need to count the objects in a file or drawing? The “old school” method was to take a print, different colored markers, and physically count each item. Then you would create a chart, or table. This is one way to create a bill of material, or a quantities sheet, or an assets tracking form, what ever you call it. Well, we use AutoCAD to help us out for many reasons, one to draw quicker, revise drawings quicker, and to count items faster too.

DATAEXTRACTION is a command that will automatically count the objects in a file and list them in a table. That list is linked to the objects so that if they change, the table is updated. How cool is that?

How do I start? Well, open your data file. In my case it is a site plan of a small parcel with about 11 residential single-family home lots on it. But yours could be anything that has stuff in it to count. I want to know how many lineal feet of water main pipe, sewer main pipe, and drainage pipe I have. I could dimension each one, or measure each one, and add up the totals, then create a table and input that data into it. Sure, if I had the time.

Enter in DATAEXTRACTION. I am asked if I want to create a new data extraction, edit an existing one, or use a previous extraction as a template. I would normally use one as a template, but I want to show you how to set one up. I pick Create a new one. Then click next. A file name and location are required for this data extraction. The data is counted and stored in this file. When the objects change, the data file can be updated, which will update the table we are about to produce. I name my file and click save.

Now I have to tell AutoCAD what data I want to count. There are two options: Drawing/Sheet set, or Select Objects in the current drawing.

This means that I can select everything in an entire sheet set (holy abacus batman!!) or just pick certain objects in the current file. Pick the one that suits your current needs. I only want to pick from objects in the current file. I find that this fits the majority of my needs, most of the time. I select the button for this and then click on the button that allows me to go into the drawing and actually pick my objects. Ok, then I pick my objects.

I select my objects and press the Enter key. There is a SETTINGS button at the bottom right of this dialog box. I click it. I can then alter some of my extraction settings. These settings allow me to choose if my extracted objects will include objects from an xrefed file or not. I choose not in this case, but pick what ever it is you need to do. I also have the choice of picking only from model space, or from the entire file. I am done with my settings so I click the OK button. I am done with this part so I click the next button.

A list of the object types selected (in my case lines and polylines) is displayed. I can choose to include or exclude any object type from my list at this point. There is also a display options area where I can choose if all object types are displayed according to their block settings (attributed blocks, non-attributed blocks, in use or not.) I am done here so I click the next button.

A list every possible object property is given and I have to choose which ones I want to have in my table. Some of these options are: angle, area, author, closed, color, delta x, delta y, drawing revision, file size, file name, linetype, LT scale, material, thickness, title, layer, and much much more. There is a category filter that will help select and un-select these options. I choose to display the length and the layer because I want to know how much pipe I have of what type. I am done so I once again click the next button.

Now I have a preview of the general setup of my table. There area some options on controlling the rows and columns. I can tell it to combine similar objects, or to separate them for each one. Very handy. I also have the options here to sort the columns how I want them and to link external data to them. There is a full preview button so you can check to see if you got it all right or not. Ii looks good so I click next.

Now I can insert this data into a table in my file, or I can output the data to an external file (.csv, .xls, .mdb, or .txt) I just want to put it in the drawing this time. But I often find that I need this data somewhere else so many times I will export it to an .xls file or a .csv file. This is very useful indeed. I am ready to proceed so I click next.

Now I can change my table settings or use a table template that I already have. I’ll do that and then click on next. One more click. I have to finish by clicking the FINSH button. Good idea there. If I chose for an external file to be created it will be when I click finish. If I chose to insert a table I will have to pick an insertion point after I click finish. Which is what I do. There you go, a nice neat table that is displaying my pipe types (by layer names but you can do this in many different ways) and their lengths.

Since this table is linked to the objects, (my pipes) I can change the length of my pipes. Select the table, right click and select the UPDATE TABLE DATA option to update my table. I don’t have to redo it.

I used this on lines and polylines, but it can be used for blocks too, which can be very useful. If you need to count it, this command can count it.

Experiment with the settings and create a template. Once you get it set up why set it up again right?

Happy CADDING.


 Subscribe in a reader

Read More..

Thursday, July 17, 2014

How To Get The Best Excel Consulting Services

By Alyce Powell


You need a professional in excel consulting San Francisco. You know you are going to need to find the right professional for the job. So, it dies help that you know what things to look into in order for you to find one who can really help you out right his time.

There are factors to consider if you want to make sure that you will be able to choose right this time. Its always very helpful that you have a good notion of the things you have to look into so you can choose right find out ways on how you can locate the right people and the right professionals for this particular need. Then, maximizing their presence would be easier for you to do.

Know the specific reasons why you need to secure his assistance. Know what are the different needs of the firm that will surely merit upon the entrance of such a provider into the picture. You will find that it is easier for you to choose right when you have an idea of things that are currently driving you and motivating you towards hiring the right people.

Know what are your goals. Set your expectations ahead of time you have to know what are the things that you are aiming for this time. It is always easier for you to choose right and opt for the most appropriate option there is when you have a good idea of the things that you expect to achieve while securing the services of this particular professional.

Take note of at least three possible providers that you can then refer to. You would not want to get the first professional that youll find along. Rather, youd want to take the time to know what it is that they can offer first and compare them before you make a final decision later on. So, make sure that you will use this very chance to take note of at least three possible names that you can refer to.

Determine the credentials they possess. As a firm that will be relying on their consultancy services for the next big decisions that you are going to be making, it makes sense that you get to see proof first that indeed, these are people that you can rely on. So, check what papers they have and ensure that these are valid credentials. Thus, you know you can rely on them this time.

See to it that youre looking at experienced professionals too. You need to find providers who have the most exposure in the field. It is always very helpful that you have a good idea of the number of years they have been doing these consultancy services so you know that you can really rely on them to actually know whatever it is that they have to do when the time comes for them to extend their services to you.

Know what these professionals in excel consulting San Francisco can really bring to your table. You need to find the right people. You need to find those that can really offer something out of whatever it is that you can spend in hiring them and securing their services around. Thus, you are confident that paying for whatever services they can extend is really worth it all at the end of the day.




About the Author:



Read More..

Thursday, July 10, 2014

Laptop computer Learn how to repair Ergoguys EG ErgoArm Ergonomic Adjustable Computer Arm Rest with Mouse Pad

Ways to solve Ergoguys EG-ErgoArm Ergonomic Adjustable Computer Arm Rest with Mouse Pad Special

Reviews: Ergoguys EG-ErgoArm Ergonomic Adjustable Computer Arm Rest with Mouse Pad

Ergoguys EG-ErgoArm Ergonomic Adjustable Computer Arm Rest with Mouse Pad

Ergoguys EG-ErgoArm Ergonomic Adjustable Computer Arm Rest with Mouse Pad Special offer

The Arm-Stand computer armrest is ergonomically designed to reduce aches and pains such as Carpal Tunnel Syndrome in the wrist, arm, shoulder and neck areas cause by long-term use of computer and other repetitive movements. Each of the Arm-Stand can support up to 11kgs(or 24lbs) of weight effectively relieving 90% of the weight undertaken by your wrists. With its unique design, you can now move freely, comfortably and effortlessly to perform your computer tasks.

Read more »
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..

Tuesday, May 27, 2014

How to Avoid Double Clicking With jQuery


Introduction

  • There has been always troubling issue regarding user interaction,when the user Double Clicks the DOM elements.Such as buttons,links etc. 
  • Fortunately, jQuery has an awesome solution for this
  • That is .one() method

What does .one Method Do ?

  • It attaches a handler to an event for the elements and that handler is executed at most once per element

Theory

.one( events [, selector ] [, data ], handler(eventObject) )

events
Type: String
  • One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin"

selector
Type: String
  • A selector string to filter the descendants of the selected elements that trigger the event
  • If the selector is null or omitted, the event is always triggered when it reaches the selected element

data
Type: Anything
  • Data to be passed to the handler in event.data when an event is triggered

handler(eventObject)
Type: Function()
  • A function to execute when the event is triggered
  • The value false is also allowed as a shorthand for a function that simply does return false

Example

$("#saveBttn").one("click", function () {
    alert("This will be displayed only once.");
});

OR

$("body").one("click", "#saveBttn", function () {
    alert("This displays if #saveBttn is the first thing clicked in the body.");
});


Key points of the above code :
  • After the code is executed, a click on the element with Id saveBttn will display the alert
  • Subsequent clicks will do nothing
  • This is equivalent to ==>

$("#saveBttn").on("click", function (event) {
    alert("This will be displayed only once.");
    $(this).off(event);
});

In other words
  • explicitly calling .off() from within a regularly-bound handler has exactly the same effect

Do You Need to Know More ?

jQuery .one()


Conclusion

  • Above mentioned method works since jQuery Version 1.7
  • So if your elements click event fires more than once then this may be the solution
  • Enjoy this awesome method and let me know If you have any issues 

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

If you feel it was a good article,Give me a +1.Thank You.





You Might Also Like

Read More..

Friday, May 23, 2014

Home computer How to Cisco Replacement Power Kit

Learn how to Cisco Replacement Power Kit on sale

Scores: Cisco Replacement Power Kit

Cisco Replacement Power Kit

Cisco Replacement Power Kit available

Manufacturer: Cisco Systems, Inc. Each. The CP-7936-PWR-KIT= is a replacement power kit. It includes power cube, PIM, and cables. This power kit also fits the Cisco IP Conference Station 7935. Product Type: Power adapter Designed For: IP Conference Station 7935, 7936; Unified IP Conference Station 7936 Customers also search for: Discount Power Adapter, Buy Power Adapter, Wholesale Power Adapter, 0746320897745, CP-7936-PWR-KIT=, Specialty Adapters

Read more »
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..