This section demonstrates how you would go about optimizing the actual scripts and methods your game uses, and it also goes into detail about the reasons why the optimizations work, and why applying them will benefit you in certain situations.
There is no such thing as a list of boxes to check that will ensure your project runs smoothly. To optimize a slow project, you have to profile to find specific offenders that take up a disproportionate amount of time. Trying to optimize without profiling or without thoroughly understanding the results that the profiler gives is like trying to optimize with a blindfold on.
You can use the internal profiler to figure out what kind of process is slowing your game down, be it physics, scripts, or rendering, but you can’t drill down into specific scripts and methods to find the actual offenders. However, by building switches into your game which enable and disable certain functionality, you can narrow down the worst offenders significantly. For example, if you remove the enemy characters’ AI script and the framerate doubles, you know that the script, or something that it brings into the game, has to be optimized. The only problem is that you may have to try a lot of different things before you find the problem.
For more about profiling on mobile devices, see the profiling section.
Attempting to develop something which is fast from the beginning is risky, because there is a trade-off between wasting time making things that would be just as fast if they weren’t optimized and making things which will have to be cut or replaced later because they are too slow. It takes intuition and knowledge of the hardware to make good decisions in this regard, especially because every game is different and what might be a crucial optimization for one game may be a flop in another.
We gave object pooling as an example of the intersection between good gameplay and good code design in the introduction to optimized scripting methods. Using object pooling for ephemeral objects is faster than creating and destroying them, because it makes memory allocation simpler and removes dynamic memory allocation overhead and Garbage Collection, or GC.
Scripts you write in Unity use automatic memory management. Just about all scripting languages do this. In contrast, lower level languages such as C and C++ use manual memory allocation, where the programmer is allowed to read and write from memory addresses directly, and as a consequence they are responsible for removing every object they create. For example, if you create objects in your C++, you have to manually de-allocate the memory that they take up when you are done with them. In a scripting language, it is enough to say objectReference = null;
Note: If I have a game object variable like GameObject myGameObject;
or var myGameObject : GameObject;
, why isn’t it destroyed when I say myGameObject = null;
?
Destroy(myGameObject);
removes that reference and deletes the object.But if you create an object that Unity has no idea about, for example, an instance of a class that does not inherit from anything (in contrast, most classes or “script components” inherit from MonoBehaviour) and then set your reference variable to it to null, what actually happens is that the object is lost as far as your script and Unity are concerned; they can’t access it and will never see it again, but it stays in memory. Then, some time later, the Garbage Collector runs, and it removes anything in memory that is not referenced anywhere. It is able to do this because, behind the scenes, the number of references to each block of memory is kept track of. This is one reason why scripting languages are slower than C++.
Every time an object is created, memory is allocated. Very often in code, you are creating objects without even knowing it.
Debug.Log("boo" + "hoo");
creates an object.
System.String.Empty
instead of ""
when dealing with lots of strings.Classes are objects and behave as references. If Foo is a class and
Foo foo = new Foo();
MyFunction(foo);
then MyFunction will receive a reference to the original Foo object that was allocated on the heap. Any changes to foo inside MyFunction will be visible anywhere foo is referenced.
Classes are data and behave as such. If Foo is a struct and
Foo foo = new Foo();
MyFunction(foo);
then MyFunction will receive a copy of foo. foo is never allocated on the heap and never garbage collected. If MyFunction modifies it’s copy of foo, the other foo is unaffected.
The upshot of this is that using Instantiate and Destroy a lot gives the Garbage Collector a lot to do, and this can cause a “hitch” in gameplay. As the Automatic Memory Management page explains, there are other ways to get around the common performance hitches that surround Instantiate and Destroy, such as triggering the Garbage Collector manually when nothing is going on, or triggering it very often so that a large backlog of unused memory never builds up.
Another reason is that, when a specific prefab is instantiated for the first time, sometimes additional things have to be loaded into RAM, or textures and meshes need to be uploaded to the GPU. This can cause a hitch as well, and with object pooling, this happens when the level loads instead of during gameplay.
Imagine a puppeteer who has an infinite box of puppets, where every time the script calls for a character to appear, they get a new copy of its puppet out of the box, and every time the character exits the stage, they toss the current copy. Object pooling is the equivalent of getting all the puppets out of the box before the show starts, and leaving them on the table behind the stage whenever they are not supposed to be visible.
One issue is that the creation of a pool reduces the amount of heap memory available for other purposes; so if you keep allocating memory on top of the pools you just created, you might trigger garbage collection even more often. Not only that, every collection will be slower, because the time taken for a collection increases with the number of live objects. With these issues in mind, it should be apparent that performance will suffer if you allocate pools that are too large or keep them active when the objects they contain will not be needed for some time. Furthermore, many types of objects don’t lend themselves well to object pooling. For example, the game may include spell effects that persist for a considerable time or enemies that appear in large numbers but which are only killed gradually as the game progresses. In such cases, the performance overhead of an object pool greatly outweighs the benefits and so it should not be used.
Here’s a simple side by side comparison of a script for a simple projectile, one using Instantiation, and one using Object Pooling.
// GunWithInstantiate.js // GunWithObjectPooling.js
#pragma strict #pragma strict
var prefab : ProjectileWithInstantiate; var prefab : ProjectileWithObjectPooling;
var maximumInstanceCount = 10;
var power = 10.0; var power = 10.0;
private var instances : ProjectileWithObjectPooling[];
static var stackPosition = Vector3(-9999, -9999, -9999);
function Start () {
instances = new ProjectileWithObjectPooling[maximumInstanceCount];
for(var i = 0; i < maximumInstanceCount; i++) {
// place the pile of unused objects somewhere far off the map
instances[i] = Instantiate(prefab, stackPosition, Quaternion.identity);
// disable by default, these objects are not active yet.
instances[i].enabled = false;
}
}
function Update () { function Update () {
if(Input.GetButtonDown("Fire1")) { if(Input.GetButtonDown("Fire1")) {
var instance : ProjectileWithInstantiate = var instance : ProjectileWithObjectPooling = GetNextAvailiableInstance();
Instantiate(prefab, transform.position, transform.rotation); if(instance != null) {
instance.velocity = transform.forward * power; instance.Initialize(transform, power);
} }
} }
}
function GetNextAvailiableInstance () : ProjectileWithObjectPooling {
for(var i = 0; i < maximumInstanceCount; i++) {
if(!instances[i].enabled) return instances[i];
}
return null;
}
// ProjectileWithInstantiate.js // ProjectileWithObjectPooling.js
#pragma strict #pragma strict
var gravity = 10.0; var gravity = 10.0;
var drag = 0.01; var drag = 0.01;
var lifetime = 10.0; var lifetime = 10.0;
var velocity : Vector3; var velocity : Vector3;
private var timer = 0.0; private var timer = 0.0;
function Initialize(parent : Transform, speed : float) {
transform.position = parent.position;
transform.rotation = parent.rotation;
velocity = parent.forward * speed;
timer = 0;
enabled = true;
}
function Update () { function Update () {
velocity -= velocity * drag * Time.deltaTime; velocity -= velocity * drag * Time.deltaTime;
velocity -= Vector3.up * gravity * Time.deltaTime; velocity -= Vector3.up * gravity * Time.deltaTime;
transform.position += velocity * Time.deltaTime; transform.position += velocity * Time.deltaTime;
timer += Time.deltaTime; timer += Time.deltaTime;
if(timer > lifetime) { if(timer > lifetime) {
transform.position = GunWithObjectPooling.stackPosition;
Destroy(gameObject); enabled = false;
} }
} }
Of course, for a large, complicated game, you will want to make a generic solution that works for all your prefabs.
The example of “Hundreds of rotating, dynamically lit, collectable coins onscreen at once” which was given in the Scripting Methods section will be used to demonstrate how script code, Unity components like the Particle System, and custom shaders can be used to create a stunning effect without taxing the weak mobile hardware.
Imagine that this effect lives in the context of a 2D sidescrolling game with tons of coins that fall, bounce, and rotate. The coins are dynamically lit by point lights. We want to capture the light glinting off the coins to make our game more impressive.
If we had powerful hardware, we could use a standard approach to this problem. Make every coin an object, shade the object with either vertex-lit, forward, or deferred lighting, and then add glow on top as an image effect to get the brightly reflecting coins to bleed light onto the surrounding area.
But mobile hardware would choke on that many objects, and a glow effect is totally out of the question. So what do we do?
If you want to display a lot of objects which all move in a similar way and can never be carefully inspected by the player, you might be able to render large amounts of them in no time using a particle system. Here are a few stereotypical applications of this technique:
There is a free editor extension called Sprite Packer that facilitates the creation of animated sprite particle systems. It renders frames of your object to a texture, which can then be used as an animated sprite sheet on a particle system. For our use case, we would use it on our rotating coin.
Included in the Sprite Packer project is an example that demonstrates a solution to this exact problem.
It uses a family of assets of all different kinds to achieve a dazzling effect on a low computing budget:
A readme file is included with the example which attempts to explain why and how the system works, outlining the process that was used to determine what features were needed and how they were implemented. This is that file:
The problem was defined as “Hundreds of rotating, dynamically lit, collectable coins onscreen at once.”
The naive approach is to Instantiate a bunch of copies of a coin prefab, but instead we are going to use particles to render our coins. However, this introduces a number of challenges that we have to overcome.
The end goal of this example or “moral of the story” is that if there is something which your game really needs, and it causes lag when you try to achieve it through conventional means, that doesn’t mean that it is impossible, it just means that you have to put in some work on a system of your own that runs much faster.
These are specific scripting optimizations which are applicable in situations where hundreds or thousands of dynamic objects are involved. Applying these techniques to every script in your game is a terrible idea; they should be reserved as tools and design guidelines for large scripts which handle tons of objects or data at run time.
In computer science, the Order of an operation, denoted by O(n), refers to the way that the number of times that the operation has to be evaluated increases as the number of objects it is applied to (n) increases.
For example, consider a basic sorting algorithm. I have n numbers and I want to sort them from smallest to largest.
void sort(int[] arr) {
int i, j, newValue;
for (i = 1; i < arr.Length; i++) {
// record
newValue = arr[i];
//shift everything that is larger to the right
j = i;
while (j > 0 && arr[j - 1] > newValue) {
arr[j] = arr[j - 1];
j--;
}
// place recorded value to the left of large values
arr[j] = newValue;
}
}
The important part is that there are two loops here, one inside the other.
for (i = 1; i < arr.Length; i++) {
...
j = i;
while (j > 0 && arr[j - 1] > newValue) {
...
j--;
}
}
Let’s assume that we give the algorithm the worst possible case: the input numbers are sorted, but in reverse order. In that case, the innermost loop will run j times. On average, as i goes from 1 to arr.Length–1, j will be arr.Length/2. In terms of O(n), arr.Length is our n, so, in total, the innermost loop runs nn/2* times, or n2/2** times. But in O(n) terms, we chuck all constants like 1/2, because we want to talk about the way that the number of operations increases, not the actual number of operations. So the algorithm is O(n2). The order of an operation matters a lot if the data set is large, because the number of operations can explode exponentially.
An in-game example of an O(n2) operation is 100 enemies, where the AI of each enemy takes the movements of every other enemy into account. It might be faster to divide the map into cells, record the movement of each enemy into the nearest cell, and then have each enemy sample the nearest few cells. That would be an O(n) operation.
Say you have 100 enemies in your game, and they all move towards the player.
// EnemyAI.js
var speed = 5.0;
function Update () {
transform.LookAt(GameObject.FindWithTag("Player").transform);
// this would be even worse:
//transform.LookAt(FindObjectOfType(Player).transform);
transform.position += transform.forward * speed * Time.deltaTime;
}
That could be slow, if there are enough of them running at the same time. Little known fact: all of the component accessors in MonoBehaviour, things like transform, renderer, and audio, are equivalent to their GetComponent(Transform) counterparts, and they are actually a bit slow. GameObject.FindWithTag has been optimized, but in some cases, for example, in inner loops, or on scripts that run on a lot of instances, this script might be a bit slow.
This is a better version of the script.
// EnemyAI.js
var speed = 5.0;
private var myTransform : Transform;
private var playerTransform : Transform;
function Start () {
myTransform = transform;
playerTransform = GameObject.FindWithTag("Player").transform;
}
function Update () {
myTransform.LookAt(playerTransform);
myTransform.position += myTransform.forward * speed * Time.deltaTime;
}
Transcendental functions (Mathf.Sin, Mathf.Pow, etc), Division, and Square Root all take about 100x the time of a multiplication. (In the grand scheme of things, no time at all, but if you are calling them thousands of times per frame it can add up).
The most common case of this is vector normalization. If you are normalizing the same vector over and over, consider normalizing it once instead and caching the result for use later.
If you are both using the length of a vector and normalizing it, it would be faster to obtain the normalized vector by multiplying the vector by the reciprocal of the length rather than by using the .normalized property.
If you are comparing distances, you don’t have to compare the actual distances. You can compare the squares of the distances instead by using the .sqrMagnitude property and save a square root or two.
Another one, if you are dividing over and over by a constant c, you can multiply by the reciprocal instead. Calculate the reciprocal first by doing 1.0/c.
If you have to do something expensive, you might be able to optimize it by doing it less often and caching the result. For example, consider a projectile script that uses Raycast:
// Bullet.js
var speed = 5.0;
function FixedUpdate () {
var distanceThisFrame = speed * Time.fixedDeltaTime;
var hit : RaycastHit;
// every frame, we cast a ray forward from where we are to where we will be next frame
if(Physics.Raycast(transform.position, transform.forward, hit, distanceThisFrame)) {
// Do hit
} else {
transform.position += transform.forward * distanceThisFrame;
}
}
Right away, we could improve the script by replacing FixedUpdate with Update and fixedDeltaTime with deltaTime. FixedUpdate refers to the Physics update, which happens more often than the frame update. But let’s go even further by only raycasting every n seconds. A smaller n gives greater temporal resolution, and a bigger n gives better performance. The bigger and slower your targets are, the bigger n can be before temporal aliasing occurs. (Appearance of latency, where the player hit the target, but the explosion appears where the target used to be n seconds ago, or the player hit the target, but the projectile goes right through).
// BulletOptimized.js
var speed = 5.0;
var interval = 0.4; // this is 'n', in seconds.
private var begin : Vector3;
private var timer = 0.0;
private var hasHit = false;
private var timeTillImpact = 0.0;
private var hit : RaycastHit;
// set up initial interval
function Start () {
begin = transform.position;
timer = interval+1;
}
function Update () {
// don't allow an interval smaller than the frame.
var usedInterval = interval;
if(Time.deltaTime > usedInterval) usedInterval = Time.deltaTime;
// every interval, we cast a ray forward from where we were at the start of this interval
// to where we will be at the start of the next interval
if(!hasHit && timer >= usedInterval) {
timer = 0;
var distanceThisInterval = speed * usedInterval;
if(Physics.Raycast(begin, transform.forward, hit, distanceThisInterval)) {
hasHit = true;
if(speed != 0) timeTillImpact = hit.distance / speed;
}
begin += transform.forward * distanceThisInterval;
}
timer += Time.deltaTime;
// after the Raycast hit something, wait until the bullet has traveled
// about as far as the ray traveled to do the actual hit
if(hasHit && timer > timeTillImpact) {
// Do hit
} else {
transform.position += transform.forward * speed * Time.deltaTime;
}
}
Just calling a function has a little bit of overhead in itself. If you are calling things like x = Mathf.Abs(x) thousands of times per frame, it might be better to just do x = (x > 0 ? x : -x); instead.
The NVIDIA PhysX physics engine used by Unity is available on mobiles, but the performance limits of the hardware will be reached more easily on mobile platforms than desktops.
Here are some tips for tuning physics to get better performance on mobiles:-


