Build a Raspberry Pi Cluster
How to build a cluster with Raspberry Pi.
Background
Building a cluster with Raspberry Pi is a good way to learn about cluster computing and distributed systems. It is also a good way to learn about Linux and networking. In this post, I will show you how to build a cluster with Raspberry Pi.
The hardware we need is listed below:
- Four Raspberry Pi 4 B boards
- Four 64GB MicroSD cards, one for each board
- Cables: four Ethernet cables, four MicroUSB cables, one Micro HDMI cable
- One 40W 8A 4-port USB Charging Station
- One 5-port switch
- One cluster rack that has coolers installed
Cluster assemble
Easy and self-explanatory. Lots of related videos on Youtube.
We’re going to access each node using wireless LAN and use Ethernet port for communication among nodes. Thus the switch does not have to be connected to internet.
The connection is shown below:
OS installation
We use CentOS in our cluster. To be noticed, the distribution for armv7hl platform is called “CentOS Userland Linux” and not “CentOS Linux”.
- For Raspberry Pi 4, we have a limited choice on what version of CentOS we can use. We choose CentOS-Userland-7-armv7hl-RaspberryPI-Minimal-4 for our cluster.
- Download the zip file and unzip it to iso image. Image all microSD cards with CentOS7 using Raspberry Pi Imager. The default root passward is centos.
Expand capacity
There is a /root/README
file that describes how to expand the root partition to capacity of the MicroSD. On each node, follow the instructions to expand the root filesystem using: rootfs-expand
== CentOS 7 userland ==
If you want to automatically resize your / partition, just type the following (as root user):
rootfs-expand
Network configuration
Wifi
On each node, configure Wifi network with Network Manager Text User Interface(nmtui
) tool.
Ethernet
There is no eth0
ifcfg files by default. We create a file named /etc/sysconfig/network-scripts/ifcfg-eth0
as follows:
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
PREFIX=24
# IPADDR are <IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS> for master, node1, node2, node3, respectively.
IPADDR=<IP_ADDRESS>
Restart network service: systemctl restart network
Brand new key
For the cluster to work, each worker node needs to be able to talk to the master node without needing a password to login. To do this, we use SSH keys. Run the following:
ssh-keygen -t rsa
This creates a unique digital “identity” (and key pairs) for the computer. You’ll be asked a few questions; just press RETURN for each one and do not create a passphrase when asked. Next, tell the master(<IP_ADDRESS> in our setup) about the keys by running the following on every other node:
ssh-copy-id <IP_ADDRESS>
Finally, do the same on the master node and copy its key to every other node in the cluster.
Setup NFS server
NFS stands for Network File System, helps you to share files and folders between Linux/Unix systems, developed by SUN Microsystems in 1990. NFS enables you to mount a remote share locally.
Install NFS server
Install the below package for NFS server using the yum
command.
yum install -y nfs-utils
Once the packages are installed, enable and start NFS services.
systemctl start nfs-server rpcbind
systemctl enable nfs-server rpcbind
Create NFS share
Create a directory to share with the NFS client. We will create a new directory named nfs
in the /
partition.
mkdir /nfs
Allow NFS client to read and write to the created directory.
chmod 777 /nfs/
We have to modify /etc/exports
file to make an entry of directory /nfs
that you want to share.
vi /etc/exports
Create a NFS share:
/nfs <IP_ADDRESS>/4(rw,sync,no_root_squash,no_subtree_check)
<IP_ADDRESS>/4
defines the range of client IP addresses.
Export the shared directories using the following command.
exportfs -r
Configure firewall
We need to configure the firewall on the NFS server to allow NFS client to access the NFS share. Run the following commands on the NFS server(master, <IP_ADDRESS>)
firewall-cmd --permanent --add-service mountd
firewall-cmd --permanent --add-service rpc-bind
firewall-cmd --permanent --add-service nfs
firewall-cmd --reload
Install NFS client
We need to install NFS packages on NFS client(<IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>) to mount a remote NFS share. Install NFS packages using below command.
yum install -y nfs-utils
Check the NFS shares available on the NFS server by running the following command on the NFS client.
showmount -e <IP_ADDRESS>
Mount NFS share
Create a directory on NFS client to mount the NFS share /nfs
which we have created in the NFS server.
mkdir /nfs
Use blow command to mount a NFS share /nfs
from NFS server <IP_ADDRESS>
in /nfs
on NFS client.
mount <IP_ADDRESS>:/nfs /nfs
You can use the df -hT
command to check the mounted NFS share.
Create a file on the mounted directory to verify the read and write access on NFS share.
touch /nfs/test
If other nodes can see the test file, you have working NFS setup.
Automount NFS shares.
To mount the shares automatically on every reboot, you would need to modify /etc/fstab
file of your NFS clients.
vi /etc/fstab
Add an entry at the end of the file:
<IP_ADDRESS>:/nfs /nfs nfs auto,noatime,nolock,bg,nfsvers=3,intr,tcp,actimeo=1800 0 0
Save and close the file.
Reboot the client machine and check whether the share is automatically mounted or not.
If you want to unmount that shared directory from your NFS client, you can unmount that particular directory using umount
command.
umount /nfs


|
Easy Online Shopping
|
|
Free Delivery
|
|
Free Returns*
|
|
100 Days Return
|
|
|
Find Inspiration
|
|
|
|
Shop Easily
|
|
|
|
|
|
Legal Notice Zalando.co.uk is brought to you by Zalando SE
|
|
Tamara-Danz-Str. 1, 10243 Berlin, Germany
|
|
Management Booard: Robert Gentz, David Schneider, Rubin Ritte
|
|
Chairman of the Supervisory Board: Lothar Lanz
|
|
Registered at Amtsgericht Charlottenburg Berlin, HRB 158855 B
|
|
VAT ID: DE 260543043, Tax number:37/132/45004
|
|
All prices include VAT. Only while stock lasts. All prices subject to change.
|
|
Responsible for contents of Zalando SE: Robert Gentz
|
|
This is an automatic email the inbox is unattended, please do not reply.
|


Bacon ipsum dolor amet short loin meatloaf spare ribs sausage.
 Leberkas alcatra sausage venison shoulder shank tri-tip landjaeger porchetta. Ham bresaola short ribs chuck. Ball tip pork chop frankfurter doner turkey, porchetta pork belly.


A wrapper contains another instance, the delegate, to which it transfers any call it receives. The calls of the user to a wrapper are transferred to the delegate, and the answers of the delegate are transferred back by the wrapper to the user. The whole point of a wrapper is, in other words, to play as an intermediary between the user and the delegate.
Different types of wrappers can be designed:
interface Foo {
void doSomething();
}
class FooProxy implements Foo {
private Foo delegate;
void setDelegate(Foo newDelegate) {
this.delegate = newDelegate;
}
public void doSomething() {
delegate.doSomething();
}
}
interface Foo {
void doSomething();
}
class FooDecorator implements Foo {
private final Foo delegate;
public FooDecorator(Foo foo) {
this.delegate = foo;
}
public void doSomething() {
doSomethingBefore();
delegate.doSomething();
doSomethingAfter();
}
private void doSomethingBefore() {...}
private void doSomethingAfter() {...}
}
interface Source {
long doSomething(char[] sourceArg);
}
interface Target {
int doItAnotherWay(String targetArg);
}
class SourceTargetAdapter implements Target {
private final Source delegate;
SourceTargetAdapter(Source source) {
this.delegate = source;
}
public int doItAnotherWay(String targetArg) {
char[] sourceArg = targetArg.toCharArray(); // Param translation
long sourceResult = delegate.doSomething(sourceArg);
int targetResult = (int) sourceResult; // Result translation
return targetResult;
}
}
interface Foo {
void foo1(String arg1, int arg2, boolean arg3);
void foo2(char[] arg1, boolean arg2);
}
interface Bar {
void bar();
}
class FooMethodReductionFacade {
private final Foo foo;
public FooMethodReductionFacade(Foo foo) {
this.foo = foo;
}
public void foo1(String arg1, int arg2, boolean arg3) {
foo.foo1(arg1, arg2, arg3);
}
// No foo2 method because not wanted
}
class FooParamReductionFacade {
private final Foo foo;
private final int intArg = 0;
private final boolean boolArg = true;
public FooParamReductionFacade(Foo foo) {
this.foo = foo;
}
public void foo1(String arg) { // No param 2 & 3
foo.foo1(arg, intArg, boolArg); // Use defaults
}
public void foo2(char[] arg) { // No param 2
foo.foo2(arg, boolArg); // Use default
}
}
class FooBarMergingFacade implements Foo, Bar {
private final Foo foo;
private final Bar bar;
public FooBarMergingFacade(Foo foo, Bar bar) {
this.foo = foo;
this.bar = bar;
}
// Expose Foo method
public void foo1(String arg, int arg2, boolean arg3) {
foo.foo1(arg, arg2, arg3);
}
// Expose Foo method
public void foo2(char[] arg, boolean arg2) {
foo.foo2(arg, arg2);
}
// Expose Bar method
public void bar() {
bar.bar();
}
}
Although the term of wrapper have been initially used only for the adapter and the decorator patterns, more specific terms exist to do the difference. Their common aspect, i.e. the delegate, becomes the main aspect of the more generic concept of wrapper. Since this aspect applies also to other designs, as shown above, we use the term of wrapper more broadly in this article. The examples above are not the only ones, and a single class can combine several of them depending on the needs. Generally speaking, any class that relies on a delegate to provide the main feature will be considered as a wrapper class in this article.
The wrapper, because it relies on its delegate to provide the main feature, should preserve its behaviour. But different delegates my come with different behaviours, so should we test the wrapper with any possible delegate? Such an objective would be unreasonable: there may have to much possibilites to properly test all the relevant behaviours.
Some of them implement a single interface, so we may at least test the common behaviours. But since the wrapper itself does not store the logic, it would need to be tested with a specific instance. Such a stratgy would also be unreasonable: we would confirm the wrapper only for a single delegate. Morover, the delegate may require a huge set up effort and, since it may be already tested alone, it seems unreasonable to spend all this effort again to test the wrapper.
In fact, the solution is rather trivial and systematic. Indeed, the contract of a wrapper is not to provide the features of the delegate, but to wrap it. This delegate is the one holding the contract of the feature to implement. The only contract of the wrapper is then to properly play its intermediary role. In other words, it should be tested on its ability to transfer the calls to the delegate, and transfer back the answer of this delegate.
Let's take this interface as an example:
interface Foo {
boolean doSomething(String arg1, int arg2);
}
And this wrapper implementation:
class FooWrapper {
private final Foo delegate;
private final int hiddenArg = 0;
public FooWrapper(Foo foo) {
this.delegate = foo;
}
public boolean doSomething(String arg) {
return delegate.doSomething(arg, hiddenArg);
}
}
A proper test would check that, for each method:
public class FooWrapperTest {
@Test
public void testDoSomethingIsCorrectlyMapped() {
// Decide the expected values
String expectedShownArg = "test";
int expectedHiddenArg = 0;
boolean expectedResult = true;
// Store the transferred values
String[] actualShownArg = {null};
Integer[] actualHiddenArg = {null};
FooWrapper wrapper = new FooWrapper(new Foo() {
public boolean doSomething(String arg1, int arg2) {
actualShownArg[0] = arg1;
actualHiddenArg[0] = arg2;
return expectedResult;
}
});
boolean actualResult = wrapper.doSomething(expectedShownArg);
// Check they correspond
assertEquals(expectedShownArg, actualShownArg[0]);
assertEquals(expectedHiddenArg, actualHiddenArg[0], 0);
assertEquals(expectedResult, actualResult);
}
}
The key point is to check that everything is properly transferred. Be careful if you prefer to write the arguments assertions in the delegate method. If it is not called, and you have no returned value to check, you may have a passing test without calling the delegate:
class FooWrapper {
private final Foo delegate;
private final int hiddenArg = 0;
public FooWrapper(Foo foo) {
this.delegate = foo;
}
public void doSomething(String arg) {
// Forget to call the delegate
}
}
public class FooWrapperTest {
@Test
public void testDoSomethingIsCorrectlyMapped() {
String expectedShownArg = "test";
int expectedHiddenArg = 0;
FooWrapper wrapper = new FooWrapper(new Foo() {
public void doSomething(String arg1, int arg2) {
// Never called, so no assertion fail and all is green
assertEquals(expectedShownArg, arg1);
assertEquals(expectedHiddenArg, arg2, 0);
}
});
wrapper.doSomething(expectedShownArg);
}
}
Prefer to systematically check the method is called in this case:
public class FooWrapperTest {
@Test
public void testDoSomethingIsCorrectlyMapped() {
String expectedShownArg = "test";
int expectedHiddenArg = 0;
boolean[] isCalled = {false};
FooWrapper wrapper = new FooWrapper(new Foo() {
public void doSomething(String arg1, int arg2) {
assertEquals(expectedShownArg, arg1);
assertEquals(expectedHiddenArg, arg2, 0);
isCalled[0] = true;
}
});
wrapper.doSomething(expectedShownArg);
assertTrue(isCalled[0]); // Fail here
}
}


