Thursday, January 24, 2019

Ensure that you write code to handle all types of error conditions

Here’s the bottom line when it comes to working with errors.

  • Always expect that errors can occur in a program.
  • Ensure that you write code to handle all types of error conditions.


30. Logging in Programs

One of the most important concept in programming, is logging of what is happening in the program. Logging helps one to understand how the program is behaving and whether it’s performing as per its requirements. In the previous section, we looked at error handling in programs. In order to ensure that these errors are recorded somewhere, we need to have a facility to log the errors. Programming languages provide a few different methods that enable us to log data. We’ll look at some of them next.

30.1 Debugging During Development

Some programming languages, such as C#, provide classes that can be used to write debug statements to the console of the Integrated Development Environment as the program runs. This helps give the developer a good insight as to how the program is running. Values, and how they flow in the program, can be seen via these debug statements. For example, the following snippet of code shows how to write a debug statement that outputs to the output window in Visual Studio.

first specify the name of your macro

Type your name and hit enter

Macro Name: It is important that you assign a name to your macro because Excel will give it a default name otherwise. The macro name should describe what it is going to perform.

Shortcut Key: Each macro must have an event that will take place for it to run. This event can include a press of a button or the opening of a Workbook. Once you assign the shortcut key to the macro and you press the key combinations, Excel Macro will start. Note, though, that this field is optional.

Store Macro In: A macro that is stored here means that it has an active Excel file. Therefore, if you open a specific Workbook, you can run the macro.

Description: This field is optional, but it can still be very useful when you have multiple macros in the spreadsheet. In addition, this field allows you to describe the macro to the user in greater detail.

Once the Record Macro dialog box shows up, the steps below will help you create a macro you can use to enter your name into a Worksheet.

  1. First, specify the name of your macro. Don’t go with the default name.
  2. Next, allocate a unique shortcut key, such as Ctrl+Shift+N, to the macro.
  3. Select OK and exit the dialog box before you start recording.
  4. Click any cell in the Worksheet. Type your name and hit enter.
  5. Finally, select Developer—>Code—>Stop Recording.

THE CAR CLASS INHERITS BOTH VEHICLE AND SEDAN CLASS

class Vehicle:

def showVehicleDetails (self):

print("I am vehicle class")

class Sedan:

def showSedanDetails (self):

print("I am sedan class")

#Create Class Car that inherits Vehicle and Sedan

class Car(Vehicle,Sedan):

def showCarDetails (self):

print("I am car class")

#Create object of car Class

car = Car()

#Access Vehicle class method

car.showVehicleDetails()

#Access Sedan class method

car.showSedanDetails()

#Access child class method

car.showCarDetails()

In the script above we have three classes Vehicle, Sedan and Car. The Car class inherits both Vehicle and Sedan class. We then create the object of the Car class and access the Vehicle and Sedan class methods from the car class object. The example shows that a child class that inherits multiple parents has access to all the attributes and methods of all the parent classes. The output of the above example looks like this:

Method Overriding

In addition to having access to parent class methods, a child class can also override parent class method by providing its own definition for the same method name. Take a look at the following example to understand this concept:

#Create Person Class

class Employee:

def printdetails (self):

print("I am an employee of this company")

#Create Class Manager that inherits Employee

class Manager(Employee):

def printdetails (self):

Friday, December 21, 2018

CALENDAR TELLS WINDOWS WHAT APPS CAN ACCESS YOUR CALENDAR

Gaming

  • Game bar – Lets you record videos and screenshots while playing your favorite video games.
  • Game DVR – Determines where your videos and screenshots are saved.

Ease of Access

  • Narrator – Reads the text on the screen out loud through your computer speakers.
  • Magnifier – Lets you zoom in on sections of the screen to see things better.
  • Color & high contrast – Provides color filters to let you see your screen more clearly.
  • Keyboard – Provides various options to make using the keyboard easier such as having single key keyboard shortcuts.
  • Mouse - Provides various options to make using the mouse easier such as changing the pointer size and color.

Cortana

  • Talk to Cortana – If you have a microphone or are running Windows 10 on a tablet, you can say “Hey Cortana” to have it respond to your voice.
  • Permissions & history – Determine what Cortana knows about you and retains in her history.