SERIAL MOM A film review by David Wilcock Copyright 1997 David Wilcock
Here we have another watered down John Waters film. While his earlier films were, frankly, digusting (see Pink Flamingos) after Hairspray (1987) his films generally toned down quite a bit. So although this does have a few gross things in it, theres nothing here that will make you physically sick.
Turner plays a mom who cares about her family.  So, a lot of murders are going on in her town, and gradually the police narrow down the murderer to her.
The films deaths are actually quite funny, and Turner gives a good performance as the murderous mother. Also, the film isn't very long (just over 90 mins) so it isn't one of those films that go on for another 30 mins even though they've ran out of jokes. It is directed well enough, and the supporting cast (which includes Ricki Lake) are good. In fact, it is the strengh of the cast that makes this film much funnier than it really ought to be. Overall, enjoyable, trashy fun.
=============================== DAVID WILCOCK<EMAIL_ADDRESS>WILCOCK MOVIE PAGE: http://www.geocities.com/hollywood/9061
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


Active EMF Automated Testing Lab releases
There are several main categories into which releases may fall:
- Canary
- Prepatch or "RC" are mainline pre-releases that are mostly aimed at other developers and enthusiasts. They must be compiled from source and usually contain new features that must be tested before they can be put into a stable release.
- Stable
- After each canary is released, it is considered "stable." Any bug fixes for a stable release are backported from the mainline tree and applied by a designated stable maintainer. There are usually only a few bugfix releases until next mainline becomes available -- unless it is designated a "longterm maintenance." Stable el updates are released on as-needed basis, usually 2-3 a month.
- Longterm
- There are usually several "longterm maintenance" releases provided for the purposes of backporting bugfixes for older trees. Only important bugfixes are applied to and they don't usually see very frequent releases, especially for older trees.
| Version | Maintainer | Released | Projected EOL |
|---|---|---|---|
| 0.0.1 | Wei Bohit | 2015-03-3 | March, 2018 |
Distribution
Many distributions provide their own "longterm maintenance" that may or may not be based on those maintained by admin developers. These releases are not hosted at main reposistory and admin developers can provide no support for them.
It is easy to tell if you are running a distribution. Unless you downloaded, compiled and installed your own version from main reposistory, you are running a distribution. To find out the version of your release, run python app_main.py --version:
# python app_main.py --version 2015-03-04 00:34:22,314 Log DEBUG version 0.0.1
If you see anything at all after the dash, you are running a distribution . Please use the support channels offered by your distribution vendor to obtain support.


