Вы находитесь на странице: 1из 12

/DAVE/NEXT

GUITA R .   S CIENCE. COMPUTER STUFF.   G A M B I T E E R .   S O M E T I M E S   I   G E T   T H I N G S   R I G H T.

Home Archives

Some Interesting Tek Readings


2018‑06‑30

Golden Rules of Typography on the Web


Building AR/VR with Javascript and HTML
Node.js Guide for Frontend Developers
Drawing Images With CSS Gradients — HTML and CSS are so mature now
that they are becoming a fun playground. Animations, transitions,
drawing images… you name it.
Object detection with 10 lines of code — Interesting approach, but… not
really 10 lines of code, just calling library functions doesn’t make it
simple.
7 Performance Tips for Jank‑free JavaScript Animations
And a couple that ar not really tek related

How to Steel 50 Million Bees — An amazing story about an industry that


is so invisible 99% of the time.
Are we stuck with cement? How one of the biggest industries in the
world is not doing its part in getting a sustainable environment. Read
and think about it. You next sustainable project might not be as clean as
one thinks.

web #javascript, #html, #css, #performance, #ar/vr, #machine vision

Why Is the for Loop Faster in This Javascript?


2018‑06‑12

I’ve measured and tested and what not javascript loops and always came
to the conclusion that we don’t know how Javascript is going to behave.
In the following example function f1 is substantially faster than
function f2 . Can’t understand why.

