This tool lets you rename your GitHub default branches to whatever you want.
Create a GitHub personal access token with the repo scope, fill out the fields, but don't check the box unless you know those branches are safe to delete!
When you submit the form, this short JavaScript snippet is run, entirely on your local machine, making no network requests to any servers besides through the GitHub API. If you don't trust sketchy webapps despite the countless perfectly legitimate testimonials, please copy the JavaScript code and run it yourself.
What's a default branch?
It's the base branch in a GitHub repository, which by default is master
.
Why should I use this tool?
Freedom of speech! Defy conventions! Express yourself in one word!
Who, other than suspicious testimonials, would trust this site?
Nobody. So you should really read the source code and run it yourself.
Will I encounter issues if branches with the same name already exist, or if there are many external hyperlinks to the master
branch, or if many people use my repo as a submodule, or if I have many forks I don't want to touch, or if I have over 1239 repositories, or if I'm using multiple remotes, or if I'm using Netscape Navigator 3.02?
Yes, yes, yes, yes, yes, yes, and yes. In any case, don't use this tool. Nevertheless, feel free to modify it to suit your needs!
Would any changes be irreversible?
Not unless you check the box to delete your old default branches. Usually, you can just run the script again in reverse to undo your changes. Otherwise, if you're not a casual user (see above), this tool isn't for you.
Whose repositories does this affect?
This script only affects repos under your username, unfortunately including all forks. It does not affect any repos owned by organizations, even if you are an owner of such a repo, because presumably you should probably consult your collaborators first before breaking everything.
Which scopes should I select when creating my token?
You should select repo if you want to change both public and private repos, or just public_repo if you don't trust that I wouldn't "accidentally" delete all your private repos. Remember to revoke your token afterwards!
Where's the progress indicator?
You can open up the JavaScript console to see some output. A list of results for all repositories will show up at the very end, so be patient.
Whatever shall I do, in order to switch to my new branch on my local repositories after running this script?
If you're scared of Git, you can do the usual: delete and clone again.
If your local branch is behind or even with your remote branch, try:
git pull git checkout <new_branch> git branch -d <old_branch> git remote update -p
If your local branch is ahead of your remote branch, try:
git checkout -b <new_branch> git branch -d <old_branch> git push <remote> -u <new_branch> git remote update -p
Here's an example of the bash loop that I used:
for d in ./*/; do ( cd "$d" && git pull && git checkout salad && git branch -d master && git remote update -p ) done
Whom should I ask for help in configuring git init
to initialize new repositories with a different default branch?
See this StackOverflow answer by nicoo for details.
When will you write a script to rename GitLab default branches?
Tomorrow, if this gets over 10 upvotes on Hacker News or Reddit. Otherwise never, because nobody would ever use it, not even myself. [Update: I got four upvotes on both Hacker News and Reddit, so never. Reddit and the eight people who downvoted this must hate free speech!]
Was this script thoroughly checked for bugs?
No. I express no representation or warranties of any kind whatsoever, including without limitation the implied warranties of merchantability and fitness for a particular purpose, all of which I hereby disclaim to the fullest extent permitted by law.
Whoever could have "accidentally" deleted all of my repos?
It wasn't me! Again, please read the source code to double-check.
Were any of these "frequently" asked questions ever asked?
No.
@eyqs: Amazing tool. If this didn't already exist, I would have written it myself!
@oirectine: i haven’t used it but i’m sure it probably works
@danield128: Rename is so easy to use! We plan to replace git with rename as our exclusive version control system. Thanks @eyqs!
@emsal1863: I was paid $0.10 to give my 2 cents here. This script sucks!!!
@Schemetrical: Never used tool
@mo-morgan: this tool will definitely advance humanity 10/10
@fb39ca4: I can now sleep at night knowing racism has ended.
@jzaralim: none of the people in the testimonials even used the tool...
@rhymu8354: The tool you wrote is very neat! I thought about making a tool that just does the "patch" part (changing the default branch) but in the end I opted to just change them all manually since it didn't take long. However, I'm sure your tool could be handy for others, especially if there are a lot of repos to go through.
@priyanshmalik: this sounds like a lot of effort when I only have one repository
@ben324: YOOOOooOOOOoOoOo i don't even have any repositories!!!!
@gwenli: what is this
@rachitkumar: This tool is useless
@lynnzhang7: I don't remember how to git and I also got locked out of my account last year but if I could use it im sure this would be life changing
@nishadjamaldeen: I used to spend a lot of my time trying to rename my github branches. Now, its done at the click of a button!
@zcliang97: It’s apps like these that make me think the future is here. #GoodThingsHappenIn2020Too
@s-zheng: this cured my cancer
@rebeccayelin: ...
@estherlin: this is so much better than plain old
git branch -m master salad
.
@gzgreg: pretty sure this got one of my coworkers fired yesterday when all the links to
tree/master
broke, nice job
@andersfylling: So I can rename it to
master
after GitHub takes this race play too far?
@divyabudihal: this is so important in 2020! We must work to completely abolish terms like
master
from the tech world!
@maggiechen: ah I see, doing away with the master slave terminology
@ShuHaoLi: masterful.
@mkduan: I always felt like
master
was a little bit too oppressive for me, now I feel much safer coding! 10/5 would recommend it to anyone!
@jnancy: 🥵😤💦
@Cesium-Ice: The author has excellent taste in anime.
@eishan05: I am surprised this tool doesn’t need a credit card number and the three digits on the back to work, considering I discovered it on a kissanime ad banner
@Andrew-Ting: すごい！このツールは面白くて、かっこいいですよ！やれやれだぜ。Grabe talaga yung tool na ito. Napakagaling, di mo na kailangan magsulat ng git commands sa terminal. Astig!
@izyb: this gave me cancer
@davidberard98: yikes
@Chenart: I'd love to invest in your startup but I just don't see a clear monetization strategy.
@Bruno-DaSilva: Is this web scale? MongoDB is web scale. Can this use MongoDB?
@ehnryx: scary. can this defeat science advising?
@blin4444: oh no, what if it steals my API keys
@EbTech: The source code ain't Rust, can't trust it. I hardly even trust my own code.
@silastsui: this tool will turn u into a 10x developer
@esemeniuc: This tool renamed my life. I am now X Æ A-12 Musk
@ezaanm: pog
@bogwarts: So convenient and such a good idea! Thanks for building!
@luccasiau: Eugene told me this tool is great and I think he's right
@d-e-lu: According to Eugene I can use this to make myself look cool. Thanks Eugene!!!
@felixhe97: Writing testimonial because I just want to feel included.
@Visible1: i dont social distance much
@SoleSun: LOOL sorey I missed it, I defijitely didnt know what was happening
@wollip: seems cool, probably won’t use it. I like my repos the way they are. This is going to break my repos that have multiple remotes.
@Thanh-To: I was probably the only person who actually used it? Works as intended. I’m deleting the token just in case.
...and if you'd like to create/update/destroy your own testimonial, raise an issue!


Goofie
Team Members
< Back
Goofie
843/1000
Adminstrator India
<EMAIL_ADDRESS>Mobile
+91<PHONE_NUMBER>
Manager
Darshit Vora
Skills
Developer
Location
Mumbai
Extension
22
Last activity
Online Now


ewes EBV Farm FECs low FEC egg high resistance breeding infection nematode lambs climate pasture observed Fig. estimated eggs ewe reduced faecal mean counts data PPR gastrointestinal {border-style Rose change lamb peri-parturient using circumcincta px;} #ffffff;} future larvae nematodes output reduction daily infective Supplementary exposure grazing impact model resistant Bishop EBVs peak period predicted sheep week Parasitol. Vet. compared farms lambing lower value Morgan P = ., contamination contortus simulations age group individual potential pressure simulated southwestern E.R. Haemonchus Stear Table anthelmintic ewes. historic number numbers weight average genetic maternal mitigate production selection used Teladorsagia breed epidemiological herbage higher lambs, line parasite px; similar stages study, susceptible {font-family Dijk P = .) benefits climatic decrease excreted font-size free-living range sampling season selective study s = ., (L) (high Ewes FECs, However, Williams control dataset development difference double; grazed groups immunity increase maximum monitored parasites parasitic produced reduce result rise temperature values van (e.g. (±S.D. Breeding EBV) Leathwick PPR. Predicted Simulations approximately arising baseline border-color border-width changes correlation count course current deposited distribution effects estimate ewes, faeces gram group, infectivity input management milk period, period. present presented pressure. rainfall resistance. selecting solid; time vaccination weaning {font-style {font-weight – months = , months weeks (EBVs) (S.D.) (both (low (negative) . kg Animal Carlo England England). Exlana Farms Furthermore, Gruner Individual Int. Linear Model Monte Nisbet Parasitology Sci. Stear, age, attenuated based birth bold breeds change, climate-driven commercial conditions. contributed correlated courier; derived determine early em; end example, following function growth help impacts important improvement increased indicate indicators key lambs. likely line) method methods package performance phenotypic pt;} rate reducing resistance, sample samples season, season. select selected simulation statistical studies subsequent survival s = −., taken terms third-stage total traits value) variation weaning, worm week


{% extends "tutorial.html" %} {% block html5badge %} {% endblock %} {% block iscompatible %} return !!window.ArrayBuffer; {% endblock %} {% block content %}
Typed Arrays are a relatively recent addition to browsers, born out of the need to have an efficient way to handle binary data in WebGL. A Typed Array is a slab of memory with a typed view into it, much like how arrays work in C. Because a Typed Array is backed by raw memory, the JavaScript engine can pass the memory directly to native libraries without having to painstakingly convert the data to a native representation. As a result, typed arrays perform a lot better than JavaScript arrays for passing data to WebGL and other APIs dealing with binary data.
Typed array views act like single-type arrays to a segment of an ArrayBuffer. There are views for all the usual numeric types, with self-descriptive names like Float32Array, Float64Array, Int32Array and Uint8Array. There's also a special view which has replaced the pixel array type in Canvas's ImageData: Uint8ClampedArray.
DataView is the second type of view and it is meant for handling heterogeneous data. Instead of having an array-like API, the DataView object provides you a get/set API to read and write arbitrary data types at arbitrary byte offsets. DataView works great for reading and writing file headers and other such struct-like data.
To use Typed Arrays, you need to create an ArrayBuffer and a view to it. The easiest way is to create a typed array view of the desired size and type.
// Typed array views work pretty much like normal arrays. var f64a = new Float64Array(8); f64a[0] = 10; f64a[1] = 20; f64a[2] = f64a[0] + f64a[1];
There are several different types of typed array views. They all share the same API, so once you know how to use one, you pretty much know how to use them all. I'm going to create one of each currently existing typed array views in the next example.
// Floating point arrays. var f64 = new Float64Array(8); var f32 = new Float32Array(16); // Signed integer arrays. var i32 = new Int32Array(16); var i16 = new Int16Array(32); var i8 = new Int8Array(64); // Unsigned integer arrays. var u32 = new Uint32Array(16); var u16 = new Uint16Array(32); var u8 = new Uint8Array(64); var pixels = new Uint8ClampedArray(64);
The last one is a bit special, it clamps input values between 0 and 255. This is especially handy for Canvas image processing algorithms since now you don’t have to manually clamp your image processing math to avoid overflowing the 8-bit range.
For example, here’s how you’d apply a gamma factor to an image stored in a Uint8Array. Not very pretty:
u8[i] = Math.min(255, Math.max(0, u8[i] * gamma));
With Uint8ClampedArray you can skip the manual clamping:
pixels[i] *= gamma;
The other way to create typed array views is to create an ArrayBuffer first and then create views that point to it. The APIs that get you external data usually deal in ArrayBuffers, so this is the way you get a typed array view to those.
var ab = new ArrayBuffer(256); // 256-byte ArrayBuffer. var faFull = new Uint8Array(ab); var faFirstHalf = new Uint8Array(ab, 0, 128); var faThirdQuarter = new Uint8Array(ab, 128, 64); var faRest = new Uint8Array(ab, 192);
You can also have several views to the same ArrayBuffer.
var fa = new Float32Array(64); var ba = new Uint8Array(fa.buffer, 0, Float32Array.BYTES_PER_ELEMENT); // First float of fa.
To copy a typed array to another typed array, the fastest way is to use the typed array set method. For a memcpy-like use, create Uint8Arrays to the buffers of the views and use set to copy the data over.
function memcpy(dst, dstOffset, src, srcOffset, length) { var dstU8 = new Uint8Array(dst, dstOffset, length); var srcU8 = new Uint8Array(src, srcOffset, length); dstU8.set(srcU8); };
To use ArrayBuffers that contain data with heterogenous types, the easiest way is to use a DataView to the buffer. Suppose we have a file format that has a header with an 8-bit unsigned int followed by two 16-bit ints, followed by a payload array of 32-bit floats. Reading this back with typed array views is doable but a bit of a pain. With a DataView we can read the header and use a typed array view for the float array.
var dv = new DataView(buffer); var vector_length = dv.getUint8(0); var width = dv.getUint16(1); // 0+uint8 = 1 bytes offset var height = dv.getUint16(3); // 0+uint8+uint16 = 3 bytes offset var vectors = new Float32Array(width*height*vector_length); for (var i=0, off=5; i<vectors.length; i++, off+=4) { vectors[i] = dv.getFloat32(off); }
In the above example, all the values I read are big-endian. If the values in the buffer are little-endian, you can pass the optional littleEndian parameter to the getter:
... var width = dv.getUint16(1, true); var height = dv.getUint16(3, true); ... vectors[i] = dv.getFloat32(off, true); ...
Note that typed array views are always in the native byte order. This is to make them fast. You should use a DataView to read and write data where endianness is going to be an issue.
The DataView also has methods for writing values to buffers. These setters are named in the same fashion as the getters, "set" followed by the data type.
dv.setInt32(0, 25, false); // set big-endian int32 at byte offset 0 to 25 dv.setInt32(4, 25); // set big-endian int32 at byte offset 4 to 25 dv.setFloat32(8, 2.5, true); // set little-endian float32 at byte offset 8 to 2.5
Endianness, or byte order, is the order in which multi-byte numbers are stored in the computer's memory. The term big-endian describes a CPU architecture which stores the most significant byte first; little-endian, the least significant byte first. Which endianness is used in a given CPU architecture is completely arbitrary; there are good reasons to choose either one. In fact, some CPUs can be configured to support both big-endian and little-endian data.
Why do you need to be concerned about endianness? The reason is simple. When reading or writing data from the disk or the network, the endianness of the data must be specified. This ensures that the data is interpreted properly, regardless of the endianness of the CPU that is working with it. In our increasingly networked world, it is essential to properly support all kinds of devices, big- or little-endian, that might need to work with binary data coming from servers or other peers on the network.
The DataView interface is specifically designed to read and write data to and from files and the network. DataView operates upon data with a specified endianness. The endianness, big or little, must be specified with every access of every value, ensuring that you get consistent and correct results when reading or writing binary data, no matter what the endianness of the CPU on which the browser is running.
Typically, when your application reads binary data from a server, you’ll need to scan through it once in order to convert it into the data structures your application uses internally. DataView should be used during this phase. It’s not a good idea to use the multi-byte typed array views (Int16Array, Uint16Array, etc.) directly with data fetched via XMLHttpRequest, FileReader, or any other input/output API, because the typed array views use the CPU’s native endianness. More on this later.
Let’s look at a couple of simple examples. The Windows BMP file format used to be the standard format for storing images in the early days of Windows. The documentation linked above clearly indicates that all of the integer values in the file are stored in little-endian format. Here is a snippet of code which parses the beginning of the BMP header using the DataStream.js library which accompanies this article:
function parseBMP(arrayBuffer) { var stream = new DataStream(arrayBuffer, 0, DataStream.LITTLE_ENDIAN); var header = stream.readUint8Array(2); var fileSize = stream.readUint32(); // Skip the next two 16-bit integers stream.readUint16(); stream.readUint16(); var pixelOffset = stream.readUint32(); // Now parse the DIB header var dibHeaderSize = stream.readUint32(); var imageWidth = stream.readInt32(); var imageHeight = stream.readInt32(); // ... }
Here’s another example, this one from the High Dynamic Range rendering demo in the WebGL samples project. This demo downloads raw, little-endian floating-point data representing high dynamic range textures, and needs to upload it to WebGL. Here is the snippet of code which properly interprets the floating-point values on all CPU architectures. Assume the variable “arrayBuffer” is an ArrayBuffer which has just been downloaded from the server via XMLHttpRequest:
var arrayBuffer = ...; var data = new DataView(arrayBuffer); var tempArray = new Float32Array( data.byteLength / Float32Array.BYTES_PER_ELEMENT); var len = tempArray.length; // Incoming data is raw floating point values // with little-endian byte ordering. for (var jj = 0; jj < len; ++jj) { tempArray[jj] = data.getFloat32(jj * Float32Array.BYTES_PER_ELEMENT, true); } gl.texImage2D(...other arguments..., gl.RGB, gl.FLOAT, tempArray);
The rule of thumb is: upon receiving binary data from the web server, make one pass over it with a DataView. Read the individual numeric values and store them in some other data structure, either a JavaScript object (for small amounts of structured data) or a typed array view (for large blocks of data). This will ensure that your code works correctly on all kinds of CPUs. Also use DataView to write data to a file or the network, and make sure to appropriately specify the littleEndian argument to the various set methods in order to produce the file format you are creating or using.
Remember, all data that goes over the network implicitly has a format and an endianness (at least, for any multi-byte values). Make sure to clearly define and document the format of all data your application sends over the network.
I'm going to give you a brief overview of the different browser APIs that are currently using Typed Arrays. The current crop includes WebGL, Canvas, Web Audio API, XMLHttpRequests, WebSockets, Web Workers, Media Source API and File APIs. From the list of APIs you can see that Typed Arrays are well suited for performance-sensitive multimedia work as well as passing data around in an efficient fashion.
The first use of Typed Arrays was in WebGL, where it is used to pass around buffer data and image data. To set the contents of a WebGL buffer object, you use the gl.bufferData() call with a Typed Array.
var floatArray = new Float32Array([1,2,3,4,5,6,7,8]); gl.bufferData(gl.ARRAY_BUFFER, floatArray);
Typed Arrays are also used to pass around texture data. Here's a basic example of passing in texture content using a Typed Array.
var pixels = new Uint8Array(16*16*4); // 16x16 RGBA image gl.texImage2D( gl.TEXTURE_2D, // target 0, // mip level gl.RGBA, // internal format 16, 16, // width and height 0, // border gl.RGBA, //format gl.UNSIGNED_BYTE, // type pixels // texture data );
You also need Typed Arrays to read pixels from the WebGL context.
var pixels = new Uint8Array(320*240*4); // 320x240 RGBA image gl.readPixels(0, 0, 320, 240, gl.RGBA, gl.UNSIGNED_BYTE, pixels);
Recently the Canvas ImageData object was made to work with the Typed Arrays spec. Now you can get a Typed Arrays representation of the pixels on a canvas element. This is helpful since now you can also create and edit canvas pixel arrays without having to fiddle around with the canvas element.
var imageData = ctx.getImageData(0,0, 200, 100); var typedArray = imageData.data // data is a Uint8ClampedArray
XMLHttpRequest got a Typed Array boost and now you can receive a Typed Array response instead of having to parse a JavaScript string into a Typed Array. This is really neat for passing fetched data directly to multimedia APIs and for parsing binary files fetched from the network.
All you have to do is set the responseType of the XMLHttpRequest object to 'arraybuffer'.
xhr.responseType = 'arraybuffer';
Recall that you must be aware of endianness issues when downloading data from the network! See the section on endianness above.
The FileReader can read file contents as an ArrayBuffer. You can then attach typed array views and DataViews to the buffer to manipulate its contents.
reader.readAsArrayBuffer(file);
You should keep endianness in mind here as well. Check out the endianness section for details.
Transferable objects in postMessage make passing binary data to other windows and Web Workers a great deal faster. When you send an object to a Worker as a Transferable, the object becomes inaccessible in the sending thread and the receiving Worker gets ownership of the object. This allows for a highly optimized implementation where the sent data is not copied, just the ownership of the Typed Array is transferred to the receiver.
To use Transferable objects with Web Workers, you need to use the webkitPostMessage method on the worker. The webkitPostMessage method works just like postMessage, but it takes two arguments instead of just one. The added second argument is an array of objects you wish to transfer to the worker.
worker.webkitPostMessage(oneGBTypedArray, [oneGBTypedArray]);
To get the objects back from the worker, the worker can pass them back to the main thread in the same fashion.
webkitPostMessage({results: grand, youCanHaveThisBack: oneGBTypedArray}, [oneGBTypedArray]);
Zero copies, woo!
Recently, the media elements also got some Typed Array goodness in the form of the Media Source API. You can directly pass a Typed Array containing video data to a video element using webkitSourceAppend. This makes the video element append the video data after the existing video. SourceAppend is awesome for doing interstitials, playlists, streaming and other uses where you might want to play several videos using a single video element.
video.webkitSourceAppend(uint8Array);
You can also use Typed Arrays with WebSockets to avoid having to stringify all your data. Great for writing efficient protocols and minimizing network traffic.
socket.binaryType = 'arraybuffer';
Whew! That wraps up the API review. Let's move onto looking at third-party libraries for handling Typed Arrays.
jDataView implements a DataView shim for all browsers. DataView used to be a WebKit-only feature, but now it's supported by most other browsers. The Mozilla developer team is in the process of landing a patch to enable DataView on Firefox as well.
Eric Bidelman on the Chrome Developer Relations team wrote a small MP3 ID3 tag reader example that uses jDataView. Here's a usage example from the blog post:
var dv = new jDataView(arraybuffer); // "TAG" starts at byte -128 from EOF. // See http://en.wikipedia.org/wiki/ID3 if (dv.getString(3, dv.byteLength - 128) == 'TAG') { var title = dv.getString(30, dv.tell()); var artist = dv.getString(30, dv.tell()); var album = dv.getString(30, dv.tell()); var year = dv.getString(4, dv.tell()); } else { // no ID3v1 data found. }
Working with strings in Typed Arrays is a bit of a pain at the moment, but there’s the stringencoding library that helps there. Stringencoding implements the proposed Typed Array string encoding spec, so it’s also a good way to get a feel for what’s coming.
Here's a basic usage example of stringencoding:
var uint8array = new TextEncoder(encoding).encode(string); var string = new TextDecoder(encoding).decode(uint8array);
I have written a small bit manipulation library for Typed Arrays called BitView.js. As the name says, it works much like the DataView, except it works with bits. With BitView you can get and set the value of a bit at a given bit offset in an ArrayBuffer. BitView also has methods for storing and loading 6-bit and 12-bit ints at arbitrary bit offsets.
12-bit ints are nice for working with screen coordinates, as displays tend to have fewer than 4096 pixels along the longer dimension. By using 12-bit ints instead of 32-bit ints, you get a 62% size reduction. For a more extreme example, I was working with Shapefiles that use 64-bit floats for the coordinates, but I didn't need the precision because the model was only going to be shown at screen size. Switching over to 12-bit base coordinates with 6-bit deltas to encode changes from the previous coordinate brought the filesize down to a tenth. You can see the demo of that at here. Here's an example of using BitView.js:
var bv = new BitView(arrayBuffer); bv.setBit(4, 1); // Set fourth bit of arrayBuffer to 1. bv.getBit(17); // Get 17th bit of arrayBuffer. bv.getBit(50*8 + 3); // Get third bit of 50th byte in arrayBuffer. bv.setInt6(3, 18); // Write 18 as a 6-bit int to bit position 3 in arrayBuffer. bv.getInt12(9); // Read a 12-bit int from bit position 9 in arrayBuffer.
One of the most exciting things about typed arrays is how they make it easier to deal with binary files in JavaScript. Instead of parsing a string character by character and manually converting the characters into binary numbers and such, you can now get an ArrayBuffer with XMLHttpRequest and directly process it using a DataView. This makes it easy to e.g. load in an MP3 file and read the metadata tags for use in your audio player. Or load in a shapefile and turn it into a WebGL model. Or read the EXIF tags off a JPEG and show them in your slideshow app.
The problem with ArrayBuffer XHRs is that reading struct-like data from the buffer is a bit of a pain. DataView is good for reading a few numbers at a time in an endian-safe fashion, typed array views are good for reading arrays of element-size-aligned native endian numbers. What we felt missing is a way to read in arrays and structs of data in a convenient endian-safe fashion. Enter DataStream.js.
DataStream.js is a Typed Arrays library that read and writes scalars, strings, arrays and structs of data from ArrayBuffers in a file-like fashion.
Example of reading in an array of floats from an ArrayBuffer:
// without DataStream.js var dv = new DataView(buffer); var f32 = new Float32Array(buffer.byteLength / 4); var littleEndian = true; for (var i = 0; i<f32.length; i++) { f32[i] = dv.getFloat32(i*4, littleEndian); } // with DataStream.js var ds = new DataStream(buffer); ds.endianness = DataStream.LITTLE_ENDIAN; var f32 = ds.readFloat32Array(ds.byteLength / 4);
Where DataStream.js gets really useful is in reading more complex data. Suppose you have a method that reads in JPEG markers:
// without DataStream.js var dv = new DataView(buffer); var objs = []; for (var i=0; i<buffer.byteLength;) { var obj = {}; obj.tag = dv.getUint16(i); i += 2; obj.length = dv.getUint16(i); i += 2; obj.data = new Uint8Array(obj.length - 2); for (var j=0; j<obj.data.length; j++,i++) { obj.data[j] = dv.getUint8(i); } objs.push(obj); } // with DataStream.js var ds = new DataStream(buffer); ds.endianness = ds.BIG_ENDIAN; var objs = []; while (!ds.isEof()) { var obj = {}; obj.tag = ds.readUint16(); obj.length = ds.readUint16(); obj.data = ds.readUint8Array(obj.length - 2); objs.push(obj); }
Or use the DataStream.readStruct method to read in structs of data. The readStruct method takes in a struct definition array that contains the types of the struct members. It’s got callback functions for handling complex types and handles arrays of data and nested structs as well:
// with DataStream.readStruct ds.readStruct([ 'objs', ['[]', [ // objs: array of tag,length,data structs 'tag', 'uint16', 'length', 'uint16', 'data', ['[]', 'uint8', function(s,ds){ return s.length - 2; }], // get length with a function '*'] // read in as many struct as there are ]);
As you can see, the struct definition is a flat array of [name, type]-pairs. Nested structs are done by having an array for the type. Arrays are defined by using a three-element array where the second element is the array element type and the third element is the array length (either as a number, as a reference to previously read field or as a callback function). The first element of the array definition is unused.
The possible values for the type are as follows:
Number types Unsuffixed number types use DataStream endianness. To explicitly specify endianness, suffix the type with 'le' for little-endian or 'be' for big-endian, e.g. 'int32be' for big-endian int32. 'uint8' -- 8-bit unsigned int 'uint16' -- 16-bit unsigned int 'uint32' -- 32-bit unsigned int 'int8' -- 8-bit int 'int16' -- 16-bit int 'int32' -- 32-bit int 'float32' -- 32-bit float 'float64' -- 64-bit float String types 'cstring' -- ASCII string terminated by a zero byte. 'string:N' -- ASCII string of length N. 'string,CHARSET:N' -- String of byteLength N encoded with given CHARSET. 'u16string:N' -- UCS-2 string of length N in DataStream endianness. 'u16stringle:N' -- UCS-2 string of length N in little-endian. 'u16stringbe:N' -- UCS-2 string of length N in big-endian. Complex types [name, type, name_2, type_2, ..., name_N, type_N] -- Struct function(dataStream, struct) {} -- Callback function to read and return data. {get: function(dataStream, struct) {}, set: function(dataStream, struct) {}} -- Getter/setter functions to reading and writing data. Handy for using the same struct definition for both reading and writing. ['', type, length] -- Array of given type and length. The length can be either a number, a string that references a previously-read field, or a callback function(struct, dataStream, type){}. If length is set to ‘*’, elements are read from the DataStream until a read fails.
You can see a live example of reading in JPEG metadata here. The demo's using DataStream.js for reading the tag-level structure of the JPEG file (along with some EXIF parsing), and jpg.js for decoding and displaying the JPEG image in JavaScript.
Typed Arrays got their start in the early implementation stage of WebGL, when we found that passing JavaScript arrays to the graphics driver was causing performance problems. With JavaScript arrays, the WebGL binding had to allocate a native array and fill it by walking over the JavaScript array and cast every JavaScript object in the array to the required native type.
To fix the data conversion bottleneck, Mozilla's Vladimir Vukicevic wrote CanvasFloatArray: a C-style float array with a JavaScript interface. Now you could edit the CanvasFloatArray in JavaScript and pass it directly to WebGL without having to do any extra work in the binding. In further iterations, CanvasFloatArray was renamed to WebGLFloatArray, which was further renamed to Float32Array and split into a backing ArrayBuffer and the typed Float32Array-view to access the buffer. Types were also added for other integer and floating-point sizes and signed/unsigned variants.
From the beginning, the design of Typed Arrays was driven by the need to efficiently pass binary data to native libraries. For this reason, the typed array views operate upon aligned data in the host CPU’s native endianness. These decisions make it possible for JavaScript to reach maximum performance during operations such as sending vertex data to the graphics card.
DataView is specifically designed for file and network I/O, where the data always has a specified endianness, and might not be aligned for maximum performance.
The design split between in-memory data assembly (using the typed array views) and I/O (using DataView) was a conscious one. Modern JavaScript engines optimize the typed array views heavily, and achieve high performance on numerical operations with them. The current levels of performance of the typed array views were made possible by this design decision.


Thunderstorm
Menu
Team
Score
Get Teams
New Team
Update Team
Get Team
Get
Team Number
Team Name
School
City
State
Leader
Year Founded
Notes


US drops to 1-3 in Olympic baseball qualifying
by The Associated PressThe United States dropped to 1-3 in the super round of an Olympic baseball qualifying tournament, losing to Australia 2-1 on Wednesday at the Tokyo Dome.
Minnesota prospect Aaron Whitefield hit a two-run single in the first off Boston’s Tanner Houck at the Premier12 tournament game.
The U.S. was held to four hits, including an eighth-inning home run by Oakland’s Mark Payton off Ryan Searle.
Winner Tim Atherton allowed one hit in 5 1/3 innings, and former big leaguer Peter Moylan got two outs. Jon Kennedy retired two batters for the save, including the New York Yankees’ Erik Kratz on a game-ending flyout.
Mexico was 3-0 heading into its game against Japan later Wednesday,
Managed by Scott Brosius, the U.S. plays Taiwan on Friday. The top finisher from the Americas qualifies for the Tokyo Olympics next year. The second-place finisher from the Americas goes to a final qualifying tournament in March or April.
___
More AP MLB: https://apnews.com/MLB and https://twitter.com/AP_Sports
The Associated Press


Despite Oyster passing three separate smart contract audits, we were told by Bruno Block, the original founder and chief architect of the project, that the directorship of the token contract had to remain open so that the peg could be adjusted over time. This ultimately turned out to be a trapdoor mechanism in the contract that was eventually exploited. This contract was written by Bruno Block prior to the ICO, at which point Bruno was the only member of the team.


My home territory is Durham Region between Pickering and Bowmanville. Travel fees may apply and are based on $0.50/kilometer. This fee is per visit and not per bike. Travel fees are never included with service prices.
I perform all service on-site whenever possible. Under some circumstances a job may take more time than we have available. At your discretion, I can take the bike back to my home shop for completion or be paid for time spent and return another day.
The standard prices listed are subject to change without notice. Individual part installation prices can be quoted upon request but are also subject to change without notice. Prices do NOT include parts.


fishbase.ropensci.org is a RESTful Application Programming Interface (API) to the Fishbase database.
The Fishbase database and web portal are completely separate entities from this API. Fishbase is kind enough to give us a copy of their database, from which we provide some of it through this API.
Consider donating to Fishbase at fishbase.us/donate/
Source code for this API: https://github.com/ropensci/fishbaseapi
find the docs at https://fishbaseapi.readme.io/
See the bottom of the Fishbase website for details on usage.
The Fishbase API follows the same license as Fishbase. It is free for non-commercial use with attribution as defined by the terms of the CC-BY-NC license (see above). Commercial users should first contact Fishbase maintainers at www.fishbase.us/mail/MailForm.php.


Enumeration Atomic_Data_Select_Column
Enumeration members
Event
Event: = "event"
OEffect
OEffect: = "o_effect"
OReact
OReact: = "o_react"
OWant
OWant: = "o_want"
Prefix
Prefix: = "prefix"
XAttr
XAttr: = "x_attr"
XEffect
XEffect: = "x_effect"
XIntent
XIntent: = "x_intent"
XNeed
XNeed: = "x_need"
XReact
XReact: = "x_react"
XWant
XWant: = "x_want"
select columns of table "atomic.data"


About Me
Here is where we can insert a small thing about yourself
Here is a second paragraph for saying extra stuff
Contact Me
This is where we can insert some contact information
{% include _head.html %}
{% include _browser-upgrade.html %} {% include _navigation.html %}Here is where we can insert a small thing about yourself
Here is a second paragraph for saying extra stuff
This is where we can insert some contact information


 Also read interesting
things on the web.
Interest
- Football
- Madden games
- games
- coding
Favorite Quotes
"If you want something you've never
had, you have to do something you've
never done." - Unknown
"Never be ashamed of a scar. It
simply means you were stonger than
whatever tried to hurt you." - Unknown
"Don't walk behind me. I may not lead.
 I may not
follow. Just walk besides me and be my
freind." - Albert Camus
"There is only one god and his
name is Death. And there is only
one thing we say to Death:
''Not Today'' - George RR Martin"


Logout
Weather by geographic coordinates
Weather by city
Enter geographic coordinates
Enter city e.g. London or London,uk:
Execution time
Operation
Parameters
Weather
Result Message
×
Open weather response


Tony's Spotify Hotlist
Top 10 artists
Biig Piig
Art School Girlfriend
black midi
Against All Logic
The Silhouettes Project
Crumb
Nia Archives
Seoul Music Ensemble
Aphex Twin
Pinty
Top 10 tracks
2 Far Gone
Only One
Chaise Longue
This Old House Is All I Have
Plants
Liquorice
DiVine Ascension
Nothing is Safe
London To LA
A Place To Lie


Do you want me to upload some other app go ahead and fill this form and ill try to upload it for you :)
Submit


Stay up to date with ecommerce trends with Shopify's newsletter
Subscribe for free marketing tips
Please enter a valid email address
Interested In...
Everything!
Pricing Tips
Shopify Theme Hacks
Funnel Optimization
Sign up now
Thanks for signing up!
Unsubscribe


TOMORROW NEVER DIES A film review by Mark R. Leeper
Capsule: Media mega-tycoon and megalomaniac Jonathan Pryce matches wits with the Pierce Brosnan's James Bond. The film is long on action sequences and short on plot. Brosnan's interpretation of Bond gets more and more like Roger Moore's. There is less and less effective under all the polish and instead we have plot contrivances to make sure things work out for the best. TOMORROW NEVER DIES ranks about 12th of the 18 James Bond films from United Artists and (now) MGM. Rating: 5 (0 to 10), high 0 (-4 to +4)
If one looks at FROM RUSSIA WITH LOVE, there is a lot that happening in the film. The plot involves British intelligence, Russian intelligence, Turkish intelligence, and SPECTRE. Within SPECTRE there are competing agents chess champion Kronstein vs. Rosa Klebb. There is a false seduction and other double crosses. There are also fights and chases, but they are each relatively short in duration. When Bond fights Grant it is a believable fight and Grant is dispatched in three or four minutes. Then the plot starts moving forward again. The result was that FROM RUSSIA WITH LOVE was a James Bond thriller. If you have James Bond captured by the nasties and twenty minutes later he is still escaping and the plot is still at a standstill, it does not matter how many cars have been blown up, how many people have been shot, or how many helicopters have crashed. What you have may be a James Bond action film, but it is not a thriller. If Bond has to do some clever deductive work to realize what the villain is up to, you may have a thriller. If Bond's success just happens because by coincidence he is in the right place at the right time, you might have an action film, but you do not have a thriller. TOMORROW NEVER DIES has an unfortunate shortage of plot complexity. It is an action film with James Bond, but it is not a James Bond thriller.
After a shaky start in his first film, Pierce Brosnan is every bit the James Bond that Roger Moore was, for whatever that is worth. TOMORROW NEVER DIES reminds on of a Roger Moore Bond film. After a mostly irrelevant opening sequence we have a British battleship first buzzed by Chinese MiGs, then chewed up by some sort of mechanical device that combines aspects of a torpedo, a tunnel borer, and a lamprey. It goes to the bottom much like the Titanic, the film about which was released in the same weekend. (I wonder if the allusion could have been intentional.) The British and Chinese governments are on the point of war and James Bond is sent off to figure out another puzzle. It seems that while sea-water was still leaking into the battleship, news of the attack had already leaked out. It was on the news channel before anyone could have possibly known unless they knew in advance the attack was to happen. The news channel is ruled over by magnate Elliot Carver (played by Jonathan Pryce). Pryce seems to comprise the worst aspects of Ted Turner, Rupert Murdoch, Bill Gates, and a lamprey. Can it be that Carver is actually creating the news-- WAG THE DOG style--for his own ends? Wait till you hear the reasons why! But Bond has to get his information pumping Paris Carver (Teri Hatcher), former Bond lover and now Mrs. Elliot Carver. The plot works like a too-well-oiled machine taking us from one fifteen-minute action sequence to one that is possibly twenty minutes without ever slowing down for the audience to ask if it all makes sense, which it does not.
Along for the ride this time are Judi Dench as M, trying to look as much as possible like Bernard Lee with two X-chromosomes and frighteningly succeeding. Desmond Llewelyn is trying to give the impression that a job in the Secret Service is for life. He is probably there mostly for continuity as is Joe Don Baker's superfluous Jack Wade, formerly of GOLDENEYE. Jonathan Pryce is a great actor who makes a nearly colorless Bond villain. Two characters are not colorless and should have been used to considerably advantage. One was a Chinese agent played by Malaysian actress Michelle Yeoh, a sort of female Jackie Chan who could well have out-performed Brosnan in the action scenes. The other was a terrific small role for Vincent Schiavelli as Dr. Kaufman, expert in torture and other infamous arts. Schiavelli has one short delectable scene in a role that cried out to be expanded. Also there is a totally lackluster and boring acting job by Bond's car. The scenes in which the car appears look like second rate automobile ads, which by an odd coincidence is exactly what they are. (I would not mention that here, but since the filmmakers accepted all that nice money from the manufacturer to pose the car so much more carefully than they pose any of the human characters, I feel obliged to review the car's performance.)
As a director Roger Spottiswoode is, well, spotty. His UNDER FIRE was a very solid political film. His made for cable adaptation of AND THE BAND PLAYED ON was a high-point of its year. Let us not, however, dwell on his STOP! OR MY MOM WILL SHOOT. As a director of a Bond film he was only middling successful. He should have exerted more control on the script, making it more intelligent and refusing the product placements. David Arnold has written an acceptably John Barry-sounding score built around Barry's James Bond theme (credited falsely to Monty Norman).
TOMORROW NEVER DIES is below average for the Bond films to date. They never even bother to tell the viewer what the title means. I rate the new Bond film a 5 on the 0 to 10 scale and a high 0 on the -4 to +4 scale
Just so the reader can know what my values are in Bond films I would rate the Bond film best to worse as: 1. FROM RUSSIA WITH LOVE 2. ON HER MAJESTY'S SECRET SERVICE 3. THUNDERBALL 4. DR. NO 5.  GOLDFINGER 7. FOR YOUR EYES ONLY 8.  THE LIVING DAYLIGHTS 10. THE SPY WHO LOVED ME 11. OCTOPUSSY 12. TOMORROW NEVER DIES 13. GOLDENEYE 14. DIAMONDS ARE FOREVER 15. THE MAN WITH THE GOLDEN GUN 16.  MOONRAKER 18. LIVE AND LET DIE
Mark R. Leeper<EMAIL_ADDRESS>Copyright 1997 Mark R. Leeper
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


Linux Command Line Shell
Shell
What is Shell?
Quoting from wikipedia
A Unix shell is a command-line interpreter or shell that provides a traditional Unix-like command line user interface. Users direct the operation of the computer by entering commands as text for a command line interpreter to execute, or by creating text scripts of one or more such commands. Users typically interact with a Unix shell using a terminal emulator, however, direct operation via serial hardware connections, or networking session, are common for server systems. All Unix shells provide filename wildcarding, piping, here documents, command substitution, variables and control structures for condition-testing and iteration
- Interprets user commands
- from terminal, from a file or as a shell script
- expand wildcards, command/variable substitution
- Command history, command completion and command editing
- Managing processes
- Shell variables to customize the environment
- Difference between shell, tty and console
Popular Shells
Like any indispensible software, Shell has undergone transformation from the days of basic sh
shell that was used in 1970s Unix. While bash
is default shell in most distros and most commonly used, powerful and feature rich shells are still being developed and released
sh
bourne shell (light weight Linux distros might come withsh
shell only)bash
bourne again shellcsh
C shelltcsh
tenex C shellksh
Korn shellzsh
Z shell (bourne shell with improvements, including features from bash, tcsh, ksh)cat /etc/shells
displays list of login shells available in the current Linux distroecho $SHELL
path of current user’s login shell- The material presented here is primarily for interactive shell
- difference between login shell and non-login shell
Further Reading
- Comparison of command shells
- Features and differences between various shells
- syntax comparison on different shells with examples
bash
shell has also been ported on Windows platform- Shell, choosing shell and changing default shells
Wildcards
It is easy to specify complete filenames as command arguments when they are few in number. But suppose, one has to delete hundreds of log files, spread across different sub-directories? Wildcards, or also known as globbing patterns help in such cases, provided the filenames have a commonality to exploit. We have already seen regular expressions used in commands like grep
and sed
. Shell wildcards are similar but has fundamental and syntactical differences
*
match any character, 0 or more times- as a special case,
*
won’t match the starting.
of hidden files and has to be explicity specified
- as a special case,
?
match any character exactly 1 time[aeiou]
match any vowel character[!aeiou]
exclude vowel characters, i.e match a consonant[!0-9]
match any character except digits[a-z]
match any lower case alphabets[0-9a-fA-F]
match any hexademical character{word1,word2}
match either of the specified words- words can themselves be made of wildcards
Examples
ls txt*
list all files starting with txtls *txt*
list all files containing txt anywhere in its namels *txt
list all files ending with txt in the current directoryls -d .*
list only hidden files and directoriesrm *.???
remove any file ending with . character followed by exactly three charactersls bkp/201[0-5]
list files in bkp directory matching 2010/2011/2012/2013/2014/2015echo *txt
for dry runs, useecho
command to see how the wildcard expands
Brace Expansion
ls *{txt,log}
list all files ending with txt or log in the current directorycp ~/projects/adders/verilog/{half_,full_}adder.v .
copy half_adder.v and full_adder.v to current directorymv story.txt{,.bkp}
rename story.txt as story.txt.bkpcp story.txt{,.bkp}
to create bkp file as well retain originalmv story.txt{.bkp,}
rename story.txt.bkp as story.txtmv story{,_old}.txt
rename story.txt as story_old.txttouch file{1..4}.txt
same astouch file1.txt file2.txt file3.txt file4.txt
touch file_{x..z}.txt
same astouch file_x.txt file_y.txt file_z.txt
rm file{1..4}.txt
same asrm file1.txt file2.txt file3.txt file4.txt
echo story.txt{,.bkp}
displays the expanded version ‘story.txt story.txt.bkp’ , useful to dry run before executing actual command
Extended globs
From info bash
, where pattern-list
is a list of one or more patterns separated by a |
?(pattern-list)
Matches zero or one occurrence of the given patterns*(pattern-list)
Matches zero or more occurrences of the given patterns+(pattern-list)
Matches one or more occurrences of the given patterns@(pattern-list)
Matches one of the given patterns!(pattern-list)
Matches anything except one of the given patterns
To check if extglob
is enabled or to enable/disable:
$ shopt extglob
extglob on
$ # unset extglob
$ shopt -u extglob
$ shopt extglob
extglob off
$ # set extglob
$ shopt -s extglob
$ shopt extglob
extglob on
Examples
$ ls
123.txt main.c math.h power.log
$ echo +([0-9]).txt
123.txt
$ ls @(*.c|*.h)
main.c math.h
$ ls !(*.txt)
main.c math.h power.log
$ ls !(*.c|*.h)
123.txt power.log
Recursively search current directory and its sub-folders
Set globstar
and prefix pattern with **/
to search recursively
$ find -name '*.txt'
./song_list.txt
./bar/f1.txt
./bar/baz/f2.txt
$ shopt -s globstar
$ ls **/*.txt
bar/baz/f2.txt bar/f1.txt song_list.txt
Further Reading
- Glob
- See topic ‘Pathname Expansion’ in
info bash
- brace expansion wiki
- when to use brace expansion
Redirection
By default all results of a command are displayed on the terminal, which is the default destination for standard output. But often, one might want to save or discard them or send as input to another command. Similarly, inputs to a command can be given from files or from another command. Errors are special outputs generated on a wrong usage of command or command name
<
or0<
is stdin filehandle>
or1>
is stdout filehandle2>
is stderr filehandle
Redirecting output of a command to a file
grep -i 'error' report/*.log > error.log
create new file, overwrite if file already existsgrep -i 'fail' test_results_20mar2015.log >> all_fail_tests.log
creates new file if file doesn’t exist, otherwise append the result to existing file./script.sh > /dev/null
redirect output to a special file/dev/null
that just discards everything written to it, whatever may be the size-
[explicitly override the setting of noclobber with the > redirection operator](https://unix.stackexchange.com/questions/45201/bash-what-does-do/45203#45203)
Redirecting output of a command to another command
ls -q | wc -l
the ‘pipe’ operator redirects stdout ofls
command towc
command as stdindu -sh * | sort -h
calculate size of files/folders, display size in human-readable format which is then sorted./script.sh | tee output.log
thetee
command displays standard output on terminal as well as writes to file
Combining output of several commands
(head -5 ~/.vimrc ; tail -5 ~/.vimrc) > vimrc_snippet.txt
multiple commands can be grouped in()
and redirected as if single command output- commands grouped in
()
gets executed in a subshell environment
- commands grouped in
{ head -5 ~/.vimrc ; tail -5 ~/.vimrc ; } > vimrc_snippet.txt
gets executed in current shell context- Command grouping
Command substitution
sed -i "s|^|$(basename $PWD)/|" dir_list.txt
add current directory path and forward-slash character at the start of every line- Note the use of double quotes to perform command substitution
file_count=$(ls -q | wc -l)
save command output to a variable- Command Substitution
Process Substitution
comm -23 <(sort file1.txt) <(sort file2.txt)
allows to create named pipes, effectively avoiding need to create temporary files- Process Substitution
- input and output process substitution examples
Redirecting error
xyz 2> cmderror.log
assuming a non-existent commandxyz
, it would give an error and gets redirected to specified file./script.sh 2> /dev/null
discard error messages
Combining stdout and stderr
Assume that the file ‘report.log’ exists containing the text ‘test’ and non-existing file ‘xyz.txt’
Bash version 4+:
grep 'test' report.log xyz.txt &> cmb_out.txt
redirect both stdout and stderr to a filegrep 'test' report.log xyz.txt &>> cmb_out.txt
append both stdout and stderr to a filels report.log xyz.txt |& grep '[st]'
redirect both stdout and stderr as stdin
Earlier versions:
grep 'test' report.log xyz.txt > cmb_out.txt 2>&1
redirect both stdout and stderr to a filegrep 'test' report.log xyz.txt 2> cmb_out.txt 1>&2
redirect both stdout and stderr to a filegrep 'test' report.log xyz.txt >> cmb_out.txt 2>&1
append both stdout and stderr to a filels report.log xyz.txt 2>&1 | grep '[st]'
redirect both stdout and stderr as stdin
Redirecting input
tr a-z A-Z < test_list.txt
convert lowercase to uppercase,tr
command only reads from stdin and doesn’t have the ability to read from a file directlywc -l < report.log
useful to avoid filename inwc
output< report.log grep 'test'
useful to easily modify previous command for different command options, search patterns, etcgrep 'test' report.log | diff - test_list.txt
output ofgrep
as one of the input file fordiff
command- difference between « , «< and < <
Using xargs to redirect output of command as input to another command
grep -rlZ 'pattern' | xargs -0 sed -i 's/pattern/replace/'
search and replace only those files matching the required pattern (Note: search pattern could be different forgrep
andsed
as per requirement)- the
-Z
option would print filename separated by ASCII NUL character which is in turn understood byxargs
via the-0
option. This ensures the command won’t break on filenames containing characters like spaces, newlines, etc
- the
- When to use xargs
- has a good example for parallel processing jobs with xargs
Further Reading
- See topic ‘REDIRECTION’ in
info bash
- stdin, stdout and stderr
- Illustrated Redirection Tutorial
- short introduction
- redirect a stream to another file descriptor using >&
- difference between 2>&1 >foo and >foo 2>&1
- redirect and append both stdout and stderr to a file
- Redirections explained
Process Control
Process
is any running program- Program is a set of instructions written to perform a task
Daemon
to simply put, are background processesJob
in Shell parlance is a process that is not a daemon, i.e an interactive program with user control
ps
report a snapshot of the current processes
- First column indicates the process id (PID)
-e
select all processes-f
full-format listing- ps Q&A on unix stackexchange
- ps Q&A on stackoverflow
- ps tutorial
kill
send a signal to a process
kill -l
list signal nameskill PID
send default ‘SIGTERM’ signal to a process (specified by the PID) asking the process to terminate- gracefully shutdown processes
- why kill -9 should be avoided
- kill Q&A on unix stackexchange
- kill Q&A on stackoverflow
- See also
pkill
andkillall
commands
top
display Linux processes
- Press
M
(uppercase) to sort the processes by memory usage - Press
q
to quit the command - Press
W
(uppercase) to write your favorite view of top command to~/.toprc
file and quit immediately, so that next time you use top command, it will display in the format you like - htop is better/prettier alternative to top
- install instructions here
- top Q&A on unix stackexchange
free
Display amount of free and used memory in the system
free -h
shows amount of free and used memory in human readable format
pgrep
look up or signal processes based on name and other attributes
pgrep -l foobar
search for process names containing foobar, displays PID and full process namepgrep -x gvim
search for processes exactly named gvimpgrep -c chrom
total number of processes matching chrompgrep -nl chrom
most recently started process matching chrom
Further Reading
- Process Management
- Managing Linux Processes
- Linux Processes
- what is daemon
- Job Control commands
- Useful examples for top command
Running jobs in background
Often commands and scripts can take more than few minutes to complete, but user might still need to continue using the shell. Opening a new shell might not serve the purpose if local shell variable settings are needed too. Shell provides the &
operator to push the commad (or script) execution to background and return the command prompt to the user. However, the standard outputs and errors would still get displayed on the terminal unless appropriately redirected
tkdiff result_v1.log result_v2.log &
tkdiff, if installed, shows differences between two files in a GUI. If&
is not used, the program would hog the command prompt
Pushing current job to background
What if you forgot to add &
and using kill
on the process might corrupt lot of things?
Ctrl+z
suspends the current running jobbg
push the recently suspended job to background- Continue using shell
fg
bring the recently pushed background job to foregroundjobs
built-in command - Display status of jobsnohup
command - run a command immune to hangups, with output to a non-tty- job control


Dundee striker Kane Hemmings gets right behind club’s bid for stability
Dundee striker Kane Hemmings has thrown his support behind the club’s bid for stability.
by Ian RoacheDark Blues boss James McPake stated this week that there will be no big turnaround in players during the January transfer window as he aims for a settled squad.
Hemmings is right behind the plan as he and his teammates prepare to take on Inverness Caley Thistle in the Highland capital this afternoon.
He believes halting ther revolving door will benefit him personally and the club generally.
The English frontman said: “I came back here to get stability because I didn’t want to keep jumping around clubs.
“I wanted to be somewhere, put down roots and be there for a long time.
“I went down to England and moved around but I don’t want to do that any longer.
“I don’t want to be heading to a new club regularly and have to move, meet new managers, new teammates and new staff.
“I want somewhere where you can spend a bit of time.
“That’s from both a football perspective and from a personal life point of view.
“You want to get settled somewhere because that’s when you play your best football,” added Hemmings, who counts Rangers, Cowdenbeath, Barnsley, Oxford, Mansfield (loan) and Notts County among his former clubs.
“I think the club needs that stability, too, and it was clear that’s what they want when I was speaking to the gaffer about coming here.
“There is a lot to be said for getting a group of players and sticking with them for a period of time.
“Seeing the same faces, getting that familiarity on and off the pitch can be really valuable.
“Success doesn’t come immediately but if you stick with a group and with an idea, then you get your rewards for that.”
While city neighbours Dundee United got the core of their squad in by last January, relegation meant wholesale change was the scenario for Dundee over the close season.
Hemmings said: “Our team was only put together in the summer but I can see a group which could be together for a while.
“We are getting to know each other properly and you can feel things coming together.
“Nothing has changed too much round the club compared to when I left.
“It’s the same training ground most days, the same people around the club, it’s just the dressing-room is different.
“Obviously we are in a different league and the aim has to be to get out of it now.”
The derby result left a cloud over the club but Hemmings insists they are ready to go again today.
He said: “Dundee United are ahead of us at the moment but we have a chance to get three points closer with the game in hand this weekend.
“All we can do is just try to win our games and then after that you look and see what other clubs do.
“If you win and they lose then great, if you both win then so be it and you go again the next week.
“That’s all you can do.
“In this league there will be a lot of shock results over the next few months.
“Arbroath are up in fifth place which has surprised a lot of people but it shouldn’t really because they have good players.
“They are capable of beating anyone in this league just like Partick Thistle, who are bottom but shouldn’t be there.
“It is massively competitive and such a hard league to get out of.”
Hemmings admits that there have been both good and bad times since he returned to the club.
“That has been the case for the team and for me personally,” he said.
“Some days we have been good, others not so good like in the derby.
“It is about becoming consistent now because you need to get a run together at this time of year.
“It’s easy to sit back and say there are loads of games left but I always feel it’s at this time of year they start coming thick and fast.
“Before you know it, it is the new year and you are heading into the real business end of the season.”


Configuring a List
How to configure the Form and List module as a list. Note: Before the Form and List module is configured it displays message: "Create a new Form or List based on a template from the list above, or design your own in Form and List Configuration."
- Click the Configuration button - OR - Select Edit > Form and List Configuration from the module actions menu.
- Select the Page Related Settings tab.
- Expand the Current View Options section.
- At Appearance, select List. This will be pre-selected.
- At Actions as Buttons, to use buttons as well as the module action menu for actions such as "Show Records" (the default setting) - OR - to only use the action menu.
- Expand the List Settings section.
- At Rendering Method, select from these options:
- Default Grid Table. Select to create a list using the default layout and CSS classes provided with this module.
- XSLT: Select to use a custom layout and CSS classes. You will need an XSL script.
- At XSL Script, set the link to an uploaded XSLT file (See "Setting a File Link") - OR - Upload a new XSLT file (See "Uploading and Linking to a File")
- Optional. Go to the Sorting Options section and set the sorting for this list. Until you have added columns to the list, only the four default columns will be listed, therefore it is best to set sorting options once columns have been added. If these settings are not configured the default options are applied. See "Setting List Sorting Options"
- Optional. Go to the Search and Filter Options section and set the search and filtering options for this list. If these settings are not configured the default options are applied. See "Setting List Search and Filter Options"
- Click the Save Configuration and Return button to return to the module. The module now displays the yellow warning "There are no columns defined. Setup the module inside the Form and List Configuration."
You must now complete the following:
- Set the roles and users who can add and manage list records. See "Setting List Permissions"
- Define the columns for this list. See "Creating a Form or List"
The following additional options are available for configuring a list:
-
See "Setting List Search and Filter Options"
-
See "Setting List Sorting Options"


ATTN:MD/CEO SIR, I am a refugee at the Budumbura refugee camp here in Accra(Ghana).I got your contact from an email directory and decided to contact you for assistance. I am the son of Jonas Savimbi the rebel leader in Angola who was short dead on the 25th of February, 2002, by the opposing Angolan Army.Before the death of my father he had deposited the sum of $27,000,000.00(Twenty Seven Million Dollars)in a Security Company in West Africa (Ghana) Which all the legal documents for the deposit are with me which my father gave to me for safe keeping. After the death of my father I and my family fled to West Africa (Ghana) where we are currently living. And we have been trying to fly out of Africa but it has been difficult for us to get visas from Africa. So we want you to help us make claims of this fund ($27M) in Ghana as my family beneficiary and transfer the money to your account or any account of your choice before I and my family can get visas to fly down to your country so that we can share this money. My family have agreed to give you 10%, which would be ($2.7 Million dollars)of this Money for your assistance, and 87% would be for us and the other 3% would be set aside for any expenses that we may incure during the course of this transaction. And part of our share of 87% would be invested in your country in any profitable business proposed by you. While a large part of our share will also be used to help charity organizations. We have never met, but I want to trust you and please do not let us down when this fund finally gets into your account.And I want you to promise me that you will not run away with the money or sit on it. Please if you are interested; get to me through my email address to enable me feed you with more details and all necessary documentations.Please treat this as confidential Regards JOHN SAVIMBI N/B THIS MY ALTERNATIVE EMAIL ADDRESS( johnsavimbi8@yahoo.co.uk)


This class can allocate different size of memory, but can deallocate it only with a marker. Copy and move constructors and assignments are unavailable.
More...
#include <StackAllocator.hpp>
|
| | Allocator (void *memory, const size_t &size) |
| | Constructor for child classes. More...
|
| |
|
void * | mMemory |
| |
|
size_t | mSize |
| |
This class can allocate different size of memory, but can deallocate it only with a marker. Copy and move constructors and assignments are unavailable.
| mfg::StackAllocator::StackAllocator |
( |
void * |
memory, |
|
|
const size_t & |
size |
|
) |
| |
Constructor.
- Parameters
-
| memory | The beginning of the memory. |
| size | The size of the memory. |
| void * mfg::StackAllocator::allocate |
( |
const size_t & |
size | ) |
|
|
virtual |
Allocates memory with the specified size.
- Parameters
-
- Returns
- The beginning of the memory.
Implements mfg::Allocator.
| void mfg::StackAllocator::deallocate |
( |
void * |
memory | ) |
|
|
virtual |
In this class this method is not working. Use void deallocateTo(void* memory) instead.
- Parameters
-
do nothing, because you have to use deallocateTo
Implements mfg::Allocator.
| void mfg::StackAllocator::deallocateTo |
( |
Marker |
marker | ) |
|
Deallocate all the items next to marker.
- Parameters
-
| Marker mfg::StackAllocator::getMarker |
( |
| ) |
|
- Returns
- The current marker.
The documentation for this class was generated from the following files:


Developed by James Tauber and Patrick Altman. Open-sourced under an MIT License. Contributions welcome. Github Repository


This package contains the implementation of the Command pattern.
The actions provided by an application can be implemented as Command
objects. Such an object has a well-defined interface (namely the
Command
interface) and will be run in a separate thread. This is
important for the application to stay responsive even when it executes complex
tasks.
The CommandQueue
interface allows executing command objects: just
pass an object implementing the Command
interface to its
execute()
method. It will then be executed by a working thread (as
soon as one becomes available). The Command
interface provides some
methods that define a kind of life-cycle for a command object. In addition to
the main execute()
method that contains the main logic of the
command methods for error handling are available. There is also support
for updating the GUI after the execution of the command. Special care has to be
taken about this topic because GUI updates must be performed by the event
dispatch thread only.
Interested components can register itself as CommandQueueListener
s
at a command queue object. They will then receive notifications when commands
are executed or the status of the queue changes.
$Id: package.html 205 2012-01-29 18:29:57Z oheger $


Relay allows you to push graphics in Figma straight to your GitHub Repo.
No more zipping or emailing graphics.
Your well-oiled machine doesn’t have to break down due to complex build processes, or lack of time to enforce consistency. Relay builds a connection that allows designers to make graphical changes live in an instant.
Relay reduces file size in transit.
Running graphics through post-Figma production processes is something Relay is uniquely capable of handling. Today, Relay automatically crunches your file sizes down, but we’ve got even more workflows coming.
No more hand-off meetings. Once a connection is made between Figma, Relay, and GitHub, graphic changes can be made whenever—you’ll never need to bug your development team again.
Our routing system is flexible for when projects grow, shrink, or pivot. Export assets to multiple folders, in as many sizes and formats as you need to meet requirements for most architectures.
Finally, designers can have a process that dovetails with engineering. Push with a single click, and Relay will create and commit to branches, and open Pull Requests.
Your First Relay Project
Up to 10 Relay Projects
Unlimited Relay Projects
Team Plans are coming soon. What’s after that? You tell us.


2020 Jaguar XE sedan to be launched in India on December 4
by Aditya JadhavThe 2020 Jaguar XE broke cover earlier this year and now the manufacturer is all set to launch the sedan in India on December 4, 2019. For its midlife update, the 2020 XE gets cosmetic tweaks and updated interiors.
Cosmetic changes include an aggressively styled fascia with all-LED headlamp units. The new car sits on a set of newly designed 18-inch alloy wheels but the company is likely to continue offering the 17-inch wheel size as well in India.
The interiors are updated and the 10-inch infotainment system in the current car has been replaced for a larger 12.3-inch infotainment system. The cabin also features first in segment ClearSight rear-view mirror. Jaguar has done away with the gear selector dial and now offers a stick for the same. The artificial intelligence of the new Jaguar XE learns the preferences of individual drivers and adjusts seat, mirrors, audio and climate settings automatically.
The engines on offer will be the petrol and diesel units from the Ingenium series. Internationally, the XE is available in a rear-wheel drive and an all-wheel drive drivetrain layout but the latter one is unlikely to be offered in the Indian market.
Currently, the Jaguar XE is sold with two engine options - 2.0-litre petrol engine producing 200PS between 4,500-6,000rpm and 320Nm of torque between 1,200-4,500rpm. The top-spec Portfolio has a higher output of 250PS at 5,500rpm and 365Nm between 1,200-4,500rpm.
The 2.0-litre diesel engine has a power rating of 180PS at 4,000rpm and 430Nm of torque between 1,750-2,500rpm. Both the engines come mated to an 8-speed automatic gearbox. The company could continue to offer the same drivetrain, however, with BSVI compliant state of tune.
The 2020 Jaguar XE could ask a premium of Rs 2-3 lakh over the current car's pricing and could retail between Rs 43-49 lakh, ex-showroom. The XE will continue its rivalry in the segment with the Audi A4, Mercedes-Benz C-Class and the recently launched BMW 3 series.
Also Read,
Tata Motors will not sell off Jaguar Land Rover
Jaguar Vision Gran Turismo is a virtual racecar for your Playstation 4
Jaguar Land Rover's new 430 lakh sq.ft product creation facility opens in Gaydon, England


Benchmark results are always dependent on a very individual setup. Normally it is not useful to generalize such results for every use case, but it can give you a hint. However, if you're really in the need of maximum performance, you should probably create an own benchmark with your objects or even use a profiler to detect the real hot spots in your application.
XStream uses the Java Microbenchmark Harness (JMH) of the JDK Tools as benchmark framework starting with version 1.4.9. As result it contains a ZIP file (xstream-jmh-<version>-app.zip) as new artifact containing anything required to run the benchmarks. Unpack the file and use the scripts in the bin directory to execute the benchmarks. Use option -h to look at the options provided by JMH. You may exchange the libraries in the lib directory with other versions of XStream or the individual parsers or you may even add new JMH benchmarks to the default ones of XStream.
All benchmark values below measure the average throughput in nanosecond per operation. JMH provides additional measurement options, see online help. The maximum deviation for each benchmark is recorded in the reference files of the distributed ZIP file. The benchmark is executed on Linux 4.14.65 Gentoo 64-bit system with an Intel Core i7 CPU 920 of 2.67 GHz. Note again, that these values are no replacement for real profiler results and they may vary from run to run (see reference files) due to this machine's background processes. However, it can give you some idea of what you can expect using different parser technologies.
The values represent the average throughput of 15 runs with a single thread. The benchmarks emphasis the parser efficiency for different structures.
| Parser | Text | Array | Nested |
|---|---|---|---|
| W3C DOM (Oracle JDK 1.8.0_181) | 9710278.896 | 53954694.751 | 5148010.389 |
| JDOM (1.1.3) | 6387821.035 | 6898339.792 | 14111857.552 |
| JDOM 2 (2.0.5) | 5921949.583 | 8723291.385 | 10579620.188 |
| DOM4J (1.6.1) | 7452345.867 | 93099746.029 | 5533035.930 |
| XOM (1.1) | 8204769.944 | 42486494.920 | 8086714.065 |
| StAX (BEA 1.2.0) | 2879876.995 | 666062.149 | 572549.126 |
| StAX (Woodstox 3.2.7) | 1845769.311 | 632147.776 | 604788.852 |
| StAX (Oracle JDK 1.8.0_131) | 7444273.102 | 706572.092 | 617636.917 |
| XPP (Xpp3 min 1.1.4c) | 2155470.575 | 661082.180 | 12444913.194 |
| XPP (kXML2 min 2.3.0) | 3663477.841 | 854613.418 | 34372562.351 |
| Binary (XStream 1.4.10) | 1129812.942 | 383203.739 | 260233.635 |
| Jettison (1.2) | 3016232.225 | 555908.503 | 619961.028 |
The values represent the average throughput of 16 runs with four threads using the Xpp3 parser for a structure with 1.000 elements. The benchmarks demonstrate the different converter types that can be used for a standard Java class.
| Converter Type | Throughput |
|---|---|
| Custom | 9176744.283 |
| Java Bean | 18353984.976 |
| Reflection | 23371721.858 |
The values represent the average throughput of 16 runs with four threads using the Xpp3 parser for a structure with 10.000 string elements of various sizes and duplicates. The benchmarks demonstrate different implementations and configurations of the StringConverter.
| StringConverter Strategy | Throughput |
|---|---|
| No Cache | 9422597.717 |
| Intern | 12576002.757 |
| ConcurrentMap (length limit) | 10411028.373 |
| ConcurrentMap (unlimited) | 10666492.267 |
| Sync'd WeakCache (length limit) | 10948390.386 |
| Sync'd WeakCache (unlimited) | 11917404.787 |
The values represent the average throughput of 25 runs with four threads using the Xpp3 parser for a structure with 250 nested elements using names invalid for XML elements. The benchmarks demonstrate different implementation strategies for a NameCoder to create valid tag names in XML.
| NameCoder Implementation | Throughput |
|---|---|
| No Coding | 4190972.243 |
| Dollar Coding | 4621025.135 |
| Escaped Underscore Coding | 5896886.514 |
| Cached Escaped Underscore Coding | 4350643.046 |
| Xml Friendly Coding | 4938586.549 |


| pydoc (26 February 2001) | index /home/jirong/anaconda3/envs/quant/lib/python3.7/pydoc.py Module Reference |
Generate Python documentation in HTML or text for interactive use.
At the Python interactive prompt, calling help(thing) on a Python object
documents the object, and calling help() starts up an interactive
help session.
Or, at the shell command line outside of Python:
Run "pydoc <name>" to show documentation on something. <name> may be
the name of a function, module, package, or a dotted reference to a
class or function within a module or module in a package. If the
argument contains a path segment delimiter (e.g. slash on Unix,
backslash on Windows) it is treated as the path to a Python source file.
Run "pydoc -k <keyword>" to search for a keyword in the synopsis lines
of all available modules.
Run "pydoc -n <hostname>" to start an HTTP server with the given
hostname (default: localhost) on the local machine.
Run "pydoc -p <port>" to start an HTTP server on the given port on the
local machine. Port number 0 can be used to get an arbitrary unused port.
Run "pydoc -b" to start an HTTP server on an arbitrary unused port and
open a Web browser to interactively browse documentation. Combine with
the -n and -p options to control the hostname and port used.
Run "pydoc -w <name>" to write out the HTML documentation for a module
to a file named "<name>.html".
Module docs for core modules are assumed to be in
https://docs.python.org/X.Y/library/
This can be overridden by setting the PYTHONDOCS environment variable
to a different URL or to a local directory containing the Library
Reference Manual pages.
| Modules | ||||||
|
| Data | ||
| __all__ = ['help'] help = <pydoc.Helper instance> |
| Author | ||
| Ka-Ping Yee<EMAIL_ADDRESS>|
| Credits | ||
| Guido van Rossum, for an excellent programming language. Tommy Burnette, the original creator of manpy. Paul Prescod, for all his work on onlinehelp. Richard Chamberlain, for the first implementation of textdoc. |


MEPHAS is a shiny-based statistical software that was developed to support statistical data analyses for medical and pharmaceutical students, researchers, and doctors.
Two platforms are available: (1) web server and (2) R package.
We suggested to use the latest version of R and RStudio. The old version may not support some visualization functions
To install package from GitHub, we need R package “remotes”. Package “mephas” need to use some functions from “mephas.tools”, so we need to install 2 packages.
Note: upgrade="never"
: suppress the updates of the R packages, see details here; package “remotes” and “devtools” shared the same install_github
function, thus package “remotes” can be replaced by package “devtools”
Videos of the installation process on windows
Installing from “.tar.gz” file is not recommended. Users need to install two packages: “mephas.tools” and “mephas”. Some packages are also required.
> mephas.need.packages <- c("DescTools",
"DT",
"exactRankTests",
"dunn.test",
"ROCR",
"ggplot2",
"magrittr",
"psych",
"pls",
"plotly",
"reshape",
"shiny",
"shinythemes",
"shinyWidgets",
"survival",
"survminer",
"survAUC",
"spls")
> not.installed.packages <- mephas.need.packages[!(mephas.need.packages %in% installed.packages()[,"Package"])]
> not.installed.packages
Videos of the installation process on windows
Before open the applications, we need to load the package “mephas” together with “mephas.tools”
Then, you can open the applications as follows.
Continuous probability distribution, web server
Discrete probability distribution, web server
Linear regression, web server
Logistic regression, web server
Survival analysis, web server
Dimensional analysis 1, web server
Dimensional analysis 2, web server
More functions are under construction…


permalink: /404.html
KitKit's Place
It looks like that page doesn't exist. Click the button to go back to the Homepage.
Click to enlarge.
Go Back


The Choicescript IDE is a piece of software designed to aid people with the development of interactive novels (or games) using the Choicescript scripting language, developed by Dan Fabulich of Choice of Games LLC.
The Choicescript IDE is a third party product developed by CJW (of the COG forums) and is in no way officially endorsed by (or representative of) Choice of Games LLC.
If you have anything you want to say or ask about the application, please see the discussion thread below on the official Choice of Games forums.
If you've got a bug report, suggestion or even a complaint, feel free to post them there. You can also send me an email directly via the provided address.
Choicescript IDE Forum Thread
<EMAIL_ADDRESS>Please help us spread the word about Choicescript, Choice of Games and the Choicescript IDE.
Follow @CareyWilliamz
Follow @Choiceofgames
Tweet #Choicescript


Input Connector
Tests the literal
InputConnector
please choose
foo_b
foo_c
please choose
bar_b
bar_c


#comment Copyright 2016 Erik Neumann. All Rights Reserved. #comment Use of this source code is governed by the Apache License, Version 2.0. #comment See the LICENSE file and http://www.apache.org/licenses/LICENSE-2.0. #define #TOP_DIR ../.. #define #APP_PATH sims.springs.SingleSpringApp #include "#TOP_DIR/macros.html" #include "#TOP_DIR/macros_tab.html" #DOC_TYPE
#META_TAGS #HIDE_ALL #SITE_LOGOSecond version:
This demonstrates two independent versions of a simulation running simultaneoulsy on a single page. Also demonstrates customizing a simulation with JavaScript.
Current language is #LANGUAGE.
#PAGE_INFO #LOREM_IPSUM #LOAD_APP #SHOW_ALL #PAGE_FOOTER


BE GEEGLY: DON'T SHARE INTERNAL INFO WITH NON-GEEGLERS.
Goatlet Info
The server is working hard to teleport goat. Please appreciate it.
Serving at <IP_ADDRESS>:80
Docs (unrelated to getting flag, but fun):
For more information, see
Goatlet
If too many goats are teleported, see
b/31482.


Physalia course: An introduction to computational Bayesian methods using Stan
Instructors
Shravan Vasishth and
Bruno Nicenboim.
Dates and location
Taught at
Physalia.
March 25-29 2019. Our classroom is the seminar room “Ehrenbergsaal” of the Department of Biology, Chemistry, Pharmacy at the Freie Universität Berlin, Königin-Luise-Str. 1-3, 14195 Berlin-Dahlem. Our classroom is on the second floor.
Overview
In recent years, Bayesian methods have come to be widely adopted in all areas of science. This is in large part due to the development of sophisticated software for probabilisic programming; a recent example is the astonishing computing capability afforded by the language Stan (mc-stan.org). However, the underlying theory needed to use this software sensibly is often inaccessible because end-users don't necessarily have the statistical and mathematical background to read the primary textbooks (such as Gelman et al's classic Bayesian data analysis, 3rd edition). In this course, we seek to cover this gap, by providing a relatively accessible and technically non-demanding introduction to the basic workflow for fitting different kinds of linear models using Stan. To illustrate the capability of Bayesian modeling, we will use the R package RStan and a powerful front-end R package for Stan called brms.
Prerequisites
We assume familiarity with R. Participants will benefit most if they have previously fit linear models and linear mixed models (using lme4) in R, in any scientific domain. No knowledge of calculus or linear algebra is assumed, but basic school level mathematics knowledge is assumed (this will be quickly revisited in class).
Please install the following software before coming to the course
We will be using the software
R,
and
RStudio,
so make sure you install these on your computer.
You should also install the R package
rstan; the R package
brms.
Outcomes
After completing this course, the participant will have become familiar with the foundations of Bayesian inference using Stan (RStan and brms), and will be able to fit a range of multiple regression models and hierarchical models, for normally distributed data, and for lognormal, Poisson, multinomial, and Binomially distributed data. They will know how to calibrate their models using prior and posterior predictive checks; they will be able to establish true and false discovery rates to validate discovery claims, and to carry out model comparison using Bayes factors.
Course materials
Click here to download everything.
Solutions to exercises are not publicly available; they will only be provided to participants.
lecture notes:
- download pdf from here. These are provided only for reference for later reading; I don't expect participants to read these during the one-week course.
slides and exercises:
- 00 Frequentist review, 00 Comparison: Frequentist vs Bayesian methods
- 01 Foundations
- 01 Exercises
- 02 Introduction to Bayesian methods
- 02 Exercises
- 03 Linear Modeling
-
03.01 Exercises,
03.02 Exercises
- 04 Hierarchical Linear Models
- fake data generation function
- 04.01 Exercises,
04.02 Exercises
- 05 Model Comparison using Bayes Factor
- 05 code from slides
- 05.01 Exercises,
05.02 Exercises
case studies:
Three case studies (zip archive)..
Schedule
Mon-Fri:
- 9:30AM-11:00AM Lecture 1
- 11:00AM-11:30AM Coffee break
- 11:30AM-1:00PM Lecture 2
- 1:00AM-2:00PM Lunch break
- 2:00PM-3:30PM Lecture 3/Exercises
- 3:30:00PM-4:00PM Coffee break
- 4:00PM-5:30PM Lecture 4/Exercises (May end earlier than 5:30PM)
Note that on Tuesday evening a well-known Bayesian and an author of a classic textbbook,
Richard McElreath, is giving a talk in the
Berlin Bayesians meetup. He is talking about a topic we will cover in the coming days (Practical Principles in Applied Bayesian Data Analysis). *Note: You have to sign up to attend this event.* His lectures are always great; I recommend going. If all participants are going, we can end at 5PM on Tuesday.
- Monday: Foundations of Bayesian inference
Probability theory and Bayes' rule, Probability distributions, Understanding and eliciting priors, Analytical Bayes: Beta-Binomial, Poisson-Gamma, Normal-Normal
- Tuesday: Computational Bayes
Generating prior predictive distributions using RStan and R, Fake-data simulation for model evaluation, Sampling methods: Inverse sampling, Gibbs sampling, Random Walk Metropolis, Hamiltonian Monte Carlo
- Wednesday: Bayesian Modeling with Stan and brms
Introduction to Stan syntax, Introduction to brms, Linear models using RStan and brms, fake-data generation, true and false discovery rate
- Thursday: Regression modeling using Stan and brms
Generalized linear models, Model evaluation and calibration, Hierarchical linear models, Fake-data generation for hierarchical data, Posterior predictive checks,
- Friday: Model evaluation and comparison
Model comparison using Bayes factor,
Some instructive case studies and examples of models
Additional readings
R programming
- R for data science
- Efficient R programming.
Books
-
A Student's Guide to Bayesian Statistics, by Ben Lambert: A good, non-technical introduction to Stan and Bayesian modeling.
- Statistical Rethinking, by Richard McElreath: A classic introduction.
- Doing Bayesian Data Analysis, Second Edition:
A Tutorial with R, JAGS, and Stan, By John Kruschke: A good introduction specifically for psychologists.
Tutorial articles
-
brms tutorial by the author of the package, Paul Buerkner.
- Ordinal regression models in psychological research: A tutorial, by Buerkner and Vuorre.
Contrast coding tutorial, by Schad, Hohenstein, Vasishth, Kliegl.
-
Bayesian workflow tutorial, by Schad, Betancourt, Vasishth.
-
Linear mixed models tutorial, Sorensen, Hohenstein, Vasishth.
-
brms tutorial for phonetics/phonology, Vasishth, Nicenboim, Beckman, Li, Kong.
- Michael Betancourt's resources: These are a must if you want to get deeper into Stan and Bayesian modeling.
Some example articles from our lab that use Bayesian methods
-
Example random-effects meta-analysis.
-
Example of finite mixture models using Stan.
- Replication attempt of a published study.
- Bayesian analysis of relatively large-sample psycholinguistic experiment.


{% extends "moderation/moderators_base.html" %} {% load humanize i18n %} {% block page_title %}{% trans "Review Abuse Reports" %}{% endblock %} {% block review_abuse_active %}active{% endblock %} {% block moderators_content %} {% include "messages.html" %}
{% trans "Review abuse reports currently logged in the system. User's emails are provided in the event that you need to gather additional information to make an appropriate ruling - please only use them for this purpose." %}
{% trans "To help moderators make informed decisions (especially in the context of recurring reports), previous warnings are displayed on the accused user." %}
| {% trans "Date Lodged" %} | {% trans "Complaint made against" %} | {% trans "Complaint made by" %} | {% trans "Comments" %} | {% trans "Actions" %} |
|---|---|---|---|---|
| {{ report.logged_datetime|date:"M d, Y" }} |
{{ report.logged_against.get_full_name|title }} {{ report.logged_against.email }} {% if report.prior_warnings %} {% blocktrans count c=report.prior_warnings|length with count=report.prior_warnings|length|apnumber|title trimmed %} {{ count }} prior warning {% plural %} {{ count }} prior warnings {% endblocktrans %} {% endif %} |
{{ report.logged_by.get_full_name|title }} {{ report.logged_by.email }} |
{{ report.abuse_comment|linebreaksbr|truncatewords_html:20 }} {% if report.abuse_comment|wordcount > 21 %} {% trans "Read More" %} {% endif %} {{ report.abuse_comment|linebreaksbr }} | {% trans "Dismiss Report" %} {% trans "Warn User" %} {% trans "Ban User" %} |
{% trans "There are currently no abuse reports logged in the system" %}.
{% endif %} {% endblock %}


I have my emontx connected via serial link on my Rpi on the ttyAMA0. I am trying to run the pylink.py script and seem to work at least for one or two updates. Then it fails showing the message below.
pi@raspberrypi ~ $ ./pylink.py
0 8 2 3236
ok
5 9 2 3236
Traceback (most recent call last):
File "./pylink.py", line 44, in <module>
response = conn.getresponse()
File "/usr/lib/python2.7/httplib.py", line 1034, in getresponse
response.begin()
File "/usr/lib/python2.7/httplib.py", line 407, in begin
version, status, reason = self._read_status()
File "/usr/lib/python2.7/httplib.py", line 371, in _read_status
raise BadStatusLine(line)
httplib.BadStatusLine: ''
Obviously I believe my variables (apikey, serial etc...) in the python script are correct since it does succeed for at least one update (or scan).
I have tried adding a try statement to get the http request to be sent again but that still fails. According to my searches on the web this is failing when it gets a response from the server it does not understand. My apikey and domain variable both point to the Rpi http server (emoncms) itself.
Any ideas?
Re: pylink.py fails after couple of updates
Solved it. The request string seem to miss a carriage return in the end. I modified the end of the script like so below:
# Send to emoncms
#conn.request("GET", "/"+emoncmspath+"/input/post.json?apikey="+apikey+"&node="+str(nodeid)+"&csv="+csv)
conn.request("GET", "/%s/input/post.json?apikey=%s&node=%s&csv=%s\n" % (emoncmspath,apikey,str(nodeid),csv))
response = conn.getresponse()
print response.read()
It's been working solid for a while now.


server = org.apache.openejb.server.discovery.MultipointDiscoveryAgent
bind = <IP_ADDRESS>
port = 4212
disabled = false
initialServers = <IP_ADDRESS>:4212, <IP_ADDRESS>:4212, <IP_ADDRESS>:4212
Multipoint (TCP) Discovery
As TCP has no real broadcast functionality to speak of, communication of who is in the network is achieved by each server having a physical connection to each other server in the network.
To join the network, the server must be configured to know the address of at least one server in the network and connect to it. When it does both servers will exchange the full list of all the other servers each knows about. Each server will then connect to any new servers they’ve just learned about and repeat the processes with those new servers. The end result is that everyone has a direct connection to everyone 100% of the time, hence the made-up term "multipoint" to describe this situation of each server having multiple point-to-point connections which create a fully connected graph.
On the client side things are similar. It needs to know the address of at least one server in the network and be able to connect to it. When it does it will get the full (and dynamically maintained) list of every server in the network. The client doesn’t connect to each of those servers immediately, but rather consults the list in the event of a failover, using it to decide who to connect to next.
The entire process is essentially the art of using a statically maintained list to bootstrap getting the more valuable dynamically maintained list.
Server Configuration
In the server this list can be specified via the
conf/multipoint.properties
file like so:
The above configuration shows the server has an port
4212
open for
connections by other servers for multipoint communication. The
initialServers
list should be a comma separated list of other similar
servers on the network. Only one of the servers listed is required to be
running when this server starts up — it is not required to list all
servers in the network.
Client Configuration
Configuration in the client is similar, but note that EJB clients do not
participate directly in multipoint communication and do not connect to
the multipoint port. The server list is simply a list of the regular
ejbd://
urls that a client normally uses to connect to a server.
Properties p = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.RemoteInitialContextFactory");
p.put(Context.PROVIDER_URL, "failover:ejbd://<IP_ADDRESS>:4201,ejbd://<IP_ADDRESS>:4201");
InitialContext remoteContext = new InitialContext(p);
Failover can work entirely driven by the server, the client does not need to be configured to participate. A client can connect as usual to the server.
Properties p = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.RemoteInitialContextFactory");
p.put(Context.PROVIDER_URL, "ejbd://<IP_ADDRESS>:4201");
InitialContext remoteContext = new InitialContext(p);
If the server at <IP_ADDRESS>:4201
supports failover, so will the
client.
In this scenario the list of servers used for failover is supplied
entirely by the server at <IP_ADDRESS>:4201
. The server could have
aquired the list via multicast or multipoint (or both), but this detail
is not visible to the client.