| credentials | Load and store git HTTPS credentials |
| credential_api | Retrieve and store git HTTPS credentials |
| credential_approve | Retrieve and store git HTTPS credentials |
| credential_fill | Retrieve and store git HTTPS credentials |
| credential_helper | Credential Helpers |
| credential_helper_get | Credential Helpers |
| credential_helper_list | Credential Helpers |
| credential_helper_set | Credential Helpers |
| credential_reject | Retrieve and store git HTTPS credentials |
| git_credential_ask | Load and store git HTTPS credentials |
| git_credential_forget | Load and store git HTTPS credentials |
| git_credential_update | Load and store git HTTPS credentials |
| http_credentials | Load and store git HTTPS credentials |
| set_github_pat | Set your Github Personal Access Token |
| ssh_agent_add | Managing Your SSH Key |
| ssh_credentials | Managing Your SSH Key |
| ssh_home | Managing Your SSH Key |
| ssh_keygen | Managing Your SSH Key |
| ssh_key_info | Managing Your SSH Key |
| ssh_read_key | Managing Your SSH Key |
| ssh_setup_github | Managing Your SSH Key |
| ssh_update_passphrase | Managing Your SSH Key |


Machine learning
...as briefly as possible
Machine learning tasks
- Classification: Predict a class
- Regression: Predict a continuous value
- Clustering: Predict similarity
Machine learning setups
- Supervised: Labelled data
- Unsupervised: No labels
- Semi-supervised: Small amounts of labelled data
Popular algorithms
- Support vector machines (SVM)
- Random Forests
- Penalized Regression
- K-means, K-nearest-neighbour
- Deep neural networks
Data preprocessing
- Some ML algorithms are sensitive to scales, so scale/center
- Reduce dimensionality (PCA)
- [Discretize]
Training and Testing
- Input data is split 70:30. First set is used to build model, second to evaluate overfitting.
- K-fold cross validation repeats this K times
- Leave one out (LOO) or leave P out (LPO)
Decision trees
Bootstrap aggregation of many trees
Penalties
- L1: Lasso
- L2: Ridge
- L1/L2: Elastic Net
- Select number of cluster
- Algorithm will recursively divide data to find best assignments


- Choose "File:separate:separate these images" to make four separate displays.
- Choose to create 3 or more slices of the color wheel and 3 colormaps.
- Click next to the chandra, galex, spitzer images to assign new colormaps.
- Click the colored rectangle to display the color picker.
- Choose different base colors and see how the three colormaps change.
- For three slices, the colormaps will be spaced around the whole
color wheel.
- For six slices, the colormaps will be spaced around the half the colorwheel.
|
- In the fourth display, choose "View:colormaps" to bring up a new colormaps plugin.
- Click the button to the left of the hst image.
- Click the colored rectangle to switch the color picker to this plugin.
- Choose a base color and see how only this colormap changes.
- Switch between plugins by clicking the appropriate colored rectangle.
|


Pairing and Giving Feedback
At first, pairing with others to solve challenges was in itself a whole new challenge. On one hand, it was fun to work on challenges with other people rather than just alone. On the other, I did find that the difficult part of solving the challenge was not the challenge itself, but in communicating with another person. Now that we are more than half way through Phase 0, I have gotten to know a few people who I not only enjoy pairing with and learn from, but whom I would consider friends.
I think one thing that was initially frustrating was assigning driver/navigator roles. Ultimately, that always ended up feeling more like student/teacher roles. It felt a little artificial to do that when both people are typing on a shared Stypi document. For example, telling the "driver" what to type was sometimes much less practical than simply showing them a line of code at times, the way our guides do during GPS sessions. This is something that has gotten easy to work out as we go along through the process of solving a challenge. As long as we can both agree on a way to work together that benefits both of us and keep the communication line open, it seems to go well.
Reading my feedback was mostly helpful and encouraging. I did feel like I got some conflicting feedback, which was confusing. I think I struggled initially to find the balance between being proactive during pairing and being cooperative. There was one session in which I felt like I really wanted to be helpful rather than just be a deadweight (which was how I felt around week 1), so I was intentionally about being assertive and trying to teach new things. Based on the feedback I got, that actually came off as overly persistent and not listening to the other person. I found that very discouraging because it was completely not my intention.
Since then, I have tried to find a between being assertive and cooperative. It is still a difficult line to find, but one thing I make sure to do is go in as prepared as I can be. I try to get familiar with the challenge as much as I can without actually doing it, and be very aware of what questions I do have so that I don't hold us back.
Writing feedback was initially hard but has gotten easier. One thing that was hard was keeping it anonymous. It's hard to be specific without giving yourself away. It's pretty easy to figure out who has given me feedback based on who says something like, "Thanks for showing me how to comment out a block of code!" I actually appreciate when I could tell which person was giving me feedback; it allows me to know what modifications I can make specifically for that person, given that people often have different preferences and opinions.
I also felt a little uncomfortable at first trying to give constructive criticism. Sometimes I felt like my peer did a much better job than I did, so I felt that I had no right to critique them. But now that I've seen how helpful it is to receive constructive feedback, I feel a little more comfortable with it.
I think the biggest thing I have had to learn is to be willing to be corrected. Instead of feeling deeply ashamed if someone has a piece of constructive criticism for me, I remember that they are not criticizing me as a person but trying to help me to more be effective as a programmer.


performs knn classification > > @param TestFeatureVector: features for test observation (length iNumFeatures) > @param TrainFeatureMatrix: features for all train observations (dimension iNumFeatures x iNumObservations) > @param TrainClassIndices: audio signal (length iNumObservations) > @param k: number of points taken into account (default = 3) > > @retval class index of the resulting class ======================================================================
0001 %performs knn classification 0002 %> 0003 %> @param TestFeatureVector: features for test observation (length iNumFeatures) 0004 %> @param TrainFeatureMatrix: features for all train observations (dimension iNumFeatures x iNumObservations) 0005 %> @param TrainClassIndices: audio signal (length iNumObservations) 0006 %> @param k: number of points taken into account (default = 3) 0007 %> 0008 %> @retval class index of the resulting class 0009 % ====================================================================== 0010 function [class] = ToolSimpleKnn(TestFeatureVector, TrainFeatureMatrix, TrainClassIndices, k) 0011 0012 % set order to 3 if not set 0013 if (nargin < 4) 0014 k = 3; 0015 end 0016 0017 % compute distances to all training observations 0018 d = computeEucDist_I(TestFeatureVector, TrainFeatureMatrix); 0019 0020 % sort the distances to find closest 0021 [dummy,idx] = sort(d); 0022 0023 % pick the majority of the k closest training observations 0024 % note that for multi-class problems and even k, this needs to be 0025 % refined 0026 class = mode(TrainClassIndices(idx(1:k))); 0027 end 0028 0029 function d = computeEucDist_I(A, B) 0030 d = sqrt(sum(A.^2, 2)*ones(1,size(B,1)) - ... 0031 2*A*B' + ... 0032 ones(size(A,1),1)*sum(B.^2, 2)'); 0033 end


Potential Updates¶
This toolbox is written mainly for personal and work-related use at Norges Bank. Hence, things are written for specific applications. General extensions are left for future if the expected payoff for the current application is small. Create an issue in github if you believe some extension might be useful for you application.
Todo
- Only multithreading is supported via openmp. In theory, the problem can be extensioned with MPI to use even more compute nodes. Currently, the internal problem size is not large enough to require MPI setup.
- The current implementation of the differential operators give a huge freedom as one can just pass in a function to define a new differential operator on the sparse grid. This comes at some cost, but this is not a large enough bottleneck for our application, but it might be for other applications (profile!).
- Adaptation is done in an (asymptotical) inefficient manner. As the scale of the problem increases, this part can take a larger share of the program execution, but currently, adaptation takes less than a fraction of one percent of the execution time.


title = "Activity Stream" url = "/activity-stream" layout = "default" hidden = "0" [ActivityStream] ==


{% extends 'simple.server.view.html' %} {% block content %}
oops!
error 404
The page you are looking for might have been removed, had its name changed, or is temporarily unavailable. Please try using our search box below to look for information on the website


