Source code for examples.macro_model.agents.household
# -*- coding: utf-8 -*-
""" Household Agents from the basic macroeconomic model """
from .agents import EconomicAgent
from .agents_accounting import Good
[docs]class Household(EconomicAgent):
""" Household Agent """
def __init__(self, simulation, model, agent_number, agent_def):
super().__init__(simulation, model, agent_number, agent_def)
self.labor_market = self.spaces['LaborMarket']
self.employed = False
[docs] def step(self):
""" Household Agent Step method """
if not self.employed:
self.generate_offer()
self.offer_workforce()
self.formulate_price_expectations()
self.calculate_income()
self.establish_demmand()
self.buy_goods()
self.pay_taxes()
[docs] def show_offer(self):
""" Show Offer The agent show an offer in some market """
print(" I, ", self.name,
"am offering ",
self.labor_offer.quantity_of_g,
"hour of work at ",
self.labor_offer.value_of_g,
"hourly wage."
)
[docs] def generate_offer(self):
""" The Household decides wage to offer """
self.decide_hourly_wage()
self.labor_offer = Good('Labor',
'real',
'w',
'immediate',
self.labor_capacity,
self.hourly_wage,
self,
self)
[docs] def decide_hourly_wage(self):
""" The Household decides wage to offer """
self.hourly_wage = self.labor_market.average_labor_price()
if self.hourly_wage == 0.0:
self.hourly_wage = self.expected_wage
[docs] def offer_workforce(self):
""" The Household offer its workforce """
self.labor_market.bid_market('O', self.labor_offer)
self.offered_workforce = True
[docs] def calculate_income(self):
""" The household calculates its income """
pass
[docs] def establish_demmand(self):
""" The HH establish its demmand """
pass
[docs] def buy_goods(self):
""" The HH buy goods in the goods market """
pass
[docs] def pay_taxes(self):
""" The HH pay taxes to the government """
pass
[docs] def got_contract(self):
""" The household is employed """
self.employed = True
[docs] def reslease_bid(self):
""" The agent now is unemployed """
self.labor_offer = None
self.employed = False


Pick your super awesome nickname
Currently Online
Invite your friends by sharing the
link
@harry ciao
to say ciao to harry privately


Help us get a more human-like feedback about how it is to visit that city
To which culture would you like to go?
Please select a country
For how long are you planning to stay?
How would you like to get there?
Too which regime would you like to go?
Would you like to visit any religion in particular?
Which of the following do you value the most?
Which activities would you like to do?
How would you like to be accomodated?
What about populational density?
Which is your food preference?
Which is your language preference of your destinity?
How much are you available to pay for a BigMac Menu (€)?
How would you like to move in your destiny?
In which outdoors would you like to be?


This is the landing page for Rest Cafe, an API which works as a Cafe. You can login, register, add categories and products and also deal with all the standard operations such as Updates, Deletes and Gets. Futurely it will have a lot of interesting stuff. Hope you will like it!
Feature: Login with your Google Account thanks to Google OAuth!
Sign out


XmlFixture is the class that helps XML assertions in an easy way.
Download
http://sourceforge.net/project/showfiles.php?group_id=54719&package_id=156151
Creation
XmlFixture works using JDom, and it can be created from various type of sources using its static factory methods:
- String:
XmlFixture.fromText(String content)
- Reader:
XmlFixture.fromReader(Reader reader)
- w3c Document:
XmlFixture.fromW3cDocument(org.w3c.dom.Document document)
XPath Match
After a XmlFixture instance is created, it can be used for XPath matching by calling xpathMatch
.
This methods will create a XpathMatch
object that contains the XPath match result, with the following method:
node()
: This will return the matched node. IMPORTANT: It will returnnull
if there is no match found, and throwIllegalStateException
if more than one node matched.stringValue()
: This is the same as node method except that it will return the string value of the matched node.list
: Return the list of matched nodes.count
: Convenience method that returns the number of the matched nodeshasMatch
: Convenience method that returns true if there are matched nodes and false otherwise.
The following code block illustrates how a typical XML assertion looks like with XmlFixture:
XmlFixture xml = XmlFixture.fromText("<person><address type=\"test\">address value</address></person>");
assertEquals("address value", xml.xpath("/person/address[@type='test']"));
assertEquals(1, xml.xpathCount("/person/address"));
Exception Handling
XmlFixture wraps all the excepion into a RuntimeException
so that you don't have to.
Dependency
The following are the jars that XmlFixture depends on:
- commons-lang-2.0.jar
- jaxen-1.0-dev.jar
- jdom-b9/jdom.jar
- saxpath-1.0-FCS.jar
- junit.jar: For backward compatibility. Although you should use JUnit in your project anyway.


Plugin Information |
|---|
No information for the plugin 'ruby' is available. It may have been removed from distribution. |
This plugin will let users use Ruby in the build scripts.
The plugin works like Shell builder. To use, you just enter the Ruby scripts in the text area and save. During build the Ruby interpreter (defaults to 'ruby') will be used to execute the scripts you previously entered.
It is expected that Ruby interpreter 'ruby' is made available to system PATH.
Change Log
Version 1.2 (Jan 31, 2010)
- Update code for more recent Hudson
Version 1.1 (Jan 26, 2008)
Attachments:
ruby.png (image/png)


Header
Here is another funny picture
And another
Try to find some of your own!
Look at this cool picture!
Footer


Edit me
What is Apache Quarks?
Quarks is an open source programming model and runtime for edge devices that enables you to analyze streaming data on your edge devices. When you analyze on the edge, you can:
- Reduce the amount of data that you transmit to your analytics server
- Reduce the amount of data that you store
For more information, see the Quarks overview.
Apache Quarks and streaming analytics
The fundamental building block of a Quarks application is a stream: a continuous sequence of tuples (messages, events, sensor readings, and so on).
The Quarks API provides the ability to process or analyze each tuple as it appears on a stream, resulting in a derived stream.
Source streams are streams that originate data for analysis, such as readings from a device's temperature sensor.
Streams are terminated using sink functions that can perform local device control or send information to centralized analytic systems through a message hub.
Quarks' primary API is functional where streams are sourced, transformed, analyzed or sinked though functions, typically represented as lambda expressions, such as reading -> reading < 50 || reading > 80
to filter temperature readings in Fahrenheit.
Downloading Apache Quarks
To use Quarks, access the source code and build it. You can read more about building Quarks here.
After you build the Quarks package, you can set up your environment.
 For more information, see the Quarks overview. This guide assumes you're running Java 8.
The Quarks Java 8 JAR files are located in the quarks/java8/lib
directory.
Create a new Java project in Eclipse, and specify Java 8 as the execution environment JRE:
Modify the Java build path to include all of the JAR files in the quarks\java8\lib
directory:
Your environment is set up! You can start writing your first Quarks application.
Creating a simple application
If you're new to Quarks or to writing streaming applications, the best way to get started is to write a simple program.
Quarks is a framework that pushes data analytics and machine learning to edge devices. (Edge devices include things like routers, gateways, machines, equipment, sensors, appliances, or vehicles that are connected to a network.) Quarks enables you to process data locally—such as, in a car engine, on an Android phone, or Raspberry Pi—before you send data over a network.
For example, if your device takes temperature readings from a sensor 1,000 times per second, it is more efficient to process the data locally and send only interesting or unexpected results over the network. To simulate this, let's define a (simulated) TempSensor class:
import java.util.Random;
import quarks.function.Supplier;
/**
* Every time get() is called, TempSensor generates a temperature reading.
*/
public class TempSensor implements Supplier<Double> {
double currentTemp = 65.0;
Random rand;
TempSensor(){
rand = new Random();
}
@Override
public Double get() {
// Change the current temperature some random amount
double newTemp = rand.nextGaussian() + currentTemp;
currentTemp = newTemp;
return currentTemp;
}
}
Every time you call TempSensor.get()
, it returns a new temperature reading. The continuous temperature readings are a stream of data that a Quarks application can process.
Our sample Quarks application processes this stream by filtering the data and printing the results. Let's define a TempSensorApplication class for the application:
import java.util.concurrent.TimeUnit;
import quarks.providers.direct.DirectProvider;
import quarks.topology.TStream;
import quarks.topology.Topology;
public class TempSensorApplication {
public static void main(String[] args) throws Exception {
TempSensor sensor = new TempSensor();
DirectProvider dp = new DirectProvider();
Topology topology = dp.newTopology();
TStream<Double> tempReadings = topology.poll(sensor, 1, TimeUnit.MILLISECONDS);
TStream<Double> filteredReadings = tempReadings.filter(reading -> reading < 50 || reading > 80);
filteredReadings.print();
dp.submit(topology);
}
}
To understand how the application processes the stream, let's review each line.
Specifying a provider
Your first step when you write a Quarks application is to create a DirectProvider
:
DirectProvider dp = new DirectProvider();
A Provider
is an object that contains information on how and where your Quarks application will run. A DirectProvider
is a type of Provider that runs your application directly within the current virtual machine when its submit()
method is called.
Creating a topology
Additionally a Provider is used to create a Topology
instance:
Topology topology = dp.newTopology();
In Quarks, Topology
is a container that describes the structure of your application:
- Where the streams in the application come from
- How the data in the stream is modified
In the TempSensor application above, we have exactly one data source: the TempSensor
object. We define the source stream by calling topology.poll()
, which takes both a Supplier
function and a time parameter to indicate how frequently readings should be taken. In our case, we read from the sensor every millisecond:
TStream<Double> tempReadings = topology.poll(sensor, 1, TimeUnit.MILLISECONDS);
Defining the TStream
object
Calling topology.poll()
to define a source stream creates a TStream<Double>
instance, which represents the series of readings taken from the temperature sensor.
A streaming application can run indefinitely, so the TStream
might see an arbitrarily large number of readings pass through it. Because a TStream
represents the flow of your data, it supports a number of operations which allow you to modify your data.
Filtering a TStream
In our example, we want to filter the stream of temperature readings, and remove any "uninteresting" or expected readings—specifically readings which are above 50 degrees and below 80 degrees. To do this, we call the TStream
's filter
method and pass in a function that returns true if the data is interesting and false if the data is uninteresting:
TStream<Double> filteredReadings = tempReadings.filter(reading -> reading < 50 || reading > 80);
As you can see, the function that is passed to filter
operates on each tuple individually. Unlike data streaming frameworks like Apache Spark, which operate on a collection of data in batch mode, Quarks achieves low latency processing by manipulating each piece of data as soon as it becomes available. Filtering a TStream
produces another TStream
that contains only the filtered tuples; for example, the filteredReadings
stream.
Printing to output
When our application detects interesting data (data outside of the expected parameters), we want to print results. You can do this by calling the TStream.print()
method, which prints using .toString()
on each tuple that passes through the stream:
filteredReadings.print();
Unlike TStream.filter()
, TStream.print()
does not produce another TStream
. This is because TStream.print()
is a sink, which represents the terminus of a stream.
In addition to TStream.print()
there are other sink operations that send tuples to an MQTT server, JDBC connection, file, or Kafka cluster. Additionally, you can define your own sink by invoking TStream.sink()
and passing in your own function.
Submitting your application
Now that your application has been completely declared, the final step is to run your application.
DirectProvider
contains a submit()
method, which runs your application directly within the current virtual machine:
After you run your program, you should see output containing only "interesting" data coming from your sensor:
49.904032311772596
47.97837504039084
46.59272336309031
46.681544551652934
47.400819234155236
...
As you can see, all temperatures are outside the 50-80 degree range. In terms of a real-world application, this would prevent a device from sending superfluous data over a network, thereby reducing communication costs.
Further examples
This example demonstrates a small piece of Quarks' functionality. Quarks supports more complicated topologies, such as topologies that require merging and splitting data streams, or perform operations which aggregate the last N seconds of data (for example, calculating a moving average).
For more complex examples, see:


