20221117

Mechanical circuits

spintronics simulator: simulator.spintronics.com?linkID=1564
sim code: github.com/upperstory/spintronics-simulator

20220428

Strategic search

If we divide a circle into 360 equal angles, we end up with one degree incremental vectors in which we can look around ourselves on a planar surface. When we misplace something, we can head off in 360 different directions. If we then allow for up and down angles of equivalent size, then for the sphere surrounding us at every moment, there are 41,253 directions we can look. Given all these options, we must choose wisely.

Technically, the number of directions is computed from A=4πr² where r=360/2π. [Square degree]

20220220

Two timing twin tuplets

A rare temporally numeric occurrence is about to happen two days from now.
year:2022
month: 02
day: 22
hour: 22
minute: 22
second: 22
millisecond: 222
Almost like an astronomical event, but human made.

20210403

Window size

A simple window size reporter which runs in modern browsers (and even those back to Safari 5 and IE 6). Additionally, the browser agent string is displayed and if feasible, a simple canvas animation. Click here to launch in a new window.

20200503

Loss of image quality in Word 2007

Finally, a mystery is solved. When saving a document using Word 2007, image quality would decrease. There is an option to fix this issue and it took a long time to find it.

Compression can be disabled on a per-file basis using the following steps:
Click the Office Button, and then click Save As.
Click Tools, and then click Compress Pictures.
Click Options.
Click to clear the Automatically perform basic compression on save check box.
Click OK.
In the Compress Pictures dialog box, click Cancel.

Note: Clicking OK on this dialog will not prevent the issue from occurring.

You can also modify a registry setting to prevent basic compression from occurring by default.

For further details see:

https://docs.microsoft.com/en-us/office/troubleshoot/office/office-docuemnt-image-quality-loss

Update: Another option is to double the size of the document. For example, if targeting a size of 8.5x11, then set the document size to 17x22 and adjust margins and font size to compensate. When saving to PDF, the images will still be down-sampled to 220dpi, however, this translates to 440dpi at double the size. If printing, scale the document to 50% in the printer settings. Images will be crisp. Or...move on to libreoffice.org

20191113

Submerged!

Noi viviamo sommersi nel fondo d'un pelago d'aria. -Evangelista Torricelli

20190911

JavaScript popularity

According to the 2019 Stack Overflow survey: "For the seventh year in a row, JavaScript is the most commonly used programming language"

20190630

easeSmoother

The CSS cubic-bezier timing function creates easing curves using 4 control points.

The first and last control points are fixed at (0,0) and (1,1), while the second and third control points are passed as arguments to create a variety of easing curves.

Sometimes an "in-out" easing is needed which starts slow and ends slow. We experimented to find a curve that best approximates the smootherStep function (see here) which produces a natural acceleration similar to when we change lanes while driving on the highway or when we reach for something (see also this).

Specifying the timing function as "cubic-bezier(.49,0,.51,1)" creates the lowest error compared to the minimum-jerk reference (see code at the bottom of this article). Visualize the timing here using Lea Verou’s cubic-bezier.com (compare to ease-in-out). JSFiddle example: https://jsfiddle.net/intrinsica/9ryqet30

If a preset it created, it could be aliased as easeSmoother or easeInOutSmoother.

The green curve below is the reference min-jerk function. The purple curve is the easeSmoother cubic-bezier.



JavaScript reference (see also):

function MinJerk(t) {
  var ts = t * t, tc = ts * t;
  return 6*tc*ts - 15*ts*ts + 10*tc;
}

Alternatively:

let MinJerk = t => (6*t*t-15*t+10)*t*t*t;

Below is the L2 error curve, comparing the cubic-bezier to the reference min-jerk function.

20190106

Our 2018 list of top mobile games

In our spare time, the most played games last year were:
1. Battle Bay from Rovio (strategy guide here)
2: BitCity from NimbleBit (strategy guide here)
3. Go Round from Little White Bear Studios
4: Hackers from Trickster Arts (defensive strategies here)


20181219

SimCity 2000 running on Windows 7

SimCity 2000 runs on Windows 7 x64, but crashes when attempting to access the dialog box to save or load a city. After searching for and trying all of the suggested fixes and patches to avoid this crash, we still had no success. Crash, crash, crash!

Alas, there is a solution! Use the command line to invoke the app with a path to a city file to open. For example: "c:> simcity Saved\city.sc2" This will not only open a city, but allow saving it on exit. If a new terrain is desired, use the urban renewal kit.

20180824

p5.js vs processing.js

Explanation of the difference between p5.js and processing.js here and here and here

The history of Processing here

20180710

BlackScript

Valuable technique in JavaScript class coding: link

The following benchmarks indicate a performance improvement for bulk object creation.
Try this in your own browser here

Update 2025.0106: Ex Nihilo wins in jsbench.me tests on Chrome 131 [left] and Firefox 133 [right]:



Update 2023.0119: Ex Nihilo wins in jsbench.me tests on Chrome 109 and Firefox 109:

Chrome 109

Firefox 109



Older benchmarks follow for archival reference:

A benchmark.js test running on node.js:
________________________________________________________
Research>node --version
v10.16.3

Research>node bench.js
OldStyleClass x 165,772 ops/sec ±0.38% (106 runs sampled)
Ex Nihilo x 180,305 ops/sec ±0.50% (104 runs sampled)
Fastest is Ex Nihilo

Research>node bench.js
NewStyleClass x 163,242 ops/sec ±0.28% (111 runs sampled)
Ex Nihilo x 180,219 ops/sec ±0.46% (100 runs sampled)
Fastest is Ex Nihilo

