CS411 Notes in Short As Short Notes
CS411 Notes in Short As Short Notes
1). Commands are a more robust and loosely coupled version of:
• Events
5). For cut, copy and paste we can define and implement three classes mplementing
• icommand
11) TextBox is an example of Control with builtin command binding that responds to ctrl-z
etc.
1).WPF Window is a:
• win32 window
11). Properties Dictionary is a simple Dictionary used to share things among different
windows.
18). Modal Dialog are such windows that are necessary to terminate explicitly in order to
interact with main window.
19). In modeless Window we can work in parallel with main window just like using Tools
window in Photoshop.
20).Common Dialogs are actually provided by win32 and are part of Modal dialog.
21). Custom Dialogs are user-defined.
8). Page does everything that windows does except OnClosed and OnClosing.
9). Navigation can also happen between HTML files.
10). A page can interact with its Navigation Container by using NavigationService Class.
20).Navigation Window always has a journal but frame may depending on its
JournalOwnership = OwnsJournal, UseParenJournal, Automatic
21). When frame has journal it has back/frwd buttons but can set NavigationUiVisibility =
Hidden
3). Basic benefit of Silverlight is that it is cross-platform. But WPF browser based
applications just run on windows.
4). In Web Based applications the journal of Application and Web Browser are integrated.
12). To publish a web based application use VS publishing wizard or mage tool in SDK and
copy files to webserver which must be configured to serve it.
13). Users can install and run a web based application just by navigating to a URL.
17). Localization:
Localization means that your application can target more than one target languages or target
Grammers.
18). In Order to localize resources its necessary to make them embedded resources.
2). Logical Resources are arbitrary .net objects stored and named in an element Resource
Properties.
3). By using logical resources we can save change in one place and have different effects.
Like you can change brushes in one place and have different effects .
4). Logical Resources can further be categorized in “Static Resources” and “Dynamic
Resources”.
14). System Resources are such resources which are shared by al application For Example:
System Color, System font, System Parameters.
1). Data Binding allows to declaratively bind two different properties in xaml.
3). Binding binds two propertiews together and keeps a communication channel open.
13). With Data Template User Interface are auto-applied to arbitrary .net object when it is
rendered.
16). Value Converter is a custom Logic that morphs Source value into Target Type.
14). If you have multiple target elements connected to the same Custom View then their
IsSynchronizedWithCurrentItem = “True” by default and it is “false” in Default View.
15). Data Providers are kind of classes which made it simple for us to access certain kind of
data.
1). Object Data Provider provides us some facility which are useful for binding to objects
which are not designed for binding.
2). Asynchronous Data Binding means that the property that you want to access should be
done in background.
6). Convert Method is used when bringing data from Source to Target
7). Convert Back is used when bringing data from target to source.
10). One-Way Binding means the target is updated whenever the source changes.
11). Two-Way Binding means change to either the target or source updates the other
12). OneWayToSource is the opposite of One-Way binding. the source is changed whenever
the target changes.
13). One-Time binding is like one-way except changes to the source are not reflected at the
target. The target retains a snapshot of the source at the time the Binding is initiated.
15). Validation Rules are just like simple classes that are used to ensure the proper working
of the application.
16). Binding has ValidationRules Property that can be set to one or more validation rules
17). ExceptionValidationRule says that you can update a source if updating a source does not
cast an exception
3). Time slicing means giving time to a thread then we slice and run another thread then
come back and so on.
7). When you call t.join() it means you want to wait for t to finish.
10). Locks are a way to ensure that if you are in area of a code then no other thread will be
allowed to enter that area of thread. And are used when threads are sharing shared
data.
1). BeginInvoke and Invoke are such methods that can be called from any other thread.
9). ThreadPool saves the overhead of thread creation, management and termination.
10). ThreadPool creates or reduces real threads using hillclimbing algo to maximize CPU
usage and reduce time slicing.
11). Threads of ThreadPool are always Background threads which means they are not going
to be deleted they are just waiting for work items.
13). Starting a task is like creating a thread except started right away(hot) means that there
is no need to explicitly start a task.
16). Create a task which you can wait and attach continuations. Controlled by the following
operations:
public class TaskCompletionSource<TResult>
{
public void SetResult(TResult result); public
void SetException(Exception exception); public
void SetCanceled();
public bool TrysetResult(TResult result); public
bool TrySetException(Exception exception); public
bool TrySetCanceled();
}
17). What would be the result of following piece of code:
Var tcs = new TaskCompletionSource<int>(); new
Thread(()=>{Thread.Sleep(5000);
tcs.SetResult(42); }).Start();
Task<int> task = tcs.Task;
Console.WriteLine(task.Result);
4). For CPU bound we can start and return task and are asynchronous tasks.
9). Asynchronous tasks means doing some work then returning some result then completing
the rest.
3). If you have to write asynchronous function then follow three steps:
• Write its totally synchronous version
• Then use await and async
• Then use returnand return Task in place of void
9). Cancellation can even be used Task.Wait i.e. Synchronous methods but have to call
cancel from another task. Cancellation is useful for timeouts.
10). In Task-Based Async Pattern (TAP) we create a “Hot” task From Task or TaskResult.
13). Pseudo Concurrency means a program is running and awaiting for something then
resuming and then awaiting.
4). Data Parallelism is easier to perform and scales well, it is also structured.
5). Concurrent collections are useful when you want a thread-safe collection.
8). Parallel.Invoke:
Executes an array of delegates in parallel.
10).Example of Parallel.For:
for(int i=0; i<100; i++)
foo(i);
Parallel.For(0, 100, i=>foo(i));
Parallel.For(0, 100, foo);
14). Concurrent Collections are three times slower than normal collections in writing but not
the case with reading.
15). Concurrent Collections include :
• Concurrent Stack
• Concurrent Queue
• Concurrent Bag
• Concurrent Dictionary
• 4). JS was introduced in 1995, originally named with LiveScript but got populated
with most hot name “Java”, MS introduced jScript... their version of JS for IE,
5). JQuery:
• JS is a prog language... can be hard for some... also browser incompatibilities make
testing difficult
• jQuery is a JS library intended to make JS programming easier
• jQuery soles JS complexity and browser incompatibilities
• can do things in single LOC that would take hundreds
• many advanced features come as jQuery plugins
• used on millions of websites
6). In HTML:
• at least three tags ... html root tag, head tag containing title etc, and body tag
containing all parts to be rendered in browser window
• <p></p> is paragraph <strong></strong> is emphasis <a href=“http:...”></a> is a
hyperlink... XML attribute and value
• validating html means checking if all tags appropriately closed etc.
9). CSS says that take “this” and make “this” look like “that
11). CSS can do more powerful stuff, like add border, change margins, and even control
exact placement on web page
12). JS can add/remove/change CSS properties based on input or mouse clicks... even
animate from one property to another... like yellow to red... or animate across screen
by changing position
Explanation:
14). Concurrent Collections are three times slower than normal collections in writing but not
the case with reading.
15). JS is an interpreted language means each line of code is compiled at run time.
15). JS is an interpreted language means each line of code is compiled at run time.
27). When acting on each element in selection key word Each is used like this:
28). Web mouse Events are : click,
dblclick, mousedown,
34).JQuery Events:
• hover
• toggle is like hover except worked on and off by clicks
• event object is passed to all functions handling events
Chapter NO.39 Short Notes
1). Web events also have an event object just like desktop event object.
7). Examples:
Binding multiple events:
1). Ajax is a term which allows us to talk to server remaining within JS.
3). JS, server-side programming, and web browser, all work together
8). The basic concept of POST is that if you want to post a lot of data then instead of sending
it via URL you can insert this into the request body.
9). The Web Server Request can respond in the following states:
• status = 200/304 all ok, 404 file not found, 500 internal server error, 403 access
forbidden
8). The JQuery simplifies all steps except that of changing the webpage
13). Serialize is used for form submission in JS by so that the page may not reload.
15). third parameter in get() and post() is call back. We write a function that will process
data returned by server.
1). Web events also have an event object just like desktop event object.
1). Ajax is a term which allows us to talk to server remaining within JS.
3). JS, server-side programming, and web browser, all work together
8). The basic concept of POST is that if you want to post a lot of data then instead of
sending it via URL you can insert this into the request body.
9). The Web Server Request can respond in the following states:
• status = 200/304 all ok, 404 file not found, 500 internal server error, 403
access forbidden
8). The JQuery simplifies all steps except that of changing the webpage
12). The better way to use Get() and Post() is object literal i.e.
var data = $.post('rankMovie.php',
{
rating: 5,
user: 'Bob' }
); // end post
13). Serialize is used for form submission in JS by so that the page may not reload.
15). third parameter in get() and post() is call back. We write a function that will process
data returned by server.
19). JASON:
• JS format... method for exchanging data
• JSON is JS so its quick n easy for JS
• no XML like parsing
• JSON is a JS obj literal
• {
• firstName: 'Frank',
• lastName: 'Smith',
• phone: '503-555-1212'
• }
• OR
• {
• 'firstName': 'Frank',
• 'lastName': 'Smith',
• 'phone': '503-555-1212'
• } (MUST use if names have spaces etc.)
• server returns a string formatted like a JSON obj literal
• jQuery getJSON method
• like get but data passed to callback will be a JSON object
• e.g. var bday = {
• person: 'Raoul',
• date: '10/27/1980'
• };
• bday.person // 'Raoul'
• bday.date // '10/27/1980'
Chapter NO.41 Short Notes
1). C Objective is a simple extension of C and made using pre processors in early 1980’s.
6). Dangling pointer means you have assigned some memory and released but some
pointer is still pointing to that place.
7). NSString:
• [items addObject:@"One"];
• @ is shortcut for creating NSString
• NSString *myString = @"Hello, World!";
• int len = [myString length];
• len = [@"Hello, World!" length];
• myString = [[NSString alloc] initWithString:@"Hello, World!"]; • len = [myString
length];
8). NsLog:
• format string
• int a = 1;
• float b = 2.5;
• char c = 'A';
• NSLog(@"Integer: %d Float: %f Char: %c", a, b, c);
• Integer: 1 Float: 2.5 Char: A
9). “-“ is used to mention compiler that we are going to write an instance method.
13). Initializers:
• start with “init” naming convention
• id = any object
• every object has “isa” pointer to class and thats how methods are called... like vtable
• self and super
• other initializers
15). Initializers:
• start with “init” naming convention
• id = any object
• every object has “isa” pointer to class and thats how methods are called... like vtable
• self and super
• other initializers
1). Auto Release: Means saying an object that i no longer want to hold the reference of
this object but don’t delete the object immediately. The resulting object will be added to
the autorelease pool.
2). Description Function creates a string returns it so that it can be printed by NsLog.
4). Retain Cycle: An object is retaining the other object and the other object is retaining
this object.
9). Controller contains the main logic and keep things in sync.