Privacy

  • General – Here you can change privacy options such as what Windows tracks about your activity, as well as advertising options.
  • Location – Tells Windows where you are located to help with content that is presented to you.
  • Camera – Tells Windows what programs or apps can access your camera (if you have one).
  • Microphone – Tells Windows what programs or apps can access your microphone (if you have one).
  • Account info – Determines if Windows can use your name, picture, and other account information with applications.
  • Contacts – Tells Windows what apps can access your contacts.
  • Calendar – Tells Windows what apps can access your calendar.
  • Email – Lets you decide which apps can access and send emails on your behalf.

GANTT CHARTS ARE ONLY GOOD FOR SMALL PROJECTS

Gantt charts are only good for small projects

The Gantt chart helps you to schedule your project. Gantt charts are good for showing the project dependencies, the start and stop times for project tasks, and it provides a frame which can help anyone in the project for visualization. It helps one to easily calculate the critical path. Gantt charts are only good for small projects.

In the case of more complex projects, one can use the PERT chart, commonly known as the network diagram. This can be used for projects which are complex and it will show the relationships between the project activities. Rather than visualizing the whole of the project, it can help you to visualize part of it.

A histogram is also another chart which is popular in project management. It works well to help the project team improve the quality of their work by relying on historical data. You then have to choose the processes which you will improve. It can help you know where a problem which occurs more frequently is coming from.

Dashboard/status report

Communication between the teams which are involved in development of the project is very essential. There should be effective communication among the member of the project team, the sponsor, and the stakeholders. A project status report or dashboard is an effective and efficient way for you to express the status of your project at any time. There are a number of software programs which can allow you to create this report. A good example of this is Microsoft Excel.

AFTER ALL BAD TRAFFIC IS SOMETHING THAT ALL OF US CAN RELATE TO

The concept of anchoring has its origins in the study of Neuro-Linguistic Programming (NLP). NLP is an approach to communication by linking neurological processes, language and behavioral patterns through “programming.” What does that mean? Well, the concept of NLP is that it can be used in casual conversation to subliminally condition the mind, yours or others. As an aside, the concept is somewhat controversial in terms of validity. Some people think it’s pure hogwash. Some people consider it evil mind control while others claim that it’s useful for personal enrichment purposes. Personally I believe it works, but I’m a firm moderate on the subject. I’ve seen its effects firsthand, but I personally don’t believe all the hype. But I digress.

Anchoring is essentially all about association of statements while using some sort of physical gesture to do so. That is to say, language is used to associate two or more statements and gestures are the medium to link them together. The underlying objective is persuasive in nature. In other words, the purpose of anchoring is to subconsciously persuade the target toward one way of thinking.

Though the concept of anchoring might sound somewhat cryptic, it is actually used fairly significantly outside of social engineering. In fact, some sales people use anchoring as a sales tactic. For example, let’s assume a situation where a target and a sales person are sitting across from one another at table. During casual conversation, the sales person may make a reference about how bad the traffic is in the city. This will generally generate some kind of agreeable response by the target. A head nod or otherwise. After all, bad traffic is something that all of us can relate to. This is step one in the anchoring setup. While describing the bad traffic, he puts his left hand on the table forming a roadblock hand gesture. The negative association has now been built. Now it needs to be reinforced two or more time during the course of the conversation and with similar associations.

Thursday, December 20, 2018

If Your Computer DoesnT Recognize It Try The Following Remedies

Figure 2: The Kindle Fire HD Shows up as Removable Disk G on this Windows 7 Computer

If you want to transfer your music or video collection to your Kindle manually, move any of the materials into the appropriate directory. As you’ll see in the next chapter, the Kindle Library will organize it for you so that it’s very easy to navigate.

If Your Device Isn’t Recognized

There is very little to go wrong with hooking your Kindle Fire HD up to a computer. If your computer doesn’t recognize it, try the following remedies.

  • Unplug the Kindle Fire HD and plug it back into the USB drive

  • Try a different USB port

  • Try rebooting the computer

If none of these measures work, you may want to email Amazon tech support about the issue.

If you have a USB 2.0 or USB 3.0 port, transferring files will go much more quickly if you use that port instead of a USB 1.0 port.

Chapter 3: Shopping on the Kindle Fire HD

The Kindle Fire HD makes it very easy to go shopping at Amazon. You can use the web browser to access the site in the usual way, but you can shop right from your library, as well.