Research>node bench.js
OldStyleClass x 160,930 ops/sec ±0.58% (103 runs sampled)
NewStyleClass x 161,634 ops/sec ±0.79% (105 runs sampled)
Ex Nihilo x 176,387 ops/sec ±0.44% (107 runs sampled)
Fastest is Ex Nihilo

Older runs on jsperf.com:




Update 20200627: None of the newer versions of the browsers run Ex Nihilo faster. Optimization wins!

Update 20201006: Additional server-side tests:
________________________________________________________
Research>node --version
v12.19.0

Research>node bench.js
OldStyleClass x 153,207 ops/sec ±0.95% (84 runs sampled)
NewStyleClass x 150,535 ops/sec ±0.32% (93 runs sampled)
Ex Nihilo x 166,850 ops/sec ±1.84% (91 runs sampled)
Fastest is Ex Nihilo

________________________________________________________
Research>node --version
v13.14.0

Research>node bench.js
OldStyleClass x 151,339 ops/sec ±0.76% (86 runs sampled)
NewStyleClass x 147,369 ops/sec ±0.27% (95 runs sampled)
Ex Nihilo x 164,624 ops/sec ±0.26% (93 runs sampled)
Fastest is Ex Nihilo

________________________________________________________
Research>node --version
v14.13.0

Research>node bench.js
OldStyleClass x 147,954 ops/sec ±1.03% (87 runs sampled)
NewStyleClass x 144,716 ops/sec ±0.37% (93 runs sampled)
Ex Nihilo x 160,388 ops/sec ±0.47% (89 runs sampled)
Fastest is Ex Nihilo

20161107

Faster hypot for JavaScript

When the distance between two points is required, one method of computation in modern browsers is a function called Hypot. Implementation of this function is often not optimized and ultimately calls on Math.sqrt at the last step. Performance tests indicate a calculation bottleneck with JavaScript's standard Math library implementation. Here then is an improvement of hypot at the cost of a fractional error (0.05%):

  function hypot(x, y) { // expects: abs(x) and abs(y)
    var a = Math.max(x,y),
        b = Math.min(x,y)/a,
        c = 1 + b*b;
    return a * ((-0.0705613450914645*c + 0.624084374908536)*c + 0.447383574908535);
  }

Note, this function expects absolute values (which can be computed on the call). The formula in the return is a polynomial approximation of the square root of values in the range from 1 to 2. Caveat: your mileage may vary!

20161102

Neural Network in 12 lines of JavaScript

Inspired by Andrew Trask's article about coding a neural network in 11 lines of Python, I wondered if this could be accomplished as succinctly in JavaScript. Part of the brevity of the Python solution is the use of a common numeric library called Numpy which helps manipulate matrix mathematics. For something comparable, I rolled my own JavaScript matrix library to assist with some of the notation and computation. The implementation converges quickly on the XOR solution as represented by the box moving toward the outlined target. Explore the solution on the newly revamped OpenProcessing website and embedded here:
20161112 Update: Just noticed this similar implementation.

20160306

Sphiral Minima

1000 dots perform a coordinated dance. How many combinations could there be? It's surprising! Tap/click to advance along the time continuum (the x value is added to the timeline, so clicking near the left side advances more slowly than clicking near the right side)...amazing harmonic patterns await. WARNING: there is a naturally occurring stroboscopic effect at times. This sketch is a reduction of http://hakim.se/experiments/html5/sphere.

20150702

BlueStacks memory allocation

Unfortunately, BlueStacks tends to use a lot of memory and then forgets to cover its tracks resulting in memory bloat and starvation of other tasks. To free up memory, after closing BlueStacks, go into Windows Task Manager and on the Services tab, shut down the following:

BstHdAndroidSvc
BstHdLogRotatorSvc
BstHdUpdaterSvc

Then, on the Processes tab, right-click on the entry HD-Agent.exe and select "End Process".

On my system, this frees up 1.8GB of memory.

20150328

Gameforge: War-Game Strategy Guide

The following advice/opinion is primarily for War Game (present level 216), but also applies somewhat to Knight Game.

Reinvest collected hourly payments and objective earnings into income production. Spend attribute points primarily on attack offensive strength and secondarily on oil(fortitude) - this helps perform assignments(quests). An assignment in Fireland requires 95 oil while later, in Hawaii, an alliance size of 973.

Realize that these games are not continuous play...after depleting resources on objectives, attack opponents, build up income production and then set the game aside. Opponents take 8% per successful attack and can be repeated several times until health is below 24.

Sometimes a higher level player attacks unprovoked. If this happens, check to be sure the opponent is not in the alliance(order). Remove the player if they are poaching.

Each player's country flag is displayed. It might be advantageous to attack an opponent during their sleep cycles.

At some levels/ranks and alliance/clan size combinations, some or all opponents may be artificial players with random names. Watch for player profiles where the number of assignments(quests) and battles(duels) won/lost are displayed as a dash (-). Also, there is no comment tab on these players. These opponents are dynamically generated for an even match up and often yield little rewards. They can be useful to bring health down below 24.

One major difference in Knight Game, is the lack of dedicated defense objects. Instead, this function is performed by Vassals, which also produce income. Tip: buy as many Beggars as possible. ALL of them are used in duels.

Additional links:
http://mafiagameapp.blogspot.com
http://www.gamefaqs.com/boards/669052-war-game/64582658
http://www.gamefaqs.com/boards/669052-war-game/64582709

20150327

Facebook video problems

Running Facebook in the latest Chrome browser, we encountered some Flash video stuttering or choppiness during playback. To fix, see https://forums.adobe.com/thread/891337 and turn off hardware acceleration for Flash. Leave hardware acceleration enabled in Chrome.

KVR News:

The Gadget Blog | Latest Gadgets, Technology