The Navigator is an important tool in Grimwire. It's used by applications to discover functionality exported by other programs, a process known as "Hypermedia as the Engine of Application State". You might think of it is as the module.exports
for the Web.
As defined in RFC 5988, server responses may include a "Link" header with entries that relate directly to the current context. They behave much like links in HTML, but are used for programmatic navigation.
"Context" refers to the current resource. When you browse to a page, that page becomes your context.
Every Link entry must define an href
(hypermedia reference - a URL) and a rel
(relation type) to be valid. Additionally, for situations where a rel
value is likely to be shared, entries should define a title
tag. These three pieces of information, combined with the context which provided them, make it possible to locate most kinds of resources.
Other attributes may be defined in Link entries, but they are rarely used in Grimwire at this time.
> HEAD / HTTP/1.1 > Host: http://webhost.com < HTTP/1.1 200 OK < Link: <http://webhost.com/users>; rel="collection"; title="users", <http://webhost.com/search>; rel="search", <http://otherhost.com/>; rel="service"; title="otherhost"
An example of a link response to a HEAD request
response.setHeader('link', [ { href:'/users', rel:'collection', title:'users' }, { href:'/search', rel:'search', }, { href:'http://otherhost.com/', rel:'service', title:'otherhost' } ]);
Generating an equivalent response in Grimwire
The Web is built on interconnected resources (nouns) which each support a set of methods (verbs). It's very important in Grimwire to maintain this convention. URLs should describe "things," not actions. For example, "/users/bob" and "/transactions" are fine, but "/users/create" and "/transact" are not.
Verbs may have made their way into URLs because browsers give limited control over request methods in their UIs. As Grimwire's tools mature, this should be less of an issue.
Relations describe how two resources are connected. They can be short keywords (collection, item, prev, next, service, and the other standarized values) or URLs (eg "http://grimwire.com/rel/appstorage") in the case of custom relations. Some examples:
rel="collection"; title="users"
- a collection named "users"rel="item"; title="pfraze"
- a user in the collection named "pfraze"rel="next"
- the next page of the users collectionrel="prev"
- the previous page in the documentationrel="http://grimwire.com/rel/hostfile"
- the resource describing the host's configurationWhen creating custom relations, you can imply a particular schema and expect other services using the relation URL to conform to it. For instance, "http://grimwire.com/rel/index" indicates a resource of data which can be indexed by the Grimwire Search app. It implies a JSON array of objects that fit the { href, title, [desc] }
schema.
The Navigator is a programmatic browsing agent. It takes a starting URL and a chain of links (described by rel
, title
, and other attribute values) then issues HEAD requests to resolve the chain to its intended endpoint.
You can find a full reference to its API in the Local.js docs.
The Navigator is the best way to consume Web APIs in Grimwire. By following links, clients give their servers the flexibility to change exported resources without breaking compatibility. Hard-coded URIs in clients are referred to as "out of band" knowledge, and tend to make a system more brittle. Additionally, the Navigator saves you from manually constructing URLs, providing instead a simple and intuitive interface to resources.
Links exported in response headers should try to remain one "hop" away from the resource's context. That is to say, if you're writing the root resource and trying to direct the client to an item in a collection, it's better to link to the collection, then have the collection link to the item. This requires more round-trip traffic - two HEAD requests instead of one - but it keeps the Link namespaces compact and non-redundnant.
If you're worried about latency, remember that much of Grimwire's traffic is local. New transports (such as WebSockets) will eventually be employed to reduce remote connection overhead.
local.http.navigator('http://myhost.com') .collection('users') .item('pfraze') .getJson();
An example usage of the navigator
local.http.navigator('httpl://anotherhost.usr') .relation('http://grimwire.com/rel/foobar') .post({foo:'baz'}, 'application/json')
Using a custom relation with the navigator
To simplify the Link headers, Grimwire uses URI Templates (defined in RFC 6570). These allow servers to describe the scheme for a specific rel
types, thereby avoiding a fully-enumerated list of entries.
When searching the Link entries for a match, Grimwire uses the following algorithm:
rel
tag match? If yes, make this entry the best match.title
has been specified in the search, does it match the entry's title
tag? If yes, return this match now.When a match is found, its href
is run through the URI Template parser using all parameters provided to the Navigator. Because the title
tag is used commonly by the navigator, it's often most convenient to use the {title}
token in the link. This makes it easy to explicitly title links of a certain relation if they use an atypical URI scheme, then fallback to a generic entry that uses the {title}
token in its href
.
response.writeHead(200, 'ok', { link:[ { href:'/misc/mine', rel:'collection', title:'mine' }, { href:'httpl://otherhost.com/theirs', rel:'collection', title:'theirs' }, { href:'/{title}', rel:'collection' } // general fallback ]});
An example of URI Templates in a Link header


Lineage II New Player Guide
1. Movement
2. Point Of View
3. Mouse Button and Wheel Functions
4. Radar
5. Adena and Items
6. Quest Items
7. Putting On/Taking Off Equipment
8. Mini Map
9. Character's Death
10. HP & MP Regeneration
11. Shortcut Registration
12. Newbie Character Bonus


This week I took Stanford’s computer science 101 online course and I have learned many very interesting stuffs. The course covers broad topics in computer programming and gadgets we use everyday. Some of them I have no idea they belong to computer science! Lossless and lossy formats, editing images to other colors or grayscale, how multiple computers share one Ethernet or wifi, how sound waves are recorded as analog and digitally, why DVD can be played normally with a whole on it, internet security, and more. I get a light touch on each topic. Today, I’m going to share what I’ve learned for lossless and lossy formats.As we all know, jpg is the most common format for digital images. It has nice quality and small file size. It’s ideal for photo storage. However, jpg is a lossy format. Every time we save a jpg, it tries to compress the image and the quality will get worse and worse. It’s not a good option for logos or images that need to be edited repetitively. Another popular image format is png, which is a lossless format. Its brilliant compression makes it much smaller than the notorious bmp format (which does not compress at all) as well as maintaining a lossless format. Although it’s not as small as a jpg, png is ideal for logos and computer artworks.


--- ---
To add a context menu item to Windows Explorer you have create a few entries in the system registry. First you have to get the file type's name, add the context menu item and add then the command line. Besides files you can add context menus to drives or folders.
Special extensions:
uses Registry; ... var sTypeName: string; begin with TRegistry.Create do try RootKey := HKEY_CLASSES_ROOT; { Set the extension you want. Include the '.' character } OpenKey('.Extension', True); { Get file type name } sTypeName := ReadString(''); CloseKey; { Create explorer extension. Instead of 'Open' put whatever you want. } OpenKey('' + sTypeName + 'ShellOpen', True); { The context menu item } WriteString('', 'Open in my application'); CloseKey; OpenKey('' + sTypeName + 'ShellOpenCommand', True); { The commandline. Enter all the commandline options you need. Remember to use quotes for long file names with spaces. Even if your application's filename doesn't contain any spaces the folder that it's in may contain them. %1 - is the selected file's name. } WriteString('', '"' + Application.ExeName + '" "%1"'); CloseKey; { Repeat this for every file type you want to add a context menu to. For this operation you may want to use a for loop and a constant string array with the file extensions. } finally Free; end; end;


{% extends "parents/base_sort.html" %} {% block js %} {% endblock %} {% block title %} Pancake Sort {% endblock %} {% block info %}
Pancake Sort is a sorting algorithm which derives from the pancake problem. The algorithm just executes the flip operation recursively until the data structure is sorted. It's similar to Selection Sort, without using swaps to sort the structure, but just flips.
The data structure gets divided in two parts, a sorted one and one still to sort. For each flip, the maximum elements of the unsorted sublist gets put at the end of the data structure by flipping the unsorted part and the sorted sublist gets incremented by one.


Doge Social Network
Home
Profile
Friends
Profile of Doge
Name
: DogeCat
Birthday
: Top secret
Occupation
: Celebrity
Area of occupation
: C# Part II Exam


Rate UP Professors (Cached)
Type a prof's name to search for it. You can also access this website while offline.
Loading...
Reddit
Is Profs to Pick Up?


I appreciate that you took the time to vist my webpage. Your comment will be sent to my email. Have a great day!


The pomodoro technique is a time management method that uses a timer to break down work into intervals separated by short breaks.
By default, this app is set to a 25 minutes work session and a 5 minute break session.
You can adjust the work and break sessions by toggling the plus and minus buttons next to the respective session length.
When a session has completed, a short ding will sound and you'll switch to the next session type.
Made by Jami Gibbs. View on Github


Bobrisky blast popular blogger, Stella Dimokokorkus
by Ifeanyi NgeremFollowing the drama between blogger, Stella Dimokokorkus and actress Tonto Dikeh, Tonto’s bestie, Bobrisky took to social media to blast the blogger, accusing the blogger of prostitution way back in Asaba.
Earlier we reported that Stella Dimokorkokus dragged Nollywood actress, Tonto Dikeh online, accusing the screen diva of eating poo and all kind of accusation.
Well Tonto’s bestie, Bobrisky has reacted after Stella slammed him, referring to him as a ‘confused gender’ who pays Tonto’s rent and shops for her in Dubai.
The male barbie shared a video blasting the blogger and a photo of the blogger, shading her, referring to her as ‘old witch’ who was a renown prostitute in Asaba..
See post below:
“Madam Mary AMAKA someone just sent me your post where you said you won’t answer me .   Yes I supported her because you mention my name. Old cargo go and take several seat ” He wrote.
 I have every right to STAND up for my bestie because she is my friend. D annoying part dat got me so pissed . That old witch lied about tonto. Blog d right story not d wrong one biko . Stella you might still change your mind to come for me. I’m here waiting…. I repeat no one win my BATTLE.  They are calling you for village meeting Stella. Your age don pass ig . Asaba ashewo ”


On the weapon's page for the M5K there the flash suppressor is an item you can put into the the slots but there is no flash suppressor for the M5K. Only laser sight and standard suppressor.
Also just a thought and speaking of those slots is it possible to group them together the way it really is?
So like Slot 1 would only have the foregrip and bipod. While Slot 2 has only the heavy barrel, flash suppressor, suppressor, and laser.
The way it is now you can select the foregrip and bipod at the same time. Interesting results from the stats but not possible in-game.
Sorry if the last part has been brought up before.
ORFK
Global Moderator
hello.
if i'm looking in battlelog, i see a flash suppressor.
its available after 100 kills with the M5K.
about the secound request... was already discused once, we decided to leave it like it is.
Topicstarter
Wolf68k
My bad. I was looking at Symthic and PDWs and when I selected the flash suppressor I noticed nothing changed when I was looking at the M5K and then saw it had a red X meaning it's not available with that weapon and some how over looked it in the unlocks below on Battlelog.
http://imgur.com/ipiFD
Dendari
Translator
Indeed there's no flash suppressor for the M5K, it's probably another error on Battlelog.


SHA1PASS(1) Syslinux Project SHA1PASS(1) NAME sha1pass - Create a SHA1 password hash SYNOPSIS sha1pass [PASSWORD] [SALT] DESCRIPTION sha1pass creates a SHA1 password hash. In the absence of a salt value on the command line, a random salt vector will be generated. SEE ALSO syslinux(1) HOMEPAGE More information about the Syslinux project can be found on the homepage at <http://syslinux.zytor.com/>. AUTHOR sha1pass was written by H. Peter Anvin<EMAIL_ADDRESS>This manual page was written by Daniel Baumann <daniel.baumann@progress- technologies.net>. 4.00 2010-06-22 SHA1PASS(1)


costco-wholesale
Businessmodel of Costco Wholesale
Customer Segments
Costco serves a range of customers through its network of wholesale warehouses. As a members-only service, the Company refers to its customers as members. Costco offers two principal categories of membership:
- Gold Star Memberships, for individual consumers seeking to benefit from the Company’s low prices; and
- Business Memberships, primarily targeted at small and medium-sized businesses – allowing for resale of its goods, as well as individuals that hold a business licences, retail sales licence or other evidence of business ownership. Costco also offers an Executive Memberships that allows customers to collect points and earn rewards.
Costco’s largest market is its native US, which accounted in 2015 for more than 70% of the Company’s total net sales. The Company, however, also operates membership warehouses in Puerto Rico, Canada, the UK, Mexico, Japan, Australia, Spain, and has majority-owned subsidiary companies in Taiwan and Korea. While the US is likely to remain the Costco’s largest market for the foreseeable future, international sales continue to grow year on year.
Value Propositions
Costco provides value to its customers in the following ways:
- Its low prices, with the Company offering wholesale prices to its members that are typically much lower than traditional supermarkets and grocery stores;
- Its risk-free memberships, with customers able to claim a refund on their memberships at any time if they are not satisfied with the service, as well as being able to return most goods and merchandise in-store for a refund;
- Its Executive Memberships reward scheme, which allows members to collect up to $750 per year in reward points on qualified Costco purchases; and
- Its accessibility and global reach, with the Company providing an online sales channel – including a delivery service – as well as operating an international network of wholesale warehouses exclusively for its members. ### Channels
Costco operates a website at www.costco.com, through which it provides information to customers on its activities, locations, rewards schemes and memberships. The Company also operates an online sales channel – available only to customers in the US, Canada, the UK and Mexico – which offers additional products and services that are not necessarily available in-store, including photo processing, pharmacy, travel, business delivery, and membership services. For each of the past three years, online sales have accounted for approximately 3% of the Company’s total net sales for the year.
The vast majority of Costco’s sales are made through its international network of wholesale warehouses. At 30th August 2015, the Company operated 686 memberships warehouses worldwide, of which 480 were located in the US and Puerto Rico. During 2015, Costco operated 206 warehouses in eight countries outside of the US – Canada, Mexico, the UK, Japan, Australia, Spain, Taiwan and Korea – and has plans to expand its international operations further.
Customer Relationships
Costco makes a variety of products and services available to customer in the US, Canada, Mexico and the UK available on a self-service basis, including many products and services that are exclusive to these markets. Members in these jurisdictions are able to make purchases through the Costco website, organise deliveries and manage their accounts without interacting with members of the Company’s sales staff.
As noted above, the majority of Costco’s sales are made through its physical network memberships warehouses, where customers are able to purchase products on a largely self-service basis, dealing directly with the Company’s sales representatives only at checkout or if personal assistance is required.
Costco provides in-person sales support through its teams of in-store staff, who are on-hand to handle any individual customer queries or concerns. The Company also operates dedicated customer support teams that can be contacted by email, telephone or mail to handle more complex problems or provide advice. These teams are supported by a range of online resources such as guides and FAQs that are available through the Costco website.
Additionally, customers are able to interact directly with Costco through its social media accounts with Facebook and Pinterest.
Key Activities
Costco is engaged in the operation of membership warehouses across the US and Puerto Rico, Canada, the UK, Mexico, Japan, Australia, and Spain, as well as through subsidiary companies it controls in Taiwan and Korea.
The Company’s warehouses generally operate seven days a week, providing a broad range of products, categorized as food, sundries, hardlines, fresh food, softlines, ancillary and other.
Costco also operates an online sales channel that offers members in certain jurisdictions additional products and services, including photo processing, pharmacy, travel, business delivery, and membership services.
Key Partners
Costco has a number of partnerships in place that help to supplement and support its own services. The Company’s most notable partners are its suppliers. Costco maintains direct buying relationships with producers of brand-name merchandise and goods, and does not rely disproportionately on any one supplier.
Recently, the Company also agreed a new credit partnership with Visa, replacing a previous deal with American Express. Under this partnership Visa is the only credit card payment provider accepted at Costco warehouses worldwide.
Costco also maintains partnerships with non-profits as part of its corporate responsibility program, including a partnership with the Children’s Miracle Network; with technology companies, such as with payment solutions provider Elavon; with advertising and branding firms, such as with MG2, and with hotels chains as part of its online travel service offerings.
Key Resources
Costco’s key resources are its network of physical warehouses, its online store and IT infrastructure, its supply chain and network of supplier partners, its logistics and distribution networks, and its personnel.
Cost Structure
Costco incurs costs in relation to the operation of its international network of membership warehouses, the purchase of goods and merchandise, the maintenance of its IT infrastructure, the operation of its logistics and storage infrastructure, the management of its partnerships, and the retention of its personnel.
By far Costco’s largest expense is its acquisition of merchandise across its multiple product categories, which in 2015 amounted to $101.1 billion. The Company also incurs substantial selling, general and administrative costs – including costs associated with the payment of employee salaries and benefits and the payment of rental and utility fees across its facilities – which surpassed 11.4 billion for the year ending 30th August 2015. Preopening expenses – including costs for startup operations related to new warehouses, development in new international markets, and expansions at existing warehouses – was recorded at $65 million in 2015.
Revenue Streams
Costco generates revenue through the operation of wholesale membership warehouses across markets in North America, Asia Pacific and Europe. Its revenue is divided broadly into two streams:
- Product Sales, comprising revenue derived from the sale of goods and services through the Company’s physical outlets and online stores; and
- Membership Fees, comprising revenue derived from the sale of Gold Star, Business and Executive memberships to customers worldwide. In 2015 Costco generated total revenue of $116.20 billion, up more than $3 billion on the $112.64 billion recorded by the Company in 2014. The vast majority of this revenue is attributed to sales made through the Company’s various channels, which amounted to $113.67 billion for the year. Memberships fees – with individual members paying between $55 and $110 annually – generated $2.53 billion.


Configuration
Every framework uses configuration files to define numerous parameters and initial settings. CodeIgniter configuration files define simple classes where the required settings are public properties.
Unlike many other frameworks, CodeIgniter configurable items aren’t contained in a single file. Instead, each class that needs configurable items will have a configuration file with the same name as the class that uses it. You will find the application configuration files in the app/Config folder.
Working with Configuration Files
Getting a Config Object
You can access configuration files for your classes in several different ways.
new keyword
By using the new
keyword to create an instance:
<?php
// Creating new configuration object by hand
$config = new \Config\Pager();
config()
By using the config()
function:
<?php
// Get shared instance with config function
$config = config('Pager');
// Access config class with namespace
$config = config('Config\\Pager');
$config = config(\Config\Pager::class);
// Creating a new object with config function
$config = config('Pager', false);
If no namespace is provided, it will look for the file in the app/Config folder first, and if not found, look for in the Config folder in all defined namespaces.
All of the configuration files that ship with CodeIgniter are namespaced with
Config
. Using this namespace in your application will provide the best
performance since it knows exactly where to find the files.
Note
Prior to v4.4.0, config()
finds the file in app/Config/ when there
is a class with the same shortname,
even if you specify a fully qualified class name like config(\Acme\Blog\Config\Blog::class)
.
This behavior has been fixed in v4.4.0, and returns the specified instance.
Getting a Config Property
All configuration object properties are public, so you access the settings like any other property:
<?php
$config = config('Pager');
// Access settings as object properties
$pageSize = $config->perPage;
Creating Configuration Files
When you need a new configuration, first you create a new file at your desired location. The default file location (recommended for most cases) is app/Config.
You can put configuration files in any Config folder by using a different namespace.
The class should use the appropriate namespace, and it should extend
CodeIgniter\Config\BaseConfig
to ensure that it can receive environment-specific settings.
Define the class and fill it with public properties that represent your settings:
<?php
namespace Config;
use CodeIgniter\Config\BaseConfig;
class CustomClass extends BaseConfig
{
public $siteName = 'My Great Site';
public $siteEmail =<EMAIL_ADDRESS>// ...
}
Environment Variables
One of today’s best practices for application setup is to use Environment Variables. One reason for this is that Environment Variables are easy to change between deploys without changing any code. Configuration can change a lot across deploys, but code does not. For instance, multiple environments, such as the developer’s local machine and the production server, usually need different configuration values for each particular setup.
Environment Variables should also be used for anything private such as passwords, API keys, or other sensitive data.
Dotenv File
CodeIgniter makes it simple and painless to set Environment Variables by using a “dotenv” file. The term comes from the file name, which starts with a dot before the text “env”.
Creating Dotenv File
CodeIgniter expects the .env file to be at the root of your project alongside the
app directories. There is a template file distributed with CodeIgniter that’s
located at the project root named env (Notice there’s no dot (.
) at the start?).
It has a large collection of variables your project might use that have been assigned empty, dummy, or default values. You can use this file as a starting place for your application by either renaming the template to .env, or by making a copy of it named .env.
Warning
Make sure the .env file is NOT tracked by your version control system. For git that means adding it to .gitignore. Failure to do so could result in sensitive credentials being exposed to the public.
Setting Variables
Settings are stored in .env files as a simple a collection of name/value pairs separated by an equal sign.
S3_BUCKET = dotenv
SECRET_KEY = super_secret_key
CI_ENVIRONMENT = development
When your application runs, .env will be loaded automatically, and the variables put into the environment. If a variable already exists in the environment, it will NOT be overwritten.
Getting Variables
The loaded environment variables are accessed using any of the following:
getenv()
, $_SERVER
, or $_ENV
.
<?php
$s3_bucket = getenv('S3_BUCKET');
$s3_bucket = $_ENV['S3_BUCKET'];
$s3_bucket = $_SERVER['S3_BUCKET'];
Warning
Note that your settings from the .env file are added to $_SERVER
and $_ENV
. As a side effect, this means that if your CodeIgniter application is (for example) generating a var_dump($_ENV)
or phpinfo()
(for debugging or other valid reasons), or a detailed error report in the development
environment is shown, your secure credentials are publicly exposed.
Nesting Variables
To save on typing, you can reuse variables that you’ve already specified in the file by wrapping the
variable name within ${...}
:
BASE_DIR = "/var/webroot/project-root"
CACHE_DIR = "${BASE_DIR}/cache"
TMP_DIR = "${BASE_DIR}/tmp"
Namespaced Variables
There will be times when you will have several variables with the same name. The system needs a way of knowing what the correct setting should be. This problem is solved by “namespacing” the variables.
Namespaced variables use a dot notation to qualify variable names so they will be unique when incorporated into the environment. This is done by including a distinguishing prefix followed by a dot (.), and then the variable name itself.
// not namespaced variables
name = "George"
db = my_db
// namespaced variables
address.city = "Berlin"
address.country = "Germany"
frontend.db = sales
backend.db = admin
BackEnd.db = admin
Namespace Separator
Some environments, e.g., Docker, CloudFormation, do not permit variable name with dots (.
). In such case, since v4.1.5, you could also use underscores (_
) as a separator.
// namespaced variables with underscore
app_forceGlobalSecureRequests = true
app_CSPEnabled = true
Configuration Classes and Environment Variables
When you instantiate a configuration class, any namespaced environment variables are considered for merging into the configuration object’s properties.
Important
You cannot add a new property by setting environment variables, nor change a scalar value to an array. See Environment Variables as Replacements for Data.
If the prefix of a namespaced variable exactly matches the namespace of the configuration class, then the trailing part of the setting (after the dot) is treated as a configuration property. If it matches an existing configuration property, the environment variable’s value will replace the corresponding value from the configuration file. If there is no match, the configuration class properties are left unchanged. In this usage, the prefix must be the full (case-sensitive) namespace of the class.
Config\App.forceGlobalSecureRequests = true
Config\App.CSPEnabled = true
Note
Both the namespace prefix and the property name are case-sensitive. They must exactly match the full namespace and property names as defined in the configuration class file.
The same holds for a short prefix, which is a namespace using only the lowercase version of the configuration class name. If the short prefix matches the class name, the value from .env replaces the configuration file value.
app.forceGlobalSecureRequests = true
app.CSPEnabled = true
Since v4.1.5, you can also write with underscores:
app_forceGlobalSecureRequests = true
app_CSPEnabled = true
Note
When using the short prefix the property names must still exactly match the class defined name.
Environment Variables as Replacements for Data
It is very important to always remember that environment variables contained in your .env are only replacements for existing data.
Simply put, you can change only the property value that exists in the Config class by setting it in your .env.
You cannot add a property that is not defined in the Config class, nor can you change it to an array if the value of the defined property is a scalar.
For example, you cannot just put app.myNewConfig = foo
in your .env and
expect your Config\App
to magically have that property and value at run time.
When you have the property $default = ['encrypt' => false]
in your
Config\Database
, you cannot change the encrypt
value to an array even if
you put database.default.encrypt.ssl_verify = true
in your .env.
Treating Environment Variables as Arrays
A namespaced environment variable can be further treated as an array. If the prefix matches the configuration class, then the remainder of the environment variable name is treated as an array reference if it also contains a dot.
// regular namespaced variable
Config\SimpleConfig.name = George
// array namespaced variables
Config\SimpleConfig.address.city = "Berlin"
Config\SimpleConfig.address.country = "Germany"
If this was referring to a SimpleConfig configuration object, the above example would be treated as:
<?php
$address['city'] = 'Berlin';
$address['country'] = 'Germany';
Any other elements of the $address
property would be unchanged.
You can also use the array property name as a prefix. If the environment file held the following then the result would be the same as above.
// array namespaced variables
Config\SimpleConfig.address.city = "Berlin"
address.country = "Germany"
Handling Different Environments
Configuring multiple environments is easily accomplished by using a separate .env file with values modified to meet that environment’s needs.
The file should not contain every possible setting for every configuration class used by the application. In truth, it should include only those items that are specific to the environment or are sensitive details like passwords and API keys and other information that should not be exposed. But anything that changes between deployments is fair-game.
In each environment, place the .env file in the project’s root folder. For most setups, this will be the same level as the app
directories.
Do not track .env files with your version control system. If you do, and the repository is made public, you will have put sensitive information where everybody can find it.
Registrars
“Registrars” are any other classes which might provide additional configuration properties. Registrars provide a means of altering a configuration at runtime across namespaces and files.
Registrars work if Auto-Discovery is enabled in Modules. It alters configuration properties when the Config object is instantiated.
There are two ways to implement a Registrar: implicit and explicit.
Note
Values from .env always take priority over Registrars.
Implicit Registrars
Implicit Registrars can change any Config class properties.
Any namespace may define implicit registrars by using the Config/Registrar.php file. These files are classes whose methods are named for each configuration class you wish to extend.
For example, a third-party module or Composer package might
wish to supply an additional template to Config\Pager
without overwriting whatever a developer has
already configured. In src/Config/Registrar.php there would be a Registrar
class with
the single Pager()
method (note the case-sensitivity):
<?php
namespace CodeIgniter\Shield\Config;
class Registrar
{
public static function Pager(): array
{
return [
'templates' => [
'module_pager' => 'MyModule\Views\Pager',
],
];
}
}
Registrar methods must always return an array, with keys corresponding to the properties of the target config file. Existing values are merged, and Registrar properties have overwrite priority.
Explicit Registrars
Explicit Registrars can only change the Config class properties in which they are registered.
A configuration file can also specify any number of registrars explicitly.
This is done by adding a $registrars
property to your configuration file,
holding an array of the names of candidate registrars:
<?php
namespace Config;
// ...
class MyConfig extends BaseConfig
{
public static $registrars = [
SupportingPackageRegistrar::class,
];
// ...
}
In order to act as a “registrar” the classes so identified must have a static function with the same name as the configuration class, and it should return an associative array of property settings.
When your configuration object is instantiated, it will loop over the
designated classes in $registrars
. For each of these classes it will invoke
the method named for the configuration class and incorporate any returned properties.
A sample configuration class setup for this:
<?php
namespace Config;
use CodeIgniter\Config\BaseConfig;
class MySalesConfig extends BaseConfig
{
public int $target = 100;
public string $campaign = 'Winter Wonderland';
public static $registrars = [
'\App\Models\RegionalSales',
];
}
… and the associated regional sales model might look like:
<?php
namespace App\Models;
class RegionalSales
{
public static function MySalesConfig(): array
{
return [
'target' => 45,
];
}
}
With the above example, when MySalesConfig
is instantiated, it will end up with
the three properties declared, but the value of the $target
property will be overridden
by treating RegionalSales
as a “registrar”. The resulting configuration properties:
<?php
$target = 45;
$campaign = 'Winter Wonderland';


Try a language:
State name:
Choose year:
Select an year
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
Choose crop:
SUBMIT


Skip to main content
Toggle navigation
%(title)s
LINK1
LINK2
%(main)s
%(table_of_contents)s
Back to top
Here goes a footer, if desired, maybe with author(s) and a copyright ©


Writing
maintanable tests
Why we have to test our programs ?
To ensure that what we create does what it’s supposed to do
right things
There’s always a chance that a user really will do that – no matter how silly it seems.
Something that works when one person is using it may not work when hundreds of people are using it.
There are lots of different devices, browsers, and operating systems out there.
We owe it to our users and ourselves to deliver the best application we can.
Why we are automating testing process ?
Automated Software Testing Saves Time and Money
Vastly Increases Your Test Coverage
Testing Improves Accuracy
Automation Does What Manual Testing Cannot
Automated QA Testing Helps Developers and Testers
QA and Dev Team Morale Improves
Different kinds of testing
tests clacifications
execution process
manual
semi-automated
automated
realtive to system under test
black-box
white-box
person who is doing testing
QA
Customer (end user)
Developer
areas covered by tests
functional testing
security
system load
by scope
whole system
feature
compoenent
integration
Different kinds of testing
Functional Testing
performed by testers
testing against design and use-case document
black-box testing
User Acceptance testing (UAT)
performed by clients / end-users
testing against design and use-case document
check if software meet requirements
Integration Testing
performed by QA / Dev
tests the connectivity among multiple units/components
usually white-box
End-to-end Testing
performed by QA
mimic real life scenarios
test whole system
Performance Testing
measures the response time of an application with an expected number of users
Load Testing
check the behavior of the software under normal and over peak load conditions
Stress Testing
like load testing but we resume the load on the server for a long period, say 1 hour
Break Point
increasing the load on the server, until the server cannot handle any more requests and it crashes
Smoke testing
performed by QA
check if new build is stable enough
major functionality is working
Regression Testing
performed by QA
set of functional regression tests and unit tests
find defects which were introduced after current feature / sprint
Functional vs Acceptance
Functional Testing
verification activity
correctly working product
"doing things right"
User Acceptance Testing
validation activity
cooperation with the customer
"doing right things"
Acceptance Testing "ilities"
Reliability, Availability
Scalability
Usability
Security (Securability)
Maintainability
Configurability
V-Model
Maslow's pyramid of testing
Unit tests a great because of:
they are cheap
they are fast
high coverage
point to exact error place
feedback loop is very short
Unit tests a weak in:
integration of components
configurations
integration with framework
Integrations tests a great because of:
checking contracts fullfiling
external system integration
framework expectations
Integrations tests a weak in:
they a slow
rely on configuration
coupled to frameworks
low coverage
End-to-end tests a great because of:
simualte real-life use cases
all components are integrated
End-to-end tests a weak in:
they a REALLY slow
they are fragile (always red)
find a problem - issue
Unit tests
key point
automated
written by developers
white-box
small scope (component)
F.I.R.S.T
fast
isolates / independent
irepeatable
self-verifying
timely
3 phases tests ( aka 4 phases)
arrange
act
assert
teardown
BDD style
Gherkin
Gherkin
Domain-Specific language
Business readable
specifications
seams
is a place where you can alter behavior in your program without editing in that place. the place where we can inject test double
test doubles
is a generic term for any case where you replace a production object for testing purposes
XUnit Test Patterns (Gerard Meszaros)
Test Double
Dummy
Stubs
Spies
Mocks
Fake *
Mocks vs Stubs
Stubs
Mocks
going deeper
while the unit-testing is pretty old, but ...
there is no single way how to do it
two schools of TDD
London-school
/ interaction-style
/ mockist-style
Detroit-school
/ state-based
/ classic-style
London school
top-down use cases
nice to use when there are many collaborations
heavelly usage of mocks
big coupling to implementation
hard to refactor code
Detroit school
bottom-up use cases
focus on refactoring
decouple tests from internals
try to avoid mocks
summary
high-level components - London
many collborations - London
internal algorithm - Detroit
domain enteties - Detroit
hard to test code
shared state (singlethons, static)
new operator
non deterministic code (random / Date)
spaghetti code - mixed abstractions
too many collaborations
framework issues (express middlewares/mongoose)
practices
write to audience
single “logical” assert
assert first style
don’t mock what you don't own
one mock per test
use contexts
keep your descriptions short
stubs could be better then mocks
limit deps of your specs
try to avoid Guard in tests
code-coverage
but there are more
new tools
AVA
JEST
new kind of testing
property-based
JEST snapshot testing
netflix chaos monkey testing


Home
Contact Us
About Us
Packages
Trekking
Honeymoon
Plan your trip
Book an Accomodation
Book Your
Accomodation
stay & feel free
Your're here :
Home
/ Book an Accommodation
Hotels
Guest Houses
Resorts
Forest Rest Houses


You Can Always Count On Pizza!
Pizza Motto gets its pizza dough from one of the best producers thats to why our pizza is always delicious.We always use fresh ingredients and spices to add to the flavour which makes our loyal customers coming back for more.We never disappoint :)


{{extend 'layout.html'}}
Have a friend who is still not on StopStalk, or not accepting your friend request? We got you covered ;) - just enter his/her details and you are all set!
You have reached the limit for creating custom friends
Refer 3 more friends to increase your limit
{{pass}}


The article for this week is -\Roswell 1947\
This story is discussed at length in your book as well: Ch. 7, pp 239-260.
This is a pretty neat story. Here is a very short summary:
In 1947, devices that the US government called flying disks crashed in New Mexico. Debris were collected by the army at the Roswell Army Air Base which was one of the most highly classified facilities in the US. The government said flying disks and this is the headline you just saw.
The next day, the US government retracted the press release; they said they were mistaken at first. What had fallen was now supposed to be weather balloons. It was very obvious it was not a weather balloon to anybody who had seen the debris. The government was lying, and conspiracy theories still exist to this day that the flying disk was actually a UFO.
It is true that the government was lying. It was covering up a secret program called "Project Mogul."
From your readings, try to answer the following questions.
One way to see that waves bend on the slow side is to imagine that a wave is just a marching band with each row of the band representing a crest of the wave. As the band marches, all members in a given crest try to stay in line. If one side slows down, the other side will need to turn in order to keep a straight line.
As we saw, the speed of sound is determined by the speed of molecules or atoms in the medium. In a liquid or gas, there can be two competing effects to change the speed of sound:
If you look at the ocean, the temperature decreases as you go down in depth, but the pressure increases. The two effects compete against each other and there is a minimum speed.
This is the sound channel in the ocean. Sound tends to get focused and trapped in this channel, and it will travel for miles before being dissipated. The SOFAR program is a military program to rescue downed pilots and it uses the ocean sound channel. Whales also use this sound channel to communicate over long distances.
A similar sound channel exists in the atmosphere. At high enough altitude, the temperature of the air in the atmosphere goes up because it is heated by the sun's rays. The pressure on the other hand goes down the higher you go. This competition creates a sound channel in the atmosphere where there is a minimum in the speed of sound.
The answer to Roswell (at least if you want to believe the most recent explanation) is that the 1947 flying saucer was really a big disk microphone (like Gandhi is using below circa 1940 but bigger). This was the "flying disk" and it was flying high up in the atmosphere since it was stationed in the sound channel in the hope of detecting Russia's nuclear tests. This was a top secret program and it worked with the US detecting the first of Russia's nuclear tests in 1949.


During the last decade, twitter has emerged as the primary discussion platform online for everybody who is or believes to be important. Therefore, a colossal event like a global pandemic will not just be a major topic on twitter, but looking at how it is discussed there can be quite enlightening. For everybody, who is a bit tired of looking only at infection numbers all the time, we offer some alternative numbers about the coronavirus pandemic.
For this, we have taken a total of about 1.1 million random English tweets between January and April that thematized corona and analyzed them. Enjoy!


source file: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/botocore/history.py
file stats: 28 lines, 18 executed: 64.3% covered
1. # Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2. # 3. # Licensed under the Apache License, Version 2.0 (the "License"). You 4. # may not use this file except in compliance with the License. A copy of 5. # the License is located at 6. # 7. # http://aws.amazon.com/apache2.0/ 8. # 9. # or in the "license" file accompanying this file. This file is 10. # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 11. # ANY KIND, either express or implied. See the License for the specific 12. # language governing permissions and limitations under the License. 13. import logging 14. 15. 16. HISTORY_RECORDER = None 17. logger = logging.getLogger(__name__) 18. 19. 20. class BaseHistoryHandler(object): 21. def emit(self, event_type, payload, source): 22. raise NotImplementedError('emit()') 23. 24. 25. class HistoryRecorder(object): 26. def __init__(self): 27. self._enabled = False 28. self._handlers = [] 29. 30. def enable(self): 31. self._enabled = True 32. 33. def disable(self): 34. self._enabled = False 35. 36. def add_handler(self, handler): 37. self._handlers.append(handler) 38. 39. def record(self, event_type, payload, source='BOTOCORE'): 40. if self._enabled and self._handlers: 41. for handler in self._handlers: 42. try: 43. handler.emit(event_type, payload, source) 44. except Exception: 45.  47. logger.debug("Exception raised in %s.", handler, 48. exc_info=True) 49. 50. 51. def get_global_history_recorder(): 52. global HISTORY_RECORDER 53. if HISTORY_RECORDER is None: 54. HISTORY_RECORDER = HistoryRecorder() 55. return HISTORY_RECORDER


Money Play. How should Red play 62?
pips Red=97 White=115
(CorrectAnswer= 0/0, ErrorScore= 0)
Red is well ahead in the race and his priority will be clearing points not making them, except of course his 4-pt.
If he plays 14/6 he may well have trouble clearing both his 8-pt and his bar-pt later on. He does much better by clearing the troublesome bar-pt now with 7/5, 7/1.
Knowing when to switch from priming to clearing is a necessary skill required to play top class backgammon. 14/6 is an error (just).
If he plays 14/6 he may well have trouble clearing both his 8-pt and his bar-pt later on. He does much better by clearing the troublesome bar-pt now with 7/5, 7/1.
Knowing when to switch from priming to clearing is a necessary skill required to play top class backgammon. 14/6 is an error (just).
1. Cubeful 2-ply 7/5 7/1 Eq.: +0.598 0.799 0.055 0.001 - 0.201 0.012 0.000 2. Cubeful 2-ply 14/6 Eq.: +0.597 (-0.001) 0.802 0.048 0.001 - 0.198 0.012 0.000 3. Cubeful 2-ply 14/8 5/3 Eq.: +0.515 (-0.083) 0.771 0.041 0.001 - 0.229 0.018 0.000 4. Cubeful 2-ply 14/8 6/4 Eq.: +0.374 (-0.224) 0.702 0.079 0.003 - 0.298 0.058 0.001 5. Cubeful 0-ply 14/8 3/1 Eq.: +0.280 (-0.318) 0.669 0.062 0.003 - 0.331 0.068 0.001


Show all books
Non-fiction4
Fiction25
Health4
Business17
Technical14
Neuroscience1
Self-help8
Psychology6
Biography4
Phylosophy7
Robert M. Pirsig - 2 books
Henry David Thoreau - 3 books
Aldous Huxley - 1 book
Scott Berkun - 2 books, blog
-
Robert M. Pirsig
-
Zen and the Art of Motorcycle Maintenance: An Inquiry into Values1974
- Philosophy Non-fiction


Please slide the slider to the side which you prefer. If you are not
absolutely sure you prefer one to the other, please do not slide to the end,
try to choose a middle point. Be careful to be consistent. please do that do thos
Please fill the table with comparison scores. A comparison score is a number between 1 and 9
which denotes your preference between the criteria at the right to the criteria at the top.
Only move the slider if you are sure that you prefer one option to the other.
Note that the table is reciprocal on the y=(-x) axis, the table will update itself as you enter.
In cases where the criteria is compared to itself, the result will always be 1, this cells cannot be changed.


Menu
Home
Nutrition
Fitness
Members section
About
Contact
Login
My Shopping Card
Login
Invalid username or password.
You have been logged out.
Username
:
Password
:
New user?
Register here


This demo shows how to render selected files in Custom element FileUpload. For uploading files, you should set the "uploadUrl" property to point to a Web Server file that will handle the actual Upload proces.


1.Watch TV and Movies
You don't have to have cable any more if you don't want to. Many popular TV shows and movies can be watched through services like Netflix or Hulu, which can even stream right to your TV. These usually cost money, but it's much, much cheaper than paying for cable.
2.Watch YouTube
Youtube carries all sorts of different video content. You can watch funny clips, family movies, full TV shows, full movies, clips of either of those things, or even just do things like listen to songs.
3.Play games
You can play games online (or even gamble!). Websites like Games.com offer lots of free, classic games that you can play. Another option are games like fantasy football: a number of league are available online that you can enjoy for free.
4.Listen to music.
You can also listen to music online. There are many free websites that let you listen to music that you like. Pandora is a free internet radio that lets you choose what kind of music to listen to. Slacker.com is similar to a satellite radio service with a wide variety of music of all genres. You can also try to bring up specific songs or artists using websites like YouTube.


This is the first news description today. Try to add more news. Another news goes ahead. This is the first news description today. Try to add more news. Another news goes ahead. This is the first news description today. Try to add more news. Another news goes ahead. This is the first news description today. Try to add more news. Another news goes ahead. This is the first news description today. Try to add more news. Another news goes ahead. This is the first news description today. Try to add more news. Another news goes ahead.
Read More
Heading of the news
This is the first news description today. Try to add more news. Another news goes ahead. This is the first news description today. Try to add more news. Another news goes ahead. This is the first news description today. Try to add more news. Another news goes ahead. This is the first news description today. Try to add more news. Another news goes ahead. This is the first news description today. Try to add more news. Another news goes ahead. This is the first news description today. Try to add more news. Another news goes ahead.
Read More
Heading of the news
This is the first news description today. Try to add more news. Another news goes ahead. This is the first news description today. Try to add more news. Another news goes ahead. This is the first news description today. Try to add more news. Another news goes ahead. This is the first news description today. Try to add more news. Another news goes ahead. This is the first news description today. Try to add more news. Another news goes ahead. This is the first news description today. Try to add more news. Another news goes ahead.
Read More
Heading of the news
This is the first news description today. Try to add more news. Another news goes ahead. This is the first news description today. Try to add more news. Another news goes ahead. This is the first news description today. Try to add more news. Another news goes ahead. This is the first news description today. Try to add more news. Another news goes ahead. This is the first news description today. Try to add more news. Another news goes ahead. This is the first news description today. Try to add more news. Another news goes ahead.
Read More
Heading of the news
This is the first news description today. Try to add more news. Another news goes ahead. This is the first news description today. Try to add more news. Another news goes ahead. This is the first news description today. Try to add more news. Another news goes ahead. This is the first news description today. Try to add more news. Another news goes ahead. This is the first news description today. Try to add more news. Another news goes ahead. This is the first news description today. Try to add more news. Another news goes ahead.
Read More
Heading of the news
This is the first news description today. Try to add more news. Another news goes ahead. This is the first news description today. Try to add more news. Another news goes ahead. This is the first news description today. Try to add more news. Another news goes ahead. This is the first news description today. Try to add more news. Another news goes ahead. This is the first news description today. Try to add more news. Another news goes ahead. This is the first news description today. Try to add more news. Another news goes ahead.
Read More
Hello This is my right column
Hello This is my right column
Hello This is my right column
Hello This is my right column
Hello This is my right column
Hello This is my right column
Hello This is my right column
Hello This is my right column
Hello This is my right column
Hello This is my right column
Hello This is my right column
Hello This is my right column
Hello This is my right column
Hello This is my right column
Hello This is my right column
Hello This is my right column
Hello This is my right column
Hello This is my right column
Hello This is my right column
Hello This is my right column
Hello This is my right column
Hello This is my right column
Hello This is my right column
Hello This is my right column
copyright
Contact with me ok!!
This is the main body of modal. Here you can write description of your topics. This model is now open, because you click on contact button. Click outside of the modal to close it.


TeacherDirectory is a Pakistani portal, where you can find most a basic profile overview of most University teachers all over Pakistan. Information including courses taught, a basic description, profile pictures, everything is available on this website.
This was originally the first semester project of CS101 at DHA Suffa University, developed by Kumail & Shayan.


Bruno Coulais - Song of the Sea https://www.youtube.com/watch?v=q6wVijh2n9g Orig: Gmi - Kapo: 3 I: Emi Emi Emi Emi ♪ E H ^E H E H ^E H E H ^E G E H Emi Emi A Emi Emi Emi Emi Emi ♪ E H H G F# E 1. Be tween the here, Between the now Emi Emi A Emi G6 Emi Emi Between the North, Between the Sooooooooooouth Emi Emi A7 Emi Emi Emi ♪ G F# E vE F# G A H D Between the West, Between the East Emi Emi Emi Emi A Emi G6 Emi Emi ♪ E D Hum A G F# E Between the time, Between the plaaaaaaaace R: Emi Emi7 Emi Emi Emi Emi Emi Emi Fro om the shell the Song of the Sea Emi Emi7 Emi Hmi7 Emi Emiadd2 Emi7 Emi6 Neither qui et nor calm, sear ching for love again, Emi Emi Emi Emi Emi Emi Emi Emi7 ♪ H H E E C# D Mo hrá Emi Emi Emi A Emi Emi Emi Emi Emi ♪ D D# G E 2. Between the winds, Between the waves Emi Emi A Emi G6 Emi Emi Between the sands, Between the shooooooores R: Emi Emi7 Hmi Hmi Emi Emi Emi Emi6 Fro om the shell the Song of the Sea Emi Emi Hmi Hmi Emi Emi Hmi Hmi Neither qui et nor calm sear ching for love again, Emi Emi A G G A A A 3. Between the stones, Between the storms Emi Emi A Emi G6 Emi Emi Emi Emi Esus4 Emi Emi Between belief, Between the seeeeeeeeas áááá mé púúúúúúú Note: Mo ghrá [Mo hrá] - My love, Tá mé i dtiúin [á mé pú] - I am in tune


| Path: | README.rdoc |
| Last Update: | Thu Apr 22 21:01:15 -0400 2010 |
This plugin is created to make managing Solr Search using the Sunspot gem easier. The purpose of this plugin is to provide an admin interface for non-technical people and allow for:
By creating partials in your app directory you can override how results are displayed.
The default template can be overridden by creating the following file:
app/views/search/_default_display_results.html.haml
It is suggested to create a template for each model:
app/views/search/_display_results_<model_name_lowercase_and_singular>.html.haml
For recent versions of Rails, In your project’s config/environment.rb, add the following gem dependencies:
config.gem 'sunspot', :lib => 'sunspot' config.gem 'sunspot_rails', :lib => 'sunspot/rails'
Install the gems with:
rake gems:install
If you are using an older version of Rails that doesn’t support plugins-as-gems, install the gems manually and install the plugin:
sudo gem install sunspot sunspot_rails --source=http://gems.github.com script/plugin install git://github.com/outoftime/sunspot_rails.git
Generate the file config/sunspot.yml:
script/generate sunspot
Require the rake tasks in your Rakefile:
require 'sunspot/rails/tasks'
To start up a Solr instance, issue the following:
rake sunspot:solr:start
Note that using the built-in Solr instance packaged with Sunspot is great for development, but is not recommended for production. See the Sunspot documentation for more information.
For recent versions of Rails, In your project’s config/environment.rb, add the following gem dependencies:
config.gem 'will_paginate', :version => '~> 2.3.11', :source => 'http://gemcutter.org'
Install the gems with:
rake gems:install
You may need to add the following at the end of config/environment.rb:
require "will_paginate"
HAML is used to replace the .erb templates:
gem install haml haml --rails path/to/rails/app
install plugin:
./script/plugin install git://github.com/ychaker/sunspot_admin.git
run migrations:
rake sunspotadmin:db:migrate:up
add the routes to your config/routes.rb:
map.sunspot_admin
Copyright (c) 2010 Youssef Chaker, released under the MIT license


This week I learned about the glorious data storage object that is the Hash. The following will be some fun information on how to differentiate, define, and reference arrays and hashes. Arrays and hashes are both constucts used for data storage. Their construction and syntax are different, so depending on what you're trying to do, one will likely be better than the other for specific applications.
Ordered, iteger-indexed collections of any object. Array indexing starts at 0 and goes to (n-1), where n is the number of array indices. A negative index is assumed to be relative to the end of the array—that is, an index of -1 indicates the last element of the array, -2 is the next to last element in the array, and so on.
A collection of key-value pairs. Indexing is done via arbitrary keys of any object type. Hashes order their values in the sequence that the corresponding keys were inserted. By default, hashes return 'nil' when accessing keys that do not exist in the hash. It's possible to define this value to something other than 'nil' (see below).
Array.new
is functionally the same as array = []
for creating a new array, except Array.new
has some fun options for initializing the array however you like. For example:
{% highlight ruby %}Array.new # => [] Array.new(2) # => [nil,nil] Array.new(3,"apple") # => ["apple","apple","apple"]{% endhighlight %}
Or the following:
{% highlight ruby %}example_array = [1,2,3] copycat_array = Array.new(example_array) # => [1,2,3]{% endhighlight %}
The procedure for creating a new hash is all but identical: Hash.new
, or hash = {}
. Similarly, Hash.new
can do the following:
{% highlight ruby %}Hash.new # => {} Hash.new(2) # => {} Hash.new(3,"apple") # => probably a syntax error (don't do this){% endhighlight %}
The Hash.new(argument)
is the default value for accessing keys that do not exist in the hash. If you were to create an empty hash with the argument '2', and then try to access a nonexistent key (since our hash is empty in this example, ALL keys are nonexistent), the hash would return '2' instead of returning 'nil'.
This is the easiest part:
{% highlight ruby %}puts array[integer] # => value of the array at the specified integer puts hash["key"] # => value of the hash at the specified key{% endhighlight %}
Arrays have integer index-value pairs, hashes have key-value pairs. Try creating and then accessing array/hash values at indices/keys that do not exist. That way, you'll be able to recognize it if you ever do it unintentionally.
{% highlight ruby %}puts array.index(value) # => index of the array at the specified value puts hash.key(value) # => key of the hash at the specified value{% endhighlight %}
For duplicate values at different indices/keys, the above two statements will return the first index/key that corresponds to the specified value. But don't take my word for it, try it for yourself!


The Secret Life of C++: Exceptions
Exceptions are wonderful things. They let you report error
conditions in vaguely correct ways. But C++ exceptions have to
live in a highly hostile environment. No virtual machine to coddle
them, they have to leap over large blocks of legacy C code
unharmed. TODO: More flavortext.
For more detail about exception handling, check out .
How Exceptions Work
Exceptions are basically a non-local-goto. They allow a program to
transfer control up the stack, in cases when the code at the
bottom of the stack doesn't know what else to do. They are even
more flexible then this becuase there is a registry system, so
that an exception is thrown up the stack until it hits the first
stack frame where some expressed interest in dealing with it (ie,
a catch () handler).
But this is C++, and nothing is easy. So on our way up the stack,
it is important that we properly destroy our stack frames. In C,
we could just ignore them, becuase there is no such thing as a
destructor. Of course, this simplicity makes it very hard to make
C programs that properly handle non-local gotos. But we are
talking about C++ and complexity.
So the basic way in which we handle exceptions is to walk up the
stack, calling the cleanup code as we go, until we find someone
who wants to handle our exception.
Exceptions are also objects, and the fact that they can use
inheritance is important. They have an object lifecycle, they get
created and destroyed. We will look at this in more detail.
Hello World-ish example.
A Hello Worldish example of exceptions:
- __cxa_allocate_exception
- Allocate memory for an exception.
Generally on the heap. Has access to a last-resort piece of memory
for this purpose, so we can throw out of memory exceptions.
eh_alloc.cc
- __cxa_throw
- External interface to throw in the C++ support
library. Takes three arguments: an exception object, a typeinfo
for that object, and a pointer to the destructor to call when we
are done with that object.
eh_throw.cc
- _Unwind_RaiseException
- Function called by __cxa_throw.
- _Unwind_Resume
- Resume the unwind process, called at the end
of cleanup code that didn't return to the normal thread of
execution (ie, not a catch).
- __cxa_begin_catch
- Keeps track of which exceptions are being
caught in which order, pushes this exceptoin on the stack of
exceptions that are being handled.
eh_catch.cc
- __cxa_end_catch
- Take the exception we are processing off
the stack and free it. When it returns, we should be in our normal
execution thread.
Unwinding the Stack
How does unwinding the stack really work? It happens in two passes.
On the first pass (Phase One), we walk up the stack until we find
an exception handler that wants to handle our exception. it is
even possible to find a handler up the stack that tells us to
ignore the exception. I'm told this functionality is used in
Common Lisp implementations.
The second pass (Phase Two) walks up the stack, executing the
cleanup code, until we get to the frame which is going to do the
catch.
There are two specific methods:
SjLj stack unwinding
In SjLj (Setjmp, Longjmp) stack unwinding, we do a setjmp-ish call
each time we enter a function. As we go up the stack, we just
longjmp to each setjmp point in succession.
An example of SjLj exceptions:
Dwarf2 stack unwinding
In Dwarf2 stack unwinding we don't have to do any work as long as
there are no exceptions, but complexity is increased. We create a
symbol table similar to debugging symbols that lets us find out
the right places to walk up the stack to.
Forced Unwind versus Regular
There is the concept of a Forced unwind of the stack. A Forced
unwind is not caused by an exception being thrown. A forced unwind
is when the exception handlers on the call stack aren't allowed to
catch an exception, and some other code takes care of knowing when
to stop. Two examples of forced unwind are longjmp() and
pthread_cancel().
Rethrowing
An example of rethrowing a caught exception:
Catching and Throwing a Different Exception
See the above example. Pretty straightforward. unless we want to
throw and catch an exception
while handling an exception.
noexcept specification on a function
The noexcept specification will cause the unwind Phase One to fail
with unexepected exception.
TODO: Example
Passing through code that doesn't know about exceptions
THis works out, partly because code that doesn't know about
exceptions can't have destructors to be called. More succinctly,
longjmp just works in native C code, stack frames can just be
discarded.
TODO: Does it work for library code which was compiled without exceptions in dwarf unwinding?