{% extends "tutorial.html" %} {% block head %} {% endblock %} {% block onload %}{% endblock %} {% block iscompatible %} return !!(window.indexedDB || window.webkitIndexedDB || window.mozIndexedDB || window.msIndexedDB); {% endblock %} {% block html5badge %} {% endblock %} {% block content %}
Because web databases let you store data and assets in users' browsers and provide you with rich query abilities, they enable you to create a new breed of web applications that can work online, offline, and states in between where the connection is flaky. Here are the main differences between the two databases.
| Category | WebSQL | IndexedDB |
|---|---|---|
| Advantages | A real, relational database implementation on the client (SQLite). | * Allows fast indexing and searching of objects, so in a web application scenario, you can manage your data and read/write it fast.
* A NoSQL database that let you work with your JavaScript objects and indexing them based on your application needs. * Works in asynchronous mode with moderately granular locking per transaction. This allows you to work inside the event-driven module of JavaScript. |
| Disadvantages | * The spec is deprecated.
* Overhead of SQL language you need to master and transform your JavaScript objects into relational schema * Not object driven |
Harder to understand if you are coming from the world of relational databases. |
| Location | Tables contain columns and rows | objectStore contains Javascript objects and keys |
| Query Mechanism | SQL | Cursor APIs, Key Range APIs, and Application Code |
| Transaction | Lock can happen on databases, tables, or rows on READ_WRITE transactions | Lock can happen on database VERSION_CHANGE transaction, on an objectStore READ_ONLY and READ_WRITE transactions. |
| Transaction Commits | Transaction creation is explicit. Default is to rollback unless we call commit. | Transaction creation is explicit. Default is to commit unless we call abort or there is an error that is not caught. |
Since November 18, 2010, the W3C announced that Web SQL database is a deprecated specification. This is a recommendation for web developers to no longer use the technology as effectively, the spec will receive no new updates and browser vendors aren't encouraged to support this technology. The new alternative is IndexedDB which is already available on Chrome 12+ and Firefox 5+, and, soon, in IE 10 as well.
In this tutorial, we will take a simple example of a todo list and move our WebSQL code to indexedDB one.
In the majority of cases where you are using web database you will be using the asynchronous API. The asynchronous API is a non-blocking system and, as such, does not get data through return values, but rather will gets data delivered to a defined callback function. We are going to use the asynchronous APIs in both webSQL and IndexedDB. Let's see how we creating the database in each case.
You can only create a table by executing a CREATE TABLE SQL statement inside a transaction. We have defined a function that create a table in the body onload event. If the table doesn't already exist, a table is created. In our case, let's have 2MB of memory allocated to our todo list.
var db = openDatabase('todos1', '1.0', 'todo list example db', 2 * 1024 * 1024);
In IndexedDB, we need a bit more code at the initialization phase because we wish to handle the prefix per browser (webkit, moz, etc). This enable us to have cleaner code during our application. Moreover, when more browsers implement this feature, we could use the window object without any prefix so our code is ready for that.
var indexedDB = window.indexedDB || window.webkitIndexedDB || window.mozIndexedDB || window.msIndexedDB; // Handle the prefix of Chrome to IDBTransaction/IDBKeyRange. if ('webkitIndexedDB' in window) { window.IDBTransaction = window.webkitIDBTransaction; window.IDBKeyRange = window.webkitIDBKeyRange; } indexedDB.db = null; // Hook up the errors to the console so we could see it. // In the future, we need to push these messages to the user. indexedDB.onerror = function(e) { console.log(e); };
In WebSQL, we want to create a table. This is the code that define it for us:
if (database) { database.transaction(function(tx) { tx.executeSql("CREATE TABLE IF NOT EXISTS tasks (id REAL UNIQUE, text TEXT)", []); }); }
In indexedDB, we create an object store inside a 'SetVersion' transaction. SetVersion is the only place in our code that we can alter the structure of the database. In it, we can create and delete object stores and build and remove indexes. Object stores contain your JavaScript objects and you can reach your data by key or by setting indexes. A call to setVersion returns an IDBRequest object where we can attach our callbacks. When successful, we start to create our object stores.
indexedDB.open = function() { var request = indexedDB.open("todos"); request.onsuccess = function(e) { var v = "2.0 beta"; // yes! you can put strings in the version not just numbers todoDB.indexedDB.db = e.target.result; var db = todoDB.indexedDB.db; // We can only create Object stores in a setVersion transaction; if (v!= db.version) { var setVrequest = db.setVersion(v); // onsuccess is the only place we can create Object Stores setVrequest.onfailure = todoDB.indexedDB.onerror; setVrequest.onsuccess = function(e) { if (db.objectStoreNames.contains("todo")) { db.deleteObjectStore("todo"); } var store = db.createObjectStore("todo", {keyPath: "timeStamp"}); todoDB.indexedDB.getAllTodoItems(); }; } else { todoDB.indexedDB.getAllTodoItems(); } }; request.onfailure = todoDB.indexedDB.onerror; };
Object Stores are created with a single call to createObjectStore()
.
The method takes a name of the store and an parameter object. The parameter object is
very important as it lets you define important optional properties. In our case, we define
a keyPath
that is the property that makes an individual object in the store unique. That
property in this example is "timeStamp". "timeStamp" must be present on every object that is
stored in the objectStore.
Note: according to latest IndexedDB spec: http://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html
setVersion()
will be taken out. Thus, our code snippets here is going to change and the version setting will be part of the open()
function of the database.
Let's have a look at the most basic ability: adding data to our database. In both cases, we are using the location (table or object store) and then adding some data into it.
function addTodo() { var todo = document.getElementById("todo"); var task = { "id": new Date().getTime(), "text": todo.value }; database.transaction(function(tx) { tx.executeSql('INSERT INTO tasks (id, text) values (?, ?)', [task.id, task.text]); }); todo.value = ''; // Clean for the next todo. showAll(); }
We first get a quick reference to the database object todoDB.indexedDB.db, initiate a READ_WRITE transaction and get a reference to our object store. There are three types of transactions:
indexedDB.addTodo = function() { var db = todoDB.indexedDB.db; var trans = db.transaction(['todo'], IDBTransaction.READ_WRITE); var store = trans.objectStore('todo'); var data = { "text": todoText, // todoText should be visible here "timeStamp": new Date().getTime() }; var request = store.put(data); request.onsuccess = function(e) { todoDB.indexedDB.getAllTodoItems(); }; request.onerror = function(e) { console.log("Error Adding: ", e); }; };
After we put 'huge' amount of data in our database we wish to get it out.
In webSQL we will use the familiar syntax of 'Select'.
function showAll() { var ourList = document.getElementById('ourList'); ourList.innerHTML = ''; database.transaction(function(tx) { tx.executeSql('SELECT * FROM tasks', [], function (tx, results) { var len = results.rows.length; var ul = document.createElement("ul"); for (var i = 0; i < len; i++) { var item = results.rows.item(i); var li = document.createElement("li"); var t = document.createTextNode(i + ") key: " + item.id + " => Todo text: " + item.text); // Have the ability to delete the item using data attributes and a link. var a = document.createElement("a"); a.textContent = " [Delete]"; a.dataset.key = item.id; a.dataset.value = item.text; a.addEventListener("click", function() { deleteTodo(this.dataset.key, this.dataset.val ); }, false); li.appendChild(t); li.appendChild(a); ul.appendChild(li); } // Update the DOM only after we have ALL items in one element (performance baby...) ourList.appendChild(li); }); }); }
We open a transaction on our object store. This is set to READ_ONLY, because we only wish to retrieve data. Next, we open a cursor and iterate with it on our list of todos. All of these commands used in this sample are asynchronous and, as such, the data is not returned from inside the transaction.
function showAll() { document.getElementById("ourList").innerHTML = ""; var request = window.indexedDB.open("todos"); request.onsuccess = function(event) { // Enumerate the entire object store. var db = todoDB.indexedDB.db; var trans = db.transaction(["todo"], IDBTransaction.READ_ONLY); var request = trans.objectStore("todo").openCursor(); var ul = document.createElement("ul"); request.onsuccess = function(event) { // This hack is to allow our code to run with Firefox (older versions then 6) var cursor = request.result || event.result; // If cursor is null then we've completed the enumeration - so update the DOM if (!cursor) { document.getElementById("ourList").appendChild(ul); return; } var li = document.createElement("div"); li.textContent = "key: " + cursor.key + " => Todo text: " + cursor.value.text; ul.appendChild(li); cursor.continue(); } } }
We use a simple SQL to delete a todo item base on its ID. We took the extra mile here, and we even, warn the user. Because that's how we like to roll...
function deleteTodo(id, text) { if (confirm("Are you sure you want to Delete "+ text +"?")) { database.transaction(function(tx) { tx.executeSql('DELETE FROM tasks WHERE id=?', [id]); }); showAll(); } }
Start a transaction, reference the Object Store with your object in and issue a delete command with the unique ID of your object.
indexedDB.deleteTodo = function(id, text) { if (confirm("Are you sure you want to Delete " + text + "?")) { var db = todoDB.indexedDB.db; var trans = db.transaction(["todo"], IDBTransaction.READ_WRITE); var store = trans.objectStore("todo"); var request = store.delete(id); request.onsuccess = function(e) { todoDB.indexedDB.getAllTodoItems(); }; request.onerror = function(e) { console.log("Error Adding: ", e); }; } };
you can find the full code on github: https://github.com/greenido/WebSQL-to-IndexedDB-example and here is a live example.
As WebSQL is deprecated, we recommend web developers to stop using the technology in new projects, as, effectively, the spec will receive no new updates and browser vendors aren't encouraged to support this technology. The replacement is IndexedDB. As a 'NoSQL' database, IndexedDB is very different from relational databases, and it give us lots of power. IndexedDB let us create an Object Store for a type of data and simply persist Javascript Objects to that store. Each Object Store can have a collection of Indexes that make it efficient to query and iterate across.


Enter text in the text box below. The text will be presented below with reserved characters for SOLR (+ - & | ! ( ) { } [ ] ^ " ~ * ? : \) escaped, and the whole term properly escaped for placement in a SOLR query URL.
Original:
SOLR encoded:
SOLR and URL encoded:


|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.cilib.Container.Graph.Vertex
This class represents a Vertex
as defined in a Graph
in modern Graph theory.
The vertex has incident and eminating edges.
| Constructor Summary | |
Vertex()
Constructor. |
|
Vertex(java.lang.Object identity)
Constructor that specifies a value for the Vertex identity |
| Method Summary | |
void |
addEminatingEdge(Edge e)
Add an Edge to the eminaining edge set of the Vertex |
void |
addIncidentEdge(Edge e)
Add an Edge to the incident edge set of the Vertex |
int |
getDegree()
Get the degree associated with this vertex |
java.util.ListIterator |
getEmanatingEdges()
Get an iterator that can cycle through all the eminating edges on this Vertex |
int |
getEminatingEdgeCount()
Returns the number of eminating edges from this vertex |
java.lang.Object |
getIdentity()
Get the identity of this Vertex |
int |
getIncidentEdgeCount()
Returns the number of incident edges on this Vertex |
java.util.ListIterator |
getIncidentEdges()
Get an iterator that can cycle through all the incident edges on this Vertex |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public Vertex()
public Vertex(java.lang.Object identity)
Vertex
identity
identity
- The object that will give the vertex an identity| Method Detail |
public void addEminatingEdge(Edge e)
Edge
to the eminaining edge set of the Vertex
e
- The Edge
to be addedpublic void addIncidentEdge(Edge e)
Edge
to the incident edge set of the Vertex
e
- The Edge
to be addedpublic java.lang.Object getIdentity()
Vertex
Object
representing the Vertex
identitypublic java.util.ListIterator getIncidentEdges()
Vertex
public java.util.ListIterator getEmanatingEdges()
Vertex
public int getDegree()
public int getEminatingEdgeCount()
vertex
Vertex
public int getIncidentEdgeCount()
Vertex
Vertex
public java.lang.String toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |


Slav Guys
HOME
GAMES
VIDEOS
DOWNLOADS
ABOUT US
BLOG
VIDEOS
Eastern Europe Style
Making Pancakes
Washing Clothes
Quick Breakfast
Shorts
Video Game Attacks!
Killer with a knife & Victim with a gun


|
Resetting Your Password
|
|
Need to reset your password? No problem. Just click the button below and follow the
process. If the button doesn’t work you can use the following link too.
|
|
Reset My Password
|
|
{link}
|
|
|
If you didn’t request to change your TFCL PORTAL password, simply delete this email. You don’t
have to do anything, so that’s easy.
|
|


Join Us
Already have an account
Sign In
Register Here
Employee ID
Employee Name
Employee Image
Gender
Select an Option
Male
Female
Others
Date Of Birth
City
Contact No
Designation
Date Of Joining
Email
Password
Confirm Password
Register


LIVE
MOTION
Camera 1
Camera 2
TIMELAPSE
List of hours of day
8:00
9:00
10:00
11:00
12:00
13:00
14:00
15:00
16:00
List of days of week
8:00
8:00
8:00
8:00
8:00
8:00


|
| | PCA (const bool scaleData=false) |
| | Create the PCA object, specifying if the data should be scaled in each dimension by standard deviation when PCA is performed. More...
|
| |
| void | Apply (const arma::mat &data, arma::mat &transformedData, arma::vec &eigval, arma::mat &eigvec) const |
| | Apply Principal Component Analysis to the provided data set. More...
|
| |
| void | Apply (const arma::mat &data, arma::mat &transformedData, arma::vec &eigVal) const |
| | Apply Principal Component Analysis to the provided data set. More...
|
| |
| double | Apply (arma::mat &data, const size_t newDimension) const |
| | Use PCA for dimensionality reduction on the given dataset. More...
|
| |
| double | Apply (arma::mat &data, const int newDimension) const |
| | This overload is here to make sure int gets casted right to size_t. More...
|
| |
| double | Apply (arma::mat &data, const double varRetained) const |
| | Use PCA for dimensionality reduction on the given dataset. More...
|
| |
| bool | ScaleData () const |
| | Get whether or not this PCA object will scale (by standard deviation) the data when PCA is performed. More...
|
| |
| bool & | ScaleData () |
| | Modify whether or not this PCA object will scale (by standard deviation) the data when PCA is performed. More...
|
| |
| std::string | ToString () const |
| |
This class implements principal components analysis (PCA).
This is a common, widely-used technique that is often used for either dimensionality reduction or transforming data into a better basis. Further information on PCA can be found in almost any statistics or machine learning textbook, and all over the internet.
Definition at line 30 of file pca.hpp.
| double mlpack::pca::PCA::Apply |
( |
arma::mat & |
data, |
|
|
const double |
varRetained |
|
) |
| const |
Use PCA for dimensionality reduction on the given dataset.
This will save as many dimensions as necessary to retain at least the given amount of variance (specified by parameter varRetained). The amount should be between 0 and 1; if the amount is 0, then only 1 dimension will be retained. If the amount is 1, then all dimensions will be retained.
The method returns the actual amount of variance retained, which will always be greater than or equal to the varRetained parameter.
- Parameters
-
| data | Data matrix. |
| varRetained | Lower bound on amount of variance to retain; should be between 0 and 1. |
- Returns
- Actual amount of variance retained (between 0 and 1).


Johnson | April 6, 2017
The digital age has spurred a demand for professionals in the fields of computing and computer science. Based on the findings of recent reports, the demand isn’t slowing down any time soon, which is great for prospective students who are keen to forge a career in this respected discipline.
According to a report from The Complete University Guide, the UK job market is experiencing a shortage of graduates with digital expertise. “In the software industry alone there are 20,000 graduate vacancies a year, and only 7,500 computer science graduates to fill them,” says Hugh Millward, Microsoft’s Director of Corporate Affairs.
Meanwhile, a report by Computer World UK has shown that the most popular jobs of 2017 includes the IT profession, with research by the global IT industry body CompTIA reporting that UK IT staff job postings have increased by 10 percent each year. On top of that, the emerging threats of cyber hacking and identity theft have led to a boost in corporate security measures, with companies worldwide seeking to hire professionals who specialise in cyber security to protect their business assets.
If this field is truly of interest to you, a degree in Computing is exactly what you need. A general degree covers many areas, giving students the chance to explore subject areas before selecting their specialisation. Among the most common higher education pathways are disciplines like Computer Science, Cyber Security, Information Technology and Software Engineering. Courses are known to hold a practical-focus, equipping students with subject-specific and transferable skills that make them highly employable graduates.
Here are 5 UK universities you should consider to kick-start your career in computing…
This School provides an innovative computing degree that promises to equip graduates with the technical skills the industry demands, on top of the entrepreneurial and social expertise that grant a competitive edge. From Computer Games Development, to Computing Network Technology, to Forensic Computing and beyond, UCLan offers a breadth and depth of courses – all of which provide invaluable optional placement years – to produce creative students with the proficiencies to work with rapidly changing technologies.
At Kent’s School of Computing, Faculty aim to do more than provide students with a first-rate academic experience. Here, you’ll develop key transferable skills that are considered vital for a successful career. The staff ensure that pupils pursuing a Computing degree are equipped with the knowledge and proficiencies that will make them highly sought-after in the graduate sphere.
Oxford Brookes University promises a lively, progressive and supportive study environment. At the Department of Computing and Communication Technologies, the Faculty believes in producing well-rounded graduates that develop a wide range of cognitive, practical, analytical, creative and professional expertise.
With over 92 percent of graduates in work or further study six months after graduation, it’s clear that a degree from Ulster University can strengthen your future employment opportunities. The Faculty of Computing and Engineering offers industry-led and professionally recognised degrees at both undergraduate and postgraduate level. The programmes include a mix of theory and application with a focus on employability. Each teaching course is underpinned by world-class research and established industry links.
With an excellent record for teaching and research in the Computing field, there’s no better place than Sussex to kick-start your education. The School of Engineering and Informatics offers a rich and stimulating curriculum that connects computer science with a broad range of application areas. Many of its degrees are interdisciplinary, drawing on and contributing to subjects like business and management, media studies and more.
*Some of the institutions featured in this article are commercial partners of Study Abroad


easy to interact with
This is your private user page and below is your private key. Keep this safe and secret. This key is used for all interactions with the easy high scores API. When running a local application, you should obfuscate this key where possible.
Your private key
If your data is ill-formed, you will recieve a 400 (Bad Request) status code along with a message showing the correct format. If your private key is incorrect or missing, you will recieve a 401 (Unauthorized) status code with an error message. Otherwise, expect a 200 (Successful) status code with "OK" as the message.
You can share your public key to allow read-only access to your score-list through the route below. This is the only thing you should share from this page.
Read-only access (via public key)


Learning LDA and inference with stream data from wikipedia¶
The purpose of this tutorial is to show you how to train the LDA model based on a specific data - stream data (inlude articles from wikipedia website) and after that, use this model to infer a new data. In this part, we’ll work with stream data, so I’ll use the learning method by stream scheme. Of course, the online or regularized methods are also used for this case. We will select a detailed method to guide all of you. If you want to go into detail , you can find out more these methods in user guide document.
Contents
Data¶
To design and implement for this part, we refered source code Online-VB (Hoffman, 2010). Authors fit the LDA model to 3.3 million articles from Wikipedia (actually is a large corpora), and a vocabulary is extracted from this corpus. In each training iteration, we’ll crawl randomly a mini-batch articles from Wikipedia and analyze it for training. To understand more detail, you can infer how to load a mini-batch from wikipedia
Learning¶
We will demo with the learning method Streaming VB
First, we’ll create a object used for load data
In[1]:
from tmlib.datasets.wiki_stream import WikiStream
# Create object to load mini-batch from website
training_data = WikiStream(64, 100)
In setting above, size of a mini-batch is 64, and number of mini-batches used for traning (or number of interations to run the learning algorithm) is 100
After create object to load data, we need set value for parameters . By default, number of topics is 100, alpha=0.01, eta=0.01, tau0=0.9, kappa=1.0, conv_infer=50, iter_infer=50
In[2]:
from tmlib.lda.Streaming_VB import StreamingVB
# get number of unique terms
num_terms = training_data.get_num_terms()
#create object and setting parameters in default
obj_strvb = StreamingVB(num_terms)
After that, we learn model as follow:
In[3]:
# learn model, model and statistics are saved in folder model_vb
model = obj_strvb.learn_model(training_data, save_model_every=5, compute_sparsity_every=5,
save_statistic=True, save_top_words_every=5, num_top_words=10,
model_folder='model_stream_vb')
See class LdaLearning to know what the above parameters mean. The algorithm will be stopped after 100 iterations. At the 4th, 9th, 14th, …, 99th loop, the value of \(\lambda\), sparsity document, time and top words of each topic are saved. The folder model_stream_vb inludes these files:
- model_batch4.npy, model_batch9.npy, model_batch14.npy, … , model_batch99.npy. These files save value of \(\lambda\)
- top_words_batch4.txt, top_words_batch9.txt, …, top_words_batch99.txt to save top 10 words of topics
- file sparsity100.csv and time100.csv save respectly document sparsity and time (time of E-step, time M-step in each iteration)
Finally, we save the value of \(\lambda\), display top 10 words of topics as follow:
In[4]:
# save lambda to a file text
model.save('model_stream_vb/lambda_final.txt', file_type='text')
# Estimating beta by normalize lambda
model.normalize()
# Display top 10 words of 10 topic
model.print_top_words(10, training_data.vocab_file, show_topics=10)
# or you can show all of topics by
# model.print_top_words(10, training_data.vocab_file)
# or you can save to a file named top_words_final.txt
# model.print_top_words(10, training_data.vocab_file, result_file='model_stream_vb/top_words_final.txt')
Output:
topic 000
new 0.008113
first 0.004547
time 0.003746
two 0.003542
york 0.002589
university 0.002514
school 0.002432
world 0.002413
three 0.002332
october 0.002200
topic 001
first 0.001946
two 0.001712
new 0.001666
time 0.001343
years 0.001296
university 0.001249
three 0.001050
states 0.001046
number 0.001033
world 0.001029
topic 002
first 0.001967
two 0.001936
time 0.001618
new 0.001458
city 0.001394
years 0.001256
university 0.001232
duke 0.001223
war 0.001202
world 0.001189
topic 003
score 0.186668
team 0.108287
seed 0.026724
round 0.009304
mens 0.006177
first 0.005672
time 0.005346
final 0.005298
report 0.005259
event 0.004698
topic 004
first 0.002050
art 0.001949
new 0.001816
two 0.001546
time 0.001318
university 0.001036
united 0.001015
city 0.000984
series 0.000980
day 0.000946
topic 005
first 0.004525
new 0.003888
two 0.002278
time 0.002250
united 0.001957
named 0.001742
war 0.001675
years 0.001493
john 0.001473
year 0.001444
topic 006
first 0.001904
new 0.001838
two 0.001798
time 0.001594
university 0.001481
ship 0.001445
group 0.001380
number 0.001303
united 0.001280
member 0.001171
topic 007
first 0.003349
new 0.002382
two 0.002283
time 0.001614
three 0.001502
art 0.001463
number 0.001443
life 0.001332
field 0.001295
known 0.001275
topic 008
new 0.002254
first 0.002059
two 0.001728
time 0.001414
world 0.001260
states 0.001254
air 0.001119
army 0.001067
city 0.001044
art 0.001039
topic 009
two 0.003724
first 0.003343
time 0.002620
new 0.002562
city 0.002016
august 0.001570
october 0.001520
game 0.001482
year 0.001446
january 0.001401
Inference for new stream data¶
Assume that a stream data arrives and we have to infer for all of documents in this block. First, we need load stream data and return a corpus with a specific format
In[5]:
from tmlib.datasets import base
# size of data is 10 documents
data = WikiStream(10,1)
# return corpus of 10 documents with term-frequency format
new_corpus = data.load_mini_batch()
After that, execute inference for new corpus
from tmlib.lda.ldamodel import LdaModel
# create object model
learned_model = LdaModel(0,0)
# load value of lambda from file saved above
learned_model.load('model_stream_vb/lambda_final.txt')
# inference by create new object for OnlineVB
object = StreamingVB(num_terms, lda_model=learned_model)
theta = object.infer_new_docs(new_corpus)
# or you can infer by using object in learning phase
# theta = obj_strvb.infer_new_docs(new_corpus)
base.write_topic_mixtures(theta, 'model_stream_vb/topic_mixtures.txt')


Portfolio for Alex Warner - web developer
Here is some of my current skills:
- Using the terminal to navigate my documents, rename, move, make git commits and much more!
- Basics on using html, asigning classes, adding pictures, making columns and styling with css
- Learned some basic use of the styling tool bootstrap
- Learned how to create README files using markdown language
- learned to style html pages in css
Here is some of the projects made by my partners and I:
Projects created by solely me
These are only a few of my favorite projects that I feel are worth displaying. There will be plenty more to come!
About the author:
Alex Warner currently spends his time learning to code full time at the school Epicodus, playing with his dog Sherman, and playing the guitar. He lives in a small suburb of Portland, Oregon called Saint Helens. He can be contacted<EMAIL_ADDRESS>You can look at any of his repositories at http://www.github.com/warneralex0914


--- title: Centennial Acquires Cross Pointe Center in Saginaw, Texas class: latest-news parent: Latest News categories: ---
Centennial Real Estate Company, a Dallas-based shopping center owner and operator, has purchased Cross Pointe Center, located in Saginaw, Texas.
The 45,465-square-foot neighborhood center is located at Business 287 & Bailey Boswell Rd. and is adjacent to a Super Wal-mart. Constructed in 2005, the center is more than 80 percent leased with tenants including Dollar Tree, Cato, Radio Shack, Hibbitts Sports, AT&T, Cici’s Pizza, Fantastic Sam’s and Nationwide Insurance.
“Surrounded by the strong retail market of Saginaw and just seven minutes from downtown Fort Worth, Cross Pointe Center is exactly the type of neighborhood center where needs-based spending is resilient and properties perform well in all economic cycles,” said Mathew Smith, Senior Vice President of Centennial Real Estate. “We are pleased to have the opportunity to acquire a center that is leased to top quality tenants in a high-demand shopping area.”
Cross Pointe Center has great visibility and access along highway 287 and, within a five-mile radius of the center, there are 97,117 residents with an average household income of $69,190. Approximately 8,000-square-feet of space is available for lease.
The center will be managed by Centennial Real Estate Managment.


Extracts colors from various image types, returns customized reports and plots treemaps and 3D scatterplots of image compositions. Selected colors and color ranges can be excluded from the analysis.
| Version: | 0.1.3 |
| Imports: | purrr, stringr, pixmap, tibble, treemap, rsvg, png, jpeg, tiff, bmp, dplyr, plotly, magrittr, plotwidgets |
| Published: | 2018-10-07 |
| Author: | David Zumbach [aut, cre] |
| Maintainer: | David Zumbach <david.zumbach at gfzb.ch> |
| BugReports: | https://github.com/zumbov2/colorfindr/issues |
| License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
| NeedsCompilation: | no |
| Materials: | NEWS |
| CRAN checks: | colorfindr results |
| Reference manual: | colorfindr.pdf |
| Package source: | colorfindr_0.1.3.tar.gz |
| Windows binaries: | r-devel: colorfindr_0.1.3.zip, r-release: colorfindr_0.1.3.zip, r-oldrel: colorfindr_0.1.3.zip |
| OS X binaries: | r-release: colorfindr_0.1.3.tgz, r-oldrel: colorfindr_0.1.3.tgz |
| Old sources: | colorfindr archive |
Please use the canonical form https://CRAN.R-project.org/package=colorfindr to link to this page.


| Topics | Assignments | Coq | Summaries | Presentations | Sources |
Semester: Spring 2021
Syllabus: [MS DOCX]
Course Code: PBM 763 (for Course Search in ORTUS)
Creditpoints: TBD
Course Home: BITL.LV
Please read the relevant subchapters from the textbook (see below).
The link to the textbook (Kenneth Rosen. Discrete Mathematics, 2019) is in ORTUS.
See also
the Playlist below are by
Kimberly Brehm.


Kafka Connectors
Create new
Connector
Cluster
Class
Type
Tasks
Status
Action
No Connectors found!
Actions
Edit
Delete


|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.security.PermissionCollection
public abstract class PermissionCollection
Abstract class representing a collection of Permission objects.
With a PermissionCollection, you can:
add
method.
implies
method.
elements
method.
When it is desirable to group together a number of Permission objects
of the same type, the newPermissionCollection
method on that
particular type of Permission object should first be called. The default
behavior (from the Permission class) is to simply return null.
Subclasses of class Permission override the method if they need to store
their permissions in a particular PermissionCollection object in order
to provide the correct semantics when the
PermissionCollection.implies
method is called.
If a non-null value is returned, that PermissionCollection must be used.
If null is returned, then the caller of newPermissionCollection
is free to store permissions of the
given type in any PermissionCollection they choose
(one that uses a Hashtable, one that uses a Vector, etc).
The PermissionCollection returned by the
Permission.newPermissionCollection
method is a homogeneous collection, which stores only Permission objects
for a given Permission type. A PermissionCollection may also be
heterogeneous. For example, Permissions is a PermissionCollection
subclass that represents a collection of PermissionCollections.
That is, its members are each a homogeneous PermissionCollection.
For example, a Permissions object might have a FilePermissionCollection
for all the FilePermission objects, a SocketPermissionCollection for all the
SocketPermission objects, and so on. Its add
method adds a
permission to the appropriate collection.
Whenever a permission is added to a heterogeneous PermissionCollection
such as Permissions, and the PermissionCollection doesn't yet contain a
PermissionCollection of the specified permission's type, the
PermissionCollection should call
the newPermissionCollection
method on the permission's class
to see if it requires a special PermissionCollection. If
newPermissionCollection
returns null, the PermissionCollection
is free to store the permission in any type of PermissionCollection it
desires (one using a Hashtable, one using a Vector, etc.). For example,
the Permissions object uses a default PermissionCollection implementation
that stores the permission objects in a Hashtable.
Subclass implementations of PermissionCollection should assume
that they may be called simultaneously from multiple threads,
and therefore should be synchronized properly. Furthermore,
Enumerations returned via the elements
method are
not fail-fast. Modifications to a collection should not be
performed while enumerating over that collection.
Permission
,
Permissions
,
Serialized Form| Constructor Summary | |
|---|---|
PermissionCollection()
|
| Method Summary | |
|---|---|
abstract void |
add(Permission permission)
Adds a permission object to the current collection of permission objects. |
abstract Enumeration<Permission> |
elements()
Returns an enumeration of all the Permission objects in the collection. |
abstract boolean |
implies(Permission permission)
Checks to see if the specified permission is implied by the collection of Permission objects held in this PermissionCollection. |
boolean |
isReadOnly()
Returns true if this PermissionCollection object is marked as readonly. |
void |
setReadOnly()
Marks this PermissionCollection object as "readonly". |
String |
toString()
Returns a string describing this PermissionCollection object, providing information about all the permissions it contains. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public PermissionCollection()
| Method Detail |
|---|
public abstract void add(Permission permission)
permission
- the Permission object to add.
SecurityException
- - if this PermissionCollection object
has been marked readonlypublic abstract boolean implies(Permission permission)
permission
- the Permission object to compare.
public abstract Enumeration<Permission> elements()
public void setReadOnly()
add
.
public boolean isReadOnly()
add
.
By default, the object is not readonly. It can be set to
readonly by a call to setReadOnly
.
public String toString()
super.toString() ( // enumerate all the Permission // objects and call toString() on them, // one per line.. )
super.toString
is a call to the toString
method of this
object's superclass, which is Object. The result is
this PermissionCollection's type name followed by this object's
hashcode, thus enabling clients to differentiate different
PermissionCollections object, even if they contain the same permissions.
toString
in class Object
|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2004, 2010 Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.


Madrid strikes early again on way to 4-0 rout of Eibar
EIBAR, Spain (AP) - Real Madrid got the job done early again, scoring three goals in the first 30 minutes as it thrashed Eibar 4-0 in the Spanish league on Saturday.
The victory came three days after Madrid took a three-goal lead by the 14th minute of a 6-0 rout of Galatasaray in the group stage of the Champions League.
The win at Eibar left Madrid top of the standings with 25 points, two more than Real Sociedad and three more than Barcelona, which hosts Celta Vigo later Saturday. Sociedad was held by last-place Leganés to a 1-1 draw on Friday.
It was one of the best games of the season for Madrid, which was up 2-0 after goals by Karim Benzema in the 17th and Sergio Ramos in the 20th. Benzema added another in the 29th and Federico Valverde also netted in the 61st.
Benzema’s second goal and the strike by Ramos came from penalties after fouls on Eden Hazard and Lucas Vázquez.
Madrid right back Dani Carvajal made his 250th appearance for the club.
It was only the third away win by Madrid in 11 league matches since coach Zinedine Zidane returned to the club late last season.
The team has kept a clean sheet in five straight matches in all competitions, since a 1-0 loss at Mallorca in the Spanish league.
Eibar, which was coming off two straight wins, dropped to 15th place, staying six points clear of the relegation zone.
More AP soccer https://apnews.com/Soccer and https://twitter.com/AP_Sports
Sign up for Daily Newsletters
Copyright © 2019 The Washington Times, LLC.
Please read our comment policy before commenting.


Interested in applying to The Forum Helpers? Check out our how to apply page.
We are a small group of people on Scratch who help around on the Discussion Forums by answering questions, responding to bug reports, and giving our thoughts on suggestions made by Scratchers from all over the world. We don't "police" the forums, but we try our best to assist other users whenever we can.
All of us are members of this studio.
We generally frequent the Suggestions, Bugs And Glitches, Questions About Scratch, and Help With Scripts forums.
For a detailed explanation on how to join our group, please check out the how to apply page.


{% include '../includes/head.html' %}
{% block content %}{% endblock %}
{% include '../includes/foot.html' %} {% include '../includes/scripts.html' %}


UTC -3
Voltage: 220 V
Frequency: 50 Hz
Danish krone (Dkr) of 100 ore.
There are ATMs but many are inside and are closed from 18:00 to 06:00.
Credit cards are accepted but cash is more useful in remote places.
International Dialing Code for Greenland is +299.
Mobile roaming agreements exist but coverage is limited to the main towns. Handsets can be hired at TELE Greenland shops (in all cities). A deposit is required. Roaming agreements exist with some international mobile phone companies.
There are no public phone boxes.
Internet cafes in the towns and some libraries.
Post office hours: Mon-Fri 09:00-15:00. Greenland produces its own stamps which are popular among collectors. Post from Greenland takes about four to five days to reach Europe.
In Greenland local police should be contacted.
IMRAY AND ADLARD COLES PILOT BOOKS are available at a discounted price for Noonsite.com users via World Cruising Club
High Latitude Sailing
Explore the cold waters of the world
Published June 2014
By Jon Amtrup - Co-author Bob Shepton
$US 9.99
Kindle version available on amazon.com
Printed version to be published later this year (paperback soon to follow).
Arctic and Northern Waters (RCCPF)
Including Faroe, Iceland and Greenland - New 2014
By Andrew Wilkes
ISBN<PHONE_NUMBER>030
Publisher: Imray
Price: £60.00
A major new work from the RCC Pilotage Foundation, this pilot covers the Northwest and Northeast Passages through the Arctic Ocean. The RCCPF website has supplementary information to this guide free to download.
Addicted to Adventure - Between rocks and cold places
Publisher Adlard Coles - May 2014
By Bob Shepton
ISBN:<PHONE_NUMBER>
Price £11.69
Battling Atlantic storms, losing a mast in Antarctica, sailing the Arctic, skiing across remote regions, climbing and sailing through the North West Passage.
Faeroes, Iceland and Greenland Guide
Published 3rd Edition 2004
By Willy Ker
From RCC Pilotage Foundation
Published by Imray
ISBN 0 85288 765 5
See Noonsite review
Cruising Notes in Western Greenland (Blog)
http://annie-hill.blogspot.com/search/label/Greenland
Produced in 2004/5
Collected by Annie Hill and Trevor Robertson.
Visit Greenland - www.greenland.com
A great information website about this country covering nature, culture, travel and the wonders to see, plus incredible photography.
http://saltykisses.net/greenland-slideshow/
SV Salty sailed up the East coast of Greenland in June/July 2015. Their blog has a great slideshow and they are a good contact for further information.
www.morganscloud.com
Useful information for anyone planning a cruise to Greenland.


h1 text
h2 text
h3 text
h4 text
h5 text
h6 text
List:
First item
Second item
Third item
Link
Button
Form:
First
Second
Third
First
Second
Third
Submit


Seems like I have promised to write down the interesting stuff about s-ketamine... Let's see what I can do. I think in this case it would be best to write about the patterns I have noticed in the course of several experiences instead of describing one particular journey.
So I was lucky to find some sealed vials of Ketanest S by Parke-Davis, so there's no doubt that I'm talking about what I'm talking about. ;)
Potency
If I recall correctly, the stereoisomer s-ketamine is supposed to be (apart from possible qualitative differences) twice as potent as r-ketamine. Which means that 75mg of s-ketamine should have about the potency of 100mg (my regular im-dose) of the racemic. This sounds right to me. 75mg would do a reliable job of taking me on vacation, maybe even more so than 100mg of the racemic would. With the racemic I'd sometimes (maybe 5%) experience a dud, a trip that wouldn't take off. In contrast, all of the s-trips I've had up to now met or surpassed my expectations...
Duration
Whereas the regular k-trip lasts about 45-60 minutes for me, it's only 30 minutes with the s-ketamine. However, these 30 minutes seem much longer than a regular k-trip! I know the feeling of 'back so soon?' after resurfacing from regular k, with the s-ket however I seem to be in the infinite place for much longer, and being aware of it. In a way it reminds me of taking ketamine with a booster like 2cb.
Effects I noticed...
In the take-off and also during the trip, I didn't see and feel as many wide open spaces as I was used to. That was a pity since I liked that part.
Most of the time I had an exquisite, blissful feeling of who/what I was. For some part it was a body feeling, but even when I didn't have a body and was just a small ball of pure consciousness that felt very good. :)
Phases of the journey: 1) Take-Off
I'm not sure but take-off seems slightly slower, and there is a more pronounced hissing carrier-tone. This is the part where I'm still aware of things, feeling the onset, trying to push it in the right, pleasant direction. Sometimes I actually feel slightly anxious 'Is this it? There doesn't seem to be too much going on?!' Then there's some sort of a cut and I don't notice the transition to
Phases of the journey: 2) Zero gravity
I'm at the place to be... Lot's of things are going on. This is roughly the same as on regular k, although I think I feel more aware of things, and remember it better. Not in a way that I'd be able to write it down for you, but it's still with me. On several occasions I went to the place where all things begin, or all things end, just short of the point where time stops. On the last journey I ended up being just a small ball of consciousness floating alone in space, and that was all there was, and God assured me telepathically that that indeed was all there was and that it was fine... So quite often I end up in a very weird world, dimly aware that there used to be some other reality but quite sure that this was the real real for now, and possibly for the future.
Phases of the journey: 3) Paragliding downwards
At some point I start being aware of my outer surroundings, in a vague and abstract way at first. This phase definitely feels longer and more pleasurable to me than on regular k. It mostly looks like an 'enhanced reality' kind of a virtual reality superimposed on the real world. So I may have the feeling of lying in my room (like you also can imagine your room after closing your eyes) but an improved version, maybe larger, with cooler furniture and stuff... Maybe in some other cool place I'd enjoy, a place I'd invent for myself. The difference to phase 2 is that these whould be physical places instead of the more abstract energy places. The interesting contrast to having a daydream of, say, being at a beatiful island is that on s-ket (also on k but this here feels more distinct) you're very vividly inside your imagination, like having an especially vivid dream...
Nearer to the ground, when I'm more and more aware of my body, that body feels very strange on regular k: all skin and bones, the skin has a texture like paper, but it's actually fun touching it. And I have this weird, almost compulsory urge to move my fingers in complex, repetitive patterns. I usually enjoy these physical expressions of the k state but they weren't especially noticable on s-ket. Too bad.
Recovery
Recovery seems subjectively faster, I haven't measured it though. But I think speech and coordination come back faster.
 Maybe this says it all.
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


Mail
Images
Sign in
G
o
o
g
l
e
Search offered in:
English
April
Privacy
Terms
Settings
Advertising
Business
About


Current index of alpha mask pool
Pool of used sprite mask filters
Enable scissor
Pool of mask data
The renderer this manager works for.
Target to mask
Generic destroy methods to be overridden by the subclass
Sets type of MaskData based on its maskObject
Removes the last mask from the mask stack and doesn't return it. Renderer batch must be flushed beforehand.
Display Object to pop the mask from
Removes the last filter from the filter stack and doesn't return it.
Applies the Mask and adds it to the current filter stack. Renderer batch must be flushed beforehand.
Display Object to push the mask to
The masking data.
Applies the Mask and adds it to the current filter stack.
Sprite to be used as the mask
Changes the mask stack that is used by this System.
The mask stack
Generated using TypeDoc
System plugin to the renderer to manage masks.
PIXI.systems


Welcome to my World
About me..
I'm Benjie S. Barozo, 21 years of age, from Basey, Samar. I'm currently enrolled at Eastern Visayas State University. I love singing but singing doesn't love me. So I quit singing because I think it is not for me, so I decided to explore, and I discovered a lot. I love to play online games such as Mobile Legend and Call of Duty.


collection = client.order
collection.create_index(
[("account_cookie", ASCENDING), ("realorder_id", ASCENDING)], unique=True)
try:
if isinstance(orderlist,list):
pass
else:
if isinstance(orderlist, pd.DataFrame):
collection = client.order
collection.create_index(
[("account_cookie", ASCENDING), ("realorder_id", ASCENDING)], unique=True)
try:
orderlist = QA_util_to_json_from_pandas(orderlist.reset_index())


by Gregg Weissman
This is an expanded version of the article that originally appeared in Dr. Dobb's Journal, Aug 96.
Anyone who has tried using a PC Card (PCMCIA Card) over the last several years knows the promise and the frustration of the technology, which tries to be 'plug and play' and too often becomes 'plug and pray.'
The reasons for this include manufacturers' loose interpretations of the PC Card specification, subtle differences in the interactions between card, computer, and operating system, and simple pilot error. Effort on several vendors' parts has gone into fixing this problem, creating installation programs which will try to automatically configure the PC Card and driver software, PC Card system software (Socket and Card Services) which analyzes and tries to correct configuration errors, and adhering more closely to published standards.
For the manufacturer of a PC Card, the combinatorics of trying to be compatible with a dozen laptop makers with a dozen models each, a large handful of current and legacy versions of PC Card systems software, several species of operating systems, not to mention being interoperable with other PC Cards from other manufacturers, go beyond daunting to the realm of impossibility very rapidly. At Xircom we had the choice to limit the scope of compatibility we were willing to settle for, but instead opted to create an expert system that could solve the most common and most serious obstacles to a successful installation and compatible operation of our network and network/modem combo-cards.
Traditional procedural programming techniques and languages are
excellent for accomplishing what they are intended to do, and
can do almost anything if you push them hard enough, but I felt
that there were serious deficits in using only a language like
C to solve our problems. For one thing, a vast collection of
statements like
if (problem_1_exists) do_solution_1();
didn't appeal to me esthetically, and would be too hard to maintain. A more table-driven approach, though, would have required setting up a meta-language for expressing problems and solutions, requiring a lot of documentation and training for newcomers to the project. In this day and age it is essential to think beyond the implementation of today's code, and consider its maintainability and evolvability over time. Revising and going through a code/test/release cycle on core code for the lifetime of the system as new sources of incompatibilities arose, and as our products went though hardware and driver revisions, also seemed like a burden that was too great in proportion to the payoff.
Based on some exposure to Prolog in the mid-eighties, when Borland made a splash with the release of an integrated development system and compiler, I started to seriously consider it as an ideal language to use to create our expert. Prolog has the capability to very simply perform tasks that would take hundreds of lines of C code, including exhaustively searching for solutions in a 'decision tree', allowing expression of rules and facts with little regard for procedural details, and supporting self-modification during execution. Facts, or simple statements describing the state of the system being installed onto, could be expressed in a Prolog 'database' and then a logic engine could digest all these facts and determine how to install a PC Card, instruct the user how to correct compatibility problems that would prevent correct operation, and select optimum configuration parameters.
The only problem was that, as well-suited as Prolog is to those sorts of tasks, it is awful for those times when you really want to do old-fashioned procedural programming like handling user interface tasks, talking to operating systems, and otherwise architecting major applications. When all you really want to do is just iterate, C is a lot more straightforward than Prolog. So the required solution looked like it was going to require an expert system built in Prolog, but with a traditional C or C++ application superstructure. The Prolog toolset that exactly fit the bill is the Amzi! Prolog compiler and logic server, which is one of just a few Prolog implementations that support easy integration with other high-level languages.
With Amzi! Prolog, development and compilation can be done within a Windows Integrated Development Environment (IDE), or you can edit a Prolog source file and compile from the DOS command line. The compiled source resides in a proprietary binary format file with an .xpl extension which is loaded by the "logic server" - a Prolog engine implemented in C which is provided in .DLL and .OBJ formats for linking to your application. Some easily implemented conventions allow you to call Prolog 'functions' from within a C (or C++ ... from now on I'll just lump them together as "C++") program, or to call from Prolog to C++ functions. With the comprehensive API provided for calling the logic server, you can manipulate the Prolog component to any level of detail desired, or you can call higher-level functions that hide the Prolog internals. This mix of capabilities made it the ideal choice for the project.
The design of the complete system involved accounting for two very different tasks. The first was to collect as much information about the target computer, its configuration, PC Card software, and other installed devices as possible. The second task was to take all this information, make some sense out of it so that a configuration for installing the card could be determined, and detect failure modes that would prevent the installation from being successful.
The first task was accomplished by designing a series of C++ modules, including a general class library for working with DOS and Windows platforms and their dependencies, PC Cards, and PC Card systems software (Card Services). Utilizing the services of the general class library was a collection of classes which model system components. Deriving from a base "Device" class, classes for each component were responsible for detecting and reporting only those characteristics bound to that specific device type. An "IODevice" object was instantiated, for example, which only had the responsibility for reporting on IO port usage throughout the IO space, in a general way. Other examples are a "SoundCardDevice" object which had the task of detecting common sound cards and reporting on their characteristics, an "IRQControllerDevice" which analyzed the settings on the Peripheral Interrupt Controller chip as a means of detecting free IRQ's, and a "NetworkDevice" object which looked for open network connections. No doubt a real pro Prolog programmer could have done this all in Prolog, but for me the C++ approach was completely natural in handling the low-level, dirty job of snooping around the system while facilitating a 'pure' architecture which makes maintenance and enhancement of the code almost painless.
To analyze the PC Card environment, a class was defined to encapsulate examination and diagnostic functions that could report on a myriad of parameters representing the configuration parameters specific to PC Cards and Card Services. Functions highly specific to exercising Card Services capabilities and resource allocations were executed to probe every cranny of how well that complex system component was running. Details of how this part of the system was implemented is far outside the scope of this article, but anyone familiar with PC Card technology can probably appreciate the complexities of determining whether events were being generated correctly, if configurations could be selected, if Card Services was allocating and releasing memory and IO resources correctly, and so on.
What the Card Services and system diagnostics functions had in common was that the results of their tests were collected in a linked list of objects derived from an Assertion class. The Assertion class had the responsibility for linking together instances of itself and its subclasses, each instance containing a representation of a fact regarding system state. Assertions were generated in one of a small handful of canonical forms, with a subclass managing the storage and representation of that particular form. When all system diagnostics were complete, a static member function of the Assertion class was invoked to dump all assertions out to a disk file, in a form suitable for digestion by the expert system written in Prolog.
Also written in C/C++, but only loosely coupled with the "front-end" was, logically enough, a "back-end" which was responsible for executing diagnostic functions on the PC card being installed, under the control of the Expert System which is described below. Taking parameters from the Expert System, the back-end would actually test out configurations to ensure that the card would function as intended given the Expert's analysis, and report back a result. This showed off one of the strengths of the Amzi! system, which supported not only invoking the Prolog engine from the C++ front-end, but also supported calling back down to C functions from the Expert System.
The overall system architecture looked like this, then:
The Expert System consisted of three main components: the Driver, the Rules, and the Assertions generated by the C++ front-end. The Driver and Rules were combined into one compiled executable which the Amzi! logic server executed. In the Amzi architecture, the logic server is a C++ object, implemented in this case as a DLL, invoked by the front-end by calling a few initialization routines, including one to load the target executable Prolog program, and then issuing a "run" function to the server. The Driver portion of the Expert System was simply a series of "function calls" to more complex rule processing, and will not be discussed here, as the fun was really in the core of designing and implementing the machine to digest all the facts about the system and come up with intelligent choices for configuring the card.
In order to design the Expert System, there needed to be a schema for how all the configuration information would be represented. Only after that was in place could the Rules be constructed that would process the raw data, or facts, and derive the desired answer: could the card be correctly installed given the configuration of the user's system?
The resulting schema represented configuration facts as a tuple associated with a resource type. The tuples associated with a resource type defined its locus, its value, and an attribute of the resource. For example, to designate the availability of an IO port, a fact would appear in the database: "ioresource(machine,0x300,used)."
Once this schema was defined, the vocabulary for the possible loci and attributes that could be associated with a resource were defined, as there were several. A resource locus could be "machine", meaning the resource was analyzed as part of the system hardware scan , or "cardsrv" (Card Services), meaning the resource was analyzed by the Card Services diagnostics, and other similar designations. Attributes were defined as "available" or "unavailable" primarily, with some adjunct attributes defined for additional flexibility.
The Value portion of the tuple always refers to the value of the
resource under test: a memory address, an IO port address,an IRQ
number, etc. A portion of the database the expert system was to
operate on, therefore, looked something like this:
ioresource(machine,0x200,available). ioresource(machine,0x220,available). ioresrouce(cardsrv,0x200,unavailable). ... memresource(machine,0xD000,available). memresource(machine,0xD100,available). memresource(cardsrv,0xD000,available). ... irqresource(machine,8,available). irqresource(machine,9,available). irqresource(cardsrv,8,unavailable). ...
The entire range of system resources as pertain to the installation and configuration analysis were represented this way. IO port ranges were defined on 32-byte boundaries, and memory was analyzed on 4k boundaries, primarily as that is the minimum granularity of Card Services memory allocation logic, and it also served to keep the size of the database reasonable.
There were many other system attributes to be tested as part of the overall analysis that did not fit this canonical model, and they were represented in ad-hoc fashion, as exceptions that had to be handled specially. But the core of the analysis operated on the database as presented here.
With the database constructs in place, design of the rules began. A decision was made to implement the rules directly in Prolog, rather than, as in many expert systems, in a specialized expert system dialect interpreted by the Prolog engine. This gave us more flexibility and was a better fit to the very experimental nature of the project. In other words, we didn't know enough about what we were doing yet to design an expert system language as well as design the analysis. So the rules were coded in Prolog.
Here's where the strength of Prolog was brought to bear. A rule was written simply as a series of Prolog clauses that tested resources in the appropriate combinations and produced a result: either the combination of resources tested by a rule allowed configuration and installation of the card to proceed, or it revealed a conflict that would prevent proper operation and the process terminated with appropriate feedback to the user. Each rule could be designed totally independently from the others since there is generally no data coupling between Prolog "functions." All we had to do was capture the essence of what constituted a well-configured system, express the rules in Prolog syntax, fire the rules off in sequence and let them examine the data.
For example, let's start with a rule that says "if there
is an IO port that the system scan indicates is usable, then if
Card Services thinks it's usable too then it's a candidate for
configuration of the card." In other words: if both the
system scan and Card Services analysis indicate a free IO port,
we can try to configure the card to use that IO port. Expressed
in Prolog, this looked like:
iorule1 :- ioresource(machine,Port,usable), ioresource(cardsrv,Port,usable), try_io_port(Port), ...
In these three lines, Prolog is able to search the database of "ioresource" facts where "machine" is the locus, find any that match the "usable" attribute, return the associated IO port value in "Port", then search the ioresource facts that have "cardsrv" as the locus, "usable" as the attribute, and that match the Port value. And that's just the first two lines! If those clauses succeed, then the Port is used in a final diagnostic routine try_io_port, which validates that the card will truly work with that value of IO port. I that test succeeds, further logic is executed to do something useful with that IO port value. If any one of the three lines fails, then the rule fails, and the driver logic would take approriate action. This rule failing would translate to "there either is no port that is reported as available by both Card Services and a system scan, or even if there is, it doesn't work!"
This shortcuts a good deal of discussion as to the actual mechanism Prolog uses for the exhaustive search capability, called backtracking, but should convey the idea, and the power of using such an expressive language. To perform the same task in C(++) would take somewhere in the range of 6 to 12 lines, plus decisions as to data structure, variable naming and scoping, and on and on.
Before the core resource analysis was executed, though, we thought it would be helpful to look for known and common conflicts in resource and system configuration, and report back to the user any conditions that we could detect early on that would prevent installation. Here were more opportunities to exploit the power of Prolog, as several dozen complex rules defining conflicts were devised, each of which took only a few lines to code.
For example, we could detect if the system memory manager was
configured incorrectly as follows: first, the front-end scanned
upper memory blocks to determine what upper memory areas were
excluded from the memory manager's control, and made other independent
tests of the usability of the memory and its status as known to
Card Services. If there weren't any memory blocks excluded from
the memory manager, this was simply expressed as
conflict :- not memresource(memmgr,_,excluded).
If Card Services was configured so that it might allocate a memory
block that was not excluded from the memory manager, this was
expressed as:
conflict :- memresource(cardsvc,Mem,usable), not memresource(memmgr,Mem,excluded).
or, translated, "If a memory block is reported by Card Services
and usable, and the memory block is not excluded from the memory
manager command, then there is a conflict."
The front-end was able to generate a "fingerprint" of
the installed system, and Prolog made short work of searching
for a match in a database of known problem platforms and advise
of incompatibilities. For example, the machine's identifier was
obtained by the front-end and stored as a fact in the database
as "platform (XXXX)" where XXXX was the specific value
of the fingerprint; then we had a set of rules:
conflict :- platform(platform_type_1), not mem_rule. mem_rule :- memresource(machine,Address,usable), Address > 0xCFFF.
In these four lines of code, we embodied: "If the platform is platform_type_1, then if there is no memory free above upper memory address 0xD000:0000, then there is a conflict."
The modifiability and maintainability of this type of code, once the programmer was familiar with the basic nature of Prolog programming, was vastly superior to traditional C/C++, where there would have been, for each of these kinds of conditions and tests, loops to search the data, boundary conditions (what if there were no memory blocks reported for the "machine" locus at all?), and a complete edit/build/test cycle for each change. Using the Amzi! Prolog system and the architecture described, a new rule could be added and compiled into the rule base in a matter of minutes without having to touch any core code.
As mentioned above, another powerful feature of the Amzi! system is the ability not only to call a Prolog program from a C++ superstructure, but the capability of calling a C function as well, having it look just like another Prolog clause. In Example 1 above, the "try_io_port" clause was actually a call to a C routine that took an int value and performed low-level diagnostics on the card: again, a task much more reasonable to code in C and assembler than in Prolog! Note that these routines were in C and not C++, using the "extern C" linkage construct to force the C calling convention.
To do this was simple from the standpoint of integration with the logic server. A table of predicate names and their associated C function names, together with the number of arguments to be passed in from Prolog, is created in the C module. An initialization call is made to the logic server with a pointer to the table, and presto! predicates, written in C, are all available to your Prolog program.
The C functions all take one argument, which is a type defined by the logic server, which allows function arguments passed in from Prolog to be extracted one by one. The return type is a boolean truth value, indicating success or failure just as a native Prolog predicate returns.
So there is the capability for a complete integration of C(++)
and Prolog, allowing the designer to use the proper tool for the
job. The Amzi Prolog architecture allowed construction of complex
system requiring both procedural and non-procedural tasks, and
performed without any significant drawbacks. I would not have
wanted to implement this system using any architecture other than
one which allowed me to use a hammer to hit the nails and a screwdriver
to drive the screws, and not, as is so often the case, have to
see everything as a nail because all I had was a hammer.
Gregg Weissman was Manager of Systems Software Development at Xircom, Inc, and the architect and implementer of the software described in this article. He has sinced moved to Mountain View where he works for Spyrus, Inc as Director of PC Security Products. He can be reached at geeman@best.com.


UCL winner claims he could have been as good as Lionel Messi, Cristiano Ronaldo
by Sarthak SharmaLionel Messi and Cristiano Ronaldo are undoubtedly the greatest footballing duo of the century, but one man claims he might have been as good as him.
That man is Wesley Sneijder, who was widely tipped to win the Ballon d’Or award back in 2010 after a phenomenal year all around, but was beaten to it in the end by Lionel Messi.
And now, the Dutchman claims that if he was 100% dedicated to craft, he might have been in the same league as Messi and Ronaldo.
“If I would have lived 100% for my sport, I would have joined the list of Cristiano & Messi. I know that. But I didn’t want to, and I don’t regret that. It’s not like I couldn’t do it, I just didn’t want to.”
Sneijder also threw some shade on Ronaldo’s free-kick taking ability.
“If you look at Cristiano, he will stand behind the ball 30 times and won’t score 1,” Sneijder went on.
“Then I think to myself, how?”
He also said that Guti was the greatest player he ever played with.
“Best player I ever played with? Then I choose Guti,” Sneijder revealed.
“He impressed me the most. Me and Guti found each other blindly on the pitch, that man was phenomanal. Of-course I played with lots of big players but he impressed me the most.”


The Building Blocks of Missions
eXtensible Markup Language or XML provides for a software and hardware
independent way to store and transmit data. Additionally, XML is a
language that is designed for coming up with specialized markup
languages. For example, one could come up with a language for
genealogy, and define tags like <mother>
, <father>
,
<son>
, and <daughter>
. As a result of this ease of
creating new languages, XML has been used in hundreds of document
and markup language formats including MathML for specifying
mathematical and scientific content, XHTML for extending HTML,
the popular backbone language of the Internet, and Atom and RSS
for delivering updates on regularly changing content.
Though XML is generally weak syntactically, there is a specification which should be followed for clarity and functionality. A thorough yet brief introduction to the key terminology is given in the XML Wikipedia page . Given below is an even briefer view on what will be important, especially in the context of Project Malmö.
-
XML comprises of a string of characters. These characters may generally be any Unicode character.
-
The characters making up an XML document are divided into markup and content. These are different using simple syntactic rules.
-
As alluded to above in the example given previously, XML at its core is built on tags, like many other Markup Languages. These begin with
<
and end with>
.
- Start-tags like
-
A logical document component that either begins with a start-tag and ends with a matching end-tag or consists of only an empty-element tag. The characters between the start- and end-tags, if any are the element's content. Examples are
<Greeting>Hello, World</Greeting>
,
<line-break></line-break>
and<line-break />
. -
Attributes are name/value pairs that exist within a start or empty-element tag. In the example below the element img has two attributes, src and alt:
<img src="proj_malmo.jpg" alt="Project Malmo Image" />
The above is an empty-element tag. Another example with start- and end-tags, where the only attribute is number with a value of 3, is:
<step number="3">Open the XML file.</step>
-
An XML attribute can only have a single value and each attribute can appear only once.
-
A processor or XML parser analyzes markup and passes structured information to an application. The specification places requirements on what an XML processor must do or not do, but the application is outside of its scope.
Now, the last point about the processor and application is what leads us to XSD and JAXB, the next things to get an understanding of Missions in Project Malmö.
Rules for the Building Blocks
As described in the previous section, XML can be used to come up with new markup languages. However, there is a question of how one does this and in particular of how the syntax is defined.
XML Schema Definitions or XSD formally describe elements in an XML document. Its purpose is to verify each piece of item content in an XML document, i.e., to parse an XML document using various Schemas (rules).
Without further ado, let's now take a look at the XSD files for Project Malmö. Within the Project Malmö root folder, look for the Schemas folder. In there you will find (as of this tutorial's writing at least), 5 files with a .xsd extension. These are namely: Mission, MissionEnded, MissionHandlers, MissionInit and Types.
Feel free to go through the files and get an understanding of the structure. The general format should be quite intuitive as XML is designed to be human readable while still having a well-defined syntax like that of many programming languages.
To highlight a few points about the files and to direct your attention to some interesting properties of XSD, given below are somethings you can try/have a read through with code snippets as appropriate for illustration purposes:
-
At the top of all of the files, there is the XML declaration which specifies the version of XML to use and the character encoding to use.
-
Just below the XML declaration, is the root element which is required for XSD documents. This root element importantly contains information about namespaces which are a common programming language concept that prevents name conflicts (eg., when an element is defined in multiple separate schema files).
xmlns:xs="http://www.w3.org/2001/XMLSchema"
indicates that the elements and data types used in the schema come from the w3 organizations namespace. It also specifies that elements that come from this namespace should be prefixed with xs.The value of a targetNamespace,
http://ProjectMalmo.microsoft.com
is simply a unique identifier, typically a company's project URL, that indicates the elements defined by this schema come from the URL specified.The default namespace is set to the same URL as the targetNamespace using the
xmlns
attribute.Setting elementFormDefault to qualified indicates that any elements defined in the Schema must be qualified, i.e, be associated with a namespace, when used in an XML document.
-
XML Schema have a lot of built-in data types including:
xs:string
,xs:decimal
,xs:integer
,xs:boolean
,xs:date
,xs:time
. -
A Simple Element is an XML element that contains text of one of the types included in XSD or it can be a custom type. It cannot contain any other elements or attributes. The syntax for defining a simple element is as follows:
<xs:element name="xxx" type="yyy" />
-
An Attribute is very similar to a simple element. Simple elements cannot have attributes. The syntax for defining an attribute is
<xs:attribute name="xxx" type="yyy" />
-
A simpleType element defines a simple type and specifies the constraints and information about the values of attributes or text-only elements. For examples, see Types.xsd where enumerations are used for definitions of simpleTypes like Colour and BlockType. In particular, note the use of xs:restriction to restrict the values the simpleType can take as well as to define the base type which the simpleType takes, such as xs:string.
-
A Complex Element contains other element and/or attributes. There are four types based on the contents: empty elements, only other elements, only text, and a mixture of other elements and text.
-
Complex Elements often make use of complexTypes as well as order and occurence indicators.
-
Order Indicators
- The
<all>
indicator specifies that child elements can appear in any order, and that each child must occur only once. - The
<choice>
indicator specifies that only one of a list of children elements can be present. - The
<sequence>
indicator specifies that the child elements must appear in a specific order.
- The
-
Occurrence Indicators
-
The
<minOccurs>
indicator specifies the minimum number of times an element can occur and the<maxOccurs>
indicator specifies the maximum number of times an element can occur. -
Note that the above occurrence indicators can be used to specify the range of the number of times an element can appear. This not only is useful to specify the number of times a child element can appear in, say, a sequence, but also for specifying the number of times for example a sequence itself can occur.
-
-
-
complexContent defines extensions or restrictions on a complex type that contains mixed content or elements only.
-
xs:group and xs:attributeGroup cannot be extended or restricted in the way xs:complexType or xs:simpleType can. They are purely to group a number of items of data that are always used together.
-
Finally, xs:documentation and xs:annotation allow for documentation of the XML schema which is one of, if not the most, important parts of defining XML schema. Again, if you haven't already, do take a look at the Schema documentation.