Mach4 UK02p21 Release Notes
November 3, 1995
- Overview
- Tested Configurations
- FTP information
- Details
UK02p21 is a public release of the so-called
``Mach4''
kernel for the Intel x86 processor family. Mach4 is one component of the
Flux
project at the
University of Utah Computer Science Department.
The focus of the x86 branch has been to make Mach more usable on PCs,
with particular emphasis on ease of building, compatibility with a number
of OS environments and additional hardware support. This release
reflects the latest development in those areas.
New in UK02p21, since p13:
- Compatibility: support unmodified
Linux network drivers
in Mach, from Shantanu Goel of Columbia.
- Booting:
kernel has been mostly updated to conform to
MultiBoot-0.3,
BSD boot adapter
code passes along root device and command line
options from Mach, FreeBSD and NetBSD bootblocks to Mach,
and Linux boot adapter
passes LILO command line options and root device to Mach.
- Kernel debugger again works (a.out only).
- Remote console support again works.
- Native drivers: added a contributed
NE2000 driver;
IDE (nhd) device driver uses LBA mode on drives that support
it.
- Various other random things.
Note the warnings re building Lites and the Linux boot adaptor code.
All configurations were built using i386-mach cross-build tools, which can
be
found at:
ftp://flux.cs.utah.edu/flux/binaries/i386.
The kernel was tested with
Lites-1.1.u2
running on the following base systems:
- FreeBSD 2.0.5
- FreeBSD 2.1.0-950726-SNAP
- NetBSD-1.0
The system was also booted on a system running UX42 on a CMU Mach
base.
Mach4 and Mach4-i386
- Sources
-
ftp://flux.cs.utah.edu/flux/mach4-UK02p21.tar.gz
-
ftp://flux.cs.utah.edu/flux/mach4-i386-UK02p21.tar.gz
-
ftp://flux.cs.utah.edu/flux/patch-UK02p13-UK02p21.gz
-
ftp://flux.cs.utah.edu/flux/patch-i386-UK02p13-UK02p21.gz
- Intel x86: BSD bootable Binaries
-
ftp://flux.cs.utah.edu/flux/binaries/i386/mach4/Mach
-
ftp://flux.cs.utah.edu/flux/binaries/i386/mach4/Mach+linuxdev
- Intel x86: Linux bootable Binaries
-
ftp://flux.cs.utah.edu/flux/binaries/i386/mach4/zMach
-
ftp://flux.cs.utah.edu/flux/binaries/i386/mach4/zMach+linuxdev
Shantanu Goel<EMAIL_ADDRESS>has modified Mach to accept
mostly unchanged Linux network device drivers.
He has
work in progress to support SCSI host adapters and all block devices,
which should be available "soon."
All this work is described in the paper
``Linux Device Driver Emulation in Mach''
by Shantanu Goel and Dan Duchamp of the
Columbia Mobile Computing Laboratory. The paper will be presented at
1996 USENIX Annual Technical Conference. The
paper will be available by November 16, 1995, at which time we'll add
a link to it here.
To enable the Linux device driver support, use ``--enable-linuxdev''
when configuring Mach4. You
cannot mix native network drivers with the Linux network drivers.
Be aware that since the drivers are from Linux, they are all covered by the
GPL.
Testing status
The drivers that have been tested at Columbia are:
- Western Digital 8003 and clones
- SMC Ultra
- NE2000 and clones
- AMD LANCE based boards
- 3Com 3c503 (Etherlink II)
We have tested the linuxdev code
with HP PCLAN Plus and NE2000 clones, and while they
work, we have had problems on fast machines and suggest
that you use the native Mach ethernet drivers if you can.
Please report your experiences with other hardware.
No PCI boards work yet, since there is currently no support for PCI in
Mach. (That will also be provided "soon" via more linuxdev work.)
Complete list of Linux network drivers in the source tree:
- de4x5.c: A DIGITAL DE425/DE434/DE435/DE500 ethernet driver for Linux.
- depca.c: A DIGITAL DEPCA & EtherWORKS ethernet driver for linux.
- ewrk3.c: A DIGITAL EtherWORKS 3 ethernet driver for linux.
- 3c501.c: A 3Com 3c501 ethernet driver for linux.
- 3c503.c: A shared-memory NS8390 ethernet driver for linux.
- 3c507.c: An EtherLink16 device driver for Linux.
- 3c509.c: A 3c509 EtherLink3 ethernet driver for linux.
- 8390.c: A general NS8390 ethernet driver core for linux.
- ac3200.c: A driver for the Ansel Communications EISA ethernet adaptor.
- apricot.c: An Apricot 82596 ethernet driver for linux.
- at1700.c: A network device driver for the Allied Telesis AT1700.
- atp.c: Attached (pocket) ethernet adapter driver for linux.
- e2100.c: A Cabletron E2100 series ethernet driver for linux.
- eepro.c: Intel EtherExpress Pro/10 device driver for Linux.
- eexpress.c: Intel EtherExpress device driver for Linux.
- hp-plus.c: A HP PCLAN/plus ethernet driver for linux.
- hp.c: A HP LAN ethernet driver for linux.
- lance.c: An AMD LANCE ethernet driver for linux.
- ne.c: A general non-shared-memory NS8390 ethernet driver for linux.
- seeq8005.c: A network driver for linux.
- smc-ultra.c: A SMC Ultra ethernet driver for linux.
- tulip.c: A DEC 21040 ethernet driver for linux.
- wd.c: A WD80x3 ethernet driver for linux.
- znet.c: An Zenith Z-Note ethernet driver for linux.
- Linux ethernet device driver for the 3Com Etherlink Plus (3C505)
- Linux driver for the D-Link DE-600 Ethernet pocket adapter.
- Linux driver for the D-Link DE-620 Ethernet pocket adapter.
- hp100.c: Hewlett Packard HP10/100VG ANY LAN ethernet driver for Linux.
- net-3-driver for the NI5210 card (i82586 Ethernet chip)
- ni6510 (am7990 'lance' chip) driver for Linux-net-3 by MH
- Schneider & Koch G16 Ethernet Device Driver for
- AT&T GIS (nee NCR) WaveLAN card.
BSD and Mach
Booting from Mach, NetBSD and FreeBSD bootblocks should now work
as you'd expect. The kernel uses the bootdev and boothowto fields that
are passed from the bootblocks, so now you can boot from an alternate
root/partition without hardcoding it in setroot.c. Any command line
arguments are likewise passed along to the kernel and server.
The old Mach bootblocks don't support loading NMAGIC kernels,
which is a problem since that's usually what the Mach boot image is. So,
if you're going to be booting from the original Mach bootblocks, you can
either build ZMAGIC or OMAGIC kernels, or you'll can make a small
change to the Mach bootblocks to recognize NMAGIC binaries:
*** boot.c Wed Sep 1 17:14:33 1993
--- newboot.c Fri Nov 3 03:34:52 1995
***************
*** 137,143 ****
read(&head, sizeof(head));
! if (head.a_magic == 0407)
poff = 32;
else if (head.a_magic == 0413 ) {
poff = 0;
head.a_text += sizeof(struct exec);
} else {
--- 137,143 ----
read(&head, sizeof(head));
! if (head.a_magic == 0407 || head.a_magic == 410)
poff = 32;
else if (head.a_magic == 0413) {
poff = 0;
head.a_text += sizeof(struct exec);
} else {
The kernel debugger
is once again useful, supporting symbols and backtraces. The problem
was that the symbol table for the kernel wasn't getting loaded,
which broke a number of things (now
at least the kernel and server symbol tables are being loaded, but the
bootstrap and emulator's aren't).
However,
symbols are only loaded if the
kernel is a.out. If you feel you have to build your kernel as ELF, then
you don't get symbols.
Remote console support is working again. This is
NOT the same as a serial console; basically it just spews out kernel
messages to your favorite serial port. This can be very useful for
logging the output of the system
and using the kernel debugger over the serial line.
To enable the remote console support, you must change a
#define in mach4-i386/kernel/bogus/rc.h. RCLINE is the number of the
serial device that you want to use, and RCBAUD is the speed. The
options for RCLINE are shown below, as taken from autoconf.c, for the
``com'' device.
options for RCLINE:
RCLINE info
------ ---------------------------
0 (port 0x3f8/irq 4 DOS COM1)
1 (port 0x2f8/irq 3 DOS COM2)
2 (port 0x3e8/irq 5 DOS COM3)
3 (port 0x2e8/irq 9 DOS COM4)
This is a device driver for the ne2000 series of ethernet cards. It
was ported from 386BSD by Shang-te Hsu of the Computer System Lab, Dep. of
Computer & Information Science National Chiao Tung University in Hsinchu,
Taiwan. The driver was sent to us by Terrence Mitchem (mitchem@sctc.com).
We've only tested the driver with an ne2000 clone card, but the original
README said that it supported the ``NE1000, NE2000, DE-100, DE-200, DE-220''
cards.
The driver is configured to look for cards set up as:
(ne0) port 0x280, memory addr 0xd0000, irq 5
(ne1) port 0x300, memory addr 0xd0000, irq 10
If you need to change this, go into
mach4-i386/kernel/i386at/autoconf.c and you'll find a section that looks
like this:
#if NNE > 0
{&nedriver, "ne", 0, neintr, 0x280,0x4000,0xd0000,
'?', 0, -1, -1, 0, 0, 0, SPL_SIX, 5},
{&nedriver, "ne", 1, neintr, 0x300,0x4000,0xd0000,
'?', 0, -1, -1, 0, 0, 0, SPL_SIX, 10},
#endif NNE > 0
Change the 4th, 6th and/or the last (port, mem, irq) to match
your card and recompile the kernel. If you want to disable the driver
or want to add more than one card, look in mach4-i386/kernel/bogus/ne.h
and change the #define to either be 0, or greater than one. The number
after the ``ne'' is the number that it will be configured for if found.
So, a card at port 0x280 irq 5 will be configured as ne0.
- To build Lites with the include files
that come with this release, you'll have at least one problem.
EFL_USER_SET is no longer exported in include/mach/machine/eflags.h,
so compiling lites/emulator/i386/e_exception.c will give you an error.
Since the kernel always sets the efl state to be EFL_USER_SET, Lites
shouldn't bother with setting it. The fix is to just replace
EFL_USER_SET with 0.
- Use the .code16 directive of gas instead of AS86, LD86. This
mostly affects the Linux boot adapter code. You MUST
have a
recent snapshot of gas to compile the kernel because of this.
Check
ftp://flux.cs.utah.edu/flux/gas-950428.tar.gz.
- Small addition to trap.c to support NetBSD-current and Linux
system call traps (for Lites).
- Modifications to compile with gcc 2.7.0.
- Support for building ELF kernels (use ``--enable-elf'' to turn
this on). Note that the kernel debugger and symbols currently don't
work for ELF kernels.
- Now uses libmach_exec, which supports ELF and a.out. This is
part of the ELF support, so that we can exec an ELF
kernel/bootstrap.
- Cleaned up the use of EXT/LEXT/ENTRY macros in the kernel.
- Only have to specify ``--with-mach4='' if mach4 is in a strange place.
- Various other makefile changes, too numerous to detail...
- Other bug fixes, of course.
Stephen Clawson
<EMAIL_ADDRESS>November 3, 1995


Process
User-centered design was always my design principle
Because I was a Chinese student, as both the user and the designer, I knew who users were and what users
wanted. Our main users were Chinese students at the University of Kansas, who wanted to reduce their
economic burden by purchasing used products. However, due to lacking a local platform, they could only
choose big platforms like craigslist, which was not very effective to finish transactions.
Therefore, my goal was to build a Chinese-based localized fast transaction platform. To achieve the goal,
my considerations had 3 main aspects:
-
Economy
Make users feel that the products' price was attractive
-
Safety
Filter users to be KU students only to improve transaction security
-
Convenience
Streamline the posting and finding to be as convenient as possible
For the economy aspect, my idea was to ask users to input original price and selling price on the posting
step, so later other people could feel they enjoyed a good bargain when they saw the price gap. And I
was really concerned about the safety aspect because I didn’t want anyone to be cheated when using my
product. Therefore, I decided to ask users to input their KU ID as an authentication when they signed up
their account.
Moreover, for the sake of convenience — making users spend the least time to finish
posting — I put the posting button at the bottom center of the index page and greatly streamlined the
posting form. Of course, to make our target users become more familiar with the website, I decided to
use Chinese as the website language.
As to the marketing aspect, I created a WeChat official account and asked my teammate to publish
interesting articles everyday. Through reposting articles among our friends, we gradually accumulated
our
first users. And we used QQ group and WeChat account to maintain relationships with them and received
suggestions from them about improving our website. To give users better access to us, we created a
closed
loop with website, QQ and WeChat.


JXHTTPOperationQueue Class Reference
| Inherits from | NSOperationQueue |
| Declared in | JXHTTPOperationQueue.h |
Overview
JXHTTPOperationQueue
is an NSOperationQueue
subclass and can be used to group
multiple instances of JXHTTPOperation for progress tracking, timing, or cancellation.
It provides blocks and delegate methods via the JXHTTPOperationQueueDelegate protocol.
Any NSOperation
subclass can be safely added to this queue; classes other than
JXHTTPOperation receive no special treatment.
Progress and byte count properties are reset every time a new operation is added when the queue is empty.
Example
JXHTTPOperationQueue *queue = [[JXHTTPOperationQueue alloc] init];
queue.didFinishBlock = ^(JXHTTPOperationQueue *queue) {
NSLog(@"queue finished at %@", queue.finishDate);
NSLog(@"total bytes downloaded: %@", queue.bytesDownloaded);
};
for (NSUInteger i = 0; i < 10; i++) {
JXHTTPOperation *op = [JXHTTPOperation withURLString:@"http://jxhttp.com/"];
op.didFinishLoadingBlock = ^(JXHTTPOperation *op) {
NSLog(@"operation %d finished loading at %@", i, op.finishDate);
};
[queue addOperation:op];
}
Tasks
Core
-
delegate
The operation’s delegate, conforming to JXHTTPOperationDelegate.
property -
uniqueString
A string guaranteed to be unique for the lifetime of the application process.
property
Progress
-
downloadProgress
A number between 0 and 1 representing the percentage of download progress.
property -
uploadProgress
A number between 0 and 1 representing the percentage of upload progress.
property -
bytesDownloaded
The total number of bytes downloaded.
property -
bytesUploaded
The total number of bytes uploaded.
property -
expectedDownloadBytes
The total number of bytes expected to be downloaded.
property -
expectedUploadBytes
The total number of bytes expected to be uploaded.
property
Timing
-
startDate
The date the request started.
property -
finishDate
The date the request finished (or failed).
property -
elapsedSeconds
The number of seconds elapsed between the startDate and the finishDate (or the current date if the request is still running).
property0.0
if the request has not started.
Blocks
-
performsBlocksOnMainQueue
property -
willStartBlock
property -
willFinishBlock
property -
didStartBlock
property -
didUploadBlock
property -
didDownloadBlock
property -
didMakeProgressBlock
property -
didFinishBlock
property -
+ sharedQueue
A singleton queue with a default
maxConcurrentOperationCount
of4
.
Properties
bytesDownloaded
The total number of bytes downloaded.
@property (strong, readonly) NSNumber *bytesDownloaded
Discussion
Safe to access from any thread at any time.
Declared In
JXHTTPOperationQueue.h
bytesUploaded
The total number of bytes uploaded.
@property (strong, readonly) NSNumber *bytesUploaded
Discussion
Safe to access from any thread at any time.
Declared In
JXHTTPOperationQueue.h
delegate
The operation’s delegate, conforming to JXHTTPOperationDelegate.
@property (weak) NSObject<JXHTTPOperationQueueDelegate> *delegate
Discussion
Safe to access from any thread at any time.
Declared In
JXHTTPOperationQueue.h
downloadProgress
A number between 0 and 1 representing the percentage of download progress.
@property (strong, readonly) NSNumber *downloadProgress
Discussion
Safe to access from any thread at any time.
Declared In
JXHTTPOperationQueue.h
elapsedSeconds
The number of seconds elapsed between the startDate and the finishDate (or the
current date if the request is still running). 0.0
if the request has not started.
@property (readonly) NSTimeInterval elapsedSeconds
Discussion
Safe to access from any thread at any time.
Declared In
JXHTTPOperationQueue.h
expectedDownloadBytes
The total number of bytes expected to be downloaded.
@property (strong, readonly) NSNumber *expectedDownloadBytes
Discussion
Safe to access from any thread at any time.
Declared In
JXHTTPOperationQueue.h
expectedUploadBytes
The total number of bytes expected to be uploaded.
@property (strong, readonly) NSNumber *expectedUploadBytes
Discussion
Safe to access from any thread at any time.
Declared In
JXHTTPOperationQueue.h
finishDate
The date the request finished (or failed).
@property (strong, readonly) NSDate *finishDate
Discussion
Safe to access from any thread at any time.
Declared In
JXHTTPOperationQueue.h
startDate
The date the request started.
@property (strong, readonly) NSDate *startDate
Discussion
Safe to access from any thread at any time.
Declared In
JXHTTPOperationQueue.h
uniqueString
A string guaranteed to be unique for the lifetime of the application process.
@property (strong, readonly) NSString *uniqueString
Discussion
Safe to access from any thread at any time.
Declared In
JXHTTPOperationQueue.h


What is the Mandelbulb?
The Mandelbulb is a three-dimensional fractal, constructed by Daniel White and Paul Nylander using spherical coordinates in 2009.Did you know?
- In the 2014 computer-animated film Big Hero 6, the climax takes place in the middle of a wormhole, which is represented by the stylized interior of a Mandelbulb.
- In the 2018 science fiction horror film Annihilation, an extraterrestrial being appears in the form of a partial Mandelbulb.
- In the webcomic Unsounded the spirit realm of the kerht is represented by a stylized golden mandelbulb.
Credits
"A flight to and around the Mandelbulb." was created with Mandelbulber2 by PantheraLeo1359531. Original video available on Wikimedia. Still poster image also available on Wikimedia.


Creates a recurrent neural network specified by RNNCell cell
. (deprecated)
tf.compat.v1.nn.dynamic_rnn( cell, inputs, sequence_length=None, initial_state=None, dtype=None, parallel_iterations=None, swap_memory=False, time_major=False, scope=None )
Warning: THIS FUNCTION IS DEPRECATED. It will be removed in a future version.
Instructions for updating:
Please use keras.layers.RNN(cell)
, which is equivalent to this API
Performs fully dynamic unrolling of inputs
.
# create a BasicRNNCell rnn_cell = tf.compat.v1.nn.rnn_cell.BasicRNNCell(hidden_size) # 'outputs' is a tensor of shape [batch_size, max_time, cell_state_size] # defining initial state initial_state = rnn_cell.zero_state(batch_size, dtype=tf.float32) # 'state' is a tensor of shape [batch_size, cell_state_size] outputs, state = tf.compat.v1.nn.dynamic_rnn(rnn_cell, input_data, initial_state=initial_state, dtype=tf.float32)
# create 2 LSTMCells rnn_layers = [tf.compat.v1.nn.rnn_cell.LSTMCell(size) for size in [128, 256]] # create a RNN cell composed sequentially of a number of RNNCells multi_rnn_cell = tf.compat.v1.nn.rnn_cell.MultiRNNCell(rnn_layers) # 'outputs' is a tensor of shape [batch_size, max_time, 256] # 'state' is a N-tuple where N is the number of LSTMCells containing a # tf.nn.rnn_cell.LSTMStateTuple for each cell outputs, state = tf.compat.v1.nn.dynamic_rnn(cell=multi_rnn_cell, inputs=data, dtype=tf.float32)
cell
: An instance of RNNCell.inputs
: The RNN inputs.
If time_major == False
(default), this must be a Tensor
of shape:
[batch_size, max_time, ...]
, or a nested tuple of such elements.
If time_major == True
, this must be a Tensor
of shape: [max_time,
batch_size, ...]
, or a nested tuple of such elements. This may also be
a (possibly nested) tuple of Tensors satisfying this property. The
first two dimensions must match across all the inputs, but otherwise the
ranks and other shape components may differ. In this case, input to
cell
at each time-step will replicate the structure of these tuples,
except for the time dimension (from which the time is taken). The input
to cell
at each time step will be a Tensor
or (possibly nested)
tuple of Tensors each with dimensions [batch_size, ...]
.sequence_length
: (optional) An int32/int64 vector sized [batch_size]
. Used
to copy-through state and zero-out outputs when past a batch element's
sequence length. This parameter enables users to extract the last valid
state and properly padded outputs, so it is provided for correctness.initial_state
: (optional) An initial state for the RNN. If cell.state_size
is an integer, this must be a Tensor
of appropriate type and shape
[batch_size, cell.state_size]
. If cell.state_size
is a tuple, this
should be a tuple of tensors having shapes [batch_size, s] for s in
cell.state_size
.dtype
: (optional) The data type for the initial state and expected output.
Required if initial_state is not provided or RNN state has a heterogeneous
dtype.parallel_iterations
: (Default: 32). The number of iterations to run in
parallel. Those operations which do not have any temporal dependency and
can be run in parallel, will be. This parameter trades off time for
space. Values >> 1 use more memory but take less time, while smaller
values use less memory but computations take longer.swap_memory
: Transparently swap the tensors produced in forward inference
but needed for back prop from GPU to CPU. This allows training RNNs which
would typically not fit on a single GPU, with very minimal (or no)
performance penalty.time_major
: The shape format of the inputs
and outputs
Tensors. If true,
these Tensors
must be shaped [max_time, batch_size, depth]
. If false,
these Tensors
must be shaped [batch_size, max_time, depth]
. Using
time_major = True
is a bit more efficient because it avoids transposes
at the beginning and end of the RNN calculation. However, most TensorFlow
data is batch-major, so by default this function accepts input and emits
output in batch-major form.scope
: VariableScope for the created subgraph; defaults to "rnn".A pair (outputs, state) where:
outputs
: The RNN output Tensor
.If time_major == False (default), this will be a Tensor
shaped:
[batch_size, max_time, cell.output_size]
.
If time_major == True, this will be a Tensor
shaped:
[max_time, batch_size, cell.output_size]
.
Note, if cell.output_size
is a (possibly nested) tuple of integers
or TensorShape
objects, then outputs
will be a tuple having the
same structure as cell.output_size
, containing Tensors having shapes
corresponding to the shape data in cell.output_size
.
state
: The final state. If cell.state_size
is an int, this
will be shaped [batch_size, cell.state_size]
. If it is a
TensorShape
, this will be shaped [batch_size] + cell.state_size
.
If it is a (possibly nested) tuple of ints or TensorShape
, this will
be a tuple having the corresponding shapes. If cells are LSTMCells
state
will be a tuple containing a LSTMStateTuple
for each cell.TypeError
: If cell
is not an instance of RNNCell.ValueError
: If inputs is None or an empty list.


--- permalink: / layout: default ---
CompSoc is the best, and only, Computer Science society. We do tech talks, workshops, and plenty of socials.
Our next events are during Welcome Week in September
View our events Meet the community Become a member
Interested in becoming a partner? Get in touch at partners@comp-soc.com


ReverserApplication by Robert Theis
Send feedback
This app is just for fun! Forked from the OCR Test project.


{% extends 'foirequest/base.html' %} {% load i18n %} {% load static %} {% load block_helper %} {% block title %}{% blocktrans with name=attachment.name %}Redacting attachment {{ name }}{% endblocktrans %}{% endblock %} {% block app_body %}
{% blocktrans %}The original version of the document will still be available to you (but not to the public).{% endblocktrans %}
{% blocktrans with name=SITE_NAME %}Go to each page of the PDF and locate the parts that need to be blacked out. Redact text by selecting it. You can also draw rectangles by clicking the mouse and dragging it. {% endblocktrans %}
{% trans "Check the text only view to see if the underlying text is also gone. If the document does not load correctly, cancel and inform a site moderator." %}


Function overloading (having a several variants of a function with the same name and different arguments) is a language feature available in many languages but not in C.
In general, language binding authors should use restraint in
combining functions in the cairo API via function
overloading. What may seem like an obvious overload now may
turn out to be strange with future additions to cairo.
It might seem logical to make
cairo_set_source_rgb()
an overload of cairo_set_source()
, but future plans to add
cairo_set_source_rgb_premultiplied()
,
which will also take three doubles make this a bad idea. For
this reason, only the following pairs of functions should
be combined via overloading
void cairo_set_source (cairo_t *cr, cairo_pattern_t *source); void cairo_set_source_surface (cairo_t *cr, cairo_surface_t *source, double surface_x, double surface_y); void cairo_mask (cairo_t *cr, cairo_pattern_t *pattern); void cairo_mask_surface (cairo_t *cr, cairo_surface_t *surface, double surface_x, double surface_y); cairo_surface_t * cairo_image_surface_create (cairo_format_t format, int width, int height); cairo_surface_t * cairo_image_surface_create_for_data (unsigned char *data, cairo_format_t format, int width, int height, int stride); cairo_status_t cairo_surface_write_to_png (cairo_surface_t *surface, const char *filename); cairo_status_t cairo_surface_write_to_png_stream (cairo_surface_t *surface, cairo_write_func_t write_func, void *closure); cairo_surface_t * cairo_image_surface_create_from_png (const char *filename); cairo_surface_t * cairo_image_surface_create_from_png_stream (cairo_read_func_t read_func, void *closure);
Note that there are cases where all constructors for a type
aren't overloaded together. For example
cairo_image_surface_create_from_png()
should not be overloaded together with
cairo_image_surface_create()
.
In such cases, the remaining constructors will typically need to
be bound as static methods. In Java, for example, we might have:
Surface surface1 = ImageSurface(Format.RGB24, 100, 100); Surface surface2 = ImageSurface.createFromPNG("camera.png");
Some other overloads that add combinations not found in C may be convenient for users for language bindings that provide cairo_point_t and cairo_rectangle_t types, for example:
void cairo_move_to (cairo_t *cr, cairo_point_t *point); void cairo_rectangle (cairo_t *cr, cairo_rectangle_t *rectangle);


browser-dl.jar
and the second for
jsk-dl.jar
. The Class-Path
manifest attribute
for browser.jar
now also includes jsk-lib.jar
.
jsk-lib.jar
.
JavaSpace05
interface.
exitActionListener
configuration entry has been added,
which can be used to set the action listener for the Exit item of the
File menu. The new class,
Browser.Exit
,
is a simple action listener that calls System.exit
.


Linguagem de template YATL
py4web uses two distinct template languages for rendering dynamic HTML pages that contain Python code:
yatl (Yet Another Template Language) , which is considered the original reference implementation
Renoir, which is a newer and faster implementation of yatl with additional functionality
Since Renoir
does not include HTML helpers (see next chapter), py4web by default uses the Renoir
module for rendering templates and the yatl
module for helpers,
plus some minor trickery to make them work together seamlessly.
py4web also uses double square brackets [[ ... ]]
to escape Python code embedded in HTML, unless specified otherwise.
The advantage of using square brackets instead of angle brackets is that it’s transparent to all common HTML editors. This allows the developer to use those editors to create py4web templates.
Aviso
Be careful not to mix Python code square brackets with other square brackets! For example, you’ll soon see syntax like this:
[[items = ['a', 'b', 'c']]] # this gives "Internal Server Error" [[items = ['a', 'b', 'c'] ]] # this works
It’s mandatory to add a space after the first closed bracket for separating the list from the Python code square brackets.
Since the developer is embedding Python code into HTML, the document
should be indented according to HTML rules, and not Python rules.
Therefore, we allow un-indented Python inside the [[ ... ]]
tags.
But since Python normally uses indentation to delimit blocks of code, we
need a different way to delimit them; this is why the py4web template
language makes use of the Python keyword pass
.
A code block starts with a line ending with a colon and ends with a
line beginning with pass
. The keyword pass
is not necessary
when the end of the block is obvious from the context.
Aqui está um exemplo:
[[
if i == 0:
response.write('i is 0')
else:
response.write('i is not 0')
pass
]]
Note que `` pass`` é uma palavra-chave Python, não uma palavra-chave py4web. Alguns editores Python, como Emacs, use a palavra-chave `` pass`` para significar a divisão de blocos e usá-lo para o código re-indent automaticamente.
O linguagem de template py4web faz exatamente a mesma. Quando encontra algo como:

[[for x in range(10):]][[=x]] hello
[[pass]]

que traduz em um programa:
response.write("""""", escape=False)
for x in range(10):
response.write(x)
response.write(""" hello
""", escape=False)
response.write("""""", escape=False)
response.write
writes to the response body.
When there is an error in a py4web template, the error report shows the generated template code, not the actual template as written by the developer. This helps the developer debug the code by highlighting the actual code that is executed (which is something that can be debugged with an HTML editor or the DOM inspector of the browser).
Observe também que:
[[=x]]
gera
response.write(x)
Variables injected into the HTML in this way are escaped by default. The
escaping is ignored if x
is an XML
object, even if escape is set
to True
(see `` XML`` later for details).
Aqui está um exemplo que introduz o `` H1`` helper:
[[=H1(i)]]
que é traduzido para:
response.write(H1(i))
mediante avaliação, o objeto `` H1`` e seus componentes são recursivamente serializados, escapou e escrita para o corpo da resposta. As tags gerados pelo `` H1`` e HTML interior não escapamos. Este mecanismo garante que todo o texto - e somente texto - exibido na página web é sempre escaparam, evitando assim vulnerabilidades XSS. Ao mesmo tempo, o código é simples e fácil de depurar.
O método `` response.write (obj, escapar = True) `` recebe dois argumentos, o objeto a ser escrito e se ele tem que ser escapado (definido como `` True`` por padrão). Se `` obj`` tem um `` .xml () `` método, ele é chamado e o resultado escrito para o corpo da resposta (o argumento `` escape`` é ignorado). Caso contrário, ele usa `` __str__`` o método do objeto para serializar-lo e, se o argumento fuga é `` True``, lhe escapa. Todos os built-in helper objetos ( `` H1`` no exemplo) são objetos que sabem como serializar-se através do `` .xml () `` método.
This is all done transparently.
Nota
While the response object used inside the controllers is a
full bottle.response
object, inside the yatl templates it is
replaced by a dummy object (yatl.template.DummyResponse
).
This object is quite different, and much simpler: it only has a write method!
Also, you never need to (and never should) call the response.write
method explicitly.
Sintaxe básica
The py4web template language supports all Python control structures.
Here we provide some examples of each of them. They can be nested
according to usual programming practice.
You can easily test them by copying the _scaffold app (see
Copying the _scaffold app) and then editing the file
new_app/template/index.html
.
`` Para … in``
Em templates você pode fazer um loop sobre qualquer objeto iterável:
[[items = ['a', 'b', 'c'] ]]

[[for item in items:]]
[[=item]]
[[pass]]

que produz:

a

b

c

Aqui `` items`` é qualquer objeto iterável como uma lista Python, Python tupla, ou linhas objeto, ou qualquer objeto que é implementado como um iterador. Os elementos apresentados são primeiro serializado e escapou.
`` While``
Você pode criar um loop usando a palavra-chave, enquanto:
[[k = 3]]

[[while k > 0:]]
[[=k]][[k = k - 1]]
[[pass]]

que produz:

3

2

1

`` If … elif … else``
Você pode usar cláusulas condicionais:
[[
import random
k = random.randint(0, 100)
]]

[[=k]]
[[if k % 2:]]is odd[[else:]]is even[[pass]]

que produz:

45 is odd

Uma vez que é óbvio que `` else`` encerra a primeira `` if`` bloco, não há necessidade de um `` declaração pass``, e usando um seria incorreto. No entanto, você deve fechar explicitamente a opção `` bloco else`` com um `` pass``.
Lembre-se que, em Python “else if” está escrito `` elif`` como no exemplo a seguir:
[[
import random
k = random.randint(0, 100)
]]

[[=k]]
[[if k % 4 == 0:]]is divisible by 4
[[elif k % 2 == 0:]]is even
[[else:]]is odd
[[pass]]

Produz:

64 is divisible by 4

`` Tentar … exceto … else … finally``
It is also possible to use try...except
statements in templates with one
caveat. Consider the following example:
[[try:]]
Hello [[= 1 / 0]]
[[except:]]
division by zero
[[else:]]
no division by zero
[[finally:]]

[[pass]]
Ela irá produzir o seguinte resultado:
Hello division by zero

Este exemplo ilustra que todas as saídas gerado antes de ocorrer uma exceção é processado (incluindo a saída que precedeu a excepção) no interior do bloco de teste. “Olá” é escrito porque precede a exceção.
`` Def … return``
O linguagem de template py4web permite ao desenvolvedor definir e implementar funções que podem retornar qualquer objeto Python ou uma cadeia de texto / html.
Considere agora o seguinte código:
[[def itemize2(link):]]

[[=link]]

[[return]]

[[itemize2('www.google.com')]]

Ela produz exactamente o mesmo resultado como acima. Neste caso, a função `` itemize2`` representa um pedaço de HTML que vai substituir a tag py4web onde a função é chamada. Observe que não existe ‘=’ na frente da chamada para `` itemize2``, já que a função não retornar o texto, mas escreve-lo diretamente para a resposta.
There is one caveat: functions defined inside a template must terminate with
a return
statement, or the automatic indentation will fail.
Information workflow
For dynamically modifying the workflow of the information there are custom commands available:
extend
, include
, block
and super
. Note that they are special template
directives, not Python commands.
In addition, you can use normal Python functions inside templates.
extend
and include
Templates can extend and include other templates in a tree-like structure.
For example, we can think of a template “index.html” that extends “layout.html” and includes “body.html”. At the same time, “layout.html” may include “header.html” and “footer.html”.
The root of the tree is what we call a layout template. Just like any other HTML template file, you can edit it from the command line or using the py4web Dashboard. The file name “layout.html” is just a convention.
Here is a minimalist page that extends the “layout.html” template and includes the “page.html” template:

[[extend 'layout.html']]

Hello World

[[include 'page.html']]
The extended layout file must contain an [[include]]
directive,
something like:

<title>Page Title</title>

[[include]]

When the template is called, the extended (layout) template is loaded, and the
calling template replaces the [[include]]
directive inside the layout.
If you don’t write the [[include]]
directive inside the layout, then it will
be included at the beginning of the file. Also, if you use multiple [[extend]]
directives only the last one will be processed.
Processing continues recursively until all extend
and include
directives have been processed. The resulting template is then
translated into Python code.
Note, when an application is bytecode compiled, it is this Python code that is compiled, not the original template files themselves. So, the bytecode compiled version of a given template is a single .pyc file that includes the Python code not just for the original template file, but for its entire tree of extended and included templates.
Any content or code that precedes the [[extend ...]]
directive will
be inserted (and therefore executed) before the beginning of the
extended template’s content/code. Although this is not typically used to
insert actual HTML content before the extended template’s content, it can be
useful as a means to define variables or functions that you want to make
available to the extended template. For example, consider a template
“index.html”:

[[sidebar_enabled=True]]
[[extend 'layout.html']]

Home Page

and an excerpt from “layout.html”:

[[include]]
[[if sidebar_enabled:]]

Sidebar Content

[[pass]]
Because the sidebar_enabled
assignment in “index.html” comes before
the extend
, that line gets inserted before the beginning of
“layout.html”, making sidebar_enabled
available anywhere within the
“layout.html” code.
It is also worth pointing out that the variables returned by the controller function are available not only in the function’s main template, but in all of its extended and included templates as well.
Extending using variables
The argument of an extend
or include
(i.e., the extended or
included template name) can be a Python variable (though not a Python
expression). However, this imposes a limitation – templates that use
variables in extend
or include
statements cannot be bytecode
compiled. As noted above, bytecode-compiled templates include the entire
tree of extended and included templates, so the specific extended and
included templates must be known at compile time, which is not possible if
the template names are variables (whose values are not determined until run
time). Because bytecode compiling templates can provide a significant speed
boost, using variables in extend
and include
should generally be
avoided if possible.
In some cases, an alternative to using a variable in an include
is
simply to place regular [[include ...]]
directives inside an
if...else
block.
[[if some_condition:]]
[[include 'this_template.html']]
[[else:]]
[[include 'that_template.html']]
[[pass]]
The above code does not present any problem for bytecode compilation
because no variables are involved. Note, however, that the bytecode
compiled template will actually include the Python code for both
“this_template.html” and “that_template.html”, though only the code for one of
those templates will be executed, depending on the value of
some_condition
.
Keep in mind, this only works for include
– you cannot place
[[extend ...]]
directives inside if...else
blocks.
Layouts are used to encapsulate page commonality (headers, footers, menus), and though they are not mandatory, they will make your application easier to write and maintain.
Template Functions
Consider this “layout.html”:

[[include]]

[[if 'mysidebar' in globals():]][[mysidebar()]][[else:]]
my default sidebar
[[pass]]

and this extending template
[[def mysidebar():]]
my new sidebar!!!
[[return]]
[[extend 'layout.html']]
Hello World!!!
Notice the function is defined before the [[extend...]]
statement –
this results in the function being created before the “layout.html” code
is executed, so the function can be called anywhere within
“layout.html”, even before the [[include]]
. Also notice the function
is included in the extended template without the =
prefix.
The code generates the following output:

Hello World!!!

my new sidebar!!!

Notice that the function is defined in HTML (although it could also
contain Python code) so that response.write
is used to write its
content (the function does not return the content). This is why the
layout calls the template function using [[mysidebar()]]
rather than
[[=mysidebar()]]
. Functions defined in this way can take arguments.
block
and super
The main way to make a template more modular is by using
[[block ...]]
s and this mechanism is an alternative to the
mechanism discussed in the previous section.
To understand how this works, consider apps based on the scaffolding app
welcome, which has a template layout.html. This template is extended by the template
default/index.html
via [[extend 'layout.html']]
. The contents of
layout.html predefine certain blocks with certain default content, and
these are therefore included into default/index.html.
You can override these default content blocks by enclosing your new content inside the same block name. The location of the block in the layout.html is not changed, but the contents is.
Here is a simplified version. Imagine this is “layout.html”:

[[include]]

[[block mysidebar]]
my default sidebar (this content to be replaced)
[[end]]

and this is a simple extending template default/index.html
:
[[extend 'layout.html']]
Hello World!!!
[[block mysidebar]]
my new sidebar!!!
[[end]]
It generates the following output, where the content is provided by the over-riding block in the extending template, yet the enclosing DIV and class comes from layout.html. This allows consistency across templates:

Hello World!!!

my new sidebar!!!

The real layout.html defines a number of useful blocks, and you can easily add more to match the layout your desire.
You can have many blocks, and if a block is present in the extended template
but not in the extending template, the content of the extended template is used.
Also, notice that unlike with functions, it is not necessary to define
blocks before the [[extend ...]]
– even if defined after the
extend
, they can be used to make substitutions anywhere in the
extended template.
Inside a block, you can use the expression [[super]]
to include the
content of the parent. For example, if we replace the above extending
template with:
[[extend 'layout.html']]
Hello World!!!
[[block mysidebar]]
[[super]]
my new sidebar!!!
[[end]]
we get:

Hello World!!!

my default sidebar
my new sidebar!

Page layout standard structure
Default page layout
The “templates/layout.html” that currently ships with the py4web _scaffold application is quite complex but it has the following structure:
1 <!DOCTYPE html>
2
3
4 <base href="[[=URL('static')]]/">
5 <meta name="viewport" content="width=device-width, initial-scale=1">
6 <link rel="shortcut icon" href="data:image/x-icon;base64,AAABAAEAAQEAAAEAIAAwAAAAFgAAACgAAAABAAAAAgAAAAEAIAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAPAAAAAA=="/>
7 <link rel="stylesheet" href="css/no.css">
8 <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.14.0/css/all.min.css" integrity="sha512-1PKOgIY59xJ8Co8+NE6FZ+LOAZKjy+KY8iq0G4B3CyeY6wYHN3yt9PW0XpSriVlkMXe40PTKnXrLnZ9+fkDaog==" crossorigin="anonymous" />
9
10 [[block page_head]][[end]]
11
12
13
14
15
16
17
18 py4web
19
20
21 ☰
22 <input type="checkbox" id="hamburger">
23
24 [[block page_left_menu]][[end]]
25
26

27 [[if globals().get('user'):]]
28

29
30 [[=globals().get('user',{}).get('email')]]
31
32

33
Edit Profile

34
Change Password

35
Logout

36

37

38 [[else:]]
39

40 Login
41

42
Sign up

43
Log in

44

45

46 [[pass]]
47

48
49
50
51
52

53
54 <flash-alerts class="padded" data-alert="[[=globals().get('flash','')]]"></flash-alerts>
55

56
57
58 [[include]]
59
60
61
62
63

64 Made with py4web
65

66
67
68
69
70 [[block page_scripts]][[end]]
71
There are a few features of this default layout that make it very easy to use and customize:
it is written in HTML5
on line 7 it’s used the
no.css
stylesheet, see hereon line 58
[[include]]
is replaced by the content of the extending template when the page is renderedit contains the following blocks: page_head, page_left_menu, page_scripts
on line 30 it checks if the user is logged on and changes the menu accordingly
on line 54 it checks for flash alert messages
Of course you can also completely replace the “layout.html” and the stylesheet with your own.
Mobile development
Although the default layout.html is designed to be mobile-friendly, one may sometimes need to use different templates when a page is visited by a mobile device.


profile() = atom()
| config/0 | |
| config/1 | |
| config/2 | |
| ensure_started/0 | |
| ensure_started/1 | |
| is_running/0 | |
| is_running/1 | |
| start/0 | |
| start/1 | |
| stop/0 | |
| stop/1 | |
| which_profiles/0 |
config() -> [proplists:property()]
config(Name::atom()) -> string()
config(Name, Value) -> ok
ensure_started() -> ok | {error, Reason}
ensure_started(Profile::profile()) -> ok | {error, Reason}
is_running() -> boolean() | {error, Reason}
is_running(Profile::profile()) -> boolean() | {error, Reason}
start() -> ok | {error, Reason}
start(Profile::profile()) -> ok | {error, Reason}
stop() -> ok | {error, Reason}
stop(Profile::profile()) -> ok | {error, Reason}
which_profiles() -> [profile()]
Generated by EDoc


cashmusic.js
Front-end made easy. Embeds, lightboxes, and audio players. Animate, tween, or customize any page element by timecode or song progress — without a line of JavaScript.
Download it Read the docs
cashmusic.js is a lightweight JavaScript library that handles CASH Music embeds, video lightboxing, and provides simple audio players. It also provides no-script animation keyed to song progress, enabling advanced audio players with little to no coding.
Advanced demos
Feature: CASH Music platform embeds
These are the standard embed codes offered via the CASH Music platform — HTML5-friendly workflows embedded in your page with a single line of JavaScript. These examples show an email signup form for the CASH Music mailing list.
Feature: Video lightboxes
These are built from simple, ordinary links to YouTube or Vimeo pages. No embed codes, no scripts. Just link to the page and specify the "lightboxvideo" option by adding 'data-options="lightboxvideo"' to the cashmusic.js script tag.
RED FANG - "Wires"
(YouTube)
XIU XIU - "Boy Soprano"
(Vimeo)
Feature: Tween
Basic tween example:
Play/pause/stop toggles
A play/stop toggle: Toggle "Life-Cycle"
A play/pause toggle: Toggle "Life-Cycle"
Feature: Basic-interface players
These players are built using the same progress/tween animation featured throughout the page. An add-on module controls the playlists, pulls in a standard template using basic html/css, and grabs the playlist either from JSON or by collecting all links to valid audio in a div classed "cashmusic soundplayer playlist" — flexible and easy to configure or customize.
Advanced options for data tagging and JSONP-based audio-source resolution coming soon.
A playlist play/pause toggle: Toggle (second) playlist
New tests
Basic style injection: White outExternal style injection, end of cascade: Steal an external stylesheet
Add a new soundplayer: Thermals demo player
License and dependencies
cashmusic.js is distributed under a simplified BSD License — so pretty much go nuts. Build rad stuff. Give back where you can. There are no external dependencies other than SoundManager 2 for audio playback. We've taken lengths to make sure we don't interfere with jQuery or similar libraries, so cashmusic.js should play well with others.


Create users and grant them website access. Ideally, we can make this a register page. Then, we can modify their permissions after they've signed up.


Generate an FFT and scan for the fundamental frequency.
In these examples, I'll be using SFML (www.sfml-dev.org) for audio loading and playing, which should help keep these examples simple.
Part 1 - Introduction to FFT Generation
The fundamental frequency finder here will generate an FFT in real-time, and scan the resulting data for the frequency most strongest.
#include <SFML/Audio.hpp>
#include <iostream>
sf::Mutex mutex;
class AudioFileStream : public sf::Music
{
private:
public:
{
m_fada = fada;
}
protected:
virtual void onSeek(sf::Time timeOffset)
{
sf::Lock lock(mutex);
sf::Music::onSeek(timeOffset);
}
virtual bool onGetData(sf::SoundStream::Chunk& chunk)
{
if (sf::Music::onGetData(chunk))
{
sf::Lock lock(mutex);
{
std::cerr << "Could not push " << chunk.sampleCount << " samples!" << std::endl;
}
return true;
}
return false;
}
};
int main(int argc, char* args[])
{
std::string filename = "";
if (argc > 1)
filename = args[1];
AudioFileStream audio(fada);
if (!audio.openFromFile(filename))
{
std::cerr << "Problem opening audio file." << std::endl;
return 1;
}
fada_bindstream(fada, FADA_TSAMPLE_INT16, audio.getSampleRate(), audio.getChannelCount());
sf::Time continueInterval = sf::seconds(1024.f / audio.getSampleRate());
sf::Time nextContinue = continueInterval;
bool readyToUpdate = true;
audio.play();
while (audio.getStatus() == AudioFileStream::Playing)
{
sf::Lock lock(mutex);
if (readyToUpdate)
{
std::cout << "Fundamental Frequency: " << findFundamentalFreq(fada) << "Hz" << std::endl;
readyToUpdate = false;
}
while (audio.getPlayingOffset() >= nextContinue)
{
nextContinue += continueInterval;
readyToUpdate = true;
}
sf::sleep(sf::milliseconds(1));
}
return 0;
}
{
double high = 0.;
size_t fundamental = 0;
{
double cur;
if (cur > high)
{
high = cur;
fundamental = i;
}
}
}
The output, as the music plays, keeps us up to date on the fundamental frequency:
Cool, it works nicely! However, there's a noticable problem - there's a lot of repeating values. This is due to the fada_Manager's internal FFT buffer's limited size, which is automatically determined by the manager's analysis window size. In the next example, we ditch the idea of the manager housing the FFT buffer internally, and we create our own larger external FFT buffer.
Part 2 - External FFT Buffers
In this modification, we create our own external FFT buffer, and assign it to the manager.
int main(int argc, char* args[])
{
std::string filename = "";
if (argc > 1)
filename = args[1];
AudioFileStream audio(fada);
if (!audio.openFromFile(filename))
{
std::cerr << "Problem opening audio file." << std::endl;
return 1;
}
fada_bindstream(fada, FADA_TSAMPLE_INT16, audio.getSampleRate(), audio.getChannelCount());
sf::Time continueInterval = sf::seconds(1024.f / audio.getSampleRate());
sf::Time nextContinue = continueInterval;
bool readyToUpdate = true;
audio.play();
while (audio.getStatus() == AudioFileStream::Playing)
{
sf::Lock lock(mutex);
if (readyToUpdate)
{
std::cout << "Fundamental Frequency: " << findFundamentalFreq(fada) << "Hz" << std::endl;
readyToUpdate = false;
}
while (audio.getPlayingOffset() >= nextContinue)
{
nextContinue += continueInterval;
readyToUpdate = true;
}
sf::sleep(sf::milliseconds(1));
}
return 0;
}
{
double high = 0.;
size_t fundamental = 0;
{
double cur;
if (cur > high)
{
high = cur;
fundamental = i;
}
}
}
The output:
That looks a bit nicer, not as many repeating frequencies now.
With external FFT buffers, you're able to specify how large they are independent of the manager's analysis window size. You're also able create multiple FFT buffers so you are not limited to the single internal buffer.


Logistics Company
Log out
Reports
Packets registered by:
View
Sent but not delivered packets:
View
Packets sent by:
View
Packets received by:
View
Income in the period between:
From
Through
View


--- title: "Market Research: Discovering the “What”" date: 2014-02-17 tags: ["The Need for a Broad Range of Services for RightSourcing"] ---
The first step to effective market research is to gather field data from users in their daily context. Techniques used to understand user goals and tasks include:
1. Interviews
2. User observation
3. User surveys
While gathering data, it is important to consider these questions for a compelling analysis:
1. What information is most relevant?
2. What are the environmental conditions like?
3. Are there environmental constraints?
4. What is missing?
5. What should be automated vs. manual?
Conducting market research on user input has two benefits:
1. Discovering potential product opportunities
2. Decreasing time and money waste
The contextual knowledge gathered from user research is then used to create
1. User personas
2. Scenarios
3. Effective design solutions
Post Release
Once the product is developed and released in the market, it is still important to conduct market research to gauge user input. Some ways to gather user input include:
1. Create mechanisms to monitor what users think of the product
2. Build an online community for users to share ideas with other users
Post release research paves the way for future improvements, as users openly discuss popular features, indicate their preferences, or shed insight on unintended uses of the product. In the end, the best way to maintain the lifecycle of the product is to know and deliver what the user ultimately wants.


What I built, Build a personal portfolio site as my submission for DigitalOcean App Platform Hackathon on DEV!
Read moreSimply put, cloud computing is the delivery of computing services—including servers, storage, databases, networking, software, analytics, and intelligence—over the Internet (“the cloud”) to offer faster innovation, flexible resources, and economies of scale. You typically pay only for cloud services you use, helping you lower your operating costs, run your infrastructure more efficiently, and scale as your business needs change.
Read moreWe’ll have an overview of Flutter, the latest buzz in app development market. Flutter is gaining popularity faster than any other framework. Some say it is Google’s answer to Facebook’s React Native or any other cross platform frameworks, but that debate is for later.
Read moreA Video and Audio player that can play from local assets, local files and network URLs with the powerful controls
Read more


Home
About
CV
Blog
adarsh dessai's Blog
15 Aug 2016
»
adarsh dessai, rythm of life, coming soon, stay tuned


Why use Git?
January 18, 2015
What are the benefits of version control? Version control is exactly what is sounds like. It allows many versions of any particular document to be modified at any given time. This is a great benefit for teams of developers because everybody on the team is able to work on any file at any time and later merge all the changes into a common version.
How does git help you keep track of changes? Git is a system that saves all of your files in your project. It allows you to "commit" your projects at any given time. It then allows for recall of not just the latest version, but the the exact contents of each version that was committed.
Why use GitHub to store your code? Github is the online hub for version control, built on top of Git. While it is known as the largest host of code, it essentially allows for easy hosting of any file. It also allows for easy collaboration on code, via version control.


| oauth_service_token {httr} | R Documentation |
Service accounts provide a way of using OAuth2 without user intervention. They instead assume that the server has access to a private key used to sign requests. The OAuth app is not needed for service accounts: that information is embedded in the account itself.
oauth_service_token(endpoint, secrets, scope = NULL, sub = NULL)
endpoint |
An OAuth endpoint, created by |
secrets |
Secrets loaded from JSON file, downloaded from console. |
scope |
a character vector of scopes to request. |
sub |
The email address of the user for which the application is requesting delegated access. |
Other OAuth:
oauth1.0_token()
,
oauth2.0_token()
,
oauth_app()
,
oauth_endpoint()
## Not run: endpoint <- oauth_endpoints("google") secrets <- jsonlite::fromJSON("~/Desktop/httrtest-45693cbfac92.json") scope <- "https://www.googleapis.com/auth/bigquery.readonly" token <- oauth_service_token(endpoint, secrets, scope) ## End(Not run)


This module provides the ability to import data into the grid. It uses the column defs to work out which data belongs in which column, and creates entities from a configured class (typically a $resource).
If the rowEdit feature is enabled, it also calls save on those newly created objects, and then displays any errors in the imported data.
Currently the importer imports only CSV and json files, although provision has been made to process other file formats, and these can be added over time.
For json files, the properties within each object in the json must match the column names (to put it another way, the importer doesn't process the json, it just copies the objects within the json into a new instance of the specified object type)
For CSV import, the default column identification relies on each column in the header row matching a column.name or column.displayName. Optionally, a column identification callback can be used. This allows matching using other attributes, which is particularly useful if your application has internationalised column headings (i.e. the headings that the user sees don't match the column names).
The importer makes use of the grid menu as the UI for requesting an import.


Mix of RequireJS, Marionette.js and Facebook API
This is a quick example of use a serie of libraries that work great together.
I like a lot RequireJS, the way I can organize my modules/code with it. Marionette.js do a great work with the views, it takes care about everything: listeners, selectors, events, etc. And with the Facebook SDK we have a lot of info to build complex or simple applications like the next one.
The example is very straightforward:
Search for your Facebook ID or, for example: "obama" or "mickeymouse"
How it works?
This is our basic layout: Let configure RequireJS, resolve some dependencies and start our application:
The SearchView listens the "keyup" event and dispatches the current input value. It also listens when the model is updated and changes the style of himself.
The UserView displays the information every time that the model is updated.
#javascript#requirejs#marionette#facebook


calculate target saccade density Syntax: AOIDensity =calcAOISacDensity( eyePos, aoiCenter, maxDist ) Inputs: eyePos: vector of complex (x+i*y) coordinates. -1-i1 to identify missing data. They are in range [ 0 ,1 ] aoiCenter: coordinates of AOI in image scale, returned by 'returnAOICenters.m' maxDist: maximum distance to a nearest AOI, anything further considered not part of any AOI, returned by 'returnAOICenters.m' Outputs: AOIDensity: vector of number of saccades to a particular AOI
0001 % calculate target saccade density 0002 % 0003 % Syntax: AOIDensity =calcAOISacDensity( eyePos, aoiCenter, maxDist ) 0004 % 0005 % Inputs: 0006 % eyePos: vector of complex (x+i*y) coordinates. -1-i1 to identify 0007 % missing data. They are in range [ 0 ,1 ] 0008 % aoiCenter: coordinates of AOI in image scale, returned by 'returnAOICenters.m' 0009 % maxDist: maximum distance to a nearest AOI, anything further 0010 % considered not part of any AOI, returned by 'returnAOICenters.m' 0011 % 0012 % Outputs: 0013 % AOIDensity: vector of number of saccades to a particular AOI 0014 0015 function [AOIDensity ] =calcAOISacDensityDist( sacStruct, aoiCenter, maxDist ) 0016 0017 0018 endSacPos = sacStruct.endSacPos; 0019 0020 %calculate AOI fixation density 0021 numAOI = size(aoiCenter,2); 0022 numSaccades = size( endSacPos,2); 0023 AOIDensity = zeros( numAOI,1); 0024 effectivNumSaccades = 0; 0025 0026 for i1 = 1:numSaccades 0027 dist = calc2Dist( endSacPos(:,i1), aoiCenter); % 2-norm 0028 [minDist minIdx] = min( dist); 0029 if minDist < maxDist 0030 effectivNumSaccades = effectivNumSaccades+1; 0031 AOIDensity(minIdx) = AOIDensity(minIdx) + 1; 0032 end 0033 end 0034 0035 % normalize so the sum is 1 0036 if effectivNumSaccades > 0 0037 AOIDensity = AOIDensity./sum( AOIDensity); 0038 end 0039 0040


gitlab create_project project_name- Get info about a specific commit:
gitlab commit project_name commit_hash- Get info about jobs in a CI pipeline:
gitlab pipeline_jobs project_name pipeline_id- Start a specific CI job:
gitlab job_play project_name job_id


Astro3Words: easy coordinates in astronomy¶
Hi! Welcome to the documentation of Astro3Words – a Python package to find what3words coordinates of astronomical sources.
If you’ve ever been confused by endless J01234.567+012345 object names in talks and posters, or bored of jokes about their beautiful names, you are not alone. Coordinates don’t have to be so difficult!
Astro3Words converts an R.A, Dec coordinate into three words - with a precision of 0.1”. It’s easy! Our goal is to help astronomy outreach and make astronomy more accessible. We encourage the rest of the community to use our package and get involved. If you find a bug, or have a suggestion, please create an issue on GitHub.
User Guide:¶
Contributing:¶
This project is still very much under development, and we are happy with new ideas and contributions! If you would like to get involved, please reach out to Liza Sazonova (esazono1@jhu.edu).


Melkweg is one of the best known music venues in Amsterdam, NL. They pride themselves on being at the meeting point between pop- and underground culture. Giving their audience the chance to hear new music, and expose them to artists they might otherwise not have heard is a vital part of what they do.
Therefore it seemed only logical exploration should take center stage on the site. The chronological agenda view takes a backseat to that which is internally dubbed ‘the discovery page’, but what visitors experience as the homepage. Since motivating visitors to explore music they might not or vaguely know is so important, listening through audio or video should never be more than a click away. Almost all events are enriched with audio snippets from Spotify or Soundcloud, or videos from Youtube.
Every visit should bring something new, so me and my colleagues at Grrr developed a simple but effective algorithm that allows Melkweg a degree of curation. While at the same time making sure concerts in the near future float to the top, and lesser known artists don’t get buried by the big names.
Of course hardcore music lovers aren’t left behind. The agenda is straightforward, and makes it easy to search for specific artists, see what club-nights are on, or keep up with just announced concerts.
Melkweg.nl is not about ‘disrupting’ websites of pop venues. We don’t try new things because we’re bored with the status quo. What we’re looking for is the best way to connect people to concerts that interest them, and ones they don’t even know they’re looking for. It’s a constant conversation with both the client and the audience. With small incremental updates we try to bring more focus to the parts that work, while eliminating the features that don’t.
The fact that after over 3 years the site isn’t bloated by unneeded features, but is actually still being improved upon is what makes this a great project for me to work on.


-Gather evidence to identify what your personal values are. The reflection gets you to examine and identify who you are at this point, this involves a self-evaluation and seeking feedback from two or three trusted friends, family, whanau, colleagues. This allows you to compare how you see yourself, with how others see you.
Kindness
Feelings
Friendship
Fun
Clever
Honesty
Silence
Simplicity
Commitment
Control
Loyalty
Trustworthy
Uniqueness
Energy
Playfulness
Welcoming
Ethical
-Explain a situation where you have had an ethical decision to make. Discuss how you weighed up the values involved in that decision, the decision you made and the consequences of the action you took.
I had a friend that came to NZ from Argentina last year. I got her a job with my partner’s family as a Nanny. She has always been super nice with everybody and everyone liked her. After some time my partners family and my friend from Argentina started to get into fights for different work/life balance reasons, as she was living in the same house that she was working as a Nanny. I was in the middle of that because she was my friend and on the other side there was my partners family as well. She ended up quitting the job badly, a lot of drama... My partner’s family started saying that my friend was a horrible person.... That she deleted some files from a laptop that they lended her and that she written offensive stuff on different parts of the house.
Everyone was against my friend and I didn’t knew who to believe. She was saying that my partners family were crazy and even my partner got to start hating her for that.
I decided to believe on my friend and that costed me some fights with my partner. I feel that my relationship with my partner kinda broke a bit because of me believing on my friend.
-Describe how your culture has influenced your values and identity.
Argentinian people are very straight up and because of that sometimes we can come as abrasive and rude.
I remember that during the first year of living in NZ people were calling me rude very often for things that I was saying. It was quite shocking for me because I always though that I was a nice and kind person back in Argentina and I remember that those comments were quite hurtful at the time.
We have a very clear sense of who we are and our identity and when you come into a new country people don’t really get that as they might not be used to it... So we have to adapt.
Back where I’m from it’s very common for people to talk about emotions and how we feel. People do therapy and it’s a normal and healthy thing to do...
Here in NZ it’s not that common and people assume that if you go to therapy its because you have mental problems.
People here in NZ exercise a lot to feel good about themselves and ‘silence’ those little demons in our heads... and not many people talks about it.
-Using the evidence gathered, describe your strengths and limitations.
Intuitive
Insightful
Passionate
Sentitive
Adaptable
Sensitive
Perfectionistic
Anxious
-Evaluate your strengths and limitations in terms of your learning and career development
I find web development super interesting and its something that I’ve always wanted to properly learn... now that I have the opportunity my passion and driven will help me to achieve the learning.
I’ve been able to Adapt onto to many situations since I moved from Argentina to NZ.... The cultural shock was big at the time but now I fell that being on a position where you get challenged its the best way of improving and learning about yourself. This boootcamp will put me on the edge and being able to Adapt to the workload and the new routine its gonna help me a lot.
My anxiety will def play a role into this journey... I’ve been working on it for some time now and I’ve been able to use the tools that I got to calm it down. The meditations and the yoga classes will help me with that one :)
-Identify which of your strengths might help you in your learning journey and how they might intersect with learning obstacles.
Passionate/Drive
I’ve been interested on code and development since I finished with high school... I had opportunities where I could have studied it but I remember not being on the best scenario at that point... There were different priorities at the time. Even tho I did a short course on web development it wasn’t enough. After working for quite a few years on the industry and getting a deeper knowledge on development I found myself with enough time, money, and this opportunity to take on. I’m quite passionate about the things that I like and coding is one of those.... I will use the passion that I got for it in this learning journey to overcome possible learning obstacles.
-Share an example from your experience of where you were trying to work productively with others, but there was resistance or tension. Discuss the strategies you used at that time, how effective they were, and your reflections on what other strategies you would try now, and why.
On my last job for a client I was given defects to fix and I was aware that they were gone take more time that the time that I was allowed to claim for on my company. There was 2 hours per defect but I had to investigate for 10 hours to be able to fix it. After some time of me working on those defects I had to talk with my PM to tell him the issue. I guess next time that I get into a situation like this I would straight away call it out to avoid misunderstandings and maybe some possible tension from both sides.


--- layout: post authors: ["Greg Wilson"] title: "Another Good Workshop in Brazil" date: 2015-06-23 time: "11:30:00" tags: ["Workshops", "University of Ceara", "Latin America"] ---
The indefatigable Raniere Silva has just posted a description of a workshop at the University of Ceará that he and Dani Ushizima just finished teaching. It went well, and there are a lot of good ideas in his write-up — please check it out.