1 function tic() {
2 the_time = performance.now()
3 }
4
5 function toc() {
6 console.log(performance.now() - the_time)
7 }
8
9 function f1(z) {
10 let len = z;
11 let buff = []
12 for (let i = 0; i < len; i++) {
13 buff[i] = i;
14 }
15 return buff;
16 }
17
18 function f2(z) {
18 function f2(z) {
19 let len = z;
20 let buff = []
21 while (len--) {
22 buff[len] = len;
23 }
24 return buff
25 }
26 tic(); f1(2 << 20); toc();
27 tic(); f2(2 << 20); toc();

Your Results:
f1: 86
f2: 195
Normally I would say that the reversed while would be faster. It has been
in other instances. But in this case we want to create an array with
numbers from 0 to z-1 . In this case the for loop is much faster
(tested in Chrome, Firefox, Opera). What is going on? Is it a caches
problem where JS engines expect the “straight” order and not the
reverse one?
update

What if we pre‑allocate the size of the buffer before iterating over it as


in function f2 . This would lead to the new function f2_new

1 function f2_new(z) {
2 var len = z;
3 var buff = [];
4 buff.length=len;
5 while (len--) {
6 buff[len] = len;
7 }
8 return buff;
9 }

Notice that I’m creating a buffer with the correct length before looping
over it. If you run this version you’ll get the fastest while loop.
f2_new: 91
This version is now on par with the for loop and in some benchmarks it
is substantially faster. So, order restored in the realm of Javascript. Me
happy again.

programming #loops, #arrays, #testing, #javascript

Quick Way to Use Jeromq in Eclipse


2018‑05‑21

1. Download a jeromq JAR from the maven repository (current version


0.4.3)
https://mvnrepository.com/artifact/org.zeromq/jeromq/0.4.3
2. Place the jar file in a “lib” folder in your project.
3. Add jeromq.jar to your project libraries in the Project Build Path
4. Try the simple hwserver/hwclient examples
https://github.com/zeromq/jeromq/tree/master/src/test/java/guide
5. you can run both the server and clients from within eclipse, but if
you want to run them from the command line:
Assuming that you are using eclipse, and that you placed the jar in a
“lib” folder
go to your “bin” folder and run
java -cp "../lib/*:." HWServer

java -cp "../lib/*:." HWClient

Notice the codepath setting with -cp "../lib/*:." In windows


you’ll have to replace the : with ; .
This will create a little setup that allows you to develop and experiment
with jeromq.

programming #java, #jeromq, #zeromq

Lemon
2018‑05‑19
animation #animation, #pug, #sass, #css3

This Is a Kafkian World. May 17, 2018


2018‑05‑17

Four Distributed Systems Architectural Patterns by Tim Berglund


(youtube.com)
Algorithms Behind Modern Storage Systems
(queue.acm.org)
Finland offers free online Artificial Intelligence course to anyone,
anywhere
(yle.fi)

reading #links

Take Five, Sunday, May 13


2018‑05‑13

Supercollider ‑ This could be such a great tool if it didn’t force me to


learn a new language. Not saying that it is a bad language (per Wikipedia
sclang is dynamically typed, garbage‑collected, single‑inheritance
object‑oriented and functional), it is just that right now I have my hands
(and brain) full with other things.
(supercollider.github.io)
Artificial Neural Nets Grow Brainlike Cells to Find Their Way ‑ Can’t
understand Wired use of ALL CAPS. But what do I know?
(wired.com)
How to build a Gesture Controlled Web based Game using Tensorflow
Object Detection Api
(towardsdatascience.com)
Burned out: why are so many teachers quitting or off sick with stress? ‑
One more month to go, one more month to go… :‑)
(theguardian.com)
Inbox zero and the search for the perfect email client ‑ My inbox count
is 1324 :‑( .
(arstechnica.com)

#links

Saturday, 12 May
2018‑05‑12

I Used The Web For A Day With JavaScript Turned Off ‑ Unfortunately the
web is a race between those that push stuff out and those that have to
implement them. (smashingmagazine.com)
Getting Started With The Web MIDI API ‑ It is a real pity that web Midi
isn’t well supported across browsers. (smashingmagazine.com)
Consensus Mechanisms — As Detailed and Concise as possible! ‑ Great
read on such important algorithms, informative, mainly focused on
blockchain technologies. (hackernoon.com)
“A Sloppy Machine, Like Me”: The History of Video Synthesizers
(wearethemutants.com)
What’s the difference between UX and UI design? ‑ Everywhere you need
to tick boxes, put things into small confined spaces, otherwise they’ll
bite you in the hand. (medium.freecodecamp.org)

#links
Help! Need an Index Card and Contacts Manager
Apps for OS X
2018‑02‑01

I’ve rely on physical index cards for many tasks related to managing
information, but I’d like to have the same functionality on the desktop. I
don’t want it integrated in a “brainstorming, mindmapping” package, or
in a “screenplay” software. I wanted something like a shoe box of index
cards, that I could just sort by some criterion, or group under certain
labels. Just something simple. In design making things simple is
sometimes the hardest.
My other need is about the Contacts app in OS X. As all Apple software,
Contacts is suffering from the “we don’t have time to think about OS X
software while we are stealing candy from hipsters buying iPhones”
syndrome. I really need to have some way of categorizing, cleaning, and
searching through my contacts easily. Every time I open Contacts, I’m
surprised by the number of people that I don’t know and never
contacted. I’m starting to think that the app just comes up with fake
contacts like fake twitter followers.
If you know about an app that can help me, please share it with me! I’m
avidly searching for apps to solve these two tasks.

software #contacts, #osx, #index cards

Big Data, Digitization, and the Social Change: Big


Data Ubiquity Symposium
2017‑12‑22
I’m very happy that Ubiquity just started publishing a symposium on Big
Data, where I have a humble contribution as editor and author. The
introduction statement of this symposium is available from the ACM
website.
For you to get an idea about what this simposium is all about pleasel let
me quote the paper:

The term “big data” is something of a misnomer. Every


generation of computers since the 1950s has been confronted
with problems where data was way too large for the memory and
processing power available. This seemed like an inconvenience of
the technology that would someday be resolved when the next
generation of computers came along. So what is different about
big data today? The revolution is happening at the convergence
of two trends: the expansion of the internet into billions of
computing devices, and the digitization of almost everything.
The internet gives us access to vast amounts of data. Digitization
creates digital representations for many things once thought to
be beyond the reach of computing technology. The result is an
explosion of innovation of network‑based big data applications
and the automation of cognitive tasks. This revolution is
introducing what Brynjolfsson and McAfee call the “Second
Machine Age.” This symposium will examine this revolution from
a number of angles.
Our authors will argue the big data challenge is the not technical
problem of moving the maximum amount of bits in the minimum
amount of time, but the scientific challenge of formulating
methods to represent the complex and entangled systems that
we must design and manage to run the modern world. This goes
beyond “computational analytics” that abstract statistics from
large data sets; “data mining” that discovers useful structures in
combined data streams; and “visual analytics” that display
multisource data as ingenious maps, color‑coded images, and
multidimensional videos to aid understanding and inform
decisionmaking.

Big Data is a no brainer game changer. Understanding it and more


importantly, understanding its implications for society will clear many
misconceptions around Big Data. I hope that by reading this symposium
we can contribute for some clarification of the field.
[REFERENCE:] Jeffrey Johnson, Peter Denning, David Sousa‑Rodrigues,
and Kemal A. Delic. Big data, digitization, and social change: Big data
(ubiquity symposium). Ubiquity, 2017(December):1:1–1:8,
http://doi.acm.org/10.1145/3158335 December 2017.

computer science #big data, #ubiquity, #acm, #digitization, #symposia

A Collection of Great Visuals on Sort Algorithms


2017‑10‑28

Sorting algorithms are one of those basic concepts that every CS course
has, and that act as a great pedagogic tools for teaching students about
how computers work. But many times they tend to be difficult to
visualize and explain. That’s why it is always great to find some
visualizations that are very clear and that compare several algorithm
side by side.
computer science #sort algorithms, #visualization

Next

Proudly powered by Hexo and Theme by Hacker


© 2018 David Sousa‑Rodrigues

Вам также может понравиться