Welcome to Pixel-level Label Prediction Tool’s documentation!¶
NMF with Sparseness Constraints Tool: NMF_Sparse.py¶
Run Non-nagative matrx factorization with sparseness constraints
-
NMF_Sparse.
initialise_WH
(width, length, kmeans, NumOfClasses, k_clusters, numImages)[source]¶ Initialisation of W and H
- Parameters
width (int, row of an image data) –
length (int, column of an image data) –
kmeans (list, kmeans classifiers for classes) –
NumOfClasses (int) –
k_clusters (int) –
numImages (int) –
- Returns
W_init (nd array)
H_init (nd array)
-
NMF_Sparse.
nmf_allClass
(X, NumOfClasses, k_clusters, W_init, H_init, alpha=0, l1_ratio=0)[source]¶ Run Non-negative matrix factorization for each classes. Assign the updated W and H into a list.
- Parameters
NumOfClasses (int) –
k_clusters (int, should be less than image dimension. Selected by elbow's method) –
- Returns
W_all (2d array, updated W for all classes. shape = image dimension, num of components)
H_all (2d array, updated H for all classes. shape = num of components, total num of sample)
-
NMF_Sparse.
nmf_singleClass
(NumOfClasses, X_class, k_clusters, alpha=0, l1_ratio=0)[source]¶ This is a experimental function. Leave this function Run Non-negative matrix factorization for each classes. Assign the updated W and H into a list.
- Parameters
NumOfClasses (int) –
k_clusters (int, should be less than image dimension. Selected by elbow's method) –
- Returns
W_class (list of arrays, contains W for each class)
H_class (list of arrays, contains H for each class)
-
NMF_Sparse.
plotHistogram_W
(W_, name_, NumOfClasses, k_clusters)[source]¶ Plot Histogram of basis matrix. The histogram indicates disdributions of each geophysical feature magnitude.
- Parameters
W_ (numpy array of basis matrix W) –
name_ (numpy array of string) –
Examples
W_ = np.array([W1, W2])
name_ = np.array([name1, name2])
-
NMF_Sparse.
plt_boxData
(classL, numImagesPerClass, numImages, width, length, array_data=None, WH_product=None)[source]¶ Plot the first five sample images of the dataset in each class. It will give 25 plots in total.
- Parameters
classL (list, list of class labels. Starting from 0) –
numImagesPerClass (list, relating to classL: image number per corresponding class) –
numImages (int, total number of images in image dataset) –
width (int, single image row dimension) –
length (int, single image column dimension) –
array_data (3D array-like, stacked classes with shape = numImg, imgWidth, imgLength) –
WH_product (nd array, W*H product, Need to be reshped for plotting) –
- Returns
- Return type
none
-
NMF_Sparse.
projection
(N_p, s, L1, L2sqr, nonNeg, set_sparsity)[source]¶ Projection operator that enforces sparsity on columns. When a vector s is given, find a same-sized vector v that has the desired L1 and L2 norm that has the closes Euclidian distance to s
If the nonNeg flag is set, the output v is constrained to being non-negative (v>=0).
- Parameters
N_p (int, number of pixels) –
s (1d array, vector to be sparsified) –
L1 (L1 norm) –
L2sqr (L2 square norm) –
nonNeg (Bool, non negativity flag) –
set_sparsity (double, target sparsity set by user) –
- Returns
v (1d array, sparsified columns)
iterations (int, number of iteration to convergence)
-
NMF_Sparse.
replace_Hall_with_Hclass
(H_all, H_class, NumOfClasses, numImagesPerClass, k_clusters)[source]¶ This is a experimental function. It is not used for generating masks. Leave this. Stack single class of Hclass result onto all class result H_all Concatenate W and H to to facilitate stacked calculation
- Parameters
H_all (nd array, updated H for the whole dataset. shape = components number, total num of sample) –
- Returns
H_concat
- Return type
nd array, shape = components number, number of total dataset samples
-
NMF_Sparse.
sparcify_columns
(mat, set_sparsity)[source]¶ Sparsifying the matrix column. The algorithm takes the vector w_i as input and find a vector v that has target L1 and L2 norms that achieve the pre-defined sparseness ρ(w).
- Parameters
mat (nd array, matrix to be sparsified) –
set_sparsity (double, target sparsity) –
- Returns
mat
- Return type
nd array, sparsified matrix
References
Patrik O. Hoyer, 2004
-
NMF_Sparse.
splitX
(X, classL, numImagesPerClass)[source]¶ Split data matrix X into classes matrix for performing Kmeans on each class
- Parameters
X (2D array, shape = total number of images, image dimension) –
classL (list, list of class labels. Starting from 0) –
- Returns
X_class
- Return type
list of arrays, splitted classes of data
-
NMF_Sparse.
stack_singleWH
(W_class, H_class, NumOfClasses, numImagesPerClass, k_clusters, width, length, numImages)[source]¶ This is a experimental function. It is not used for generating masks. Leave this. Stack each class of updated W hozizontally and updated H diagonally for processing
- Parameters
W_class (list of arrays, contains W for each class) –
H_class (list of arrays, contains H for each class) –
- Returns
W_conc (nd array, shape = single image dimension, components number)
H_conc (nd array, shape = components number, number of total dataset samples)
Check Accuracy Tool: validate_Accuracy.py¶
Validate Accuracy of mask predictions.
-
validate_Accuracy.
getAccuracy
(y_truth, y_pred, classL_acc)[source]¶ Compute the Jacccard Index and accuracy score for multiclass or binary class pixel label prediction. Jaccard Score is the intersection of binary images y_pred and y_true divided by the union of BW1 and BW2
- Parameters
y_truth (nd array, ground truth) –
y_pred (nd array, pixel-level prediction) –
classL_acc (int, classes chosen to validate) –
- Returns
jacc_score (1d array, contains jaccard index for each predicted classes)
cf (1d array, contains accuracy scores for each predicted classes)
-
validate_Accuracy.
get_Ypred_Ytrue
(mask_truth, classL_acc, classified_all, maskNum, numImagesPerClass, bkgrd_label, background=True)[source]¶ Create prediction array and ground truth array.
- Parameters
mask_truth (nd array, contain all classes of mask.) – mask_truth shape = (num of class, num of masks per class, mask row, mask length)
int, classes chosen to validate (classL_acc：) –
classified_all (nd arrays. Contains pixel labels coordinations) –
maskNum (int, total mask numbers per class) –
numImagesPerClass (int, number of images per class for the original dataset) –
bkgrd_label (int, background label) –
background (bool, flag for background) –
- Returns
y_truth (nd array, ground truths)
y_pred (nd array, pixel-level predictions)
-
validate_Accuracy.
importMask
(width, length)[source]¶ Import mask png files. The ground truth mask should have the same dimension with the box image :param width: :type width: int, single image number of row :param length: :type length: int, single image number of column
- Returns
mask_truth (nd array, contain all classes of mask.) – mask_truth shape = (num of class, num of masks per class, mask row, mask length)
maskNum (int, number of masks per class)
-
validate_Accuracy.
plotPredvsGT
(mask_truth, numImagesPerClass, array_data, color_img, classL_acc, maskNum, imgIdx=0)[source]¶ Plot prediction vs ground truth mask
- Parameters
mask_truth (nd array, contain all classes of mask.) – mask_truth shape = (num of class, num of masks per class, mask row, mask length)
numImagesPerClass (int, number of images per class for the original dataset) –
array_data (nd array, original dataset) –
color_img (nd array, colorred mask of the images) –
int, classes chosen to validate (classL_acc：) –
maskNum (int, total mask numbers per class) –
imgIdx (int, index of image to show) –
-
validate_Accuracy.
tune_sparsity_alpha
(array_data, X, iteration, numImagesPerClass, classL, classL_acc, width, length, sparsity_opt, kmeans, NumOfClasses, k_clusters)[source]¶ Run several iterations to check the effect of sparsity on accuracy and result. User can modify the functions to check how other parameters affect the accracy.
This function will plot the jaccard indeies and accuracy scores for each predicted class
Label Position Extraction Tool: label_Pixel.py¶
Label pixels from NMF representations
-
label_Pixel.
createBinaryMask
(classL, classN, numImages, width, length, numImagesPerClass, plotMask=True)[source]¶ Create binary mask for each input class
- Returns
class_mask
- Return type
list of nd-arrays, Each array is a class of predicted masks
-
label_Pixel.
extract_coordination
(Y, NumOfClasses, numImages, width, length, bkgrd_label, gaussian_filtering=True, median_filtering=True, sigma=0.45)[source]¶ Get the likelihood matrix of the nmf data matrix. Each pixel is a seismic structure in W. The likelihood matrix Y indicates the likelihood of each pixel being that structure
- Parameters
W_stk (nd array, updated W with stacked result. shape = single image dimension, components number) –
H_stk (nd array, updated H with stacked result. shape = components number, number of total dataset samples) –
- Returns
classified_all
- Return type
nd array, classification matrix. Shape = (total num of data, width, length)
-
label_Pixel.
get_likelihoodMatrix
(W_stk, H_stk, NumOfClasses, k_clusters, numImages, width, length)[source]¶ Get the likelihood matrix of the nmf data matrix. Each pixel is a seismic structure in W. The likelihood matrix Y indicates the likelihood of each pixel being that structure
- Parameters
W_stk (nd array, updated W with stacked result. shape = (single image dimension, components number)) –
H_stk (nd array, updated H with stacked result. shape = (components number, number of total dataset samples)) –
- Returns
Y
- Return type
nd-array, likelihood matrix
-
label_Pixel.
normalizeColumns
(matrix)[source]¶ normalizes the input matrix to have the L1 norm of each column = 1
- Parameters
matrix (nd array, matrix to be normalized) –
-
label_Pixel.
plotLabels
(classL, numImagesPerClass, numImages, width, length, classN, array_data, colorarr, plot=True)[source]¶ Plot the predicted pixel-level labels
- Parameters
classN (list of arrays. Contain class of labels corrdinations) –
classL (list of integers. Contain labels for each class.) –
array_data (nd array，original data array) –
colorarr (list of lists. Each sublist is RGB color from 0-255) –
plot (bool) –
- Returns
color_img
- Return type
nd array, colorred mask of the images
-
label_Pixel.
save_toPath
(maskPath, class_mask, classL, numImagesPerClass)[source]¶ Save each class masks to the paths defined by user. :param class_mask: :type class_mask: list of nd-array: contain classes of masks :param maskPath: :type maskPath: list of nd-array. Paths defined by user.contains n paths, where n is the number of classes input to data matrx X.
-
label_Pixel.
split_labelResult
(classified_all, NumOfClasses, bkgrd_label=5, background=True)[source]¶ To split the classification result into individuals.
- Parameters
classified_all (nd arrays. Contains pixel labels coordinations) –
bkgrd_label (int, labels for background.) –
background (bool, background flag. If the flag is False, then no background color when plotting the prediction) –
- Returns
classN
- Return type
list of arrays. Contain class of labels coordinations


Class MixedRealityCameraSystem
The Mixed Reality Toolkit's default implementation of the IMixedRealityCameraSystem.
Inherited Members
Namespace: XRTK.Services.CameraSystem
Assembly: XRTK.dll
Syntax
public class MixedRealityCameraSystem : BaseSystem, IMixedRealityCameraSystem, IMixedRealityService, IDisposable
Constructors
| Improve this Doc View SourceMixedRealityCameraSystem(MixedRealityCameraProfile)
Constructor.
Declaration
public MixedRealityCameraSystem(MixedRealityCameraProfile profile)
Parameters
| Type | Name | Description |
|---|---|---|
| MixedRealityCameraProfile | profile |
Properties
| Improve this Doc View SourceCameraRig
The IMixedRealityCameraRig component used in the current configuration.
Declaration
public IMixedRealityCameraRig CameraRig { get; }
Property Value
| Type | Description |
|---|---|
| IMixedRealityCameraRig |
DefaultHeadHeight
The default head height when a platform doesn't automatically set it.
Declaration
public float DefaultHeadHeight { get; }
Property Value
| Type | Description |
|---|---|
| Single |
HeadHeight
The current head height of the player
Declaration
public float HeadHeight { get; set; }
Property Value
| Type | Description |
|---|---|
| Single |
IsOpaque
Is the current camera displaying on an Opaque (AR) device or a VR / immersive device
Declaration
public bool IsOpaque { get; }
Property Value
| Type | Description |
|---|---|
| Boolean |
IsStereoscopic
Is the current camera displaying on a traditional 2d screen or a stereoscopic display?
Declaration
public bool IsStereoscopic { get; }
Property Value
| Type | Description |
|---|---|
| Boolean |
Methods
| Improve this Doc View SourceDisable()
Optional Disable function to pause the service.
Declaration
public override void Disable()
Overrides
| Improve this Doc View SourceEnable()
Optional Enable function to enable / re-enable the service.
Declaration
public override void Enable()
Overrides
| Improve this Doc View SourceInitialize()
The initialize function is used to setup the service once created. This method is called once all services have been registered in the Mixed Reality Toolkit.
Declaration
public override void Initialize()
Overrides
| Improve this Doc View SourceLateUpdate()
Optional LateUpdate function to perform updates after the end of the last Update cycle.
Declaration
public override void LateUpdate()
Overrides
| Improve this Doc View SourceUpdate()
Optional Update function to perform per-frame updates of the service.
Declaration
public override void Update()


| GTK+ 2.0 Tutorial using Ocaml | ||
|---|---|---|
| <<< Previous | Miscellaneous Widgets | Next >>> |
Progress bars are used to show the status of an operation. They are pretty easy to use, as you will see with the code below. But first lets start out with the calls to create a new progress bar using GRange.progress_bar.
val GRange.progress_bar: ?orientation:Gtk.Tags.progress_bar_orientation -> ?pulse_step:float -> ?packing:(GObj.widget -> unit) -> ?show:bool -> unit -> progress_bar orientation : default value is `LEFT_TO_RIGHT pulse_step : default value is 0.1 |
Now that the progress bar has been created we can use it.
method set_fraction : float -> unit |
The argument is the amount "completed", meaning the amount the progress bar has been filled from 0-100%. This is passed to the method as a float number ranging from 0.0 to 1.0
GTK v1.2 has added new functionality to the progress bar that enables it to display its value in different ways, and to inform the user of its current value and its range.
A progress bar may be set to one of a number of orientations using the function
method set_orientation : Gtk.Tags.progress_bar_orientation -> unit |
The orientation argument may take one of the following values to indicate the direction in which the progress bar moves:
`LEFT_TO_RIGHT `RIGHT_TO_LEFT `BOTTOM_TO_TOP `TOP_TO_BOTTOM |
As well as indicating the amount of progress that has occured, the progress bar may be set to just indicate that there is some activity. This can be useful in situations where progress cannot be measured against a value range. The following function indicates that some progress has been made.
method pulse : unit -> unit |
The step size of the activity indicator is set using the following function.
method set_pulse_step : float -> unit |
When not in activity mode, the progress bar can also display a configurable text string within its trough, using the following function.
method set_text : string -> unit |
You can turn off the display of the string by calling set_text method again with empty string as an argument.
The current text setting of a progressbar can be retrieved with the following function.
method text : string |
Progress Bars are usually used with timeouts or other such functions (see section on Timeouts and Idle Functions) to give the illusion of multitasking. All will employ the set_fraction or pulse methods in the same manner.
Here is an example of the progress bar, updated using timeouts. This code also shows you how to reset the Progress Bar.
(* file: progressbar.ml *) let pulse_mode = ref false (* Update the value of the progress bar so that we get * some movement *) let progress_timeout pbar () = if !pulse_mode then pbar#pulse () else ( (* Calculate the value of the progress bar using the * value range set in the adjustment object *) let new_val = let v = pbar#fraction +. 0.01 in if v > 1.0 then 0.0 else v in pbar#set_fraction new_val ); (* As this is a timeout function, return true so that it * continues to get called *) true (* Callback that toggles the text display with the progress bar trough *) let toggle_show_text pbar () = let text = pbar#text in if text = "" then pbar#set_text "some text" else pbar#set_text "" (* Callback that toggles the activity mode of the progress bar *) let toggle_activity_mode pbar () = pulse_mode := not !pulse_mode; if !pulse_mode then pbar#pulse () else pbar#set_fraction 0.0 (* Callback that toggles the orientation of the progress bar *) let toggle_orientation pbar () = match pbar#orientation with | `LEFT_TO_RIGHT -> pbar#set_orientation `RIGHT_TO_LEFT | `RIGHT_TO_LEFT -> pbar#set_orientation `LEFT_TO_RIGHT | _ -> () (* Remove timer and quit *) let destroy_progress timer () = GMain.Timeout.remove timer; GMain.Main.quit () let main () = let window = GWindow.window ~title:"ProgressBar" () in let vbox = GPack.vbox ~border_width:10 ~packing:window#add () in (* Create a centering alignment object *) let align = GBin.alignment ~xalign:0.5 ~yalign:0.5 ~xscale:0.0 ~yscale:0.0 ~packing:vbox#add () in (* Create the progressbar *) let pbar = GRange.progress_bar ~packing:align#add () in (* Add a timer callback to update the value of the progress bar *) let timer = GMain.Timeout.add ~ms:100 ~callback:(progress_timeout pbar) in GMisc.separator `HORIZONTAL ~packing:vbox#add (); let table = GPack.table ~rows:3 ~columns:1 ~homogeneous:false ~packing:vbox#add () in (* Add a check button to select displaying of trough text *) let check = GButton.check_button ~label:"Show text" ~packing:(table#attach ~left:0 ~top:0) () in check#connect#clicked ~callback:(toggle_show_text pbar); (* Add a check button to toggle activity mode *) let check = GButton.check_button ~label:"Activity mode" ~packing:(table#attach ~left:0 ~top:1) () in check#connect#clicked ~callback:(toggle_activity_mode pbar); (* Add a check button to toggle orientation *) let check = GButton.check_button ~label:"Right to Left" ~packing:(table#attach ~left:0 ~top:2) () in check#connect#clicked ~callback:(toggle_orientation pbar); (* Add a buton to exit the program *) let button = GButton.button ~label:"Close" ~packing:vbox#add () in button#connect#clicked ~callback:(destroy_progress timer); window#connect#destroy ~callback:(destroy_progress timer); window#show (); GMain.Main.main () let _ = main () |
| <<< Previous | Home | Next >>> |
| The Tooltips Object | Up | Dialogs |


FSharpChecker
Namespace: FSharp.Compiler.SourceCodeServices
Used to parse and check F# source code.
Instance members
| Instance member | Description |
BeforeBackgroundFileCheck
Signature: IEvent<string * obj option>
|
Notify the host that the logical type checking context for a file has now been updated internally and that the file has become eligible to be re-typechecked for errors. The event will be raised on a background thread. CompiledName: |
CheckFileInProject(...)
Signature: (parsed:FSharpParseFileResults * filename:string * fileversion:int * source:string * options:FSharpProjectOptions * textSnapshotInfo:obj option * userOpName:string option) -> Async<FSharpCheckFileAnswer>
|
Check a source code file, returning a handle to the results Note: all files except the one being checked are read from the FileSystem API Return FSharpCheckFileAnswer.Aborted if a parse tree was not available. |
CheckFileInProjectAllowingStaleCachedResults(...)
Signature: (parsed:FSharpParseFileResults * filename:string * fileversion:int * source:string * options:FSharpProjectOptions * textSnapshotInfo:obj option * userOpName:string option) -> Async<FSharpCheckFileAnswer option>
|
Check a source code file, returning a handle to the results of the parse including the reconstructed types in the file.All files except the one being checked are read from the FileSystem APINote: returns NoAntecedent if the background builder is not yet done preparing the type check context for the file (e.g. loading references and parsing/checking files in the project that this file depends upon). In this case, the caller can either retry, or wait for FileTypeCheckStateIsDirty to be raised for this file. |
CheckProjectInBackground(...)
Signature: (options:FSharpProjectOptions * userOpName:string option) -> unit
|
Set the project to be checked in the background. Overrides any previous call to |
ClearLanguageServiceRootCachesAndCollectAndFinalizeAllTransients(...)
Signature: unit -> unit
|
Flush all caches and garbage collect |
Compile(...)
Signature: (ast:ParsedInput list * assemblyName:string * outFile:string * dependencies:string list * pdbFile:string option * executable:bool option * noframework:bool option * userOpName:string option) -> Async<FSharpErrorInfo [] * int>
|
TypeCheck and compile provided AST |
Compile(argv, userOpName)
Signature: (argv:string [] * userOpName:string option) -> Async<FSharpErrorInfo [] * int>
|
Compile using the given flags. Source files names are resolved via the FileSystem API. The output file must be given by a -o flag. The first argument is ignored and can just be "fsc.exe". |
CompileToDynamicAssembly(...)
Signature: (ast:ParsedInput list * assemblyName:string * dependencies:string list * execute:(TextWriter * TextWriter) option * debug:bool option * noframework:bool option * userOpName:string option) -> Async<FSharpErrorInfo [] * int * Assembly option>
|
TypeCheck and compile provided AST |
CompileToDynamicAssembly(...)
Signature: (otherFlags:string [] * execute:(TextWriter * TextWriter) option * userOpName:string option) -> Async<FSharpErrorInfo [] * int * Assembly option>
|
Compiles to a dynamic assembly using the given flags. The first argument is ignored and can just be "fsc.exe". Any source files names are resolved via the FileSystem API. An output file name must be given by a -o flag, but this will not be written - instead a dynamic assembly will be created and loaded. If the 'execute' parameter is given the entry points for the code are executed and the given TextWriters are used for the stdout and stderr streams respectively. In this case, a global setting is modified during the execution. |
CurrentQueueLength
Signature: int
|
Current queue length of the service, for debug purposes. In addition, a single async operation or a step of a background build may be in progress - such an operation is not counted in the queue length. CompiledName: |
FileChecked
Signature: IEvent<string * obj option>
|
Raised after a check of a file in the background analysis. The event will be raised on a background thread. CompiledName: |
FileParsed
Signature: IEvent<string * obj option>
|
Raised after a parse of a file in the background analysis. The event will be raised on a background thread. CompiledName: |
GetBackgroundCheckResultsForFileInProject(...)
Signature: (filename:string * options:FSharpProjectOptions * userOpName:string option) -> Async<FSharpParseFileResults * FSharpCheckFileResults>
|
Like CheckFileInProject, but uses the existing results from the background builder.All files are read from the FileSystem API, including the file being checked. |
GetBackgroundParseResultsForFileInProject(...)
Signature: (filename:string * options:FSharpProjectOptions * userOpName:string option) -> Async<FSharpParseFileResults>
|
Like ParseFile, but uses results from the background builder.All files are read from the FileSystem API, including the file being checked. |
GetParsingOptionsFromCommandLineArgs(...)
Signature: (argv:string list * isInteractive:bool option) -> FSharpParsingOptions * FSharpErrorInfo list
|
Get the FSharpParsingOptions implied by a set of command line arguments. |
GetParsingOptionsFromCommandLineArgs(...)
Signature: (sourceFiles:string list * argv:string list * isInteractive:bool option) -> FSharpParsingOptions * FSharpErrorInfo list
|
Get the FSharpParsingOptions implied by a set of command line arguments and list of source files. |
GetParsingOptionsFromProjectOptions(...)
Signature: FSharpProjectOptions -> FSharpParsingOptions * FSharpErrorInfo list
|
Get the FSharpParsingOptions implied by a FSharpProjectOptions. |
GetProjectOptionsFromCommandLineArgs(...)
Signature: (projectFileName:string * argv:string [] * loadedTimeStamp:DateTime option * extraProjectInfo:obj option) -> FSharpProjectOptions
|
Get the FSharpProjectOptions implied by a set of command line arguments. |
GetProjectOptionsFromScript(...)
Signature: (filename:string * source:string * loadedTimeStamp:DateTime option * otherFlags:string [] option * useFsiAuxLib:bool option * assumeDotNetFramework:bool option * extraProjectInfo:obj option * optionsStamp:int64 option * userOpName:string option) -> Async<FSharpProjectOptions * FSharpErrorInfo list>
|
For a given script file, get the FSharpProjectOptions implied by the #load closure.All files are read from the FileSystem API, except the file being checked. |
ImplicitlyStartBackgroundWork()
Signature: unit -> bool
|
Get or set a flag which controls if background work is started implicitly. If true, calls to CheckFileInProject implicitly start a background check of that project, replacing any other background checks in progress. This is useful in IDE applications with spare CPU cycles as it prepares the project analysis results for use. The default is 'true'. CompiledName: |
ImplicitlyStartBackgroundWork()
Signature: unit -> unit
|
Get or set a flag which controls if background work is started implicitly. If true, calls to CheckFileInProject implicitly start a background check of that project, replacing any other background checks in progress. This is useful in IDE applications with spare CPU cycles as it prepares the project analysis results for use. The default is 'true'. CompiledName: |
InvalidateAll()
Signature: unit -> unit
|
This function is called when the entire environment is known to have changed for reasons not encoded in the ProjectOptions of any project/compilation. |
InvalidateConfiguration(...)
Signature: (options:FSharpProjectOptions * startBackgroundCompileIfAlreadySeen:bool option * userOpName:string option) -> unit
|
This function is called when the configuration is known to have changed for reasons not encoded in the ProjectOptions. For example, dependent references may have been deleted or created. Start a background compile of the project if a project with the same name has already been seen before. An optional string used for tracing compiler operations associated with this request. |
KeepProjectAlive(options, userOpName)
Signature: (options:FSharpProjectOptions * userOpName:string option) -> Async<IDisposable>
|
Create resources for the project and keep the project alive until the returned object is disposed. |
MatchBraces(...)
Signature: (filename:string * source:string * options:FSharpProjectOptions * userOpName:string option) -> Async<(range * range) []>
|
Parse a source code file, returning information about brace matching in the file. Return an enumeration of the matching parenthetical tokens in the file. |
MatchBraces(...)
Signature: (filename:string * source:string * options:FSharpParsingOptions * userOpName:string option) -> Async<(range * range) []>
|
Parse a source code file, returning information about brace matching in the file. Return an enumeration of the matching parenthetical tokens in the file. |
MaxMemory()
Signature: unit -> int
|
A maximum number of megabytes of allocated memory. If the figure reported by CompiledName: |
MaxMemory()
Signature: unit -> unit
|
A maximum number of megabytes of allocated memory. If the figure reported by CompiledName: |
MaxMemoryReached
Signature: IEvent<unit>
|
Raised after the maxMB memory threshold limit is reached CompiledName: |
NotifyProjectCleaned(...)
Signature: (options:FSharpProjectOptions * userOpName:string option) -> Async<unit>
|
This function is called when a project has been cleaned/rebuilt, and thus any live type providers should be refreshed. |
ParseAndCheckFileInProject(...)
Signature: (filename:string * fileversion:int * source:string * options:FSharpProjectOptions * textSnapshotInfo:obj option * userOpName:string option) -> Async<FSharpParseFileResults * FSharpCheckFileAnswer>
|
Parse and check a source code file, returning a handle to the results Note: all files except the one being checked are read from the FileSystem API Return FSharpCheckFileAnswer.Aborted if a parse tree was not available. |
ParseAndCheckProject(...)
Signature: (options:FSharpProjectOptions * userOpName:string option) -> Async<FSharpCheckProjectResults>
|
Parse and typecheck all files in a project.All files are read from the FileSystem API |
ParseFile(...)
Signature: (filename:string * source:string * options:FSharpParsingOptions * userOpName:string option) -> Async<FSharpParseFileResults>
|
Parse a source code file, returning a handle that can be used for obtaining navigation bar information To get the full information, call 'CheckFileInProject' method on the result |
ParseFileInProject(...)
Signature: (filename:string * source:string * options:FSharpProjectOptions * userOpName:string option) -> Async<FSharpParseFileResults>
|
Parse a source code file, returning a handle that can be used for obtaining navigation bar information To get the full information, call 'CheckFileInProject' method on the resultAll files except the one being checked are read from the FileSystem API |
PauseBeforeBackgroundWork()
Signature: unit -> int
|
Get or set the pause time in milliseconds before background work is started. CompiledName: |
PauseBeforeBackgroundWork()
Signature: unit -> unit
|
Get or set the pause time in milliseconds before background work is started. CompiledName: |
ProjectChecked
Signature: IEvent<string * obj option>
|
Notify the host that a project has been fully checked in the background (using file contents provided by the file system API) The event may be raised on a background thread. CompiledName: |
StopBackgroundCompile()
Signature: unit -> unit
|
Stop the background compile. |
TokenizeFile(source)
Signature: source:string -> FSharpTokenInfo [] []
|
Tokenize an entire file, line by line |
TokenizeLine(line, state)
Signature: (line:string * state:FSharpTokenizerLexState) -> FSharpTokenInfo [] * FSharpTokenizerLexState
|
Tokenize a single line, returning token information and a tokenization state represented by an integer |
TryGetRecentCheckResultsForFile(...)
Signature: (filename:string * options:FSharpProjectOptions * source:string option * userOpName:string option) -> (FSharpParseFileResults * FSharpCheckFileResults * int) option
|
Try to get type check results for a file. This looks up the results of recent type checks of the same file, regardless of contents. The version tag specified in the original check of the file is returned. If the source of the file has changed the results returned by this function may be out of date, though may still be usable for generating intellisense menus and information. |
WaitForBackgroundCompile()
Signature: unit -> unit
|
Block until the background compile finishes. |
Static members
| Static member | Description |
Create(...)
Signature: (projectCacheSize:int option * keepAssemblyContents:bool option * keepAllBackgroundResolutions:bool option * legacyReferenceResolver:Resolver option * tryGetMetadataSnapshot:ILReaderTryGetMetadataSnapshot option) -> FSharpChecker
|
Create an instance of an FSharpChecker. |
GlobalForegroundParseCountStatistic
Signature: int
|
Report a statistic for testability CompiledName: |
GlobalForegroundTypeCheckCountStatistic
Signature: int
|
Report a statistic for testability CompiledName: |
Instance
Signature: FSharpChecker
|
CompiledName: |


Seattle's Famous Salmon Cookie
Wholesome and locally sourced...
Pat's Pesca-tisserie is a farm-to-table establishment, meaning you get the finest and freshest ingredients from the northwest's finest in every sweet bite of salmon cookies. Berries and dairy from Skagit and Whatcom county are the backbone of our scratch-made frosting. The only ingredients that aren't farm-fresh are the salmon! All of the salmon in Pat's cookies are wild-caught Alaskan salmon, brought home by local fishermen.
From our family to yours...
Pat and his wife met and fell in love 15 years ago while baking cookies for a departmental fundraiser at UW. After graduation they worked in many capacties around the city involved with habitat restoration and sustainable development, and every night coming hoome to decompress over a warm oven. A few years ago they decided to take the leap, in the midst of a rapidly changing Seattle landscape, and decided to combine their two loves and create an establishment that they dreamed would represent Seattle heritage, fill stomachs, warm hearts, and give back to the community. On weekends you may even see their kids helping in the shop! Thanks for beign part of our dream!
New! Show Your Pescatisserie Pride!
Show your love for Pat's Pesca-tisserie by sporting your best salmon schwag! You'll be the talk of the town in our salmon sweethearts shirt. Made of organic cotton, you can rest easy there's nothing toxic rubbing up against you or your loved ones, our salmon sweeheart shirt sports the image of a male and female coho salmon in spawning stage, hence the "sweetheart" moniker.
You can pick up a shirt for you or your loved ones in any of our Seattle-area shops. They also make great gifts and souvenirs for any fans out-of-state.
You can also find them in our online shop on the merchandise page, as well as other awesome salmon merchandise that support local artists and conservation programs. Every purchase helps keep the Northwest healthy and beautiful for future generations!
Shops and Hours
Open Everyday 6AM to 8PM at these fine locations:
- 1st and Pike //
- SeaTac Airport //
- Seattle Center - Armory //
- Capitol Hill - near SCCC //
- Alki


Islamic Reminders is an Islamic* website built from scratch within approximately 24 hours. It is simple website which is built upon the famous material design made by Google, and features a video spotlight which is tailored based on your mood, so you get the most relevant reminders.
*Uncertified by MUIS


November 30
If ye abide in me, and my words abide in you, ye shall ask what ye will, and it shall be done unto you.
John 15:7
That word abide is so important.
He was telling us to allow His Word--which is a living thing!--to make its home within us. He was telling us to spend time with it, to meditate on it, to fill our minds and our mouths with it, and to let it guide our every action.
The Apostle Paul put it this way, "Let the word of Christ dwell in you richly..." (Col. 3:16). Most believers don't have any idea what that means. That's one of the reasons they're so short on power.
Oral Roberts once said that when the Word is really abiding in you, when it's alive and producing like it should, you can hear it.  Well, when you start abiding in the Word, you're probably going to hear it in much that same way.
Many times, I've been in desperate situations, wondering what I was going to do when suddenly I'd hear a scripture down on the inside of me. Suddenly, I'd know exactly what the answer to my situation was. I'd be delivered by the Word of God that was dwelling in me.
So, invite the Holy Spirit to go to work on your behalf. Just keep telling Him, "Whatever You bring to my remembrance from the Word is exactly what I'm going to act on.
Make a quality decision to abide in the Word. You'll soon discover that the Word is abiding in you.
Scripture Reading: Colossians 3:1-16


Bank account
Register new account
Name
ID Number
initial deposit
Submit
Balance:
Deposit
Deposit Amount
deposit
Balance:
Withdraw
Withdraw- Amount
withdraw


Colony Park (the park) is a 3.12 acre plot and was originally owned by the subdivision and maintained by an HOA. This was a legitimate HOA, with a board, which included residents and the developer William Fannin. There were Easter egg hunts, cookouts, and even bonfires (some of which, got out of hand).
Most accounts indicate that the park was intended to be passive green space. When the HOA was disbanded, it turned over the deed to the Village of Pickerington. The village, and later, the city of Pickerington maintained the park, which largely consisted of mowing.
A key part of deeding the park to the city is what passive means. The city code specifies that passive space prohibits active recreational game equipment, game courts, and playing field, BUT allows for benches, picnic areas, and tot lots. Tot lots are play gyms for small children.
In 2012, the city surveyed residents about possible park development. When an effort put in a tot lot was attempted, it was blocked by some residents. An article in the Pickerington Times-Sun covered the story.
Underground gas lines and the narrow shape of the park make development tricky. And when you consider the privacy of the closest neighbors, potential for trash and noise, it is easy to dismiss doing anything with the land. Today, the park is used very little. Occaisionally you may see kids playing a pick up game of volleyball or soccer. More often, you will see folks walking their dogs through it.
You could argue that there are more young families with school-age children in our subdivision in 2015 than there were in 2012. I think a tot lot would be a fitting addition to the park. Although the author's own children are too old to get any benefit, I have certainly heard from many folks over the summer who would welcome such an addition. You could argue that such a feature may attract outsiders to our park and create parking and other issues, but this defies conventional wisdom. Take the park at Willow Pond - they have a tot lot, a pond, and a shelter (and only street parking), and those I've interviewed haven't experienced any of these issues. When folks can choose Victory Park, or Sycamore, or go to a school playground, they will do so.
Park benches will be installed. I made a request to the city's Safety Committee for park benches in October, and they approved us to have the 2 or 3 in their inventory. They will be installed and set in concrete at locations that don't interfere with underground utilities and future possible development. In November, the city installed 17 trees, which more than made up for the ones that were removed in 2013 because of infestation. These trees look to be leftover from the SR256 construction project, and consists of Oaks, Red Oaks, and London Planetrees
I asked the Safety Committee to once again consider putting in a tot lot into the park. I was asked to survey the residents that directly surround the park, which is 10 homes on Parkview Dr. and 10 homes on Parkwood Ave. It took me 3 weeks, but I personally talked with homeowners for all 20 of these residences. There are a few that oppose, but mostly folks are for it.
An attraction like a tot lot would give a reason for neighbors (kids and adults) to meet and socialize and form community bonds. Here are the main reasons I think a tot lot would work:
1. It is a compact feature
2. We have a lot of school-aged children
3. It would still allow for the larger space of the park to be used for other things
I know that some people don't want it because they are worried about trash, crime, noise, trespassing, loss of privacy, and having their dogs disturbed. I think park visitors will mostly be respectful of the nearby homes, look after their kids, and throw away their trash. I think people will actually use the park.
I think that there is a good chance that with the right placement (non-central, away from utilities, etc.), it could move forward. Success or failure of this does not hinge on me, but instead will be the result of neighbors and city finding common ground. I am just trying to facilitate the wishes of residents to make improvements that we can all enjoy. The Safety Committee will discuss these results in December when they reconvene on 12/2/15.
-Tony


Database Forge Class
The Database Forge Class contains methods that help you manage your database.
Initializing the Forge Class
Important
In order to initialize the Forge class, your database driver must already be running, since the Forge class relies on it.
Load the Forge Class as follows:
<?php
$forge = \Config\Database::forge();
You can also pass another database group name to the DB Forge loader, in case the database you want to manage isn’t the default one:
<?php
$this->myforge = \Config\Database::forge('other_db');
In the above example, we’re passing the name of a different database group to connect to as the first parameter.
Creating and Dropping Databases
$forge->createDatabase(‘db_name’)
Permits you to create the database specified in the first parameter. Returns true/false based on success or failure:
<?php
if ($forge->createDatabase('my_db')) {
echo 'Database created!';
}
An optional second parameter set to true will add IF EXISTS
statement
or will check if a database exists before create it (depending on DBMS).
<?php
$forge->createDatabase('my_db', true);
/*
* gives CREATE DATABASE IF NOT EXISTS `my_db`
* or will check if a database exists
*/
$forge->dropDatabase(‘db_name’)
Permits you to drop the database specified in the first parameter. Returns true/false based on success or failure:
<?php
if ($forge->dropDatabase('my_db')) {
echo 'Database deleted!';
}
Creating Databases in the Command Line
CodeIgniter supports creating databases straight from your favorite terminal using the dedicated db:create
command. By using this command it is assumed that the database is not yet existing. Otherwise, CodeIgniter
will complain that the database creation has failed.
To start, just type the command and the name of the database (e.g., foo
):
php spark db:create foo
If everything went fine, you should expect the Database "foo" successfully created.
message displayed.
If you are on a testing environment or you are using the SQLite3 driver, you may pass in the file extension
for the file where the database will be created using the --ext
option. Valid values are db
and
sqlite
and defaults to db
. Remember that these should not be preceded by a period.
:
php spark db:create foo --ext sqlite
The above command will create the db file in WRITEPATH/foo.sqlite.
Note
When using the special SQLite3 database name :memory:
, expect that the command will still
produce a success message but no database file is created. This is because SQLite3 will just use
an in-memory database.
Creating Tables
There are several things you may wish to do when creating tables. Add fields, add keys to the table, alter columns. CodeIgniter provides a mechanism for this.
Adding Fields
Fields are normally created via an associative array. Within the array, you must
include a type
key that relates to the datatype of the field. For
example, INT, VARCHAR, TEXT, etc. Many datatypes (for example VARCHAR)
also require a constraint
key.
<?php
$fields = [
'users' => [
'type' => 'VARCHAR',
'constraint' => 100,
],
];
// will translate to "users VARCHAR(100)" when the field is added.
Additionally, the following key/values can be used:
unsigned
/true : to generate “UNSIGNED” in the field definition.default
/value : to generate a default value in the field definition.null
/true : to generate “null” in the field definition. Without this, the field will default to “NOT null”.auto_increment
/true : generates an auto_increment flag on the field. Note that the field type must be a type that supports this, such as integer.unique
/true : to generate a unique key for the field definition.
<?php
$fields = [
'id' => [
'type' => 'INT',
'constraint' => 5,
'unsigned' => true,
'auto_increment' => true,
],
'title' => [
'type' => 'VARCHAR',
'constraint' => '100',
'unique' => true,
],
'author' => [
'type' => 'VARCHAR',
'constraint' => 100,
'default' => 'King of Town',
],
'description' => [
'type' => 'TEXT',
'null' => true,
],
'status' => [
'type' => 'ENUM',
'constraint' => ['publish', 'pending', 'draft'],
'default' => 'pending',
],
];
After the fields have been defined, they can be added using
$forge->addField($fields)
followed by a call to the
createTable()
method.
$forge->addField()
The addField()
method will accept the above array.
Raw Sql Strings as Default Values
New in version 4.2.0.
Since v4.2.0, $forge->addField()
accepts a CodeIgniter\Database\RawSql
instance, which expresses raw SQL strings.
<?php
use CodeIgniter\Database\RawSql;
$fields = [
'id' => [
'type' => 'INT',
'constraint' => 5,
'unsigned' => true,
'auto_increment' => true,
],
'created_at' => [
'type' => 'TIMESTAMP',
'default' => new RawSql('CURRENT_TIMESTAMP'),
],
];
$forge->addField($fields);
/*
gives:
"id" INT(5) UNSIGNED NOT NULL AUTO_INCREMENT,
"created_at" TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL
*/
Warning
When you use RawSql
, you MUST escape the data manually. Failure to do so could result in SQL injections.
Passing Strings as Fields
If you know exactly how you want a field to be created, you can pass the
string into the field definitions with addField()
:
<?php
$forge->addField("label varchar(100) NOT NULL DEFAULT 'default label'");
Note
Passing raw strings as fields cannot be followed by addKey()
calls on those fields.
Note
Multiple calls to addField()
are cumulative.
Creating an id Field
There is a special exception for creating id fields. A field with type id will automatically be assigned as an INT(9) auto_incrementing Primary Key.
<?php
$forge->addField('id');
// gives `id` INT(9) NOT NULL AUTO_INCREMENT
Adding Keys
$forge->addKey()
Generally speaking, you’ll want your table to have Keys. This is
accomplished with $forge->addKey('field')
. The optional second
parameter set to true will make it a primary key and the third
parameter set to true will make it a unique key. You may specify a name
with the fourth parameter. Note that addKey()
must be followed by a
call to createTable()
or processIndexes()
when the table already
exists.
Multiple column non-primary keys must be sent as an array. Sample output below is for MySQL.
<?php
$forge->addKey('blog_id', true);
// gives PRIMARY KEY `blog_id` (`blog_id`)
$forge->addKey('blog_id', true);
$forge->addKey('site_id', true);
// gives PRIMARY KEY `blog_id_site_id` (`blog_id`, `site_id`)
$forge->addKey('blog_name');
// gives KEY `blog_name` (`blog_name`)
$forge->addKey(['blog_name', 'blog_label'], false, false, 'my_key_name');
// gives KEY `my_key_name` (`blog_name`, `blog_label`)
$forge->addKey(['blog_id', 'uri'], false, true, 'my_key_name');
// gives UNIQUE KEY `my_key_name` (`blog_id`, `uri`)
$forge->addPrimaryKey()
$forge->addUniqueKey()
To make code reading more objective it is also possible to add primary and unique keys with specific methods:
<?php
$forge->addPrimaryKey('blog_id', 'pd_name');
// gives PRIMARY KEY `pd_name` (`blog_id`)
$forge->addUniqueKey(['blog_id', 'uri'], 'key_name');
// gives UNIQUE KEY `key_name` (`blog_id`, `uri`)
Note
When you add a primary key, MySQL and SQLite will assume the name PRIMARY
even if a name is provided.
Adding Foreign Keys
Foreign Keys help to enforce relationships and actions across your tables. For tables that support Foreign Keys, you may add them directly in forge:
<?php
$forge->addForeignKey('users_id', 'users', 'id');
// gives CONSTRAINT `TABLENAME_users_id_foreign` FOREIGN KEY(`users_id`) REFERENCES `users`(`id`)
$forge->addForeignKey(['users_id', 'users_name'], 'users', ['id', 'name']);
// gives CONSTRAINT `TABLENAME_users_id_foreign` FOREIGN KEY(`users_id`, `users_name`) REFERENCES `users`(`id`, `name`)
You can specify the desired action for the “on update” and “on delete” properties of the constraint as well as the name:
<?php
$forge->addForeignKey('users_id', 'users', 'id', 'CASCADE', 'CASCADE', 'my_fk_name');
// gives CONSTRAINT `my_fk_name` FOREIGN KEY(`users_id`) REFERENCES `users`(`id`) ON DELETE CASCADE ON UPDATE CASCADE
$forge->addForeignKey('users_id', 'users', 'id', '', 'CASCADE');
// gives CONSTRAINT `TABLENAME_users_foreign` FOREIGN KEY(`users_id`) REFERENCES `users`(`id`) ON DELETE CASCADE
$forge->addForeignKey(['users_id', 'users_name'], 'users', ['id', 'name'], 'CASCADE', 'CASCADE', 'my_fk_name');
// gives CONSTRAINT `my_fk_name` FOREIGN KEY(`users_id`, `users_name`) REFERENCES `users`(`id`, `name`) ON DELETE CASCADE ON UPDATE CASCADE
Note
SQLite3 does not support the naming of foreign keys. CodeIgniter will refer to them by prefix_table_column_foreign
.
Creating a Table
After fields and keys have been declared, you can create a new table with
<?php
$forge->createTable('table_name');
// gives CREATE TABLE table_name
An optional second parameter set to true will create the table only if it doesn’t already exist.
<?php
$forge->createTable('table_name', true);
// creates table only if table does not exist
You could also pass optional table attributes, such as MySQL’s ENGINE
:
<?php
$attributes = ['ENGINE' => 'InnoDB'];
$forge->createTable('table_name', false, $attributes);
// produces: CREATE TABLE `table_name` (...) ENGINE = InnoDB DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci
Note
Unless you specify the CHARACTER SET
and/or COLLATE
attributes,
createTable()
will always add them with your configured charset
and DBCollat values, as long as they are not empty (MySQL only).
Dropping Tables
Dropping a Table
Execute a DROP TABLE
statement and optionally add an IF EXISTS
clause.
<?php
// Produces: DROP TABLE `table_name`
$forge->dropTable('table_name');
// Produces: DROP TABLE IF EXISTS `table_name`
$forge->dropTable('table_name', true);
A third parameter can be passed to add a CASCADE
option, which might be required for some
drivers to handle removal of tables with foreign keys.
<?php
// Produces: DROP TABLE `table_name` CASCADE
$forge->dropTable('table_name', false, true);
Modifying Tables
Adding a Field to a Table
$forge->addColumn()
The addColumn()
method is used to modify an existing table. It
accepts the same field array as Creating Tables, and can
be used to add additional fields.
Note
Unlike when creating a table, if null
is not specified, the column
will be NULL
, not NOT NULL
.
<?php
$fields = [
'preferences' => ['type' => 'TEXT'],
];
$forge->addColumn('table_name', $fields);
// Executes: ALTER TABLE `table_name` ADD `preferences` TEXT
If you are using MySQL or CUBIRD, then you can take advantage of their
AFTER
and FIRST
clauses to position the new column.
Examples:
<?php
// Will place the new column after the `another_field` column:
$fields = [
'preferences' => ['type' => 'TEXT', 'after' => 'another_field'],
];
// Will place the new column at the start of the table definition:
$fields = [
'preferences' => ['type' => 'TEXT', 'first' => true],
];
Dropping Fields From a Table
$forge->dropColumn()
Used to remove a column from a table.
<?php
$forge->dropColumn('table_name', 'column_to_drop'); // to drop one single column
Used to remove multiple columns from a table.
<?php
$forge->dropColumn('table_name', 'column_1,column_2'); // by proving comma separated column names
$forge->dropColumn('table_name', ['column_1', 'column_2']); // by proving array of column names
Modifying a Field in a Table
$forge->modifyColumn()
The usage of this method is identical to addColumn()
, except it
alters an existing column rather than adding a new one. In order to
change the name, you can add a “name” key into the field defining array.
<?php
$fields = [
'old_name' => [
'name' => 'new_name',
'type' => 'TEXT',
'null' => false,
],
];
$forge->modifyColumn('table_name', $fields);
// gives ALTER TABLE `table_name` CHANGE `old_name` `new_name` TEXT NOT NULL
Note
The modifyColumn()
may unexpectedly change NULL
/NOT NULL
.
So it is recommended to always specify the value for null
key. Unlike when creating
a table, if null
is not specified, the column will be NULL
, not
NOT NULL
.
Note
Due to a bug, prior v4.3.3, SQLite3 may not set NOT NULL
even if you
specify 'null' => false
.
Note
Due to a bug, prior v4.3.3, Postgres and SQLSRV set NOT NULL
even
if you specify 'null' => false
.
Adding Keys to a Table
New in version 4.3.0.
You may add keys to an existing table by using addKey()
, addPrimaryKey()
,
addUniqueKey()
or addForeignKey()
and processIndexes()
:
<?php
$this->forge->addKey(['category', 'name'], false, false, 'category_name');
$this->forge->addPrimaryKey('id', 'pk_actions');
$this->forge->addForeignKey('userid', 'user', 'id', '', '', 'userid_fk');
$this->forge->processIndexes('actions');
/* gives:
ALTER TABLE `actions` ADD KEY `category_name` (`category`, `name`);
ALTER TABLE `actions` ADD CONSTRAINT `pk_actions` PRIMARY KEY(`id`);
ALTER TABLE `actions` ADD CONSTRAINT `userid_fk` FOREIGN KEY (`userid`) REFERENCES `user`(`id`);
*/
Dropping a Primary Key
New in version 4.3.0.
Execute a DROP PRIMARY KEY.
<?php
// MySqli Produces: ALTER TABLE `tablename` DROP PRIMARY KEY
// Others Produces: ALTER TABLE `tablename` DROP CONSTRAINT `pk_tablename`
$forge->dropPrimaryKey('tablename');
Dropping a Key
Execute a DROP KEY.
<?php
// For Indexes Produces: DROP INDEX `users_index` ON `tablename`
// For Unique Indexes Produces: ALTER TABLE `tablename` DROP CONSTRAINT `users_index`
$forge->dropKey('tablename', 'users_index', false);
Dropping a Foreign Key
Execute a DROP FOREIGN KEY.
<?php
// Produces: ALTER TABLE `tablename` DROP FOREIGN KEY `users_foreign`
$forge->dropForeignKey('tablename', 'users_foreign');
Renaming a Table
Executes a TABLE rename
<?php
$forge->renameTable('old_table_name', 'new_table_name');
// gives ALTER TABLE `old_table_name` RENAME TO `new_table_name`
Class Reference
- class CodeIgniter\Database\Forge
- addColumn($table[, $field = []])
- Parameters
$table (
string
) – Table name to add the column to$field (
array
) – Column definition(s)
- Returns
true on success, false on failure
- Return type
bool
Adds a column to an existing table. Usage: See Adding a Field to a Table.
- addField($field)
- Parameters
$field (
array
) – Field definition to add
- Returns
\CodeIgniter\Database\Forge
instance (method chaining)- Return type
\CodeIgniter\Database\Forge
Adds a field to the set that will be used to create a table. Usage: See Adding Fields.
- addForeignKey($fieldName, $tableName, $tableField[, $onUpdate = '', $onDelete = '', $fkName = ''])
- Parameters
$fieldName (
string|string[]
) – Name of a key field or an array of fields$tableName (
string
) – Name of a parent table$tableField (
string|string[]
) – Name of a parent table field or an array of fields$onUpdate (
string
) – Desired action for the “on update”$onDelete (
string
) – Desired action for the “on delete”$fkName (
string
) – Name of foreign key. This does not work with SQLite3
- Returns
\CodeIgniter\Database\Forge
instance (method chaining)- Return type
\CodeIgniter\Database\Forge
Adds a foreign key to the set that will be used to create a table. Usage: See Adding Foreign Keys.
Note
$fkName
can be used since v4.3.0.
- addKey($key[, $primary = false[, $unique = false[, $keyName = '']]])
- Parameters
$key (
mixed
) – Name of a key field or an array of fields$primary (
bool
) – Set to true if it should be a primary key or a regular one$unique (
bool
) – Set to true if it should be a unique key or a regular one$keyName (
string
) – Name of key to be added
- Returns
\CodeIgniter\Database\Forge
instance (method chaining)- Return type
\CodeIgniter\Database\Forge
Adds a key to the set that will be used to create a table. Usage: See Adding Keys.
Note
$keyName
can be used since v4.3.0.
- addPrimaryKey($key[, $keyName = ''])
- Parameters
$key (
mixed
) – Name of a key field or an array of fields$keyName (
string
) – Name of key to be added
- Returns
\CodeIgniter\Database\Forge
instance (method chaining)- Return type
\CodeIgniter\Database\Forge
Adds a primary key to the set that will be used to create a table. Usage: See Adding Keys.
Note
$keyName
can be used since v4.3.0.
- addUniqueKey($key[, $keyName = ''])
- Parameters
$key (
mixed
) – Name of a key field or an array of fields$keyName (
string
) – Name of key to be added
- Returns
\CodeIgniter\Database\Forge
instance (method chaining)- Return type
\CodeIgniter\Database\Forge
Adds a unique key to the set that will be used to create a table. Usage: See Adding Keys.
Note
$keyName
can be used since v4.3.0.
- createDatabase($dbName[, $ifNotExists = false])
- Parameters
$db_name (
string
) – Name of the database to create$ifNotExists (
string
) – Set to true to add anIF NOT EXISTS
clause or check if database exists
- Returns
true on success, false on failure
- Return type
bool
Creates a new database. Usage: See Creating and Dropping Databases.
- createTable($table[, $if_not_exists = false[, array $attributes = []]])
- Parameters
$table (
string
) – Name of the table to create$if_not_exists (
string
) – Set to true to add anIF NOT EXISTS
clause$attributes (
string
) – An associative array of table attributes
- Returns
Query object on success, false on failure
- Return type
mixed
Creates a new table. Usage: See Creating a Table.
- dropColumn($table, $column_name)
- Parameters
$table (
string
) – Table name$column_names (
mixed
) – Comma-delimited string or an array of column names
- Returns
true on success, false on failure
- Return type
bool
Drops single or multiple columns from a table. Usage: See Dropping Fields From a Table.
- dropDatabase($dbName)
- Parameters
$dbName (
string
) – Name of the database to drop
- Returns
true on success, false on failure
- Return type
bool
Drops a database. Usage: See Creating and Dropping Databases.
- dropKey($table, $keyName[, $prefixKeyName = true])
- Parameters
$table (
string
) – Name of table that has key$keyName (
string
) – Name of key to be dropped$prefixKeyName (
string
) – If database prefix should be added to$keyName
- Returns
true on success, false on failure
- Return type
bool
Drops an index or unique index.
Note
$keyName
and$prefixKeyName
can be used since v4.3.0.
- dropPrimaryKey($table[, $keyName = ''])
- Parameters
$table (
string
) – Name of table to drop primary key$keyName (
string
) – Name of primary key to be dropped
- Returns
true on success, false on failure
- Return type
bool
Drops a primary key from a table.
Note
$keyName
can be used since v4.3.0.
- dropTable($table_name[, $if_exists = false])
- Parameters
$table (
string
) – Name of the table to drop$if_exists (
string
) – Set to true to add anIF EXISTS
clause
- Returns
true on success, false on failure
- Return type
bool
Drops a table. Usage: See Dropping a Table.
- processIndexes($table)
New in version 4.3.0.
- Parameters
$table (
string
) – Name of the table to add indexes to
- Returns
true on success, false on failure
- Return type
bool
Used following
addKey()
,addPrimaryKey()
,addUniqueKey()
, andaddForeignKey()
to add indexes to an existing table. See Adding Keys to a Table.
- modifyColumn($table, $field)
- Parameters
$table (
string
) – Table name$field (
array
) – Column definition(s)
- Returns
true on success, false on failure
- Return type
bool
Modifies a table column. Usage: See Modifying a Field in a Table.
- renameTable($table_name, $new_table_name)
- Parameters
$table (
string
) – Current of the table$new_table_name (
string
) – New name of the table
- Returns
Query object on success, false on failure
- Return type
mixed
Renames a table. Usage: See Renaming a Table.


Home
About
Products
Blog
Contact
Contact Us
Please fill out the form below and we will get back to you! Thank you.
Firstname:
Lastname:
Age:
Email Address:
Submit


Back
Add LCO
Employee Id:
Employee Name:
Employee Email:
S No
lcoName
lcoCode
address
jvCode
jvName
city
state
aopLocation
pincode
phone
parentCode
area
dealerTypeId
oldAopLocation
employeeId
agreementId
kycId


As usual, answer all questions in a plain text file
named questions4.txt
.
At the top of your plain text file, please include your name, user id, and lab section.
Failure to do so will result in a 0.
This classic problem requires that the farmer carry his wolf, goat, and
cabbage across a river in a leaky boat.
Because the boat leaks, the farmer can only take one of the three items
in each trip across the river.
However, if the wolf is left alone with the goat, it eats the goat.
Similarly, if the goat is left alone with the cabbage, it eats the cabbage.
In this lab, you will create a digital logic circuit that will allow a
user to attempt to solve this puzzle.
You'll also publish this puzzle on your web page.
During lecture, we said we would be doing a number related lab this week.
However, we had a slight change of heart and will be doing this one instead.
Start by opening the logic workbench and wiring up the inputs as illustrated here.
The four toggle switches each represent the four things to move across the river: the farmer, the wolf, the goat, and the cabbage. When the corresponding switch is turned off, it represents the item being on the left side of the river. When it's turned on, it represents the item on the right side of the river. If your browser supports it, I recommend double clicking on the names of the switches and changing them to names that describe the items they represent. The push on switch is used to test a configuration to see whether it is a final solution, a safe state, or a dangerous state. Your first task for this lab is to create a circuit for detecting the successful completion of the task. You should design and construct a circuit that illuminates an LED when all four are on the right side of the river. Test your circuit and ensure that the LED lights exactly when all four toggle switches are on and the push button is pressed. Take a PDF capture of your circuit, name it circuit3.pdf and upload it with questions3.txt .
For using logic to express the behavior of this puzzle,
we will have four Boolean variables: f, w, g, and c.
These correspond to the farmer, the wolf, the goat, and the cabbage, respectively.
For each of the variables, a True value indicates that the corresponding thing
is on the right bank of the river, and a False value indicates that it is
on the left bank.
The next step in developing this puzzle web page is to write a Boolean
expression that is True when there is a potential problem on the right bank:
that is when the farmer is not there and either the wolf and goat or the goat
and cabbage are there.
Remember, it's only a problem if the farmer is not there to keep control.
Write down the truth table for the answer.
Now that you have a truth table, you can build an equation off of this. From your equation, build it in the logic workbench and make sure you test all the cases. Write your boolean expression as an answer.
Now we need to address the same issue on the other side of the river. In particular, we want to create a circuit that lights an LED when there is danger on the left side of the river. As before, you're asked to write down the truth table for the danger condition in this problem, and you'll be asked to create the circuit in the next. So below, write the truth table for the danger on the other side of the river.
As before, write a boolean expression for the truth table you wrote in question 4. From there, wire it up and test it in the logic workbench. For the answer write your expression.
At this point, you should have a complete circuit that simulates the actions that take place in this puzzle. Each member of your lab group should now use another person's circuit to attempt to solve the puzzle. Did you find any problems with anyone else's circuit? If so, what were they? Did anyone find any problems with your circuit? If so, what were they and how did you fix them?
We're gonna do a quick break from the boolean algebra to prepare you for the next step. You're going to complete this tutorial on HTML. In the next step, you're going to create a webpage to display the circuit you've made. To recieve credit for question 7, what is the answer to part 8 of the tutorial?
Now that you've finished development of your puzzle and thoroughly tested it,
it's time to publish the result.
Create a web page named fwgc.html in your public_html directory on tux.
To get the data to paste into that file,
go back to your circuit in the logic workbench.
On a Mac, use command-left click to change the graphical display
to the circuit data.
Other other platforms, use ctrl-left click to do the same thing.
When you have your circuit description in textual form,
cut and paste it into the HTML file.
You can then use command-left click or ctrl-left click to return to the
graphical presentation of the circuit.
The next step is to enhance the HTML file so that it's more than just the logic workspace.
In particular, you should use the h1 tag to create a title for your page.
Then you should include some text (with proper HTML markup)
that describes what the puzzle is and gives instructions for the user to attempt to
solve the puzzle.
Use the other HTML files you've worked with in lab as examples to follow
for the HTML markup.
To view your results, you'll also need to download some JavaScript and CSS files
into the same directory where you are editing your HTML file.
The files you'll need are:
~bls96/public_html/cs164/logwb
to your
public_html directory to get these files.
There are also sample files in that directory that you can look at to embed your circuit.
If you finish the main assignment and want to do a little more for a few points of extra credit, then clean up the way the circuit workspace looks. In particular, figure out how to remove the toolbar of circuit elements that appears on the left side of the workspace. Also change the size of the workspace so that it shows the full circuit with just a small amount of blank space around it. Describe below what you did to figure out the changes that needed to be made.
Submit on BBLearn
questions4.txt : A plain text file with your answers to the questions
circuit4.pdf : A PDF of a screenshot of the circuit from Question 1
Webpage on tux
fwgc.html : Your resulting webpage you make in Question 8


Class NavMapComponent
Represents Vector's navigation memory map.
The NavMapComponent object subscribes for nav memory map updates from the robot to store and dispatch.
Implements
Inherited Members
Namespace: Anki.Vector
Assembly: Anki.Vector.dll
Syntax
public class NavMapComponent : Component, INotifyPropertyChanged
Properties
| Improve this Doc View SourceFrequency
Gets the map frequency.
public float Frequency { get; }
Property Type
| Single |
IsFeedActive
Gets a value indicating whether the nav map feed is active.
public bool IsFeedActive { get; }
Property Type
| Boolean |
LatestNavMap
Gets the latest nav map.
public NavMapGrid LatestNavMap { get; }
Property Type
| NavMapGrid |
Methods
| Improve this Doc View SourceStartFeed(Single)
Starts the nav map feed. The feed will run in a background thread and raise the LatestNavMap event for each map change. It will also update the LatestNavMap property.
public Task StartFeed(float frequency = 0.5F)
Parameters
| Type | Name | Description |
|---|---|---|
| Single | frequency | The navmap polling frequency. |
Returns
| Type | Description |
|---|---|
| Task | A task that represents the asynchronous operation. |
StopFeed()
Stops the nav map feed.
public Task StopFeed()
Returns
| Type | Description |
|---|---|
| Task | A task that represents the asynchronous operation. |
Events
| Improve this Doc View SourceNavMapUpdate
Occurs when nav map updated
public event EventHandler<NavMapUpdateEventArgs> NavMapUpdate
Event Type
| EventHandler<NavMapUpdateEventArgs> |


--- layout: blogpost title: Four City Tour with PM2AM, Interlaken-Lyon-Mont Blanc-Geneva comments: true date: 12th October 2016 pc: Silva, Prayaag, Alap, Pabitra, Manish ---
The journey from Interlaken to Lyon took about 4.30 hrs and we checked-in our hotel in Lyon at 4 PM. Everyone was hungry and a bit tired from the journey. Unfortunately, our 3-bedroom in the hotel was very small and the attached toilet/bathroom was also tiny. It felt like a ship’s cabin! After eating some sandwiches and relaxing for a while, we were re-energized to explore this third largest city in France.
Two rivers Rhône and Saône pass through Lyon and meet at a point in the southern part of Lyon. The bridges across both rivers add to the beauty of the town.
We walked across both the rivers and climbed up a hill towards our first spot, the ‘Basilica of Notre-Dame de Fourvière’: a hilltop church and religious art museum. On the way to the Basilica, there was a Museum of Archaeology called ‘Musée de la Civilisation Gallo -Romaine’. It had a huge open-air theater in which Gallo-Roman-era objects including vases, gravestones, mosaics, statues, coins, and ceramics were put on display.
The topmost point on the hill offered a breathtaking panorama of the Lyon city.
By the time evening rolled in, clouds had covered the sky and it started drizzling. The ringing of huge bells in the background made the atmosphere electric. The Basilica itself was very elegantly built!
As the rain subsided, we decided to climb down the hill and roam through the city. The twilight was gone and the city was being lit up in golden lights.
Enjoying the view, we walked along the river for a while. On the way, we stopped at a local food shop and bought our dinner. FC Barcelona’s match was being streamed in the shop but we had to miss it because the food was only available as take-away. So we had our dinner near the ‘Flower Tree’!
The food was delicious! (and as this was our first ‘proper’ meal of the day, it tasted heavenly!) But the quantity was not sufficient to satiate our full-blown hunger. It was already past 9 PM and most of the shops in this part of the city were closed, so we decided to leave for our hotel and look for open food places along the way. After walking through ‘Lyon ki Galiyaan’ for more than an hour and finding most of the restaurants closed or beyond our budget, we finally stumbled upon a kebab shop, which was about to close. Luckily we were able to grab some falafel before the owner closed the shop and then got back to the hotel around 11 PM.


|
LibDriver HMC5883L
2.0.0
HMC5883L full function driver
|
hmc5883l example driver modules More...
Macros | |
| #define | HMC5883L_BASIC_DEFAULT_AVERAGE_SAMPLE HMC5883L_AVERAGE_SAMPLE_8 |
| hmc5883l basic example default definition More... | |
| #define | HMC5883L_BASIC_DEFAULT_DATA_OUTPUT_RATE HMC5883L_DATA_OUTPUT_RATE_15 |
| #define | HMC5883L_BASIC_DEFAULT_MODE HMC5883L_MODE_NORMAL |
| #define | HMC5883L_BASIC_DEFAULT_GAIN HMC5883L_GAIN_820 |
| #define | HMC5883L_SHOT_DEFAULT_AVERAGE_SAMPLE HMC5883L_AVERAGE_SAMPLE_8 |
| hmc5883l shot example default definition More... | |
| #define | HMC5883L_SHOT_DEFAULT_DATA_OUTPUT_RATE HMC5883L_DATA_OUTPUT_RATE_15 |
| #define | HMC5883L_SHOT_DEFAULT_MODE HMC5883L_MODE_NORMAL |
| #define | HMC5883L_SHOT_DEFAULT_GAIN HMC5883L_GAIN_820 |
Functions | |
| uint8_t | hmc5883l_basic_init (void) |
| basic example init More... | |
| uint8_t | hmc5883l_basic_deinit (void) |
| basic example deinit More... | |
| uint8_t | hmc5883l_basic_read (float m_gauss[3]) |
| basic example read More... | |
| uint8_t | hmc5883l_shot_init (void) |
| shot example init More... | |
| uint8_t | hmc5883l_shot_deinit (void) |
| shot example deinit More... | |
| uint8_t | hmc5883l_shot_read (float m_gauss[3]) |
| shot example read More... | |
hmc5883l example driver modules
| #define HMC5883L_BASIC_DEFAULT_AVERAGE_SAMPLE HMC5883L_AVERAGE_SAMPLE_8 |
hmc5883l basic example default definition
average 8 sample
Definition at line 57 of file driver_hmc5883l_basic.h.
| #define HMC5883L_BASIC_DEFAULT_DATA_OUTPUT_RATE HMC5883L_DATA_OUTPUT_RATE_15 |
15Hz output rate
Definition at line 58 of file driver_hmc5883l_basic.h.
| #define HMC5883L_BASIC_DEFAULT_GAIN HMC5883L_GAIN_820 |
gain 820
Definition at line 60 of file driver_hmc5883l_basic.h.
| #define HMC5883L_BASIC_DEFAULT_MODE HMC5883L_MODE_NORMAL |
normal mode
Definition at line 59 of file driver_hmc5883l_basic.h.
| #define HMC5883L_SHOT_DEFAULT_AVERAGE_SAMPLE HMC5883L_AVERAGE_SAMPLE_8 |
hmc5883l shot example default definition
average 8 sample
Definition at line 55 of file driver_hmc5883l_shot.h.
| #define HMC5883L_SHOT_DEFAULT_DATA_OUTPUT_RATE HMC5883L_DATA_OUTPUT_RATE_15 |
15Hz output rate
Definition at line 56 of file driver_hmc5883l_shot.h.
| #define HMC5883L_SHOT_DEFAULT_GAIN HMC5883L_GAIN_820 |
gain 820
Definition at line 58 of file driver_hmc5883l_shot.h.
| #define HMC5883L_SHOT_DEFAULT_MODE HMC5883L_MODE_NORMAL |
normal mode
Definition at line 57 of file driver_hmc5883l_shot.h.
| uint8_t hmc5883l_basic_deinit | ( | void | ) |
basic example deinit
Definition at line 164 of file driver_hmc5883l_basic.c.
| uint8_t hmc5883l_basic_init | ( | void | ) |
basic example init
Definition at line 49 of file driver_hmc5883l_basic.c.
| uint8_t hmc5883l_basic_read | ( | float | m_gauss[3] | ) |
basic example read
| [out] | *m_gauss | points to a converted data buffer |
Definition at line 142 of file driver_hmc5883l_basic.c.
| uint8_t hmc5883l_shot_deinit | ( | void | ) |
shot example deinit
Definition at line 154 of file driver_hmc5883l_shot.c.
| uint8_t hmc5883l_shot_init | ( | void | ) |
shot example init
Definition at line 49 of file driver_hmc5883l_shot.c.
| uint8_t hmc5883l_shot_read | ( | float | m_gauss[3] | ) |
shot example read
| [out] | *m_gauss | points to a converted data buffer |
Definition at line 132 of file driver_hmc5883l_shot.c.


| class | description | |
| AggregationResult | Stores the result of an aggregation operation | |
| Container | Provides management functions for sets of row having same type | Inherits Resource class |
| ContainerInfo | Represents the information about a specific Container | |
| GSException | Exception for GridDB | |
| PartitionController | Controller for acquiring and processing the partition status | |
| Query | Provides the functions of holding the information about a query related to a specific Container, specifying the options for fetching and retrieving the result | Inherits Resource class |
| Resource | Error handling | |
| Row | A general-purpose Row for managing fields in any schema | Inherits Resource class |
| RowSet | Manages a set of Rows obtained by a query | Inherits Resource class |
| Store | Provides functions to manipulate the entire data managed in one GridDB system | Inherits Resource class |
| StoreFactory | Manages a Store instance | Inherits Resource class |
| Timestamp | Provides the utilities for manipulating time data |


This is an early payment, any additionals fee will be added to the
| Confirmation Number | Billing recipet sent to (digital) | Billing recipet sent to (printed) |
|---|
|<PHONE_NUMBER>94 |<EMAIL_ADDRESS>| 1475 cedarhurst ave,<PHONE_NUMBER> Charleston, SC 29407 United Sates of America |


Nathan Liboutet
01.
Home
02.
Works
03.
About me
04.
Contact
UX/UI Designer, based in Paris and working at Creat’. A bit of a geek on the edges, I aim to discover everything that has to do with design, from near and far.
“There are three responses to a piece of design - yes, no, and Wow! Wow is the one to aim for.”


RT @notahat: Figured out why I don't like Ruby 1.9 hash syntax. "a :b" and "a: b" are both syntactically correct, but mean completely di ...
1/28/2013, 10:10:15 PM
Favs: 0
Retweets: 0
link--- layout: tweet ---
RT @notahat: Figured out why I don't like Ruby 1.9 hash syntax. "a :b" and "a: b" are both syntactically correct, but mean completely di ...
1/28/2013, 10:10:15 PM
Favs: 0
Retweets: 0
link


The options below control the operation of the FontWarnings extension that is run when you include "FontWarnings.js" in the extensions array of your configuration. They are listed with their default values. To set any of these options, include a FontWarnings section in your MathJax.Hub.Config() call. For example
MathJax.Hub.Config({
FontWarnings: {
fadeoutTime: 2*1000
}
});
would set the fadeoutTime option to 2000 milliseconds (2 seconds).
This sets the CSS styles to be used for the font warning message window. See the extensions/FontWarnings.js file for details of what are set by default. See the CSS style objects for details about how to specify CSS styles via javascript objects.
This block contains HTML snippets to be used for the various messages that the FontWarning extension can produce. There are three messages that you can redefine to suit your needs:
The message used for when MathJax uses web-based fonts (rather than local fonts installed on the user’s system).
The message used for when MathJax must use image fonts rather than local or web-based fonts (for those browsers that don’t handle the @font-face CSS directive).
The message used when MathJax is unable to find any font to use (i.e., neither local nor web-based nor image-based fonts are available).
Any message that is set to null rather than an HTML snippet array will not be presented to the user, so you can set, for example, the webFont message to null in order to have the imageFonts and noFonts messages, but no message if MathJax uses web-based fonts.
See the description of HTML snippets for details about how to describe the messages using HTML snippets. Note that in addition to the usual rules for defining such snippets, the FontWarnings snippets can include references to pre-defined snippets (that represent elements common to all three messages). These are defined below in the HTML block, and are referenced using ["name"] within the snippet, where name is the name of one of the snippets defined in the HTML configuration block. For example
Message: {
noFonts: [
["closeBox"],
"MathJax is unable to locate a font to use to display ",
"its mathematics, and image fonts are not available, so it ",
"is falling back on generic unicode characters in hopes that ",
"your browser will be able to display them. Some characters ",
"may not show up properly, or possibly not at all.",
["fonts"],
["webfonts"]
]
}
refers to the closeBox, fonts and webfonts snippets declared in the HTML section.
This object defines HTML snippets that are common to more than one message in the Message section above. They can be included in other HTML snippets by by using ["name"] in an HTML snippet, where name refers to the name of the snippet in the HTML block. The pre-defined snippets are:
The HTML for the close box in the FontWarning message.
The HTML for a paragraph suggesting an upgrade to a more modern browser that supports web fonts.
HTML that includes links to the MathJax and STIX font download pages.
HTML that gives the download link for the STIX fonts only. (Used in place of fonts when the HTML-CSS option for availableFonts only includes the STIX fonts.)
HTML that gives the download link for the MathJax TeX fonts only. (Used in place of fonts when the HTML-CSS option for availableFonts only includes the TeX fonts.)
You can add your own pre-defined HTML snippets to this object, or override the ones that are there with your own text.
This is the amount of time to show the FontWarning message, in milliseconds. The default is 12 seconds.
This is the number of steps to take while fading out the FontWarning message. More steps make for a smoother fade-out.
This is the time used to perform the fade-out, in milliseconds. The default is 1.5 seconds.


cs complete dep
Allows the developer to search for libraries without searching directly on the web but from the command line.
More information: home page
- Print which artifacts are published under a specific Maven group identifier:
cs complete-dep group_id
- List published library versions under a specific Maven group identifier and an artifact one:
cs complete-dep group_id:artifact_id
- Print which artifacts are pubblished under a given Maven groupId searching in the ivy2local:
cs complete-dep group_id --repository ivy2local
- List published artifacts under a Maven group identifier searching in a specific repository and credentials:
cs complete-dep group_id:artifact_id --repository repository_url --credentials user:password